diff options
-rw-r--r-- | drivers/hv/channel_mgmt.c | 11 | ||||
-rw-r--r-- | include/linux/hyperv.h | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 60ca25b93b4c..76864c98a110 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c | |||
@@ -741,6 +741,10 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr) | |||
741 | spin_unlock_irqrestore(&channel->lock, flags); | 741 | spin_unlock_irqrestore(&channel->lock, flags); |
742 | 742 | ||
743 | if (channel->device_obj) { | 743 | if (channel->device_obj) { |
744 | if (channel->chn_rescind_callback) { | ||
745 | channel->chn_rescind_callback(channel); | ||
746 | return; | ||
747 | } | ||
744 | /* | 748 | /* |
745 | * We will have to unregister this device from the | 749 | * We will have to unregister this device from the |
746 | * driver core. | 750 | * driver core. |
@@ -1110,3 +1114,10 @@ bool vmbus_are_subchannels_present(struct vmbus_channel *primary) | |||
1110 | return ret; | 1114 | return ret; |
1111 | } | 1115 | } |
1112 | EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present); | 1116 | EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present); |
1117 | |||
1118 | void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel, | ||
1119 | void (*chn_rescind_cb)(struct vmbus_channel *)) | ||
1120 | { | ||
1121 | channel->chn_rescind_callback = chn_rescind_cb; | ||
1122 | } | ||
1123 | EXPORT_SYMBOL_GPL(vmbus_set_chn_rescind_callback); | ||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index f636f91f104b..2e54e34e5feb 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -766,6 +766,12 @@ struct vmbus_channel { | |||
766 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); | 766 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); |
767 | 767 | ||
768 | /* | 768 | /* |
769 | * Channel rescind callback. Some channels (the hvsock ones), need to | ||
770 | * register a callback which is invoked in vmbus_onoffer_rescind(). | ||
771 | */ | ||
772 | void (*chn_rescind_callback)(struct vmbus_channel *channel); | ||
773 | |||
774 | /* | ||
769 | * The spinlock to protect the structure. It is being used to protect | 775 | * The spinlock to protect the structure. It is being used to protect |
770 | * test-and-set access to various attributes of the structure as well | 776 | * test-and-set access to various attributes of the structure as well |
771 | * as all sc_list operations. | 777 | * as all sc_list operations. |
@@ -851,6 +857,9 @@ int vmbus_request_offers(void); | |||
851 | void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel, | 857 | void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel, |
852 | void (*sc_cr_cb)(struct vmbus_channel *new_sc)); | 858 | void (*sc_cr_cb)(struct vmbus_channel *new_sc)); |
853 | 859 | ||
860 | void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel, | ||
861 | void (*chn_rescind_cb)(struct vmbus_channel *)); | ||
862 | |||
854 | /* | 863 | /* |
855 | * Retrieve the (sub) channel on which to send an outgoing request. | 864 | * Retrieve the (sub) channel on which to send an outgoing request. |
856 | * When a primary channel has multiple sub-channels, we choose a | 865 | * When a primary channel has multiple sub-channels, we choose a |