diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2016-06-03 18:50:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-06 06:16:35 +0300 |
commit | 2625466d6d92f056da970bee990c862c54188819 (patch) | |
tree | d250c8b295c13dd09bc290344faf00ec2ba6897b /drivers/net/hyperv/hyperv_net.h | |
parent | 4baa994dc93287321c1b712d98cb6f721652891b (diff) | |
download | linux-2625466d6d92f056da970bee990c862c54188819.tar.xz |
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>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index c270c5a54f3a..952cbc860676 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -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; |