aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-01-19 17:03:07 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-20 23:16:03 -0500
commit825863408a1670035e7105368cbfe8b126290ba1 (patch)
tree98e80bdc9c2e41e00f926ee8a80ffb5837243f5d /drivers/firewire
parentb577d7e2ad50cfbf43b648e34128a5c231cc5236 (diff)
firewire net: Use LL_RESERVED_SPACE(), HH_DATA_OFF().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/net.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index df6a1caea7b6..2b27bff2591a 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -270,7 +270,7 @@ static int fwnet_header_cache(const struct neighbour *neigh,
270 if (type == cpu_to_be16(ETH_P_802_3)) 270 if (type == cpu_to_be16(ETH_P_802_3))
271 return -1; 271 return -1;
272 net = neigh->dev; 272 net = neigh->dev;
273 h = (struct fwnet_header *)((u8 *)hh->hh_data + 16 - sizeof(*h)); 273 h = (struct fwnet_header *)((u8 *)hh->hh_data + HH_DATA_OFF(sizeof(*h)));
274 h->h_proto = type; 274 h->h_proto = type;
275 memcpy(h->h_dest, neigh->ha, net->addr_len); 275 memcpy(h->h_dest, neigh->ha, net->addr_len);
276 hh->hh_len = FWNET_HLEN; 276 hh->hh_len = FWNET_HLEN;
@@ -282,7 +282,7 @@ static int fwnet_header_cache(const struct neighbour *neigh,
282static void fwnet_header_cache_update(struct hh_cache *hh, 282static void fwnet_header_cache_update(struct hh_cache *hh,
283 const struct net_device *net, const unsigned char *haddr) 283 const struct net_device *net, const unsigned char *haddr)
284{ 284{
285 memcpy((u8 *)hh->hh_data + 16 - FWNET_HLEN, haddr, net->addr_len); 285 memcpy((u8 *)hh->hh_data + HH_DATA_OFF(FWNET_HLEN), haddr, net->addr_len);
286} 286}
287 287
288static int fwnet_header_parse(const struct sk_buff *skb, unsigned char *haddr) 288static int fwnet_header_parse(const struct sk_buff *skb, unsigned char *haddr)
@@ -398,11 +398,11 @@ static struct fwnet_partial_datagram *fwnet_pd_new(struct net_device *net,
398 398
399 new->datagram_label = datagram_label; 399 new->datagram_label = datagram_label;
400 new->datagram_size = dg_size; 400 new->datagram_size = dg_size;
401 new->skb = dev_alloc_skb(dg_size + net->hard_header_len + 15); 401 new->skb = dev_alloc_skb(dg_size + LL_RESERVED_SPACE(net));
402 if (new->skb == NULL) 402 if (new->skb == NULL)
403 goto fail_w_fi; 403 goto fail_w_fi;
404 404
405 skb_reserve(new->skb, (net->hard_header_len + 15) & ~15); 405 skb_reserve(new->skb, LL_RESERVED_SPACE(net));
406 new->pbuf = skb_put(new->skb, dg_size); 406 new->pbuf = skb_put(new->skb, dg_size);
407 memcpy(new->pbuf + frag_off, frag_buf, frag_len); 407 memcpy(new->pbuf + frag_off, frag_buf, frag_len);
408 list_add_tail(&new->pd_link, &peer->pd_list); 408 list_add_tail(&new->pd_link, &peer->pd_list);
@@ -690,14 +690,14 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
690 buf++; 690 buf++;
691 len -= RFC2374_UNFRAG_HDR_SIZE; 691 len -= RFC2374_UNFRAG_HDR_SIZE;
692 692
693 skb = dev_alloc_skb(len + net->hard_header_len + 15); 693 skb = dev_alloc_skb(len + LL_RESERVED_SPACE(net));
694 if (unlikely(!skb)) { 694 if (unlikely(!skb)) {
695 dev_err(&net->dev, "out of memory\n"); 695 dev_err(&net->dev, "out of memory\n");
696 net->stats.rx_dropped++; 696 net->stats.rx_dropped++;
697 697
698 return -ENOMEM; 698 return -ENOMEM;
699 } 699 }
700 skb_reserve(skb, (net->hard_header_len + 15) & ~15); 700 skb_reserve(skb, LL_RESERVED_SPACE(net));
701 memcpy(skb_put(skb, len), buf, len); 701 memcpy(skb_put(skb, len), buf, len);
702 702
703 return fwnet_finish_incoming_packet(net, skb, source_node_id, 703 return fwnet_finish_incoming_packet(net, skb, source_node_id,