Commit 49adc5ce authored by John W. Linville's avatar John W. Linville

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: default avatarJohn W. Linville <linville@tuxdriver.com>
parent af335a6c
...@@ -1562,24 +1562,11 @@ static int mwl8k_tid_queue_mapping(u8 tid) ...@@ -1562,24 +1562,11 @@ static int mwl8k_tid_queue_mapping(u8 tid)
/* The firmware will fill in the rate information /* The firmware will fill in the rate information
* for each packet that gets queued in the hardware * for each packet that gets queued in the hardware
* in this structure * and these macros will interpret that info.
*/ */
struct rateinfo { #define RI_FORMAT(a) (a & 0x0001)
__le16 format:1; #define RI_RATE_ID_MCS(a) ((a & 0x01f8) >> 3)
__le16 short_gi:1;
__le16 band_width:1;
__le16 rate_id_mcs:6;
__le16 adv_coding:2;
__le16 antenna:2;
__le16 act_sub_chan:2;
__le16 preamble_type:1;
__le16 power_id:4;
__le16 antenna2:1;
__le16 reserved:1;
__le16 tx_bf_frame:1;
__le16 green_field:1;
} __packed;
static int static int
mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) 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,7 +1587,6 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
struct ieee80211_sta *sta; struct ieee80211_sta *sta;
struct mwl8k_sta *sta_info = NULL; struct mwl8k_sta *sta_info = NULL;
u16 rate_info; u16 rate_info;
struct rateinfo *rate;
struct ieee80211_hdr *wh; struct ieee80211_hdr *wh;
tx = txq->head; tx = txq->head;
...@@ -1643,14 +1629,13 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force) ...@@ -1643,14 +1629,13 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
sta_info = MWL8K_STA(sta); sta_info = MWL8K_STA(sta);
BUG_ON(sta_info == NULL); BUG_ON(sta_info == NULL);
rate_info = le16_to_cpu(tx_desc->rate_info); rate_info = le16_to_cpu(tx_desc->rate_info);
rate = (struct rateinfo *)&rate_info;
/* If rate is < 6.5 Mpbs for an ht station /* If rate is < 6.5 Mpbs for an ht station
* do not form an ampdu. If the station is a * do not form an ampdu. If the station is a
* legacy station (format = 0), do not form an * legacy station (format = 0), do not form an
* ampdu * ampdu
*/ */
if (rate->rate_id_mcs < 1 || if (RI_RATE_ID_MCS(rate_info) < 1 ||
rate->format == 0) { RI_FORMAT(rate_info) == 0) {
sta_info->is_ampdu_allowed = false; sta_info->is_ampdu_allowed = false;
} else { } else {
sta_info->is_ampdu_allowed = true; sta_info->is_ampdu_allowed = true;
......
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