Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bing Zhao <bzhao@marvell.com>
To: linux-wireless@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Kiran Divekar <dkiran@marvell.com>,
	Frank Huang <frankh@marvell.com>, Bing Zhao <bzhao@marvell.com>
Subject: [PATCH 1/2] mwifiex: replace struct eth_II_hdr with ethhdr
Date: Tue,  7 Dec 2010 15:11:54 -0800	[thread overview]
Message-ID: <1291763515-1203-1-git-send-email-bzhao@marvell.com> (raw)

"struct ethhdr" is defined in include/linux/if_ether.h

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/mwifiex/fw.h     |    3 +++
 drivers/net/wireless/mwifiex/sta_rx.c |   22 ++++++----------------
 2 files changed, 9 insertions(+), 16 deletions(-)

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. */
-- 
1.7.0.2


             reply	other threads:[~2010-12-07 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 23:11 Bing Zhao [this message]
2010-12-07 23:11 ` [PATCH 2/2] mwifiex: replace struct eth_803_hdr with ethhdr Bing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291763515-1203-1-git-send-email-bzhao@marvell.com \
    --to=bzhao@marvell.com \
    --cc=akarwar@marvell.com \
    --cc=dkiran@marvell.com \
    --cc=frankh@marvell.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox