diff mbox

[1/2] mwifiex: replace struct eth_II_hdr with ethhdr

Message ID 1291763515-1203-1-git-send-email-bzhao@marvell.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bing Zhao Dec. 7, 2010, 11:11 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index ed691ac..86e8a96 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -20,6 +20,9 @@ 
 #ifndef _MWIFIEX_FW_H_
 #define _MWIFIEX_FW_H_
 
+#include <linux/if_ether.h>
+
+
 #define INTF_HEADER_LEN     4
 
 struct eth_803_hdr {
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c
index 504c377..022ae4b 100644
--- a/drivers/net/wireless/mwifiex/sta_rx.c
+++ b/drivers/net/wireless/mwifiex/sta_rx.c
@@ -26,16 +26,6 @@ 
 #include "11n_aggr.h"
 #include "11n_rxreorder.h"
 
-/** Ethernet II header */
-struct eth_II_hdr {
-	/** Ethernet II header destination address */
-	u8 dest_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	/** Ethernet II header source address */
-	u8 src_addr[MWIFIEX_MAC_ADDR_LENGTH];
-	/** Ethernet II header length */
-	u16 ethertype;
-};
-
 /*
  * This function processes the received packet and forwards it
  * to kernel/upper layer.
@@ -58,7 +48,7 @@  mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 	struct rx_packet_hdr *rx_pkt_hdr;
 	struct rxpd *local_rx_pd;
 	int hdr_chop;
-	struct eth_II_hdr *eth_hdr;
+	struct ethhdr *eth_hdr;
 	u8 rfc1042_eth_hdr[MWIFIEX_MAC_ADDR_LENGTH] = { 0xaa, 0xaa, 0x03,
 							0x00, 0x00, 0x00 };
 
@@ -114,7 +104,7 @@  mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 		 *  To create the Ethernet II, just move the src, dst address
 		 *    right before the snap_type.
 		 */
-		eth_hdr = (struct eth_II_hdr *)
+		eth_hdr = (struct ethhdr *)
 			((u8 *) &rx_pkt_hdr->eth803_hdr
 			 + sizeof(rx_pkt_hdr->eth803_hdr) +
 			 sizeof(rx_pkt_hdr->rfc1042_hdr)
@@ -122,10 +112,10 @@  mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
 			 - sizeof(rx_pkt_hdr->eth803_hdr.src_addr)
 			 - sizeof(rx_pkt_hdr->rfc1042_hdr.snap_type));
 
-		memcpy(eth_hdr->src_addr, rx_pkt_hdr->eth803_hdr.src_addr,
-		       sizeof(eth_hdr->src_addr));
-		memcpy(eth_hdr->dest_addr, rx_pkt_hdr->eth803_hdr.dest_addr,
-		       sizeof(eth_hdr->dest_addr));
+		memcpy(eth_hdr->h_source, rx_pkt_hdr->eth803_hdr.src_addr,
+		       sizeof(eth_hdr->h_source));
+		memcpy(eth_hdr->h_dest, rx_pkt_hdr->eth803_hdr.dest_addr,
+		       sizeof(eth_hdr->h_dest));
 
 		/* Chop off the rxpd + the excess memory from the 802.2/llc/snap
 		   header that was removed. */