hv_netvsc: introduce {net, hv}_device_to_netvsc_device() helpers

Make it easier to get 'struct netvsc_device' from 'struct net_device' and
'struct hv_device' by introducing inline helpers.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vitaly Kuznetsov
2016-06-03 17:50:59 +02:00
committed by David S. Miller
parent 4baa994dc9
commit 2625466d6d
3 changed files with 22 additions and 25 deletions

View File

@@ -743,6 +743,18 @@ struct netvsc_device {
atomic_t vf_use_cnt;
};
static inline struct netvsc_device *
net_device_to_netvsc_device(struct net_device *ndev)
{
return ((struct net_device_context *)netdev_priv(ndev))->nvdev;
}
static inline struct netvsc_device *
hv_device_to_netvsc_device(struct hv_device *device)
{
return net_device_to_netvsc_device(hv_get_drvdata(device));
}
/* NdisInitialize message */
struct rndis_initialize_request {
u32 req_id;