diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2015-04-07 01:22:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-08 01:45:33 +0300 |
commit | 721514222db13498613706709409c21c105e0f4a (patch) | |
tree | dfca6e70440efd1db7f40d92196fbd4924a8f4c8 /drivers/net/hyperv/netvsc_drv.c | |
parent | 0d158852a8089099a6959ae235b20f230871982f (diff) | |
download | linux-721514222db13498613706709409c21c105e0f4a.tar.xz |
hv_netvsc: Define a macro RNDIS_AND_PPI_SIZE
The sum of RNDIS msg and PPI struct sizes is used in multiple places, so we define
a macro for them.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f9db6bc513e9..73f8fba62a52 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -401,10 +401,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) return NETDEV_TX_OK; } - pkt_sz = sizeof(struct hv_netvsc_packet) + - sizeof(struct rndis_message) + - NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE + - NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE; + pkt_sz = sizeof(struct hv_netvsc_packet) + RNDIS_AND_PPI_SIZE; if (head_room < pkt_sz) { packet = kmalloc(pkt_sz, GFP_ATOMIC); @@ -436,11 +433,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) packet->rndis_msg = (struct rndis_message *)((unsigned long)packet + sizeof(struct hv_netvsc_packet)); - memset(packet->rndis_msg, 0, sizeof(struct rndis_message) + - NDIS_VLAN_PPI_SIZE + - NDIS_CSUM_PPI_SIZE + - NDIS_LSO_PPI_SIZE + - NDIS_HASH_PPI_SIZE); + memset(packet->rndis_msg, 0, RNDIS_AND_PPI_SIZE); /* Set the completion routine */ packet->send_completion = netvsc_xmit_completion; @@ -872,9 +865,7 @@ static int netvsc_probe(struct hv_device *dev, return -ENOMEM; max_needed_headroom = sizeof(struct hv_netvsc_packet) + - sizeof(struct rndis_message) + - NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE + - NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE; + RNDIS_AND_PPI_SIZE; netif_carrier_off(net); |