diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-15 06:55:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:11 -0400 |
commit | e039fa4a4195ac4ee895e6f3d1334beed63256fe (patch) | |
tree | cfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless | |
parent | e24549485f859be6518929bb1c9c0257d79f033d (diff) |
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit
information and status in skb->cb rather than allocating extra
memory for it and copying all the data around. To make it fit,
a union is used where only data that is necessary for all steps
is kept outside of the union.
A number of fixes were done by Ivo, as well as the rt2x00 part
of this patch.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
51 files changed, 562 insertions, 745 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c index 22db664a58d9..0ba55ba93958 100644 --- a/drivers/net/wireless/adm8211.c +++ b/drivers/net/wireless/adm8211.c | |||
@@ -324,7 +324,7 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) | |||
324 | for (dirty_tx = priv->dirty_tx; priv->cur_tx - dirty_tx; dirty_tx++) { | 324 | for (dirty_tx = priv->dirty_tx; priv->cur_tx - dirty_tx; dirty_tx++) { |
325 | unsigned int entry = dirty_tx % priv->tx_ring_size; | 325 | unsigned int entry = dirty_tx % priv->tx_ring_size; |
326 | u32 status = le32_to_cpu(priv->tx_ring[entry].status); | 326 | u32 status = le32_to_cpu(priv->tx_ring[entry].status); |
327 | struct ieee80211_tx_status tx_status; | 327 | struct ieee80211_tx_info *txi; |
328 | struct adm8211_tx_ring_info *info; | 328 | struct adm8211_tx_ring_info *info; |
329 | struct sk_buff *skb; | 329 | struct sk_buff *skb; |
330 | 330 | ||
@@ -334,24 +334,23 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) | |||
334 | 334 | ||
335 | info = &priv->tx_buffers[entry]; | 335 | info = &priv->tx_buffers[entry]; |
336 | skb = info->skb; | 336 | skb = info->skb; |
337 | txi = IEEE80211_SKB_CB(skb); | ||
337 | 338 | ||
338 | /* TODO: check TDES0_STATUS_TUF and TDES0_STATUS_TRO */ | 339 | /* TODO: check TDES0_STATUS_TUF and TDES0_STATUS_TRO */ |
339 | 340 | ||
340 | pci_unmap_single(priv->pdev, info->mapping, | 341 | pci_unmap_single(priv->pdev, info->mapping, |
341 | info->skb->len, PCI_DMA_TODEVICE); | 342 | info->skb->len, PCI_DMA_TODEVICE); |
342 | 343 | ||
343 | memset(&tx_status, 0, sizeof(tx_status)); | 344 | memset(&txi->status, 0, sizeof(txi->status)); |
344 | skb_pull(skb, sizeof(struct adm8211_tx_hdr)); | 345 | skb_pull(skb, sizeof(struct adm8211_tx_hdr)); |
345 | memcpy(skb_push(skb, info->hdrlen), skb->cb, info->hdrlen); | 346 | memcpy(skb_push(skb, info->hdrlen), skb->cb, info->hdrlen); |
346 | memcpy(&tx_status.control, &info->tx_control, | 347 | if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK)) { |
347 | sizeof(tx_status.control)); | ||
348 | if (!(tx_status.control.flags & IEEE80211_TXCTL_NO_ACK)) { | ||
349 | if (status & TDES0_STATUS_ES) | 348 | if (status & TDES0_STATUS_ES) |
350 | tx_status.excessive_retries = 1; | 349 | txi->status.excessive_retries = 1; |
351 | else | 350 | else |
352 | tx_status.flags |= IEEE80211_TX_STATUS_ACK; | 351 | txi->flags |= IEEE80211_TX_STAT_ACK; |
353 | } | 352 | } |
354 | ieee80211_tx_status_irqsafe(dev, skb, &tx_status); | 353 | ieee80211_tx_status_irqsafe(dev, skb); |
355 | 354 | ||
356 | info->skb = NULL; | 355 | info->skb = NULL; |
357 | } | 356 | } |
@@ -1638,7 +1637,6 @@ static void adm8211_calc_durations(int *dur, int *plcp, size_t payload_len, int | |||
1638 | /* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */ | 1637 | /* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */ |
1639 | static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, | 1638 | static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, |
1640 | u16 plcp_signal, | 1639 | u16 plcp_signal, |
1641 | struct ieee80211_tx_control *control, | ||
1642 | size_t hdrlen) | 1640 | size_t hdrlen) |
1643 | { | 1641 | { |
1644 | struct adm8211_priv *priv = dev->priv; | 1642 | struct adm8211_priv *priv = dev->priv; |
@@ -1664,7 +1662,6 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
1664 | 1662 | ||
1665 | priv->tx_buffers[entry].skb = skb; | 1663 | priv->tx_buffers[entry].skb = skb; |
1666 | priv->tx_buffers[entry].mapping = mapping; | 1664 | priv->tx_buffers[entry].mapping = mapping; |
1667 | memcpy(&priv->tx_buffers[entry].tx_control, control, sizeof(*control)); | ||
1668 | priv->tx_buffers[entry].hdrlen = hdrlen; | 1665 | priv->tx_buffers[entry].hdrlen = hdrlen; |
1669 | priv->tx_ring[entry].buffer1 = cpu_to_le32(mapping); | 1666 | priv->tx_ring[entry].buffer1 = cpu_to_le32(mapping); |
1670 | 1667 | ||
@@ -1685,17 +1682,17 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
1685 | } | 1682 | } |
1686 | 1683 | ||
1687 | /* Put adm8211_tx_hdr on skb and transmit */ | 1684 | /* Put adm8211_tx_hdr on skb and transmit */ |
1688 | static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 1685 | static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
1689 | struct ieee80211_tx_control *control) | ||
1690 | { | 1686 | { |
1691 | struct adm8211_tx_hdr *txhdr; | 1687 | struct adm8211_tx_hdr *txhdr; |
1692 | u16 fc; | 1688 | u16 fc; |
1693 | size_t payload_len, hdrlen; | 1689 | size_t payload_len, hdrlen; |
1694 | int plcp, dur, len, plcp_signal, short_preamble; | 1690 | int plcp, dur, len, plcp_signal, short_preamble; |
1695 | struct ieee80211_hdr *hdr; | 1691 | struct ieee80211_hdr *hdr; |
1696 | struct ieee80211_rate *txrate = ieee80211_get_tx_rate(dev, control); | 1692 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1693 | struct ieee80211_rate *txrate = ieee80211_get_tx_rate(dev, info); | ||
1697 | 1694 | ||
1698 | short_preamble = !!(txrate->flags & IEEE80211_TXCTL_SHORT_PREAMBLE); | 1695 | short_preamble = !!(txrate->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE); |
1699 | plcp_signal = txrate->bitrate; | 1696 | plcp_signal = txrate->bitrate; |
1700 | 1697 | ||
1701 | hdr = (struct ieee80211_hdr *)skb->data; | 1698 | hdr = (struct ieee80211_hdr *)skb->data; |
@@ -1730,15 +1727,15 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
1730 | if (short_preamble) | 1727 | if (short_preamble) |
1731 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE); | 1728 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE); |
1732 | 1729 | ||
1733 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) | 1730 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
1734 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS); | 1731 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS); |
1735 | 1732 | ||
1736 | if (fc & IEEE80211_FCTL_PROTECTED) | 1733 | if (fc & IEEE80211_FCTL_PROTECTED) |
1737 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE); | 1734 | txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE); |
1738 | 1735 | ||
1739 | txhdr->retry_limit = control->retry_limit; | 1736 | txhdr->retry_limit = info->control.retry_limit; |
1740 | 1737 | ||
1741 | adm8211_tx_raw(dev, skb, plcp_signal, control, hdrlen); | 1738 | adm8211_tx_raw(dev, skb, plcp_signal, hdrlen); |
1742 | 1739 | ||
1743 | return NETDEV_TX_OK; | 1740 | return NETDEV_TX_OK; |
1744 | } | 1741 | } |
diff --git a/drivers/net/wireless/adm8211.h b/drivers/net/wireless/adm8211.h index 8d7c564b3b04..9b190ee26e90 100644 --- a/drivers/net/wireless/adm8211.h +++ b/drivers/net/wireless/adm8211.h | |||
@@ -443,7 +443,6 @@ struct adm8211_rx_ring_info { | |||
443 | struct adm8211_tx_ring_info { | 443 | struct adm8211_tx_ring_info { |
444 | struct sk_buff *skb; | 444 | struct sk_buff *skb; |
445 | dma_addr_t mapping; | 445 | dma_addr_t mapping; |
446 | struct ieee80211_tx_control tx_control; | ||
447 | size_t hdrlen; | 446 | size_t hdrlen; |
448 | }; | 447 | }; |
449 | 448 | ||
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 32ee351a7650..7d97934265db 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,37 +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 = (void*) skb->cb; | ||
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), | 1320 | (sc->power_level * 2), |
1327 | ieee80211_get_tx_rate(sc->hw, ctl)->hw_value, | 1321 | ieee80211_get_tx_rate(sc->hw, info)->hw_value, |
1328 | ctl->retry_limit, keyidx, 0, flags, 0, 0); | 1322 | info->control.retry_limit, keyidx, 0, flags, 0, 0); |
1329 | if (ret) | 1323 | if (ret) |
1330 | goto err_unmap; | 1324 | goto err_unmap; |
1331 | 1325 | ||
@@ -1927,11 +1921,11 @@ next: | |||
1927 | static void | 1921 | static void |
1928 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | 1922 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) |
1929 | { | 1923 | { |
1930 | struct ieee80211_tx_status txs = {}; | ||
1931 | struct ath5k_tx_status ts = {}; | 1924 | struct ath5k_tx_status ts = {}; |
1932 | struct ath5k_buf *bf, *bf0; | 1925 | struct ath5k_buf *bf, *bf0; |
1933 | struct ath5k_desc *ds; | 1926 | struct ath5k_desc *ds; |
1934 | struct sk_buff *skb; | 1927 | struct sk_buff *skb; |
1928 | struct ieee80211_tx_info *info; | ||
1935 | int ret; | 1929 | int ret; |
1936 | 1930 | ||
1937 | spin_lock(&txq->lock); | 1931 | spin_lock(&txq->lock); |
@@ -1951,24 +1945,25 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1951 | } | 1945 | } |
1952 | 1946 | ||
1953 | skb = bf->skb; | 1947 | skb = bf->skb; |
1948 | info = (void*) skb->cb; | ||
1954 | bf->skb = NULL; | 1949 | bf->skb = NULL; |
1950 | |||
1955 | pci_unmap_single(sc->pdev, bf->skbaddr, skb->len, | 1951 | pci_unmap_single(sc->pdev, bf->skbaddr, skb->len, |
1956 | PCI_DMA_TODEVICE); | 1952 | PCI_DMA_TODEVICE); |
1957 | 1953 | ||
1958 | txs.control = bf->ctl; | 1954 | info->status.retry_count = ts.ts_shortretry + ts.ts_longretry / 6; |
1959 | txs.retry_count = ts.ts_shortretry + ts.ts_longretry / 6; | ||
1960 | if (unlikely(ts.ts_status)) { | 1955 | if (unlikely(ts.ts_status)) { |
1961 | sc->ll_stats.dot11ACKFailureCount++; | 1956 | sc->ll_stats.dot11ACKFailureCount++; |
1962 | if (ts.ts_status & AR5K_TXERR_XRETRY) | 1957 | if (ts.ts_status & AR5K_TXERR_XRETRY) |
1963 | txs.excessive_retries = 1; | 1958 | info->status.excessive_retries = 1; |
1964 | else if (ts.ts_status & AR5K_TXERR_FILT) | 1959 | else if (ts.ts_status & AR5K_TXERR_FILT) |
1965 | txs.flags |= IEEE80211_TX_STATUS_TX_FILTERED; | 1960 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
1966 | } else { | 1961 | } else { |
1967 | txs.flags |= IEEE80211_TX_STATUS_ACK; | 1962 | info->flags |= IEEE80211_TX_STAT_ACK; |
1968 | txs.ack_signal = ts.ts_rssi; | 1963 | info->status.ack_signal = ts.ts_rssi; |
1969 | } | 1964 | } |
1970 | 1965 | ||
1971 | ieee80211_tx_status(sc->hw, skb, &txs); | 1966 | ieee80211_tx_status(sc->hw, skb); |
1972 | sc->tx_stats[txq->qnum].count++; | 1967 | sc->tx_stats[txq->qnum].count++; |
1973 | 1968 | ||
1974 | spin_lock(&sc->txbuflock); | 1969 | spin_lock(&sc->txbuflock); |
@@ -2005,10 +2000,10 @@ ath5k_tasklet_tx(unsigned long data) | |||
2005 | * Setup the beacon frame for transmit. | 2000 | * Setup the beacon frame for transmit. |
2006 | */ | 2001 | */ |
2007 | static int | 2002 | static int |
2008 | ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | 2003 | ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) |
2009 | struct ieee80211_tx_control *ctl) | ||
2010 | { | 2004 | { |
2011 | struct sk_buff *skb = bf->skb; | 2005 | struct sk_buff *skb = bf->skb; |
2006 | struct ieee80211_tx_info *info = (void*) skb->cb; | ||
2012 | struct ath5k_hw *ah = sc->ah; | 2007 | struct ath5k_hw *ah = sc->ah; |
2013 | struct ath5k_desc *ds; | 2008 | struct ath5k_desc *ds; |
2014 | int ret, antenna = 0; | 2009 | int ret, antenna = 0; |
@@ -2047,7 +2042,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | |||
2047 | ret = ah->ah_setup_tx_desc(ah, ds, skb->len, | 2042 | ret = ah->ah_setup_tx_desc(ah, ds, skb->len, |
2048 | ieee80211_get_hdrlen_from_skb(skb), | 2043 | ieee80211_get_hdrlen_from_skb(skb), |
2049 | AR5K_PKT_TYPE_BEACON, (sc->power_level * 2), | 2044 | AR5K_PKT_TYPE_BEACON, (sc->power_level * 2), |
2050 | ieee80211_get_tx_rate(sc->hw, ctl)->hw_value, | 2045 | ieee80211_get_tx_rate(sc->hw, info)->hw_value, |
2051 | 1, AR5K_TXKEYIX_INVALID, | 2046 | 1, AR5K_TXKEYIX_INVALID, |
2052 | antenna, flags, 0, 0); | 2047 | antenna, flags, 0, 0); |
2053 | if (ret) | 2048 | if (ret) |
@@ -2626,11 +2621,11 @@ ath5k_led_event(struct ath5k_softc *sc, int event) | |||
2626 | \********************/ | 2621 | \********************/ |
2627 | 2622 | ||
2628 | static int | 2623 | static int |
2629 | ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 2624 | ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
2630 | struct ieee80211_tx_control *ctl) | ||
2631 | { | 2625 | { |
2632 | struct ath5k_softc *sc = hw->priv; | 2626 | struct ath5k_softc *sc = hw->priv; |
2633 | struct ath5k_buf *bf; | 2627 | struct ath5k_buf *bf; |
2628 | struct ieee80211_tx_info *info = (void*) skb->cb; | ||
2634 | unsigned long flags; | 2629 | unsigned long flags; |
2635 | int hdrlen; | 2630 | int hdrlen; |
2636 | int pad; | 2631 | int pad; |
@@ -2656,13 +2651,13 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2656 | memmove(skb->data, skb->data+pad, hdrlen); | 2651 | memmove(skb->data, skb->data+pad, hdrlen); |
2657 | } | 2652 | } |
2658 | 2653 | ||
2659 | sc->led_txrate = ieee80211_get_tx_rate(hw, ctl)->hw_value; | 2654 | sc->led_txrate = ieee80211_get_tx_rate(hw, info)->hw_value; |
2660 | 2655 | ||
2661 | spin_lock_irqsave(&sc->txbuflock, flags); | 2656 | spin_lock_irqsave(&sc->txbuflock, flags); |
2662 | if (list_empty(&sc->txbuf)) { | 2657 | if (list_empty(&sc->txbuf)) { |
2663 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); | 2658 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); |
2664 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2659 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2665 | ieee80211_stop_queue(hw, ctl->queue); | 2660 | ieee80211_stop_queue(hw, info->queue); |
2666 | return -1; | 2661 | return -1; |
2667 | } | 2662 | } |
2668 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); | 2663 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); |
@@ -2674,7 +2669,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2674 | 2669 | ||
2675 | bf->skb = skb; | 2670 | bf->skb = skb; |
2676 | 2671 | ||
2677 | if (ath5k_txbuf_setup(sc, bf, ctl)) { | 2672 | if (ath5k_txbuf_setup(sc, bf)) { |
2678 | bf->skb = NULL; | 2673 | bf->skb = NULL; |
2679 | spin_lock_irqsave(&sc->txbuflock, flags); | 2674 | spin_lock_irqsave(&sc->txbuflock, flags); |
2680 | list_add_tail(&bf->list, &sc->txbuf); | 2675 | list_add_tail(&bf->list, &sc->txbuf); |
@@ -3052,8 +3047,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw) | |||
3052 | } | 3047 | } |
3053 | 3048 | ||
3054 | static int | 3049 | static int |
3055 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 3050 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
3056 | struct ieee80211_tx_control *ctl) | ||
3057 | { | 3051 | { |
3058 | struct ath5k_softc *sc = hw->priv; | 3052 | struct ath5k_softc *sc = hw->priv; |
3059 | int ret; | 3053 | int ret; |
@@ -3069,7 +3063,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
3069 | 3063 | ||
3070 | ath5k_txbuf_free(sc, sc->bbuf); | 3064 | ath5k_txbuf_free(sc, sc->bbuf); |
3071 | sc->bbuf->skb = skb; | 3065 | sc->bbuf->skb = skb; |
3072 | ret = ath5k_beacon_setup(sc, sc->bbuf, ctl); | 3066 | ret = ath5k_beacon_setup(sc, sc->bbuf); |
3073 | if (ret) | 3067 | if (ret) |
3074 | sc->bbuf->skb = NULL; | 3068 | sc->bbuf->skb = NULL; |
3075 | else | 3069 | else |
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index ecb17495488c..bb4b26d523ab 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
@@ -60,7 +60,6 @@ struct ath5k_buf { | |||
60 | dma_addr_t daddr; /* physical addr of desc */ | 60 | dma_addr_t daddr; /* physical addr of desc */ |
61 | struct sk_buff *skb; /* skbuff for buf */ | 61 | struct sk_buff *skb; /* skbuff for buf */ |
62 | dma_addr_t skbaddr;/* physical addr of skb data */ | 62 | dma_addr_t skbaddr;/* physical addr of skb data */ |
63 | struct ieee80211_tx_control ctl; | ||
64 | }; | 63 | }; |
65 | 64 | ||
66 | /* | 65 | /* |
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index 0c2bc061e8f3..aa493830a82d 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -733,7 +733,6 @@ struct b43_wl { | |||
733 | /* The beacon we are currently using (AP or IBSS mode). | 733 | /* The beacon we are currently using (AP or IBSS mode). |
734 | * This beacon stuff is protected by the irq_lock. */ | 734 | * This beacon stuff is protected by the irq_lock. */ |
735 | struct sk_buff *current_beacon; | 735 | struct sk_buff *current_beacon; |
736 | struct ieee80211_tx_control beacon_txctl; | ||
737 | bool beacon0_uploaded; | 736 | bool beacon0_uploaded; |
738 | bool beacon1_uploaded; | 737 | bool beacon1_uploaded; |
739 | struct work_struct beacon_update_trigger; | 738 | struct work_struct beacon_update_trigger; |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index f50e2014ffbe..aced9866d815 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -1131,10 +1131,10 @@ struct b43_dmaring *parse_cookie(struct b43_wldev *dev, u16 cookie, int *slot) | |||
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | static int dma_tx_fragment(struct b43_dmaring *ring, | 1133 | static int dma_tx_fragment(struct b43_dmaring *ring, |
1134 | struct sk_buff *skb, | 1134 | struct sk_buff *skb) |
1135 | struct ieee80211_tx_control *ctl) | ||
1136 | { | 1135 | { |
1137 | const struct b43_dma_ops *ops = ring->ops; | 1136 | const struct b43_dma_ops *ops = ring->ops; |
1137 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1138 | u8 *header; | 1138 | u8 *header; |
1139 | int slot, old_top_slot, old_used_slots; | 1139 | int slot, old_top_slot, old_used_slots; |
1140 | int err; | 1140 | int err; |
@@ -1158,7 +1158,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1158 | header = &(ring->txhdr_cache[slot * hdrsize]); | 1158 | header = &(ring->txhdr_cache[slot * hdrsize]); |
1159 | cookie = generate_cookie(ring, slot); | 1159 | cookie = generate_cookie(ring, slot); |
1160 | err = b43_generate_txhdr(ring->dev, header, | 1160 | err = b43_generate_txhdr(ring->dev, header, |
1161 | skb->data, skb->len, ctl, cookie); | 1161 | skb->data, skb->len, info, cookie); |
1162 | if (unlikely(err)) { | 1162 | if (unlikely(err)) { |
1163 | ring->current_slot = old_top_slot; | 1163 | ring->current_slot = old_top_slot; |
1164 | ring->used_slots = old_used_slots; | 1164 | ring->used_slots = old_used_slots; |
@@ -1180,7 +1180,6 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1180 | desc = ops->idx2desc(ring, slot, &meta); | 1180 | desc = ops->idx2desc(ring, slot, &meta); |
1181 | memset(meta, 0, sizeof(*meta)); | 1181 | memset(meta, 0, sizeof(*meta)); |
1182 | 1182 | ||
1183 | memcpy(&meta->txstat.control, ctl, sizeof(*ctl)); | ||
1184 | meta->skb = skb; | 1183 | meta->skb = skb; |
1185 | meta->is_last_fragment = 1; | 1184 | meta->is_last_fragment = 1; |
1186 | 1185 | ||
@@ -1210,7 +1209,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1210 | 1209 | ||
1211 | ops->fill_descriptor(ring, desc, meta->dmaaddr, skb->len, 0, 1, 1); | 1210 | ops->fill_descriptor(ring, desc, meta->dmaaddr, skb->len, 0, 1, 1); |
1212 | 1211 | ||
1213 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 1212 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { |
1214 | /* Tell the firmware about the cookie of the last | 1213 | /* Tell the firmware about the cookie of the last |
1215 | * mcast frame, so it can clear the more-data bit in it. */ | 1214 | * mcast frame, so it can clear the more-data bit in it. */ |
1216 | b43_shm_write16(ring->dev, B43_SHM_SHARED, | 1215 | b43_shm_write16(ring->dev, B43_SHM_SHARED, |
@@ -1281,16 +1280,16 @@ static struct b43_dmaring * select_ring_by_priority(struct b43_wldev *dev, | |||
1281 | return ring; | 1280 | return ring; |
1282 | } | 1281 | } |
1283 | 1282 | ||
1284 | int b43_dma_tx(struct b43_wldev *dev, | 1283 | int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) |
1285 | struct sk_buff *skb, struct ieee80211_tx_control *ctl) | ||
1286 | { | 1284 | { |
1287 | struct b43_dmaring *ring; | 1285 | struct b43_dmaring *ring; |
1288 | struct ieee80211_hdr *hdr; | 1286 | struct ieee80211_hdr *hdr; |
1289 | int err = 0; | 1287 | int err = 0; |
1290 | unsigned long flags; | 1288 | unsigned long flags; |
1289 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1291 | 1290 | ||
1292 | hdr = (struct ieee80211_hdr *)skb->data; | 1291 | hdr = (struct ieee80211_hdr *)skb->data; |
1293 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 1292 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { |
1294 | /* The multicast ring will be sent after the DTIM */ | 1293 | /* The multicast ring will be sent after the DTIM */ |
1295 | ring = dev->dma.tx_ring_mcast; | 1294 | ring = dev->dma.tx_ring_mcast; |
1296 | /* Set the more-data bit. Ucode will clear it on | 1295 | /* Set the more-data bit. Ucode will clear it on |
@@ -1298,7 +1297,7 @@ int b43_dma_tx(struct b43_wldev *dev, | |||
1298 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); | 1297 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); |
1299 | } else { | 1298 | } else { |
1300 | /* Decide by priority where to put this frame. */ | 1299 | /* Decide by priority where to put this frame. */ |
1301 | ring = select_ring_by_priority(dev, ctl->queue); | 1300 | ring = select_ring_by_priority(dev, info->queue); |
1302 | } | 1301 | } |
1303 | 1302 | ||
1304 | spin_lock_irqsave(&ring->lock, flags); | 1303 | spin_lock_irqsave(&ring->lock, flags); |
@@ -1316,9 +1315,9 @@ int b43_dma_tx(struct b43_wldev *dev, | |||
1316 | /* Assign the queue number to the ring (if not already done before) | 1315 | /* Assign the queue number to the ring (if not already done before) |
1317 | * so TX status handling can use it. The queue to ring mapping is | 1316 | * so TX status handling can use it. The queue to ring mapping is |
1318 | * static, so we don't need to store it per frame. */ | 1317 | * static, so we don't need to store it per frame. */ |
1319 | ring->queue_prio = ctl->queue; | 1318 | ring->queue_prio = info->queue; |
1320 | 1319 | ||
1321 | err = dma_tx_fragment(ring, skb, ctl); | 1320 | err = dma_tx_fragment(ring, skb); |
1322 | if (unlikely(err == -ENOKEY)) { | 1321 | if (unlikely(err == -ENOKEY)) { |
1323 | /* Drop this packet, as we don't have the encryption key | 1322 | /* Drop this packet, as we don't have the encryption key |
1324 | * anymore and must not transmit it unencrypted. */ | 1323 | * anymore and must not transmit it unencrypted. */ |
@@ -1334,7 +1333,7 @@ int b43_dma_tx(struct b43_wldev *dev, | |||
1334 | if ((free_slots(ring) < SLOTS_PER_PACKET) || | 1333 | if ((free_slots(ring) < SLOTS_PER_PACKET) || |
1335 | should_inject_overflow(ring)) { | 1334 | should_inject_overflow(ring)) { |
1336 | /* This TX ring is full. */ | 1335 | /* This TX ring is full. */ |
1337 | ieee80211_stop_queue(dev->wl->hw, ctl->queue); | 1336 | ieee80211_stop_queue(dev->wl->hw, info->queue); |
1338 | ring->stopped = 1; | 1337 | ring->stopped = 1; |
1339 | if (b43_debug(dev, B43_DBG_DMAVERBOSE)) { | 1338 | if (b43_debug(dev, B43_DBG_DMAVERBOSE)) { |
1340 | b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index); | 1339 | b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index); |
@@ -1377,13 +1376,19 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, | |||
1377 | b43_txhdr_size(dev), 1); | 1376 | b43_txhdr_size(dev), 1); |
1378 | 1377 | ||
1379 | if (meta->is_last_fragment) { | 1378 | if (meta->is_last_fragment) { |
1380 | B43_WARN_ON(!meta->skb); | 1379 | struct ieee80211_tx_info *info; |
1381 | /* Call back to inform the ieee80211 subsystem about the | 1380 | |
1382 | * status of the transmission. | 1381 | BUG_ON(!meta->skb); |
1383 | * Some fields of txstat are already filled in dma_tx(). | 1382 | |
1383 | info = IEEE80211_SKB_CB(meta->skb); | ||
1384 | |||
1385 | memset(&info->status, 0, sizeof(info->status)); | ||
1386 | |||
1387 | /* | ||
1388 | * Call back to inform the ieee80211 subsystem about | ||
1389 | * the status of the transmission. | ||
1384 | */ | 1390 | */ |
1385 | frame_succeed = b43_fill_txstatus_report( | 1391 | frame_succeed = b43_fill_txstatus_report(info, status); |
1386 | &(meta->txstat), status); | ||
1387 | #ifdef CONFIG_B43_DEBUG | 1392 | #ifdef CONFIG_B43_DEBUG |
1388 | if (frame_succeed) | 1393 | if (frame_succeed) |
1389 | ring->nr_succeed_tx_packets++; | 1394 | ring->nr_succeed_tx_packets++; |
@@ -1391,8 +1396,8 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, | |||
1391 | ring->nr_failed_tx_packets++; | 1396 | ring->nr_failed_tx_packets++; |
1392 | ring->nr_total_packet_tries += status->frame_count; | 1397 | ring->nr_total_packet_tries += status->frame_count; |
1393 | #endif /* DEBUG */ | 1398 | #endif /* DEBUG */ |
1394 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb, | 1399 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb); |
1395 | &(meta->txstat)); | 1400 | |
1396 | /* skb is freed by ieee80211_tx_status_irqsafe() */ | 1401 | /* skb is freed by ieee80211_tx_status_irqsafe() */ |
1397 | meta->skb = NULL; | 1402 | meta->skb = NULL; |
1398 | } else { | 1403 | } else { |
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h index 20acf885dba5..d1eb5c0848a5 100644 --- a/drivers/net/wireless/b43/dma.h +++ b/drivers/net/wireless/b43/dma.h | |||
@@ -181,7 +181,6 @@ struct b43_dmadesc_meta { | |||
181 | dma_addr_t dmaaddr; | 181 | dma_addr_t dmaaddr; |
182 | /* ieee80211 TX status. Only used once per 802.11 frag. */ | 182 | /* ieee80211 TX status. Only used once per 802.11 frag. */ |
183 | bool is_last_fragment; | 183 | bool is_last_fragment; |
184 | struct ieee80211_tx_status txstat; | ||
185 | }; | 184 | }; |
186 | 185 | ||
187 | struct b43_dmaring; | 186 | struct b43_dmaring; |
@@ -285,7 +284,7 @@ void b43_dma_get_tx_stats(struct b43_wldev *dev, | |||
285 | struct ieee80211_tx_queue_stats *stats); | 284 | struct ieee80211_tx_queue_stats *stats); |
286 | 285 | ||
287 | int b43_dma_tx(struct b43_wldev *dev, | 286 | int b43_dma_tx(struct b43_wldev *dev, |
288 | struct sk_buff *skb, struct ieee80211_tx_control *ctl); | 287 | struct sk_buff *skb); |
289 | void b43_dma_handle_txstatus(struct b43_wldev *dev, | 288 | void b43_dma_handle_txstatus(struct b43_wldev *dev, |
290 | const struct b43_txstatus *status); | 289 | const struct b43_txstatus *status); |
291 | 290 | ||
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index e428645352b4..3622d76de1e1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1368,18 +1368,18 @@ static void b43_write_beacon_template(struct b43_wldev *dev, | |||
1368 | unsigned int rate; | 1368 | unsigned int rate; |
1369 | u16 ctl; | 1369 | u16 ctl; |
1370 | int antenna; | 1370 | int antenna; |
1371 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon); | ||
1371 | 1372 | ||
1372 | bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data); | 1373 | bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data); |
1373 | len = min((size_t) dev->wl->current_beacon->len, | 1374 | len = min((size_t) dev->wl->current_beacon->len, |
1374 | 0x200 - sizeof(struct b43_plcp_hdr6)); | 1375 | 0x200 - sizeof(struct b43_plcp_hdr6)); |
1375 | rate = ieee80211_get_tx_rate(dev->wl->hw, &dev->wl->beacon_txctl)->hw_value; | 1376 | rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value; |
1376 | 1377 | ||
1377 | b43_write_template_common(dev, (const u8 *)bcn, | 1378 | b43_write_template_common(dev, (const u8 *)bcn, |
1378 | len, ram_offset, shm_size_offset, rate); | 1379 | len, ram_offset, shm_size_offset, rate); |
1379 | 1380 | ||
1380 | /* Write the PHY TX control parameters. */ | 1381 | /* Write the PHY TX control parameters. */ |
1381 | antenna = b43_antenna_from_ieee80211(dev, | 1382 | antenna = b43_antenna_from_ieee80211(dev, info->antenna_sel_tx); |
1382 | dev->wl->beacon_txctl.antenna_sel_tx); | ||
1383 | antenna = b43_antenna_to_phyctl(antenna); | 1383 | antenna = b43_antenna_to_phyctl(antenna); |
1384 | ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); | 1384 | ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL); |
1385 | /* We can't send beacons with short preamble. Would get PHY errors. */ | 1385 | /* We can't send beacons with short preamble. Would get PHY errors. */ |
@@ -1613,8 +1613,7 @@ static void b43_beacon_update_trigger_work(struct work_struct *work) | |||
1613 | 1613 | ||
1614 | /* Asynchronously update the packet templates in template RAM. | 1614 | /* Asynchronously update the packet templates in template RAM. |
1615 | * Locking: Requires wl->irq_lock to be locked. */ | 1615 | * Locking: Requires wl->irq_lock to be locked. */ |
1616 | static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon, | 1616 | static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon) |
1617 | const struct ieee80211_tx_control *txctl) | ||
1618 | { | 1617 | { |
1619 | /* This is the top half of the ansynchronous beacon update. | 1618 | /* This is the top half of the ansynchronous beacon update. |
1620 | * The bottom half is the beacon IRQ. | 1619 | * The bottom half is the beacon IRQ. |
@@ -1625,7 +1624,6 @@ static void b43_update_templates(struct b43_wl *wl, struct sk_buff *beacon, | |||
1625 | if (wl->current_beacon) | 1624 | if (wl->current_beacon) |
1626 | dev_kfree_skb_any(wl->current_beacon); | 1625 | dev_kfree_skb_any(wl->current_beacon); |
1627 | wl->current_beacon = beacon; | 1626 | wl->current_beacon = beacon; |
1628 | memcpy(&wl->beacon_txctl, txctl, sizeof(wl->beacon_txctl)); | ||
1629 | wl->beacon0_uploaded = 0; | 1627 | wl->beacon0_uploaded = 0; |
1630 | wl->beacon1_uploaded = 0; | 1628 | wl->beacon1_uploaded = 0; |
1631 | queue_work(wl->hw->workqueue, &wl->beacon_update_trigger); | 1629 | queue_work(wl->hw->workqueue, &wl->beacon_update_trigger); |
@@ -2813,8 +2811,7 @@ static int b43_rng_init(struct b43_wl *wl) | |||
2813 | } | 2811 | } |
2814 | 2812 | ||
2815 | static int b43_op_tx(struct ieee80211_hw *hw, | 2813 | static int b43_op_tx(struct ieee80211_hw *hw, |
2816 | struct sk_buff *skb, | 2814 | struct sk_buff *skb) |
2817 | struct ieee80211_tx_control *ctl) | ||
2818 | { | 2815 | { |
2819 | struct b43_wl *wl = hw_to_b43_wl(hw); | 2816 | struct b43_wl *wl = hw_to_b43_wl(hw); |
2820 | struct b43_wldev *dev = wl->current_dev; | 2817 | struct b43_wldev *dev = wl->current_dev; |
@@ -2836,9 +2833,9 @@ static int b43_op_tx(struct ieee80211_hw *hw, | |||
2836 | err = -ENODEV; | 2833 | err = -ENODEV; |
2837 | if (likely(b43_status(dev) >= B43_STAT_STARTED)) { | 2834 | if (likely(b43_status(dev) >= B43_STAT_STARTED)) { |
2838 | if (b43_using_pio_transfers(dev)) | 2835 | if (b43_using_pio_transfers(dev)) |
2839 | err = b43_pio_tx(dev, skb, ctl); | 2836 | err = b43_pio_tx(dev, skb); |
2840 | else | 2837 | else |
2841 | err = b43_dma_tx(dev, skb, ctl); | 2838 | err = b43_dma_tx(dev, skb); |
2842 | } | 2839 | } |
2843 | 2840 | ||
2844 | read_unlock_irqrestore(&wl->tx_lock, flags); | 2841 | read_unlock_irqrestore(&wl->tx_lock, flags); |
@@ -3429,10 +3426,8 @@ static int b43_op_config_interface(struct ieee80211_hw *hw, | |||
3429 | if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP)) { | 3426 | if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP)) { |
3430 | B43_WARN_ON(conf->type != IEEE80211_IF_TYPE_AP); | 3427 | B43_WARN_ON(conf->type != IEEE80211_IF_TYPE_AP); |
3431 | b43_set_ssid(dev, conf->ssid, conf->ssid_len); | 3428 | b43_set_ssid(dev, conf->ssid, conf->ssid_len); |
3432 | if (conf->beacon) { | 3429 | if (conf->beacon) |
3433 | b43_update_templates(wl, conf->beacon, | 3430 | b43_update_templates(wl, conf->beacon); |
3434 | conf->beacon_control); | ||
3435 | } | ||
3436 | } | 3431 | } |
3437 | b43_write_mac_bssid_templates(dev); | 3432 | b43_write_mac_bssid_templates(dev); |
3438 | } | 3433 | } |
@@ -4118,31 +4113,29 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set) | |||
4118 | struct b43_wl *wl = hw_to_b43_wl(hw); | 4113 | struct b43_wl *wl = hw_to_b43_wl(hw); |
4119 | struct sk_buff *beacon; | 4114 | struct sk_buff *beacon; |
4120 | unsigned long flags; | 4115 | unsigned long flags; |
4121 | struct ieee80211_tx_control txctl; | ||
4122 | 4116 | ||
4123 | /* We could modify the existing beacon and set the aid bit in | 4117 | /* We could modify the existing beacon and set the aid bit in |
4124 | * the TIM field, but that would probably require resizing and | 4118 | * the TIM field, but that would probably require resizing and |
4125 | * moving of data within the beacon template. | 4119 | * moving of data within the beacon template. |
4126 | * Simply request a new beacon and let mac80211 do the hard work. */ | 4120 | * Simply request a new beacon and let mac80211 do the hard work. */ |
4127 | beacon = ieee80211_beacon_get(hw, wl->vif, &txctl); | 4121 | beacon = ieee80211_beacon_get(hw, wl->vif); |
4128 | if (unlikely(!beacon)) | 4122 | if (unlikely(!beacon)) |
4129 | return -ENOMEM; | 4123 | return -ENOMEM; |
4130 | spin_lock_irqsave(&wl->irq_lock, flags); | 4124 | spin_lock_irqsave(&wl->irq_lock, flags); |
4131 | b43_update_templates(wl, beacon, &txctl); | 4125 | b43_update_templates(wl, beacon); |
4132 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 4126 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
4133 | 4127 | ||
4134 | return 0; | 4128 | return 0; |
4135 | } | 4129 | } |
4136 | 4130 | ||
4137 | static int b43_op_ibss_beacon_update(struct ieee80211_hw *hw, | 4131 | static int b43_op_ibss_beacon_update(struct ieee80211_hw *hw, |
4138 | struct sk_buff *beacon, | 4132 | struct sk_buff *beacon) |
4139 | struct ieee80211_tx_control *ctl) | ||
4140 | { | 4133 | { |
4141 | struct b43_wl *wl = hw_to_b43_wl(hw); | 4134 | struct b43_wl *wl = hw_to_b43_wl(hw); |
4142 | unsigned long flags; | 4135 | unsigned long flags; |
4143 | 4136 | ||
4144 | spin_lock_irqsave(&wl->irq_lock, flags); | 4137 | spin_lock_irqsave(&wl->irq_lock, flags); |
4145 | b43_update_templates(wl, beacon, ctl); | 4138 | b43_update_templates(wl, beacon); |
4146 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 4139 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
4147 | 4140 | ||
4148 | return 0; | 4141 | return 0; |
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c index 08c8a087f30e..284786a94e7d 100644 --- a/drivers/net/wireless/b43/pio.c +++ b/drivers/net/wireless/b43/pio.c | |||
@@ -446,29 +446,27 @@ static void pio_tx_frame_4byte_queue(struct b43_pio_txpacket *pack, | |||
446 | } | 446 | } |
447 | 447 | ||
448 | static int pio_tx_frame(struct b43_pio_txqueue *q, | 448 | static int pio_tx_frame(struct b43_pio_txqueue *q, |
449 | struct sk_buff *skb, | 449 | struct sk_buff *skb) |
450 | struct ieee80211_tx_control *ctl) | ||
451 | { | 450 | { |
452 | struct b43_pio_txpacket *pack; | 451 | struct b43_pio_txpacket *pack; |
453 | struct b43_txhdr txhdr; | 452 | struct b43_txhdr txhdr; |
454 | u16 cookie; | 453 | u16 cookie; |
455 | int err; | 454 | int err; |
456 | unsigned int hdrlen; | 455 | unsigned int hdrlen; |
456 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
457 | 457 | ||
458 | B43_WARN_ON(list_empty(&q->packets_list)); | 458 | B43_WARN_ON(list_empty(&q->packets_list)); |
459 | pack = list_entry(q->packets_list.next, | 459 | pack = list_entry(q->packets_list.next, |
460 | struct b43_pio_txpacket, list); | 460 | struct b43_pio_txpacket, list); |
461 | memset(&pack->txstat, 0, sizeof(pack->txstat)); | ||
462 | memcpy(&pack->txstat.control, ctl, sizeof(*ctl)); | ||
463 | 461 | ||
464 | cookie = generate_cookie(q, pack); | 462 | cookie = generate_cookie(q, pack); |
465 | hdrlen = b43_txhdr_size(q->dev); | 463 | hdrlen = b43_txhdr_size(q->dev); |
466 | err = b43_generate_txhdr(q->dev, (u8 *)&txhdr, skb->data, | 464 | err = b43_generate_txhdr(q->dev, (u8 *)&txhdr, skb->data, |
467 | skb->len, ctl, cookie); | 465 | skb->len, info, cookie); |
468 | if (err) | 466 | if (err) |
469 | return err; | 467 | return err; |
470 | 468 | ||
471 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 469 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { |
472 | /* Tell the firmware about the cookie of the last | 470 | /* Tell the firmware about the cookie of the last |
473 | * mcast frame, so it can clear the more-data bit in it. */ | 471 | * mcast frame, so it can clear the more-data bit in it. */ |
474 | b43_shm_write16(q->dev, B43_SHM_SHARED, | 472 | b43_shm_write16(q->dev, B43_SHM_SHARED, |
@@ -492,17 +490,18 @@ static int pio_tx_frame(struct b43_pio_txqueue *q, | |||
492 | return 0; | 490 | return 0; |
493 | } | 491 | } |
494 | 492 | ||
495 | int b43_pio_tx(struct b43_wldev *dev, | 493 | int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb) |
496 | struct sk_buff *skb, struct ieee80211_tx_control *ctl) | ||
497 | { | 494 | { |
498 | struct b43_pio_txqueue *q; | 495 | struct b43_pio_txqueue *q; |
499 | struct ieee80211_hdr *hdr; | 496 | struct ieee80211_hdr *hdr; |
500 | unsigned long flags; | 497 | unsigned long flags; |
501 | unsigned int hdrlen, total_len; | 498 | unsigned int hdrlen, total_len; |
502 | int err = 0; | 499 | int err = 0; |
500 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
503 | 501 | ||
504 | hdr = (struct ieee80211_hdr *)skb->data; | 502 | hdr = (struct ieee80211_hdr *)skb->data; |
505 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 503 | |
504 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { | ||
506 | /* The multicast queue will be sent after the DTIM. */ | 505 | /* The multicast queue will be sent after the DTIM. */ |
507 | q = dev->pio.tx_queue_mcast; | 506 | q = dev->pio.tx_queue_mcast; |
508 | /* Set the frame More-Data bit. Ucode will clear it | 507 | /* Set the frame More-Data bit. Ucode will clear it |
@@ -510,7 +509,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
510 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); | 509 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); |
511 | } else { | 510 | } else { |
512 | /* Decide by priority where to put this frame. */ | 511 | /* Decide by priority where to put this frame. */ |
513 | q = select_queue_by_priority(dev, ctl->queue); | 512 | q = select_queue_by_priority(dev, info->queue); |
514 | } | 513 | } |
515 | 514 | ||
516 | spin_lock_irqsave(&q->lock, flags); | 515 | spin_lock_irqsave(&q->lock, flags); |
@@ -533,7 +532,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
533 | if (total_len > (q->buffer_size - q->buffer_used)) { | 532 | if (total_len > (q->buffer_size - q->buffer_used)) { |
534 | /* Not enough memory on the queue. */ | 533 | /* Not enough memory on the queue. */ |
535 | err = -EBUSY; | 534 | err = -EBUSY; |
536 | ieee80211_stop_queue(dev->wl->hw, ctl->queue); | 535 | ieee80211_stop_queue(dev->wl->hw, info->queue); |
537 | q->stopped = 1; | 536 | q->stopped = 1; |
538 | goto out_unlock; | 537 | goto out_unlock; |
539 | } | 538 | } |
@@ -541,9 +540,9 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
541 | /* Assign the queue number to the ring (if not already done before) | 540 | /* Assign the queue number to the ring (if not already done before) |
542 | * so TX status handling can use it. The mac80211-queue to b43-queue | 541 | * so TX status handling can use it. The mac80211-queue to b43-queue |
543 | * mapping is static, so we don't need to store it per frame. */ | 542 | * mapping is static, so we don't need to store it per frame. */ |
544 | q->queue_prio = ctl->queue; | 543 | q->queue_prio = info->queue; |
545 | 544 | ||
546 | err = pio_tx_frame(q, skb, ctl); | 545 | err = pio_tx_frame(q, skb); |
547 | if (unlikely(err == -ENOKEY)) { | 546 | if (unlikely(err == -ENOKEY)) { |
548 | /* Drop this packet, as we don't have the encryption key | 547 | /* Drop this packet, as we don't have the encryption key |
549 | * anymore and must not transmit it unencrypted. */ | 548 | * anymore and must not transmit it unencrypted. */ |
@@ -561,7 +560,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
561 | if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || | 560 | if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || |
562 | (q->free_packet_slots == 0)) { | 561 | (q->free_packet_slots == 0)) { |
563 | /* The queue is full. */ | 562 | /* The queue is full. */ |
564 | ieee80211_stop_queue(dev->wl->hw, ctl->queue); | 563 | ieee80211_stop_queue(dev->wl->hw, info->queue); |
565 | q->stopped = 1; | 564 | q->stopped = 1; |
566 | } | 565 | } |
567 | 566 | ||
@@ -578,6 +577,7 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev, | |||
578 | struct b43_pio_txqueue *q; | 577 | struct b43_pio_txqueue *q; |
579 | struct b43_pio_txpacket *pack = NULL; | 578 | struct b43_pio_txpacket *pack = NULL; |
580 | unsigned int total_len; | 579 | unsigned int total_len; |
580 | struct ieee80211_tx_info *info; | ||
581 | 581 | ||
582 | q = parse_cookie(dev, status->cookie, &pack); | 582 | q = parse_cookie(dev, status->cookie, &pack); |
583 | if (unlikely(!q)) | 583 | if (unlikely(!q)) |
@@ -586,15 +586,17 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev, | |||
586 | 586 | ||
587 | spin_lock(&q->lock); /* IRQs are already disabled. */ | 587 | spin_lock(&q->lock); /* IRQs are already disabled. */ |
588 | 588 | ||
589 | b43_fill_txstatus_report(&(pack->txstat), status); | 589 | info = (void *)pack->skb; |
590 | memset(&info->status, 0, sizeof(info->status)); | ||
591 | |||
592 | b43_fill_txstatus_report(info, status); | ||
590 | 593 | ||
591 | total_len = pack->skb->len + b43_txhdr_size(dev); | 594 | total_len = pack->skb->len + b43_txhdr_size(dev); |
592 | total_len = roundup(total_len, 4); | 595 | total_len = roundup(total_len, 4); |
593 | q->buffer_used -= total_len; | 596 | q->buffer_used -= total_len; |
594 | q->free_packet_slots += 1; | 597 | q->free_packet_slots += 1; |
595 | 598 | ||
596 | ieee80211_tx_status_irqsafe(dev->wl->hw, pack->skb, | 599 | ieee80211_tx_status_irqsafe(dev->wl->hw, pack->skb); |
597 | &(pack->txstat)); | ||
598 | pack->skb = NULL; | 600 | pack->skb = NULL; |
599 | list_add(&pack->list, &q->packets_list); | 601 | list_add(&pack->list, &q->packets_list); |
600 | 602 | ||
diff --git a/drivers/net/wireless/b43/pio.h b/drivers/net/wireless/b43/pio.h index e2ec676cc9e4..6c174c91ca20 100644 --- a/drivers/net/wireless/b43/pio.h +++ b/drivers/net/wireless/b43/pio.h | |||
@@ -62,8 +62,6 @@ struct b43_pio_txpacket { | |||
62 | struct b43_pio_txqueue *queue; | 62 | struct b43_pio_txqueue *queue; |
63 | /* The TX data packet. */ | 63 | /* The TX data packet. */ |
64 | struct sk_buff *skb; | 64 | struct sk_buff *skb; |
65 | /* The status meta data. */ | ||
66 | struct ieee80211_tx_status txstat; | ||
67 | /* Index in the (struct b43_pio_txqueue)->packets array. */ | 65 | /* Index in the (struct b43_pio_txqueue)->packets array. */ |
68 | u8 index; | 66 | u8 index; |
69 | 67 | ||
@@ -167,8 +165,7 @@ int b43_pio_init(struct b43_wldev *dev); | |||
167 | void b43_pio_stop(struct b43_wldev *dev); | 165 | void b43_pio_stop(struct b43_wldev *dev); |
168 | void b43_pio_free(struct b43_wldev *dev); | 166 | void b43_pio_free(struct b43_wldev *dev); |
169 | 167 | ||
170 | int b43_pio_tx(struct b43_wldev *dev, | 168 | int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb); |
171 | struct sk_buff *skb, struct ieee80211_tx_control *ctl); | ||
172 | void b43_pio_handle_txstatus(struct b43_wldev *dev, | 169 | void b43_pio_handle_txstatus(struct b43_wldev *dev, |
173 | const struct b43_txstatus *status); | 170 | const struct b43_txstatus *status); |
174 | void b43_pio_get_tx_stats(struct b43_wldev *dev, | 171 | void b43_pio_get_tx_stats(struct b43_wldev *dev, |
@@ -193,8 +190,7 @@ static inline void b43_pio_stop(struct b43_wldev *dev) | |||
193 | { | 190 | { |
194 | } | 191 | } |
195 | static inline int b43_pio_tx(struct b43_wldev *dev, | 192 | static inline int b43_pio_tx(struct b43_wldev *dev, |
196 | struct sk_buff *skb, | 193 | struct sk_buff *skb) |
197 | struct ieee80211_tx_control *ctl) | ||
198 | { | 194 | { |
199 | return 0; | 195 | return 0; |
200 | } | 196 | } |
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c index 9b682a3cf5e4..f9e1cff2aecb 100644 --- a/drivers/net/wireless/b43/xmit.c +++ b/drivers/net/wireless/b43/xmit.c | |||
@@ -185,14 +185,14 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
185 | u8 *_txhdr, | 185 | u8 *_txhdr, |
186 | const unsigned char *fragment_data, | 186 | const unsigned char *fragment_data, |
187 | unsigned int fragment_len, | 187 | unsigned int fragment_len, |
188 | const struct ieee80211_tx_control *txctl, | 188 | const struct ieee80211_tx_info *info, |
189 | u16 cookie) | 189 | u16 cookie) |
190 | { | 190 | { |
191 | struct b43_txhdr *txhdr = (struct b43_txhdr *)_txhdr; | 191 | struct b43_txhdr *txhdr = (struct b43_txhdr *)_txhdr; |
192 | const struct b43_phy *phy = &dev->phy; | 192 | const struct b43_phy *phy = &dev->phy; |
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 = (!(txctl->flags & IEEE80211_TXCTL_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 | u16 fctl = le16_to_cpu(wlhdr->frame_control); |
197 | struct ieee80211_rate *fbrate; | 197 | struct ieee80211_rate *fbrate; |
198 | u8 rate, rate_fb; | 198 | u8 rate, rate_fb; |
@@ -205,10 +205,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
205 | 205 | ||
206 | memset(txhdr, 0, sizeof(*txhdr)); | 206 | memset(txhdr, 0, sizeof(*txhdr)); |
207 | 207 | ||
208 | txrate = ieee80211_get_tx_rate(dev->wl->hw, txctl); | 208 | txrate = ieee80211_get_tx_rate(dev->wl->hw, info); |
209 | rate = txrate ? txrate->hw_value : B43_CCK_RATE_1MB; | 209 | rate = txrate ? txrate->hw_value : B43_CCK_RATE_1MB; |
210 | rate_ofdm = b43_is_ofdm_rate(rate); | 210 | rate_ofdm = b43_is_ofdm_rate(rate); |
211 | fbrate = ieee80211_get_alt_retry_rate(dev->wl->hw, txctl) ? : txrate; | 211 | fbrate = ieee80211_get_alt_retry_rate(dev->wl->hw, info) ? : txrate; |
212 | rate_fb = fbrate->hw_value; | 212 | rate_fb = fbrate->hw_value; |
213 | rate_fb_ofdm = b43_is_ofdm_rate(rate_fb); | 213 | rate_fb_ofdm = b43_is_ofdm_rate(rate_fb); |
214 | 214 | ||
@@ -228,15 +228,13 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
228 | * use the original dur_id field. */ | 228 | * use the original dur_id field. */ |
229 | txhdr->dur_fb = wlhdr->duration_id; | 229 | txhdr->dur_fb = wlhdr->duration_id; |
230 | } else { | 230 | } else { |
231 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, | 231 | txhdr->dur_fb = ieee80211_generic_frame_duration( |
232 | txctl->vif, | 232 | dev->wl->hw, info->control.vif, fragment_len, fbrate); |
233 | fragment_len, | ||
234 | fbrate); | ||
235 | } | 233 | } |
236 | 234 | ||
237 | plcp_fragment_len = fragment_len + FCS_LEN; | 235 | plcp_fragment_len = fragment_len + FCS_LEN; |
238 | if (use_encryption) { | 236 | if (use_encryption) { |
239 | u8 key_idx = txctl->hw_key->hw_key_idx; | 237 | u8 key_idx = info->control.hw_key->hw_key_idx; |
240 | struct b43_key *key; | 238 | struct b43_key *key; |
241 | int wlhdr_len; | 239 | int wlhdr_len; |
242 | size_t iv_len; | 240 | size_t iv_len; |
@@ -254,7 +252,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
254 | } | 252 | } |
255 | 253 | ||
256 | /* Hardware appends ICV. */ | 254 | /* Hardware appends ICV. */ |
257 | plcp_fragment_len += txctl->icv_len; | 255 | plcp_fragment_len += info->control.icv_len; |
258 | 256 | ||
259 | key_idx = b43_kidx_to_fw(dev, key_idx); | 257 | key_idx = b43_kidx_to_fw(dev, key_idx); |
260 | mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) & | 258 | mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) & |
@@ -262,7 +260,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
262 | mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & | 260 | mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & |
263 | B43_TXH_MAC_KEYALG; | 261 | B43_TXH_MAC_KEYALG; |
264 | wlhdr_len = ieee80211_get_hdrlen(fctl); | 262 | wlhdr_len = ieee80211_get_hdrlen(fctl); |
265 | iv_len = min((size_t) txctl->iv_len, | 263 | iv_len = min((size_t) info->control.iv_len, |
266 | ARRAY_SIZE(txhdr->iv)); | 264 | ARRAY_SIZE(txhdr->iv)); |
267 | memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); | 265 | memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); |
268 | } | 266 | } |
@@ -293,10 +291,10 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
293 | phy_ctl |= B43_TXH_PHY_ENC_OFDM; | 291 | phy_ctl |= B43_TXH_PHY_ENC_OFDM; |
294 | else | 292 | else |
295 | phy_ctl |= B43_TXH_PHY_ENC_CCK; | 293 | phy_ctl |= B43_TXH_PHY_ENC_CCK; |
296 | if (txctl->flags & IEEE80211_TXCTL_SHORT_PREAMBLE) | 294 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) |
297 | phy_ctl |= B43_TXH_PHY_SHORTPRMBL; | 295 | phy_ctl |= B43_TXH_PHY_SHORTPRMBL; |
298 | 296 | ||
299 | switch (b43_ieee80211_antenna_sanitize(dev, txctl->antenna_sel_tx)) { | 297 | switch (b43_ieee80211_antenna_sanitize(dev, info->antenna_sel_tx)) { |
300 | case 0: /* Default */ | 298 | case 0: /* Default */ |
301 | phy_ctl |= B43_TXH_PHY_ANT01AUTO; | 299 | phy_ctl |= B43_TXH_PHY_ANT01AUTO; |
302 | break; | 300 | break; |
@@ -317,21 +315,21 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
317 | } | 315 | } |
318 | 316 | ||
319 | /* MAC control */ | 317 | /* MAC control */ |
320 | if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK)) | 318 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
321 | mac_ctl |= B43_TXH_MAC_ACK; | 319 | mac_ctl |= B43_TXH_MAC_ACK; |
322 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | 320 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && |
323 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) | 321 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) |
324 | mac_ctl |= B43_TXH_MAC_HWSEQ; | 322 | mac_ctl |= B43_TXH_MAC_HWSEQ; |
325 | if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) | 323 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) |
326 | mac_ctl |= B43_TXH_MAC_STMSDU; | 324 | mac_ctl |= B43_TXH_MAC_STMSDU; |
327 | if (phy->type == B43_PHYTYPE_A) | 325 | if (phy->type == B43_PHYTYPE_A) |
328 | mac_ctl |= B43_TXH_MAC_5GHZ; | 326 | mac_ctl |= B43_TXH_MAC_5GHZ; |
329 | if (txctl->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | 327 | if (info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT) |
330 | mac_ctl |= B43_TXH_MAC_LONGFRAME; | 328 | mac_ctl |= B43_TXH_MAC_LONGFRAME; |
331 | 329 | ||
332 | /* Generate the RTS or CTS-to-self frame */ | 330 | /* Generate the RTS or CTS-to-self frame */ |
333 | if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) || | 331 | if ((info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) || |
334 | (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)) { | 332 | (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)) { |
335 | unsigned int len; | 333 | unsigned int len; |
336 | struct ieee80211_hdr *hdr; | 334 | struct ieee80211_hdr *hdr; |
337 | int rts_rate, rts_rate_fb; | 335 | int rts_rate, rts_rate_fb; |
@@ -339,14 +337,14 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
339 | struct b43_plcp_hdr6 *plcp; | 337 | struct b43_plcp_hdr6 *plcp; |
340 | struct ieee80211_rate *rts_cts_rate; | 338 | struct ieee80211_rate *rts_cts_rate; |
341 | 339 | ||
342 | rts_cts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, txctl); | 340 | rts_cts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, info); |
343 | 341 | ||
344 | rts_rate = rts_cts_rate ? rts_cts_rate->hw_value : B43_CCK_RATE_1MB; | 342 | rts_rate = rts_cts_rate ? rts_cts_rate->hw_value : B43_CCK_RATE_1MB; |
345 | rts_rate_ofdm = b43_is_ofdm_rate(rts_rate); | 343 | rts_rate_ofdm = b43_is_ofdm_rate(rts_rate); |
346 | rts_rate_fb = b43_calc_fallback_rate(rts_rate); | 344 | rts_rate_fb = b43_calc_fallback_rate(rts_rate); |
347 | rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb); | 345 | rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb); |
348 | 346 | ||
349 | if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 347 | if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
350 | struct ieee80211_cts *cts; | 348 | struct ieee80211_cts *cts; |
351 | 349 | ||
352 | if (b43_is_old_txhdr_format(dev)) { | 350 | if (b43_is_old_txhdr_format(dev)) { |
@@ -356,9 +354,9 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
356 | cts = (struct ieee80211_cts *) | 354 | cts = (struct ieee80211_cts *) |
357 | (txhdr->new_format.rts_frame); | 355 | (txhdr->new_format.rts_frame); |
358 | } | 356 | } |
359 | ieee80211_ctstoself_get(dev->wl->hw, txctl->vif, | 357 | ieee80211_ctstoself_get(dev->wl->hw, info->control.vif, |
360 | fragment_data, fragment_len, | 358 | fragment_data, fragment_len, |
361 | txctl, cts); | 359 | info, cts); |
362 | mac_ctl |= B43_TXH_MAC_SENDCTS; | 360 | mac_ctl |= B43_TXH_MAC_SENDCTS; |
363 | len = sizeof(struct ieee80211_cts); | 361 | len = sizeof(struct ieee80211_cts); |
364 | } else { | 362 | } else { |
@@ -371,9 +369,9 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
371 | rts = (struct ieee80211_rts *) | 369 | rts = (struct ieee80211_rts *) |
372 | (txhdr->new_format.rts_frame); | 370 | (txhdr->new_format.rts_frame); |
373 | } | 371 | } |
374 | ieee80211_rts_get(dev->wl->hw, txctl->vif, | 372 | ieee80211_rts_get(dev->wl->hw, info->control.vif, |
375 | fragment_data, fragment_len, | 373 | fragment_data, fragment_len, |
376 | txctl, rts); | 374 | info, rts); |
377 | mac_ctl |= B43_TXH_MAC_SENDRTS; | 375 | mac_ctl |= B43_TXH_MAC_SENDRTS; |
378 | len = sizeof(struct ieee80211_rts); | 376 | len = sizeof(struct ieee80211_rts); |
379 | } | 377 | } |
@@ -687,27 +685,27 @@ void b43_handle_txstatus(struct b43_wldev *dev, | |||
687 | /* Fill out the mac80211 TXstatus report based on the b43-specific | 685 | /* Fill out the mac80211 TXstatus report based on the b43-specific |
688 | * txstatus report data. This returns a boolean whether the frame was | 686 | * txstatus report data. This returns a boolean whether the frame was |
689 | * successfully transmitted. */ | 687 | * successfully transmitted. */ |
690 | bool b43_fill_txstatus_report(struct ieee80211_tx_status *report, | 688 | bool b43_fill_txstatus_report(struct ieee80211_tx_info *report, |
691 | const struct b43_txstatus *status) | 689 | const struct b43_txstatus *status) |
692 | { | 690 | { |
693 | bool frame_success = 1; | 691 | bool frame_success = 1; |
694 | 692 | ||
695 | if (status->acked) { | 693 | if (status->acked) { |
696 | /* The frame was ACKed. */ | 694 | /* The frame was ACKed. */ |
697 | report->flags |= IEEE80211_TX_STATUS_ACK; | 695 | report->flags |= IEEE80211_TX_STAT_ACK; |
698 | } else { | 696 | } else { |
699 | /* The frame was not ACKed... */ | 697 | /* The frame was not ACKed... */ |
700 | if (!(report->control.flags & IEEE80211_TXCTL_NO_ACK)) { | 698 | if (!(report->flags & IEEE80211_TX_CTL_NO_ACK)) { |
701 | /* ...but we expected an ACK. */ | 699 | /* ...but we expected an ACK. */ |
702 | frame_success = 0; | 700 | frame_success = 0; |
703 | report->excessive_retries = 1; | 701 | report->status.excessive_retries = 1; |
704 | } | 702 | } |
705 | } | 703 | } |
706 | if (status->frame_count == 0) { | 704 | if (status->frame_count == 0) { |
707 | /* The frame was not transmitted at all. */ | 705 | /* The frame was not transmitted at all. */ |
708 | report->retry_count = 0; | 706 | report->status.retry_count = 0; |
709 | } else | 707 | } else |
710 | report->retry_count = status->frame_count - 1; | 708 | report->status.retry_count = status->frame_count - 1; |
711 | 709 | ||
712 | return frame_success; | 710 | return frame_success; |
713 | } | 711 | } |
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h index b05f44e0d626..0215faf47541 100644 --- a/drivers/net/wireless/b43/xmit.h +++ b/drivers/net/wireless/b43/xmit.h | |||
@@ -178,7 +178,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, | |||
178 | u8 * txhdr, | 178 | u8 * txhdr, |
179 | const unsigned char *fragment_data, | 179 | const unsigned char *fragment_data, |
180 | unsigned int fragment_len, | 180 | unsigned int fragment_len, |
181 | const struct ieee80211_tx_control *txctl, u16 cookie); | 181 | const struct ieee80211_tx_info *txctl, u16 cookie); |
182 | 182 | ||
183 | /* Transmit Status */ | 183 | /* Transmit Status */ |
184 | struct b43_txstatus { | 184 | struct b43_txstatus { |
@@ -294,7 +294,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr); | |||
294 | 294 | ||
295 | void b43_handle_txstatus(struct b43_wldev *dev, | 295 | void b43_handle_txstatus(struct b43_wldev *dev, |
296 | const struct b43_txstatus *status); | 296 | const struct b43_txstatus *status); |
297 | bool b43_fill_txstatus_report(struct ieee80211_tx_status *report, | 297 | bool b43_fill_txstatus_report(struct ieee80211_tx_info *report, |
298 | const struct b43_txstatus *status); | 298 | const struct b43_txstatus *status); |
299 | 299 | ||
300 | void b43_tx_suspend(struct b43_wldev *dev); | 300 | void b43_tx_suspend(struct b43_wldev *dev); |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index d6686f713b6d..c1c501d963bc 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -1205,10 +1205,10 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev, | |||
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, | 1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, |
1208 | struct sk_buff *skb, | 1208 | struct sk_buff *skb) |
1209 | struct ieee80211_tx_control *ctl) | ||
1210 | { | 1209 | { |
1211 | const struct b43legacy_dma_ops *ops = ring->ops; | 1210 | const struct b43legacy_dma_ops *ops = ring->ops; |
1211 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1212 | u8 *header; | 1212 | u8 *header; |
1213 | int slot, old_top_slot, old_used_slots; | 1213 | int slot, old_top_slot, old_used_slots; |
1214 | int err; | 1214 | int err; |
@@ -1231,7 +1231,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1231 | header = &(ring->txhdr_cache[slot * sizeof( | 1231 | header = &(ring->txhdr_cache[slot * sizeof( |
1232 | struct b43legacy_txhdr_fw3)]); | 1232 | struct b43legacy_txhdr_fw3)]); |
1233 | err = b43legacy_generate_txhdr(ring->dev, header, | 1233 | err = b43legacy_generate_txhdr(ring->dev, header, |
1234 | skb->data, skb->len, ctl, | 1234 | skb->data, skb->len, info, |
1235 | generate_cookie(ring, slot)); | 1235 | generate_cookie(ring, slot)); |
1236 | if (unlikely(err)) { | 1236 | if (unlikely(err)) { |
1237 | ring->current_slot = old_top_slot; | 1237 | ring->current_slot = old_top_slot; |
@@ -1255,7 +1255,6 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1255 | desc = ops->idx2desc(ring, slot, &meta); | 1255 | desc = ops->idx2desc(ring, slot, &meta); |
1256 | memset(meta, 0, sizeof(*meta)); | 1256 | memset(meta, 0, sizeof(*meta)); |
1257 | 1257 | ||
1258 | memcpy(&meta->txstat.control, ctl, sizeof(*ctl)); | ||
1259 | meta->skb = skb; | 1258 | meta->skb = skb; |
1260 | meta->is_last_fragment = 1; | 1259 | meta->is_last_fragment = 1; |
1261 | 1260 | ||
@@ -1323,14 +1322,14 @@ int should_inject_overflow(struct b43legacy_dmaring *ring) | |||
1323 | } | 1322 | } |
1324 | 1323 | ||
1325 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 1324 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
1326 | struct sk_buff *skb, | 1325 | struct sk_buff *skb) |
1327 | struct ieee80211_tx_control *ctl) | ||
1328 | { | 1326 | { |
1329 | struct b43legacy_dmaring *ring; | 1327 | struct b43legacy_dmaring *ring; |
1328 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1330 | int err = 0; | 1329 | int err = 0; |
1331 | unsigned long flags; | 1330 | unsigned long flags; |
1332 | 1331 | ||
1333 | ring = priority_to_txring(dev, ctl->queue); | 1332 | ring = priority_to_txring(dev, info->queue); |
1334 | spin_lock_irqsave(&ring->lock, flags); | 1333 | spin_lock_irqsave(&ring->lock, flags); |
1335 | B43legacy_WARN_ON(!ring->tx); | 1334 | B43legacy_WARN_ON(!ring->tx); |
1336 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { | 1335 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { |
@@ -1343,7 +1342,7 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1343 | * That would be a mac80211 bug. */ | 1342 | * That would be a mac80211 bug. */ |
1344 | B43legacy_BUG_ON(ring->stopped); | 1343 | B43legacy_BUG_ON(ring->stopped); |
1345 | 1344 | ||
1346 | err = dma_tx_fragment(ring, skb, ctl); | 1345 | err = dma_tx_fragment(ring, skb); |
1347 | if (unlikely(err == -ENOKEY)) { | 1346 | if (unlikely(err == -ENOKEY)) { |
1348 | /* Drop this packet, as we don't have the encryption key | 1347 | /* Drop this packet, as we don't have the encryption key |
1349 | * anymore and must not transmit it unencrypted. */ | 1348 | * anymore and must not transmit it unencrypted. */ |
@@ -1401,26 +1400,29 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | |||
1401 | 1); | 1400 | 1); |
1402 | 1401 | ||
1403 | if (meta->is_last_fragment) { | 1402 | if (meta->is_last_fragment) { |
1404 | B43legacy_WARN_ON(!meta->skb); | 1403 | struct ieee80211_tx_info *info; |
1404 | BUG_ON(!meta->skb); | ||
1405 | info = IEEE80211_SKB_CB(meta->skb); | ||
1405 | /* Call back to inform the ieee80211 subsystem about the | 1406 | /* Call back to inform the ieee80211 subsystem about the |
1406 | * status of the transmission. | 1407 | * status of the transmission. |
1407 | * Some fields of txstat are already filled in dma_tx(). | 1408 | * Some fields of txstat are already filled in dma_tx(). |
1408 | */ | 1409 | */ |
1410 | |||
1411 | memset(&info->status, 0, sizeof(info->status)); | ||
1412 | |||
1409 | if (status->acked) { | 1413 | if (status->acked) { |
1410 | meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 1414 | info->flags |= IEEE80211_TX_STAT_ACK; |
1411 | } else { | 1415 | } else { |
1412 | if (!(meta->txstat.control.flags | 1416 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
1413 | & IEEE80211_TXCTL_NO_ACK)) | 1417 | info->status.excessive_retries = 1; |
1414 | meta->txstat.excessive_retries = 1; | ||
1415 | } | 1418 | } |
1416 | if (status->frame_count == 0) { | 1419 | if (status->frame_count == 0) { |
1417 | /* The frame was not transmitted at all. */ | 1420 | /* The frame was not transmitted at all. */ |
1418 | meta->txstat.retry_count = 0; | 1421 | info->status.retry_count = 0; |
1419 | } else | 1422 | } else |
1420 | meta->txstat.retry_count = status->frame_count | 1423 | info->status.retry_count = status->frame_count |
1421 | - 1; | 1424 | - 1; |
1422 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb, | 1425 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb); |
1423 | &(meta->txstat)); | ||
1424 | /* skb is freed by ieee80211_tx_status_irqsafe() */ | 1426 | /* skb is freed by ieee80211_tx_status_irqsafe() */ |
1425 | meta->skb = NULL; | 1427 | meta->skb = NULL; |
1426 | } else { | 1428 | } else { |
diff --git a/drivers/net/wireless/b43legacy/dma.h b/drivers/net/wireless/b43legacy/dma.h index 2dd488c5be2d..67537a7495ff 100644 --- a/drivers/net/wireless/b43legacy/dma.h +++ b/drivers/net/wireless/b43legacy/dma.h | |||
@@ -195,7 +195,6 @@ struct b43legacy_dmadesc_meta { | |||
195 | dma_addr_t dmaaddr; | 195 | dma_addr_t dmaaddr; |
196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ | 196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ |
197 | bool is_last_fragment; | 197 | bool is_last_fragment; |
198 | struct ieee80211_tx_status txstat; | ||
199 | }; | 198 | }; |
200 | 199 | ||
201 | struct b43legacy_dmaring; | 200 | struct b43legacy_dmaring; |
@@ -297,8 +296,7 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | |||
297 | struct ieee80211_tx_queue_stats *stats); | 296 | struct ieee80211_tx_queue_stats *stats); |
298 | 297 | ||
299 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 298 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
300 | struct sk_buff *skb, | 299 | struct sk_buff *skb); |
301 | struct ieee80211_tx_control *ctl); | ||
302 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | 300 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, |
303 | const struct b43legacy_txstatus *status); | 301 | const struct b43legacy_txstatus *status); |
304 | 302 | ||
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index b05a507ed44d..f706ca65f159 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2358,8 +2358,7 @@ static int b43legacy_rng_init(struct b43legacy_wl *wl) | |||
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, | 2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, |
2361 | struct sk_buff *skb, | 2361 | struct sk_buff *skb) |
2362 | struct ieee80211_tx_control *ctl) | ||
2363 | { | 2362 | { |
2364 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 2363 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
2365 | struct b43legacy_wldev *dev = wl->current_dev; | 2364 | struct b43legacy_wldev *dev = wl->current_dev; |
@@ -2373,10 +2372,10 @@ static int b43legacy_op_tx(struct ieee80211_hw *hw, | |||
2373 | /* DMA-TX is done without a global lock. */ | 2372 | /* DMA-TX is done without a global lock. */ |
2374 | if (b43legacy_using_pio(dev)) { | 2373 | if (b43legacy_using_pio(dev)) { |
2375 | spin_lock_irqsave(&wl->irq_lock, flags); | 2374 | spin_lock_irqsave(&wl->irq_lock, flags); |
2376 | err = b43legacy_pio_tx(dev, skb, ctl); | 2375 | err = b43legacy_pio_tx(dev, skb); |
2377 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 2376 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
2378 | } else | 2377 | } else |
2379 | err = b43legacy_dma_tx(dev, skb, ctl); | 2378 | err = b43legacy_dma_tx(dev, skb); |
2380 | out: | 2379 | out: |
2381 | if (unlikely(err)) | 2380 | if (unlikely(err)) |
2382 | return NETDEV_TX_BUSY; | 2381 | return NETDEV_TX_BUSY; |
@@ -3409,7 +3408,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3409 | * field, but that would probably require resizing and moving of data | 3408 | * field, but that would probably require resizing and moving of data |
3410 | * within the beacon template. Simply request a new beacon and let | 3409 | * within the beacon template. Simply request a new beacon and let |
3411 | * mac80211 do the hard work. */ | 3410 | * mac80211 do the hard work. */ |
3412 | beacon = ieee80211_beacon_get(hw, wl->vif, NULL); | 3411 | beacon = ieee80211_beacon_get(hw, wl->vif); |
3413 | if (unlikely(!beacon)) | 3412 | if (unlikely(!beacon)) |
3414 | return -ENOMEM; | 3413 | return -ENOMEM; |
3415 | spin_lock_irqsave(&wl->irq_lock, flags); | 3414 | spin_lock_irqsave(&wl->irq_lock, flags); |
@@ -3420,8 +3419,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3420 | } | 3419 | } |
3421 | 3420 | ||
3422 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, | 3421 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, |
3423 | struct sk_buff *beacon, | 3422 | struct sk_buff *beacon) |
3424 | struct ieee80211_tx_control *ctl) | ||
3425 | { | 3423 | { |
3426 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3424 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3427 | unsigned long flags; | 3425 | unsigned long flags; |
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c index 8d3d27d3cd67..a86c7647fa2d 100644 --- a/drivers/net/wireless/b43legacy/pio.c +++ b/drivers/net/wireless/b43legacy/pio.c | |||
@@ -196,7 +196,7 @@ static int pio_tx_write_fragment(struct b43legacy_pioqueue *queue, | |||
196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); | 196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); |
197 | err = b43legacy_generate_txhdr(queue->dev, | 197 | err = b43legacy_generate_txhdr(queue->dev, |
198 | txhdr, skb->data, skb->len, | 198 | txhdr, skb->data, skb->len, |
199 | &packet->txstat.control, | 199 | IEEE80211_SKB_CB(skb), |
200 | generate_cookie(queue, packet)); | 200 | generate_cookie(queue, packet)); |
201 | if (err) | 201 | if (err) |
202 | return err; | 202 | return err; |
@@ -463,8 +463,7 @@ err_destroy0: | |||
463 | } | 463 | } |
464 | 464 | ||
465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
466 | struct sk_buff *skb, | 466 | struct sk_buff *skb) |
467 | struct ieee80211_tx_control *ctl) | ||
468 | { | 467 | { |
469 | struct b43legacy_pioqueue *queue = dev->pio.queue1; | 468 | struct b43legacy_pioqueue *queue = dev->pio.queue1; |
470 | struct b43legacy_pio_txpacket *packet; | 469 | struct b43legacy_pio_txpacket *packet; |
@@ -476,9 +475,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev, | |||
476 | list); | 475 | list); |
477 | packet->skb = skb; | 476 | packet->skb = skb; |
478 | 477 | ||
479 | memset(&packet->txstat, 0, sizeof(packet->txstat)); | ||
480 | memcpy(&packet->txstat.control, ctl, sizeof(*ctl)); | ||
481 | |||
482 | list_move_tail(&packet->list, &queue->txqueue); | 478 | list_move_tail(&packet->list, &queue->txqueue); |
483 | queue->nr_txfree--; | 479 | queue->nr_txfree--; |
484 | queue->nr_tx_packets++; | 480 | queue->nr_tx_packets++; |
@@ -494,6 +490,7 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
494 | { | 490 | { |
495 | struct b43legacy_pioqueue *queue; | 491 | struct b43legacy_pioqueue *queue; |
496 | struct b43legacy_pio_txpacket *packet; | 492 | struct b43legacy_pio_txpacket *packet; |
493 | struct ieee80211_tx_info *info; | ||
497 | 494 | ||
498 | queue = parse_cookie(dev, status->cookie, &packet); | 495 | queue = parse_cookie(dev, status->cookie, &packet); |
499 | B43legacy_WARN_ON(!queue); | 496 | B43legacy_WARN_ON(!queue); |
@@ -505,11 +502,13 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
505 | queue->tx_devq_used -= (packet->skb->len + | 502 | queue->tx_devq_used -= (packet->skb->len + |
506 | sizeof(struct b43legacy_txhdr_fw3)); | 503 | sizeof(struct b43legacy_txhdr_fw3)); |
507 | 504 | ||
505 | info = IEEE80211_SKB_CB(packet->skb); | ||
506 | memset(&info->status, 0, sizeof(info->status)); | ||
507 | |||
508 | if (status->acked) | 508 | if (status->acked) |
509 | packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 509 | info->flags |= IEEE80211_TX_STAT_ACK; |
510 | packet->txstat.retry_count = status->frame_count - 1; | 510 | info->status.retry_count = status->frame_count - 1; |
511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb, | 511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb); |
512 | &(packet->txstat)); | ||
513 | packet->skb = NULL; | 512 | packet->skb = NULL; |
514 | 513 | ||
515 | free_txpacket(packet, 1); | 514 | free_txpacket(packet, 1); |
diff --git a/drivers/net/wireless/b43legacy/pio.h b/drivers/net/wireless/b43legacy/pio.h index 5bfed0c40030..49310dfaf2d1 100644 --- a/drivers/net/wireless/b43legacy/pio.h +++ b/drivers/net/wireless/b43legacy/pio.h | |||
@@ -41,7 +41,6 @@ struct b43legacy_xmitstatus; | |||
41 | struct b43legacy_pio_txpacket { | 41 | struct b43legacy_pio_txpacket { |
42 | struct b43legacy_pioqueue *queue; | 42 | struct b43legacy_pioqueue *queue; |
43 | struct sk_buff *skb; | 43 | struct sk_buff *skb; |
44 | struct ieee80211_tx_status txstat; | ||
45 | struct list_head list; | 44 | struct list_head list; |
46 | }; | 45 | }; |
47 | 46 | ||
@@ -104,8 +103,7 @@ int b43legacy_pio_init(struct b43legacy_wldev *dev); | |||
104 | void b43legacy_pio_free(struct b43legacy_wldev *dev); | 103 | void b43legacy_pio_free(struct b43legacy_wldev *dev); |
105 | 104 | ||
106 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 105 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
107 | struct sk_buff *skb, | 106 | struct sk_buff *skb); |
108 | struct ieee80211_tx_control *ctl); | ||
109 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | 107 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, |
110 | const struct b43legacy_txstatus *status); | 108 | const struct b43legacy_txstatus *status); |
111 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | 109 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index 55dc251bf510..82dc04d59446 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -188,11 +188,11 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
188 | struct b43legacy_txhdr_fw3 *txhdr, | 188 | struct b43legacy_txhdr_fw3 *txhdr, |
189 | const unsigned char *fragment_data, | 189 | const unsigned char *fragment_data, |
190 | unsigned int fragment_len, | 190 | unsigned int fragment_len, |
191 | const struct ieee80211_tx_control *txctl, | 191 | const struct ieee80211_tx_info *info, |
192 | u16 cookie) | 192 | u16 cookie) |
193 | { | 193 | { |
194 | const struct ieee80211_hdr *wlhdr; | 194 | const struct ieee80211_hdr *wlhdr; |
195 | int use_encryption = (!(txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)); | 195 | int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)); |
196 | u16 fctl; | 196 | u16 fctl; |
197 | u8 rate; | 197 | u8 rate; |
198 | struct ieee80211_rate *rate_fb; | 198 | struct ieee80211_rate *rate_fb; |
@@ -208,11 +208,11 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
208 | 208 | ||
209 | memset(txhdr, 0, sizeof(*txhdr)); | 209 | memset(txhdr, 0, sizeof(*txhdr)); |
210 | 210 | ||
211 | tx_rate = ieee80211_get_tx_rate(dev->wl->hw, txctl); | 211 | tx_rate = ieee80211_get_tx_rate(dev->wl->hw, info); |
212 | 212 | ||
213 | rate = tx_rate->hw_value; | 213 | rate = tx_rate->hw_value; |
214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); | 214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); |
215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, txctl) ? : tx_rate; | 215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, info) ? : tx_rate; |
216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); | 216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); |
217 | 217 | ||
218 | txhdr->mac_frame_ctl = wlhdr->frame_control; | 218 | txhdr->mac_frame_ctl = wlhdr->frame_control; |
@@ -228,14 +228,14 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
228 | txhdr->dur_fb = wlhdr->duration_id; | 228 | txhdr->dur_fb = wlhdr->duration_id; |
229 | } else { | 229 | } else { |
230 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, | 230 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, |
231 | txctl->vif, | 231 | info->control.vif, |
232 | fragment_len, | 232 | fragment_len, |
233 | rate_fb); | 233 | rate_fb); |
234 | } | 234 | } |
235 | 235 | ||
236 | plcp_fragment_len = fragment_len + FCS_LEN; | 236 | plcp_fragment_len = fragment_len + FCS_LEN; |
237 | if (use_encryption) { | 237 | if (use_encryption) { |
238 | u8 key_idx = txctl->hw_key->hw_key_idx; | 238 | u8 key_idx = info->control.hw_key->hw_key_idx; |
239 | struct b43legacy_key *key; | 239 | struct b43legacy_key *key; |
240 | int wlhdr_len; | 240 | int wlhdr_len; |
241 | size_t iv_len; | 241 | size_t iv_len; |
@@ -245,7 +245,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
245 | 245 | ||
246 | if (key->enabled) { | 246 | if (key->enabled) { |
247 | /* Hardware appends ICV. */ | 247 | /* Hardware appends ICV. */ |
248 | plcp_fragment_len += txctl->icv_len; | 248 | plcp_fragment_len += info->control.icv_len; |
249 | 249 | ||
250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); | 250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); |
251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & | 251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & |
@@ -254,7 +254,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & | 254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & |
255 | B43legacy_TX4_MAC_KEYALG; | 255 | B43legacy_TX4_MAC_KEYALG; |
256 | wlhdr_len = ieee80211_get_hdrlen(fctl); | 256 | wlhdr_len = ieee80211_get_hdrlen(fctl); |
257 | iv_len = min((size_t)txctl->iv_len, | 257 | iv_len = min((size_t)info->control.iv_len, |
258 | ARRAY_SIZE(txhdr->iv)); | 258 | ARRAY_SIZE(txhdr->iv)); |
259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); | 259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); |
260 | } else { | 260 | } else { |
@@ -278,7 +278,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
278 | phy_ctl |= B43legacy_TX4_PHY_OFDM; | 278 | phy_ctl |= B43legacy_TX4_PHY_OFDM; |
279 | if (dev->short_preamble) | 279 | if (dev->short_preamble) |
280 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; | 280 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; |
281 | switch (txctl->antenna_sel_tx) { | 281 | switch (info->antenna_sel_tx) { |
282 | case 0: | 282 | case 0: |
283 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; | 283 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; |
284 | break; | 284 | break; |
@@ -293,21 +293,21 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* MAC control */ | 295 | /* MAC control */ |
296 | if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK)) | 296 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
297 | mac_ctl |= B43legacy_TX4_MAC_ACK; | 297 | mac_ctl |= B43legacy_TX4_MAC_ACK; |
298 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | 298 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && |
299 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) | 299 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) |
300 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; | 300 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; |
301 | if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) | 301 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) |
302 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; | 302 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; |
303 | if (rate_fb_ofdm) | 303 | if (rate_fb_ofdm) |
304 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; | 304 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; |
305 | if (txctl->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | 305 | if (info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT) |
306 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; | 306 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; |
307 | 307 | ||
308 | /* Generate the RTS or CTS-to-self frame */ | 308 | /* Generate the RTS or CTS-to-self frame */ |
309 | if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) || | 309 | if ((info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) || |
310 | (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)) { | 310 | (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)) { |
311 | unsigned int len; | 311 | unsigned int len; |
312 | struct ieee80211_hdr *hdr; | 312 | struct ieee80211_hdr *hdr; |
313 | int rts_rate; | 313 | int rts_rate; |
@@ -315,26 +315,26 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
315 | int rts_rate_ofdm; | 315 | int rts_rate_ofdm; |
316 | int rts_rate_fb_ofdm; | 316 | int rts_rate_fb_ofdm; |
317 | 317 | ||
318 | rts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, txctl)->hw_value; | 318 | rts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, info)->hw_value; |
319 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); | 319 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); |
320 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); | 320 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); |
321 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); | 321 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); |
322 | if (rts_rate_fb_ofdm) | 322 | if (rts_rate_fb_ofdm) |
323 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; | 323 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; |
324 | 324 | ||
325 | if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 325 | if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
326 | ieee80211_ctstoself_get(dev->wl->hw, | 326 | ieee80211_ctstoself_get(dev->wl->hw, |
327 | txctl->vif, | 327 | info->control.vif, |
328 | fragment_data, | 328 | fragment_data, |
329 | fragment_len, txctl, | 329 | fragment_len, info, |
330 | (struct ieee80211_cts *) | 330 | (struct ieee80211_cts *) |
331 | (txhdr->rts_frame)); | 331 | (txhdr->rts_frame)); |
332 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; | 332 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; |
333 | len = sizeof(struct ieee80211_cts); | 333 | len = sizeof(struct ieee80211_cts); |
334 | } else { | 334 | } else { |
335 | ieee80211_rts_get(dev->wl->hw, | 335 | ieee80211_rts_get(dev->wl->hw, |
336 | txctl->vif, | 336 | info->control.vif, |
337 | fragment_data, fragment_len, txctl, | 337 | fragment_data, fragment_len, info, |
338 | (struct ieee80211_rts *) | 338 | (struct ieee80211_rts *) |
339 | (txhdr->rts_frame)); | 339 | (txhdr->rts_frame)); |
340 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; | 340 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; |
@@ -365,12 +365,12 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
365 | u8 *txhdr, | 365 | u8 *txhdr, |
366 | const unsigned char *fragment_data, | 366 | const unsigned char *fragment_data, |
367 | unsigned int fragment_len, | 367 | unsigned int fragment_len, |
368 | const struct ieee80211_tx_control *txctl, | 368 | const struct ieee80211_tx_info *info, |
369 | u16 cookie) | 369 | u16 cookie) |
370 | { | 370 | { |
371 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, | 371 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, |
372 | fragment_data, fragment_len, | 372 | fragment_data, fragment_len, |
373 | txctl, cookie); | 373 | info, cookie); |
374 | } | 374 | } |
375 | 375 | ||
376 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, | 376 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, |
diff --git a/drivers/net/wireless/b43legacy/xmit.h b/drivers/net/wireless/b43legacy/xmit.h index bab47928a0c9..e56777e0feab 100644 --- a/drivers/net/wireless/b43legacy/xmit.h +++ b/drivers/net/wireless/b43legacy/xmit.h | |||
@@ -80,7 +80,7 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
80 | u8 *txhdr, | 80 | u8 *txhdr, |
81 | const unsigned char *fragment_data, | 81 | const unsigned char *fragment_data, |
82 | unsigned int fragment_len, | 82 | unsigned int fragment_len, |
83 | const struct ieee80211_tx_control *txctl, | 83 | const struct ieee80211_tx_info *info, |
84 | u16 cookie); | 84 | u16 cookie); |
85 | 85 | ||
86 | 86 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index f3ca02fe9619..10c64bdb314c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -445,8 +445,7 @@ static int rs_adjust_next_rate(struct iwl3945_priv *priv, int rate) | |||
445 | */ | 445 | */ |
446 | static void rs_tx_status(void *priv_rate, | 446 | static void rs_tx_status(void *priv_rate, |
447 | struct net_device *dev, | 447 | struct net_device *dev, |
448 | struct sk_buff *skb, | 448 | struct sk_buff *skb) |
449 | struct ieee80211_tx_status *tx_resp) | ||
450 | { | 449 | { |
451 | u8 retries, current_count; | 450 | u8 retries, current_count; |
452 | int scale_rate_index, first_index, last_index; | 451 | int scale_rate_index, first_index, last_index; |
@@ -457,14 +456,15 @@ static void rs_tx_status(void *priv_rate, | |||
457 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 456 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
458 | struct iwl3945_rs_sta *rs_sta; | 457 | struct iwl3945_rs_sta *rs_sta; |
459 | struct ieee80211_supported_band *sband; | 458 | struct ieee80211_supported_band *sband; |
459 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
460 | 460 | ||
461 | IWL_DEBUG_RATE("enter\n"); | 461 | IWL_DEBUG_RATE("enter\n"); |
462 | 462 | ||
463 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | 463 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; |
464 | 464 | ||
465 | 465 | ||
466 | retries = tx_resp->retry_count; | 466 | retries = info->status.retry_count; |
467 | first_index = sband->bitrates[tx_resp->control.tx_rate_idx].hw_value; | 467 | first_index = sband->bitrates[info->tx_rate_idx].hw_value; |
468 | if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { | 468 | if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { |
469 | IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); | 469 | IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); |
470 | return; | 470 | return; |
@@ -525,11 +525,11 @@ static void rs_tx_status(void *priv_rate, | |||
525 | /* Update the last index window with success/failure based on ACK */ | 525 | /* Update the last index window with success/failure based on ACK */ |
526 | IWL_DEBUG_RATE("Update rate %d with %s.\n", | 526 | IWL_DEBUG_RATE("Update rate %d with %s.\n", |
527 | last_index, | 527 | last_index, |
528 | (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ? | 528 | (info->flags & IEEE80211_TX_STAT_ACK) ? |
529 | "success" : "failure"); | 529 | "success" : "failure"); |
530 | iwl3945_collect_tx_data(rs_sta, | 530 | iwl3945_collect_tx_data(rs_sta, |
531 | &rs_sta->win[last_index], | 531 | &rs_sta->win[last_index], |
532 | tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1); | 532 | info->flags & IEEE80211_TX_STAT_ACK, 1); |
533 | 533 | ||
534 | /* We updated the rate scale window -- if its been more than | 534 | /* We updated the rate scale window -- if its been more than |
535 | * flush_time since the last run, schedule the flush | 535 | * flush_time since the last run, schedule the flush |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index f8e691f88ab3..0ba6889dfd41 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -283,8 +283,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv, | |||
283 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { | 283 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { |
284 | 284 | ||
285 | tx_info = &txq->txb[txq->q.read_ptr]; | 285 | tx_info = &txq->txb[txq->q.read_ptr]; |
286 | ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0], | 286 | ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]); |
287 | &tx_info->status); | ||
288 | tx_info->skb[0] = NULL; | 287 | tx_info->skb[0] = NULL; |
289 | iwl3945_hw_txq_free_tfd(priv, txq); | 288 | iwl3945_hw_txq_free_tfd(priv, txq); |
290 | } | 289 | } |
@@ -306,7 +305,7 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv, | |||
306 | int txq_id = SEQ_TO_QUEUE(sequence); | 305 | int txq_id = SEQ_TO_QUEUE(sequence); |
307 | int index = SEQ_TO_INDEX(sequence); | 306 | int index = SEQ_TO_INDEX(sequence); |
308 | struct iwl3945_tx_queue *txq = &priv->txq[txq_id]; | 307 | struct iwl3945_tx_queue *txq = &priv->txq[txq_id]; |
309 | struct ieee80211_tx_status *tx_status; | 308 | struct ieee80211_tx_info *info; |
310 | struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 309 | struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
311 | u32 status = le32_to_cpu(tx_resp->status); | 310 | u32 status = le32_to_cpu(tx_resp->status); |
312 | int rate_idx; | 311 | int rate_idx; |
@@ -319,21 +318,22 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv, | |||
319 | return; | 318 | return; |
320 | } | 319 | } |
321 | 320 | ||
322 | tx_status = &(txq->txb[txq->q.read_ptr].status); | 321 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]); |
322 | memset(&info->status, 0, sizeof(info->status)); | ||
323 | 323 | ||
324 | tx_status->retry_count = tx_resp->failure_frame; | 324 | info->status.retry_count = tx_resp->failure_frame; |
325 | /* tx_status->rts_retry_count = tx_resp->failure_rts; */ | 325 | /* tx_status->rts_retry_count = tx_resp->failure_rts; */ |
326 | tx_status->flags = ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ? | 326 | info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ? |
327 | IEEE80211_TX_STATUS_ACK : 0; | 327 | IEEE80211_TX_STAT_ACK : 0; |
328 | 328 | ||
329 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n", | 329 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n", |
330 | txq_id, iwl3945_get_tx_fail_reason(status), status, | 330 | txq_id, iwl3945_get_tx_fail_reason(status), status, |
331 | tx_resp->rate, tx_resp->failure_frame); | 331 | tx_resp->rate, tx_resp->failure_frame); |
332 | 332 | ||
333 | rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate); | 333 | rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate); |
334 | if (tx_status->control.band == IEEE80211_BAND_5GHZ) | 334 | if (info->band == IEEE80211_BAND_5GHZ) |
335 | rate_idx -= IWL_FIRST_OFDM_RATE; | 335 | rate_idx -= IWL_FIRST_OFDM_RATE; |
336 | tx_status->control.tx_rate_idx = rate_idx; | 336 | info->tx_rate_idx = rate_idx; |
337 | IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); | 337 | IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); |
338 | iwl3945_tx_queue_reclaim(priv, txq_id, index); | 338 | iwl3945_tx_queue_reclaim(priv, txq_id, index); |
339 | 339 | ||
@@ -960,11 +960,11 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr) | |||
960 | */ | 960 | */ |
961 | void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, | 961 | void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, |
962 | struct iwl3945_cmd *cmd, | 962 | struct iwl3945_cmd *cmd, |
963 | struct ieee80211_tx_control *ctrl, | 963 | struct ieee80211_tx_info *info, |
964 | struct ieee80211_hdr *hdr, int sta_id, int tx_id) | 964 | struct ieee80211_hdr *hdr, int sta_id, int tx_id) |
965 | { | 965 | { |
966 | unsigned long flags; | 966 | unsigned long flags; |
967 | u16 hw_value = ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value; | 967 | u16 hw_value = ieee80211_get_tx_rate(priv->hw, info)->hw_value; |
968 | u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1); | 968 | u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1); |
969 | u16 rate_mask; | 969 | u16 rate_mask; |
970 | int rate; | 970 | int rate; |
@@ -977,7 +977,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, | |||
977 | tx_flags = cmd->cmd.tx.tx_flags; | 977 | tx_flags = cmd->cmd.tx.tx_flags; |
978 | 978 | ||
979 | /* We need to figure out how to get the sta->supp_rates while | 979 | /* We need to figure out how to get the sta->supp_rates while |
980 | * in this running context; perhaps encoding into ctrl->tx_rate? */ | 980 | * in this running context */ |
981 | rate_mask = IWL_RATES_MASK; | 981 | rate_mask = IWL_RATES_MASK; |
982 | 982 | ||
983 | spin_lock_irqsave(&priv->sta_lock, flags); | 983 | spin_lock_irqsave(&priv->sta_lock, flags); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 9fdc1405e853..835c5b4320e9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -124,7 +124,6 @@ int iwl3945_x2_queue_used(const struct iwl3945_queue *q, int i); | |||
124 | 124 | ||
125 | /* One for each TFD */ | 125 | /* One for each TFD */ |
126 | struct iwl3945_tx_info { | 126 | struct iwl3945_tx_info { |
127 | struct ieee80211_tx_status status; | ||
128 | struct sk_buff *skb[MAX_NUM_OF_TBS]; | 127 | struct sk_buff *skb[MAX_NUM_OF_TBS]; |
129 | }; | 128 | }; |
130 | 129 | ||
@@ -645,7 +644,7 @@ extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv, | |||
645 | extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv); | 644 | extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv); |
646 | extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, | 645 | extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, |
647 | struct iwl3945_cmd *cmd, | 646 | struct iwl3945_cmd *cmd, |
648 | struct ieee80211_tx_control *ctrl, | 647 | struct ieee80211_tx_info *info, |
649 | struct ieee80211_hdr *hdr, | 648 | struct ieee80211_hdr *hdr, |
650 | int sta_id, int tx_id); | 649 | int sta_id, int tx_id); |
651 | extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv); | 650 | extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index 7993a1d83025..f28b3cc272df 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -785,8 +785,7 @@ out: | |||
785 | * mac80211 sends us Tx status | 785 | * mac80211 sends us Tx status |
786 | */ | 786 | */ |
787 | static void rs_tx_status(void *priv_rate, struct net_device *dev, | 787 | static void rs_tx_status(void *priv_rate, struct net_device *dev, |
788 | struct sk_buff *skb, | 788 | struct sk_buff *skb) |
789 | struct ieee80211_tx_status *tx_resp) | ||
790 | { | 789 | { |
791 | int status; | 790 | int status; |
792 | u8 retries; | 791 | u8 retries; |
@@ -798,6 +797,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
798 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; | 797 | struct iwl_priv *priv = (struct iwl_priv *)priv_rate; |
799 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 798 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
800 | struct ieee80211_hw *hw = local_to_hw(local); | 799 | struct ieee80211_hw *hw = local_to_hw(local); |
800 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
801 | struct iwl4965_rate_scale_data *window = NULL; | 801 | struct iwl4965_rate_scale_data *window = NULL; |
802 | struct iwl4965_rate_scale_data *search_win = NULL; | 802 | struct iwl4965_rate_scale_data *search_win = NULL; |
803 | u32 tx_rate; | 803 | u32 tx_rate; |
@@ -813,11 +813,11 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
813 | return; | 813 | return; |
814 | 814 | ||
815 | /* This packet was aggregated but doesn't carry rate scale info */ | 815 | /* This packet was aggregated but doesn't carry rate scale info */ |
816 | if ((tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) && | 816 | if ((info->flags & IEEE80211_TX_CTL_AMPDU) && |
817 | !(tx_resp->flags & IEEE80211_TX_STATUS_AMPDU)) | 817 | !(info->flags & IEEE80211_TX_STAT_AMPDU)) |
818 | return; | 818 | return; |
819 | 819 | ||
820 | retries = tx_resp->retry_count; | 820 | retries = info->status.retry_count; |
821 | 821 | ||
822 | if (retries > 15) | 822 | if (retries > 15) |
823 | retries = 15; | 823 | retries = 15; |
@@ -862,20 +862,20 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
862 | if (priv->band == IEEE80211_BAND_5GHZ) | 862 | if (priv->band == IEEE80211_BAND_5GHZ) |
863 | rs_index -= IWL_FIRST_OFDM_RATE; | 863 | rs_index -= IWL_FIRST_OFDM_RATE; |
864 | 864 | ||
865 | if ((tx_resp->control.tx_rate_idx < 0) || | 865 | if ((info->tx_rate_idx < 0) || |
866 | (tbl_type.is_SGI ^ | 866 | (tbl_type.is_SGI ^ |
867 | !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) || | 867 | !!(info->flags & IEEE80211_TX_CTL_SHORT_GI)) || |
868 | (tbl_type.is_fat ^ | 868 | (tbl_type.is_fat ^ |
869 | !!(tx_resp->control.flags & IEEE80211_TXCTL_40_MHZ_WIDTH)) || | 869 | !!(info->flags & IEEE80211_TX_CTL_40_MHZ_WIDTH)) || |
870 | (tbl_type.is_dup ^ | 870 | (tbl_type.is_dup ^ |
871 | !!(tx_resp->control.flags & IEEE80211_TXCTL_DUP_DATA)) || | 871 | !!(info->flags & IEEE80211_TX_CTL_DUP_DATA)) || |
872 | (tbl_type.ant_type ^ tx_resp->control.antenna_sel_tx) || | 872 | (tbl_type.ant_type ^ info->antenna_sel_tx) || |
873 | (!!(tx_rate & RATE_MCS_HT_MSK) ^ | 873 | (!!(tx_rate & RATE_MCS_HT_MSK) ^ |
874 | !!(tx_resp->control.flags & IEEE80211_TXCTL_OFDM_HT)) || | 874 | !!(info->flags & IEEE80211_TX_CTL_OFDM_HT)) || |
875 | (!!(tx_rate & RATE_MCS_GF_MSK) ^ | 875 | (!!(tx_rate & RATE_MCS_GF_MSK) ^ |
876 | !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) || | 876 | !!(info->flags & IEEE80211_TX_CTL_GREEN_FIELD)) || |
877 | (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != | 877 | (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != |
878 | hw->wiphy->bands[tx_resp->control.band]->bitrates[tx_resp->control.tx_rate_idx].bitrate)) { | 878 | hw->wiphy->bands[info->band]->bitrates[info->tx_rate_idx].bitrate)) { |
879 | IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); | 879 | IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); |
880 | goto out; | 880 | goto out; |
881 | } | 881 | } |
@@ -929,10 +929,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
929 | rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index); | 929 | rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index); |
930 | 930 | ||
931 | /* Update frame history window with "success" if Tx got ACKed ... */ | 931 | /* Update frame history window with "success" if Tx got ACKed ... */ |
932 | if (tx_resp->flags & IEEE80211_TX_STATUS_ACK) | 932 | status = !!(info->flags & IEEE80211_TX_STAT_ACK); |
933 | status = 1; | ||
934 | else | ||
935 | status = 0; | ||
936 | 933 | ||
937 | /* If type matches "search" table, | 934 | /* If type matches "search" table, |
938 | * add final tx status to "search" history */ | 935 | * add final tx status to "search" history */ |
@@ -943,10 +940,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
943 | tpt = search_tbl->expected_tpt[rs_index]; | 940 | tpt = search_tbl->expected_tpt[rs_index]; |
944 | else | 941 | else |
945 | tpt = 0; | 942 | tpt = 0; |
946 | if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) | 943 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
947 | rs_collect_tx_data(search_win, rs_index, tpt, | 944 | rs_collect_tx_data(search_win, rs_index, tpt, |
948 | tx_resp->ampdu_ack_len, | 945 | info->status.ampdu_ack_len, |
949 | tx_resp->ampdu_ack_map); | 946 | info->status.ampdu_ack_map); |
950 | else | 947 | else |
951 | rs_collect_tx_data(search_win, rs_index, tpt, | 948 | rs_collect_tx_data(search_win, rs_index, tpt, |
952 | 1, status); | 949 | 1, status); |
@@ -959,10 +956,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
959 | tpt = curr_tbl->expected_tpt[rs_index]; | 956 | tpt = curr_tbl->expected_tpt[rs_index]; |
960 | else | 957 | else |
961 | tpt = 0; | 958 | tpt = 0; |
962 | if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) | 959 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
963 | rs_collect_tx_data(window, rs_index, tpt, | 960 | rs_collect_tx_data(window, rs_index, tpt, |
964 | tx_resp->ampdu_ack_len, | 961 | info->status.ampdu_ack_len, |
965 | tx_resp->ampdu_ack_map); | 962 | info->status.ampdu_ack_map); |
966 | else | 963 | else |
967 | rs_collect_tx_data(window, rs_index, tpt, | 964 | rs_collect_tx_data(window, rs_index, tpt, |
968 | 1, status); | 965 | 1, status); |
@@ -971,10 +968,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
971 | /* If not searching for new mode, increment success/failed counter | 968 | /* If not searching for new mode, increment success/failed counter |
972 | * ... these help determine when to start searching again */ | 969 | * ... these help determine when to start searching again */ |
973 | if (lq_sta->stay_in_tbl) { | 970 | if (lq_sta->stay_in_tbl) { |
974 | if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) { | 971 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { |
975 | lq_sta->total_success += tx_resp->ampdu_ack_map; | 972 | lq_sta->total_success += info->status.ampdu_ack_map; |
976 | lq_sta->total_failed += | 973 | lq_sta->total_failed += |
977 | (tx_resp->ampdu_ack_len - tx_resp->ampdu_ack_map); | 974 | (info->status.ampdu_ack_len - info->status.ampdu_ack_map); |
978 | } else { | 975 | } else { |
979 | if (status) | 976 | if (status) |
980 | lq_sta->total_success++; | 977 | lq_sta->total_success++; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index fb670b5cfebb..ca9ca92bb7fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -357,22 +357,22 @@ int iwl4965_hwrate_to_plcp_idx(u32 rate_n_flags) | |||
357 | * translate ucode response to mac80211 tx status control values | 357 | * translate ucode response to mac80211 tx status control values |
358 | */ | 358 | */ |
359 | void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, | 359 | void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, |
360 | struct ieee80211_tx_control *control) | 360 | struct ieee80211_tx_info *control) |
361 | { | 361 | { |
362 | int rate_index; | 362 | int rate_index; |
363 | 363 | ||
364 | control->antenna_sel_tx = | 364 | control->antenna_sel_tx = |
365 | ((rate_n_flags & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS); | 365 | ((rate_n_flags & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS); |
366 | if (rate_n_flags & RATE_MCS_HT_MSK) | 366 | if (rate_n_flags & RATE_MCS_HT_MSK) |
367 | control->flags |= IEEE80211_TXCTL_OFDM_HT; | 367 | control->flags |= IEEE80211_TX_CTL_OFDM_HT; |
368 | if (rate_n_flags & RATE_MCS_GF_MSK) | 368 | if (rate_n_flags & RATE_MCS_GF_MSK) |
369 | control->flags |= IEEE80211_TXCTL_GREEN_FIELD; | 369 | control->flags |= IEEE80211_TX_CTL_GREEN_FIELD; |
370 | if (rate_n_flags & RATE_MCS_FAT_MSK) | 370 | if (rate_n_flags & RATE_MCS_FAT_MSK) |
371 | control->flags |= IEEE80211_TXCTL_40_MHZ_WIDTH; | 371 | control->flags |= IEEE80211_TX_CTL_40_MHZ_WIDTH; |
372 | if (rate_n_flags & RATE_MCS_DUP_MSK) | 372 | if (rate_n_flags & RATE_MCS_DUP_MSK) |
373 | control->flags |= IEEE80211_TXCTL_DUP_DATA; | 373 | control->flags |= IEEE80211_TX_CTL_DUP_DATA; |
374 | if (rate_n_flags & RATE_MCS_SGI_MSK) | 374 | if (rate_n_flags & RATE_MCS_SGI_MSK) |
375 | control->flags |= IEEE80211_TXCTL_SHORT_GI; | 375 | control->flags |= IEEE80211_TX_CTL_SHORT_GI; |
376 | rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags); | 376 | rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags); |
377 | if (control->band == IEEE80211_BAND_5GHZ) | 377 | if (control->band == IEEE80211_BAND_5GHZ) |
378 | rate_index -= IWL_FIRST_OFDM_RATE; | 378 | rate_index -= IWL_FIRST_OFDM_RATE; |
@@ -3007,7 +3007,7 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv, | |||
3007 | u16 scd_flow = le16_to_cpu(ba_resp->scd_flow); | 3007 | u16 scd_flow = le16_to_cpu(ba_resp->scd_flow); |
3008 | u64 bitmap; | 3008 | u64 bitmap; |
3009 | int successes = 0; | 3009 | int successes = 0; |
3010 | struct ieee80211_tx_status *tx_status; | 3010 | struct ieee80211_tx_info *info; |
3011 | 3011 | ||
3012 | if (unlikely(!agg->wait_for_ba)) { | 3012 | if (unlikely(!agg->wait_for_ba)) { |
3013 | IWL_ERROR("Received BA when not expected\n"); | 3013 | IWL_ERROR("Received BA when not expected\n"); |
@@ -3045,13 +3045,13 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv, | |||
3045 | agg->start_idx + i); | 3045 | agg->start_idx + i); |
3046 | } | 3046 | } |
3047 | 3047 | ||
3048 | tx_status = &priv->txq[scd_flow].txb[agg->start_idx].status; | 3048 | info = IEEE80211_SKB_CB(priv->txq[scd_flow].txb[agg->start_idx].skb[0]); |
3049 | tx_status->flags = IEEE80211_TX_STATUS_ACK; | 3049 | memset(&info->status, 0, sizeof(info->status)); |
3050 | tx_status->flags |= IEEE80211_TX_STATUS_AMPDU; | 3050 | info->flags = IEEE80211_TX_STAT_ACK; |
3051 | tx_status->ampdu_ack_map = successes; | 3051 | info->flags |= IEEE80211_TX_STAT_AMPDU; |
3052 | tx_status->ampdu_ack_len = agg->frame_count; | 3052 | info->status.ampdu_ack_map = successes; |
3053 | iwl4965_hwrate_to_tx_control(priv, agg->rate_n_flags, | 3053 | info->status.ampdu_ack_len = agg->frame_count; |
3054 | &tx_status->control); | 3054 | iwl4965_hwrate_to_tx_control(priv, agg->rate_n_flags, info); |
3055 | 3055 | ||
3056 | IWL_DEBUG_TX_REPLY("Bitmap %llx\n", (unsigned long long)bitmap); | 3056 | IWL_DEBUG_TX_REPLY("Bitmap %llx\n", (unsigned long long)bitmap); |
3057 | 3057 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index a8d062f7b87a..ad7422eadab2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -207,8 +207,7 @@ void iwl_rx_allocate(struct iwl_priv *priv); | |||
207 | * TX | 207 | * TX |
208 | ******************************************************/ | 208 | ******************************************************/ |
209 | int iwl_txq_ctx_reset(struct iwl_priv *priv); | 209 | int iwl_txq_ctx_reset(struct iwl_priv *priv); |
210 | int iwl_tx_skb(struct iwl_priv *priv, | 210 | int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); |
211 | struct sk_buff *skb, struct ieee80211_tx_control *ctl); | ||
212 | /* FIXME: remove when free Tx is fully merged into iwlcore */ | 211 | /* FIXME: remove when free Tx is fully merged into iwlcore */ |
213 | int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); | 212 | int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); |
214 | void iwl_hw_txq_ctx_free(struct iwl_priv *priv); | 213 | void iwl_hw_txq_ctx_free(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 820542bac443..f7fd8ea61779 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -119,7 +119,6 @@ struct iwl_queue { | |||
119 | 119 | ||
120 | /* One for each TFD */ | 120 | /* One for each TFD */ |
121 | struct iwl_tx_info { | 121 | struct iwl_tx_info { |
122 | struct ieee80211_tx_status status; | ||
123 | struct sk_buff *skb[MAX_NUM_OF_TBS]; | 122 | struct sk_buff *skb[MAX_NUM_OF_TBS]; |
124 | }; | 123 | }; |
125 | 124 | ||
@@ -693,7 +692,7 @@ extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, | |||
693 | struct iwl_frame *frame, u8 rate); | 692 | struct iwl_frame *frame, u8 rate); |
694 | extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, | 693 | extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, |
695 | struct iwl_cmd *cmd, | 694 | struct iwl_cmd *cmd, |
696 | struct ieee80211_tx_control *ctrl, | 695 | struct ieee80211_tx_info *info, |
697 | struct ieee80211_hdr *hdr, | 696 | struct ieee80211_hdr *hdr, |
698 | int sta_id, int tx_id); | 697 | int sta_id, int tx_id); |
699 | extern int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv); | 698 | extern int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv); |
@@ -749,7 +748,7 @@ extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode); | |||
749 | extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); | 748 | extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); |
750 | extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, | 749 | extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, |
751 | u32 rate_n_flags, | 750 | u32 rate_n_flags, |
752 | struct ieee80211_tx_control *control); | 751 | struct ieee80211_tx_info *info); |
753 | 752 | ||
754 | #ifdef CONFIG_IWL4965_HT | 753 | #ifdef CONFIG_IWL4965_HT |
755 | extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv, | 754 | extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 4b5149c8c32e..a61293ba3f6b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -502,7 +502,7 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv) | |||
502 | */ | 502 | */ |
503 | static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, | 503 | static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, |
504 | struct iwl_tx_cmd *tx_cmd, | 504 | struct iwl_tx_cmd *tx_cmd, |
505 | struct ieee80211_tx_control *ctrl, | 505 | struct ieee80211_tx_info *info, |
506 | struct ieee80211_hdr *hdr, | 506 | struct ieee80211_hdr *hdr, |
507 | int is_unicast, u8 std_id) | 507 | int is_unicast, u8 std_id) |
508 | { | 508 | { |
@@ -510,7 +510,7 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, | |||
510 | __le32 tx_flags = tx_cmd->tx_flags; | 510 | __le32 tx_flags = tx_cmd->tx_flags; |
511 | 511 | ||
512 | tx_cmd->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 512 | tx_cmd->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
513 | if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) { | 513 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
514 | tx_flags |= TX_CMD_FLG_ACK_MSK; | 514 | tx_flags |= TX_CMD_FLG_ACK_MSK; |
515 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) | 515 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) |
516 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 516 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
@@ -538,10 +538,10 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, | |||
538 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 538 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
539 | } | 539 | } |
540 | 540 | ||
541 | if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 541 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
542 | tx_flags |= TX_CMD_FLG_RTS_MSK; | 542 | tx_flags |= TX_CMD_FLG_RTS_MSK; |
543 | tx_flags &= ~TX_CMD_FLG_CTS_MSK; | 543 | tx_flags &= ~TX_CMD_FLG_CTS_MSK; |
544 | } else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 544 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
545 | tx_flags &= ~TX_CMD_FLG_RTS_MSK; | 545 | tx_flags &= ~TX_CMD_FLG_RTS_MSK; |
546 | tx_flags |= TX_CMD_FLG_CTS_MSK; | 546 | tx_flags |= TX_CMD_FLG_CTS_MSK; |
547 | } | 547 | } |
@@ -570,7 +570,7 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, | |||
570 | 570 | ||
571 | static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, | 571 | static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, |
572 | struct iwl_tx_cmd *tx_cmd, | 572 | struct iwl_tx_cmd *tx_cmd, |
573 | struct ieee80211_tx_control *ctrl, | 573 | struct ieee80211_tx_info *info, |
574 | u16 fc, int sta_id, | 574 | u16 fc, int sta_id, |
575 | int is_hcca) | 575 | int is_hcca) |
576 | { | 576 | { |
@@ -580,7 +580,7 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, | |||
580 | u16 rate_flags = 0; | 580 | u16 rate_flags = 0; |
581 | int rate_idx; | 581 | int rate_idx; |
582 | 582 | ||
583 | rate_idx = min(ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value & 0xffff, | 583 | rate_idx = min(ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xffff, |
584 | IWL_RATE_COUNT - 1); | 584 | IWL_RATE_COUNT - 1); |
585 | 585 | ||
586 | rate_plcp = iwl_rates[rate_idx].plcp; | 586 | rate_plcp = iwl_rates[rate_idx].plcp; |
@@ -637,18 +637,18 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, | |||
637 | } | 637 | } |
638 | 638 | ||
639 | static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv, | 639 | static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv, |
640 | struct ieee80211_tx_control *ctl, | 640 | struct ieee80211_tx_info *info, |
641 | struct iwl_tx_cmd *tx_cmd, | 641 | struct iwl_tx_cmd *tx_cmd, |
642 | struct sk_buff *skb_frag, | 642 | struct sk_buff *skb_frag, |
643 | int sta_id) | 643 | int sta_id) |
644 | { | 644 | { |
645 | struct ieee80211_key_conf *keyconf = ctl->hw_key; | 645 | struct ieee80211_key_conf *keyconf = info->control.hw_key; |
646 | 646 | ||
647 | switch (keyconf->alg) { | 647 | switch (keyconf->alg) { |
648 | case ALG_CCMP: | 648 | case ALG_CCMP: |
649 | tx_cmd->sec_ctl = TX_CMD_SEC_CCM; | 649 | tx_cmd->sec_ctl = TX_CMD_SEC_CCM; |
650 | memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); | 650 | memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); |
651 | if (ctl->flags & IEEE80211_TXCTL_AMPDU) | 651 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
652 | tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK; | 652 | tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK; |
653 | IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n"); | 653 | IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n"); |
654 | break; | 654 | break; |
@@ -690,13 +690,13 @@ static void iwl_update_tx_stats(struct iwl_priv *priv, u16 fc, u16 len) | |||
690 | /* | 690 | /* |
691 | * start REPLY_TX command process | 691 | * start REPLY_TX command process |
692 | */ | 692 | */ |
693 | int iwl_tx_skb(struct iwl_priv *priv, | 693 | int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) |
694 | struct sk_buff *skb, struct ieee80211_tx_control *ctl) | ||
695 | { | 694 | { |
696 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 695 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
696 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
697 | struct iwl_tfd_frame *tfd; | 697 | struct iwl_tfd_frame *tfd; |
698 | u32 *control_flags; | 698 | u32 *control_flags; |
699 | int txq_id = ctl->queue; | 699 | int txq_id = info->queue; |
700 | struct iwl_tx_queue *txq = NULL; | 700 | struct iwl_tx_queue *txq = NULL; |
701 | struct iwl_queue *q = NULL; | 701 | struct iwl_queue *q = NULL; |
702 | dma_addr_t phys_addr; | 702 | dma_addr_t phys_addr; |
@@ -726,7 +726,7 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
726 | goto drop_unlock; | 726 | goto drop_unlock; |
727 | } | 727 | } |
728 | 728 | ||
729 | if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) == | 729 | if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == |
730 | IWL_INVALID_RATE) { | 730 | IWL_INVALID_RATE) { |
731 | IWL_ERROR("ERROR: No TX rate available.\n"); | 731 | IWL_ERROR("ERROR: No TX rate available.\n"); |
732 | goto drop_unlock; | 732 | goto drop_unlock; |
@@ -782,7 +782,7 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
782 | seq_number += 0x10; | 782 | seq_number += 0x10; |
783 | #ifdef CONFIG_IWL4965_HT | 783 | #ifdef CONFIG_IWL4965_HT |
784 | /* aggregation is on for this <sta,tid> */ | 784 | /* aggregation is on for this <sta,tid> */ |
785 | if (ctl->flags & IEEE80211_TXCTL_AMPDU) | 785 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
786 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; | 786 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; |
787 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | 787 | priv->stations[sta_id].tid[tid].tfds_in_queue++; |
788 | #endif /* CONFIG_IWL4965_HT */ | 788 | #endif /* CONFIG_IWL4965_HT */ |
@@ -803,8 +803,6 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
803 | /* Set up driver data for this TFD */ | 803 | /* Set up driver data for this TFD */ |
804 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); | 804 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); |
805 | txq->txb[q->write_ptr].skb[0] = skb; | 805 | txq->txb[q->write_ptr].skb[0] = skb; |
806 | memcpy(&(txq->txb[q->write_ptr].status.control), | ||
807 | ctl, sizeof(struct ieee80211_tx_control)); | ||
808 | 806 | ||
809 | /* Set up first empty entry in queue's array of Tx/cmd buffers */ | 807 | /* Set up first empty entry in queue's array of Tx/cmd buffers */ |
810 | out_cmd = &txq->cmd[idx]; | 808 | out_cmd = &txq->cmd[idx]; |
@@ -854,8 +852,8 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
854 | * first entry */ | 852 | * first entry */ |
855 | iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); | 853 | iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); |
856 | 854 | ||
857 | if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) | 855 | if (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)) |
858 | iwl_tx_cmd_build_hwcrypto(priv, ctl, tx_cmd, skb, sta_id); | 856 | iwl_tx_cmd_build_hwcrypto(priv, info, tx_cmd, skb, sta_id); |
859 | 857 | ||
860 | /* Set up TFD's 2nd entry to point directly to remainder of skb, | 858 | /* Set up TFD's 2nd entry to point directly to remainder of skb, |
861 | * if any (802.11 null frames have no payload). */ | 859 | * if any (802.11 null frames have no payload). */ |
@@ -874,10 +872,10 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
874 | len = (u16)skb->len; | 872 | len = (u16)skb->len; |
875 | tx_cmd->len = cpu_to_le16(len); | 873 | tx_cmd->len = cpu_to_le16(len); |
876 | /* TODO need this for burst mode later on */ | 874 | /* TODO need this for burst mode later on */ |
877 | iwl_tx_cmd_build_basic(priv, tx_cmd, ctl, hdr, unicast, sta_id); | 875 | iwl_tx_cmd_build_basic(priv, tx_cmd, info, hdr, unicast, sta_id); |
878 | 876 | ||
879 | /* set is_hcca to 0; it probably will never be implemented */ | 877 | /* set is_hcca to 0; it probably will never be implemented */ |
880 | iwl_tx_cmd_build_rate(priv, tx_cmd, ctl, fc, sta_id, 0); | 878 | iwl_tx_cmd_build_rate(priv, tx_cmd, info, fc, sta_id, 0); |
881 | 879 | ||
882 | iwl_update_tx_stats(priv, fc, len); | 880 | iwl_update_tx_stats(priv, fc, len); |
883 | 881 | ||
@@ -919,7 +917,7 @@ int iwl_tx_skb(struct iwl_priv *priv, | |||
919 | spin_unlock_irqrestore(&priv->lock, flags); | 917 | spin_unlock_irqrestore(&priv->lock, flags); |
920 | } | 918 | } |
921 | 919 | ||
922 | ieee80211_stop_queue(priv->hw, ctl->queue); | 920 | ieee80211_stop_queue(priv->hw, info->queue); |
923 | } | 921 | } |
924 | 922 | ||
925 | return 0; | 923 | return 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index a28b4c9f6524..a740a1817d16 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2376,13 +2376,13 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | |||
2376 | } | 2376 | } |
2377 | 2377 | ||
2378 | static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, | 2378 | static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, |
2379 | struct ieee80211_tx_control *ctl, | 2379 | struct ieee80211_tx_info *info, |
2380 | struct iwl3945_cmd *cmd, | 2380 | struct iwl3945_cmd *cmd, |
2381 | struct sk_buff *skb_frag, | 2381 | struct sk_buff *skb_frag, |
2382 | int last_frag) | 2382 | int last_frag) |
2383 | { | 2383 | { |
2384 | struct iwl3945_hw_key *keyinfo = | 2384 | struct iwl3945_hw_key *keyinfo = |
2385 | &priv->stations[ctl->hw_key->hw_key_idx].keyinfo; | 2385 | &priv->stations[info->control.hw_key->hw_key_idx].keyinfo; |
2386 | 2386 | ||
2387 | switch (keyinfo->alg) { | 2387 | switch (keyinfo->alg) { |
2388 | case ALG_CCMP: | 2388 | case ALG_CCMP: |
@@ -2405,7 +2405,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, | |||
2405 | 2405 | ||
2406 | case ALG_WEP: | 2406 | case ALG_WEP: |
2407 | cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP | | 2407 | cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP | |
2408 | (ctl->hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT; | 2408 | (info->control.hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT; |
2409 | 2409 | ||
2410 | if (keyinfo->keylen == 13) | 2410 | if (keyinfo->keylen == 13) |
2411 | cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128; | 2411 | cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128; |
@@ -2413,7 +2413,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, | |||
2413 | memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen); | 2413 | memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen); |
2414 | 2414 | ||
2415 | IWL_DEBUG_TX("Configuring packet for WEP encryption " | 2415 | IWL_DEBUG_TX("Configuring packet for WEP encryption " |
2416 | "with key %d\n", ctl->hw_key->hw_key_idx); | 2416 | "with key %d\n", info->control.hw_key->hw_key_idx); |
2417 | break; | 2417 | break; |
2418 | 2418 | ||
2419 | default: | 2419 | default: |
@@ -2427,7 +2427,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, | |||
2427 | */ | 2427 | */ |
2428 | static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, | 2428 | static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, |
2429 | struct iwl3945_cmd *cmd, | 2429 | struct iwl3945_cmd *cmd, |
2430 | struct ieee80211_tx_control *ctrl, | 2430 | struct ieee80211_tx_info *info, |
2431 | struct ieee80211_hdr *hdr, | 2431 | struct ieee80211_hdr *hdr, |
2432 | int is_unicast, u8 std_id) | 2432 | int is_unicast, u8 std_id) |
2433 | { | 2433 | { |
@@ -2435,7 +2435,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, | |||
2435 | __le32 tx_flags = cmd->cmd.tx.tx_flags; | 2435 | __le32 tx_flags = cmd->cmd.tx.tx_flags; |
2436 | 2436 | ||
2437 | cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 2437 | cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
2438 | if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) { | 2438 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
2439 | tx_flags |= TX_CMD_FLG_ACK_MSK; | 2439 | tx_flags |= TX_CMD_FLG_ACK_MSK; |
2440 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) | 2440 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) |
2441 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 2441 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
@@ -2459,10 +2459,10 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, | |||
2459 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 2459 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
2460 | } | 2460 | } |
2461 | 2461 | ||
2462 | if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 2462 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
2463 | tx_flags |= TX_CMD_FLG_RTS_MSK; | 2463 | tx_flags |= TX_CMD_FLG_RTS_MSK; |
2464 | tx_flags &= ~TX_CMD_FLG_CTS_MSK; | 2464 | tx_flags &= ~TX_CMD_FLG_CTS_MSK; |
2465 | } else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 2465 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
2466 | tx_flags &= ~TX_CMD_FLG_RTS_MSK; | 2466 | tx_flags &= ~TX_CMD_FLG_RTS_MSK; |
2467 | tx_flags |= TX_CMD_FLG_CTS_MSK; | 2467 | tx_flags |= TX_CMD_FLG_CTS_MSK; |
2468 | } | 2468 | } |
@@ -2546,13 +2546,13 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h | |||
2546 | /* | 2546 | /* |
2547 | * start REPLY_TX command process | 2547 | * start REPLY_TX command process |
2548 | */ | 2548 | */ |
2549 | static int iwl3945_tx_skb(struct iwl3945_priv *priv, | 2549 | static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb) |
2550 | struct sk_buff *skb, struct ieee80211_tx_control *ctl) | ||
2551 | { | 2550 | { |
2552 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 2551 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
2552 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
2553 | struct iwl3945_tfd_frame *tfd; | 2553 | struct iwl3945_tfd_frame *tfd; |
2554 | u32 *control_flags; | 2554 | u32 *control_flags; |
2555 | int txq_id = ctl->queue; | 2555 | int txq_id = info->queue; |
2556 | struct iwl3945_tx_queue *txq = NULL; | 2556 | struct iwl3945_tx_queue *txq = NULL; |
2557 | struct iwl3945_queue *q = NULL; | 2557 | struct iwl3945_queue *q = NULL; |
2558 | dma_addr_t phys_addr; | 2558 | dma_addr_t phys_addr; |
@@ -2581,7 +2581,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2581 | goto drop_unlock; | 2581 | goto drop_unlock; |
2582 | } | 2582 | } |
2583 | 2583 | ||
2584 | if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) == IWL_INVALID_RATE) { | 2584 | if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) { |
2585 | IWL_ERROR("ERROR: No TX rate available.\n"); | 2585 | IWL_ERROR("ERROR: No TX rate available.\n"); |
2586 | goto drop_unlock; | 2586 | goto drop_unlock; |
2587 | } | 2587 | } |
@@ -2650,8 +2650,6 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2650 | /* Set up driver data for this TFD */ | 2650 | /* Set up driver data for this TFD */ |
2651 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl3945_tx_info)); | 2651 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl3945_tx_info)); |
2652 | txq->txb[q->write_ptr].skb[0] = skb; | 2652 | txq->txb[q->write_ptr].skb[0] = skb; |
2653 | memcpy(&(txq->txb[q->write_ptr].status.control), | ||
2654 | ctl, sizeof(struct ieee80211_tx_control)); | ||
2655 | 2653 | ||
2656 | /* Init first empty entry in queue's array of Tx/cmd buffers */ | 2654 | /* Init first empty entry in queue's array of Tx/cmd buffers */ |
2657 | out_cmd = &txq->cmd[idx]; | 2655 | out_cmd = &txq->cmd[idx]; |
@@ -2700,8 +2698,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2700 | * first entry */ | 2698 | * first entry */ |
2701 | iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); | 2699 | iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); |
2702 | 2700 | ||
2703 | if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) | 2701 | if (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)) |
2704 | iwl3945_build_tx_cmd_hwcrypto(priv, ctl, out_cmd, skb, 0); | 2702 | iwl3945_build_tx_cmd_hwcrypto(priv, info, out_cmd, skb, 0); |
2705 | 2703 | ||
2706 | /* Set up TFD's 2nd entry to point directly to remainder of skb, | 2704 | /* Set up TFD's 2nd entry to point directly to remainder of skb, |
2707 | * if any (802.11 null frames have no payload). */ | 2705 | * if any (802.11 null frames have no payload). */ |
@@ -2726,10 +2724,10 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2726 | out_cmd->cmd.tx.len = cpu_to_le16(len); | 2724 | out_cmd->cmd.tx.len = cpu_to_le16(len); |
2727 | 2725 | ||
2728 | /* TODO need this for burst mode later on */ | 2726 | /* TODO need this for burst mode later on */ |
2729 | iwl3945_build_tx_cmd_basic(priv, out_cmd, ctl, hdr, unicast, sta_id); | 2727 | iwl3945_build_tx_cmd_basic(priv, out_cmd, info, hdr, unicast, sta_id); |
2730 | 2728 | ||
2731 | /* set is_hcca to 0; it probably will never be implemented */ | 2729 | /* set is_hcca to 0; it probably will never be implemented */ |
2732 | iwl3945_hw_build_tx_cmd_rate(priv, out_cmd, ctl, hdr, sta_id, 0); | 2730 | iwl3945_hw_build_tx_cmd_rate(priv, out_cmd, info, hdr, sta_id, 0); |
2733 | 2731 | ||
2734 | out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; | 2732 | out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; |
2735 | out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; | 2733 | out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; |
@@ -2767,7 +2765,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2767 | spin_unlock_irqrestore(&priv->lock, flags); | 2765 | spin_unlock_irqrestore(&priv->lock, flags); |
2768 | } | 2766 | } |
2769 | 2767 | ||
2770 | ieee80211_stop_queue(priv->hw, ctl->queue); | 2768 | ieee80211_stop_queue(priv->hw, info->queue); |
2771 | } | 2769 | } |
2772 | 2770 | ||
2773 | return 0; | 2771 | return 0; |
@@ -3230,7 +3228,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work) | |||
3230 | struct sk_buff *beacon; | 3228 | struct sk_buff *beacon; |
3231 | 3229 | ||
3232 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ | 3230 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ |
3233 | beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); | 3231 | beacon = ieee80211_beacon_get(priv->hw, priv->vif); |
3234 | 3232 | ||
3235 | if (!beacon) { | 3233 | if (!beacon) { |
3236 | IWL_ERROR("update beacon failed\n"); | 3234 | IWL_ERROR("update beacon failed\n"); |
@@ -6681,8 +6679,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw) | |||
6681 | IWL_DEBUG_MAC80211("leave\n"); | 6679 | IWL_DEBUG_MAC80211("leave\n"); |
6682 | } | 6680 | } |
6683 | 6681 | ||
6684 | static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 6682 | static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
6685 | struct ieee80211_tx_control *ctl) | ||
6686 | { | 6683 | { |
6687 | struct iwl3945_priv *priv = hw->priv; | 6684 | struct iwl3945_priv *priv = hw->priv; |
6688 | 6685 | ||
@@ -6694,9 +6691,9 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
6694 | } | 6691 | } |
6695 | 6692 | ||
6696 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 6693 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
6697 | ieee80211_get_tx_rate(hw, ctl)->bitrate); | 6694 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); |
6698 | 6695 | ||
6699 | if (iwl3945_tx_skb(priv, skb, ctl)) | 6696 | if (iwl3945_tx_skb(priv, skb)) |
6700 | dev_kfree_skb_any(skb); | 6697 | dev_kfree_skb_any(skb); |
6701 | 6698 | ||
6702 | IWL_DEBUG_MAC80211("leave\n"); | 6699 | IWL_DEBUG_MAC80211("leave\n"); |
@@ -7333,8 +7330,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) | |||
7333 | 7330 | ||
7334 | } | 7331 | } |
7335 | 7332 | ||
7336 | static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 7333 | static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
7337 | struct ieee80211_tx_control *control) | ||
7338 | { | 7334 | { |
7339 | struct iwl3945_priv *priv = hw->priv; | 7335 | struct iwl3945_priv *priv = hw->priv; |
7340 | unsigned long flags; | 7336 | unsigned long flags; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 1fad6227aa51..07c52b69d1e2 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1606,17 +1606,7 @@ static int iwl4965_get_measurement(struct iwl_priv *priv, | |||
1606 | static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv, | 1606 | static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv, |
1607 | struct iwl_tx_info *tx_sta) | 1607 | struct iwl_tx_info *tx_sta) |
1608 | { | 1608 | { |
1609 | 1609 | ieee80211_tx_status_irqsafe(priv->hw, tx_sta->skb[0]); | |
1610 | tx_sta->status.ack_signal = 0; | ||
1611 | tx_sta->status.excessive_retries = 0; | ||
1612 | |||
1613 | if (in_interrupt()) | ||
1614 | ieee80211_tx_status_irqsafe(priv->hw, | ||
1615 | tx_sta->skb[0], &(tx_sta->status)); | ||
1616 | else | ||
1617 | ieee80211_tx_status(priv->hw, | ||
1618 | tx_sta->skb[0], &(tx_sta->status)); | ||
1619 | |||
1620 | tx_sta->skb[0] = NULL; | 1610 | tx_sta->skb[0] = NULL; |
1621 | } | 1611 | } |
1622 | 1612 | ||
@@ -1710,7 +1700,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, | |||
1710 | { | 1700 | { |
1711 | u16 status; | 1701 | u16 status; |
1712 | struct agg_tx_status *frame_status = &tx_resp->status; | 1702 | struct agg_tx_status *frame_status = &tx_resp->status; |
1713 | struct ieee80211_tx_status *tx_status = NULL; | 1703 | struct ieee80211_tx_info *info = NULL; |
1714 | struct ieee80211_hdr *hdr = NULL; | 1704 | struct ieee80211_hdr *hdr = NULL; |
1715 | int i, sh; | 1705 | int i, sh; |
1716 | int txq_id, idx; | 1706 | int txq_id, idx; |
@@ -1736,14 +1726,14 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, | |||
1736 | IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", | 1726 | IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", |
1737 | agg->frame_count, agg->start_idx, idx); | 1727 | agg->frame_count, agg->start_idx, idx); |
1738 | 1728 | ||
1739 | tx_status = &(priv->txq[txq_id].txb[idx].status); | 1729 | info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); |
1740 | tx_status->retry_count = tx_resp->failure_frame; | 1730 | info->status.retry_count = tx_resp->failure_frame; |
1741 | tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; | 1731 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
1742 | tx_status->flags = iwl4965_is_tx_success(status)? | 1732 | info->flags |= iwl4965_is_tx_success(status)? |
1743 | IEEE80211_TX_STATUS_ACK : 0; | 1733 | IEEE80211_TX_STAT_ACK : 0; |
1744 | iwl4965_hwrate_to_tx_control(priv, | 1734 | iwl4965_hwrate_to_tx_control(priv, |
1745 | le32_to_cpu(tx_resp->rate_n_flags), | 1735 | le32_to_cpu(tx_resp->rate_n_flags), |
1746 | &tx_status->control); | 1736 | info); |
1747 | /* FIXME: code repetition end */ | 1737 | /* FIXME: code repetition end */ |
1748 | 1738 | ||
1749 | IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", | 1739 | IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", |
@@ -1830,7 +1820,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
1830 | int txq_id = SEQ_TO_QUEUE(sequence); | 1820 | int txq_id = SEQ_TO_QUEUE(sequence); |
1831 | int index = SEQ_TO_INDEX(sequence); | 1821 | int index = SEQ_TO_INDEX(sequence); |
1832 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; | 1822 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; |
1833 | struct ieee80211_tx_status *tx_status; | 1823 | struct ieee80211_tx_info *info; |
1834 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 1824 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
1835 | u32 status = le32_to_cpu(tx_resp->status); | 1825 | u32 status = le32_to_cpu(tx_resp->status); |
1836 | #ifdef CONFIG_IWL4965_HT | 1826 | #ifdef CONFIG_IWL4965_HT |
@@ -1848,6 +1838,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
1848 | return; | 1838 | return; |
1849 | } | 1839 | } |
1850 | 1840 | ||
1841 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]); | ||
1842 | memset(&info->status, 0, sizeof(info->status)); | ||
1843 | |||
1851 | #ifdef CONFIG_IWL4965_HT | 1844 | #ifdef CONFIG_IWL4965_HT |
1852 | hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index); | 1845 | hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index); |
1853 | fc = le16_to_cpu(hdr->frame_control); | 1846 | fc = le16_to_cpu(hdr->frame_control); |
@@ -1902,13 +1895,12 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
1902 | } | 1895 | } |
1903 | } else { | 1896 | } else { |
1904 | #endif /* CONFIG_IWL4965_HT */ | 1897 | #endif /* CONFIG_IWL4965_HT */ |
1905 | tx_status = &(txq->txb[txq->q.read_ptr].status); | ||
1906 | 1898 | ||
1907 | tx_status->retry_count = tx_resp->failure_frame; | 1899 | info->status.retry_count = tx_resp->failure_frame; |
1908 | tx_status->flags = | 1900 | info->flags |= |
1909 | iwl4965_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0; | 1901 | iwl4965_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0; |
1910 | iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), | 1902 | iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), |
1911 | &tx_status->control); | 1903 | info); |
1912 | 1904 | ||
1913 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x " | 1905 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x " |
1914 | "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status), | 1906 | "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status), |
@@ -2053,7 +2045,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work) | |||
2053 | struct sk_buff *beacon; | 2045 | struct sk_buff *beacon; |
2054 | 2046 | ||
2055 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ | 2047 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ |
2056 | beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); | 2048 | beacon = ieee80211_beacon_get(priv->hw, priv->vif); |
2057 | 2049 | ||
2058 | if (!beacon) { | 2050 | if (!beacon) { |
2059 | IWL_ERROR("update beacon failed\n"); | 2051 | IWL_ERROR("update beacon failed\n"); |
@@ -4268,8 +4260,7 @@ static void iwl4965_mac_stop(struct ieee80211_hw *hw) | |||
4268 | IWL_DEBUG_MAC80211("leave\n"); | 4260 | IWL_DEBUG_MAC80211("leave\n"); |
4269 | } | 4261 | } |
4270 | 4262 | ||
4271 | static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 4263 | static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
4272 | struct ieee80211_tx_control *ctl) | ||
4273 | { | 4264 | { |
4274 | struct iwl_priv *priv = hw->priv; | 4265 | struct iwl_priv *priv = hw->priv; |
4275 | 4266 | ||
@@ -4281,9 +4272,9 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
4281 | } | 4272 | } |
4282 | 4273 | ||
4283 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 4274 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
4284 | ieee80211_get_tx_rate(hw, ctl)->bitrate); | 4275 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); |
4285 | 4276 | ||
4286 | if (iwl_tx_skb(priv, skb, ctl)) | 4277 | if (iwl_tx_skb(priv, skb)) |
4287 | dev_kfree_skb_any(skb); | 4278 | dev_kfree_skb_any(skb); |
4288 | 4279 | ||
4289 | IWL_DEBUG_MAC80211("leave\n"); | 4280 | IWL_DEBUG_MAC80211("leave\n"); |
@@ -5065,8 +5056,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw) | |||
5065 | IWL_DEBUG_MAC80211("leave\n"); | 5056 | IWL_DEBUG_MAC80211("leave\n"); |
5066 | } | 5057 | } |
5067 | 5058 | ||
5068 | static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 5059 | static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
5069 | struct ieee80211_tx_control *control) | ||
5070 | { | 5060 | { |
5071 | struct iwl_priv *priv = hw->priv; | 5061 | struct iwl_priv *priv = hw->priv; |
5072 | unsigned long flags; | 5062 | unsigned long flags; |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 3ca9386561ff..850857932e29 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -394,7 +394,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
394 | while (entry != (struct sk_buff *)&priv->tx_queue) { | 394 | while (entry != (struct sk_buff *)&priv->tx_queue) { |
395 | range = (struct memrecord *)&entry->cb; | 395 | range = (struct memrecord *)&entry->cb; |
396 | if (range->start_addr == addr) { | 396 | if (range->start_addr == addr) { |
397 | struct ieee80211_tx_status status; | 397 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); |
398 | struct p54_control_hdr *entry_hdr; | 398 | struct p54_control_hdr *entry_hdr; |
399 | struct p54_tx_control_allocdata *entry_data; | 399 | struct p54_tx_control_allocdata *entry_data; |
400 | int pad = 0; | 400 | int pad = 0; |
@@ -406,30 +406,23 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
406 | 406 | ||
407 | last_addr = range->end_addr; | 407 | last_addr = range->end_addr; |
408 | __skb_unlink(entry, &priv->tx_queue); | 408 | __skb_unlink(entry, &priv->tx_queue); |
409 | if (!range->control) { | 409 | memset(&info->status, 0, sizeof(info->status)); |
410 | kfree_skb(entry); | 410 | priv->tx_stats[info->queue].len--; |
411 | break; | ||
412 | } | ||
413 | memset(&status, 0, sizeof(status)); | ||
414 | memcpy(&status.control, range->control, | ||
415 | sizeof(status.control)); | ||
416 | kfree(range->control); | ||
417 | priv->tx_stats[status.control.queue].len--; | ||
418 | entry_hdr = (struct p54_control_hdr *) entry->data; | 411 | entry_hdr = (struct p54_control_hdr *) entry->data; |
419 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; | 412 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; |
420 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) | 413 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) |
421 | pad = entry_data->align[0]; | 414 | pad = entry_data->align[0]; |
422 | 415 | ||
423 | if (!(status.control.flags & IEEE80211_TXCTL_NO_ACK)) { | 416 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
424 | if (!(payload->status & 0x01)) | 417 | if (!(payload->status & 0x01)) |
425 | status.flags |= IEEE80211_TX_STATUS_ACK; | 418 | info->flags |= IEEE80211_TX_STAT_ACK; |
426 | else | 419 | else |
427 | status.excessive_retries = 1; | 420 | info->status.excessive_retries = 1; |
428 | } | 421 | } |
429 | status.retry_count = payload->retries - 1; | 422 | info->status.retry_count = payload->retries - 1; |
430 | status.ack_signal = le16_to_cpu(payload->ack_rssi); | 423 | info->status.ack_signal = le16_to_cpu(payload->ack_rssi); |
431 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); | 424 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); |
432 | ieee80211_tx_status_irqsafe(dev, entry, &status); | 425 | ieee80211_tx_status_irqsafe(dev, entry); |
433 | break; | 426 | break; |
434 | } else | 427 | } else |
435 | last_addr = range->end_addr; | 428 | last_addr = range->end_addr; |
@@ -494,13 +487,11 @@ EXPORT_SYMBOL_GPL(p54_rx); | |||
494 | * allocated areas. | 487 | * allocated areas. |
495 | */ | 488 | */ |
496 | static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | 489 | static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, |
497 | struct p54_control_hdr *data, u32 len, | 490 | struct p54_control_hdr *data, u32 len) |
498 | struct ieee80211_tx_control *control) | ||
499 | { | 491 | { |
500 | struct p54_common *priv = dev->priv; | 492 | struct p54_common *priv = dev->priv; |
501 | struct sk_buff *entry = priv->tx_queue.next; | 493 | struct sk_buff *entry = priv->tx_queue.next; |
502 | struct sk_buff *target_skb = NULL; | 494 | struct sk_buff *target_skb = NULL; |
503 | struct memrecord *range; | ||
504 | u32 last_addr = priv->rx_start; | 495 | u32 last_addr = priv->rx_start; |
505 | u32 largest_hole = 0; | 496 | u32 largest_hole = 0; |
506 | u32 target_addr = priv->rx_start; | 497 | u32 target_addr = priv->rx_start; |
@@ -512,7 +503,8 @@ static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
512 | left = skb_queue_len(&priv->tx_queue); | 503 | left = skb_queue_len(&priv->tx_queue); |
513 | while (left--) { | 504 | while (left--) { |
514 | u32 hole_size; | 505 | u32 hole_size; |
515 | range = (struct memrecord *)&entry->cb; | 506 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); |
507 | struct memrecord *range = (void *)info->driver_data; | ||
516 | hole_size = range->start_addr - last_addr; | 508 | hole_size = range->start_addr - last_addr; |
517 | if (!target_skb && hole_size >= len) { | 509 | if (!target_skb && hole_size >= len) { |
518 | target_skb = entry->prev; | 510 | target_skb = entry->prev; |
@@ -527,17 +519,18 @@ static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
527 | target_skb = priv->tx_queue.prev; | 519 | target_skb = priv->tx_queue.prev; |
528 | largest_hole = max(largest_hole, priv->rx_end - last_addr - len); | 520 | largest_hole = max(largest_hole, priv->rx_end - last_addr - len); |
529 | if (!skb_queue_empty(&priv->tx_queue)) { | 521 | if (!skb_queue_empty(&priv->tx_queue)) { |
530 | range = (struct memrecord *)&target_skb->cb; | 522 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(target_skb); |
523 | struct memrecord *range = (void *)info->driver_data; | ||
531 | target_addr = range->end_addr; | 524 | target_addr = range->end_addr; |
532 | } | 525 | } |
533 | } else | 526 | } else |
534 | largest_hole = max(largest_hole, priv->rx_end - last_addr); | 527 | largest_hole = max(largest_hole, priv->rx_end - last_addr); |
535 | 528 | ||
536 | if (skb) { | 529 | if (skb) { |
537 | range = (struct memrecord *)&skb->cb; | 530 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
531 | struct memrecord *range = (void *)info->driver_data; | ||
538 | range->start_addr = target_addr; | 532 | range->start_addr = target_addr; |
539 | range->end_addr = target_addr + len; | 533 | range->end_addr = target_addr + len; |
540 | range->control = control; | ||
541 | __skb_queue_after(&priv->tx_queue, target_skb, skb); | 534 | __skb_queue_after(&priv->tx_queue, target_skb, skb); |
542 | if (largest_hole < IEEE80211_MAX_RTS_THRESHOLD + 0x170 + | 535 | if (largest_hole < IEEE80211_MAX_RTS_THRESHOLD + 0x170 + |
543 | sizeof(struct p54_control_hdr)) | 536 | sizeof(struct p54_control_hdr)) |
@@ -548,32 +541,27 @@ static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
548 | data->req_id = cpu_to_le32(target_addr + 0x70); | 541 | data->req_id = cpu_to_le32(target_addr + 0x70); |
549 | } | 542 | } |
550 | 543 | ||
551 | static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 544 | static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
552 | struct ieee80211_tx_control *control) | ||
553 | { | 545 | { |
546 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
554 | struct ieee80211_tx_queue_stats *current_queue; | 547 | struct ieee80211_tx_queue_stats *current_queue; |
555 | struct p54_common *priv = dev->priv; | 548 | struct p54_common *priv = dev->priv; |
556 | struct p54_control_hdr *hdr; | 549 | struct p54_control_hdr *hdr; |
557 | struct p54_tx_control_allocdata *txhdr; | 550 | struct p54_tx_control_allocdata *txhdr; |
558 | struct ieee80211_tx_control *control_copy; | ||
559 | size_t padding, len; | 551 | size_t padding, len; |
560 | u8 rate; | 552 | u8 rate; |
561 | 553 | ||
562 | current_queue = &priv->tx_stats[control->queue]; | 554 | current_queue = &priv->tx_stats[info->queue]; |
563 | if (unlikely(current_queue->len > current_queue->limit)) | 555 | if (unlikely(current_queue->len > current_queue->limit)) |
564 | return NETDEV_TX_BUSY; | 556 | return NETDEV_TX_BUSY; |
565 | current_queue->len++; | 557 | current_queue->len++; |
566 | current_queue->count++; | 558 | current_queue->count++; |
567 | if (current_queue->len == current_queue->limit) | 559 | if (current_queue->len == current_queue->limit) |
568 | ieee80211_stop_queue(dev, control->queue); | 560 | ieee80211_stop_queue(dev, info->queue); |
569 | 561 | ||
570 | padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3; | 562 | padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3; |
571 | len = skb->len; | 563 | len = skb->len; |
572 | 564 | ||
573 | control_copy = kmalloc(sizeof(*control), GFP_ATOMIC); | ||
574 | if (control_copy) | ||
575 | memcpy(control_copy, control, sizeof(*control)); | ||
576 | |||
577 | txhdr = (struct p54_tx_control_allocdata *) | 565 | txhdr = (struct p54_tx_control_allocdata *) |
578 | skb_push(skb, sizeof(*txhdr) + padding); | 566 | skb_push(skb, sizeof(*txhdr) + padding); |
579 | hdr = (struct p54_control_hdr *) skb_push(skb, sizeof(*hdr)); | 567 | hdr = (struct p54_control_hdr *) skb_push(skb, sizeof(*hdr)); |
@@ -583,35 +571,37 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
583 | else | 571 | else |
584 | hdr->magic1 = cpu_to_le16(0x0010); | 572 | hdr->magic1 = cpu_to_le16(0x0010); |
585 | hdr->len = cpu_to_le16(len); | 573 | hdr->len = cpu_to_le16(len); |
586 | hdr->type = (control->flags & IEEE80211_TXCTL_NO_ACK) ? 0 : cpu_to_le16(1); | 574 | hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1); |
587 | hdr->retry1 = hdr->retry2 = control->retry_limit; | 575 | hdr->retry1 = hdr->retry2 = info->control.retry_limit; |
588 | p54_assign_address(dev, skb, hdr, skb->len, control_copy); | ||
589 | 576 | ||
590 | memset(txhdr->wep_key, 0x0, 16); | 577 | memset(txhdr->wep_key, 0x0, 16); |
591 | txhdr->padding = 0; | 578 | txhdr->padding = 0; |
592 | txhdr->padding2 = 0; | 579 | txhdr->padding2 = 0; |
593 | 580 | ||
594 | /* TODO: add support for alternate retry TX rates */ | 581 | /* TODO: add support for alternate retry TX rates */ |
595 | rate = ieee80211_get_tx_rate(dev, control)->hw_value; | 582 | rate = ieee80211_get_tx_rate(dev, info)->hw_value; |
596 | if (control->flags & IEEE80211_TXCTL_SHORT_PREAMBLE) | 583 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) |
597 | rate |= 0x10; | 584 | rate |= 0x10; |
598 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) | 585 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
599 | rate |= 0x40; | 586 | rate |= 0x40; |
600 | else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) | 587 | else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) |
601 | rate |= 0x20; | 588 | rate |= 0x20; |
602 | memset(txhdr->rateset, rate, 8); | 589 | memset(txhdr->rateset, rate, 8); |
603 | txhdr->wep_key_present = 0; | 590 | txhdr->wep_key_present = 0; |
604 | txhdr->wep_key_len = 0; | 591 | txhdr->wep_key_len = 0; |
605 | txhdr->frame_type = cpu_to_le32(control->queue + 4); | 592 | txhdr->frame_type = cpu_to_le32(info->queue + 4); |
606 | txhdr->magic4 = 0; | 593 | txhdr->magic4 = 0; |
607 | txhdr->antenna = (control->antenna_sel_tx == 0) ? | 594 | txhdr->antenna = (info->antenna_sel_tx == 0) ? |
608 | 2 : control->antenna_sel_tx - 1; | 595 | 2 : info->antenna_sel_tx - 1; |
609 | txhdr->output_power = 0x7f; // HW Maximum | 596 | txhdr->output_power = 0x7f; // HW Maximum |
610 | txhdr->magic5 = (control->flags & IEEE80211_TXCTL_NO_ACK) ? | 597 | txhdr->magic5 = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? |
611 | 0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23)); | 598 | 0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23)); |
612 | if (padding) | 599 | if (padding) |
613 | txhdr->align[0] = padding; | 600 | txhdr->align[0] = padding; |
614 | 601 | ||
602 | /* modifies skb->cb and with it info, so must be last! */ | ||
603 | p54_assign_address(dev, skb, hdr, skb->len); | ||
604 | |||
615 | priv->tx(dev, hdr, skb->len, 0); | 605 | priv->tx(dev, hdr, skb->len, 0); |
616 | return 0; | 606 | return 0; |
617 | } | 607 | } |
@@ -634,7 +624,7 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type, | |||
634 | filter = (struct p54_tx_control_filter *) hdr->data; | 624 | filter = (struct p54_tx_control_filter *) hdr->data; |
635 | hdr->magic1 = cpu_to_le16(0x8001); | 625 | hdr->magic1 = cpu_to_le16(0x8001); |
636 | hdr->len = cpu_to_le16(sizeof(*filter)); | 626 | hdr->len = cpu_to_le16(sizeof(*filter)); |
637 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*filter), NULL); | 627 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*filter)); |
638 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_FILTER_SET); | 628 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_FILTER_SET); |
639 | 629 | ||
640 | filter->filter_type = cpu_to_le16(filter_type); | 630 | filter->filter_type = cpu_to_le16(filter_type); |
@@ -678,7 +668,7 @@ static int p54_set_freq(struct ieee80211_hw *dev, __le16 freq) | |||
678 | hdr->magic1 = cpu_to_le16(0x8001); | 668 | hdr->magic1 = cpu_to_le16(0x8001); |
679 | hdr->len = cpu_to_le16(sizeof(*chan)); | 669 | hdr->len = cpu_to_le16(sizeof(*chan)); |
680 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_CHANNEL_CHANGE); | 670 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_CHANNEL_CHANGE); |
681 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + payload_len, NULL); | 671 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + payload_len); |
682 | 672 | ||
683 | chan->magic1 = cpu_to_le16(0x1); | 673 | chan->magic1 = cpu_to_le16(0x1); |
684 | chan->magic2 = cpu_to_le16(0x0); | 674 | chan->magic2 = cpu_to_le16(0x0); |
@@ -751,7 +741,7 @@ static int p54_set_leds(struct ieee80211_hw *dev, int mode, int link, int act) | |||
751 | hdr->magic1 = cpu_to_le16(0x8001); | 741 | hdr->magic1 = cpu_to_le16(0x8001); |
752 | hdr->len = cpu_to_le16(sizeof(*led)); | 742 | hdr->len = cpu_to_le16(sizeof(*led)); |
753 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_LED); | 743 | hdr->type = cpu_to_le16(P54_CONTROL_TYPE_LED); |
754 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*led), NULL); | 744 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*led)); |
755 | 745 | ||
756 | led = (struct p54_tx_control_led *) hdr->data; | 746 | led = (struct p54_tx_control_led *) hdr->data; |
757 | led->mode = cpu_to_le16(mode); | 747 | led->mode = cpu_to_le16(mode); |
@@ -801,7 +791,7 @@ static void p54_set_vdcf(struct ieee80211_hw *dev) | |||
801 | 791 | ||
802 | hdr = (void *)priv->cached_vdcf + priv->tx_hdr_len; | 792 | hdr = (void *)priv->cached_vdcf + priv->tx_hdr_len; |
803 | 793 | ||
804 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*vdcf), NULL); | 794 | p54_assign_address(dev, NULL, hdr, sizeof(*hdr) + sizeof(*vdcf)); |
805 | 795 | ||
806 | vdcf = (struct p54_tx_control_vdcf *) hdr->data; | 796 | vdcf = (struct p54_tx_control_vdcf *) hdr->data; |
807 | 797 | ||
@@ -837,12 +827,8 @@ static void p54_stop(struct ieee80211_hw *dev) | |||
837 | { | 827 | { |
838 | struct p54_common *priv = dev->priv; | 828 | struct p54_common *priv = dev->priv; |
839 | struct sk_buff *skb; | 829 | struct sk_buff *skb; |
840 | while ((skb = skb_dequeue(&priv->tx_queue))) { | 830 | while ((skb = skb_dequeue(&priv->tx_queue))) |
841 | struct memrecord *range = (struct memrecord *)&skb->cb; | ||
842 | if (range->control) | ||
843 | kfree(range->control); | ||
844 | kfree_skb(skb); | 831 | kfree_skb(skb); |
845 | } | ||
846 | priv->stop(dev); | 832 | priv->stop(dev); |
847 | priv->mode = IEEE80211_IF_TYPE_INVALID; | 833 | priv->mode = IEEE80211_IF_TYPE_INVALID; |
848 | } | 834 | } |
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h index c15b56e1d75e..2245fcce92dc 100644 --- a/drivers/net/wireless/p54/p54common.h +++ b/drivers/net/wireless/p54/p54common.h | |||
@@ -152,7 +152,6 @@ struct pda_pa_curve_data { | |||
152 | struct memrecord { | 152 | struct memrecord { |
153 | u32 start_addr; | 153 | u32 start_addr; |
154 | u32 end_addr; | 154 | u32 end_addr; |
155 | struct ieee80211_tx_control *control; | ||
156 | }; | 155 | }; |
157 | 156 | ||
158 | struct p54_eeprom_lm86 { | 157 | struct p54_eeprom_lm86 { |
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 4fcba9b4635f..900140d3b304 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1484,11 +1484,11 @@ static u64 rt2400pci_get_tsf(struct ieee80211_hw *hw) | |||
1484 | return tsf; | 1484 | return tsf; |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 1487 | static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
1488 | struct ieee80211_tx_control *control) | ||
1489 | { | 1488 | { |
1490 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1489 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1491 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 1490 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1491 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
1492 | struct queue_entry_priv_pci *entry_priv; | 1492 | struct queue_entry_priv_pci *entry_priv; |
1493 | struct skb_frame_desc *skbdesc; | 1493 | struct skb_frame_desc *skbdesc; |
1494 | struct txentry_desc txdesc; | 1494 | struct txentry_desc txdesc; |
@@ -1504,7 +1504,7 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1504 | * for our information. | 1504 | * for our information. |
1505 | */ | 1505 | */ |
1506 | intf->beacon->skb = skb; | 1506 | intf->beacon->skb = skb; |
1507 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | 1507 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
1508 | 1508 | ||
1509 | /* | 1509 | /* |
1510 | * Fill in skb descriptor | 1510 | * Fill in skb descriptor |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 06e87cdff455..673350953b89 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1799,11 +1799,11 @@ static u64 rt2500pci_get_tsf(struct ieee80211_hw *hw) | |||
1799 | return tsf; | 1799 | return tsf; |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 1802 | static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
1803 | struct ieee80211_tx_control *control) | ||
1804 | { | 1803 | { |
1805 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1804 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1806 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 1805 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1806 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
1807 | struct queue_entry_priv_pci *entry_priv; | 1807 | struct queue_entry_priv_pci *entry_priv; |
1808 | struct skb_frame_desc *skbdesc; | 1808 | struct skb_frame_desc *skbdesc; |
1809 | struct txentry_desc txdesc; | 1809 | struct txentry_desc txdesc; |
@@ -1820,7 +1820,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1820 | * for our information. | 1820 | * for our information. |
1821 | */ | 1821 | */ |
1822 | intf->beacon->skb = skb; | 1822 | intf->beacon->skb = skb; |
1823 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | 1823 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
1824 | 1824 | ||
1825 | /* | 1825 | /* |
1826 | * Fill in skb descriptor | 1826 | * Fill in skb descriptor |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 4122c5ebe7c3..cca1504550dc 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1666,13 +1666,12 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1666 | /* | 1666 | /* |
1667 | * IEEE80211 stack callback functions. | 1667 | * IEEE80211 stack callback functions. |
1668 | */ | 1668 | */ |
1669 | static int rt2500usb_beacon_update(struct ieee80211_hw *hw, | 1669 | static int rt2500usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
1670 | struct sk_buff *skb, | ||
1671 | struct ieee80211_tx_control *control) | ||
1672 | { | 1670 | { |
1673 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1671 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1674 | struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); | 1672 | struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); |
1675 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 1673 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1674 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
1676 | struct queue_entry_priv_usb_bcn *bcn_priv; | 1675 | struct queue_entry_priv_usb_bcn *bcn_priv; |
1677 | struct skb_frame_desc *skbdesc; | 1676 | struct skb_frame_desc *skbdesc; |
1678 | struct txentry_desc txdesc; | 1677 | struct txentry_desc txdesc; |
@@ -1691,7 +1690,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw, | |||
1691 | * for our information. | 1690 | * for our information. |
1692 | */ | 1691 | */ |
1693 | intf->beacon->skb = skb; | 1692 | intf->beacon->skb = skb; |
1694 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | 1693 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
1695 | 1694 | ||
1696 | /* | 1695 | /* |
1697 | * Add the descriptor in front of the skb. | 1696 | * Add the descriptor in front of the skb. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 1900d4c0e846..5c7220ea46e6 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -542,8 +542,7 @@ struct rt2x00lib_ops { | |||
542 | struct sk_buff *skb, | 542 | struct sk_buff *skb, |
543 | struct txentry_desc *txdesc); | 543 | struct txentry_desc *txdesc); |
544 | int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, | 544 | int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, |
545 | struct data_queue *queue, struct sk_buff *skb, | 545 | struct data_queue *queue, struct sk_buff *skb); |
546 | struct ieee80211_tx_control *control); | ||
547 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, | 546 | int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, |
548 | struct sk_buff *skb); | 547 | struct sk_buff *skb); |
549 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, | 548 | void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, |
@@ -930,7 +929,6 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate) | |||
930 | * rt2x00queue_create_tx_descriptor - Create TX descriptor from mac80211 input | 929 | * rt2x00queue_create_tx_descriptor - Create TX descriptor from mac80211 input |
931 | * @entry: The entry which will be used to transfer the TX frame. | 930 | * @entry: The entry which will be used to transfer the TX frame. |
932 | * @txdesc: rt2x00 TX descriptor which will be initialized by this function. | 931 | * @txdesc: rt2x00 TX descriptor which will be initialized by this function. |
933 | * @control: mac80211 TX control structure from where we read the information. | ||
934 | * | 932 | * |
935 | * This function will initialize the &struct txentry_desc based on information | 933 | * This function will initialize the &struct txentry_desc based on information |
936 | * from mac80211. This descriptor can then be used by rt2x00lib and the drivers | 934 | * from mac80211. This descriptor can then be used by rt2x00lib and the drivers |
@@ -943,8 +941,7 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate) | |||
943 | * the &struct txentry_desc structure. | 941 | * the &struct txentry_desc structure. |
944 | */ | 942 | */ |
945 | void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | 943 | void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, |
946 | struct txentry_desc *txdesc, | 944 | struct txentry_desc *txdesc); |
947 | struct ieee80211_tx_control *control); | ||
948 | 945 | ||
949 | /** | 946 | /** |
950 | * rt2x00queue_write_tx_descriptor - Write TX descriptor to hardware | 947 | * rt2x00queue_write_tx_descriptor - Write TX descriptor to hardware |
@@ -1001,8 +998,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
1001 | /* | 998 | /* |
1002 | * mac80211 handlers. | 999 | * mac80211 handlers. |
1003 | */ | 1000 | */ |
1004 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 1001 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
1005 | struct ieee80211_tx_control *control); | ||
1006 | int rt2x00mac_start(struct ieee80211_hw *hw); | 1002 | int rt2x00mac_start(struct ieee80211_hw *hw); |
1007 | void rt2x00mac_stop(struct ieee80211_hw *hw); | 1003 | void rt2x00mac_stop(struct ieee80211_hw *hw); |
1008 | int rt2x00mac_add_interface(struct ieee80211_hw *hw, | 1004 | int rt2x00mac_add_interface(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index d341764e1b24..69e233610c94 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -415,7 +415,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac, | |||
415 | struct rt2x00_dev *rt2x00dev = data; | 415 | struct rt2x00_dev *rt2x00dev = data; |
416 | struct rt2x00_intf *intf = vif_to_intf(vif); | 416 | struct rt2x00_intf *intf = vif_to_intf(vif); |
417 | struct sk_buff *skb; | 417 | struct sk_buff *skb; |
418 | struct ieee80211_tx_control control; | ||
419 | struct ieee80211_bss_conf conf; | 418 | struct ieee80211_bss_conf conf; |
420 | int delayed_flags; | 419 | int delayed_flags; |
421 | 420 | ||
@@ -433,9 +432,9 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac, | |||
433 | spin_unlock(&intf->lock); | 432 | spin_unlock(&intf->lock); |
434 | 433 | ||
435 | if (delayed_flags & DELAYED_UPDATE_BEACON) { | 434 | if (delayed_flags & DELAYED_UPDATE_BEACON) { |
436 | skb = ieee80211_beacon_get(rt2x00dev->hw, vif, &control); | 435 | skb = ieee80211_beacon_get(rt2x00dev->hw, vif); |
437 | if (skb && rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, | 436 | if (skb && |
438 | skb, &control)) | 437 | rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, skb)) |
439 | dev_kfree_skb(skb); | 438 | dev_kfree_skb(skb); |
440 | } | 439 | } |
441 | 440 | ||
@@ -494,8 +493,13 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
494 | struct txdone_entry_desc *txdesc) | 493 | struct txdone_entry_desc *txdesc) |
495 | { | 494 | { |
496 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 495 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
497 | struct skb_frame_desc *skbdesc; | 496 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
498 | struct ieee80211_tx_status tx_status; | 497 | |
498 | /* | ||
499 | * Send frame to debugfs immediately, after this call is completed | ||
500 | * we are going to overwrite the skb->cb array. | ||
501 | */ | ||
502 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb); | ||
499 | 503 | ||
500 | /* | 504 | /* |
501 | * Update TX statistics. | 505 | * Update TX statistics. |
@@ -508,21 +512,20 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
508 | /* | 512 | /* |
509 | * Initialize TX status | 513 | * Initialize TX status |
510 | */ | 514 | */ |
511 | tx_status.flags = 0; | 515 | memset(&tx_info->status, 0, sizeof(tx_info->status)); |
512 | tx_status.ack_signal = 0; | 516 | tx_info->status.ack_signal = 0; |
513 | tx_status.excessive_retries = | 517 | tx_info->status.excessive_retries = |
514 | test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags); | 518 | test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags); |
515 | tx_status.retry_count = txdesc->retry; | 519 | tx_info->status.retry_count = txdesc->retry; |
516 | memcpy(&tx_status.control, txdesc->control, sizeof(*txdesc->control)); | ||
517 | 520 | ||
518 | if (!(tx_status.control.flags & IEEE80211_TXCTL_NO_ACK)) { | 521 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
519 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) | 522 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) |
520 | tx_status.flags |= IEEE80211_TX_STATUS_ACK; | 523 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
521 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) | 524 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) |
522 | rt2x00dev->low_level_stats.dot11ACKFailureCount++; | 525 | rt2x00dev->low_level_stats.dot11ACKFailureCount++; |
523 | } | 526 | } |
524 | 527 | ||
525 | if (tx_status.control.flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 528 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
526 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) | 529 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) |
527 | rt2x00dev->low_level_stats.dot11RTSSuccessCount++; | 530 | rt2x00dev->low_level_stats.dot11RTSSuccessCount++; |
528 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) | 531 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) |
@@ -530,19 +533,13 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
530 | } | 533 | } |
531 | 534 | ||
532 | /* | 535 | /* |
533 | * Send the tx_status to debugfs. Only send the status report | 536 | * Only send the status report to mac80211 when TX status was |
534 | * to mac80211 when the frame originated from there. If this was | 537 | * requested by it. If this was a extra frame coming through |
535 | * a extra frame coming through a mac80211 library call (RTS/CTS) | 538 | * a mac80211 library call (RTS/CTS) then we should not send the |
536 | * then we should not send the status report back. | 539 | * status report back. |
537 | * If send to mac80211, mac80211 will clean up the skb structure, | ||
538 | * otherwise we have to do it ourself. | ||
539 | */ | 540 | */ |
540 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb); | 541 | if (tx_info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) |
541 | 542 | ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb); | |
542 | skbdesc = get_skb_frame_desc(entry->skb); | ||
543 | if (!(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED)) | ||
544 | ieee80211_tx_status_irqsafe(rt2x00dev->hw, | ||
545 | entry->skb, &tx_status); | ||
546 | else | 543 | else |
547 | dev_kfree_skb_irq(entry->skb); | 544 | dev_kfree_skb_irq(entry->skb); |
548 | entry->skb = NULL; | 545 | entry->skb = NULL; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index c5cedb29b87d..b5379b027b18 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -31,14 +31,15 @@ | |||
31 | 31 | ||
32 | static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev, | 32 | static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev, |
33 | struct data_queue *queue, | 33 | struct data_queue *queue, |
34 | struct sk_buff *frag_skb, | 34 | struct sk_buff *frag_skb) |
35 | struct ieee80211_tx_control *control) | ||
36 | { | 35 | { |
36 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(frag_skb); | ||
37 | struct skb_frame_desc *skbdesc; | 37 | struct skb_frame_desc *skbdesc; |
38 | struct ieee80211_tx_info *rts_info; | ||
38 | struct sk_buff *skb; | 39 | struct sk_buff *skb; |
39 | int size; | 40 | int size; |
40 | 41 | ||
41 | if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) | 42 | if (tx_info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) |
42 | size = sizeof(struct ieee80211_cts); | 43 | size = sizeof(struct ieee80211_cts); |
43 | else | 44 | else |
44 | size = sizeof(struct ieee80211_rts); | 45 | size = sizeof(struct ieee80211_rts); |
@@ -52,13 +53,33 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev, | |||
52 | skb_reserve(skb, rt2x00dev->hw->extra_tx_headroom); | 53 | skb_reserve(skb, rt2x00dev->hw->extra_tx_headroom); |
53 | skb_put(skb, size); | 54 | skb_put(skb, size); |
54 | 55 | ||
55 | if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) | 56 | /* |
56 | ieee80211_ctstoself_get(rt2x00dev->hw, control->vif, | 57 | * Copy TX information over from original frame to |
57 | frag_skb->data, frag_skb->len, control, | 58 | * RTS/CTS frame. Note that we set the no encryption flag |
59 | * since we don't want this frame to be encrypted. | ||
60 | * RTS frames should be acked, while CTS-to-self frames | ||
61 | * should not. The ready for TX flag is cleared to prevent | ||
62 | * it being automatically send when the descriptor is | ||
63 | * written to the hardware. | ||
64 | */ | ||
65 | memcpy(skb->cb, frag_skb->cb, sizeof(skb->cb)); | ||
66 | rts_info = IEEE80211_SKB_CB(skb); | ||
67 | rts_info->flags |= IEEE80211_TX_CTL_DO_NOT_ENCRYPT; | ||
68 | rts_info->flags &= ~IEEE80211_TX_CTL_USE_CTS_PROTECT; | ||
69 | rts_info->flags &= ~IEEE80211_TX_CTL_REQ_TX_STATUS; | ||
70 | |||
71 | if (tx_info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) | ||
72 | rts_info->flags |= IEEE80211_TX_CTL_NO_ACK; | ||
73 | else | ||
74 | rts_info->flags &= ~IEEE80211_TX_CTL_NO_ACK; | ||
75 | |||
76 | if (tx_info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) | ||
77 | ieee80211_ctstoself_get(rt2x00dev->hw, tx_info->control.vif, | ||
78 | frag_skb->data, size, tx_info, | ||
58 | (struct ieee80211_cts *)(skb->data)); | 79 | (struct ieee80211_cts *)(skb->data)); |
59 | else | 80 | else |
60 | ieee80211_rts_get(rt2x00dev->hw, control->vif, | 81 | ieee80211_rts_get(rt2x00dev->hw, tx_info->control.vif, |
61 | frag_skb->data, frag_skb->len, control, | 82 | frag_skb->data, size, tx_info, |
62 | (struct ieee80211_rts *)(skb->data)); | 83 | (struct ieee80211_rts *)(skb->data)); |
63 | 84 | ||
64 | /* | 85 | /* |
@@ -68,7 +89,7 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev, | |||
68 | memset(skbdesc, 0, sizeof(*skbdesc)); | 89 | memset(skbdesc, 0, sizeof(*skbdesc)); |
69 | skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; | 90 | skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; |
70 | 91 | ||
71 | if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, queue, skb, control)) { | 92 | if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, queue, skb)) { |
72 | WARNING(rt2x00dev, "Failed to send RTS/CTS frame.\n"); | 93 | WARNING(rt2x00dev, "Failed to send RTS/CTS frame.\n"); |
73 | return NETDEV_TX_BUSY; | 94 | return NETDEV_TX_BUSY; |
74 | } | 95 | } |
@@ -76,14 +97,13 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev, | |||
76 | return NETDEV_TX_OK; | 97 | return NETDEV_TX_OK; |
77 | } | 98 | } |
78 | 99 | ||
79 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 100 | int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
80 | struct ieee80211_tx_control *control) | ||
81 | { | 101 | { |
82 | struct rt2x00_dev *rt2x00dev = hw->priv; | 102 | struct rt2x00_dev *rt2x00dev = hw->priv; |
103 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | ||
83 | struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; | 104 | struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; |
84 | enum data_queue_qid qid = mac80211_queue_to_qid(control->queue); | 105 | enum data_queue_qid qid = mac80211_queue_to_qid(tx_info->queue); |
85 | struct data_queue *queue; | 106 | struct data_queue *queue; |
86 | struct skb_frame_desc *skbdesc; | ||
87 | u16 frame_control; | 107 | u16 frame_control; |
88 | 108 | ||
89 | /* | 109 | /* |
@@ -100,7 +120,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
100 | /* | 120 | /* |
101 | * Determine which queue to put packet on. | 121 | * Determine which queue to put packet on. |
102 | */ | 122 | */ |
103 | if (control->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM && | 123 | if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM && |
104 | test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) | 124 | test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) |
105 | queue = rt2x00queue_get_queue(rt2x00dev, QID_ATIM); | 125 | queue = rt2x00queue_get_queue(rt2x00dev, QID_ATIM); |
106 | else | 126 | else |
@@ -125,33 +145,27 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
125 | */ | 145 | */ |
126 | frame_control = le16_to_cpu(ieee80211hdr->frame_control); | 146 | frame_control = le16_to_cpu(ieee80211hdr->frame_control); |
127 | if (!is_rts_frame(frame_control) && !is_cts_frame(frame_control) && | 147 | if (!is_rts_frame(frame_control) && !is_cts_frame(frame_control) && |
128 | (control->flags & (IEEE80211_TXCTL_USE_RTS_CTS | | 148 | (tx_info->flags & (IEEE80211_TX_CTL_USE_RTS_CTS | |
129 | IEEE80211_TXCTL_USE_CTS_PROTECT)) && | 149 | IEEE80211_TX_CTL_USE_CTS_PROTECT)) && |
130 | !rt2x00dev->ops->hw->set_rts_threshold) { | 150 | !rt2x00dev->ops->hw->set_rts_threshold) { |
131 | if (rt2x00queue_available(queue) <= 1) { | 151 | if (rt2x00queue_available(queue) <= 1) { |
132 | ieee80211_stop_queue(rt2x00dev->hw, control->queue); | 152 | ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue); |
133 | return NETDEV_TX_BUSY; | 153 | return NETDEV_TX_BUSY; |
134 | } | 154 | } |
135 | 155 | ||
136 | if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb, control)) { | 156 | if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb)) { |
137 | ieee80211_stop_queue(rt2x00dev->hw, control->queue); | 157 | ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue); |
138 | return NETDEV_TX_BUSY; | 158 | return NETDEV_TX_BUSY; |
139 | } | 159 | } |
140 | } | 160 | } |
141 | 161 | ||
142 | /* | 162 | if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, queue, skb)) { |
143 | * Initialize skb descriptor | 163 | ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue); |
144 | */ | ||
145 | skbdesc = get_skb_frame_desc(skb); | ||
146 | memset(skbdesc, 0, sizeof(*skbdesc)); | ||
147 | |||
148 | if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, queue, skb, control)) { | ||
149 | ieee80211_stop_queue(rt2x00dev->hw, control->queue); | ||
150 | return NETDEV_TX_BUSY; | 164 | return NETDEV_TX_BUSY; |
151 | } | 165 | } |
152 | 166 | ||
153 | if (rt2x00queue_full(queue)) | 167 | if (rt2x00queue_full(queue)) |
154 | ieee80211_stop_queue(rt2x00dev->hw, control->queue); | 168 | ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue); |
155 | 169 | ||
156 | if (rt2x00dev->ops->lib->kick_tx_queue) | 170 | if (rt2x00dev->ops->lib->kick_tx_queue) |
157 | rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, qid); | 171 | rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, qid); |
@@ -380,9 +394,7 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw, | |||
380 | if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon) | 394 | if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon) |
381 | return 0; | 395 | return 0; |
382 | 396 | ||
383 | status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, | 397 | status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, conf->beacon); |
384 | conf->beacon, | ||
385 | conf->beacon_control); | ||
386 | if (status) | 398 | if (status) |
387 | dev_kfree_skb(conf->beacon); | 399 | dev_kfree_skb(conf->beacon); |
388 | 400 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index fa7de41be049..70a3d135f64e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -35,8 +35,7 @@ | |||
35 | * TX data handlers. | 35 | * TX data handlers. |
36 | */ | 36 | */ |
37 | int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, | 37 | int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, |
38 | struct data_queue *queue, struct sk_buff *skb, | 38 | struct data_queue *queue, struct sk_buff *skb) |
39 | struct ieee80211_tx_control *control) | ||
40 | { | 39 | { |
41 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); | 40 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); |
42 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; | 41 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
@@ -64,19 +63,19 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
64 | * for our information. | 63 | * for our information. |
65 | */ | 64 | */ |
66 | entry->skb = skb; | 65 | entry->skb = skb; |
67 | rt2x00queue_create_tx_descriptor(entry, &txdesc, control); | 66 | rt2x00queue_create_tx_descriptor(entry, &txdesc); |
68 | 67 | ||
69 | /* | 68 | /* |
70 | * Fill in skb descriptor | 69 | * Fill in skb descriptor |
71 | */ | 70 | */ |
72 | skbdesc = get_skb_frame_desc(skb); | 71 | skbdesc = get_skb_frame_desc(skb); |
72 | memset(skbdesc, 0, sizeof(*skbdesc)); | ||
73 | skbdesc->data = skb->data; | 73 | skbdesc->data = skb->data; |
74 | skbdesc->data_len = skb->len; | 74 | skbdesc->data_len = skb->len; |
75 | skbdesc->desc = entry_priv->desc; | 75 | skbdesc->desc = entry_priv->desc; |
76 | skbdesc->desc_len = queue->desc_size; | 76 | skbdesc->desc_len = queue->desc_size; |
77 | skbdesc->entry = entry; | 77 | skbdesc->entry = entry; |
78 | 78 | ||
79 | memcpy(&entry_priv->control, control, sizeof(entry_priv->control)); | ||
80 | memcpy(entry_priv->data, skb->data, skb->len); | 79 | memcpy(entry_priv->data, skb->data, skb->len); |
81 | 80 | ||
82 | rt2x00queue_write_tx_descriptor(entry, &txdesc); | 81 | rt2x00queue_write_tx_descriptor(entry, &txdesc); |
@@ -164,9 +163,9 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry, | |||
164 | struct txdone_entry_desc *txdesc) | 163 | struct txdone_entry_desc *txdesc) |
165 | { | 164 | { |
166 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; | 165 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
166 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); | ||
167 | u32 word; | 167 | u32 word; |
168 | 168 | ||
169 | txdesc->control = &entry_priv->control; | ||
170 | rt2x00lib_txdone(entry, txdesc); | 169 | rt2x00lib_txdone(entry, txdesc); |
171 | 170 | ||
172 | /* | 171 | /* |
@@ -187,7 +186,7 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry, | |||
187 | * is reenabled when the txdone handler has finished. | 186 | * is reenabled when the txdone handler has finished. |
188 | */ | 187 | */ |
189 | if (!rt2x00queue_full(entry->queue)) | 188 | if (!rt2x00queue_full(entry->queue)) |
190 | ieee80211_wake_queue(rt2x00dev->hw, entry_priv->control.queue); | 189 | ieee80211_wake_queue(rt2x00dev->hw, qid); |
191 | 190 | ||
192 | } | 191 | } |
193 | EXPORT_SYMBOL_GPL(rt2x00pci_txdone); | 192 | EXPORT_SYMBOL_GPL(rt2x00pci_txdone); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h index 557d15a888ab..37c851e442c1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.h +++ b/drivers/net/wireless/rt2x00/rt2x00pci.h | |||
@@ -91,8 +91,7 @@ rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, | |||
91 | * TX data handlers. | 91 | * TX data handlers. |
92 | */ | 92 | */ |
93 | int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, | 93 | int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, |
94 | struct data_queue *queue, struct sk_buff *skb, | 94 | struct data_queue *queue, struct sk_buff *skb); |
95 | struct ieee80211_tx_control *control); | ||
96 | 95 | ||
97 | /** | 96 | /** |
98 | * struct queue_entry_priv_pci: Per entry PCI specific information | 97 | * struct queue_entry_priv_pci: Per entry PCI specific information |
@@ -101,7 +100,6 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
101 | * @desc_dma: DMA pointer to &desc. | 100 | * @desc_dma: DMA pointer to &desc. |
102 | * @data: Pointer to device's entry memory. | 101 | * @data: Pointer to device's entry memory. |
103 | * @data_dma: DMA pointer to &data. | 102 | * @data_dma: DMA pointer to &data. |
104 | * @control: mac80211 control structure used to transmit data. | ||
105 | */ | 103 | */ |
106 | struct queue_entry_priv_pci { | 104 | struct queue_entry_priv_pci { |
107 | __le32 *desc; | 105 | __le32 *desc; |
@@ -109,8 +107,6 @@ struct queue_entry_priv_pci { | |||
109 | 107 | ||
110 | void *data; | 108 | void *data; |
111 | dma_addr_t data_dma; | 109 | dma_addr_t data_dma; |
112 | |||
113 | struct ieee80211_tx_control control; | ||
114 | }; | 110 | }; |
115 | 111 | ||
116 | /** | 112 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 5cf4c2f59260..e69ef4b19239 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -30,13 +30,13 @@ | |||
30 | #include "rt2x00lib.h" | 30 | #include "rt2x00lib.h" |
31 | 31 | ||
32 | void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | 32 | void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, |
33 | struct txentry_desc *txdesc, | 33 | struct txentry_desc *txdesc) |
34 | struct ieee80211_tx_control *control) | ||
35 | { | 34 | { |
36 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 35 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
36 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | ||
37 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 37 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
38 | struct ieee80211_rate *rate = | 38 | struct ieee80211_rate *rate = |
39 | ieee80211_get_tx_rate(rt2x00dev->hw, control); | 39 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); |
40 | const struct rt2x00_rate *hwrate; | 40 | const struct rt2x00_rate *hwrate; |
41 | unsigned int data_length; | 41 | unsigned int data_length; |
42 | unsigned int duration; | 42 | unsigned int duration; |
@@ -64,7 +64,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
64 | /* | 64 | /* |
65 | * Check whether this frame is to be acked. | 65 | * Check whether this frame is to be acked. |
66 | */ | 66 | */ |
67 | if (!(control->flags & IEEE80211_TXCTL_NO_ACK)) | 67 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) |
68 | __set_bit(ENTRY_TXD_ACK, &txdesc->flags); | 68 | __set_bit(ENTRY_TXD_ACK, &txdesc->flags); |
69 | 69 | ||
70 | /* | 70 | /* |
@@ -72,23 +72,20 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
72 | */ | 72 | */ |
73 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { | 73 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { |
74 | __set_bit(ENTRY_TXD_BURST, &txdesc->flags); | 74 | __set_bit(ENTRY_TXD_BURST, &txdesc->flags); |
75 | if (is_rts_frame(frame_control)) { | 75 | if (is_rts_frame(frame_control)) |
76 | __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags); | 76 | __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags); |
77 | __set_bit(ENTRY_TXD_ACK, &txdesc->flags); | 77 | else |
78 | } else { | ||
79 | __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags); | 78 | __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags); |
80 | __clear_bit(ENTRY_TXD_ACK, &txdesc->flags); | 79 | if (tx_info->control.rts_cts_rate_idx >= 0) |
81 | } | ||
82 | if (control->rts_cts_rate_idx >= 0) | ||
83 | rate = | 80 | rate = |
84 | ieee80211_get_rts_cts_rate(rt2x00dev->hw, control); | 81 | ieee80211_get_rts_cts_rate(rt2x00dev->hw, tx_info); |
85 | } | 82 | } |
86 | 83 | ||
87 | /* | 84 | /* |
88 | * Determine retry information. | 85 | * Determine retry information. |
89 | */ | 86 | */ |
90 | txdesc->retry_limit = control->retry_limit; | 87 | txdesc->retry_limit = tx_info->control.retry_limit; |
91 | if (control->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | 88 | if (tx_info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT) |
92 | __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags); | 89 | __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags); |
93 | 90 | ||
94 | /* | 91 | /* |
@@ -113,7 +110,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
113 | */ | 110 | */ |
114 | if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)) { | 111 | if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)) { |
115 | txdesc->ifs = IFS_SIFS; | 112 | txdesc->ifs = IFS_SIFS; |
116 | } else if (control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) { | 113 | } else if (tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) { |
117 | __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags); | 114 | __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags); |
118 | txdesc->ifs = IFS_BACKOFF; | 115 | txdesc->ifs = IFS_BACKOFF; |
119 | } else { | 116 | } else { |
@@ -179,8 +176,10 @@ void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, | |||
179 | 176 | ||
180 | /* | 177 | /* |
181 | * We are done writing the frame to the queue entry, | 178 | * We are done writing the frame to the queue entry, |
182 | * if this entry is a RTS of CTS-to-self frame we are done, | 179 | * also kick the queue in case the correct flags are set, |
183 | * otherwise we need to kick the queue. | 180 | * note that this will automatically filter beacons and |
181 | * RTS/CTS frames since those frames don't have this flag | ||
182 | * set. | ||
184 | */ | 183 | */ |
185 | if (rt2x00dev->ops->lib->kick_tx_queue && | 184 | if (rt2x00dev->ops->lib->kick_tx_queue && |
186 | !(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED)) | 185 | !(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED)) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index c6edc52873c4..f263fe422f87 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -105,8 +105,8 @@ enum skb_frame_desc_flags { | |||
105 | /** | 105 | /** |
106 | * struct skb_frame_desc: Descriptor information for the skb buffer | 106 | * struct skb_frame_desc: Descriptor information for the skb buffer |
107 | * | 107 | * |
108 | * This structure is placed over the skb->cb array, this means that | 108 | * This structure is placed over the driver_data array, this means that |
109 | * this structure should not exceed the size of that array (48 bytes). | 109 | * this structure should not exceed the size of that array (40 bytes). |
110 | * | 110 | * |
111 | * @flags: Frame flags, see &enum skb_frame_desc_flags. | 111 | * @flags: Frame flags, see &enum skb_frame_desc_flags. |
112 | * @data: Pointer to data part of frame (Start of ieee80211 header). | 112 | * @data: Pointer to data part of frame (Start of ieee80211 header). |
@@ -129,10 +129,15 @@ struct skb_frame_desc { | |||
129 | struct queue_entry *entry; | 129 | struct queue_entry *entry; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | /** | ||
133 | * get_skb_frame_desc - Obtain the rt2x00 frame descriptor from a sk_buff. | ||
134 | * @skb: &struct sk_buff from where we obtain the &struct skb_frame_desc | ||
135 | */ | ||
132 | static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) | 136 | static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) |
133 | { | 137 | { |
134 | BUILD_BUG_ON(sizeof(struct skb_frame_desc) > sizeof(skb->cb)); | 138 | BUILD_BUG_ON(sizeof(struct skb_frame_desc) > |
135 | return (struct skb_frame_desc *)&skb->cb[0]; | 139 | IEEE80211_TX_INFO_DRIVER_DATA_SIZE); |
140 | return (struct skb_frame_desc *)&IEEE80211_SKB_CB(skb)->driver_data; | ||
136 | } | 141 | } |
137 | 142 | ||
138 | /** | 143 | /** |
@@ -189,12 +194,10 @@ enum txdone_entry_desc_flags { | |||
189 | * Summary of information that has been read from the TX frame descriptor | 194 | * Summary of information that has been read from the TX frame descriptor |
190 | * after the device is done with transmission. | 195 | * after the device is done with transmission. |
191 | * | 196 | * |
192 | * @control: Control structure which was used to transmit the frame. | ||
193 | * @flags: TX done flags (See &enum txdone_entry_desc_flags). | 197 | * @flags: TX done flags (See &enum txdone_entry_desc_flags). |
194 | * @retry: Retry count. | 198 | * @retry: Retry count. |
195 | */ | 199 | */ |
196 | struct txdone_entry_desc { | 200 | struct txdone_entry_desc { |
197 | struct ieee80211_tx_control *control; | ||
198 | unsigned long flags; | 201 | unsigned long flags; |
199 | int retry; | 202 | int retry; |
200 | }; | 203 | }; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index dcee1b4f152b..52d12fdc0ccf 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -129,9 +129,9 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
129 | { | 129 | { |
130 | struct queue_entry *entry = (struct queue_entry *)urb->context; | 130 | struct queue_entry *entry = (struct queue_entry *)urb->context; |
131 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 131 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
132 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | ||
133 | struct txdone_entry_desc txdesc; | 132 | struct txdone_entry_desc txdesc; |
134 | __le32 *txd = (__le32 *)entry->skb->data; | 133 | __le32 *txd = (__le32 *)entry->skb->data; |
134 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); | ||
135 | u32 word; | 135 | u32 word; |
136 | 136 | ||
137 | if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || | 137 | if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || |
@@ -159,7 +159,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
159 | else | 159 | else |
160 | __set_bit(TXDONE_FAILURE, &txdesc.flags); | 160 | __set_bit(TXDONE_FAILURE, &txdesc.flags); |
161 | txdesc.retry = 0; | 161 | txdesc.retry = 0; |
162 | txdesc.control = &entry_priv->control; | ||
163 | 162 | ||
164 | rt2x00lib_txdone(entry, &txdesc); | 163 | rt2x00lib_txdone(entry, &txdesc); |
165 | 164 | ||
@@ -175,12 +174,11 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
175 | * is reenabled when the txdone handler has finished. | 174 | * is reenabled when the txdone handler has finished. |
176 | */ | 175 | */ |
177 | if (!rt2x00queue_full(entry->queue)) | 176 | if (!rt2x00queue_full(entry->queue)) |
178 | ieee80211_wake_queue(rt2x00dev->hw, entry_priv->control.queue); | 177 | ieee80211_wake_queue(rt2x00dev->hw, qid); |
179 | } | 178 | } |
180 | 179 | ||
181 | int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | 180 | int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, |
182 | struct data_queue *queue, struct sk_buff *skb, | 181 | struct data_queue *queue, struct sk_buff *skb) |
183 | struct ieee80211_tx_control *control) | ||
184 | { | 182 | { |
185 | struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); | 183 | struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); |
186 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); | 184 | struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); |
@@ -206,7 +204,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
206 | * for our information. | 204 | * for our information. |
207 | */ | 205 | */ |
208 | entry->skb = skb; | 206 | entry->skb = skb; |
209 | rt2x00queue_create_tx_descriptor(entry, &txdesc, control); | 207 | rt2x00queue_create_tx_descriptor(entry, &txdesc); |
210 | 208 | ||
211 | /* | 209 | /* |
212 | * Add the descriptor in front of the skb. | 210 | * Add the descriptor in front of the skb. |
@@ -218,13 +216,13 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | |||
218 | * Fill in skb descriptor | 216 | * Fill in skb descriptor |
219 | */ | 217 | */ |
220 | skbdesc = get_skb_frame_desc(skb); | 218 | skbdesc = get_skb_frame_desc(skb); |
219 | memset(skbdesc, 0, sizeof(*skbdesc)); | ||
221 | skbdesc->data = skb->data + queue->desc_size; | 220 | skbdesc->data = skb->data + queue->desc_size; |
222 | skbdesc->data_len = skb->len - queue->desc_size; | 221 | skbdesc->data_len = skb->len - queue->desc_size; |
223 | skbdesc->desc = skb->data; | 222 | skbdesc->desc = skb->data; |
224 | skbdesc->desc_len = queue->desc_size; | 223 | skbdesc->desc_len = queue->desc_size; |
225 | skbdesc->entry = entry; | 224 | skbdesc->entry = entry; |
226 | 225 | ||
227 | memcpy(&entry_priv->control, control, sizeof(entry_priv->control)); | ||
228 | rt2x00queue_write_tx_descriptor(entry, &txdesc); | 226 | rt2x00queue_write_tx_descriptor(entry, &txdesc); |
229 | 227 | ||
230 | /* | 228 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index 15b404aa714d..26f53f868af6 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h | |||
@@ -216,19 +216,15 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev); | |||
216 | * TX data handlers. | 216 | * TX data handlers. |
217 | */ | 217 | */ |
218 | int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, | 218 | int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, |
219 | struct data_queue *queue, struct sk_buff *skb, | 219 | struct data_queue *queue, struct sk_buff *skb); |
220 | struct ieee80211_tx_control *control); | ||
221 | 220 | ||
222 | /** | 221 | /** |
223 | * struct queue_entry_priv_usb: Per entry USB specific information | 222 | * struct queue_entry_priv_usb: Per entry USB specific information |
224 | * | 223 | * |
225 | * @urb: Urb structure used for device communication. | 224 | * @urb: Urb structure used for device communication. |
226 | * @control: mac80211 control structure used to transmit data. | ||
227 | */ | 225 | */ |
228 | struct queue_entry_priv_usb { | 226 | struct queue_entry_priv_usb { |
229 | struct urb *urb; | 227 | struct urb *urb; |
230 | |||
231 | struct ieee80211_tx_control control; | ||
232 | }; | 228 | }; |
233 | 229 | ||
234 | /** | 230 | /** |
@@ -239,15 +235,12 @@ struct queue_entry_priv_usb { | |||
239 | * with beacons. | 235 | * with beacons. |
240 | * | 236 | * |
241 | * @urb: Urb structure used for device communication. | 237 | * @urb: Urb structure used for device communication. |
242 | * @control: mac80211 control structure used to transmit data. | ||
243 | * @guardian_data: Set to 0, used for sending the guardian data. | 238 | * @guardian_data: Set to 0, used for sending the guardian data. |
244 | * @guardian_urb: Urb structure used to send the guardian data. | 239 | * @guardian_urb: Urb structure used to send the guardian data. |
245 | */ | 240 | */ |
246 | struct queue_entry_priv_usb_bcn { | 241 | struct queue_entry_priv_usb_bcn { |
247 | struct urb *urb; | 242 | struct urb *urb; |
248 | 243 | ||
249 | struct ieee80211_tx_control control; | ||
250 | |||
251 | unsigned int guardian_data; | 244 | unsigned int guardian_data; |
252 | struct urb *guardian_urb; | 245 | struct urb *guardian_urb; |
253 | }; | 246 | }; |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 7598b6e15784..e13ed5ced26e 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2357,11 +2357,11 @@ static u64 rt61pci_get_tsf(struct ieee80211_hw *hw) | |||
2357 | return tsf; | 2357 | return tsf; |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 2360 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
2361 | struct ieee80211_tx_control *control) | ||
2362 | { | 2361 | { |
2363 | struct rt2x00_dev *rt2x00dev = hw->priv; | 2362 | struct rt2x00_dev *rt2x00dev = hw->priv; |
2364 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 2363 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
2364 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
2365 | struct queue_entry_priv_pci *entry_priv; | 2365 | struct queue_entry_priv_pci *entry_priv; |
2366 | struct skb_frame_desc *skbdesc; | 2366 | struct skb_frame_desc *skbdesc; |
2367 | struct txentry_desc txdesc; | 2367 | struct txentry_desc txdesc; |
@@ -2377,7 +2377,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2377 | * for our information. | 2377 | * for our information. |
2378 | */ | 2378 | */ |
2379 | intf->beacon->skb = skb; | 2379 | intf->beacon->skb = skb; |
2380 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | 2380 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
2381 | 2381 | ||
2382 | entry_priv = intf->beacon->priv_data; | 2382 | entry_priv = intf->beacon->priv_data; |
2383 | memset(entry_priv->desc, 0, intf->beacon->queue->desc_size); | 2383 | memset(entry_priv->desc, 0, intf->beacon->queue->desc_size); |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index e55bcbdfc1e1..26c2e0a1a308 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1948,11 +1948,11 @@ static u64 rt73usb_get_tsf(struct ieee80211_hw *hw) | |||
1948 | #define rt73usb_get_tsf NULL | 1948 | #define rt73usb_get_tsf NULL |
1949 | #endif | 1949 | #endif |
1950 | 1950 | ||
1951 | static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 1951 | static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
1952 | struct ieee80211_tx_control *control) | ||
1953 | { | 1952 | { |
1954 | struct rt2x00_dev *rt2x00dev = hw->priv; | 1953 | struct rt2x00_dev *rt2x00dev = hw->priv; |
1955 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 1954 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1955 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
1956 | struct skb_frame_desc *skbdesc; | 1956 | struct skb_frame_desc *skbdesc; |
1957 | struct txentry_desc txdesc; | 1957 | struct txentry_desc txdesc; |
1958 | unsigned int beacon_base; | 1958 | unsigned int beacon_base; |
@@ -1967,7 +1967,7 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1967 | * for our information. | 1967 | * for our information. |
1968 | */ | 1968 | */ |
1969 | intf->beacon->skb = skb; | 1969 | intf->beacon->skb = skb; |
1970 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | 1970 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
1971 | 1971 | ||
1972 | /* | 1972 | /* |
1973 | * Add the descriptor in front of the skb. | 1973 | * Add the descriptor in front of the skb. |
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c index 6263209b889e..4427bc9f78a9 100644 --- a/drivers/net/wireless/rtl8180_dev.c +++ b/drivers/net/wireless/rtl8180_dev.c | |||
@@ -170,34 +170,29 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio) | |||
170 | while (skb_queue_len(&ring->queue)) { | 170 | while (skb_queue_len(&ring->queue)) { |
171 | struct rtl8180_tx_desc *entry = &ring->desc[ring->idx]; | 171 | struct rtl8180_tx_desc *entry = &ring->desc[ring->idx]; |
172 | struct sk_buff *skb; | 172 | struct sk_buff *skb; |
173 | struct ieee80211_tx_status status; | 173 | struct ieee80211_tx_info *info; |
174 | struct ieee80211_tx_control *control; | ||
175 | u32 flags = le32_to_cpu(entry->flags); | 174 | u32 flags = le32_to_cpu(entry->flags); |
176 | 175 | ||
177 | if (flags & RTL8180_TX_DESC_FLAG_OWN) | 176 | if (flags & RTL8180_TX_DESC_FLAG_OWN) |
178 | return; | 177 | return; |
179 | 178 | ||
180 | memset(&status, 0, sizeof(status)); | ||
181 | |||
182 | ring->idx = (ring->idx + 1) % ring->entries; | 179 | ring->idx = (ring->idx + 1) % ring->entries; |
183 | skb = __skb_dequeue(&ring->queue); | 180 | skb = __skb_dequeue(&ring->queue); |
184 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), | 181 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), |
185 | skb->len, PCI_DMA_TODEVICE); | 182 | skb->len, PCI_DMA_TODEVICE); |
186 | 183 | ||
187 | control = *((struct ieee80211_tx_control **)skb->cb); | 184 | info = IEEE80211_SKB_CB(skb); |
188 | if (control) | 185 | memset(&info->status, 0, sizeof(info->status)); |
189 | memcpy(&status.control, control, sizeof(*control)); | ||
190 | kfree(control); | ||
191 | 186 | ||
192 | if (!(status.control.flags & IEEE80211_TXCTL_NO_ACK)) { | 187 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
193 | if (flags & RTL8180_TX_DESC_FLAG_TX_OK) | 188 | if (flags & RTL8180_TX_DESC_FLAG_TX_OK) |
194 | status.flags = IEEE80211_TX_STATUS_ACK; | 189 | info->flags |= IEEE80211_TX_STAT_ACK; |
195 | else | 190 | else |
196 | status.excessive_retries = 1; | 191 | info->status.excessive_retries = 1; |
197 | } | 192 | } |
198 | status.retry_count = flags & 0xFF; | 193 | info->status.retry_count = flags & 0xFF; |
199 | 194 | ||
200 | ieee80211_tx_status_irqsafe(dev, skb, &status); | 195 | ieee80211_tx_status_irqsafe(dev, skb); |
201 | if (ring->entries - skb_queue_len(&ring->queue) == 2) | 196 | if (ring->entries - skb_queue_len(&ring->queue) == 2) |
202 | ieee80211_wake_queue(dev, prio); | 197 | ieee80211_wake_queue(dev, prio); |
203 | } | 198 | } |
@@ -238,9 +233,9 @@ static irqreturn_t rtl8180_interrupt(int irq, void *dev_id) | |||
238 | return IRQ_HANDLED; | 233 | return IRQ_HANDLED; |
239 | } | 234 | } |
240 | 235 | ||
241 | static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 236 | static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
242 | struct ieee80211_tx_control *control) | ||
243 | { | 237 | { |
238 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
244 | struct rtl8180_priv *priv = dev->priv; | 239 | struct rtl8180_priv *priv = dev->priv; |
245 | struct rtl8180_tx_ring *ring; | 240 | struct rtl8180_tx_ring *ring; |
246 | struct rtl8180_tx_desc *entry; | 241 | struct rtl8180_tx_desc *entry; |
@@ -251,7 +246,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
251 | u16 plcp_len = 0; | 246 | u16 plcp_len = 0; |
252 | __le16 rts_duration = 0; | 247 | __le16 rts_duration = 0; |
253 | 248 | ||
254 | prio = control->queue; | 249 | prio = info->queue; |
255 | ring = &priv->tx_ring[prio]; | 250 | ring = &priv->tx_ring[prio]; |
256 | 251 | ||
257 | mapping = pci_map_single(priv->pdev, skb->data, | 252 | mapping = pci_map_single(priv->pdev, skb->data, |
@@ -259,35 +254,32 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
259 | 254 | ||
260 | tx_flags = RTL8180_TX_DESC_FLAG_OWN | RTL8180_TX_DESC_FLAG_FS | | 255 | tx_flags = RTL8180_TX_DESC_FLAG_OWN | RTL8180_TX_DESC_FLAG_FS | |
261 | RTL8180_TX_DESC_FLAG_LS | | 256 | RTL8180_TX_DESC_FLAG_LS | |
262 | (ieee80211_get_tx_rate(dev, control)->hw_value << 24) | | 257 | (ieee80211_get_tx_rate(dev, info)->hw_value << 24) | |
263 | skb->len; | 258 | skb->len; |
264 | 259 | ||
265 | if (priv->r8185) | 260 | if (priv->r8185) |
266 | tx_flags |= RTL8180_TX_DESC_FLAG_DMA | | 261 | tx_flags |= RTL8180_TX_DESC_FLAG_DMA | |
267 | RTL8180_TX_DESC_FLAG_NO_ENC; | 262 | RTL8180_TX_DESC_FLAG_NO_ENC; |
268 | 263 | ||
269 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 264 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
270 | tx_flags |= RTL8180_TX_DESC_FLAG_RTS; | 265 | tx_flags |= RTL8180_TX_DESC_FLAG_RTS; |
271 | tx_flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; | 266 | tx_flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
272 | } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 267 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
273 | tx_flags |= RTL8180_TX_DESC_FLAG_CTS; | 268 | tx_flags |= RTL8180_TX_DESC_FLAG_CTS; |
274 | tx_flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; | 269 | tx_flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
275 | } | 270 | } |
276 | 271 | ||
277 | *((struct ieee80211_tx_control **) skb->cb) = | 272 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
278 | kmemdup(control, sizeof(*control), GFP_ATOMIC); | ||
279 | |||
280 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) | ||
281 | rts_duration = ieee80211_rts_duration(dev, priv->vif, skb->len, | 273 | rts_duration = ieee80211_rts_duration(dev, priv->vif, skb->len, |
282 | control); | 274 | info); |
283 | 275 | ||
284 | if (!priv->r8185) { | 276 | if (!priv->r8185) { |
285 | unsigned int remainder; | 277 | unsigned int remainder; |
286 | 278 | ||
287 | plcp_len = DIV_ROUND_UP(16 * (skb->len + 4), | 279 | plcp_len = DIV_ROUND_UP(16 * (skb->len + 4), |
288 | (ieee80211_get_tx_rate(dev, control)->bitrate * 2) / 10); | 280 | (ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10); |
289 | remainder = (16 * (skb->len + 4)) % | 281 | remainder = (16 * (skb->len + 4)) % |
290 | ((ieee80211_get_tx_rate(dev, control)->bitrate * 2) / 10); | 282 | ((ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10); |
291 | if (remainder > 0 && remainder <= 6) | 283 | if (remainder > 0 && remainder <= 6) |
292 | plcp_len |= 1 << 15; | 284 | plcp_len |= 1 << 15; |
293 | } | 285 | } |
@@ -300,13 +292,13 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
300 | entry->plcp_len = cpu_to_le16(plcp_len); | 292 | entry->plcp_len = cpu_to_le16(plcp_len); |
301 | entry->tx_buf = cpu_to_le32(mapping); | 293 | entry->tx_buf = cpu_to_le32(mapping); |
302 | entry->frame_len = cpu_to_le32(skb->len); | 294 | entry->frame_len = cpu_to_le32(skb->len); |
303 | entry->flags2 = control->alt_retry_rate_idx >= 0 ? | 295 | entry->flags2 = info->control.alt_retry_rate_idx >= 0 ? |
304 | ieee80211_get_alt_retry_rate(dev, control)->bitrate << 4 : 0; | 296 | ieee80211_get_alt_retry_rate(dev, info)->bitrate << 4 : 0; |
305 | entry->retry_limit = control->retry_limit; | 297 | entry->retry_limit = info->control.retry_limit; |
306 | entry->flags = cpu_to_le32(tx_flags); | 298 | entry->flags = cpu_to_le32(tx_flags); |
307 | __skb_queue_tail(&ring->queue, skb); | 299 | __skb_queue_tail(&ring->queue, skb); |
308 | if (ring->entries - skb_queue_len(&ring->queue) < 2) | 300 | if (ring->entries - skb_queue_len(&ring->queue) < 2) |
309 | ieee80211_stop_queue(dev, control->queue); | 301 | ieee80211_stop_queue(dev, info->queue); |
310 | spin_unlock_irqrestore(&priv->lock, flags); | 302 | spin_unlock_irqrestore(&priv->lock, flags); |
311 | 303 | ||
312 | rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4))); | 304 | rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4))); |
@@ -522,7 +514,6 @@ static void rtl8180_free_tx_ring(struct ieee80211_hw *dev, unsigned int prio) | |||
522 | 514 | ||
523 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), | 515 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), |
524 | skb->len, PCI_DMA_TODEVICE); | 516 | skb->len, PCI_DMA_TODEVICE); |
525 | kfree(*((struct ieee80211_tx_control **) skb->cb)); | ||
526 | kfree_skb(skb); | 517 | kfree_skb(skb); |
527 | ring->idx = (ring->idx + 1) % ring->entries; | 518 | ring->idx = (ring->idx + 1) % ring->entries; |
528 | } | 519 | } |
diff --git a/drivers/net/wireless/rtl8187.h b/drivers/net/wireless/rtl8187.h index 076d88b6db0e..a0cfb666de0e 100644 --- a/drivers/net/wireless/rtl8187.h +++ b/drivers/net/wireless/rtl8187.h | |||
@@ -44,12 +44,6 @@ struct rtl8187_rx_hdr { | |||
44 | __le64 mac_time; | 44 | __le64 mac_time; |
45 | } __attribute__((packed)); | 45 | } __attribute__((packed)); |
46 | 46 | ||
47 | struct rtl8187_tx_info { | ||
48 | struct ieee80211_tx_control *control; | ||
49 | struct urb *urb; | ||
50 | struct ieee80211_hw *dev; | ||
51 | }; | ||
52 | |||
53 | struct rtl8187_tx_hdr { | 47 | struct rtl8187_tx_hdr { |
54 | __le32 flags; | 48 | __le32 flags; |
55 | #define RTL8187_TX_FLAG_NO_ENCRYPT (1 << 15) | 49 | #define RTL8187_TX_FLAG_NO_ENCRYPT (1 << 15) |
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 86a09b49681c..b581ef8a6377 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
@@ -145,27 +145,22 @@ void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data) | |||
145 | 145 | ||
146 | static void rtl8187_tx_cb(struct urb *urb) | 146 | static void rtl8187_tx_cb(struct urb *urb) |
147 | { | 147 | { |
148 | struct ieee80211_tx_status status; | ||
149 | struct sk_buff *skb = (struct sk_buff *)urb->context; | 148 | struct sk_buff *skb = (struct sk_buff *)urb->context; |
150 | struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb; | 149 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
150 | struct ieee80211_hw *hw = info->driver_data[0]; | ||
151 | 151 | ||
152 | memset(&status, 0, sizeof(status)); | 152 | usb_free_urb(info->driver_data[1]); |
153 | |||
154 | usb_free_urb(info->urb); | ||
155 | if (info->control) | ||
156 | memcpy(&status.control, info->control, sizeof(status.control)); | ||
157 | kfree(info->control); | ||
158 | skb_pull(skb, sizeof(struct rtl8187_tx_hdr)); | 153 | skb_pull(skb, sizeof(struct rtl8187_tx_hdr)); |
159 | status.flags |= IEEE80211_TX_STATUS_ACK; | 154 | memset(&info->status, 0, sizeof(info->status)); |
160 | ieee80211_tx_status_irqsafe(info->dev, skb, &status); | 155 | info->flags |= IEEE80211_TX_STAT_ACK; |
156 | ieee80211_tx_status_irqsafe(hw, skb); | ||
161 | } | 157 | } |
162 | 158 | ||
163 | static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 159 | static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
164 | struct ieee80211_tx_control *control) | ||
165 | { | 160 | { |
166 | struct rtl8187_priv *priv = dev->priv; | 161 | struct rtl8187_priv *priv = dev->priv; |
162 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
167 | struct rtl8187_tx_hdr *hdr; | 163 | struct rtl8187_tx_hdr *hdr; |
168 | struct rtl8187_tx_info *info; | ||
169 | struct urb *urb; | 164 | struct urb *urb; |
170 | __le16 rts_dur = 0; | 165 | __le16 rts_dur = 0; |
171 | u32 flags; | 166 | u32 flags; |
@@ -179,29 +174,27 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
179 | flags = skb->len; | 174 | flags = skb->len; |
180 | flags |= RTL8187_TX_FLAG_NO_ENCRYPT; | 175 | flags |= RTL8187_TX_FLAG_NO_ENCRYPT; |
181 | 176 | ||
182 | flags |= ieee80211_get_tx_rate(dev, control)->hw_value << 24; | 177 | flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24; |
183 | if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) | 178 | if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) |
184 | flags |= RTL8187_TX_FLAG_MORE_FRAG; | 179 | flags |= RTL8187_TX_FLAG_MORE_FRAG; |
185 | if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { | 180 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { |
186 | flags |= RTL8187_TX_FLAG_RTS; | 181 | flags |= RTL8187_TX_FLAG_RTS; |
187 | flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; | 182 | flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
188 | rts_dur = ieee80211_rts_duration(dev, priv->vif, | 183 | rts_dur = ieee80211_rts_duration(dev, priv->vif, |
189 | skb->len, control); | 184 | skb->len, info); |
190 | } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 185 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
191 | flags |= RTL8187_TX_FLAG_CTS; | 186 | flags |= RTL8187_TX_FLAG_CTS; |
192 | flags |= ieee80211_get_rts_cts_rate(dev, control)->hw_value << 19; | 187 | flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; |
193 | } | 188 | } |
194 | 189 | ||
195 | hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); | 190 | hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); |
196 | hdr->flags = cpu_to_le32(flags); | 191 | hdr->flags = cpu_to_le32(flags); |
197 | hdr->len = 0; | 192 | hdr->len = 0; |
198 | hdr->rts_duration = rts_dur; | 193 | hdr->rts_duration = rts_dur; |
199 | hdr->retry = cpu_to_le32(control->retry_limit << 8); | 194 | hdr->retry = cpu_to_le32(info->control.retry_limit << 8); |
200 | 195 | ||
201 | info = (struct rtl8187_tx_info *)skb->cb; | 196 | info->driver_data[0] = dev; |
202 | info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); | 197 | info->driver_data[1] = urb; |
203 | info->urb = urb; | ||
204 | info->dev = dev; | ||
205 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2), | 198 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2), |
206 | hdr, skb->len, rtl8187_tx_cb, skb); | 199 | hdr, skb->len, rtl8187_tx_cb, skb); |
207 | usb_submit_urb(urb, GFP_ATOMIC); | 200 | usb_submit_urb(urb, GFP_ATOMIC); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 99c508c09e5b..edb1aefb4add 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -224,36 +224,6 @@ out: | |||
224 | return r; | 224 | return r; |
225 | } | 225 | } |
226 | 226 | ||
227 | /** | ||
228 | * clear_tx_skb_control_block - clears the control block of tx skbuffs | ||
229 | * @skb: a &struct sk_buff pointer | ||
230 | * | ||
231 | * This clears the control block of skbuff buffers, which were transmitted to | ||
232 | * the device. Notify that the function is not thread-safe, so prevent | ||
233 | * multiple calls. | ||
234 | */ | ||
235 | static void clear_tx_skb_control_block(struct sk_buff *skb) | ||
236 | { | ||
237 | struct zd_tx_skb_control_block *cb = | ||
238 | (struct zd_tx_skb_control_block *)skb->cb; | ||
239 | |||
240 | kfree(cb->control); | ||
241 | cb->control = NULL; | ||
242 | } | ||
243 | |||
244 | /** | ||
245 | * kfree_tx_skb - frees a tx skbuff | ||
246 | * @skb: a &struct sk_buff pointer | ||
247 | * | ||
248 | * Frees the tx skbuff. Frees also the allocated control structure in the | ||
249 | * control block if necessary. | ||
250 | */ | ||
251 | static void kfree_tx_skb(struct sk_buff *skb) | ||
252 | { | ||
253 | clear_tx_skb_control_block(skb); | ||
254 | dev_kfree_skb_any(skb); | ||
255 | } | ||
256 | |||
257 | static void zd_op_stop(struct ieee80211_hw *hw) | 227 | static void zd_op_stop(struct ieee80211_hw *hw) |
258 | { | 228 | { |
259 | struct zd_mac *mac = zd_hw_mac(hw); | 229 | struct zd_mac *mac = zd_hw_mac(hw); |
@@ -276,40 +246,15 @@ static void zd_op_stop(struct ieee80211_hw *hw) | |||
276 | 246 | ||
277 | 247 | ||
278 | while ((skb = skb_dequeue(ack_wait_queue))) | 248 | while ((skb = skb_dequeue(ack_wait_queue))) |
279 | kfree_tx_skb(skb); | 249 | dev_kfree_skb_any(skb); |
280 | } | ||
281 | |||
282 | /** | ||
283 | * init_tx_skb_control_block - initializes skb control block | ||
284 | * @skb: a &sk_buff pointer | ||
285 | * @dev: pointer to the mac80221 device | ||
286 | * @control: mac80211 tx control applying for the frame in @skb | ||
287 | * | ||
288 | * Initializes the control block of the skbuff to be transmitted. | ||
289 | */ | ||
290 | static int init_tx_skb_control_block(struct sk_buff *skb, | ||
291 | struct ieee80211_hw *hw, | ||
292 | struct ieee80211_tx_control *control) | ||
293 | { | ||
294 | struct zd_tx_skb_control_block *cb = | ||
295 | (struct zd_tx_skb_control_block *)skb->cb; | ||
296 | |||
297 | ZD_ASSERT(sizeof(*cb) <= sizeof(skb->cb)); | ||
298 | memset(cb, 0, sizeof(*cb)); | ||
299 | cb->hw= hw; | ||
300 | cb->control = kmalloc(sizeof(*control), GFP_ATOMIC); | ||
301 | if (cb->control == NULL) | ||
302 | return -ENOMEM; | ||
303 | memcpy(cb->control, control, sizeof(*control)); | ||
304 | |||
305 | return 0; | ||
306 | } | 250 | } |
307 | 251 | ||
308 | /** | 252 | /** |
309 | * tx_status - reports tx status of a packet if required | 253 | * tx_status - reports tx status of a packet if required |
310 | * @hw - a &struct ieee80211_hw pointer | 254 | * @hw - a &struct ieee80211_hw pointer |
311 | * @skb - a sk-buffer | 255 | * @skb - a sk-buffer |
312 | * @status - the tx status of the packet without control information | 256 | * @flags: extra flags to set in the TX status info |
257 | * @ackssi: ACK signal strength | ||
313 | * @success - True for successfull transmission of the frame | 258 | * @success - True for successfull transmission of the frame |
314 | * | 259 | * |
315 | * This information calls ieee80211_tx_status_irqsafe() if required by the | 260 | * This information calls ieee80211_tx_status_irqsafe() if required by the |
@@ -319,18 +264,17 @@ static int init_tx_skb_control_block(struct sk_buff *skb, | |||
319 | * If no status information has been requested, the skb is freed. | 264 | * If no status information has been requested, the skb is freed. |
320 | */ | 265 | */ |
321 | static void tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, | 266 | static void tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, |
322 | struct ieee80211_tx_status *status, | 267 | u32 flags, int ackssi, bool success) |
323 | bool success) | ||
324 | { | 268 | { |
325 | struct zd_tx_skb_control_block *cb = (struct zd_tx_skb_control_block *) | 269 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
326 | skb->cb; | 270 | |
271 | memset(&info->status, 0, sizeof(info->status)); | ||
327 | 272 | ||
328 | ZD_ASSERT(cb->control != NULL); | ||
329 | memcpy(&status->control, cb->control, sizeof(status->control)); | ||
330 | if (!success) | 273 | if (!success) |
331 | status->excessive_retries = 1; | 274 | info->status.excessive_retries = 1; |
332 | clear_tx_skb_control_block(skb); | 275 | info->flags |= flags; |
333 | ieee80211_tx_status_irqsafe(hw, skb, status); | 276 | info->status.ack_signal = ackssi; |
277 | ieee80211_tx_status_irqsafe(hw, skb); | ||
334 | } | 278 | } |
335 | 279 | ||
336 | /** | 280 | /** |
@@ -345,15 +289,12 @@ void zd_mac_tx_failed(struct ieee80211_hw *hw) | |||
345 | { | 289 | { |
346 | struct sk_buff_head *q = &zd_hw_mac(hw)->ack_wait_queue; | 290 | struct sk_buff_head *q = &zd_hw_mac(hw)->ack_wait_queue; |
347 | struct sk_buff *skb; | 291 | struct sk_buff *skb; |
348 | struct ieee80211_tx_status status; | ||
349 | 292 | ||
350 | skb = skb_dequeue(q); | 293 | skb = skb_dequeue(q); |
351 | if (skb == NULL) | 294 | if (skb == NULL) |
352 | return; | 295 | return; |
353 | 296 | ||
354 | memset(&status, 0, sizeof(status)); | 297 | tx_status(hw, skb, 0, 0, 0); |
355 | |||
356 | tx_status(hw, skb, &status, 0); | ||
357 | } | 298 | } |
358 | 299 | ||
359 | /** | 300 | /** |
@@ -368,28 +309,20 @@ void zd_mac_tx_failed(struct ieee80211_hw *hw) | |||
368 | */ | 309 | */ |
369 | void zd_mac_tx_to_dev(struct sk_buff *skb, int error) | 310 | void zd_mac_tx_to_dev(struct sk_buff *skb, int error) |
370 | { | 311 | { |
371 | struct zd_tx_skb_control_block *cb = | 312 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
372 | (struct zd_tx_skb_control_block *)skb->cb; | 313 | struct ieee80211_hw *hw = info->driver_data[0]; |
373 | struct ieee80211_hw *hw = cb->hw; | ||
374 | |||
375 | if (likely(cb->control)) { | ||
376 | skb_pull(skb, sizeof(struct zd_ctrlset)); | ||
377 | if (unlikely(error || | ||
378 | (cb->control->flags & IEEE80211_TXCTL_NO_ACK))) | ||
379 | { | ||
380 | struct ieee80211_tx_status status; | ||
381 | memset(&status, 0, sizeof(status)); | ||
382 | tx_status(hw, skb, &status, !error); | ||
383 | } else { | ||
384 | struct sk_buff_head *q = | ||
385 | &zd_hw_mac(hw)->ack_wait_queue; | ||
386 | 314 | ||
387 | skb_queue_tail(q, skb); | 315 | skb_pull(skb, sizeof(struct zd_ctrlset)); |
388 | while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS) | 316 | if (unlikely(error || |
389 | zd_mac_tx_failed(hw); | 317 | (info->flags & IEEE80211_TX_CTL_NO_ACK))) { |
390 | } | 318 | tx_status(hw, skb, 0, 0, !error); |
391 | } else { | 319 | } else { |
392 | kfree_tx_skb(skb); | 320 | struct sk_buff_head *q = |
321 | &zd_hw_mac(hw)->ack_wait_queue; | ||
322 | |||
323 | skb_queue_tail(q, skb); | ||
324 | while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS) | ||
325 | zd_mac_tx_failed(hw); | ||
393 | } | 326 | } |
394 | } | 327 | } |
395 | 328 | ||
@@ -454,7 +387,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs, | |||
454 | cs->control = 0; | 387 | cs->control = 0; |
455 | 388 | ||
456 | /* First fragment */ | 389 | /* First fragment */ |
457 | if (flags & IEEE80211_TXCTL_FIRST_FRAGMENT) | 390 | if (flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) |
458 | cs->control |= ZD_CS_NEED_RANDOM_BACKOFF; | 391 | cs->control |= ZD_CS_NEED_RANDOM_BACKOFF; |
459 | 392 | ||
460 | /* Multicast */ | 393 | /* Multicast */ |
@@ -466,10 +399,10 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs, | |||
466 | (IEEE80211_FTYPE_CTL|IEEE80211_STYPE_PSPOLL)) | 399 | (IEEE80211_FTYPE_CTL|IEEE80211_STYPE_PSPOLL)) |
467 | cs->control |= ZD_CS_PS_POLL_FRAME; | 400 | cs->control |= ZD_CS_PS_POLL_FRAME; |
468 | 401 | ||
469 | if (flags & IEEE80211_TXCTL_USE_RTS_CTS) | 402 | if (flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
470 | cs->control |= ZD_CS_RTS; | 403 | cs->control |= ZD_CS_RTS; |
471 | 404 | ||
472 | if (flags & IEEE80211_TXCTL_USE_CTS_PROTECT) | 405 | if (flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) |
473 | cs->control |= ZD_CS_SELF_CTS; | 406 | cs->control |= ZD_CS_SELF_CTS; |
474 | 407 | ||
475 | /* FIXME: Management frame? */ | 408 | /* FIXME: Management frame? */ |
@@ -516,8 +449,7 @@ void zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon) | |||
516 | } | 449 | } |
517 | 450 | ||
518 | static int fill_ctrlset(struct zd_mac *mac, | 451 | static int fill_ctrlset(struct zd_mac *mac, |
519 | struct sk_buff *skb, | 452 | struct sk_buff *skb) |
520 | struct ieee80211_tx_control *control) | ||
521 | { | 453 | { |
522 | int r; | 454 | int r; |
523 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 455 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
@@ -526,18 +458,19 @@ static int fill_ctrlset(struct zd_mac *mac, | |||
526 | struct ieee80211_rate *txrate; | 458 | struct ieee80211_rate *txrate; |
527 | struct zd_ctrlset *cs = (struct zd_ctrlset *) | 459 | struct zd_ctrlset *cs = (struct zd_ctrlset *) |
528 | skb_push(skb, sizeof(struct zd_ctrlset)); | 460 | skb_push(skb, sizeof(struct zd_ctrlset)); |
461 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
529 | 462 | ||
530 | ZD_ASSERT(frag_len <= 0xffff); | 463 | ZD_ASSERT(frag_len <= 0xffff); |
531 | 464 | ||
532 | txrate = ieee80211_get_tx_rate(mac->hw, control); | 465 | txrate = ieee80211_get_tx_rate(mac->hw, info); |
533 | 466 | ||
534 | cs->modulation = txrate->hw_value; | 467 | cs->modulation = txrate->hw_value; |
535 | if (control->flags & IEEE80211_TXCTL_SHORT_PREAMBLE) | 468 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) |
536 | cs->modulation = txrate->hw_value_short; | 469 | cs->modulation = txrate->hw_value_short; |
537 | 470 | ||
538 | cs->tx_length = cpu_to_le16(frag_len); | 471 | cs->tx_length = cpu_to_le16(frag_len); |
539 | 472 | ||
540 | cs_set_control(mac, cs, hdr, control->flags); | 473 | cs_set_control(mac, cs, hdr, info->flags); |
541 | 474 | ||
542 | packet_length = frag_len + sizeof(struct zd_ctrlset) + 10; | 475 | packet_length = frag_len + sizeof(struct zd_ctrlset) + 10; |
543 | ZD_ASSERT(packet_length <= 0xffff); | 476 | ZD_ASSERT(packet_length <= 0xffff); |
@@ -582,24 +515,21 @@ static int fill_ctrlset(struct zd_mac *mac, | |||
582 | * control block of the skbuff will be initialized. If necessary the incoming | 515 | * control block of the skbuff will be initialized. If necessary the incoming |
583 | * mac80211 queues will be stopped. | 516 | * mac80211 queues will be stopped. |
584 | */ | 517 | */ |
585 | static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | 518 | static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
586 | struct ieee80211_tx_control *control) | ||
587 | { | 519 | { |
588 | struct zd_mac *mac = zd_hw_mac(hw); | 520 | struct zd_mac *mac = zd_hw_mac(hw); |
521 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
589 | int r; | 522 | int r; |
590 | 523 | ||
591 | r = fill_ctrlset(mac, skb, control); | 524 | r = fill_ctrlset(mac, skb); |
592 | if (r) | 525 | if (r) |
593 | return r; | 526 | return r; |
594 | 527 | ||
595 | r = init_tx_skb_control_block(skb, hw, control); | 528 | info->driver_data[0] = hw; |
596 | if (r) | 529 | |
597 | return r; | ||
598 | r = zd_usb_tx(&mac->chip.usb, skb); | 530 | r = zd_usb_tx(&mac->chip.usb, skb); |
599 | if (r) { | 531 | if (r) |
600 | clear_tx_skb_control_block(skb); | ||
601 | return r; | 532 | return r; |
602 | } | ||
603 | return 0; | 533 | return 0; |
604 | } | 534 | } |
605 | 535 | ||
@@ -637,13 +567,8 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr, | |||
637 | tx_hdr = (struct ieee80211_hdr *)skb->data; | 567 | tx_hdr = (struct ieee80211_hdr *)skb->data; |
638 | if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) | 568 | if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) |
639 | { | 569 | { |
640 | struct ieee80211_tx_status status; | ||
641 | |||
642 | memset(&status, 0, sizeof(status)); | ||
643 | status.flags = IEEE80211_TX_STATUS_ACK; | ||
644 | status.ack_signal = stats->signal; | ||
645 | __skb_unlink(skb, q); | 570 | __skb_unlink(skb, q); |
646 | tx_status(hw, skb, &status, 1); | 571 | tx_status(hw, skb, IEEE80211_TX_STAT_ACK, stats->signal, 1); |
647 | goto out; | 572 | goto out; |
648 | } | 573 | } |
649 | } | 574 | } |
@@ -947,8 +872,7 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw, | |||
947 | } | 872 | } |
948 | 873 | ||
949 | static int zd_op_beacon_update(struct ieee80211_hw *hw, | 874 | static int zd_op_beacon_update(struct ieee80211_hw *hw, |
950 | struct sk_buff *skb, | 875 | struct sk_buff *skb) |
951 | struct ieee80211_tx_control *ctl) | ||
952 | { | 876 | { |
953 | struct zd_mac *mac = zd_hw_mac(hw); | 877 | struct zd_mac *mac = zd_hw_mac(hw); |
954 | zd_mac_config_beacon(hw, skb); | 878 | zd_mac_config_beacon(hw, skb); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index 71170244d2c9..18c1d56d3dd7 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -149,22 +149,6 @@ struct housekeeping { | |||
149 | struct delayed_work link_led_work; | 149 | struct delayed_work link_led_work; |
150 | }; | 150 | }; |
151 | 151 | ||
152 | /** | ||
153 | * struct zd_tx_skb_control_block - control block for tx skbuffs | ||
154 | * @control: &struct ieee80211_tx_control pointer | ||
155 | * @context: context pointer | ||
156 | * | ||
157 | * This structure is used to fill the cb field in an &sk_buff to transmit. | ||
158 | * The control field is NULL, if there is no requirement from the mac80211 | ||
159 | * stack to report about the packet ACK. This is the case if the flag | ||
160 | * IEEE80211_TXCTL_NO_ACK is not set in &struct ieee80211_tx_control. | ||
161 | */ | ||
162 | struct zd_tx_skb_control_block { | ||
163 | struct ieee80211_tx_control *control; | ||
164 | struct ieee80211_hw *hw; | ||
165 | void *context; | ||
166 | }; | ||
167 | |||
168 | #define ZD_MAC_STATS_BUFFER_SIZE 16 | 152 | #define ZD_MAC_STATS_BUFFER_SIZE 16 |
169 | 153 | ||
170 | #define ZD_MAC_MAX_ACK_WAITERS 10 | 154 | #define ZD_MAC_MAX_ACK_WAITERS 10 |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 12e24f04dddf..c8a0b34aecc8 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -869,7 +869,7 @@ static void tx_urb_complete(struct urb *urb) | |||
869 | { | 869 | { |
870 | int r; | 870 | int r; |
871 | struct sk_buff *skb; | 871 | struct sk_buff *skb; |
872 | struct zd_tx_skb_control_block *cb; | 872 | struct ieee80211_tx_info *info; |
873 | struct zd_usb *usb; | 873 | struct zd_usb *usb; |
874 | 874 | ||
875 | switch (urb->status) { | 875 | switch (urb->status) { |
@@ -893,8 +893,8 @@ free_urb: | |||
893 | * grab 'usb' pointer before handing off the skb (since | 893 | * grab 'usb' pointer before handing off the skb (since |
894 | * it might be freed by zd_mac_tx_to_dev or mac80211) | 894 | * it might be freed by zd_mac_tx_to_dev or mac80211) |
895 | */ | 895 | */ |
896 | cb = (struct zd_tx_skb_control_block *)skb->cb; | 896 | info = IEEE80211_SKB_CB(skb); |
897 | usb = &zd_hw_mac(cb->hw)->chip.usb; | 897 | usb = &zd_hw_mac(info->driver_data[0])->chip.usb; |
898 | zd_mac_tx_to_dev(skb, urb->status); | 898 | zd_mac_tx_to_dev(skb, urb->status); |
899 | free_tx_urb(usb, urb); | 899 | free_tx_urb(usb, urb); |
900 | tx_dec_submitted_urbs(usb); | 900 | tx_dec_submitted_urbs(usb); |