Skip to content

Commit

Permalink
Staging: hv: Introduce a function to map a generic driver pointer to …
Browse files Browse the repository at this point in the history
…a pointer to struct netvsc_driver

In preparation for getting rid of the priv element from struct hv_driver,
introduce a function to map a generic driver pointer to a pointer to
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>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Apr 26, 2011
1 parent c2e138a commit 9f83886
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/staging/hv/netvsc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define _NETVSC_API_H_

#include "vmbus_api.h"
#include "vmbus.h"

/* Fwd declaration */
struct hv_netvsc_packet;
Expand Down Expand Up @@ -103,6 +104,13 @@ struct netvsc_driver {
void *ctx;
};

static inline
struct netvsc_driver *drv_to_netvscdrv(struct device_driver *d)
{
struct hv_driver *hvdrv = drv_to_hv_drv(d);
return container_of(hvdrv, struct netvsc_driver, base);
}

struct netvsc_device_info {
unsigned char mac_adr[6];
bool link_state; /* 0 - link up, 1 - link down */
Expand Down

0 comments on commit 9f83886

Please sign in to comment.