summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/netvsc_drv.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan2011-03-07 22:35:48 +0100
committerGreg Kroah-Hartman2011-03-07 23:22:31 +0100
commit6bad88dac0e648c6978a02c6afb0dc2f4fa484bb (patch)
treed72ee69bd83396835a0052a3239be7a4f5631a5e /drivers/staging/hv/netvsc_drv.c
parentStaging: hv: Eliminate device_id from vm_device (diff)
downloadkernel-qcow2-linux-6bad88dac0e648c6978a02c6afb0dc2f4fa484bb.tar.gz
kernel-qcow2-linux-6bad88dac0e648c6978a02c6afb0dc2f4fa484bb.tar.xz
kernel-qcow2-linux-6bad88dac0e648c6978a02c6afb0dc2f4fa484bb.zip
Staging: hv: Remove the vm_device structure
Consolidate all device related state in struct hv_device by moving the device field from struct vm_device to struct hv_device. As part of this, also get rid of struct vm_device since the consolidation is complete. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/netvsc_drv.c')
-rw-r--r--drivers/staging/hv/netvsc_drv.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index f0d258cc5839..2d40f5f86b24 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -44,7 +44,7 @@
struct net_device_context {
/* point back to our device context */
- struct vm_device *device_ctx;
+ struct hv_device *device_ctx;
unsigned long avail;
};
@@ -70,7 +70,7 @@ static void netvsc_set_multicast_list(struct net_device *net)
static int netvsc_open(struct net_device *net)
{
struct net_device_context *net_device_ctx = netdev_priv(net);
- struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
+ struct hv_device *device_obj = net_device_ctx->device_ctx;
int ret = 0;
if (netif_carrier_ok(net)) {
@@ -93,7 +93,7 @@ static int netvsc_open(struct net_device *net)
static int netvsc_close(struct net_device *net)
{
struct net_device_context *net_device_ctx = netdev_priv(net);
- struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
+ struct hv_device *device_obj = net_device_ctx->device_ctx;
int ret;
netif_stop_queue(net);
@@ -190,7 +190,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
packet->completion.send.send_completion_ctx = packet;
packet->completion.send.send_completion_tid = (unsigned long)skb;
- ret = net_drv_obj->send(&net_device_ctx->device_ctx->device_obj,
+ ret = net_drv_obj->send(net_device_ctx->device_ctx,
packet);
if (ret == 0) {
net->stats.tx_bytes += skb->len;
@@ -218,8 +218,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
static void netvsc_linkstatus_callback(struct hv_device *device_obj,
unsigned int status)
{
- struct vm_device *device_ctx = to_vm_device(device_obj);
- struct net_device *net = dev_get_drvdata(&device_ctx->device);
+ struct net_device *net = dev_get_drvdata(&device_obj->device);
if (!net) {
DPRINT_ERR(NETVSC_DRV, "got link status but net device "
@@ -244,8 +243,7 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
static int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet)
{
- struct vm_device *device_ctx = to_vm_device(device_obj);
- struct net_device *net = dev_get_drvdata(&device_ctx->device);
+ struct net_device *net = dev_get_drvdata(&device_obj->device);
struct sk_buff *skb;
void *data;
int i;
@@ -335,8 +333,7 @@ static int netvsc_probe(struct device *device)
struct hv_driver *drv =
drv_to_hv_drv(device->driver);
struct netvsc_driver *net_drv_obj = drv->priv;
- struct vm_device *device_ctx = device_to_vm_device(device);
- struct hv_device *device_obj = &device_ctx->device_obj;
+ struct hv_device *device_obj = device_to_hv_device(device);
struct net_device *net = NULL;
struct net_device_context *net_device_ctx;
struct netvsc_device_info device_info;
@@ -353,7 +350,7 @@ static int netvsc_probe(struct device *device)
netif_carrier_off(net);
net_device_ctx = netdev_priv(net);
- net_device_ctx->device_ctx = device_ctx;
+ net_device_ctx->device_ctx = device_obj;
net_device_ctx->avail = ring_size;
dev_set_drvdata(device, net);
@@ -405,9 +402,8 @@ static int netvsc_remove(struct device *device)
struct hv_driver *drv =
drv_to_hv_drv(device->driver);
struct netvsc_driver *net_drv_obj = drv->priv;
- struct vm_device *device_ctx = device_to_vm_device(device);
- struct net_device *net = dev_get_drvdata(&device_ctx->device);
- struct hv_device *device_obj = &device_ctx->device_obj;
+ struct hv_device *device_obj = device_to_hv_device(device);
+ struct net_device *net = dev_get_drvdata(&device_obj->device);
int ret;
if (net == NULL) {