aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-06-15 02:33:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-26 16:49:13 -0400
commitf37d923422b61884a75a2a64865ed03ca5ccfc6d (patch)
treead81577534c2223d3e47f9db907642a323da813e /drivers/net/wireless/b43
parent85365820590e2fb54684c7163047f866ccbf4760 (diff)
b43: use frame control helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/xmit.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index f9e1cff2aecb..bf6f6c1ed4cf 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -193,7 +193,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
193 const struct ieee80211_hdr *wlhdr = 193 const struct ieee80211_hdr *wlhdr =
194 (const struct ieee80211_hdr *)fragment_data; 194 (const struct ieee80211_hdr *)fragment_data;
195 int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)); 195 int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT));
196 u16 fctl = le16_to_cpu(wlhdr->frame_control); 196 __le16 fctl = wlhdr->frame_control;
197 struct ieee80211_rate *fbrate; 197 struct ieee80211_rate *fbrate;
198 u8 rate, rate_fb; 198 u8 rate, rate_fb;
199 int rate_ofdm, rate_fb_ofdm; 199 int rate_ofdm, rate_fb_ofdm;
@@ -259,7 +259,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
259 B43_TXH_MAC_KEYIDX; 259 B43_TXH_MAC_KEYIDX;
260 mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & 260 mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) &
261 B43_TXH_MAC_KEYALG; 261 B43_TXH_MAC_KEYALG;
262 wlhdr_len = ieee80211_get_hdrlen(fctl); 262 wlhdr_len = ieee80211_hdrlen(fctl);
263 iv_len = min((size_t) info->control.iv_len, 263 iv_len = min((size_t) info->control.iv_len,
264 ARRAY_SIZE(txhdr->iv)); 264 ARRAY_SIZE(txhdr->iv));
265 memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); 265 memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
@@ -317,8 +317,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
317 /* MAC control */ 317 /* MAC control */
318 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) 318 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
319 mac_ctl |= B43_TXH_MAC_ACK; 319 mac_ctl |= B43_TXH_MAC_ACK;
320 if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && 320 if (!ieee80211_is_pspoll(fctl))
321 ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)))
322 mac_ctl |= B43_TXH_MAC_HWSEQ; 321 mac_ctl |= B43_TXH_MAC_HWSEQ;
323 if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) 322 if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
324 mac_ctl |= B43_TXH_MAC_STMSDU; 323 mac_ctl |= B43_TXH_MAC_STMSDU;
@@ -509,7 +508,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
509 struct b43_plcp_hdr6 *plcp; 508 struct b43_plcp_hdr6 *plcp;
510 struct ieee80211_hdr *wlhdr; 509 struct ieee80211_hdr *wlhdr;
511 const struct b43_rxhdr_fw4 *rxhdr = _rxhdr; 510 const struct b43_rxhdr_fw4 *rxhdr = _rxhdr;
512 u16 fctl; 511 __le16 fctl;
513 u16 phystat0, phystat3, chanstat, mactime; 512 u16 phystat0, phystat3, chanstat, mactime;
514 u32 macstat; 513 u32 macstat;
515 u16 chanid; 514 u16 chanid;
@@ -549,7 +548,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
549 goto drop; 548 goto drop;
550 } 549 }
551 wlhdr = (struct ieee80211_hdr *)(skb->data); 550 wlhdr = (struct ieee80211_hdr *)(skb->data);
552 fctl = le16_to_cpu(wlhdr->frame_control); 551 fctl = wlhdr->frame_control;
553 552
554 if (macstat & B43_RX_MAC_DEC) { 553 if (macstat & B43_RX_MAC_DEC) {
555 unsigned int keyidx; 554 unsigned int keyidx;
@@ -564,7 +563,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
564 B43_WARN_ON(keyidx >= dev->max_nr_keys); 563 B43_WARN_ON(keyidx >= dev->max_nr_keys);
565 564
566 if (dev->key[keyidx].algorithm != B43_SEC_ALGO_NONE) { 565 if (dev->key[keyidx].algorithm != B43_SEC_ALGO_NONE) {
567 wlhdr_len = ieee80211_get_hdrlen(fctl); 566 wlhdr_len = ieee80211_hdrlen(fctl);
568 if (unlikely(skb->len < (wlhdr_len + 3))) { 567 if (unlikely(skb->len < (wlhdr_len + 3))) {
569 b43dbg(dev->wl, 568 b43dbg(dev->wl,
570 "RX: Packet size underrun (3)\n"); 569 "RX: Packet size underrun (3)\n");
@@ -604,9 +603,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
604 * of timestamp, i.e. about 65 milliseconds after the PHY received 603 * of timestamp, i.e. about 65 milliseconds after the PHY received
605 * the first symbol. 604 * the first symbol.
606 */ 605 */
607 if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) 606 if (ieee80211_is_beacon(fctl) || dev->wl->radiotap_enabled) {
608 == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
609 dev->wl->radiotap_enabled) {
610 u16 low_mactime_now; 607 u16 low_mactime_now;
611 608
612 b43_tsf_read(dev, &status.mactime); 609 b43_tsf_read(dev, &status.mactime);