]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[TR]: Use tr_hdr() were appropriate
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 19 Mar 2007 22:27:07 +0000 (15:27 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:24:23 +0000 (22:24 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tokenring/lanstreamer.c
drivers/net/tokenring/olympic.c
drivers/s390/net/qeth_main.c
net/802/tr.c

index e999feb8c0bbe15777955415691a838d6e0978c8..5e1b884e10c10b8653c4a940e43872bd30a047e5 100644 (file)
@@ -1607,10 +1607,12 @@ static void streamer_arb_cmd(struct net_device *dev)
                                      frame_data, buffer_len);
                } while (next_ptr && (buff_off = next_ptr));
 
+               mac_frame->dev = dev;
+               mac_frame->protocol = tr_type_trans(mac_frame, dev);
 #if STREAMER_NETWORK_MONITOR
                printk(KERN_WARNING "%s: Received MAC Frame, details: \n",
                       dev->name);
-               mac_hdr = (struct trh_hdr *) mac_frame->data;
+               mac_hdr = tr_hdr(mac_frame);
                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],
@@ -1622,8 +1624,6 @@ static void streamer_arb_cmd(struct net_device *dev)
                       mac_hdr->saddr[2], mac_hdr->saddr[3],
                       mac_hdr->saddr[4], mac_hdr->saddr[5]);
 #endif
-               mac_frame->dev = dev;
-               mac_frame->protocol = tr_type_trans(mac_frame, dev);
                netif_rx(mac_frame);
 
                /* Now tell the card we have dealt with the received frame */
index 8f4ecc1109cb6b7e4eb4741a283183c34463aecb..683186afcab0e8728835a7dae0b9e07807516104 100644 (file)
@@ -1440,16 +1440,17 @@ static void olympic_arb_cmd(struct net_device *dev)
                        next_ptr=readw(buf_ptr+offsetof(struct mac_receive_buffer,next)); 
                } while (next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr)));
 
+               mac_frame->dev = dev;
+               mac_frame->protocol = tr_type_trans(mac_frame, dev);
+
                if (olympic_priv->olympic_network_monitor) { 
                        struct trh_hdr *mac_hdr ; 
                        printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name) ;
-                       mac_hdr = (struct trh_hdr *)mac_frame->data ; 
+                       mac_hdr = tr_hdr(mac_frame);
                        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]) ; 
                        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]) ; 
                }
-               mac_frame->dev = dev ; 
-               mac_frame->protocol = tr_type_trans(mac_frame,dev);
-               netif_rx(mac_frame) ;   
+               netif_rx(mac_frame);
                dev->last_rx = jiffies;
 
 drop_frame:
index d8a86f5af379fe3d2b0a17ed58b4de05c11fb085..f2b9b1b1ec108189712fdbe63095cdf006f7af91 100644 (file)
@@ -2308,7 +2308,7 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
        QETH_DBF_TEXT(trace,5,"skbfktr");
        skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR;
        /* this is a fake ethernet header */
-       fake_hdr = (struct trh_hdr *) skb->mac.raw;
+       fake_hdr = tr_hdr(skb);
 
        /* the destination MAC address */
        switch (skb->pkt_type){
index 96bd14452c55826fb1875e1b59dbd3ac691e2b58..a6a6d46e708ccfb4ebd5deca6d18dc3f7bd574eb 100644 (file)
@@ -189,11 +189,12 @@ static int tr_rebuild_header(struct sk_buff *skb)
 __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
 
-       struct trh_hdr *trh=(struct trh_hdr *)skb->data;
+       struct trh_hdr *trh;
        struct trllc *trllc;
        unsigned riflen=0;
 
        skb->mac.raw = skb->data;
+       trh = tr_hdr(skb);
 
        if(trh->saddr[0] & TR_RII)
                riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;