mac80211 fixes & improvements
Subsystems (2)
Johannes Berg
maintainercover mac80211 fixes & improvements
This patch series contains a fix (first patch) for some of my previous mac80211 work and these changes:
* make drivers use wake_queue exclusively and mac80211 start queues when the master device is started
* use rate index in ieee80211_tx_control (preparation for skb->cb)
* reorder some tx handlers (preparation for skb->cb)
* move TX info/status into skb->cb
This patch series is based on the recent 26-patch Intel update and will not apply before that. It applies whether or not the patches that akpm sent are applied or not.
Since this touches a lot of drivers, I would appreciate any testing of these patches, but if they go in and break drivers I'll just have to fix it up later...
I'll rework fragmentation and MQ on top of this later.
johannes
Johannes Berg
maintainerPATCH 1/5 mac80211: fix bugs in queue handling functions
Commit 55c308c1315bc7267dbb88011c208fd743cdce31 ("mac80211: QoS related cleanups") introduced another bug, the queue handling functions that operate on all queues now only operated on the first queues, not the A-MPDU queues as expected. This patch fixes this.
--- net/mac80211/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/mac80211/util.c +3 -3
@@ -355,7 +355,7 @@ void ieee80211_start_queues(struct ieee8struct ieee80211_local *local =hw_to_local (hw);int i; -for (i =0 ; i < local->hw.queues; i++) +for (i =0 ; i < hw->queues + hw->ampdu_queues; i++)clear_bit (IEEE80211_LINK_STATE_XOFF , &local->state[i]);if (!ieee80211_qdisc_installed (local->mdev))netif_start_queue (local->mdev);
@@ -366,7 +366,7 @@ void ieee80211_stop_queues(struct ieee80 {int i; -for (i =0 ; i < hw->queues; i++) +for (i =0 ; i < hw->queues + hw->ampdu_queues; i++)ieee80211_stop_queue (hw, i); }EXPORT_SYMBOL (ieee80211_stop_queues);
@@ -375,7 +375,7 @@ void ieee80211_wake_queues(struct ieee80 {int i; -for (i =0 ; i < hw->queues; i++) +for (i =0 ; i < hw->queues + hw->ampdu_queues; i++)ieee80211_wake_queue (hw, i); }EXPORT_SYMBOL (ieee80211_wake_queues);
Johannes Berg
maintainerPATCH 2/5 mac80211: let drivers wake but not start queues
In reply to Johannes BergHaving drivers start queues is just confusing, their ->start() callback can block and do whatever is necessary, so let mac80211 start queues and have drivers wake queues when necessary (to get packets flowing again right away.)
--- drivers/net/wireless/adm8211.c | 2 +- drivers/net/wireless/at76_usb.c | 4 ++-- drivers/net/wireless/ath5k/base.c | 2 +- drivers/net/wireless/b43/main.c | 1 - drivers/net/wireless/b43legacy/main.c | 1 - drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 +- drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +- drivers/net/wireless/p54/p54common.c | 3 --- drivers/net/wireless/p54/p54pci.c | 2 +- drivers/net/wireless/rt2x00/rt2x00dev.c | 4 ++-- include/net/mac80211.h | 8 -------- net/mac80211/main.c | 8 +++++++- net/mac80211/util.c | 12 ------------ 13 files changed, 16 insertions(+), 35 deletions(-)
drivers/net/wireless/adm8211.c +1 -1
@@ -2015,7 +2015,7 @@ static int adm8211_resume(struct pci_devif (priv->mode !=IEEE80211_IF_TYPE_INVALID ) {adm8211_start (dev); -ieee80211_start_queues (dev); +ieee80211_wake_queues (dev); }return 0 ;
drivers/net/wireless/at76_usb.c +2 -2
@@ -1720,7 +1720,7 @@ static void at76_mac80211_tx_callback(stmemset (&priv->tx_status,0 ,sizeof (priv->tx_status)); priv->tx_skb =NULL ; -ieee80211_start_queues (priv->hw); +ieee80211_wake_queues (priv->hw); } static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1918,7 +1918,7 @@ static void at76_dwork_hw_scan(struct woif (is_valid_ether_addr (priv->bssid))at76_join (priv); -ieee80211_start_queues (priv->hw); +ieee80211_wake_queues (priv->hw); exit:mutex_unlock (&priv->mtx);
drivers/net/wireless/ath5k/base.c +1 -1
@@ -1599,7 +1599,7 @@ ath5k_txq_cleanup(struct ath5k_softc *sc sc->txqs[i].link); } } -ieee80211_start_queues (sc->hw);/* XXX move to callers */ +ieee80211_wake_queues (sc->hw);/* XXX move to callers */ for (i =0 ; i <ARRAY_SIZE (sc->txqs); i++)if (sc->txqs[i].setup)
drivers/net/wireless/b43/main.c +0 -1
@@ -3497,7 +3497,6 @@ static int b43_wireless_core_start(struc/* Start data flow (TX/RX). */ b43_mac_enable (dev);b43_interrupt_enable (dev, dev->irq_savedstate); -ieee80211_start_queues (dev->wl->hw);/* Start maintainance work */ b43_periodic_tasks_setup (dev);
drivers/net/wireless/b43legacy/main.c +0 -1
@@ -2794,7 +2794,6 @@ static int b43legacy_wireless_core_start/* Start data flow (TX/RX) */ b43legacy_mac_enable (dev);b43legacy_interrupt_enable (dev, dev->irq_savedstate); -ieee80211_start_queues (dev->wl->hw);/* Start maintenance work */ b43legacy_periodic_tasks_setup (dev);
drivers/net/wireless/iwlwifi/iwl3945-base.c +1 -1
@@ -5823,7 +5823,7 @@ static void iwl3945_alive_start(struct iif (iwl3945_is_rfkill (priv))return ; -ieee80211_start_queues (priv->hw); +ieee80211_wake_queues (priv->hw); priv->active_rate = priv->rates_mask; priv->active_rate_basic = priv->rates_mask &IWL_BASIC_RATES_MASK ;
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -3367,7 +3367,7 @@ static void iwl4965_alive_start(struct iif (iwl_is_rfkill (priv))return ; -ieee80211_start_queues (priv->hw); +ieee80211_wake_queues (priv->hw); priv->active_rate = priv->rates_mask; priv->active_rate_basic = priv->rates_mask &IWL_BASIC_RATES_MASK ;
drivers/net/wireless/p54/p54common.c +0 -3
@@ -375,9 +375,6 @@ static void inline p54_wake_free_queues(struct p54_common *priv = dev->priv;int i; -/* ieee80211_start_queues is great if all queues are really empty. -* But, what if some are full? */ -for (i =0 ; i < dev->queues; i++)if (priv->tx_stats[i].len < priv->tx_stats[i].limit)ieee80211_wake_queue (dev, i);
drivers/net/wireless/p54/p54pci.c +1 -1
@@ -665,7 +665,7 @@ static int p54p_resume(struct pci_dev *pif (priv->common.mode !=IEEE80211_IF_TYPE_INVALID ) {p54p_open (dev); -ieee80211_start_queues (dev); +ieee80211_wake_queues (dev); }return 0 ;
drivers/net/wireless/rt2x00/rt2x00dev.c +2 -2
@@ -125,7 +125,7 @@ int rt2x00lib_enable_radio(struct rt2x00/* * Start the TX queues. */ -ieee80211_start_queues (rt2x00dev->hw); +ieee80211_wake_queues (rt2x00dev->hw);return 0 ; }
@@ -1186,7 +1186,7 @@ int rt2x00lib_resume(struct rt2x00_dev ** In that case we have disabled the TX queue and should * now enable it again */ -ieee80211_start_queues (rt2x00dev->hw); +ieee80211_wake_queues (rt2x00dev->hw);/* * During interface iteration we might have changed the
net/mac80211/util.c +0 -12
@@ -350,18 +350,6 @@ void ieee80211_stop_queue(struct ieee802 }EXPORT_SYMBOL (ieee80211_stop_queue); -void ieee80211_start_queues (struct ieee80211_hw *hw) -{ -struct ieee80211_local *local =hw_to_local (hw); -int i; - -for (i =0 ; i < hw->queues + hw->ampdu_queues; i++) -clear_bit (IEEE80211_LINK_STATE_XOFF , &local->state[i]); -if (!ieee80211_qdisc_installed (local->mdev)) -netif_start_queue (local->mdev); -} -EXPORT_SYMBOL (ieee80211_start_queues); -void ieee80211_stop_queues (struct ieee80211_hw *hw) {int i;
include/net/mac80211.h +0 -8
@@ -1567,14 +1567,6 @@ void ieee80211_wake_queue(struct ieee802void ieee80211_stop_queue (struct ieee80211_hw *hw,int queue);/** -* ieee80211_start_queues - start all queues -* @hw: pointer to as obtained from ieee80211_alloc_hw(). -* -* Drivers should use this function instead of netif_start_queue. -*/ -void ieee80211_start_queues (struct ieee80211_hw *hw); - -/** * ieee80211_stop_queues - stop all queues * @hw: pointer as obtained from ieee80211_alloc_hw(). *
net/mac80211/main.c +7 -1
@@ -110,7 +110,13 @@ static int ieee80211_master_open(structbreak ; } } -return res; + +if (res) +return res; + +netif_start_queue (local->mdev); + +return 0 ; }static int ieee80211_master_stop (struct net_device *dev)
Johannes Berg
maintainerPATCH 3/5 mac80211: use rate index in TX control
In reply to Johannes BergThis patch modifies struct ieee80211_tx_control to give band info and the rate index (instead of rate pointers) to drivers. This mostly serves to reduce the TX control structure size to make it fit into skb->cb so that the fragmentation code can put it there and we can think about passing it to drivers that way in the future.
The rt2x00 driver update was done by Ivo, thanks.
--- drivers/net/wireless/adm8211.c | 6 - drivers/net/wireless/at76_usb.c | 2 drivers/net/wireless/ath5k/base.c | 8 +- drivers/net/wireless/b43/main.c | 2 drivers/net/wireless/b43/xmit.c | 13 ++- drivers/net/wireless/b43legacy/xmit.c | 9 +- drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 6 - drivers/net/wireless/iwlwifi/iwl-3945.c | 7 + drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 12 +-- drivers/net/wireless/iwlwifi/iwl-4965.c | 10 -- drivers/net/wireless/iwlwifi/iwl-tx.c | 8 +- drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 - drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 drivers/net/wireless/p54/p54common.c | 2 drivers/net/wireless/rt2x00/rt2x00queue.c | 9 +- drivers/net/wireless/rtl8180_dev.c | 19 ++--- drivers/net/wireless/rtl8187_dev.c | 10 -- drivers/net/wireless/zd1211rw/zd_mac.c | 7 + include/net/mac80211.h | 51 ++++++++++--- net/mac80211/ieee80211_i.h | 8 +- net/mac80211/mlme.c | 6 - net/mac80211/rate.c | 12 ++- net/mac80211/rate.h | 25 ++---- net/mac80211/rc80211_pid_algo.c | 6 - net/mac80211/tx.c | 104 +++++++++++++++------------- net/mac80211/util.c | 10 ++ 26 files changed, 206 insertions(+), 152 deletions(-)
include/net/mac80211.h +39 -12
@@ -266,27 +266,26 @@ enum mac80211_tx_control_flags {* ieee80211_ops->remove_interface() callback funtion. * The hw_key pointer is valid until it has been removed with the * ieee80211_ops->set_key() callback function. -* The tx_rate and alt_retry_rate pointers are valid until the phy is -* deregistered. */ struct ieee80211_tx_control { -struct ieee80211_vif *vif; -struct ieee80211_rate *tx_rate; +u32 flags;/* tx control flags defined above */ + +s8 tx_rate_idx,/* Transmit rate (indexes registered rates) */ + rts_cts_rate_idx,/* Transmit rate for RTS/CTS frame */ + alt_retry_rate_idx;/* retry rate for the last retries */ -/* Transmit rate for RTS/CTS frame */ -struct ieee80211_rate *rts_cts_rate; +s8 retry_limit;/* 1 = only first attempt, 2 = one retry, .. +* This could be used when set_retry_limit +* is not implemented by the driver */ -/* retry rate for the last retries */ -struct ieee80211_rate *alt_retry_rate; +struct ieee80211_vif *vif;/* Key used for hardware encryption * NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ struct ieee80211_key_conf *hw_key; -u32 flags;/* tx control flags defined above */ -u8 retry_limit;/* 1 = only first attempt, 2 = one retry, .. -* This could be used when set_retry_limit -* is not implemented by the driver */ +enum ieee80211_band band; +u8 antenna_sel_tx;/* 0 = default/diversity, otherwise bit * position represents antenna number used */ u8 icv_len;/* length of the ICV/MIC field in octets */
@@ -298,6 +297,7 @@ struct ieee80211_tx_control { }; +/** * enum mac80211_rx_flags - receive flags *
@@ -823,6 +823,33 @@ static inline void SET_IEEE80211_PERM_ADmemcpy (hw->wiphy->perm_addr, addr,ETH_ALEN ); } +static inline struct ieee80211_rate * +ieee80211_get_tx_rate (const struct ieee80211_hw *hw, +const struct ieee80211_tx_control *c) +{ +if (WARN_ON (c->tx_rate_idx <0 )) +return NULL ; +return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; +} + +static inline struct ieee80211_rate * +ieee80211_get_rts_cts_rate (const struct ieee80211_hw *hw, +const struct ieee80211_tx_control *c) +{ +if (c->rts_cts_rate_idx <0 ) +return NULL ; +return &hw->wiphy->bands[c->band]->bitrates[c->rts_cts_rate_idx]; +} + +static inline struct ieee80211_rate * +ieee80211_get_alt_retry_rate (const struct ieee80211_hw *hw, +const struct ieee80211_tx_control *c) +{ +if (c->alt_retry_rate_idx <0 ) +return NULL ; +return &hw->wiphy->bands[c->band]->bitrates[c->alt_retry_rate_idx]; +} +/** * DOC: Hardware crypto acceleration *
net/mac80211/rate.h +9 -16
@@ -19,14 +19,15 @@#include "ieee80211_i.h" #include "sta_info.h" -/* TODO: kdoc */ +/** +* struct rate_selection - rate selection for rate control algos +* @rate: selected transmission rate index +* @nonerp: Non-ERP rate to use instead if ERP cannot be used +* @probe: rate for probing (or -1) +* +*/ struct rate_selection { -/* Selected transmission rate */ -struct ieee80211_rate *rate; -/* Non-ERP rate to use if mac80211 decides it cannot use an ERP rate */ -struct ieee80211_rate *nonerp; -/* probe with this rate, or NULL for no probing */ -struct ieee80211_rate *probe; +s8 rate_idx, nonerp_idx, probe_idx; };struct rate_control_ops {
@@ -138,7 +139,7 @@ static inline int rate_supported(structreturn (sta ==NULL || sta->supp_rates[band] &BIT (index)); } -static inline int +static inline s8 rate_lowest_index (struct ieee80211_local *local,struct ieee80211_supported_band *sband,struct sta_info *sta)
@@ -155,14 +156,6 @@ rate_lowest_index(struct ieee80211_localreturn 0 ; } -static inline struct ieee80211_rate * -rate_lowest (struct ieee80211_local *local, -struct ieee80211_supported_band *sband, -struct sta_info *sta) -{ -return &sband->bitrates[rate_lowest_index (local, sband, sta)]; -} -/* functions for rate control related to a device */ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
net/mac80211/mlme.c +3 -3
@@ -2406,15 +2406,15 @@ static int ieee80211_sta_join_ibss(strucmemset (&control,0 ,sizeof (control));rate_control_get_rate (dev, sband, skb, &ratesel); -if (!ratesel.rate) { +if (ratesel.rate_idx <0 ) {printk (KERN_DEBUG "%s: Failed to determine TX rate " "for IBSS beacon\n" , dev->name);break ; } control.vif = &sdata->vif; - control.tx_rate = ratesel.rate; + control.tx_rate_idx = ratesel.rate_idx;if (sdata->bss_conf.use_short_preamble && - ratesel.rate->flags &IEEE80211_RATE_SHORT_PREAMBLE ) + sband->bitrates[ratesel.rate_idx].flags &IEEE80211_RATE_SHORT_PREAMBLE ) control.flags |=IEEE80211_TXCTL_SHORT_PREAMBLE ; control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; control.flags |=IEEE80211_TXCTL_NO_ACK ;
net/mac80211/rate.c +8 -4
@@ -176,20 +176,24 @@ void rate_control_get_rate(struct net_dercu_read_lock (); sta =sta_info_get (local, hdr->addr1); -memset (sel,0 ,sizeof (struct rate_selection )); + sel->rate_idx =-1 ; + sel->nonerp_idx =-1 ; + sel->probe_idx =-1 ; ref->ops->get_rate (ref->priv, dev, sband, skb, sel); +BUG_ON (sel->rate_idx <0 ); +/* Select a non-ERP backup rate. */ -if (!sel->nonerp) { +if (sel->nonerp_idx <0 ) {for (i =0 ; i < sband->n_bitrates; i++) {struct ieee80211_rate *rate = &sband->bitrates[i]; -if (sel->rate->bitrate < rate->bitrate) +if (sband->bitrates[sel->rate_idx].bitrate < rate->bitrate)break ;if (rate_supported (sta, sband->band, i) && !(rate->flags &IEEE80211_RATE_ERP_G )) - sel->nonerp = rate; + sel->nonerp_idx = i; } }
net/mac80211/ieee80211_i.h +4 -4
@@ -159,11 +159,11 @@ struct ieee80211_tx_data {struct ieee80211_tx_control *control;struct ieee80211_channel *channel; -struct ieee80211_rate *rate; +s8 rate_idx;/* use this rate (if set) for last fragment; rate can * be set to lower rate for the first fragments, e.g., * when using CTS protection with IEEE 802.11g. */ -struct ieee80211_rate *last_frag_rate; +s8 last_frag_rate_idx;/* Extra fragments (in addition to the first fragment * in skb) */
@@ -225,9 +225,9 @@ struct ieee80211_tx_stored_packet {struct ieee80211_tx_control control;struct sk_buff *skb;struct sk_buff **extra_frag; -struct ieee80211_rate *last_frag_rate; +s8 last_frag_rate_idx;int num_extra_frag; -unsigned int last_frag_rate_ctrl_probe; +bool last_frag_rate_ctrl_probe; };struct beacon_data {
net/mac80211/rc80211_pid_algo.c +3 -3
@@ -266,7 +266,7 @@ static void rate_control_pid_tx_status(v/* Ignore all frames that were sent with a different rate than the rate * we currently advise mac80211 to use. */ -if (status->control.tx_rate != &sband->bitrates[sta->txrate_idx]) +if (status->control.tx_rate_idx != sta->txrate_idx) goto unlock; spinfo = sta->rate_ctrl_priv;
@@ -330,7 +330,7 @@ static void rate_control_pid_get_rate(vo fc =le16_to_cpu (hdr->frame_control);if ((fc &IEEE80211_FCTL_FTYPE ) !=IEEE80211_FTYPE_DATA ||is_multicast_ether_addr (hdr->addr1) || !sta) { - sel->rate =rate_lowest (local, sband, sta); + sel->rate_idx =rate_lowest_index (local, sband, sta);rcu_read_unlock ();return ; }
@@ -349,7 +349,7 @@ static void rate_control_pid_get_rate(vorcu_read_unlock (); - sel->rate = &sband->bitrates[rateidx]; + sel->rate_idx = rateidx;#ifdef CONFIG_MAC80211_DEBUGFS rate_control_pid_event_tx_rate(
net/mac80211/tx.c +58 -46
262 lines not on this page · raw message
net/mac80211/util.c +8 -2
@@ -266,10 +266,13 @@ __le16 ieee80211_rts_duration(struct ieebool short_preamble;int erp;u16 dur; +struct ieee80211_supported_band *sband; + + sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; short_preamble = sdata->bss_conf.use_short_preamble; - rate = frame_txctl->rts_cts_rate; + rate = &sband->bitrates[frame_txctl->rts_cts_rate_idx]; erp =0 ;if (sdata->flags &IEEE80211_SDATA_OPERATING_GMODE )
@@ -300,10 +303,13 @@ __le16 ieee80211_ctstoself_duration(strubool short_preamble;int erp;u16 dur; +struct ieee80211_supported_band *sband; + + sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; short_preamble = sdata->bss_conf.use_short_preamble; - rate = frame_txctl->rts_cts_rate; + rate = &sband->bitrates[frame_txctl->rts_cts_rate_idx]; erp =0 ;if (sdata->flags &IEEE80211_SDATA_OPERATING_GMODE ) erp = rate->flags &IEEE80211_RATE_ERP_G ;
drivers/net/wireless/adm8211.c +3 -3
@@ -1693,10 +1693,10 @@ static int adm8211_tx(struct ieee80211_hsize_t payload_len, hdrlen;int plcp, dur, len, plcp_signal, short_preamble;struct ieee80211_hdr *hdr; +struct ieee80211_rate *txrate =ieee80211_get_tx_rate (dev, control); - short_preamble = !!(control->tx_rate->flags & -IEEE80211_TXCTL_SHORT_PREAMBLE ); - plcp_signal = control->tx_rate->bitrate; + short_preamble = !!(txrate->flags &IEEE80211_TXCTL_SHORT_PREAMBLE ); + plcp_signal = txrate->bitrate; hdr = (struct ieee80211_hdr *)skb->data; fc =le16_to_cpu (hdr->frame_control) & ~IEEE80211_FCTL_PROTECTED ;
drivers/net/wireless/at76_usb.c +1 -1
@@ -1753,7 +1753,7 @@ static int at76_mac80211_tx(struct ieee8memset (tx_buffer,0 ,sizeof (*tx_buffer)); tx_buffer->padding = padding; tx_buffer->wlength =cpu_to_le16 (skb->len); - tx_buffer->tx_rate = control->tx_rate->hw_value; + tx_buffer->tx_rate =ieee80211_get_tx_rate (hw, control)->hw_value;memset (tx_buffer->reserved,0 ,sizeof (tx_buffer->reserved));memcpy (tx_buffer->packet, skb->data, skb->len);
drivers/net/wireless/ath5k/base.c +5 -3
@@ -1323,7 +1323,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc ret = ah->ah_setup_tx_desc (ah, ds, pktlen,ieee80211_get_hdrlen_from_skb (skb),AR5K_PKT_TYPE_NORMAL , - (sc->power_level *2 ), ctl->tx_rate->hw_value, + (sc->power_level *2 ), +ieee80211_get_tx_rate (sc->hw, ctl)->hw_value, ctl->retry_limit, keyidx,0 , flags,0 ,0 );if (ret) goto err_unmap;
@@ -2046,7 +2047,8 @@ ath5k_beacon_setup(struct ath5k_softc *s ret = ah->ah_setup_tx_desc (ah, ds, skb->len,ieee80211_get_hdrlen_from_skb (skb),AR5K_PKT_TYPE_BEACON , (sc->power_level *2 ), - ctl->tx_rate->hw_value,1 ,AR5K_TXKEYIX_INVALID , +ieee80211_get_tx_rate (sc->hw, ctl)->hw_value, +1 ,AR5K_TXKEYIX_INVALID , antenna, flags,0 ,0 );if (ret) goto err_unmap;
@@ -2654,7 +2656,7 @@ ath5k_tx(struct ieee80211_hw *hw, structmemmove (skb->data, skb->data+pad, hdrlen); } - sc->led_txrate = ctl->tx_rate->hw_value; + sc->led_txrate =ieee80211_get_tx_rate (hw, ctl)->hw_value;spin_lock_irqsave (&sc->txbuflock, flags);if (list_empty (&sc->txbuf)) {
drivers/net/wireless/b43/main.c +1 -1
@@ -1372,7 +1372,7 @@ static void b43_write_beacon_template(st bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data); len =min ((size_t ) dev->wl->current_beacon->len,0x200 -sizeof (struct b43_plcp_hdr6 )); - rate = dev->wl->beacon_txctl.tx_rate->hw_value; + rate =ieee80211_get_tx_rate (dev->wl->hw, &dev->wl->beacon_txctl)->hw_value;b43_write_template_common (dev, (const u8 *)bcn, len, ram_offset, shm_size_offset, rate);
drivers/net/wireless/b43/xmit.c +8 -5
@@ -201,13 +201,14 @@ int b43_generate_txhdr(struct b43_wldevu32 mac_ctl =0 ;u16 phy_ctl =0 ;u8 extra_ft =0 ; +struct ieee80211_rate *txrate;memset (txhdr,0 ,sizeof (*txhdr)); -WARN_ON (!txctl->tx_rate); - rate = txctl->tx_rate ? txctl->tx_rate->hw_value :B43_CCK_RATE_1MB ; + txrate =ieee80211_get_tx_rate (dev->wl->hw, txctl); + rate = txrate ? txrate->hw_value :B43_CCK_RATE_1MB ; rate_ofdm =b43_is_ofdm_rate (rate); - fbrate = txctl->alt_retry_rate ? : txctl->tx_rate; + fbrate =ieee80211_get_alt_retry_rate (dev->wl->hw, txctl) ? : txrate; rate_fb = fbrate->hw_value; rate_fb_ofdm =b43_is_ofdm_rate (rate_fb);
@@ -336,9 +337,11 @@ int b43_generate_txhdr(struct b43_wldevint rts_rate, rts_rate_fb;int rts_rate_ofdm, rts_rate_fb_ofdm;struct b43_plcp_hdr6 *plcp; +struct ieee80211_rate *rts_cts_rate; -WARN_ON (!txctl->rts_cts_rate); - rts_rate = txctl->rts_cts_rate ? txctl->rts_cts_rate->hw_value :B43_CCK_RATE_1MB ; + rts_cts_rate =ieee80211_get_rts_cts_rate (dev->wl->hw, txctl); + + rts_rate = rts_cts_rate ? rts_cts_rate->hw_value :B43_CCK_RATE_1MB ; rts_rate_ofdm =b43_is_ofdm_rate (rts_rate); rts_rate_fb =b43_calc_fallback_rate (rts_rate); rts_rate_fb_ofdm =b43_is_ofdm_rate (rts_rate_fb);
drivers/net/wireless/b43legacy/xmit.c +6 -3
@@ -201,15 +201,18 @@ static int generate_txhdr_fw3(struct b43unsigned int plcp_fragment_len;u32 mac_ctl =0 ;u16 phy_ctl =0 ; +struct ieee80211_rate *tx_rate; wlhdr = (const struct ieee80211_hdr *)fragment_data; fctl =le16_to_cpu (wlhdr->frame_control);memset (txhdr,0 ,sizeof (*txhdr)); - rate = txctl->tx_rate->hw_value; + tx_rate =ieee80211_get_tx_rate (dev->wl->hw, txctl); + + rate = tx_rate->hw_value; rate_ofdm =b43legacy_is_ofdm_rate (rate); - rate_fb = txctl->alt_retry_rate ? : txctl->tx_rate; + rate_fb =ieee80211_get_alt_retry_rate (dev->wl->hw, txctl) ? : tx_rate; rate_fb_ofdm =b43legacy_is_ofdm_rate (rate_fb->hw_value); txhdr->mac_frame_ctl = wlhdr->frame_control;
@@ -312,7 +315,7 @@ static int generate_txhdr_fw3(struct b43int rts_rate_ofdm;int rts_rate_fb_ofdm; - rts_rate = txctl->rts_cts_rate->hw_value; + rts_rate =ieee80211_get_rts_cts_rate (dev->wl->hw, txctl)->hw_value; rts_rate_ofdm =b43legacy_is_ofdm_rate (rts_rate); rts_rate_fb =b43legacy_calc_fallback_rate (rts_rate); rts_rate_fb_ofdm =b43legacy_is_ofdm_rate (rts_rate_fb);
drivers/net/wireless/iwlwifi/iwl-3945-rs.c +3 -3
@@ -464,7 +464,7 @@ static void rs_tx_status(void *priv_rate retries = tx_resp->retry_count; - first_index = tx_resp->control.tx_rate->hw_value; + first_index = sband->bitrates[tx_resp->control.tx_rate_idx].hw_value;if ((first_index <0 ) || (first_index >=IWL_RATE_COUNT )) {IWL_DEBUG_RATE ("leave: Rate out of bounds: %d\n" , first_index);return ;
@@ -669,7 +669,7 @@ static void rs_get_rate(void *priv_rate, is_multicast_ether_addr(hdr->addr1) || !sta || !sta->rate_ctrl_priv) {IWL_DEBUG_RATE ("leave: No STA priv data to update!\n" ); - sel->rate =rate_lowest (local, sband, sta); + sel->rate_idx =rate_lowest_index (local, sband, sta);rcu_read_unlock ();return ; }
@@ -813,7 +813,7 @@ static void rs_get_rate(void *priv_rate,IWL_DEBUG_RATE ("leave: %d\n" , index); - sel->rate = &sband->bitrates[sta->txrate_idx]; + sel->rate_idx = sta->txrate_idx; }static struct rate_control_ops rs_ops = {
drivers/net/wireless/iwlwifi/iwl-3945.c +5 -2
@@ -331,7 +331,9 @@ static void iwl3945_rx_reply_tx(struct i tx_resp->rate, tx_resp->failure_frame); rate_idx =iwl3945_hwrate_to_plcp_idx (tx_resp->rate); - tx_status->control.tx_rate = &priv->ieee_rates[rate_idx]; +if (tx_status->control.band ==IEEE80211_BAND_5GHZ ) + rate_idx -=IWL_FIRST_OFDM_RATE ; + tx_status->control.tx_rate_idx = rate_idx;IWL_DEBUG_TX_REPLY ("Tx queue reclaim %d\n" , index);iwl3945_tx_queue_reclaim (priv, txq_id, index);
@@ -962,7 +964,8 @@ void iwl3945_hw_build_tx_cmd_rate(struct struct ieee80211_hdr *hdr, int sta_id, int tx_id) { unsigned long flags; -u16 rate_index =min (ctrl->tx_rate->hw_value &0xffff ,IWL_RATE_COUNT -1 ); +u16 hw_value =ieee80211_get_tx_rate (priv->hw, ctrl)->hw_value; +u16 rate_index =min (hw_value &0xffff ,IWL_RATE_COUNT -1 );u16 rate_mask;int rate;u8 rts_retry_limit;
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +7 -5
@@ -862,7 +862,7 @@ static void rs_tx_status(void *priv_rateif (priv->band ==IEEE80211_BAND_5GHZ ) rs_index -=IWL_FIRST_OFDM_RATE ; - if ((tx_resp->control.tx_rate == NULL) || + if ((tx_resp->control.tx_rate_idx < 0) || (tbl_type.is_SGI ^ !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) || (tbl_type.is_fat ^
@@ -875,7 +875,7 @@ static void rs_tx_status(void *priv_rate (!!(tx_rate & RATE_MCS_GF_MSK) ^ !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) || (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != - tx_resp->control.tx_rate->bitrate)) { + hw->wiphy->bands[tx_resp->control.band]->bitrates[tx_resp->control.tx_rate_idx].bitrate)) {IWL_DEBUG_RATE ("initial rate does not match 0x%x\n" , tx_rate); goto out; }
@@ -2154,7 +2154,7 @@ static void rs_get_rate(void *priv_rate, fc =le16_to_cpu (hdr->frame_control);if (!ieee80211_is_data (fc) ||is_multicast_ether_addr (hdr->addr1) || !sta || !sta->rate_ctrl_priv) { - sel->rate =rate_lowest (local, sband, sta); + sel->rate_idx =rate_lowest_index (local, sband, sta); goto out; }
@@ -2184,11 +2184,13 @@ static void rs_get_rate(void *priv_rate, done:if ((i <0 ) || (i >IWL_RATE_COUNT )) { - sel->rate =rate_lowest (local, sband, sta); + sel->rate_idx =rate_lowest_index (local, sband, sta); goto out; } - sel->rate = &priv->ieee_rates[i]; +if (sband->band ==IEEE80211_BAND_5GHZ ) + i -=IWL_FIRST_OFDM_RATE ; + sel->rate_idx = i; out:rcu_read_unlock (); }
drivers/net/wireless/iwlwifi/iwl-4965.c +3 -7
@@ -373,14 +373,10 @@ void iwl4965_hwrate_to_tx_control(struct control->flags |=IEEE80211_TXCTL_DUP_DATA ;if (rate_n_flags &RATE_MCS_SGI_MSK ) control->flags |=IEEE80211_TXCTL_SHORT_GI ; -/* since iwl4965_hwrate_to_plcp_idx is band indifferent, we always use -* IEEE80211_BAND_2GHZ band as it contains all the rates */ rate_index =iwl4965_hwrate_to_plcp_idx (rate_n_flags); -if (rate_index ==-1 ) - control->tx_rate =NULL ; -else - control->tx_rate = - &priv->bands[IEEE80211_BAND_2GHZ ].bitrates[rate_index]; +if (control->band ==IEEE80211_BAND_5GHZ ) + rate_index -=IWL_FIRST_OFDM_RATE ; + control->tx_rate_idx = rate_index; }int iwl4965_hw_rxq_stop (struct iwl_priv *priv)
drivers/net/wireless/iwlwifi/iwl3945-base.c +2 -2
@@ -2581,7 +2581,7 @@ static int iwl3945_tx_skb(struct iwl3945 goto drop_unlock; } -if ((ctl->tx_rate->hw_value &0xFF ) ==IWL_INVALID_RATE ) { +if ((ieee80211_get_tx_rate (priv->hw, ctl)->hw_value &0xFF ) ==IWL_INVALID_RATE ) {IWL_ERROR ("ERROR: No TX rate available.\n" ); goto drop_unlock; }
@@ -6694,7 +6694,7 @@ static int iwl3945_mac_tx(struct ieee802 }IWL_DEBUG_TX ("dev->xmit(%d bytes) at rate 0x%02x\n" , skb->len, - ctl->tx_rate->bitrate); +ieee80211_get_tx_rate (hw, ctl)->bitrate);if (iwl3945_tx_skb (priv, skb, ctl))dev_kfree_skb_any (skb);
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -4281,7 +4281,7 @@ static int iwl4965_mac_tx(struct ieee802 }IWL_DEBUG_TX ("dev->xmit(%d bytes) at rate 0x%02x\n" , skb->len, - ctl->tx_rate->bitrate); +ieee80211_get_tx_rate (hw, ctl)->bitrate);if (iwl_tx_skb (priv, skb, ctl))dev_kfree_skb_any (skb);
drivers/net/wireless/p54/p54common.c +1 -1
@@ -592,7 +592,7 @@ static int p54_tx(struct ieee80211_hw *d txhdr->padding2 =0 ;/* TODO: add support for alternate retry TX rates */ - rate = control->tx_rate->hw_value; + rate =ieee80211_get_tx_rate (dev, control)->hw_value;if (control->flags &IEEE80211_TXCTL_SHORT_PREAMBLE ) rate |=0x10 ;if (control->flags &IEEE80211_TXCTL_USE_RTS_CTS )
drivers/net/wireless/rtl8180_dev.c +8 -11
@@ -257,24 +257,21 @@ static int rtl8180_tx(struct ieee80211_h mapping =pci_map_single (priv->pdev, skb->data, skb->len,PCI_DMA_TODEVICE ); -BUG_ON (!control->tx_rate); - tx_flags =RTL8180_TX_DESC_FLAG_OWN |RTL8180_TX_DESC_FLAG_FS |RTL8180_TX_DESC_FLAG_LS | - (control->tx_rate->hw_value <<24 ) | skb->len; + (ieee80211_get_tx_rate (dev, control)->hw_value <<24 ) | + skb->len;if (priv->r8185) tx_flags |=RTL8180_TX_DESC_FLAG_DMA |RTL8180_TX_DESC_FLAG_NO_ENC ;if (control->flags &IEEE80211_TXCTL_USE_RTS_CTS ) { -BUG_ON (!control->rts_cts_rate); tx_flags |=RTL8180_TX_DESC_FLAG_RTS ; - tx_flags |= control->rts_cts_rate->hw_value <<19 ; + tx_flags |=ieee80211_get_rts_cts_rate (dev, control)->hw_value <<19 ; }else if (control->flags &IEEE80211_TXCTL_USE_CTS_PROTECT ) { -BUG_ON (!control->rts_cts_rate); tx_flags |=RTL8180_TX_DESC_FLAG_CTS ; - tx_flags |= control->rts_cts_rate->hw_value <<19 ; + tx_flags |=ieee80211_get_rts_cts_rate (dev, control)->hw_value <<19 ; } *((struct ieee80211_tx_control **) skb->cb) =
@@ -288,9 +285,9 @@ static int rtl8180_tx(struct ieee80211_hunsigned int remainder; plcp_len =DIV_ROUND_UP (16 * (skb->len +4 ), - (control->tx_rate->bitrate *2 ) /10 ); + (ieee80211_get_tx_rate (dev, control)->bitrate *2 ) /10 ); remainder = (16 * (skb->len +4 )) % - ((control->tx_rate->bitrate *2 ) /10 ); + ((ieee80211_get_tx_rate (dev, control)->bitrate *2 ) /10 );if (remainder >0 && remainder <=6 ) plcp_len |=1 <<15 ; }
@@ -303,8 +300,8 @@ static int rtl8180_tx(struct ieee80211_h entry->plcp_len =cpu_to_le16 (plcp_len); entry->tx_buf =cpu_to_le32 (mapping); entry->frame_len =cpu_to_le32 (skb->len); - entry->flags2 = control->alt_retry_rate !=NULL ? - control->alt_retry_rate->bitrate <<4 :0 ; + entry->flags2 = control->alt_retry_rate_idx >=0 ? +ieee80211_get_alt_retry_rate (dev, control)->bitrate <<4 :0 ; entry->retry_limit = control->retry_limit; entry->flags =cpu_to_le32 (tx_flags);__skb_queue_tail (&ring->queue, skb);
drivers/net/wireless/rtl8187_dev.c +3 -7
@@ -179,21 +179,17 @@ static int rtl8187_tx(struct ieee80211_h flags = skb->len; flags |=RTL8187_TX_FLAG_NO_ENCRYPT ; -BUG_ON (!control->tx_rate); - - flags |= control->tx_rate->hw_value <<24 ; + flags |=ieee80211_get_tx_rate (dev, control)->hw_value <<24 ;if (ieee80211_get_morefrag ((struct ieee80211_hdr *)skb->data)) flags |=RTL8187_TX_FLAG_MORE_FRAG ;if (control->flags &IEEE80211_TXCTL_USE_RTS_CTS ) { -BUG_ON (!control->rts_cts_rate); flags |=RTL8187_TX_FLAG_RTS ; - flags |= control->rts_cts_rate->hw_value <<19 ; + flags |=ieee80211_get_rts_cts_rate (dev, control)->hw_value <<19 ; rts_dur =ieee80211_rts_duration (dev, priv->vif, skb->len, control); }else if (control->flags &IEEE80211_TXCTL_USE_CTS_PROTECT ) { -BUG_ON (!control->rts_cts_rate); flags |=RTL8187_TX_FLAG_CTS ; - flags |= control->rts_cts_rate->hw_value <<19 ; + flags |=ieee80211_get_rts_cts_rate (dev, control)->hw_value <<19 ; } hdr = (struct rtl8187_tx_hdr *)skb_push (skb,sizeof (*hdr));
drivers/net/wireless/zd1211rw/zd_mac.c +5 -2
@@ -523,14 +523,17 @@ static int fill_ctrlset(struct zd_mac *mstruct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;unsigned int frag_len = skb->len +FCS_LEN ;unsigned int packet_length; +struct ieee80211_rate *txrate;struct zd_ctrlset *cs = (struct zd_ctrlset *)skb_push (skb,sizeof (struct zd_ctrlset ));ZD_ASSERT (frag_len <=0xffff ); - cs->modulation = control->tx_rate->hw_value; + txrate =ieee80211_get_tx_rate (mac->hw, control); + + cs->modulation = txrate->hw_value;if (control->flags &IEEE80211_TXCTL_SHORT_PREAMBLE ) - cs->modulation = control->tx_rate->hw_value_short; + cs->modulation = txrate->hw_value_short; cs->tx_length =cpu_to_le16 (frag_len);
drivers/net/wireless/rt2x00/rt2x00queue.c +6 -3
@@ -33,8 +33,10 @@ void rt2x00queue_create_tx_descriptor(ststruct txentry_desc *txdesc, struct ieee80211_tx_control *control) { + struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; -struct ieee80211_rate *rate = control->tx_rate; +struct ieee80211_rate *rate = +ieee80211_get_tx_rate (rt2x00dev->hw, control);const struct rt2x00_rate *hwrate;unsigned int data_length;unsigned int duration;
@@ -77,8 +79,9 @@ void rt2x00queue_create_tx_descriptor(st__set_bit (ENTRY_TXD_CTS_FRAME , &txdesc->flags);__clear_bit (ENTRY_TXD_ACK , &txdesc->flags); } -if (control->rts_cts_rate) - rate = control->rts_cts_rate; +if (control->rts_cts_rate_idx >=0 ) + rate = +ieee80211_get_rts_cts_rate (rt2x00dev->hw, control); }/*
drivers/net/wireless/iwlwifi/iwl-tx.c +6 -2
@@ -578,7 +578,10 @@ static void iwl_tx_cmd_build_rate(structu8 data_retry_limit =0 ;u8 rate_plcp;u16 rate_flags =0 ; -int rate_idx =min (ctrl->tx_rate->hw_value &0xffff ,IWL_RATE_COUNT -1 ); +int rate_idx; + + rate_idx =min (ieee80211_get_tx_rate (priv->hw, ctrl)->hw_value &0xffff , +IWL_RATE_COUNT -1 ); rate_plcp = iwl_rates[rate_idx].plcp;
@@ -723,7 +726,8 @@ int iwl_tx_skb(struct iwl_priv *priv, goto drop_unlock; } -if ((ctl->tx_rate->hw_value &0xFF ) ==IWL_INVALID_RATE ) { +if ((ieee80211_get_tx_rate (priv->hw, ctl)->hw_value &0xFF ) == +IWL_INVALID_RATE ) {IWL_ERROR ("ERROR: No TX rate available.\n" ); goto drop_unlock; }
Johannes Berg
maintainerPATCH 4/5 mac80211: reorder some transmit handlers
In reply to Johannes BergThe next patch will require that transmit handlers that are after fragmentation are aware of the fact that the control info is also fragmented. To make that easier, this patch moves a number of transmit handlers before fragmentation.
--- net/mac80211/tx.c | 234 +++++++++++++++++++++++++++--------------------------- 1 file changed, 118 insertions(+), 116 deletions(-)
net/mac80211/tx.c +118 -116
@@ -506,106 +506,6 @@ ieee80211_tx_h_select_key(struct ieee802 }static ieee80211_tx_result -ieee80211_tx_h_fragment (struct ieee80211_tx_data *tx) -{ -struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data; -size_t hdrlen, per_fragm, num_fragm, payload_len, left; -struct sk_buff **frags, *first, *frag; -int i; -u16 seq; -u8 *pos; -int frag_threshold = tx->local->fragmentation_threshold; - -if (!(tx->flags &IEEE80211_TX_FRAGMENTED )) -return TX_CONTINUE ; - - first = tx->skb; - - hdrlen =ieee80211_get_hdrlen (tx->fc); - payload_len = first->len - hdrlen; - per_fragm = frag_threshold - hdrlen -FCS_LEN ; - num_fragm =DIV_ROUND_UP (payload_len, per_fragm); - - frags =kzalloc (num_fragm *sizeof (struct sk_buff *),GFP_ATOMIC ); -if (!frags) - goto fail; - - hdr->frame_control |=cpu_to_le16 (IEEE80211_FCTL_MOREFRAGS ); - seq =le16_to_cpu (hdr->seq_ctrl) &IEEE80211_SCTL_SEQ ; - pos = first->data + hdrlen + per_fragm; - left = payload_len - per_fragm; -for (i =0 ; i < num_fragm -1 ; i++) { -struct ieee80211_hdr *fhdr; -size_t copylen; - -if (left <=0 ) - goto fail; - -/* reserve enough extra head and tail room for possible -* encryption */ - frag = frags[i] = -dev_alloc_skb (tx->local->tx_headroom + - frag_threshold + -IEEE80211_ENCRYPT_HEADROOM + -IEEE80211_ENCRYPT_TAILROOM ); -if (!frag) - goto fail; -/* Make sure that all fragments use the same priority so -* that they end up using the same TX queue */ - frag->priority = first->priority; -skb_reserve (frag, tx->local->tx_headroom + -IEEE80211_ENCRYPT_HEADROOM ); - fhdr = (struct ieee80211_hdr *)skb_put (frag, hdrlen); -memcpy (fhdr, first->data, hdrlen); -if (i == num_fragm -2 ) - fhdr->frame_control &=cpu_to_le16 (~IEEE80211_FCTL_MOREFRAGS ); - fhdr->seq_ctrl =cpu_to_le16 (seq | ((i +1 ) &IEEE80211_SCTL_FRAG )); - copylen = left > per_fragm ? per_fragm : left; -memcpy (skb_put (frag, copylen), pos, copylen); - - pos += copylen; - left -= copylen; - } -skb_trim (first, hdrlen + per_fragm); - - tx->num_extra_frag = num_fragm -1 ; - tx->extra_frag = frags; - -return TX_CONTINUE ; - - fail: -printk (KERN_DEBUG "%s: failed to fragment frame\n" , tx->dev->name); -if (frags) { -for (i =0 ; i < num_fragm -1 ; i++) -if (frags[i]) -dev_kfree_skb (frags[i]); -kfree (frags); - } -I802_DEBUG_INC (tx->local->tx_handlers_drop_fragment); -return TX_DROP ; -} - -static ieee80211_tx_result -ieee80211_tx_h_encrypt (struct ieee80211_tx_data *tx) -{ -if (!tx->key) -return TX_CONTINUE ; - -switch (tx->key->conf.alg) { -case ALG_WEP : -return ieee80211_crypto_wep_encrypt (tx); -case ALG_TKIP : -return ieee80211_crypto_tkip_encrypt (tx); -case ALG_CCMP : -return ieee80211_crypto_ccmp_encrypt (tx); - } - -/* not reached */ -WARN_ON (1 ); -return TX_DROP ; -} - -static ieee80211_tx_result ieee80211_tx_h_rate_ctrl (struct ieee80211_tx_data *tx) {struct rate_selection rsel;
@@ -747,26 +647,114 @@ ieee80211_tx_h_misc(struct ieee80211_tx_ control->rts_cts_rate_idx =0 ; } -if (tx->sta) { +if (tx->sta) control->aid = tx->sta->aid; - tx->sta->tx_packets++; - tx->sta->tx_fragments++; - tx->sta->tx_bytes += tx->skb->len; -if (tx->extra_frag) { -int i; - tx->sta->tx_fragments += tx->num_extra_frag; -for (i =0 ; i < tx->num_extra_frag; i++) { - tx->sta->tx_bytes += - tx->extra_frag[i]->len; - } - } + +return TX_CONTINUE ; +} + +static ieee80211_tx_result +ieee80211_tx_h_fragment (struct ieee80211_tx_data *tx) +{ +struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data; +size_t hdrlen, per_fragm, num_fragm, payload_len, left; +struct sk_buff **frags, *first, *frag; +int i; +u16 seq; +u8 *pos; +int frag_threshold = tx->local->fragmentation_threshold; + +if (!(tx->flags &IEEE80211_TX_FRAGMENTED )) +return TX_CONTINUE ; + + first = tx->skb; + + hdrlen =ieee80211_get_hdrlen (tx->fc); + payload_len = first->len - hdrlen; + per_fragm = frag_threshold - hdrlen -FCS_LEN ; + num_fragm =DIV_ROUND_UP (payload_len, per_fragm); + + frags =kzalloc (num_fragm *sizeof (struct sk_buff *),GFP_ATOMIC ); +if (!frags) + goto fail; + + hdr->frame_control |=cpu_to_le16 (IEEE80211_FCTL_MOREFRAGS ); + seq =le16_to_cpu (hdr->seq_ctrl) &IEEE80211_SCTL_SEQ ; + pos = first->data + hdrlen + per_fragm; + left = payload_len - per_fragm; +for (i =0 ; i < num_fragm -1 ; i++) { +struct ieee80211_hdr *fhdr; +size_t copylen; + +if (left <=0 ) + goto fail; + +/* reserve enough extra head and tail room for possible +* encryption */ + frag = frags[i] = +dev_alloc_skb (tx->local->tx_headroom + + frag_threshold + +IEEE80211_ENCRYPT_HEADROOM + +IEEE80211_ENCRYPT_TAILROOM ); +if (!frag) + goto fail; +/* Make sure that all fragments use the same priority so +* that they end up using the same TX queue */ + frag->priority = first->priority; +skb_reserve (frag, tx->local->tx_headroom + +IEEE80211_ENCRYPT_HEADROOM ); + fhdr = (struct ieee80211_hdr *)skb_put (frag, hdrlen); +memcpy (fhdr, first->data, hdrlen); +if (i == num_fragm -2 ) + fhdr->frame_control &=cpu_to_le16 (~IEEE80211_FCTL_MOREFRAGS ); + fhdr->seq_ctrl =cpu_to_le16 (seq | ((i +1 ) &IEEE80211_SCTL_FRAG )); + copylen = left > per_fragm ? per_fragm : left; +memcpy (skb_put (frag, copylen), pos, copylen); + + pos += copylen; + left -= copylen; } +skb_trim (first, hdrlen + per_fragm); + + tx->num_extra_frag = num_fragm -1 ; + tx->extra_frag = frags;return TX_CONTINUE ; + + fail: +printk (KERN_DEBUG "%s: failed to fragment frame\n" , tx->dev->name); +if (frags) { +for (i =0 ; i < num_fragm -1 ; i++) +if (frags[i]) +dev_kfree_skb (frags[i]); +kfree (frags); + } +I802_DEBUG_INC (tx->local->tx_handlers_drop_fragment); +return TX_DROP ; }static ieee80211_tx_result -ieee80211_tx_h_load_stats (struct ieee80211_tx_data *tx) +ieee80211_tx_h_encrypt (struct ieee80211_tx_data *tx) +{ +if (!tx->key) +return TX_CONTINUE ; + +switch (tx->key->conf.alg) { +case ALG_WEP : +return ieee80211_crypto_wep_encrypt (tx); +case ALG_TKIP : +return ieee80211_crypto_tkip_encrypt (tx); +case ALG_CCMP : +return ieee80211_crypto_ccmp_encrypt (tx); + } + +/* not reached */ +WARN_ON (1 ); +return TX_DROP ; +} + +static ieee80211_tx_result +ieee80211_tx_h_stats (struct ieee80211_tx_data *tx) {struct ieee80211_local *local = tx->local;struct sk_buff *skb = tx->skb;
@@ -822,6 +810,20 @@ ieee80211_tx_h_load_stats(struct ieee802 tx->sta->channel_use_raw += load; tx->sdata->channel_use_raw += load; +if (tx->sta) { + tx->sta->tx_packets++; + tx->sta->tx_fragments++; + tx->sta->tx_bytes += tx->skb->len; +if (tx->extra_frag) { +int i; + tx->sta->tx_fragments += tx->num_extra_frag; +for (i =0 ; i < tx->num_extra_frag; i++) { + tx->sta->tx_bytes += + tx->extra_frag[i]->len; + } + } + } +return TX_CONTINUE ; }
@@ -834,11 +836,11 @@ static ieee80211_tx_handler ieee80211_tx ieee80211_tx_h_ps_buf, ieee80211_tx_h_select_key, ieee80211_tx_h_michael_mic_add, - ieee80211_tx_h_fragment, - ieee80211_tx_h_encrypt, ieee80211_tx_h_rate_ctrl, ieee80211_tx_h_misc, - ieee80211_tx_h_load_stats, + ieee80211_tx_h_fragment, + ieee80211_tx_h_encrypt, + ieee80211_tx_h_stats,NULL };
Johannes Berg
maintainerPATCH 5/5 mac80211: move TX info into skb->cb
In reply to Johannes BergThis 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.
--- drivers/net/wireless/adm8211.c | 31 +- drivers/net/wireless/adm8211.h | 1 drivers/net/wireless/at76_usb.c | 17 - drivers/net/wireless/at76_usb.h | 1 drivers/net/wireless/ath5k/base.c | 70 ++---- drivers/net/wireless/ath5k/base.h | 1 drivers/net/wireless/b43/b43.h | 1 drivers/net/wireless/b43/dma.c | 45 ++-- drivers/net/wireless/b43/dma.h | 3 drivers/net/wireless/b43/main.c | 33 +- drivers/net/wireless/b43/pio.c | 36 +-- drivers/net/wireless/b43/pio.h | 8 drivers/net/wireless/b43/xmit.c | 58 ++--- drivers/net/wireless/b43/xmit.h | 4 drivers/net/wireless/b43legacy/dma.c | 36 +-- drivers/net/wireless/b43legacy/dma.h | 4 drivers/net/wireless/b43legacy/main.c | 12 - drivers/net/wireless/b43legacy/pio.c | 19 - drivers/net/wireless/b43legacy/pio.h | 4 drivers/net/wireless/b43legacy/xmit.c | 44 +-- drivers/net/wireless/b43legacy/xmit.h | 2 drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 12 - drivers/net/wireless/iwlwifi/iwl-3945.c | 24 +- drivers/net/wireless/iwlwifi/iwl-3945.h | 3 drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 49 ++-- drivers/net/wireless/iwlwifi/iwl-4965.c | 28 +- drivers/net/wireless/iwlwifi/iwl-core.h | 3 drivers/net/wireless/iwlwifi/iwl-dev.h | 5 drivers/net/wireless/iwlwifi/iwl-tx.c | 40 +-- drivers/net/wireless/iwlwifi/iwl3945-base.c | 48 +--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 52 +--- drivers/net/wireless/p54/p54common.c | 90 +++----- drivers/net/wireless/p54/p54common.h | 1 drivers/net/wireless/rt2x00/rt2400pci.c | 8 drivers/net/wireless/rt2x00/rt2500pci.c | 8 drivers/net/wireless/rt2x00/rt2500usb.c | 9 drivers/net/wireless/rt2x00/rt2x00.h | 10 drivers/net/wireless/rt2x00/rt2x00dev.c | 49 ++-- drivers/net/wireless/rt2x00/rt2x00mac.c | 74 +++--- drivers/net/wireless/rt2x00/rt2x00pci.c | 11 drivers/net/wireless/rt2x00/rt2x00pci.h | 6 drivers/net/wireless/rt2x00/rt2x00queue.c | 31 +- drivers/net/wireless/rt2x00/rt2x00queue.h | 15 - drivers/net/wireless/rt2x00/rt2x00usb.c | 12 - drivers/net/wireless/rt2x00/rt2x00usb.h | 9 drivers/net/wireless/rt2x00/rt61pci.c | 8 drivers/net/wireless/rt2x00/rt73usb.c | 8 drivers/net/wireless/rtl8180_dev.c | 57 ++--- drivers/net/wireless/rtl8187.h | 6 drivers/net/wireless/rtl8187_dev.c | 41 +-- drivers/net/wireless/zd1211rw/zd_mac.c | 156 +++----------- drivers/net/wireless/zd1211rw/zd_mac.h | 16 - drivers/net/wireless/zd1211rw/zd_usb.c | 6 include/net/mac80211.h | 297 +++++++++++--------------- net/mac80211/ieee80211_i.h | 18 - net/mac80211/main.c | 126 +++-------- net/mac80211/mlme.c | 30 +- net/mac80211/rate.h | 8 net/mac80211/rc80211_pid.h | 4 net/mac80211/rc80211_pid_algo.c | 18 - net/mac80211/rc80211_pid_debugfs.c | 8 net/mac80211/rx.c | 10 net/mac80211/sta_info.c | 6 net/mac80211/sta_info.h | 2 net/mac80211/tx.c | 312 +++++++++++++--------------- net/mac80211/util.c | 10 net/mac80211/wep.c | 9 net/mac80211/wme.c | 22 - net/mac80211/wpa.c | 65 ++--- 69 files changed, 986 insertions(+), 1284 deletions(-)
include/net/mac80211.h +132 -165
@@ -201,101 +201,127 @@ struct ieee80211_bss_conf { };/** -* enum mac80211_tx_control_flags - flags to describe Tx configuration for -* the Tx frame +* enum mac80211_tx_flags - flags to transmission information/status * -* These flags are used with the @flags member of &ieee80211_tx_control +* These flags are used with the @flags member of &ieee80211_tx_info * -* @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. -* @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; -* e.g., for EAPOL frame -* @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame -* @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., -* for combined 802.11g / 802.11b networks) -* @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack -* @IEEE80211_TXCTL_RATE_CTRL_PROBE -* @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter -* for destination station -* @IEEE80211_TXCTL_REQUEUE: -* @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame -* @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the -* through set_retry_limit configured long -* retry value -* @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 -* @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon -* @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU -* @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number -* of streams when this flag is on can be extracted -* from antenna_sel_tx, so if 1 antenna is marked -* use SISO, 2 antennas marked use MIMO, n antennas -* marked use MIMO_n. -* @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame -* @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width -* @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels -* @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval +* @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. +* @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption; +* e.g., for EAPOL frame +* @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame +* @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., +* for combined 802.11g / 802.11b networks) +* @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack +* @IEEE80211_TX_CTL_RATE_CTRL_PROBE +* @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination +* station +* @IEEE80211_TX_CTL_REQUEUE: +* @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame +* @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the +* through set_retry_limit configured long retry value +* @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211 +* @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon +* @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU +* @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number +* of streams when this flag is on can be extracted from antenna_sel_tx, +* so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n +* antennas marked use MIMO_n. +* @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame +* @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width +* @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels +* @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval +* @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted +* because the destination STA was in powersave mode. +* @IEEE80211_TX_STAT_ACK: Frame was acknowledged +* @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status +* is for the whole aggregation. */ enum mac80211_tx_control_flags { -IEEE80211_TXCTL_REQ_TX_STATUS = (1 <<0 ), -IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1 <<1 ), -IEEE80211_TXCTL_USE_RTS_CTS = (1 <<2 ), -IEEE80211_TXCTL_USE_CTS_PROTECT = (1 <<3 ), -IEEE80211_TXCTL_NO_ACK = (1 <<4 ), -IEEE80211_TXCTL_RATE_CTRL_PROBE = (1 <<5 ), -IEEE80211_TXCTL_CLEAR_PS_FILT = (1 <<6 ), -IEEE80211_TXCTL_REQUEUE = (1 <<7 ), -IEEE80211_TXCTL_FIRST_FRAGMENT = (1 <<8 ), -IEEE80211_TXCTL_SHORT_PREAMBLE = (1 <<9 ), -IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1 <<10 ), -IEEE80211_TXCTL_EAPOL_FRAME = (1 <<11 ), -IEEE80211_TXCTL_SEND_AFTER_DTIM = (1 <<12 ), -IEEE80211_TXCTL_AMPDU = (1 <<13 ), -IEEE80211_TXCTL_OFDM_HT = (1 <<14 ), -IEEE80211_TXCTL_GREEN_FIELD = (1 <<15 ), -IEEE80211_TXCTL_40_MHZ_WIDTH = (1 <<16 ), -IEEE80211_TXCTL_DUP_DATA = (1 <<17 ), -IEEE80211_TXCTL_SHORT_GI = (1 <<18 ), -}; - -/* Transmit control fields. This data structure is passed to low-level driver -* with each TX frame. The low-level driver is responsible for configuring -* the hardware to use given values (depending on what is supported). -* -* NOTE: Be careful with using the pointers outside of the ieee80211_ops->tx() -* context (i.e. when defering the work to a workqueue). -* The vif pointer is valid until the it has been removed with the -* ieee80211_ops->remove_interface() callback funtion. -* The hw_key pointer is valid until it has been removed with the -* ieee80211_ops->set_key() callback function. -*/ -struct ieee80211_tx_control { -u32 flags;/* tx control flags defined above */ - -s8 tx_rate_idx,/* Transmit rate (indexes registered rates) */ - rts_cts_rate_idx,/* Transmit rate for RTS/CTS frame */ - alt_retry_rate_idx;/* retry rate for the last retries */ - -s8 retry_limit;/* 1 = only first attempt, 2 = one retry, .. -* This could be used when set_retry_limit -* is not implemented by the driver */ +IEEE80211_TX_CTL_REQ_TX_STATUS =BIT (0 ), +IEEE80211_TX_CTL_DO_NOT_ENCRYPT =BIT (1 ), +IEEE80211_TX_CTL_USE_RTS_CTS =BIT (2 ), +IEEE80211_TX_CTL_USE_CTS_PROTECT =BIT (3 ), +IEEE80211_TX_CTL_NO_ACK =BIT (4 ), +IEEE80211_TX_CTL_RATE_CTRL_PROBE =BIT (5 ), +IEEE80211_TX_CTL_CLEAR_PS_FILT =BIT (6 ), +IEEE80211_TX_CTL_REQUEUE =BIT (7 ), +IEEE80211_TX_CTL_FIRST_FRAGMENT =BIT (8 ), +IEEE80211_TX_CTL_SHORT_PREAMBLE =BIT (9 ), +IEEE80211_TX_CTL_LONG_RETRY_LIMIT =BIT (10 ), +IEEE80211_TX_CTL_EAPOL_FRAME =BIT (11 ), +IEEE80211_TX_CTL_SEND_AFTER_DTIM =BIT (12 ), +IEEE80211_TX_CTL_AMPDU =BIT (13 ), +IEEE80211_TX_CTL_OFDM_HT =BIT (14 ), +IEEE80211_TX_CTL_GREEN_FIELD =BIT (15 ), +IEEE80211_TX_CTL_40_MHZ_WIDTH =BIT (16 ), +IEEE80211_TX_CTL_DUP_DATA =BIT (17 ), +IEEE80211_TX_CTL_SHORT_GI =BIT (18 ), +IEEE80211_TX_CTL_INJECTED =BIT (19 ), +IEEE80211_TX_STAT_TX_FILTERED =BIT (20 ), +IEEE80211_TX_STAT_ACK =BIT (21 ), +IEEE80211_TX_STAT_AMPDU =BIT (22 ), +}; -struct ieee80211_vif *vif; -/* Key used for hardware encryption -* NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ -struct ieee80211_key_conf *hw_key; +#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ + (sizeof(((struct sk_buff *)0)->cb) - 8) +#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ + (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) + +/** +* struct ieee80211_tx_info - skb transmit information +* +* This structure is placed in skb->cb for three uses: +* (1) mac80211 TX control - mac80211 tells the driver what to do +* (2) driver internal use (if applicable) +* (3) TX status information - driver tells mac80211 what happened +* +* @flags: transmit info flags, defined above +* @retry_count: number of retries +* @excessive_retries: set to 1 if the frame was retried many times +* but not acknowledged +* @ampdu_ack_len: number of aggregated frames. +* relevant only if IEEE80211_TX_STATUS_AMPDU was set. +* @ampdu_ack_map: block ack bit map for the aggregation. +* relevant only if IEEE80211_TX_STATUS_AMPDU was set. +* @ack_signal: signal strength of the ACK frame +*/ +struct ieee80211_tx_info { +/* common information */ +u32 flags; +u8 band; +s8 tx_rate_idx; +u8 antenna_sel_tx; -enum ieee80211_band band; +u8 queue;/* use skb_queue_mapping soon */ -u8 antenna_sel_tx;/* 0 = default/diversity, otherwise bit -* position represents antenna number used */ -u8 icv_len;/* length of the ICV/MIC field in octets */ -u8 iv_len;/* length of the IV field in octets */ -u16 queue;/* hardware queue to use for this frame; -* 0 = highest, hw->queues-1 = lowest */ -u16 aid;/* Station AID */ -int type;/* internal */ +union { +struct { +struct ieee80211_vif *vif; +struct ieee80211_key_conf *hw_key; +unsigned long jiffies; +int ifindex; +u16 aid; +s8 rts_cts_rate_idx, alt_retry_rate_idx; +u8 retry_limit; +u8 icv_len; +u8 iv_len; + } control; +struct { +u64 ampdu_ack_map; +int ack_signal; +u8 retry_count; +bool excessive_retries; +u8 ampdu_ack_len; + } status; +void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS ]; + }; }; +static inline struct ieee80211_tx_info *IEEE80211_SKB_CB (struct sk_buff *skb) +{ +return (struct ieee80211_tx_info *)skb->cb; +}/**
@@ -363,52 +389,6 @@ struct ieee80211_rx_status { };/** -* enum ieee80211_tx_status_flags - transmit status flags -* -* Status flags to indicate various transmit conditions. -* -* @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted -* because the destination STA was in powersave mode. -* @IEEE80211_TX_STATUS_ACK: Frame was acknowledged -* @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status -* is for the whole aggregation. -*/ -enum ieee80211_tx_status_flags { -IEEE80211_TX_STATUS_TX_FILTERED =1 <<0 , -IEEE80211_TX_STATUS_ACK =1 <<1 , -IEEE80211_TX_STATUS_AMPDU =1 <<2 , -}; - -/** -* struct ieee80211_tx_status - transmit status -* -* As much information as possible should be provided for each transmitted -* frame with ieee80211_tx_status(). -* -* @control: a copy of the &struct ieee80211_tx_control passed to the driver -* in the tx() callback. -* @flags: transmit status flags, defined above -* @retry_count: number of retries -* @excessive_retries: set to 1 if the frame was retried many times -* but not acknowledged -* @ampdu_ack_len: number of aggregated frames. -* relevant only if IEEE80211_TX_STATUS_AMPDU was set. -* @ampdu_ack_map: block ack bit map for the aggregation. -* relevant only if IEEE80211_TX_STATUS_AMPDU was set. -* @ack_signal: signal strength of the ACK frame either in dBm, dB or unspec -* depending on hardware capabilites flags @IEEE80211_HW_SIGNAL_* -*/ -struct ieee80211_tx_status { -struct ieee80211_tx_control control; -u8 flags; -u8 retry_count; -bool excessive_retries; -u8 ampdu_ack_len; -u64 ampdu_ack_map; -int ack_signal; -}; - -/** * enum ieee80211_conf_flags - configuration flags * * Flags to define PHY configuration options
@@ -563,7 +543,6 @@ struct ieee80211_if_conf {u8 *ssid;size_t ssid_len;struct sk_buff *beacon; -struct ieee80211_tx_control *beacon_control; };/**
@@ -825,7 +804,7 @@ static inline void SET_IEEE80211_PERM_ADstatic inline struct ieee80211_rate *ieee80211_get_tx_rate (const struct ieee80211_hw *hw, -const struct ieee80211_tx_control *c) +const struct ieee80211_tx_info *c) {if (WARN_ON (c->tx_rate_idx <0 ))return NULL ;
@@ -834,20 +813,20 @@ ieee80211_get_tx_rate(const struct ieee8static inline struct ieee80211_rate *ieee80211_get_rts_cts_rate (const struct ieee80211_hw *hw, -const struct ieee80211_tx_control *c) +const struct ieee80211_tx_info *c) { -if (c->rts_cts_rate_idx <0 ) +if (c->control.rts_cts_rate_idx <0 )return NULL ; -return &hw->wiphy->bands[c->band]->bitrates[c->rts_cts_rate_idx]; +return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx]; }static inline struct ieee80211_rate *ieee80211_get_alt_retry_rate (const struct ieee80211_hw *hw, -const struct ieee80211_tx_control *c) +const struct ieee80211_tx_info *c) { -if (c->alt_retry_rate_idx <0 ) +if (c->control.alt_retry_rate_idx <0 )return NULL ; -return &hw->wiphy->bands[c->band]->bitrates[c->alt_retry_rate_idx]; +return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; }/**
@@ -1142,8 +1121,7 @@ enum ieee80211_ampdu_mlme_action {* that TX/RX_STOP can pass NULL for this parameter. */ struct ieee80211_ops { -int (*tx)(struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control); +int (*tx)(struct ieee80211_hw *hw,struct sk_buff *skb);int (*start)(struct ieee80211_hw *hw);void (*stop)(struct ieee80211_hw *hw); int (*add_interface)(struct ieee80211_hw *hw,
@@ -1187,8 +1165,7 @@ struct ieee80211_ops {u64 (*get_tsf)(struct ieee80211_hw *hw);void (*reset_tsf)(struct ieee80211_hw *hw);int (*beacon_update)(struct ieee80211_hw *hw, -struct sk_buff *skb, -struct ieee80211_tx_control *control); +struct sk_buff *skb);int (*tx_last_beacon)(struct ieee80211_hw *hw); int (*ampdu_action)(struct ieee80211_hw *hw, enum ieee80211_ampdu_mlme_action action,
@@ -1384,13 +1361,9 @@ void ieee80211_rx_irqsafe(struct ieee802* * @hw: the hardware the frame was transmitted by * @skb: the frame that was transmitted, owned by mac80211 after this call -* @status: status information for this frame; the status pointer need not -* be valid after this function returns and is not freed by mac80211, -* it is recommended that it points to a stack area */ void ieee80211_tx_status (struct ieee80211_hw *hw, -struct sk_buff *skb, -struct ieee80211_tx_status *status); +struct sk_buff *skb);/** * ieee80211_tx_status_irqsafe - irq-safe transmit status callback
@@ -1403,13 +1376,9 @@ void ieee80211_tx_status(struct ieee8021* * @hw: the hardware the frame was transmitted by * @skb: the frame that was transmitted, owned by mac80211 after this call -* @status: status information for this frame; the status pointer need not -* be valid after this function returns and is not freed by mac80211, -* it is recommended that it points to a stack area */ void ieee80211_tx_status_irqsafe (struct ieee80211_hw *hw, -struct sk_buff *skb, -struct ieee80211_tx_status *status); +struct sk_buff *skb);/** * ieee80211_beacon_get - beacon generation function
@@ -1425,8 +1394,7 @@ void ieee80211_tx_status_irqsafe(struct* is responsible of freeing it. */ struct sk_buff *ieee80211_beacon_get (struct ieee80211_hw *hw, -struct ieee80211_vif *vif, -struct ieee80211_tx_control *control); +struct ieee80211_vif *vif);/** * ieee80211_rts_get - RTS frame generation function
@@ -1434,7 +1402,7 @@ struct sk_buff *ieee80211_beacon_get(str* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. * @frame: pointer to the frame that is going to be protected by the RTS. * @frame_len: the frame length (in octets). -* @frame_txctl: &struct ieee80211_tx_control of the frame. +* @frame_txctl: &struct ieee80211_tx_info of the frame. * @rts: The buffer where to store the RTS frame. * * If the RTS frames are generated by the host system (i.e., not in
@@ -1444,7 +1412,7 @@ struct sk_buff *ieee80211_beacon_get(str*/ void ieee80211_rts_get (struct ieee80211_hw *hw,struct ieee80211_vif *vif,const void *frame,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl, +const struct ieee80211_tx_info *frame_txctl,struct ieee80211_rts *rts);/**
@@ -1452,7 +1420,7 @@ void ieee80211_rts_get(struct ieee80211_* @hw: pointer obtained from ieee80211_alloc_hw(). * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. * @frame_len: the length of the frame that is going to be protected by the RTS. -* @frame_txctl: &struct ieee80211_tx_control of the frame. +* @frame_txctl: &struct ieee80211_tx_info of the frame. * * If the RTS is generated in firmware, but the host system must provide * the duration field, the low-level driver uses this function to receive
@@ -1460,7 +1428,7 @@ void ieee80211_rts_get(struct ieee80211_*/ __le16 ieee80211_rts_duration (struct ieee80211_hw *hw,struct ieee80211_vif *vif,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl); +const struct ieee80211_tx_info *frame_txctl);/** * ieee80211_ctstoself_get - CTS-to-self frame generation function
@@ -1468,7 +1436,7 @@ __le16 ieee80211_rts_duration(struct iee* @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. * @frame: pointer to the frame that is going to be protected by the CTS-to-self. * @frame_len: the frame length (in octets). -* @frame_txctl: &struct ieee80211_tx_control of the frame. +* @frame_txctl: &struct ieee80211_tx_info of the frame. * @cts: The buffer where to store the CTS-to-self frame. * * If the CTS-to-self frames are generated by the host system (i.e., not in
@@ -1479,7 +1447,7 @@ __le16 ieee80211_rts_duration(struct ieevoid ieee80211_ctstoself_get (struct ieee80211_hw *hw,struct ieee80211_vif *vif,const void *frame,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl, +const struct ieee80211_tx_info *frame_txctl,struct ieee80211_cts *cts);/**
@@ -1487,7 +1455,7 @@ void ieee80211_ctstoself_get(struct ieee* @hw: pointer obtained from ieee80211_alloc_hw(). * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. -* @frame_txctl: &struct ieee80211_tx_control of the frame. +* @frame_txctl: &struct ieee80211_tx_info of the frame. * * If the CTS-to-self is generated in firmware, but the host system must provide * the duration field, the low-level driver uses this function to receive
@@ -1496,7 +1464,7 @@ void ieee80211_ctstoself_get(struct ieee__le16 ieee80211_ctstoself_duration (struct ieee80211_hw *hw,struct ieee80211_vif *vif,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl); +const struct ieee80211_tx_info *frame_txctl);/** * ieee80211_generic_frame_duration - Calculate the duration field for a frame
@@ -1535,8 +1503,7 @@ __le16 ieee80211_generic_frame_duration(* use common code for all beacons. */ struct sk_buff * -ieee80211_get_buffered_bc (struct ieee80211_hw *hw,struct ieee80211_vif *vif, -struct ieee80211_tx_control *control); +ieee80211_get_buffered_bc (struct ieee80211_hw *hw,struct ieee80211_vif *vif);/** * ieee80211_get_hdrlen_from_skb - get header length from data
net/mac80211/main.c +39 -87
284 lines not on this page · raw message
net/mac80211/mlme.c +15 -15
@@ -578,7 +578,7 @@ void ieee80211_sta_tx(struct net_device int encrypt) {struct ieee80211_sub_if_data *sdata; -struct ieee80211_tx_packet_data *pkt_data; +struct ieee80211_tx_info *info; sdata =IEEE80211_DEV_TO_SUB_IF (dev); skb->dev = sdata->local->mdev;
@@ -586,11 +586,11 @@ void ieee80211_sta_tx(struct net_deviceskb_set_network_header (skb,0 );skb_set_transport_header (skb,0 ); - pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; -memset (pkt_data,0 ,sizeof (struct ieee80211_tx_packet_data )); - pkt_data->ifindex = sdata->dev->ifindex; + info =IEEE80211_SKB_CB (skb); +memset (info,0 ,sizeof (struct ieee80211_tx_info )); + info->control.ifindex = sdata->dev->ifindex;if (!encrypt) - pkt_data->flags |=IEEE80211_TXPD_DO_NOT_ENCRYPT ; + info->flags |=IEEE80211_TX_CTL_DO_NOT_ENCRYPT ;dev_queue_xmit (skb); }
@@ -2314,7 +2314,7 @@ static int ieee80211_sta_join_ibss(strucint res, rates, i, j;struct sk_buff *skb;struct ieee80211_mgmt *mgmt; -struct ieee80211_tx_control control; +struct ieee80211_tx_info *control;struct rate_selection ratesel;u8 *pos;struct ieee80211_sub_if_data *sdata;
@@ -2404,21 +2404,22 @@ static int ieee80211_sta_join_ibss(strucmemcpy (pos, &bss->supp_rates[8 ], rates); } -memset (&control,0 ,sizeof (control)); + control =IEEE80211_SKB_CB (skb); +rate_control_get_rate (dev, sband, skb, &ratesel);if (ratesel.rate_idx <0 ) {printk (KERN_DEBUG "%s: Failed to determine TX rate " "for IBSS beacon\n" , dev->name);break ; } - control.vif = &sdata->vif; - control.tx_rate_idx = ratesel.rate_idx; + control->control.vif = &sdata->vif; + control->tx_rate_idx = ratesel.rate_idx;if (sdata->bss_conf.use_short_preamble && sband->bitrates[ratesel.rate_idx].flags &IEEE80211_RATE_SHORT_PREAMBLE ) - control.flags |=IEEE80211_TXCTL_SHORT_PREAMBLE ; - control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; - control.flags |=IEEE80211_TXCTL_NO_ACK ; - control.retry_limit =1 ; + control->flags |=IEEE80211_TX_CTL_SHORT_PREAMBLE ; + control->antenna_sel_tx = local->hw.conf.antenna_sel_tx; + control->flags |=IEEE80211_TX_CTL_NO_ACK ; + control->control.retry_limit =1 ; ifsta->probe_resp =skb_copy (skb,GFP_ATOMIC );if (ifsta->probe_resp) {
@@ -2433,8 +2434,7 @@ static int ieee80211_sta_join_ibss(struc }if (local->ops->beacon_update && - local->ops->beacon_update (local_to_hw (local), - skb, &control) ==0 ) { + local->ops->beacon_update (local_to_hw (local), skb) ==0 ) {printk (KERN_DEBUG "%s: Configured IBSS beacon " "template\n" , dev->name); skb =NULL ;
net/mac80211/sta_info.h +1 -1
@@ -32,7 +32,7 @@* @WLAN_STA_WDS: Station is one of our WDS peers. * @WLAN_STA_PSPOLL: Station has just PS-polled us. * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the -* IEEE80211_TXCTL_CLEAR_PS_FILT control flag) when the next +* IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next * frame to this station is transmitted. */ enum ieee80211_sta_info_flags {
net/mac80211/tx.c +151 -161
758 lines not on this page · raw message
net/mac80211/util.c +5 -5
@@ -258,7 +258,7 @@ EXPORT_SYMBOL(ieee80211_generic_frame_du__le16 ieee80211_rts_duration (struct ieee80211_hw *hw,struct ieee80211_vif *vif,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl) +const struct ieee80211_tx_info *frame_txctl) {struct ieee80211_local *local =hw_to_local (hw);struct ieee80211_rate *rate;
@@ -272,7 +272,7 @@ __le16 ieee80211_rts_duration(struct iee short_preamble = sdata->bss_conf.use_short_preamble; - rate = &sband->bitrates[frame_txctl->rts_cts_rate_idx]; + rate = &sband->bitrates[frame_txctl->control.rts_cts_rate_idx]; erp =0 ;if (sdata->flags &IEEE80211_SDATA_OPERATING_GMODE )
@@ -295,7 +295,7 @@ EXPORT_SYMBOL(ieee80211_rts_duration);__le16 ieee80211_ctstoself_duration (struct ieee80211_hw *hw,struct ieee80211_vif *vif,size_t frame_len, -const struct ieee80211_tx_control *frame_txctl) +const struct ieee80211_tx_info *frame_txctl) {struct ieee80211_local *local =hw_to_local (hw);struct ieee80211_rate *rate;
@@ -309,7 +309,7 @@ __le16 ieee80211_ctstoself_duration(stru short_preamble = sdata->bss_conf.use_short_preamble; - rate = &sband->bitrates[frame_txctl->rts_cts_rate_idx]; + rate = &sband->bitrates[frame_txctl->control.rts_cts_rate_idx]; erp =0 ;if (sdata->flags &IEEE80211_SDATA_OPERATING_GMODE ) erp = rate->flags &IEEE80211_RATE_ERP_G ;
@@ -317,7 +317,7 @@ __le16 ieee80211_ctstoself_duration(stru/* Data frame duration */ dur =ieee80211_frame_duration (local, frame_len, rate->bitrate, erp, short_preamble); -if (!(frame_txctl->flags &IEEE80211_TXCTL_NO_ACK )) { +if (!(frame_txctl->flags &IEEE80211_TX_CTL_NO_ACK )) {/* ACK duration */ dur +=ieee80211_frame_duration (local,10 , rate->bitrate, erp, short_preamble);
drivers/net/wireless/at76_usb.c +7 -10
@@ -1692,13 +1692,14 @@ exit:static void at76_mac80211_tx_callback (struct urb *urb) {struct at76_priv *priv = urb->context; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (priv->tx_skb);at76_dbg (DBG_MAC80211 ,"%s()" , __func__);switch (urb->status) {case 0 :/* success */ - priv->tx_status.flags |=IEEE80211_TX_STATUS_ACK ; + info->flags |=IEEE80211_TX_STAT_ACK ;break ;case -ENOENT :case -ECONNRESET :
@@ -1711,23 +1712,20 @@ static void at76_mac80211_tx_callback(stbreak ; } - priv->tx_status.excessive_retries =0 ; - priv->tx_status.retry_count =0 ; - priv->tx_status.ack_signal =0 ; +memset (&info->status,0 ,sizeof (info->status)); -ieee80211_tx_status_irqsafe (priv->hw, priv->tx_skb, &priv->tx_status); +ieee80211_tx_status_irqsafe (priv->hw, priv->tx_skb); -memset (&priv->tx_status,0 ,sizeof (priv->tx_status)); priv->tx_skb =NULL ;ieee80211_wake_queues (priv->hw); } -static int at76_mac80211_tx (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int at76_mac80211_tx (struct ieee80211_hw *hw,struct sk_buff *skb) {struct at76_priv *priv = hw->priv;struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);int padding, submit_len, ret;at76_dbg (DBG_MAC80211 ,"%s()" , __func__);
@@ -1745,7 +1743,6 @@ static int at76_mac80211_tx(struct ieee8WARN_ON (priv->tx_skb !=NULL ); priv->tx_skb = skb; -memcpy (&priv->tx_status.control, control,sizeof (*control)); padding =at76_calc_padding (skb->len); submit_len =AT76_TX_HDRLEN + skb->len + padding;
@@ -1753,7 +1750,7 @@ static int at76_mac80211_tx(struct ieee8memset (tx_buffer,0 ,sizeof (*tx_buffer)); tx_buffer->padding = padding; tx_buffer->wlength =cpu_to_le16 (skb->len); - tx_buffer->tx_rate =ieee80211_get_tx_rate (hw, control)->hw_value; + tx_buffer->tx_rate =ieee80211_get_tx_rate (hw, info)->hw_value;memset (tx_buffer->reserved,0 ,sizeof (tx_buffer->reserved));memcpy (tx_buffer->packet, skb->data, skb->len);
drivers/net/wireless/rtl8180_dev.c +24 -33
129 lines not on this page · raw message
drivers/net/wireless/rtl8187_dev.c +17 -24
73 lines not on this page · raw message
net/mac80211/ieee80211_i.h +1 -17
@@ -2,6 +2,7 @@* Copyright 2002-2005, Instant802 Networks, Inc. * Copyright 2005, Devicescape Software, Inc. * Copyright 2006-2007 Jiri Benc <[email protected]> +* Copyright 2007-2008 Johannes Berg <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -147,7 +148,6 @@ typedef unsigned __bitwise__ ieee80211_t#define IEEE80211_TX_UNICAST BIT(1)#define IEEE80211_TX_PS_BUFFERED BIT(2)#define IEEE80211_TX_PROBE_LAST_FRAG BIT(3) -#define IEEE80211_TX_INJECTED BIT(4)struct ieee80211_tx_data {struct sk_buff *skb;
@@ -157,7 +157,6 @@ struct ieee80211_tx_data {struct sta_info *sta;struct ieee80211_key *key; -struct ieee80211_tx_control *control;struct ieee80211_channel *channel;s8 rate_idx;/* use this rate (if set) for last fragment; rate can
@@ -207,22 +206,7 @@ struct ieee80211_rx_data {u16 tkip_iv16; }; -/* flags used in struct ieee80211_tx_packet_data.flags */ -#define IEEE80211_TXPD_REQ_TX_STATUS BIT(0) -#define IEEE80211_TXPD_DO_NOT_ENCRYPT BIT(1) -#define IEEE80211_TXPD_REQUEUE BIT(2) -#define IEEE80211_TXPD_EAPOL_FRAME BIT(3) -#define IEEE80211_TXPD_AMPDU BIT(4) -/* Stored in sk_buff->cb */ -struct ieee80211_tx_packet_data { -int ifindex; -unsigned long jiffies; -unsigned int flags; -u8 queue; -}; -struct ieee80211_tx_stored_packet { -struct ieee80211_tx_control control;struct sk_buff *skb;struct sk_buff **extra_frag;s8 last_frag_rate_idx;
net/mac80211/rate.h +3 -5
@@ -34,8 +34,7 @@ struct rate_control_ops {struct module *module;const char *name;void (*tx_status)(void *priv,struct net_device *dev, -struct sk_buff *skb, -struct ieee80211_tx_status *status); +struct sk_buff *skb); void (*get_rate)(void *priv, struct net_device *dev, struct ieee80211_supported_band *band, struct sk_buff *skb,
@@ -77,13 +76,12 @@ struct rate_control_ref *rate_control_gevoid rate_control_put (struct rate_control_ref *ref);static inline void rate_control_tx_status (struct net_device *dev, -struct sk_buff *skb, -struct ieee80211_tx_status *status) +struct sk_buff *skb) {struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr);struct rate_control_ref *ref = local->rate_ctrl; - ref->ops->tx_status (ref->priv, dev, skb, status); + ref->ops->tx_status (ref->priv, dev, skb); }
net/mac80211/rx.c +5 -5
@@ -714,7 +714,7 @@ static int ap_sta_ps_end(struct net_devistruct sk_buff *skb;int sent =0 ;struct ieee80211_sub_if_data *sdata; -struct ieee80211_tx_packet_data *pkt_data; +struct ieee80211_tx_info *info;DECLARE_MAC_BUF (mac); sdata = sta->sdata;
@@ -734,13 +734,13 @@ static int ap_sta_ps_end(struct net_devi/* Send all buffered frames to the station */ while ((skb =skb_dequeue (&sta->tx_filtered)) !=NULL ) { - pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; + info =IEEE80211_SKB_CB (skb); sent++; - pkt_data->flags |=IEEE80211_TXPD_REQUEUE ; + info->flags |=IEEE80211_TX_CTL_REQUEUE ;dev_queue_xmit (skb); }while ((skb =skb_dequeue (&sta->ps_tx_buf)) !=NULL ) { - pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; + info =IEEE80211_SKB_CB (skb); local->total_ps_buffered--; sent++;#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
@@ -748,7 +748,7 @@ static int ap_sta_ps_end(struct net_devi"since STA not sleeping anymore\n" , dev->name, print_mac(mac, sta->addr), sta->aid);#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ - pkt_data->flags |=IEEE80211_TXPD_REQUEUE ; + info->flags |=IEEE80211_TX_CTL_REQUEUE ;dev_queue_xmit (skb); }
net/mac80211/sta_info.c +3 -3
@@ -511,20 +511,20 @@ static inline int sta_info_buffer_expirestruct sta_info *sta, struct sk_buff *skb) { - struct ieee80211_tx_packet_data *pkt_data; + struct ieee80211_tx_info *info;int timeout;if (!skb)return 0 ; - pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; + info =IEEE80211_SKB_CB (skb);/* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */ timeout = (sta->listen_interval * local->hw.conf.beacon_int *32 /15625 ) *HZ ;if (timeout <STA_TX_BUFFER_EXPIRE ) timeout =STA_TX_BUFFER_EXPIRE ; -return time_after (jiffies, pkt_data->jiffies + timeout); +return time_after (jiffies, info->control.jiffies + timeout); }
net/mac80211/wme.c +10 -12
@@ -149,8 +149,7 @@ static int wme_qdiscop_enqueue(struct skstruct ieee80211_local *local =wdev_priv (qd->dev->ieee80211_ptr);struct ieee80211_hw *hw = &local->hw;struct ieee80211_sched_data *q =qdisc_priv (qd); -struct ieee80211_tx_packet_data *pkt_data = - (struct ieee80211_tx_packet_data *) skb->cb; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;unsigned short fc =le16_to_cpu (hdr->frame_control);struct Qdisc *qdisc;
@@ -158,8 +157,8 @@ static int wme_qdiscop_enqueue(struct skint err, queue;u8 tid; -if (pkt_data->flags &IEEE80211_TXPD_REQUEUE ) { - queue = pkt_data->queue; +if (info->flags &IEEE80211_TX_CTL_REQUEUE ) { + queue = info->queue;rcu_read_lock (); sta =sta_info_get (local, hdr->addr1); tid = skb->priority &QOS_CONTROL_TAG1D_MASK ;
@@ -168,9 +167,9 @@ static int wme_qdiscop_enqueue(struct skif ((ampdu_queue <QD_NUM (hw)) &&test_bit (ampdu_queue, q->qdisc_pool)) { queue = ampdu_queue; - pkt_data->flags |=IEEE80211_TXPD_AMPDU ; + info->flags |=IEEE80211_TX_CTL_AMPDU ; }else { - pkt_data->flags &= ~IEEE80211_TXPD_AMPDU ; + info->flags &= ~IEEE80211_TX_CTL_AMPDU ; } }rcu_read_unlock ();
@@ -206,9 +205,9 @@ static int wme_qdiscop_enqueue(struct skif ((ampdu_queue <QD_NUM (hw)) &&test_bit (ampdu_queue, q->qdisc_pool)) { queue = ampdu_queue; - pkt_data->flags |=IEEE80211_TXPD_AMPDU ; + info->flags |=IEEE80211_TX_CTL_AMPDU ; }else { - pkt_data->flags &= ~IEEE80211_TXPD_AMPDU ; + info->flags &= ~IEEE80211_TX_CTL_AMPDU ; } }
@@ -220,7 +219,7 @@ static int wme_qdiscop_enqueue(struct sk err =NET_XMIT_DROP ; }else { tid = skb->priority &QOS_CONTROL_TAG1D_MASK ; - pkt_data->queue = (unsigned int ) queue; + info->queue = (unsigned int ) queue; qdisc = q->queues[queue]; err = qdisc->enqueue (skb, qdisc);if (err ==NET_XMIT_SUCCESS ) {
@@ -241,13 +240,12 @@ static int wme_qdiscop_enqueue(struct skstatic int wme_qdiscop_requeue (struct sk_buff *skb,struct Qdisc * qd) {struct ieee80211_sched_data *q =qdisc_priv (qd); -struct ieee80211_tx_packet_data *pkt_data = - (struct ieee80211_tx_packet_data *) skb->cb; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);struct Qdisc *qdisc;int err;/* we recorded which queue to use earlier! */ - qdisc = q->queues[pkt_data->queue]; + qdisc = q->queues[info->queue];if ((err = qdisc->ops->requeue (skb, qdisc)) ==0 ) { qd->q.qlen++;
net/mac80211/wpa.c +31 -34
132 lines not on this page · raw message
net/mac80211/rc80211_pid.h +2 -2
@@ -61,7 +61,7 @@ enum rc_pid_event_type {union rc_pid_event_data {/* RC_PID_EVENT_TX_STATUS */ struct { -struct ieee80211_tx_status tx_status; +struct ieee80211_tx_info tx_status; };/* RC_PID_EVENT_TYPE_RATE_CHANGE */ /* RC_PID_EVENT_TYPE_TX_RATE */
@@ -158,7 +158,7 @@ struct rc_pid_debugfs_entries { };void rate_control_pid_event_tx_status (struct rc_pid_event_buffer *buf, -struct ieee80211_tx_status *stat); +struct ieee80211_tx_info *stat);void rate_control_pid_event_rate_change (struct rc_pid_event_buffer *buf,int index,int rate);
net/mac80211/rc80211_pid_algo.c +9 -9
@@ -237,8 +237,7 @@ static void rate_control_pid_sample(stru }static void rate_control_pid_tx_status (void *priv,struct net_device *dev, -struct sk_buff *skb, -struct ieee80211_tx_status *status) +struct sk_buff *skb) {struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr);struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
@@ -248,6 +247,7 @@ static void rate_control_pid_tx_status(vstruct rc_pid_sta_info *spinfo;unsigned long period;struct ieee80211_supported_band *sband; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);rcu_read_lock ();
@@ -266,28 +266,28 @@ static void rate_control_pid_tx_status(v/* Ignore all frames that were sent with a different rate than the rate * we currently advise mac80211 to use. */ -if (status->control.tx_rate_idx != sta->txrate_idx) +if (info->tx_rate_idx != sta->txrate_idx) goto unlock; spinfo = sta->rate_ctrl_priv; spinfo->tx_num_xmit++;#ifdef CONFIG_MAC80211_DEBUGFS -rate_control_pid_event_tx_status (&spinfo->events, status); +rate_control_pid_event_tx_status (&spinfo->events, info);#endif /* We count frames that totally failed to be transmitted as two bad * frames, those that made it out but had some retries as one good and * one bad frame. */ -if (status->excessive_retries) { +if (info->status.excessive_retries) { spinfo->tx_num_failed +=2 ; spinfo->tx_num_xmit++; - }else if (status->retry_count) { + }else if (info->status.retry_count) { spinfo->tx_num_failed++; spinfo->tx_num_xmit++; } -if (status->excessive_retries) { +if (info->status.excessive_retries) { sta->tx_retry_failed++; sta->tx_num_consecutive_failures++; sta->tx_num_mpdu_fail++;
@@ -295,8 +295,8 @@ static void rate_control_pid_tx_status(v sta->tx_num_consecutive_failures =0 ; sta->tx_num_mpdu_ok++; } - sta->tx_retry_count += status->retry_count; - sta->tx_num_mpdu_fail += status->retry_count; + sta->tx_retry_count += info->status.retry_count; + sta->tx_num_mpdu_fail += info->status.retry_count;/* Update PID controller state. */ period = (HZ * pinfo->sampling_period +500 ) /1000 ;
net/mac80211/rc80211_pid_debugfs.c +4 -4
@@ -39,11 +39,11 @@ static void rate_control_pid_event(struc }void rate_control_pid_event_tx_status (struct rc_pid_event_buffer *buf, -struct ieee80211_tx_status *stat) +struct ieee80211_tx_info *stat) {union rc_pid_event_data evd; -memcpy (&evd.tx_status, stat,sizeof (struct ieee80211_tx_status )); +memcpy (&evd.tx_status, stat,sizeof (struct ieee80211_tx_info ));rate_control_pid_event (buf,RC_PID_EVENT_TYPE_TX_STATUS , &evd); }
@@ -167,8 +167,8 @@ static ssize_t rate_control_pid_events_rswitch (ev->type) {case RC_PID_EVENT_TYPE_TX_STATUS : p +=snprintf (pb + p, length - p,"tx_status %u %u" , - ev->data.tx_status.excessive_retries, - ev->data.tx_status.retry_count); + ev->data.tx_status.status.excessive_retries, + ev->data.tx_status.status.retry_count);break ;case RC_PID_EVENT_TYPE_RATE_CHANGE : p += snprintf(pb + p, length - p, "rate_change %d %d",
drivers/net/wireless/b43/b43.h +0 -1
@@ -733,7 +733,6 @@ struct b43_wl {/* The beacon we are currently using (AP or IBSS mode). * This beacon stuff is protected by the irq_lock. */ struct sk_buff *current_beacon; -struct ieee80211_tx_control beacon_txctl;bool beacon0_uploaded;bool beacon1_uploaded;struct work_struct beacon_update_trigger;
drivers/net/wireless/b43/dma.c +25 -20
116 lines not on this page · raw message
drivers/net/wireless/b43/dma.h +1 -2
@@ -181,7 +181,6 @@ struct b43_dmadesc_meta {dma_addr_t dmaaddr;/* ieee80211 TX status. Only used once per 802.11 frag. */ bool is_last_fragment; -struct ieee80211_tx_status txstat; };struct b43_dmaring ;
@@ -285,7 +284,7 @@ void b43_dma_get_tx_stats(struct b43_wld struct ieee80211_tx_queue_stats *stats);int b43_dma_tx (struct b43_wldev *dev, -struct sk_buff *skb,struct ieee80211_tx_control *ctl); +struct sk_buff *skb);void b43_dma_handle_txstatus (struct b43_wldev *dev,const struct b43_txstatus *status);
drivers/net/wireless/b43/main.c +13 -20
@@ -1368,18 +1368,18 @@ static void b43_write_beacon_template(stunsigned int rate;u16 ctl;int antenna; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (dev->wl->current_beacon); bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data); len =min ((size_t ) dev->wl->current_beacon->len,0x200 -sizeof (struct b43_plcp_hdr6 )); - rate =ieee80211_get_tx_rate (dev->wl->hw, &dev->wl->beacon_txctl)->hw_value; + rate =ieee80211_get_tx_rate (dev->wl->hw, info)->hw_value;b43_write_template_common (dev, (const u8 *)bcn, len, ram_offset, shm_size_offset, rate);/* Write the PHY TX control parameters. */ - antenna =b43_antenna_from_ieee80211 (dev, - dev->wl->beacon_txctl.antenna_sel_tx); + antenna =b43_antenna_from_ieee80211 (dev, info->antenna_sel_tx); antenna =b43_antenna_to_phyctl (antenna); ctl =b43_shm_read16 (dev,B43_SHM_SHARED ,B43_SHM_SH_BEACPHYCTL );/* We can't send beacons with short preamble. Would get PHY errors. */
@@ -1613,8 +1613,7 @@ static void b43_beacon_update_trigger_wo/* Asynchronously update the packet templates in template RAM. * Locking: Requires wl->irq_lock to be locked. */ -static void b43_update_templates (struct b43_wl *wl,struct sk_buff *beacon, -const struct ieee80211_tx_control *txctl) +static void b43_update_templates (struct b43_wl *wl,struct sk_buff *beacon) {/* This is the top half of the ansynchronous beacon update. * The bottom half is the beacon IRQ.
@@ -1625,7 +1624,6 @@ static void b43_update_templates(structif (wl->current_beacon)dev_kfree_skb_any (wl->current_beacon); wl->current_beacon = beacon; -memcpy (&wl->beacon_txctl, txctl,sizeof (wl->beacon_txctl)); wl->beacon0_uploaded =0 ; wl->beacon1_uploaded =0 ;queue_work (wl->hw->workqueue, &wl->beacon_update_trigger);
@@ -2813,8 +2811,7 @@ static int b43_rng_init(struct b43_wl *w }static int b43_op_tx (struct ieee80211_hw *hw, -struct sk_buff *skb, -struct ieee80211_tx_control *ctl) +struct sk_buff *skb) {struct b43_wl *wl =hw_to_b43_wl (hw);struct b43_wldev *dev = wl->current_dev;
@@ -2836,9 +2833,9 @@ static int b43_op_tx(struct ieee80211_hw err = -ENODEV ;if (likely (b43_status (dev) >=B43_STAT_STARTED )) {if (b43_using_pio_transfers (dev)) - err =b43_pio_tx (dev, skb, ctl); + err =b43_pio_tx (dev, skb);else - err =b43_dma_tx (dev, skb, ctl); + err =b43_dma_tx (dev, skb); }read_unlock_irqrestore (&wl->tx_lock, flags);
@@ -3429,10 +3426,8 @@ static int b43_op_config_interface(strucif (b43_is_mode (wl,IEEE80211_IF_TYPE_AP )) {B43_WARN_ON (conf->type !=IEEE80211_IF_TYPE_AP );b43_set_ssid (dev, conf->ssid, conf->ssid_len); -if (conf->beacon) { -b43_update_templates (wl, conf->beacon, - conf->beacon_control); - } +if (conf->beacon) +b43_update_templates (wl, conf->beacon); }b43_write_mac_bssid_templates (dev); }
@@ -4118,31 +4113,29 @@ static int b43_op_beacon_set_tim(structstruct b43_wl *wl =hw_to_b43_wl (hw);struct sk_buff *beacon;unsigned long flags; -struct ieee80211_tx_control txctl;/* We could modify the existing beacon and set the aid bit in * the TIM field, but that would probably require resizing and * moving of data within the beacon template. * Simply request a new beacon and let mac80211 do the hard work. */ - beacon =ieee80211_beacon_get (hw, wl->vif, &txctl); + beacon =ieee80211_beacon_get (hw, wl->vif);if (unlikely (!beacon))return -ENOMEM ;spin_lock_irqsave (&wl->irq_lock, flags); -b43_update_templates (wl, beacon, &txctl); +b43_update_templates (wl, beacon);spin_unlock_irqrestore (&wl->irq_lock, flags);return 0 ; }static int b43_op_ibss_beacon_update (struct ieee80211_hw *hw, -struct sk_buff *beacon, -struct ieee80211_tx_control *ctl) +struct sk_buff *beacon) {struct b43_wl *wl =hw_to_b43_wl (hw);unsigned long flags;spin_lock_irqsave (&wl->irq_lock, flags); -b43_update_templates (wl, beacon, ctl); +b43_update_templates (wl, beacon);spin_unlock_irqrestore (&wl->irq_lock, flags);return 0 ;
drivers/net/wireless/b43/pio.c +19 -17
@@ -446,29 +446,27 @@ static void pio_tx_frame_4byte_queue(str }static int pio_tx_frame (struct b43_pio_txqueue *q, -struct sk_buff *skb, -struct ieee80211_tx_control *ctl) +struct sk_buff *skb) {struct b43_pio_txpacket *pack;struct b43_txhdr txhdr;u16 cookie;int err;unsigned int hdrlen; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);B43_WARN_ON (list_empty (&q->packets_list)); pack =list_entry (q->packets_list.next, struct b43_pio_txpacket, list); -memset (&pack->txstat,0 ,sizeof (pack->txstat)); -memcpy (&pack->txstat.control, ctl,sizeof (*ctl)); cookie =generate_cookie (q, pack); hdrlen =b43_txhdr_size (q->dev); err =b43_generate_txhdr (q->dev, (u8 *)&txhdr, skb->data, - skb->len, ctl, cookie); + skb->len, info, cookie);if (err)return err; -if (ctl->flags &IEEE80211_TXCTL_SEND_AFTER_DTIM ) { +if (info->flags &IEEE80211_TX_CTL_SEND_AFTER_DTIM ) {/* Tell the firmware about the cookie of the last * mcast frame, so it can clear the more-data bit in it. */ b43_shm_write16(q->dev, B43_SHM_SHARED,
@@ -492,17 +490,18 @@ static int pio_tx_frame(struct b43_pio_treturn 0 ; } -int b43_pio_tx (struct b43_wldev *dev, -struct sk_buff *skb,struct ieee80211_tx_control *ctl) +int b43_pio_tx (struct b43_wldev *dev,struct sk_buff *skb) {struct b43_pio_txqueue *q;struct ieee80211_hdr *hdr;unsigned long flags;unsigned int hdrlen, total_len;int err =0 ; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb); hdr = (struct ieee80211_hdr *)skb->data; -if (ctl->flags &IEEE80211_TXCTL_SEND_AFTER_DTIM ) { + +if (info->flags &IEEE80211_TX_CTL_SEND_AFTER_DTIM ) {/* The multicast queue will be sent after the DTIM. */ q = dev->pio.tx_queue_mcast;/* Set the frame More-Data bit. Ucode will clear it
@@ -510,7 +509,7 @@ int b43_pio_tx(struct b43_wldev *dev, hdr->frame_control |=cpu_to_le16 (IEEE80211_FCTL_MOREDATA ); }else {/* Decide by priority where to put this frame. */ - q =select_queue_by_priority (dev, ctl->queue); + q =select_queue_by_priority (dev, info->queue); }spin_lock_irqsave (&q->lock, flags);
@@ -533,7 +532,7 @@ int b43_pio_tx(struct b43_wldev *dev,if (total_len > (q->buffer_size - q->buffer_used)) {/* Not enough memory on the queue. */ err = -EBUSY ; -ieee80211_stop_queue (dev->wl->hw, ctl->queue); +ieee80211_stop_queue (dev->wl->hw, info->queue); q->stopped =1 ; goto out_unlock; }
@@ -541,9 +540,9 @@ int b43_pio_tx(struct b43_wldev *dev,/* Assign the queue number to the ring (if not already done before) * so TX status handling can use it. The mac80211-queue to b43-queue * mapping is static, so we don't need to store it per frame. */ - q->queue_prio = ctl->queue; + q->queue_prio = info->queue; - err =pio_tx_frame (q, skb, ctl); + err =pio_tx_frame (q, skb);if (unlikely (err == -ENOKEY )) {/* Drop this packet, as we don't have the encryption key * anymore and must not transmit it unencrypted. */
@@ -561,7 +560,7 @@ int b43_pio_tx(struct b43_wldev *dev,if (((q->buffer_size - q->buffer_used) <roundup (2 +2 +6 ,4 )) || (q->free_packet_slots ==0 )) {/* The queue is full. */ -ieee80211_stop_queue (dev->wl->hw, ctl->queue); +ieee80211_stop_queue (dev->wl->hw, info->queue); q->stopped =1 ; }
@@ -578,6 +577,7 @@ void b43_pio_handle_txstatus(struct b43_struct b43_pio_txqueue *q;struct b43_pio_txpacket *pack =NULL ;unsigned int total_len; +struct ieee80211_tx_info *info; q =parse_cookie (dev, status->cookie, &pack);if (unlikely (!q))
@@ -586,15 +586,17 @@ void b43_pio_handle_txstatus(struct b43_spin_lock (&q->lock);/* IRQs are already disabled. */ -b43_fill_txstatus_report (&(pack->txstat), status); + info = (void *)pack->skb; +memset (&info->status,0 ,sizeof (info->status)); + +b43_fill_txstatus_report (info, status); total_len = pack->skb->len +b43_txhdr_size (dev); total_len =roundup (total_len,4 ); q->buffer_used -= total_len; q->free_packet_slots +=1 ; -ieee80211_tx_status_irqsafe (dev->wl->hw, pack->skb, - &(pack->txstat)); +ieee80211_tx_status_irqsafe (dev->wl->hw, pack->skb); pack->skb =NULL ;list_add (&pack->list, &q->packets_list);
drivers/net/wireless/b43/pio.h +2 -6
@@ -62,8 +62,6 @@ struct b43_pio_txpacket {struct b43_pio_txqueue *queue;/* The TX data packet. */ struct sk_buff *skb; -/* The status meta data. */ -struct ieee80211_tx_status txstat;/* Index in the (struct b43_pio_txqueue)->packets array. */ u8 index;
@@ -167,8 +165,7 @@ int b43_pio_init(struct b43_wldev *dev);void b43_pio_stop (struct b43_wldev *dev);void b43_pio_free (struct b43_wldev *dev); -int b43_pio_tx (struct b43_wldev *dev, -struct sk_buff *skb,struct ieee80211_tx_control *ctl); +int b43_pio_tx (struct b43_wldev *dev,struct sk_buff *skb);void b43_pio_handle_txstatus (struct b43_wldev *dev,const struct b43_txstatus *status); void b43_pio_get_tx_stats(struct b43_wldev *dev,
@@ -193,8 +190,7 @@ static inline void b43_pio_stop(struct b { }static inline int b43_pio_tx (struct b43_wldev *dev, -struct sk_buff *skb, -struct ieee80211_tx_control *ctl) +struct sk_buff *skb) {return 0 ; }
drivers/net/wireless/b43/xmit.c +28 -30
171 lines not on this page · raw message
drivers/net/wireless/b43/xmit.h +2 -2
@@ -178,7 +178,7 @@ int b43_generate_txhdr(struct b43_wldevu8 * txhdr, const unsigned char *fragment_data, unsigned int fragment_len, - const struct ieee80211_tx_control *txctl, u16 cookie); + const struct ieee80211_tx_info *txctl, u16 cookie);/* Transmit Status */ struct b43_txstatus {
@@ -294,7 +294,7 @@ void b43_rx(struct b43_wldev *dev, strucvoid b43_handle_txstatus (struct b43_wldev *dev,const struct b43_txstatus *status); -bool b43_fill_txstatus_report (struct ieee80211_tx_status *report, +bool b43_fill_txstatus_report (struct ieee80211_tx_info *report,const struct b43_txstatus *status);void b43_tx_suspend (struct b43_wldev *dev);
drivers/net/wireless/adm8211.c +14 -17
@@ -324,7 +324,7 @@ static void adm8211_interrupt_tci(structfor (dirty_tx = priv->dirty_tx; priv->cur_tx - dirty_tx; dirty_tx++) {unsigned int entry = dirty_tx % priv->tx_ring_size;u32 status =le32_to_cpu (priv->tx_ring[entry].status); -struct ieee80211_tx_status tx_status; +struct ieee80211_tx_info *txi;struct adm8211_tx_ring_info *info;struct sk_buff *skb;
@@ -334,24 +334,23 @@ static void adm8211_interrupt_tci(struct info = &priv->tx_buffers[entry]; skb = info->skb; + txi =IEEE80211_SKB_CB (skb);/* TODO: check TDES0_STATUS_TUF and TDES0_STATUS_TRO */ pci_unmap_single (priv->pdev, info->mapping, info->skb->len,PCI_DMA_TODEVICE ); -memset (&tx_status,0 ,sizeof (tx_status)); +memset (&txi->status,0 ,sizeof (txi->status));skb_pull (skb,sizeof (struct adm8211_tx_hdr ));memcpy (skb_push (skb, info->hdrlen), skb->cb, info->hdrlen); -memcpy (&tx_status.control, &info->tx_control, -sizeof (tx_status.control)); -if (!(tx_status.control.flags &IEEE80211_TXCTL_NO_ACK )) { +if (!(txi->flags &IEEE80211_TX_CTL_NO_ACK )) {if (status &TDES0_STATUS_ES ) - tx_status.excessive_retries =1 ; + txi->status.excessive_retries =1 ;else - tx_status.flags |=IEEE80211_TX_STATUS_ACK ; + txi->flags |=IEEE80211_TX_STAT_ACK ; } -ieee80211_tx_status_irqsafe (dev, skb, &tx_status); +ieee80211_tx_status_irqsafe (dev, skb); info->skb =NULL ; }
@@ -1638,7 +1637,6 @@ static void adm8211_calc_durations(int */* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */ static void adm8211_tx_raw (struct ieee80211_hw *dev,struct sk_buff *skb,u16 plcp_signal, -struct ieee80211_tx_control *control,size_t hdrlen) {struct adm8211_priv *priv = dev->priv;
@@ -1664,7 +1662,6 @@ static void adm8211_tx_raw(struct ieee80 priv->tx_buffers[entry].skb = skb; priv->tx_buffers[entry].mapping = mapping; -memcpy (&priv->tx_buffers[entry].tx_control, control,sizeof (*control)); priv->tx_buffers[entry].hdrlen = hdrlen; priv->tx_ring[entry].buffer1 =cpu_to_le32 (mapping);
@@ -1685,17 +1682,17 @@ static void adm8211_tx_raw(struct ieee80 }/* Put adm8211_tx_hdr on skb and transmit */ -static int adm8211_tx (struct ieee80211_hw *dev,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int adm8211_tx (struct ieee80211_hw *dev,struct sk_buff *skb) {struct adm8211_tx_hdr *txhdr;u16 fc;size_t payload_len, hdrlen;int plcp, dur, len, plcp_signal, short_preamble;struct ieee80211_hdr *hdr; -struct ieee80211_rate *txrate =ieee80211_get_tx_rate (dev, control); +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb); +struct ieee80211_rate *txrate =ieee80211_get_tx_rate (dev, info); - short_preamble = !!(txrate->flags &IEEE80211_TXCTL_SHORT_PREAMBLE ); + short_preamble = !!(txrate->flags &IEEE80211_TX_CTL_SHORT_PREAMBLE ); plcp_signal = txrate->bitrate; hdr = (struct ieee80211_hdr *)skb->data;
@@ -1730,15 +1727,15 @@ static int adm8211_tx(struct ieee80211_hif (short_preamble) txhdr->header_control |=cpu_to_le16 (ADM8211_TXHDRCTL_SHORT_PREAMBLE ); -if (control->flags &IEEE80211_TXCTL_USE_RTS_CTS ) +if (info->flags &IEEE80211_TX_CTL_USE_RTS_CTS ) txhdr->header_control |=cpu_to_le16 (ADM8211_TXHDRCTL_ENABLE_RTS );if (fc &IEEE80211_FCTL_PROTECTED ) txhdr->header_control |=cpu_to_le16 (ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE ); - txhdr->retry_limit = control->retry_limit; + txhdr->retry_limit = info->control.retry_limit; -adm8211_tx_raw (dev, skb, plcp_signal, control, hdrlen); +adm8211_tx_raw (dev, skb, plcp_signal, hdrlen);return NETDEV_TX_OK ; }
drivers/net/wireless/adm8211.h +0 -1
@@ -443,7 +443,6 @@ struct adm8211_rx_ring_info {struct adm8211_tx_ring_info {struct sk_buff *skb;dma_addr_t mapping; -struct ieee80211_tx_control tx_control;size_t hdrlen; };
drivers/net/wireless/at76_usb.h +0 -1
@@ -441,7 +441,6 @@ struct at76_priv {int beacon_period;/* period of mgmt beacons, Kus */ struct ieee80211_hw *hw; -struct ieee80211_tx_status tx_status;int mac80211_registered; };
drivers/net/wireless/b43legacy/dma.c +19 -17
@@ -1205,10 +1205,10 @@ struct b43legacy_dmaring *parse_cookie(s }static int dma_tx_fragment (struct b43legacy_dmaring *ring, -struct sk_buff *skb, -struct ieee80211_tx_control *ctl) +struct sk_buff *skb) {const struct b43legacy_dma_ops *ops = ring->ops; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);u8 *header;int slot, old_top_slot, old_used_slots;int err;
@@ -1231,7 +1231,7 @@ static int dma_tx_fragment(struct b43leg header = &(ring->txhdr_cache[slot *sizeof (struct b43legacy_txhdr_fw3 )]); err =b43legacy_generate_txhdr (ring->dev, header, - skb->data, skb->len, ctl, + skb->data, skb->len, info,generate_cookie (ring, slot));if (unlikely (err)) { ring->current_slot = old_top_slot;
@@ -1255,7 +1255,6 @@ static int dma_tx_fragment(struct b43leg desc = ops->idx2desc (ring, slot, &meta);memset (meta,0 ,sizeof (*meta)); -memcpy (&meta->txstat.control, ctl,sizeof (*ctl)); meta->skb = skb; meta->is_last_fragment =1 ;
@@ -1323,14 +1322,14 @@ int should_inject_overflow(struct b43leg }int b43legacy_dma_tx (struct b43legacy_wldev *dev, -struct sk_buff *skb, -struct ieee80211_tx_control *ctl) +struct sk_buff *skb) {struct b43legacy_dmaring *ring; +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);int err =0 ;unsigned long flags; - ring =priority_to_txring (dev, ctl->queue); + ring =priority_to_txring (dev, info->queue);spin_lock_irqsave (&ring->lock, flags);B43legacy_WARN_ON (!ring->tx);if (unlikely (free_slots (ring) <SLOTS_PER_PACKET )) {
@@ -1343,7 +1342,7 @@ int b43legacy_dma_tx(struct b43legacy_wl* That would be a mac80211 bug. */ B43legacy_BUG_ON (ring->stopped); - err =dma_tx_fragment (ring, skb, ctl); + err =dma_tx_fragment (ring, skb);if (unlikely (err == -ENOKEY )) {/* Drop this packet, as we don't have the encryption key * anymore and must not transmit it unencrypted. */
@@ -1401,26 +1400,29 @@ void b43legacy_dma_handle_txstatus(struc 1);if (meta->is_last_fragment) { -B43legacy_WARN_ON (!meta->skb); +struct ieee80211_tx_info *info;
Lines of this file are not shown. View the raw message.
drivers/net/wireless/b43legacy/dma.h +1 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/b43legacy/main.c +5 -7
Lines of this file are not shown. View the raw message.
drivers/net/wireless/b43legacy/pio.c +9 -10
Lines of this file are not shown. View the raw message.
drivers/net/wireless/b43legacy/pio.h +1 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/b43legacy/xmit.c +22 -22
44 lines not on this page · raw message
drivers/net/wireless/b43legacy/xmit.h +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/wireless/p54/p54common.c +38 -52
90 lines not on this page · raw message
drivers/net/wireless/p54/p54common.h +0 -1
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rtl8187.h +0 -6
Lines of this file are not shown. View the raw message.
drivers/net/wireless/zd1211rw/zd_mac.c +40 -116
156 lines not on this page · raw message
drivers/net/wireless/zd1211rw/zd_mac.h +0 -16
Lines of this file are not shown. View the raw message.
drivers/net/wireless/zd1211rw/zd_usb.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-3945-rs.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-3945.c +12 -12
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-3945.h +1 -2
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +23 -26
49 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-4965.c +14 -14
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-dev.h +2 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl3945-base.c +22 -26
48 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl4965-base.c +21 -31
52 lines not on this page · raw message
net/mac80211/wep.c +6 -3
Lines of this file are not shown. View the raw message.
drivers/net/wireless/ath5k/base.c +32 -38
70 lines not on this page · raw message
drivers/net/wireless/ath5k/base.h +0 -1
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2400pci.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2500pci.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2500usb.c +4 -5
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00.h +3 -7
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00dev.c +23 -26
49 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00mac.c +43 -31
74 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00pci.c +5 -6
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00pci.h +1 -5
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00queue.c +15 -16
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00queue.h +9 -6
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00usb.c +5 -7
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt2x00usb.h +1 -8
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt61pci.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/net/wireless/rt2x00/rt73usb.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-core.h +1 -2
Lines of this file are not shown. View the raw message.
drivers/net/wireless/iwlwifi/iwl-tx.c +19 -21
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Johannes Berg
maintainerRe: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 9 lines · Johannes Berg
plain text document attachment (019-mac80211-tx-info-skb-cb.patch) This patch converts mac80211 and all drivers to have transmit information and status in
skb->cbrather 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.
I mangled it a bit though so you may want to check it, mac80211 now sets REQ_TX_STATUS so you can use that for status reporting, but you can't use it for queue kicking at least not in the future when mac80211 might not set it on all frames.
johannes
Re: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 8 lines · Johannes Berg
Quoted 7 lines · Johannes Berg
plain text document attachment (019-mac80211-tx-info-skb-cb.patch) This patch converts mac80211 and all drivers to have transmit information and status in
skb->cbrather 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.
Quoted 7 lines
Quoted 2 lines
A number of fixes were done by Ivo, as well as the rt2x00 part of this patch.
I mangled it a bit though so you may want to check it, mac80211 now sets
REQ_TX_STATUSso you can use that for status reporting, but you can't use it for queue kicking at least not in the future when mac80211 might not set it on all frames.
Well queue kicking from driver to mac80211 is in rt2x00 based on txdone events on a particular queue. (When frame was succesfully transmitted and is no longer full, then the queue will be awakened by rt2x00). I am changing this a bit to support burst events that will send all fragments in a single run, but that is currently under testing in rt2x00.git.
Ivo
Johannes Berg
maintainerRe: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
A number of fixes were done by Ivo, as well as the rt2x00 part of this patch.
Quoted 8 lines
Quoted 4 lines
I mangled it a bit though so you may want to check it, mac80211 now sets
REQ_TX_STATUSso you can use that for status reporting, but you can't use it for queue kicking at least not in the future when mac80211 might not set it on all frames.Well queue kicking from driver to mac80211 is in rt2x00 based on txdone events on a particular queue. (When frame was succesfully transmitted and is no longer full, then the queue will be awakened by rt2x00).
Yeah, but the patch you had sent me was removing the "driver generated" flag, and I kept that around now for this purpose.
I have thought about this a bit, you may want to wait wrt. fragments because I'm going to rewrite fragmentation, and then we could change the mac80211/driver API to hand the driver an skb with all the fragments at once instead of handing it each fragment one by one, thoughts?
johannes
Re: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 9 lines · Johannes Berg
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
A number of fixes were done by Ivo, as well as the rt2x00 part of this patch.
I mangled it a bit though so you may want to check it, mac80211 now sets
REQ_TX_STATUSso you can use that for status reporting, but you can't use it for queue kicking at least not in the future when mac80211 might not set it on all frames.
Quoted 6 lines
Quoted 3 lines
Well queue kicking from driver to mac80211 is in rt2x00 based on txdone events on a particular queue. (When frame was succesfully transmitted and is no longer full, then the queue will be awakened by rt2x00).
Yeah, but the patch you had sent me was removing the "driver generated" flag, and I kept that around now for this purpose.
I think we refer to different things when we talk about "queue kicking" ;) Anyway, I'm fine with how it looks like now. It means I can remove a few patches from rt2x00.git :)
Quoted 4 lines
I have thought about this a bit, you may want to wait wrt. fragments because I'm going to rewrite fragmentation, and then we could change the mac80211/driver API to hand the driver an skb with all the fragments at once instead of handing it each fragment one by one, thoughts?
Well that would mostly be beneficial for rt61pci who is able to attach multiple fragments into a single queue entry. But for the others that wouldn't matter that much since each fragment occupies a single queue entry, so for those drivers having mac80211 calling tx() multiple times, or having rt2x00 call write_tx_frame() multiple times isn't a big difference other then rt2x00 being able to better control frame flow by kicking the TX queue only when all fragments are in the queue.
Ivo
Johannes Berg
maintainerRe: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 7 lines
Quoted 3 lines
Yeah, but the patch you had sent me was removing the "driver generated" flag, and I kept that around now for this purpose.
I think we refer to different things when we talk about "queue kicking" ;) Anyway, I'm fine with how it looks like now. It means I can remove a few patches from rt2x00.git :)
Maybe :) I was talking about this hunk:
@@ -179,8 +176,10 @@ void rt2x00queue_write_tx_descriptor(str
/*
* We are done writing the frame to the queue entry,
- * if this entry is a RTS of CTS-to-self frame we are done,
- * otherwise we need to kick the queue.
+ * also kick the queue in case the correct flags are set,
+ * note that this will automatically filter beacons and
+ * RTS/CTS frames since those frames don't have this flag
+ * set.
*/
if (rt2x00dev->ops->lib->kick_tx_queue &&
!(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED))which looked vastly different in your original version and tested IEEE80211_TX_CTL_READY_FOR_TX I think.
But if you're ok with that, that's great :)
Quoted 5 lines
Quoted 4 lines
I have thought about this a bit, you may want to wait wrt. fragments because I'm going to rewrite fragmentation, and then we could change the mac80211/driver API to hand the driver an skb with all the fragments at once instead of handing it each fragment one by one, thoughts?
Quoted 7 lines
Well that would mostly be beneficial for rt61pci who is able to attach multiple fragments into a single queue entry. But for the others that wouldn't matter that much since each fragment occupies a single queue entry, so for those drivers having mac80211 calling
tx()multiple times, or having rt2x00 callwrite_tx_frame()multiple times isn't a big difference other then rt2x00 being able to better control frame flow by kicking the TX queue only when all fragments are in the queue.
Well I expect that this would have to be controlled by a hardware flag anyway. Also, it might get you into trouble with the number of free queue entries because mac80211 would definitely expect you to take all fragments then, you couldn't just take the first 2 and leave 2 to mac80211, for example.
johannes
Re: [PATCH 5/5] mac80211: move TX info into skb->cb
In reply to Johannes BergQuoted 5 lines · Johannes Berg
net/mac80211/tx.c +0
-0@@ -1325,9 +1324,10 @@ int ieee80211_master_start_xmit(struct sdev_kfree_skb (skb);
net/mac80211/tx.c int ieee80211_master_start_xmit(struct s · line 1333
Quoted 10 lines
net/mac80211/tx.c +2
-1return 0 ; } + osdata =IEEE80211_DEV_TO_SUB_IF (odev); - encrypt = !(pkt_data->flags &IEEE80211_TXPD_DO_NOT_ENCRYPT ); + encrypt = !(info->flags &IEEE80211_TX_CTL_DO_NOT_ENCRYPT ); headroom = osdata->local->tx_headroom;if (encrypt)
This hunk didn't apply, please review the merge results.
John
Signature · 2 lines
John W. Linville [email protected]
Johannes Berg
maintainerRe: [PATCH 5/5] mac80211: move TX info into skb->cb
Quoted 11 lines
Quoted 11 lines
net/mac80211/tx.c +1
-0@@ -1325,9 +1324,10 @@ int ieee80211_master_start_xmit(struct sdev_kfree_skb (skb);return 0 ; } + osdata =IEEE80211_DEV_TO_SUB_IF (odev);
Quoted 7 lines
net/mac80211/tx.c int ieee80211_master_start_xmit(struct s · line 1333
Quoted 5 lines
net/mac80211/tx.c +1
-1- encrypt = !(pkt_data->flags &IEEE80211_TXPD_DO_NOT_ENCRYPT ); + encrypt = !(info->flags &IEEE80211_TX_CTL_DO_NOT_ENCRYPT ); headroom = osdata->local->tx_headroom;if (encrypt)This hunk didn't apply, please review the merge results.
That's because I forgot to send you a patch: "mac80211: clean up skb reallocation code"... Sorry about that, I'll rebase it and send it to you now.
johannes