aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-19 18:27:07 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:23 -0400
commitc1a4b86e396b6870b420d23e4d49c7b685aef0a4 (patch)
tree5b5377d1aba8bb5f525833c21a50e06a4f8279a1
parent7c81fd8bfbaa9732eca142350de5154da6919411 (diff)
[TR]: Use tr_hdr() were appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/tokenring/lanstreamer.c6
-rw-r--r--drivers/net/tokenring/olympic.c9
-rw-r--r--drivers/s390/net/qeth_main.c2
-rw-r--r--net/802/tr.c3
4 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index e999feb8c0bb..5e1b884e10c1 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -1607,10 +1607,12 @@ static void streamer_arb_cmd(struct net_device *dev)
1607 frame_data, buffer_len); 1607 frame_data, buffer_len);
1608 } while (next_ptr && (buff_off = next_ptr)); 1608 } while (next_ptr && (buff_off = next_ptr));
1609 1609
1610 mac_frame->dev = dev;
1611 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1610#if STREAMER_NETWORK_MONITOR 1612#if STREAMER_NETWORK_MONITOR
1611 printk(KERN_WARNING "%s: Received MAC Frame, details: \n", 1613 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",
1612 dev->name); 1614 dev->name);
1613 mac_hdr = (struct trh_hdr *) mac_frame->data; 1615 mac_hdr = tr_hdr(mac_frame);
1614 printk(KERN_WARNING 1616 printk(KERN_WARNING
1615 "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", 1617 "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n",
1616 dev->name, mac_hdr->daddr[0], mac_hdr->daddr[1], 1618 dev->name, mac_hdr->daddr[0], mac_hdr->daddr[1],
@@ -1622,8 +1624,6 @@ static void streamer_arb_cmd(struct net_device *dev)
1622 mac_hdr->saddr[2], mac_hdr->saddr[3], 1624 mac_hdr->saddr[2], mac_hdr->saddr[3],
1623 mac_hdr->saddr[4], mac_hdr->saddr[5]); 1625 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1624#endif 1626#endif
1625 mac_frame->dev = dev;
1626 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1627 netif_rx(mac_frame); 1627 netif_rx(mac_frame);
1628 1628
1629 /* Now tell the card we have dealt with the received frame */ 1629 /* Now tell the card we have dealt with the received frame */
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 8f4ecc1109cb..683186afcab0 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -1440,16 +1440,17 @@ static void olympic_arb_cmd(struct net_device *dev)
1440 next_ptr=readw(buf_ptr+offsetof(struct mac_receive_buffer,next)); 1440 next_ptr=readw(buf_ptr+offsetof(struct mac_receive_buffer,next));
1441 } while (next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr))); 1441 } while (next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr)));
1442 1442
1443 mac_frame->dev = dev;
1444 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1445
1443 if (olympic_priv->olympic_network_monitor) { 1446 if (olympic_priv->olympic_network_monitor) {
1444 struct trh_hdr *mac_hdr ; 1447 struct trh_hdr *mac_hdr ;
1445 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name) ; 1448 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name) ;
1446 mac_hdr = (struct trh_hdr *)mac_frame->data ; 1449 mac_hdr = tr_hdr(mac_frame);
1447 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->daddr[0], mac_hdr->daddr[1], mac_hdr->daddr[2], mac_hdr->daddr[3], mac_hdr->daddr[4], mac_hdr->daddr[5]) ; 1450 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->daddr[0], mac_hdr->daddr[1], mac_hdr->daddr[2], mac_hdr->daddr[3], mac_hdr->daddr[4], mac_hdr->daddr[5]) ;
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->saddr[0], mac_hdr->saddr[1], mac_hdr->saddr[2], mac_hdr->saddr[3], mac_hdr->saddr[4], mac_hdr->saddr[5]) ; 1451 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->saddr[0], mac_hdr->saddr[1], mac_hdr->saddr[2], mac_hdr->saddr[3], mac_hdr->saddr[4], mac_hdr->saddr[5]) ;
1449 } 1452 }
1450 mac_frame->dev = dev ; 1453 netif_rx(mac_frame);
1451 mac_frame->protocol = tr_type_trans(mac_frame,dev);
1452 netif_rx(mac_frame) ;
1453 dev->last_rx = jiffies; 1454 dev->last_rx = jiffies;
1454 1455
1455drop_frame: 1456drop_frame:
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index d8a86f5af379..f2b9b1b1ec10 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -2308,7 +2308,7 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
2308 QETH_DBF_TEXT(trace,5,"skbfktr"); 2308 QETH_DBF_TEXT(trace,5,"skbfktr");
2309 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR; 2309 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR;
2310 /* this is a fake ethernet header */ 2310 /* this is a fake ethernet header */
2311 fake_hdr = (struct trh_hdr *) skb->mac.raw; 2311 fake_hdr = tr_hdr(skb);
2312 2312
2313 /* the destination MAC address */ 2313 /* the destination MAC address */
2314 switch (skb->pkt_type){ 2314 switch (skb->pkt_type){
diff --git a/net/802/tr.c b/net/802/tr.c
index 96bd14452c55..a6a6d46e708c 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -189,11 +189,12 @@ static int tr_rebuild_header(struct sk_buff *skb)
189__be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev) 189__be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
190{ 190{
191 191
192 struct trh_hdr *trh=(struct trh_hdr *)skb->data; 192 struct trh_hdr *trh;
193 struct trllc *trllc; 193 struct trllc *trllc;
194 unsigned riflen=0; 194 unsigned riflen=0;
195 195
196 skb->mac.raw = skb->data; 196 skb->mac.raw = skb->data;
197 trh = tr_hdr(skb);
197 198
198 if(trh->saddr[0] & TR_RII) 199 if(trh->saddr[0] & TR_RII)
199 riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; 200 riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;