[PATCH] ipw2200: use generic ieee80211_get_hdrlen() to get packet length
authorZhu Yi <yi.zhu@intel.com>
Tue, 14 Feb 2006 22:18:19 +0000 (06:18 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 17 Mar 2006 20:08:02 +0000 (15:08 -0500)
replace ipw2200 specific frame_hdr_len() with generic
ieee80211 routine ieee80211_get_hdrlen()

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.h

index 129891feb43ffb2e315fea5361f1f2f5caeb4cc6..b2bbdf982b0184cc201a7cc3fe424f0dcbc6e59f 100644 (file)
@@ -7895,7 +7895,8 @@ static void ipw_rx(struct ipw_priv *priv)
                                             le16_to_cpu(pkt->u.frame.length));
 
                                if (le16_to_cpu(pkt->u.frame.length) <
-                                   frame_hdr_len(header)) {
+                                   ieee80211_get_hdrlen(le16_to_cpu(
+                                                   header->frame_ctl))) {
                                        IPW_DEBUG_DROP
                                            ("Received packet is too small. "
                                             "Dropping.\n");
index 5405ba105abfde0d400c95a2a7f26dd580d4047e..c2a7aa32f724157cdfbf34fca9ac5f4bb6456c8e 100644 (file)
@@ -1907,27 +1907,4 @@ struct ipw_cmd_log {
 
 #define IPW_MAX_CONFIG_RETRIES 10
 
-static inline u32 frame_hdr_len(struct ieee80211_hdr_4addr *hdr)
-{
-       u32 retval;
-       u16 fc;
-
-       retval = sizeof(struct ieee80211_hdr_3addr);
-       fc = le16_to_cpu(hdr->frame_ctl);
-
-       /*
-        * Function     ToDS    FromDS
-        * IBSS         0       0
-        * To AP        1       0
-        * From AP      0       1
-        * WDS (bridge) 1       1
-        *
-        * Only WDS frames use Address4 among them. --YZ
-        */
-       if (!(fc & IEEE80211_FCTL_TODS) || !(fc & IEEE80211_FCTL_FROMDS))
-               retval -= ETH_ALEN;
-
-       return retval;
-}
-
 #endif                         /* __ipw2200_h__ */