Loading drivers/net/wireless/orinoco.c +20 −24 Original line number Diff line number Diff line Loading @@ -421,9 +421,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) hermes_t *hw = &priv->hw; int err = 0; u16 txfid = priv->txfid; char *p; struct ethhdr *eh; int data_len, data_off; int data_off; struct hermes_tx_descriptor desc; unsigned long flags; Loading Loading @@ -453,8 +452,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) } /* Check packet length */ data_len = skb->len; if (data_len < ETH_HLEN) if (skb->len < ETH_HLEN) goto drop; eh = (struct ethhdr *)skb->data; Loading @@ -477,20 +475,20 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) /* Encapsulate Ethernet-II frames */ if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */ struct header_struct hdr; data_len = skb->len - ETH_HLEN; data_off = HERMES_802_3_OFFSET + sizeof(hdr); p = skb->data + ETH_HLEN; struct header_struct { struct ethhdr eth; /* 802.3 header */ u8 encap[6]; /* 802.2 header */ } __attribute__ ((packed)) hdr; /* 802.3 header */ memcpy(hdr.dest, eh->h_dest, ETH_ALEN); memcpy(hdr.src, eh->h_source, ETH_ALEN); hdr.len = htons(data_len + ENCAPS_OVERHEAD); /* Strip destination and source from the data */ skb_pull(skb, 2 * ETH_ALEN); data_off = HERMES_802_2_OFFSET + sizeof(encaps_hdr); /* 802.2 header */ memcpy(&hdr.dsap, &encaps_hdr, sizeof(encaps_hdr)); /* And move them to a separate header */ memcpy(&hdr.eth, eh, 2 * ETH_ALEN); hdr.eth.h_proto = htons(sizeof(encaps_hdr) + skb->len); memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr)); hdr.ethertype = eh->h_proto; err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr), txfid, HERMES_802_3_OFFSET); if (err) { Loading @@ -500,12 +498,10 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) goto busy; } } else { /* IEEE 802.3 frame */ data_len = skb->len; data_off = HERMES_802_3_OFFSET; p = skb->data; } err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, err = hermes_bap_pwrite(hw, USER_BAP, skb->data, skb->len, txfid, data_off); if (err) { printk(KERN_ERR "%s: Error %d writing packet to BAP\n", Loading @@ -527,7 +523,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) } dev->trans_start = jiffies; stats->tx_bytes += data_off + data_len; stats->tx_bytes += data_off + skb->len; goto ok; drop: Loading drivers/net/wireless/orinoco.h +0 −14 Original line number Diff line number Diff line Loading @@ -30,20 +30,6 @@ struct orinoco_key { char data[ORINOCO_MAX_KEY_SIZE]; } __attribute__ ((packed)); struct header_struct { /* 802.3 */ u8 dest[ETH_ALEN]; u8 src[ETH_ALEN]; __be16 len; /* 802.2 */ u8 dsap; u8 ssap; u8 ctrl; /* SNAP */ u8 oui[3]; unsigned short ethertype; } __attribute__ ((packed)); typedef enum { FIRMWARE_TYPE_AGERE, FIRMWARE_TYPE_INTERSIL, Loading Loading
drivers/net/wireless/orinoco.c +20 −24 Original line number Diff line number Diff line Loading @@ -421,9 +421,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) hermes_t *hw = &priv->hw; int err = 0; u16 txfid = priv->txfid; char *p; struct ethhdr *eh; int data_len, data_off; int data_off; struct hermes_tx_descriptor desc; unsigned long flags; Loading Loading @@ -453,8 +452,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) } /* Check packet length */ data_len = skb->len; if (data_len < ETH_HLEN) if (skb->len < ETH_HLEN) goto drop; eh = (struct ethhdr *)skb->data; Loading @@ -477,20 +475,20 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) /* Encapsulate Ethernet-II frames */ if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */ struct header_struct hdr; data_len = skb->len - ETH_HLEN; data_off = HERMES_802_3_OFFSET + sizeof(hdr); p = skb->data + ETH_HLEN; struct header_struct { struct ethhdr eth; /* 802.3 header */ u8 encap[6]; /* 802.2 header */ } __attribute__ ((packed)) hdr; /* 802.3 header */ memcpy(hdr.dest, eh->h_dest, ETH_ALEN); memcpy(hdr.src, eh->h_source, ETH_ALEN); hdr.len = htons(data_len + ENCAPS_OVERHEAD); /* Strip destination and source from the data */ skb_pull(skb, 2 * ETH_ALEN); data_off = HERMES_802_2_OFFSET + sizeof(encaps_hdr); /* 802.2 header */ memcpy(&hdr.dsap, &encaps_hdr, sizeof(encaps_hdr)); /* And move them to a separate header */ memcpy(&hdr.eth, eh, 2 * ETH_ALEN); hdr.eth.h_proto = htons(sizeof(encaps_hdr) + skb->len); memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr)); hdr.ethertype = eh->h_proto; err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr), txfid, HERMES_802_3_OFFSET); if (err) { Loading @@ -500,12 +498,10 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) goto busy; } } else { /* IEEE 802.3 frame */ data_len = skb->len; data_off = HERMES_802_3_OFFSET; p = skb->data; } err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, err = hermes_bap_pwrite(hw, USER_BAP, skb->data, skb->len, txfid, data_off); if (err) { printk(KERN_ERR "%s: Error %d writing packet to BAP\n", Loading @@ -527,7 +523,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) } dev->trans_start = jiffies; stats->tx_bytes += data_off + data_len; stats->tx_bytes += data_off + skb->len; goto ok; drop: Loading
drivers/net/wireless/orinoco.h +0 −14 Original line number Diff line number Diff line Loading @@ -30,20 +30,6 @@ struct orinoco_key { char data[ORINOCO_MAX_KEY_SIZE]; } __attribute__ ((packed)); struct header_struct { /* 802.3 */ u8 dest[ETH_ALEN]; u8 src[ETH_ALEN]; __be16 len; /* 802.2 */ u8 dsap; u8 ssap; u8 ctrl; /* SNAP */ u8 oui[3]; unsigned short ethertype; } __attribute__ ((packed)); typedef enum { FIRMWARE_TYPE_AGERE, FIRMWARE_TYPE_INTERSIL, Loading