diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 74 |
1 files changed, 35 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index c76ada178781..85045afc1ba7 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -167,8 +167,7 @@ static struct pci_driver ath5k_pci_driver = { | |||
167 | /* | 167 | /* |
168 | * Prototypes - MAC 802.11 stack related functions | 168 | * Prototypes - MAC 802.11 stack related functions |
169 | */ | 169 | */ |
170 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 170 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
171 | struct ieee80211_tx_control *ctl); | ||
172 | static int ath5k_reset(struct ieee80211_hw *hw); | 171 | static int ath5k_reset(struct ieee80211_hw *hw); |
173 | static int ath5k_start(struct ieee80211_hw *hw); | 172 | static int ath5k_start(struct ieee80211_hw *hw); |
174 | static void ath5k_stop(struct ieee80211_hw *hw); | 173 | static void ath5k_stop(struct ieee80211_hw *hw); |
@@ -196,8 +195,7 @@ static int ath5k_get_tx_stats(struct ieee80211_hw *hw, | |||
196 | static u64 ath5k_get_tsf(struct ieee80211_hw *hw); | 195 | static u64 ath5k_get_tsf(struct ieee80211_hw *hw); |
197 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); | 196 | static void ath5k_reset_tsf(struct ieee80211_hw *hw); |
198 | static int ath5k_beacon_update(struct ieee80211_hw *hw, | 197 | static int ath5k_beacon_update(struct ieee80211_hw *hw, |
199 | struct sk_buff *skb, | 198 | struct sk_buff *skb); |
200 | struct ieee80211_tx_control *ctl); | ||
201 | 199 | ||
202 | static struct ieee80211_ops ath5k_hw_ops = { | 200 | static struct ieee80211_ops ath5k_hw_ops = { |
203 | .tx = ath5k_tx, | 201 | .tx = ath5k_tx, |
@@ -251,9 +249,7 @@ static void ath5k_desc_free(struct ath5k_softc *sc, | |||
251 | static int ath5k_rxbuf_setup(struct ath5k_softc *sc, | 249 | static int ath5k_rxbuf_setup(struct ath5k_softc *sc, |
252 | struct ath5k_buf *bf); | 250 | struct ath5k_buf *bf); |
253 | static int ath5k_txbuf_setup(struct ath5k_softc *sc, | 251 | static int ath5k_txbuf_setup(struct ath5k_softc *sc, |
254 | struct ath5k_buf *bf, | 252 | struct ath5k_buf *bf); |
255 | struct ieee80211_tx_control *ctl); | ||
256 | |||
257 | static inline void ath5k_txbuf_free(struct ath5k_softc *sc, | 253 | static inline void ath5k_txbuf_free(struct ath5k_softc *sc, |
258 | struct ath5k_buf *bf) | 254 | struct ath5k_buf *bf) |
259 | { | 255 | { |
@@ -289,8 +285,7 @@ static void ath5k_tx_processq(struct ath5k_softc *sc, | |||
289 | static void ath5k_tasklet_tx(unsigned long data); | 285 | static void ath5k_tasklet_tx(unsigned long data); |
290 | /* Beacon handling */ | 286 | /* Beacon handling */ |
291 | static int ath5k_beacon_setup(struct ath5k_softc *sc, | 287 | static int ath5k_beacon_setup(struct ath5k_softc *sc, |
292 | struct ath5k_buf *bf, | 288 | struct ath5k_buf *bf); |
293 | struct ieee80211_tx_control *ctl); | ||
294 | static void ath5k_beacon_send(struct ath5k_softc *sc); | 289 | static void ath5k_beacon_send(struct ath5k_softc *sc); |
295 | static void ath5k_beacon_config(struct ath5k_softc *sc); | 290 | static void ath5k_beacon_config(struct ath5k_softc *sc); |
296 | static void ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf); | 291 | static void ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf); |
@@ -1295,36 +1290,36 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) | |||
1295 | } | 1290 | } |
1296 | 1291 | ||
1297 | static int | 1292 | static int |
1298 | ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | 1293 | ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) |
1299 | struct ieee80211_tx_control *ctl) | ||
1300 | { | 1294 | { |
1301 | struct ath5k_hw *ah = sc->ah; | 1295 | struct ath5k_hw *ah = sc->ah; |
1302 | struct ath5k_txq *txq = sc->txq; | 1296 | struct ath5k_txq *txq = sc->txq; |
1303 | struct ath5k_desc *ds = bf->desc; | 1297 | struct ath5k_desc *ds = bf->desc; |
1304 | struct sk_buff *skb = bf->skb; | 1298 | struct sk_buff *skb = bf->skb; |
1299 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1305 | unsigned int pktlen, flags, keyidx = AR5K_TXKEYIX_INVALID; | 1300 | unsigned int pktlen, flags, keyidx = AR5K_TXKEYIX_INVALID; |
1306 | int ret; | 1301 | int ret; |
1307 | 1302 | ||
1308 | flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK; | 1303 | flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK; |
1309 | bf->ctl = *ctl; | 1304 | |
1310 | /* XXX endianness */ | 1305 | /* XXX endianness */ |
1311 | bf->skbaddr = pci_map_single(sc->pdev, skb->data, skb->len, | 1306 | bf->skbaddr = pci_map_single(sc->pdev, skb->data, skb->len, |
1312 | PCI_DMA_TODEVICE); | 1307 | PCI_DMA_TODEVICE); |
1313 | 1308 | ||
1314 | if (ctl->flags & IEEE80211_TXCTL_NO_ACK) | 1309 | if (info->flags & IEEE80211_TX_CTL_NO_ACK) |
1315 | flags |= AR5K_TXDESC_NOACK; | 1310 | flags |= AR5K_TXDESC_NOACK; |
1316 | 1311 | ||
1317 | pktlen = skb->len; | 1312 | pktlen = skb->len; |
1318 | 1313 | ||
1319 | if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) { | 1314 | if (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)) { |
1320 | keyidx = ctl->hw_key->hw_key_idx; | 1315 | keyidx = info->control.hw_key->hw_key_idx; |
1321 | pktlen += ctl->icv_len; | 1316 | pktlen += info->control.icv_len; |
1322 | } | 1317 | } |
1323 | |||
1324 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, | 1318 | ret = ah->ah_setup_tx_desc(ah, ds, pktlen, |
1325 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, | 1319 | ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, |
1326 | (sc->power_level * 2), ctl->tx_rate->hw_value, | 1320 | (sc->power_level * 2), |
1327 | ctl->retry_limit, keyidx, 0, flags, 0, 0); | 1321 | ieee80211_get_tx_rate(sc->hw, info)->hw_value, |
1322 | info->control.retry_limit, keyidx, 0, flags, 0, 0); | ||
1328 | if (ret) | 1323 | if (ret) |
1329 | goto err_unmap; | 1324 | goto err_unmap; |
1330 | 1325 | ||
@@ -1599,7 +1594,7 @@ ath5k_txq_cleanup(struct ath5k_softc *sc) | |||
1599 | sc->txqs[i].link); | 1594 | sc->txqs[i].link); |
1600 | } | 1595 | } |
1601 | } | 1596 | } |
1602 | ieee80211_start_queues(sc->hw); /* XXX move to callers */ | 1597 | ieee80211_wake_queues(sc->hw); /* XXX move to callers */ |
1603 | 1598 | ||
1604 | for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) | 1599 | for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) |
1605 | if (sc->txqs[i].setup) | 1600 | if (sc->txqs[i].setup) |
@@ -1926,11 +1921,11 @@ next: | |||
1926 | static void | 1921 | static void |
1927 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | 1922 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) |
1928 | { | 1923 | { |
1929 | struct ieee80211_tx_status txs = {}; | ||
1930 | struct ath5k_tx_status ts = {}; | 1924 | struct ath5k_tx_status ts = {}; |
1931 | struct ath5k_buf *bf, *bf0; | 1925 | struct ath5k_buf *bf, *bf0; |
1932 | struct ath5k_desc *ds; | 1926 | struct ath5k_desc *ds; |
1933 | struct sk_buff *skb; | 1927 | struct sk_buff *skb; |
1928 | struct ieee80211_tx_info *info; | ||
1934 | int ret; | 1929 | int ret; |
1935 | 1930 | ||
1936 | spin_lock(&txq->lock); | 1931 | spin_lock(&txq->lock); |
@@ -1950,24 +1945,25 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1950 | } | 1945 | } |
1951 | 1946 | ||
1952 | skb = bf->skb; | 1947 | skb = bf->skb; |
1948 | info = IEEE80211_SKB_CB(skb); | ||
1953 | bf->skb = NULL; | 1949 | bf->skb = NULL; |
1950 | |||
1954 | pci_unmap_single(sc->pdev, bf->skbaddr, skb->len, | 1951 | pci_unmap_single(sc->pdev, bf->skbaddr, skb->len, |
1955 | PCI_DMA_TODEVICE); | 1952 | PCI_DMA_TODEVICE); |
1956 | 1953 | ||
1957 | txs.control = bf->ctl; | 1954 | info->status.retry_count = ts.ts_shortretry + ts.ts_longretry / 6; |
1958 | txs.retry_count = ts.ts_shortretry + ts.ts_longretry / 6; | ||
1959 | if (unlikely(ts.ts_status)) { | 1955 | if (unlikely(ts.ts_status)) { |
1960 | sc->ll_stats.dot11ACKFailureCount++; | 1956 | sc->ll_stats.dot11ACKFailureCount++; |
1961 | if (ts.ts_status & AR5K_TXERR_XRETRY) | 1957 | if (ts.ts_status & AR5K_TXERR_XRETRY) |
1962 | txs.excessive_retries = 1; | 1958 | info->status.excessive_retries = 1; |
1963 | else if (ts.ts_status & AR5K_TXERR_FILT) | 1959 | else if (ts.ts_status & AR5K_TXERR_FILT) |
1964 | txs.flags |= IEEE80211_TX_STATUS_TX_FILTERED; | 1960 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
1965 | } else { | 1961 | } else { |
1966 | txs.flags |= IEEE80211_TX_STATUS_ACK; | 1962 | info->flags |= IEEE80211_TX_STAT_ACK; |
1967 | txs.ack_signal = ts.ts_rssi; | 1963 | info->status.ack_signal = ts.ts_rssi; |
1968 | } | 1964 | } |
1969 | 1965 | ||
1970 | ieee80211_tx_status(sc->hw, skb, &txs); | 1966 | ieee80211_tx_status(sc->hw, skb); |
1971 | sc->tx_stats[txq->qnum].count++; | 1967 | sc->tx_stats[txq->qnum].count++; |
1972 | 1968 | ||
1973 | spin_lock(&sc->txbuflock); | 1969 | spin_lock(&sc->txbuflock); |
@@ -2004,10 +2000,10 @@ ath5k_tasklet_tx(unsigned long data) | |||
2004 | * Setup the beacon frame for transmit. | 2000 | * Setup the beacon frame for transmit. |
2005 | */ | 2001 | */ |
2006 | static int | 2002 | static int |
2007 | ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | 2003 | ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) |
2008 | struct ieee80211_tx_control *ctl) | ||
2009 | { | 2004 | { |
2010 | struct sk_buff *skb = bf->skb; | 2005 | struct sk_buff *skb = bf->skb; |
2006 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
2011 | struct ath5k_hw *ah = sc->ah; | 2007 | struct ath5k_hw *ah = sc->ah; |
2012 | struct ath5k_desc *ds; | 2008 | struct ath5k_desc *ds; |
2013 | int ret, antenna = 0; | 2009 | int ret, antenna = 0; |
@@ -2046,7 +2042,8 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | |||
2046 | ret = ah->ah_setup_tx_desc(ah, ds, skb->len, | 2042 | ret = ah->ah_setup_tx_desc(ah, ds, skb->len, |
2047 | ieee80211_get_hdrlen_from_skb(skb), | 2043 | ieee80211_get_hdrlen_from_skb(skb), |
2048 | AR5K_PKT_TYPE_BEACON, (sc->power_level * 2), | 2044 | AR5K_PKT_TYPE_BEACON, (sc->power_level * 2), |
2049 | ctl->tx_rate->hw_value, 1, AR5K_TXKEYIX_INVALID, | 2045 | ieee80211_get_tx_rate(sc->hw, info)->hw_value, |
2046 | 1, AR5K_TXKEYIX_INVALID, | ||
2050 | antenna, flags, 0, 0); | 2047 | antenna, flags, 0, 0); |
2051 | if (ret) | 2048 | if (ret) |
2052 | goto err_unmap; | 2049 | goto err_unmap; |
@@ -2624,11 +2621,11 @@ ath5k_led_event(struct ath5k_softc *sc, int event) | |||
2624 | \********************/ | 2621 | \********************/ |
2625 | 2622 | ||
2626 | static int | 2623 | static int |
2627 | ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 2624 | ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
2628 | struct ieee80211_tx_control *ctl) | ||
2629 | { | 2625 | { |
2630 | struct ath5k_softc *sc = hw->priv; | 2626 | struct ath5k_softc *sc = hw->priv; |
2631 | struct ath5k_buf *bf; | 2627 | struct ath5k_buf *bf; |
2628 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
2632 | unsigned long flags; | 2629 | unsigned long flags; |
2633 | int hdrlen; | 2630 | int hdrlen; |
2634 | int pad; | 2631 | int pad; |
@@ -2654,13 +2651,13 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2654 | memmove(skb->data, skb->data+pad, hdrlen); | 2651 | memmove(skb->data, skb->data+pad, hdrlen); |
2655 | } | 2652 | } |
2656 | 2653 | ||
2657 | sc->led_txrate = ctl->tx_rate->hw_value; | 2654 | sc->led_txrate = ieee80211_get_tx_rate(hw, info)->hw_value; |
2658 | 2655 | ||
2659 | spin_lock_irqsave(&sc->txbuflock, flags); | 2656 | spin_lock_irqsave(&sc->txbuflock, flags); |
2660 | if (list_empty(&sc->txbuf)) { | 2657 | if (list_empty(&sc->txbuf)) { |
2661 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); | 2658 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); |
2662 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2659 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2663 | ieee80211_stop_queue(hw, ctl->queue); | 2660 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); |
2664 | return -1; | 2661 | return -1; |
2665 | } | 2662 | } |
2666 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); | 2663 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); |
@@ -2672,7 +2669,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2672 | 2669 | ||
2673 | bf->skb = skb; | 2670 | bf->skb = skb; |
2674 | 2671 | ||
2675 | if (ath5k_txbuf_setup(sc, bf, ctl)) { | 2672 | if (ath5k_txbuf_setup(sc, bf)) { |
2676 | bf->skb = NULL; | 2673 | bf->skb = NULL; |
2677 | spin_lock_irqsave(&sc->txbuflock, flags); | 2674 | spin_lock_irqsave(&sc->txbuflock, flags); |
2678 | list_add_tail(&bf->list, &sc->txbuf); | 2675 | list_add_tail(&bf->list, &sc->txbuf); |
@@ -3050,8 +3047,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw) | |||
3050 | } | 3047 | } |
3051 | 3048 | ||
3052 | static int | 3049 | static int |
3053 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 3050 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
3054 | struct ieee80211_tx_control *ctl) | ||
3055 | { | 3051 | { |
3056 | struct ath5k_softc *sc = hw->priv; | 3052 | struct ath5k_softc *sc = hw->priv; |
3057 | int ret; | 3053 | int ret; |
@@ -3067,7 +3063,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
3067 | 3063 | ||
3068 | ath5k_txbuf_free(sc, sc->bbuf); | 3064 | ath5k_txbuf_free(sc, sc->bbuf); |
3069 | sc->bbuf->skb = skb; | 3065 | sc->bbuf->skb = skb; |
3070 | ret = ath5k_beacon_setup(sc, sc->bbuf, ctl); | 3066 | ret = ath5k_beacon_setup(sc, sc->bbuf); |
3071 | if (ret) | 3067 | if (ret) |
3072 | sc->bbuf->skb = NULL; | 3068 | sc->bbuf->skb = NULL; |
3073 | else | 3069 | else |