diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-02-03 21:40:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-11 11:44:22 -0500 |
commit | 254ad0ff9387d1c0a2f975ff40b2f4d1302ccc3a (patch) | |
tree | 8152a4a429eb9fbcd281cbe60f99bd15dfcf7ffe | |
parent | 141b38b6bc6db69348a9eaed87137451240bc55f (diff) |
ath9k: Remove all the redundant internal buffer types
Use mac80211's primitives for identifying the frame type,
and cleanup the driver-specific macros.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 36 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 15 |
3 files changed, 23 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 791f1acc0bb3..63d3eb6cda88 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -192,7 +192,6 @@ static inline void ath_debug_stat_rc(struct ath_softc *sc, | |||
192 | struct ath_config { | 192 | struct ath_config { |
193 | u32 ath_aggr_prot; | 193 | u32 ath_aggr_prot; |
194 | u16 txpowlimit; | 194 | u16 txpowlimit; |
195 | u16 txpowlimit_override; | ||
196 | u8 cabqReadytime; | 195 | u8 cabqReadytime; |
197 | u8 swBeaconProcess; | 196 | u8 swBeaconProcess; |
198 | }; | 197 | }; |
@@ -206,21 +205,25 @@ struct ath_config { | |||
206 | (_bf)->bf_lastbf = NULL; \ | 205 | (_bf)->bf_lastbf = NULL; \ |
207 | (_bf)->bf_next = NULL; \ | 206 | (_bf)->bf_next = NULL; \ |
208 | memset(&((_bf)->bf_state), 0, \ | 207 | memset(&((_bf)->bf_state), 0, \ |
209 | sizeof(struct ath_buf_state)); \ | 208 | sizeof(struct ath_buf_state)); \ |
210 | } while (0) | 209 | } while (0) |
211 | 210 | ||
211 | /** | ||
212 | * enum buffer_type - Buffer type flags | ||
213 | * | ||
214 | * @BUF_HT: Send this buffer using HT capabilities | ||
215 | * @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) | ||
216 | * @BUF_AGGR: Indicates whether the buffer can be aggregated | ||
217 | * (used in aggregation scheduling) | ||
218 | * @BUF_RETRY: Indicates whether the buffer is retried | ||
219 | * @BUF_XRETRY: To denote excessive retries of the buffer | ||
220 | */ | ||
212 | enum buffer_type { | 221 | enum buffer_type { |
213 | BUF_DATA = BIT(0), | 222 | BUF_HT = BIT(1), |
214 | BUF_AGGR = BIT(1), | ||
215 | BUF_AMPDU = BIT(2), | 223 | BUF_AMPDU = BIT(2), |
216 | BUF_HT = BIT(3), | 224 | BUF_AGGR = BIT(3), |
217 | BUF_RETRY = BIT(4), | 225 | BUF_RETRY = BIT(4), |
218 | BUF_XRETRY = BIT(5), | 226 | BUF_XRETRY = BIT(5), |
219 | BUF_SHORT_PREAMBLE = BIT(6), | ||
220 | BUF_BAR = BIT(7), | ||
221 | BUF_PSPOLL = BIT(8), | ||
222 | BUF_AGGR_BURST = BIT(9), | ||
223 | BUF_CALC_AIRTIME = BIT(10), | ||
224 | }; | 227 | }; |
225 | 228 | ||
226 | struct ath_buf_state { | 229 | struct ath_buf_state { |
@@ -241,18 +244,13 @@ struct ath_buf_state { | |||
241 | #define bf_retries bf_state.bfs_retries | 244 | #define bf_retries bf_state.bfs_retries |
242 | #define bf_seqno bf_state.bfs_seqno | 245 | #define bf_seqno bf_state.bfs_seqno |
243 | #define bf_tidno bf_state.bfs_tidno | 246 | #define bf_tidno bf_state.bfs_tidno |
244 | #define bf_rcs bf_state.bfs_rcs | ||
245 | #define bf_keyix bf_state.bfs_keyix | 247 | #define bf_keyix bf_state.bfs_keyix |
246 | #define bf_keytype bf_state.bfs_keytype | 248 | #define bf_keytype bf_state.bfs_keytype |
247 | #define bf_isdata(bf) (bf->bf_state.bf_type & BUF_DATA) | ||
248 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) | ||
249 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) | ||
250 | #define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT) | 249 | #define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT) |
250 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) | ||
251 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) | ||
251 | #define bf_isretried(bf) (bf->bf_state.bf_type & BUF_RETRY) | 252 | #define bf_isretried(bf) (bf->bf_state.bf_type & BUF_RETRY) |
252 | #define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY) | 253 | #define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY) |
253 | #define bf_isbar(bf) (bf->bf_state.bf_type & BUF_BAR) | ||
254 | #define bf_ispspoll(bf) (bf->bf_state.bf_type & BUF_PSPOLL) | ||
255 | #define bf_isaggrburst(bf) (bf->bf_state.bf_type & BUF_AGGR_BURST) | ||
256 | 254 | ||
257 | /* | 255 | /* |
258 | * Abstraction of a contiguous buffer to transmit/receive. There is only | 256 | * Abstraction of a contiguous buffer to transmit/receive. There is only |
@@ -358,8 +356,6 @@ enum ATH_AGGR_STATUS { | |||
358 | ATH_AGGR_DONE, | 356 | ATH_AGGR_DONE, |
359 | ATH_AGGR_BAW_CLOSED, | 357 | ATH_AGGR_BAW_CLOSED, |
360 | ATH_AGGR_LIMITED, | 358 | ATH_AGGR_LIMITED, |
361 | ATH_AGGR_SHORTPKT, | ||
362 | ATH_AGGR_8K_LIMITED, | ||
363 | }; | 359 | }; |
364 | 360 | ||
365 | struct ath_txq { | 361 | struct ath_txq { |
@@ -658,7 +654,7 @@ struct ath_rfkill { | |||
658 | #define ATH_MAX_SW_RETRIES 10 | 654 | #define ATH_MAX_SW_RETRIES 10 |
659 | #define ATH_CHAN_MAX 255 | 655 | #define ATH_CHAN_MAX 255 |
660 | #define IEEE80211_WEP_NKID 4 /* number of key ids */ | 656 | #define IEEE80211_WEP_NKID 4 /* number of key ids */ |
661 | #define IEEE80211_RATE_VAL 0x7f | 657 | |
662 | /* | 658 | /* |
663 | * The key cache is used for h/w cipher state and also for | 659 | * The key cache is used for h/w cipher state and also for |
664 | * tracking station state such as the current tx antenna. | 660 | * tracking station state such as the current tx antenna. |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 9b040bacab10..4095fec5e047 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -1503,7 +1503,6 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1503 | 1, NULL); | 1503 | 1, NULL); |
1504 | 1504 | ||
1505 | sc->sc_config.txpowlimit = ATH_TXPOWER_MAX; | 1505 | sc->sc_config.txpowlimit = ATH_TXPOWER_MAX; |
1506 | sc->sc_config.txpowlimit_override = 0; | ||
1507 | 1506 | ||
1508 | /* 11n Capabilities */ | 1507 | /* 11n Capabilities */ |
1509 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { | 1508 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index e14bceaef125..d5f15e74854f 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -1436,14 +1436,18 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
1436 | struct sk_buff *skb; | 1436 | struct sk_buff *skb; |
1437 | struct ieee80211_tx_info *tx_info; | 1437 | struct ieee80211_tx_info *tx_info; |
1438 | struct ieee80211_tx_rate *rates; | 1438 | struct ieee80211_tx_rate *rates; |
1439 | struct ieee80211_hdr *hdr; | ||
1439 | int i, flags = 0; | 1440 | int i, flags = 0; |
1440 | u8 rix = 0, ctsrate = 0; | 1441 | u8 rix = 0, ctsrate = 0; |
1442 | bool is_pspoll; | ||
1441 | 1443 | ||
1442 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); | 1444 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); |
1443 | 1445 | ||
1444 | skb = (struct sk_buff *)bf->bf_mpdu; | 1446 | skb = (struct sk_buff *)bf->bf_mpdu; |
1445 | tx_info = IEEE80211_SKB_CB(skb); | 1447 | tx_info = IEEE80211_SKB_CB(skb); |
1446 | rates = tx_info->control.rates; | 1448 | rates = tx_info->control.rates; |
1449 | hdr = (struct ieee80211_hdr *)skb->data; | ||
1450 | is_pspoll = ieee80211_is_pspoll(hdr->frame_control); | ||
1447 | 1451 | ||
1448 | /* | 1452 | /* |
1449 | * We check if Short Preamble is needed for the CTS rate by | 1453 | * We check if Short Preamble is needed for the CTS rate by |
@@ -1506,7 +1510,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
1506 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ | 1510 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ |
1507 | ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc, | 1511 | ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc, |
1508 | bf->bf_lastbf->bf_desc, | 1512 | bf->bf_lastbf->bf_desc, |
1509 | !bf_ispspoll(bf), ctsrate, | 1513 | !is_pspoll, ctsrate, |
1510 | 0, series, 4, flags); | 1514 | 0, series, 4, flags); |
1511 | 1515 | ||
1512 | if (sc->sc_config.ath_aggr_prot && flags) | 1516 | if (sc->sc_config.ath_aggr_prot && flags) |
@@ -1534,12 +1538,6 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1534 | 1538 | ||
1535 | bf->bf_frmlen = skb->len + FCS_LEN - (hdrlen & 3); | 1539 | bf->bf_frmlen = skb->len + FCS_LEN - (hdrlen & 3); |
1536 | 1540 | ||
1537 | if (ieee80211_is_data(fc)) | ||
1538 | bf->bf_state.bf_type |= BUF_DATA; | ||
1539 | if (ieee80211_is_back_req(fc)) | ||
1540 | bf->bf_state.bf_type |= BUF_BAR; | ||
1541 | if (ieee80211_is_pspoll(fc)) | ||
1542 | bf->bf_state.bf_type |= BUF_PSPOLL; | ||
1543 | if ((conf_is_ht(&sc->hw->conf) && !is_pae(skb) && | 1541 | if ((conf_is_ht(&sc->hw->conf) && !is_pae(skb) && |
1544 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU))) | 1542 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU))) |
1545 | bf->bf_state.bf_type |= BUF_HT; | 1543 | bf->bf_state.bf_type |= BUF_HT; |
@@ -1843,6 +1841,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf, | |||
1843 | static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad) | 1841 | static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad) |
1844 | { | 1842 | { |
1845 | struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; | 1843 | struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; |
1844 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | ||
1846 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 1845 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1847 | struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); | 1846 | struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); |
1848 | 1847 | ||
@@ -1852,7 +1851,7 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad) | |||
1852 | 1851 | ||
1853 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && | 1852 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && |
1854 | (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) { | 1853 | (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) { |
1855 | if (bf_isdata(bf)) { | 1854 | if (ieee80211_is_data(hdr->frame_control)) { |
1856 | memcpy(&tx_info_priv->tx, &ds->ds_txstat, | 1855 | memcpy(&tx_info_priv->tx, &ds->ds_txstat, |
1857 | sizeof(tx_info_priv->tx)); | 1856 | sizeof(tx_info_priv->tx)); |
1858 | tx_info_priv->n_frames = bf->bf_nframes; | 1857 | tx_info_priv->n_frames = bf->bf_nframes; |