Commit Graph

28 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 46a9719136 Staging: hv: move hyperv code out of staging directory
After many years wandering the desert, it is finally time for the
Microsoft HyperV code to move out of the staging directory.  Or at least
the core hyperv bus code, and the utility driver, the rest still have
some review to get through by the various subsystem maintainers.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
2011-10-10 22:52:55 -06:00
K. Y. Srinivasan 2ddd5e5fb3 Staging: hv: netvsc: Get rid of the usage of the ext field in struct hv_device
Now, eliminate the usage of ext field in struct  hv_device for netvsc driver.
We do this by registering pointer to struct netvsc_device as the driver
specific data and eliminating the current usage of driver specific data
to save and retrieve the pointer to struct net_device.
Additionally, all access to the driver specific data is through
the vmbus wrapper functions. As part of this cleanup, we also get rid
of some unnecessary debug print statements.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-16 20:06:03 +02:00
K. Y. Srinivasan 9d88f33a15 Staging: hv: netvsc: Get rid of the refcnt field in struct netvsc_device
Get rid of the refcnt field in struct netvsc_device. We implement the following
logic to manage the life cycle of the device: If the device is being destroyed,
we do not allow any outgoing traffic. Furthermore, if the device is being
destroyed, we allow incoming traffic only to drain outgoing traffic. Note that
the driver may send some book keeping messages to the host not known to
upper level Linux code.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:01:05 -07:00
K. Y. Srinivasan c38b9c7118 Staging: hv: netvsc: Introduce state to manage the lifecycle of net device
Introduce state to manage the lifecycle of net device.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:01:04 -07:00
Greg Kroah-Hartman 768fa21919 Staging: hv: fix up driver registering mess
Individual drivers should never be touching the 'struct device' field,
so if that is a requirement to pass to the vmbus core, you know
something is wrong.

This patch fixes that all up, and resolves the problem where the module
reference counting was not happening properly for the individual drivers
as well.  Overall, it reduces the lines of code the individual drivers
have to have, which tells you that this is the correct thing to do.

Also, somehow the _GPL marking for the functions got removed on an older
patch.  As the name of the function was changing, properly change the
_GPL marking as well at the same time.

Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-25 15:07:32 -07:00
Haiyang Zhang a5923f5689 staging: hv: remove netvsc send buffer and related functions
netvsc send buffer is not used, so remove it.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:39:23 -07:00
Haiyang Zhang bdbad576d5 staging: hv: fix typo in name rndis_filte_device_add()
rename rndis_filte_device_add to rndis_filter_device_add

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:36:01 -07:00
Haiyang Zhang df06bcff81 staging: hv: change rndis_filter_device_remove() to void return type
rndis_filter_device_remove() always return 0, so change it to void return
type. Also cleaned up the error checking in the caller.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:36:00 -07:00
K. Y. Srinivasan 770cbb589b Staging: hv: netvsc_drv: Get rid of the used type struct netvsc_driver
Now, get rid of the unused type  struct netvsc_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:55 -07:00
K. Y. Srinivasan d00717301b Staging: hv: netvsc_drv: Get rid of the unused function drv_to_netvscdrv()
Get rid of the unused function drv_to_netvscdrv().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:54 -07:00
K. Y. Srinivasan 10ffe98cdc Staging: hv: netvsc_drv: Get rid of the empty function rndis_filter_init()
Get rid of the empty function rndis_filter_init().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:54 -07:00
K. Y. Srinivasan 4e3cba6b4c Staging: hv: netvsc_drv: Get rid of the unnecessary state from struct netvsc_driver
Now get rid of unused state (ring_buf_size) from struct netvsc_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:52 -07:00
K. Y. Srinivasan 78001df39c Staging: hv: netvsc_drv: Add ring_size element to struct netvsc_device_info
Add ring_size element to struct netvsc_device_info.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:50 -07:00
K. Y. Srinivasan 8afe583d21 Staging: hv: netvsc_drv: Get rid of unused state in struct netvsc_driver
Now, get rid of unused state (req_ext_size) from struct netvsc_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:49 -07:00
K. Y. Srinivasan 9dbfd1509e Staging: hv: netvsc_drv: Move the definition of struct rndis_filter_packet to hyperv_net.h
Move the definition of struct rndis_filter_packet to hyperv_net.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:28:47 -07:00
K. Y. Srinivasan e3f8a80efb Staging: hv: netvsc_drv: Get rid of unnecessary state in struct netvsc_driver
Since the function pointers in struct netvsc_driver are no longer used
(as these are invoked directly), get rid of this unused state.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:18 -07:00
K. Y. Srinivasan 0652aebc5a Staging: hv: netvsc_drv: Make the function rndis_filter_send() non-static
In preparation to getting rid of struct netvsc_driver,
make the function  rndis_filter_send()  non-static.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:14 -07:00
K. Y. Srinivasan 5fcc411519 Staging: hv: netvsc_drv: Make the function rndis_filter_receive() non-static
In preparation to getting rid of struct netvsc_driver,
make the function rndis_filter_receive()  non-static.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:14 -07:00
K. Y. Srinivasan f79adf8f13 Staging: hv: netvsc_drv: Make the function netvsc_recv_callback() non-static
In preparation to getting rid of struct netvsc_driver,
make the function netvsc_recv_callback()  non-static.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:13 -07:00
K. Y. Srinivasan 90ef117a30 Staging: hv: netvsc_drv: Make the function netvsc_linkstatus_callback() non-static
In preparation to getting rid of struct netvsc_driver,
make the function netvsc_linkstatus_callback()  non-static.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:13 -07:00
K. Y. Srinivasan f9819f05f2 Staging: hv: netvsc_drv: Make the function netvsc_send non-static
In preparation to getting rid of struct netvsc_driver,
make the function netvsc_send non-static.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:12 -07:00
K. Y. Srinivasan a76c36bc0d Staging: hv: netvsc_drv: Get rid of unused state in struct netvsc_driver
In preparation to getting rid of struct netvsc_driver, get rid of the
unused state (void *ctx)  in struct netvsc_driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:11 -07:00
K. Y. Srinivasan 8a0794117b Staging: hv: netvsc: Cleanup hyperv_net.h
Cleanup hyperv_net.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:08 -07:00
K. Y. Srinivasan 299d0925e2 Staging: hv: netvsc: Move the contents of rndis_filter.h to hyperv_net.h
Move the contents of rndis_filter.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:08 -07:00
K. Y. Srinivasan 4a5cea3951 Staging: hv: netvsc: Move the contents of rndis.h to hyperv_net.h
Move the contents of rndis.h to hyperv_net.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:08 -07:00
K. Y. Srinivasan 5258490472 Staging: hv: netvsc: Move the contents of netvsc.h to hyperv_net.h
Move the contents of netvsc.h to hyperv_net.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:07 -07:00
K. Y. Srinivasan 41308862d1 Staging: hv: netvsc: Include the contents of netvsc_api.h into hyperv_net.h
Include the contents of netvsc_api.h into hyperv_net.h.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:07 -07:00
K. Y. Srinivasan 5ca7252a7e Staging: hv: netvsc: Create a common header file for network driver
Create a common header file for network driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 12:27:06 -07:00