diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-04-27 15:04:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-28 14:53:23 -0400 |
commit | 49adc5ceb2b95e517baf625e0c8e06e91073009b (patch) | |
tree | fd8ae16948ba48fd2b8baaf32aac6328579e75be /drivers/net/wireless | |
parent | af335a6cbc3dfcba64ad31561c0da563d1c43a2d (diff) |
mwl8k: replace rateinfo bitfields with mask and shift macros
AFAICT, this driver is claiming that 24 bits of rate info fit into a
16-bit field in the Tx descriptor. Anyway, the use of bitfields is
frowned-upon for a variety of well-documented reasons...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index b8f2b12c8c7c..8a1b26255f03 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -1562,24 +1562,11 @@ static int mwl8k_tid_queue_mapping(u8 tid) | |||
1562 | 1562 | ||
1563 | /* The firmware will fill in the rate information | 1563 | /* The firmware will fill in the rate information |
1564 | * for each packet that gets queued in the hardware | 1564 | * for each packet that gets queued in the hardware |
1565 | * in this structure | 1565 | * and these macros will interpret that info. |
1566 | */ | 1566 | */ |
1567 | 1567 | ||
1568 | struct rateinfo { | 1568 | #define RI_FORMAT(a) (a & 0x0001) |
1569 | __le16 format:1; | 1569 | #define RI_RATE_ID_MCS(a) ((a & 0x01f8) >> 3) |
1570 | __le16 short_gi:1; | ||
1571 | __le16 band_width:1; | ||
1572 | __le16 rate_id_mcs:6; | ||
1573 | __le16 adv_coding:2; | ||
1574 | __le16 antenna:2; | ||
1575 | __le16 act_sub_chan:2; | ||
1576 | __le16 preamble_type:1; | ||
1577 | __le16 power_id:4; | ||
1578 | __le16 antenna2:1; | ||
1579 | __le16 reserved:1; | ||
1580 | __le16 tx_bf_frame:1; | ||
1581 | __le16 green_field:1; | ||
1582 | } __packed; | ||
1583 | 1570 | ||
1584 | static int | 1571 | static int |
1585 | mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) | 1572 | mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) |
@@ -1600,7 +1587,6 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) | |||
1600 | struct ieee80211_sta *sta; | 1587 | struct ieee80211_sta *sta; |
1601 | struct mwl8k_sta *sta_info = NULL; | 1588 | struct mwl8k_sta *sta_info = NULL; |
1602 | u16 rate_info; | 1589 | u16 rate_info; |
1603 | struct rateinfo *rate; | ||
1604 | struct ieee80211_hdr *wh; | 1590 | struct ieee80211_hdr *wh; |
1605 | 1591 | ||
1606 | tx = txq->head; | 1592 | tx = txq->head; |
@@ -1643,14 +1629,13 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) | |||
1643 | sta_info = MWL8K_STA(sta); | 1629 | sta_info = MWL8K_STA(sta); |
1644 | BUG_ON(sta_info == NULL); | 1630 | BUG_ON(sta_info == NULL); |
1645 | rate_info = le16_to_cpu(tx_desc->rate_info); | 1631 | rate_info = le16_to_cpu(tx_desc->rate_info); |
1646 | rate = (struct rateinfo *)&rate_info; | ||
1647 | /* If rate is < 6.5 Mpbs for an ht station | 1632 | /* If rate is < 6.5 Mpbs for an ht station |
1648 | * do not form an ampdu. If the station is a | 1633 | * do not form an ampdu. If the station is a |
1649 | * legacy station (format = 0), do not form an | 1634 | * legacy station (format = 0), do not form an |
1650 | * ampdu | 1635 | * ampdu |
1651 | */ | 1636 | */ |
1652 | if (rate->rate_id_mcs < 1 || | 1637 | if (RI_RATE_ID_MCS(rate_info) < 1 || |
1653 | rate->format == 0) { | 1638 | RI_FORMAT(rate_info) == 0) { |
1654 | sta_info->is_ampdu_allowed = false; | 1639 | sta_info->is_ampdu_allowed = false; |
1655 | } else { | 1640 | } else { |
1656 | sta_info->is_ampdu_allowed = true; | 1641 | sta_info->is_ampdu_allowed = true; |