mwifiex: declare snap_type as __be16 variable
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 3 Dec 2013 07:17:49 +0000 (23:17 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Dec 2013 20:35:27 +0000 (15:35 -0500)
Actually we are updating snap_type with h_proto (__be16 variable)
in ethernet frame header. Hence endianness conversion is not
required.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/11n_aggr.c
drivers/net/wireless/mwifiex/fw.h

index 1214c587fd08587f263b2c979eab9bc902b53ae1..63211707f93955c851bfb96d71f12d5ef1f4a313 100644 (file)
@@ -69,9 +69,9 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
        memcpy(&tx_header->eth803_hdr, skb_src->data, dt_offset);
 
        /* Copy SNAP header */
-       snap.snap_type =
-               le16_to_cpu(*(__le16 *) ((u8 *)skb_src->data + dt_offset));
-       dt_offset += sizeof(u16);
+       snap.snap_type = ((struct ethhdr *)skb_src->data)->h_proto;
+
+       dt_offset += sizeof(__be16);
 
        memcpy(&tx_header->rfc1042_hdr, &snap, sizeof(struct rfc_1042_hdr));
 
index 6998413c888127e5a895d24c3d6ce2065200821e..8fcb500fa09b37c7e253906350141972998c5c9e 100644 (file)
@@ -30,7 +30,7 @@ struct rfc_1042_hdr {
        u8 llc_ssap;
        u8 llc_ctrl;
        u8 snap_oui[3];
-       u16 snap_type;
+       __be16 snap_type;
 };
 
 struct rx_packet_hdr {