Commit 9d0be03a authored by Zhu Yi's avatar Zhu Yi Committed by John W. Linville

[PATCH] ipw2200: use generic ieee80211_get_hdrlen() to get packet length

replace ipw2200 specific frame_hdr_len() with generic
ieee80211 routine ieee80211_get_hdrlen()
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 85149bac
...@@ -7895,7 +7895,8 @@ static void ipw_rx(struct ipw_priv *priv) ...@@ -7895,7 +7895,8 @@ static void ipw_rx(struct ipw_priv *priv)
le16_to_cpu(pkt->u.frame.length)); le16_to_cpu(pkt->u.frame.length));
if (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 IPW_DEBUG_DROP
("Received packet is too small. " ("Received packet is too small. "
"Dropping.\n"); "Dropping.\n");
......
...@@ -1907,27 +1907,4 @@ struct ipw_cmd_log { ...@@ -1907,27 +1907,4 @@ struct ipw_cmd_log {
#define IPW_MAX_CONFIG_RETRIES 10 #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__ */ #endif /* __ipw2200_h__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment