Commit 9f838864 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Introduce a function to map a generic driver pointer to a pointer...

Staging: hv: Introduce a function to map a generic driver pointer to 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: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c2e138a6
......@@ -26,6 +26,7 @@
#define _NETVSC_API_H_
#include "vmbus_api.h"
#include "vmbus.h"
/* Fwd declaration */
struct hv_netvsc_packet;
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment