pull request: wireless-next-2.6 2008-10-06
Subsystems (6)
Dave,
Here is the latest round of wireless updates intended for 2.6.28. There are a couple of merge damage fixups, a new rate scaling algorithm for mac80211, and some miscellaneous drivers fixes and such.
Let me know if there are problems!
Thanks,
John
P.S. One of the merge fixups shows-up as from Linus -- I guess this is technically correct since I just cherry-picked the original revert which had been lost...
---
Individual patches are available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6/
---
The following changes since commit c7004482e8dcb7c3c72666395cfa98a216a4fb70:
David S. Miller (1):
tcp: Respect SO_RCVLOWAT in tcp_poll().
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git master
Christian Lamparter (1):
p54: report appropriate rate and band values for 802.11a
Davide Pesavento (1):
wireless: fix typo in Kconfig.
Felix Fietkau (4):
mac80211: free up 2 bytes in skb->cb
mac80211: add multi-rate retry support
ath5k: implement multi-rate retry support, fix tx status reporting
mac80211: add the 'minstrel' rate control algorithm
Gertjan van Wingerde (1):
rt2x00: Fix rfkill structure initialization to prevent rfkill WARN_ON.
Henrique de Moraes Holschuh (1):
rfkill: update LEDs for all state changes
John W. Linville (2):
ath9k: fixup some merge damage
mac80211: avoid "Wireless Event too big" message for assoc response
Linus Torvalds (1):
wireless: restore revert lost to merge damage
Luis R. Rodriguez (3):
ath9k: kill ath9k's memzero() and use memset() instead
ath9k: fix oops on trying to hold the wrong spinlock
ath9k: enable ANI to help with noisy environments
Rami Rosen (1):
mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
Tomas Winkler (4):
mac80211: remove shadowed variables in ieee80211_master_start_xmit
iwlwifi: scan correct setting of valid rx_chains
iwlwifi: scan fix comment
iwlwifi: remove STATUS_CONF_PENDING in scanning
drivers/net/wireless/ath5k/ath5k.h | 4 +- drivers/net/wireless/ath5k/base.c | 50 +++- drivers/net/wireless/ath5k/desc.c | 69 +++- drivers/net/wireless/ath9k/ath9k.h | 2 +- drivers/net/wireless/ath9k/beacon.c | 8 +- drivers/net/wireless/ath9k/core.c | 145 ++++++- drivers/net/wireless/ath9k/core.h | 32 ++- drivers/net/wireless/ath9k/hw.c | 35 ++- drivers/net/wireless/ath9k/main.c | 18 +- drivers/net/wireless/ath9k/recv.c | 17 +- drivers/net/wireless/ath9k/xmit.c | 12 +- drivers/net/wireless/b43/main.c | 1 + drivers/net/wireless/b43/xmit.c | 6 +- drivers/net/wireless/b43legacy/main.c | 1 + drivers/net/wireless/b43legacy/xmit.c | 6 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 28 -- drivers/net/wireless/iwlwifi/iwl-core.h | 3 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 28 ++- drivers/net/wireless/p54/p54common.c | 5 +- drivers/net/wireless/rt2x00/rt2x00crypto.c | 4 +- drivers/net/wireless/rt2x00/rt2x00queue.c | 7 +- drivers/net/wireless/rt2x00/rt2x00rfkill.c | 9 +- drivers/net/wireless/rtl8180_dev.c | 5 +- include/net/mac80211.h | 33 ++- net/mac80211/Kconfig | 13 + net/mac80211/Makefile | 4 + net/mac80211/key.c | 14 + net/mac80211/main.c | 5 + net/mac80211/mlme.c | 47 ++- net/mac80211/rate.h | 14 + net/mac80211/rc80211_minstrel.c | 583 ++++++++++++++++++++++++++++ net/mac80211/rc80211_minstrel.h | 85 ++++ net/mac80211/rc80211_minstrel_debugfs.c | 164 ++++++++ net/mac80211/tx.c | 36 +- net/mac80211/wep.c | 3 - net/mac80211/wpa.c | 6 - net/rfkill/rfkill.c | 5 +- net/wireless/Kconfig | 2 +- 38 files changed, 1335 insertions(+), 174 deletions(-) create mode 100644 net/mac80211/rc80211_minstrel.c create mode 100644 net/mac80211/rc80211_minstrel.h create mode 100644 net/mac80211/rc80211_minstrel_debugfs.c
drivers/net/wireless/ath5k/ath5k.h +3 -1
@@ -431,7 +431,9 @@ struct ath5k_tx_status {u16 ts_seqnum;u16 ts_tstamp;u8 ts_status; -u8 ts_rate; +u8 ts_rate[4 ]; +u8 ts_retry[4 ]; +u8 ts_final_idx;s8 ts_rssi;u8 ts_shortretry;u8 ts_longretry;
drivers/net/wireless/ath5k/base.c +46 -4
86 lines not on this page · raw message
drivers/net/wireless/ath5k/desc.c +47 -22
97 lines not on this page · raw message
drivers/net/wireless/ath9k/ath9k.h +1 -1
@@ -854,7 +854,7 @@ bool ath9k_hw_calibrate(struct ath_hal *ah,u8 rxchainmask, bool longcal, bool *isCalDone); -int16_t ath9k_hw_getchan_noise (struct ath_hal *ah, +s16 ath9k_hw_getchan_noise (struct ath_hal *ah,struct ath9k_channel *chan);void ath9k_hw_write_associd (struct ath_hal *ah,const u8 *bssid,u16 assocId);
drivers/net/wireless/ath9k/beacon.c +4 -4
@@ -129,7 +129,7 @@ static void ath_beacon_setup(struct ath_softc *sc,ds /* first descriptor */ ); -memzero (series,sizeof (struct ath9k_11n_rate_series ) *4 ); +memset (series,0 ,sizeof (struct ath9k_11n_rate_series ) *4 ); series[0 ].Tries =1 ; series[0 ].Rate = rate; series[0 ].ChSel = sc->sc_tx_chainmask;
@@ -282,7 +282,7 @@ int ath_beaconq_setup(struct ath_hal *ah) {struct ath9k_tx_queue_info qi; -memzero (&qi,sizeof (qi)); +memset (&qi,0 ,sizeof (qi)); qi.tqi_aifs =1 ; qi.tqi_cwmin =0 ; qi.tqi_cwmax =0 ;
@@ -662,7 +662,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)else av_opmode = sc->sc_ah->ah_opmode; -memzero (&conf,sizeof (struct ath_beacon_config )); +memset (&conf,0 ,sizeof (struct ath_beacon_config )); conf.beacon_interval = sc->hw->conf.beacon_int ? sc->hw->conf.beacon_int :ATH_DEFAULT_BINTVAL ;
@@ -738,7 +738,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) } }while (nexttbtt < tsftu);#undef FUDGE -memzero (&bs,sizeof (bs)); +memset (&bs,0 ,sizeof (bs)); bs.bs_intval = intval; bs.bs_nexttbtt = nexttbtt; bs.bs_dtimperiod = dtimperiod*intval;
drivers/net/wireless/ath9k/core.c +129 -16
223 lines not on this page · raw message
drivers/net/wireless/ath9k/core.h +27 -5
@@ -84,9 +84,6 @@ struct ath_node;#define TSF_TO_TU (_h,_l) \ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) -/* XXX: remove */ -#define memzero (_buf, _len) memset(_buf, 0, _len) -#define ATH9K_BH_STATUS_INTACT 0#define ATH9K_BH_STATUS_CHANGE 1
@@ -184,7 +181,7 @@ void ath_update_chainmask(struct ath_softc *sc, int is_ht); (_bf)->bf_lastbf =NULL ; \ (_bf)->bf_lastfrm =NULL ; \ (_bf)->bf_next =NULL ; \ -memzero (&((_bf)->bf_state), \ +memset (&((_bf)->bf_state),0 , \sizeof (struct ath_buf_state )); \ }while (0 )
@@ -312,7 +309,7 @@ void ath_descdma_cleanup(struct ath_softc *sc,#define ATH_RX_TIMEOUT 40/* 40 milliseconds */ #define WME_NUM_TID 16#define IEEE80211_BAR_CTL_TID_M 0xF000/* tid mask */ -#define IEEE80211_BAR_CTL_TID_S 2/* tid shift */ +#define IEEE80211_BAR_CTL_TID_S 12/* tid shift */ enum ATH_RX_TYPE {ATH_RX_NON_CONSUMED =0 ,
@@ -803,6 +800,28 @@ void ath_slow_ant_div(struct ath_antdiv *antdiv, struct ath_rx_status *rx_stats);void ath_setdefantenna (void *sc,u32 antenna); +/*******/ +/* ANI */ +/*******/ + +/* ANI values for STA only. +FIXME: Add appropriate values for AP later */ + +#define ATH_ANI_POLLINTERVAL 100/* 100 milliseconds between ANI poll */ +#define ATH_SHORT_CALINTERVAL 1000/* 1 second between calibrations */ +#define ATH_LONG_CALINTERVAL 30000/* 30 seconds between calibrations */ +#define ATH_RESTART_CALINTERVAL 1200000/* 20 minutes between calibrations */ + +struct ath_ani { +bool sc_caldone; +int16_t sc_noise_floor; +unsigned int sc_longcal_timer; +unsigned int sc_shortcal_timer; +unsigned int sc_resetcal_timer; +unsigned int sc_checkani_timer; +struct timer_list timer; +}; +/********************/ /* LED Control */ /********************/
@@ -1031,6 +1050,9 @@ struct ath_softc {/* Rfkill */ struct ath_rfkill rf_kill; + +/* ANI */ +struct ath_ani sc_ani; };int ath_init (u16 devid,struct ath_softc *sc);
drivers/net/wireless/ath9k/hw.c +30 -5
@@ -329,7 +329,7 @@ static void ath9k_hw_set_defaults(struct ath_hal *ah) ah->ah_config.ofdm_trig_high =500 ; ah->ah_config.cck_trig_high =200 ; ah->ah_config.cck_trig_low =100 ; - ah->ah_config.enable_ani =0 ; + ah->ah_config.enable_ani =1 ; ah->ah_config.noise_immunity_level =4 ; ah->ah_config.ofdm_weaksignal_det =1 ; ah->ah_config.cck_weaksignal_thr =0 ;
@@ -8405,23 +8405,48 @@ u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags) } } -int16_t +/* We can tune this as we go by monitoring really low values */ +#define ATH9K_NF_TOO_LOW -60 + +/* AR5416 may return very high value (like -31 dBm), in those cases the nf +* is incorrect and we should use the static NF value. Later we can try to +* find out why they are reporting these values */ +static bool ath9k_hw_nf_in_range (struct ath_hal *ah,s16 nf) +{ +if (nf >ATH9K_NF_TOO_LOW ) { +DPRINTF (ah->ah_sc,ATH_DBG_NF_CAL , +"%s: noise floor value detected (%d) is " +"lower than what we think is a " +"reasonable value (%d)\n" , + __func__, nf,ATH9K_NF_TOO_LOW ); +return false; + } +return true; +} + +s16 ath9k_hw_getchan_noise (struct ath_hal *ah,struct ath9k_channel *chan) {struct ath9k_channel *ichan; +s16 nf; ichan =ath9k_regd_check_channel (ah, chan);if (ichan ==NULL ) {DPRINTF (ah->ah_sc,ATH_DBG_NF_CAL ,"%s: invalid channel %u/0x%x; no mapping\n" , __func__, chan->channel, chan->channelFlags); -return 0 ; +return ATH_DEFAULT_NOISE_FLOOR ; }if (ichan->rawNoiseFloor ==0 ) {enum wireless_mode mode =ath9k_hw_chan2wmode (ah, chan); -return NOISE_FLOOR [mode]; + nf =NOISE_FLOOR [mode]; }else -return ichan->rawNoiseFloor; + nf = ichan->rawNoiseFloor; + +if (!ath9k_hw_nf_in_range (ah, nf)) + nf =ATH_DEFAULT_NOISE_FLOOR ; + +return nf; }bool ath9k_hw_set_tsfadjust (struct ath_hal *ah,u32 setting)
drivers/net/wireless/ath9k/main.c +17 -1
@@ -274,10 +274,12 @@ static void ath9k_rx_prepare(struct ath_softc *sc, rx_status->mactime = status->tsf; rx_status->band = curchan->band; rx_status->freq = curchan->center_freq; - rx_status->noise =ATH_DEFAULT_NOISE_FLOOR ; + rx_status->noise = sc->sc_ani.sc_noise_floor; rx_status->signal = rx_status->noise + status->rssi; rx_status->rate_idx =ath_rate2idx (sc, (status->rateKbps /100 )); rx_status->antenna = status->antenna; + +/* XXX Fix me, 64 cannot be the max rssi value, rigure it out */ rx_status->qual = status->rssi *100 /64 ;if (status->flags &ATH_RX_MIC_ERROR )
@@ -427,6 +429,11 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,ath_rate_newstate (sc, avp);/* Update ratectrl about the new state */ ath_rc_node_update (hw, avp->rc_node); + +/* Start ANI */ +mod_timer (&sc->sc_ani.timer, + jiffies +msecs_to_jiffies (ATH_ANI_POLLINTERVAL )); + }else {DPRINTF (sc,ATH_DBG_CONFIG ,"%s: Bss Info DISSOC\n" , __func__);
@@ -1173,6 +1180,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,return error; } +if (conf->type ==NL80211_IFTYPE_AP ) { +/* TODO: is this a suitable place to start ANI for AP mode? */ +/* Start ANI */ +mod_timer (&sc->sc_ani.timer, + jiffies +msecs_to_jiffies (ATH_ANI_POLLINTERVAL )); + } +return 0 ; }
@@ -1195,6 +1209,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,#ifdef CONFIG_SLOW_ANT_DIV ath_slow_ant_div_stop (&sc->sc_antdiv);#endif +/* Stop ANI */ +del_timer_sync (&sc->sc_ani.timer);/* Update ratectrl */ ath_rate_newstate (sc, avp);
drivers/net/wireless/ath9k/recv.c +4 -13
@@ -892,7 +892,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) hdr = (struct ieee80211_hdr *)skb->data; fc = hdr->frame_control; -memzero (&rx_status,sizeof (struct ath_recv_status )); +memset (&rx_status,0 ,sizeof (struct ath_recv_status ));if (ds->ds_rxstat.rs_more) {/*
@@ -999,20 +999,11 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) rx_status.flags |=ATH_RX_SHORT_GI ; } -/* sc->sc_noise_floor is only available when the station +/* sc_noise_floor is only available when the station attaches to an AP, so we use a default value if we are not yet attached. */ - -/* XXX we should use either sc->sc_noise_floor or -* ath_hal_getChanNoise(ah, &sc->sc_curchan) -* to calculate the noise floor. -* However, the value returned by ath_hal_getChanNoise -* seems to be incorrect (-31dBm on the last test), -* so we will use a hard-coded value until we -* figure out what is going on. -*/ rx_status.abs_rssi = - ds->ds_rxstat.rs_rssi +ATH_DEFAULT_NOISE_FLOOR ; + ds->ds_rxstat.rs_rssi + sc->sc_ani.sc_noise_floor; pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr,
@@ -1166,7 +1157,7 @@ int ath_rx_aggr_start(struct ath_softc *sc, }else {/* Ensure the memory is zeroed out (all internal * pointers are null) */ -memzero (rxtid->rxbuf,ATH_TID_MAX_BUFS * +memset (rxtid->rxbuf,0 ,ATH_TID_MAX_BUFS *sizeof (struct ath_rxbuf ));DPRINTF (sc,ATH_DBG_AGGR ,"%s: Allocated @%p\n" , __func__, rxtid->rxbuf);
drivers/net/wireless/ath9k/xmit.c +6 -6
@@ -237,7 +237,7 @@ static int ath_tx_prepare(struct ath_softc *sc,if (tx_info->control.hw_key) { txctl->keyix = tx_info->control.hw_key->hw_key_idx; - txctl->frmlen += tx_info->control.icv_len; + txctl->frmlen += tx_info->control.hw_key->icv_len;if (tx_info->control.hw_key->alg ==ALG_WEP ) txctl->keytype =ATH9K_KEY_TYPE_WEP ;
@@ -729,7 +729,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)/* * Setup HAL rate series */ -memzero (series,sizeof (struct ath9k_11n_rate_series ) *4 ); +memset (series,0 ,sizeof (struct ath9k_11n_rate_series ) *4 );for (i =0 ; i <4 ; i++) {if (!bf->bf_rcs[i].tries)
@@ -817,7 +817,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)* Disable multi-rate retry when using RTS/CTS by clearing * series 1, 2 and 3. */ -memzero (&series[1 ],sizeof (struct ath9k_11n_rate_series ) *3 ); +memset (&series[1 ],0 ,sizeof (struct ath9k_11n_rate_series ) *3 ); }/*
@@ -930,7 +930,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,ATH_DS_BA_BITMAP (ds), WME_BA_BMP_SIZE >> 3); }else { -memzero (ba,WME_BA_BMP_SIZE >>3 ); +memset (ba,0 ,WME_BA_BMP_SIZE >>3 );/* * AR5416 can become deaf/mute when BA
@@ -943,7 +943,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc, needreset =1 ; } }else { -memzero (ba,WME_BA_BMP_SIZE >>3 ); +memset (ba,0 ,WME_BA_BMP_SIZE >>3 ); } }
@@ -2098,7 +2098,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)struct ath9k_tx_queue_info qi;int qnum; -memzero (&qi,sizeof (qi)); +memset (&qi,0 ,sizeof (qi)); qi.tqi_subtype = subtype; qi.tqi_aifs =ATH9K_TXQ_USEDEFAULT ; qi.tqi_cwmin =ATH9K_TXQ_USEDEFAULT ;
drivers/net/wireless/b43/main.c +1 -0
@@ -4588,6 +4588,7 @@ static int b43_wireless_init(struct ssb_device *dev)BIT (NL80211_IFTYPE_ADHOC ); hw->queues = b43_modparam_qos ?4 :1 ; + hw->max_altrates =1 ;SET_IEEE80211_DEV (hw, dev->dev);if (is_valid_ether_addr (sprom->et1mac))SET_IEEE80211_PERM_ADDR (hw, sprom->et1mac);
drivers/net/wireless/b43/xmit.c +3 -3
@@ -208,7 +208,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, txrate =ieee80211_get_tx_rate (dev->wl->hw, info); rate = txrate ? txrate->hw_value :B43_CCK_RATE_1MB ; rate_ofdm =b43_is_ofdm_rate (rate); - fbrate =ieee80211_get_alt_retry_rate (dev->wl->hw, info) ? : txrate; + fbrate =ieee80211_get_alt_retry_rate (dev->wl->hw, info,0 ) ? : txrate; rate_fb = fbrate->hw_value; rate_fb_ofdm =b43_is_ofdm_rate (rate_fb);
@@ -252,7 +252,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, }/* Hardware appends ICV. */ - plcp_fragment_len += info->control.icv_len; + plcp_fragment_len += info->control.hw_key->icv_len; key_idx =b43_kidx_to_fw (dev, key_idx); mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) &
@@ -260,7 +260,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, mac_ctl |= (key->algorithm <<B43_TXH_MAC_KEYALG_SHIFT ) &B43_TXH_MAC_KEYALG ; wlhdr_len =ieee80211_hdrlen (fctl); - iv_len =min ((size_t ) info->control.iv_len, + iv_len =min ((size_t ) info->control.hw_key->iv_len,ARRAY_SIZE (txhdr->iv));memcpy (txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); }
drivers/net/wireless/b43legacy/main.c +1 -0
@@ -3710,6 +3710,7 @@ static int b43legacy_wireless_init(struct ssb_device *dev)BIT (NL80211_IFTYPE_WDS ) |BIT (NL80211_IFTYPE_ADHOC ); hw->queues =1 ;/* FIXME: hardware has more queues */ + hw->max_altrates =1 ;SET_IEEE80211_DEV (hw, dev->dev);if (is_valid_ether_addr (sprom->et1mac))SET_IEEE80211_PERM_ADDR (hw, sprom->et1mac);
drivers/net/wireless/b43legacy/xmit.c +3 -3
@@ -210,7 +210,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, rate = tx_rate->hw_value; rate_ofdm =b43legacy_is_ofdm_rate (rate); - rate_fb =ieee80211_get_alt_retry_rate (dev->wl->hw, info) ? : tx_rate; + rate_fb =ieee80211_get_alt_retry_rate (dev->wl->hw, info,0 ) ? : tx_rate; rate_fb_ofdm =b43legacy_is_ofdm_rate (rate_fb->hw_value); txhdr->mac_frame_ctl = wlhdr->frame_control;
@@ -243,7 +243,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev,if (key->enabled) {/* Hardware appends ICV. */ - plcp_fragment_len += info->control.icv_len; + plcp_fragment_len += info->control.hw_key->icv_len; key_idx =b43legacy_kidx_to_fw (dev, key_idx); mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) &
@@ -252,7 +252,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, B43legacy_TX4_MAC_KEYALG_SHIFT) & B43legacy_TX4_MAC_KEYALG; wlhdr_len =ieee80211_hdrlen (wlhdr->frame_control); - iv_len =min ((size_t )info->control.iv_len, + iv_len =min ((size_t )info->control.hw_key->iv_len,ARRAY_SIZE (txhdr->iv));memcpy (txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); }else {
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -28
@@ -2569,30 +2569,6 @@ static void iwl4965_post_associate(struct iwl_priv *priv) } -static int iwl4965_mac_config (struct ieee80211_hw *hw,struct ieee80211_conf *conf); - -static void iwl_bg_scan_completed (struct work_struct *work) -{ -struct iwl_priv *priv = - container_of(work, struct iwl_priv, scan_completed); - -IWL_DEBUG_SCAN ("SCAN complete scan\n" ); - -if (test_bit (STATUS_EXIT_PENDING , &priv->status)) -return ; - -if (test_bit (STATUS_CONF_PENDING , &priv->status)) -iwl4965_mac_config (priv->hw,ieee80211_get_hw_conf (priv->hw)); - -ieee80211_scan_completed (priv->hw); - -/* Since setting the TXPOWER may have been deferred while -* performing the scan, fire one off */ -mutex_lock (&priv->mutex); -iwl_set_tx_power (priv, priv->tx_power_user_lmt, true); -mutex_unlock (&priv->mutex); -} -/***************************************************************************** * * mac80211 entry point functions
@@ -2812,7 +2788,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *coif (unlikely (!priv->cfg->mod_params->disable_hw_scan &&test_bit (STATUS_SCANNING , &priv->status))) {IWL_DEBUG_MAC80211 ("leave - scanning\n" ); -set_bit (STATUS_CONF_PENDING , &priv->status);mutex_unlock (&priv->mutex);return 0 ; }
@@ -2898,7 +2873,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *coIWL_DEBUG_MAC80211 ("leave\n" ); out: -clear_bit (STATUS_CONF_PENDING , &priv->status);mutex_unlock (&priv->mutex);return ret; }
@@ -4117,8 +4091,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)INIT_DELAYED_WORK (&priv->init_alive_start, iwl_bg_init_alive_start);INIT_DELAYED_WORK (&priv->alive_start, iwl_bg_alive_start); -/* FIXME : remove when resolved PENDING */ -INIT_WORK (&priv->scan_completed, iwl_bg_scan_completed);iwl_setup_scan_deferred_work (priv);iwl_setup_power_deferred_work (priv);
drivers/net/wireless/iwlwifi/iwl-core.h +1 -2
@@ -333,8 +333,7 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv);#define STATUS_SCAN_HW 15#define STATUS_POWER_PMI 16#define STATUS_FW_ERROR 17 -#define STATUS_CONF_PENDING 18 -#define STATUS_MODE_PENDING 19 +#define STATUS_MODE_PENDING 18static inline int iwl_is_ready (struct iwl_priv *priv)
drivers/net/wireless/iwlwifi/iwl-scan.c +24 -4
@@ -703,7 +703,7 @@ static void iwl_bg_request_scan(struct work_struct *data)u16 cmd_len;enum ieee80211_band band;u8 n_probes =2 ; -u8 rx_chain =0x7 ;/* bitmap: ABC chains */ +u8 rx_chain = priv->hw_params.valid_rx_ant; conf =ieee80211_get_hw_conf (priv->hw);
@@ -843,7 +843,7 @@ static void iwl_bg_request_scan(struct work_struct *data)/* Force use of chains B and C (0x6) for scan Rx for 4965 * Avoid A (0x1) because of its off-channel reception on A-band. -* MIMO is not used here, but value is required */ +*/ if ((priv->hw_rev &CSR_HW_REV_TYPE_MSK ) ==CSR_HW_REV_TYPE_4965 ) rx_chain =0x6 ; }else {
@@ -851,6 +851,7 @@ static void iwl_bg_request_scan(struct work_struct *data) goto done; } +/* MIMO is not used here, but value is required */ scan->rx_chain =RXON_RX_CHAIN_DRIVER_FORCE_MSK | cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) | (rx_chain << RXON_RX_CHAIN_FORCE_SEL_POS) |
@@ -915,10 +916,29 @@ static void iwl_bg_abort_scan(struct work_struct *work)mutex_unlock (&priv->mutex); } +static void iwl_bg_scan_completed (struct work_struct *work) +{ +struct iwl_priv *priv = + container_of(work, struct iwl_priv, scan_completed); + +IWL_DEBUG_SCAN ("SCAN complete scan\n" ); + +if (test_bit (STATUS_EXIT_PENDING , &priv->status)) +return ; + +ieee80211_scan_completed (priv->hw); + +/* Since setting the TXPOWER may have been deferred while +* performing the scan, fire one off */ +mutex_lock (&priv->mutex); +iwl_set_tx_power (priv, priv->tx_power_user_lmt, true); +mutex_unlock (&priv->mutex); +} + +void iwl_setup_scan_deferred_work (struct iwl_priv *priv) { -/* FIXME: move here when resolved PENDING -* INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); */ +INIT_WORK (&priv->scan_completed, iwl_bg_scan_completed);INIT_WORK (&priv->request_scan, iwl_bg_request_scan);INIT_WORK (&priv->abort_scan, iwl_bg_abort_scan);INIT_DELAYED_WORK (&priv->scan_check, iwl_bg_scan_check);
drivers/net/wireless/p54/p54common.c +3 -2
@@ -507,9 +507,10 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) rx_status.noise = priv->noise;/* XX correct? */ rx_status.qual = (100 * hdr->rssi) /127 ; - rx_status.rate_idx = hdr->rate &0xf ; + rx_status.rate_idx = (dev->conf.channel->band ==IEEE80211_BAND_2GHZ ? + hdr->rate : (hdr->rate -4 )) &0xf ; rx_status.freq = freq; - rx_status.band =IEEE80211_BAND_2GHZ ; + rx_status.band = dev->conf.channel->band; rx_status.antenna = hdr->antenna; tsf32 =le32_to_cpu (hdr->tsf32);
drivers/net/wireless/rt2x00/rt2x00crypto.c +2 -2
@@ -56,10 +56,10 @@ unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info)* note that these lengths should only be added when * mac80211 does not generate it. */ - overhead += tx_info->control.icv_len; + overhead += key->icv_len;if (!(key->flags &IEEE80211_KEY_FLAG_GENERATE_IV )) - overhead += tx_info->control.iv_len; + overhead += key->iv_len;if (!(key->flags &IEEE80211_KEY_FLAG_GENERATE_MMIC )) {if (key->alg ==ALG_TKIP )
drivers/net/wireless/rt2x00/rt2x00queue.c +5 -2
@@ -374,7 +374,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX );struct txentry_desc txdesc;struct skb_frame_desc *skbdesc; -unsigned int iv_len =IEEE80211_SKB_CB (skb)->control.iv_len; +unsigned int iv_len;if (unlikely (rt2x00queue_full (queue)))return -EINVAL ;
@@ -410,8 +410,11 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)* the frame so we can provide it to the driver seperately. */ if (test_bit (ENTRY_TXD_ENCRYPT , &txdesc.flags) && - !test_bit (ENTRY_TXD_ENCRYPT_IV , &txdesc.flags)) + !test_bit (ENTRY_TXD_ENCRYPT_IV , &txdesc.flags) && + (IEEE80211_SKB_CB (skb)->control.hw_key !=NULL )) { + iv_len =IEEE80211_SKB_CB (skb)->control.hw_key->iv_len;rt2x00crypto_tx_remove_iv (skb, iv_len); + }/* * It could be possible that the queue was corrupted and this
drivers/net/wireless/rt2x00/rt2x00rfkill.c +7 -2
@@ -145,10 +145,15 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) rt2x00dev->rfkill->name = rt2x00dev->ops->name; rt2x00dev->rfkill->data = rt2x00dev; - rt2x00dev->rfkill->state =-1 ; rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio; -if (test_bit (CONFIG_SUPPORT_HW_BUTTON , &rt2x00dev->flags)) +if (test_bit (CONFIG_SUPPORT_HW_BUTTON , &rt2x00dev->flags)) { rt2x00dev->rfkill->get_state = rt2x00rfkill_get_state; + rt2x00dev->rfkill->state = + rt2x00dev->ops->lib->rfkill_poll (rt2x00dev) ? +RFKILL_STATE_SOFT_BLOCKED :RFKILL_STATE_UNBLOCKED ; + }else { + rt2x00dev->rfkill->state =RFKILL_STATE_UNBLOCKED ; + }INIT_DELAYED_WORK (&rt2x00dev->rfkill_work, rt2x00rfkill_poll);
drivers/net/wireless/rtl8180_dev.c +3 -2
@@ -292,8 +292,8 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 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 = info->control.alt_retry_rate_idx >=0 ? -ieee80211_get_alt_retry_rate (dev, info)->bitrate <<4 :0 ; + entry->flags2 = info->control.retries[0 ].rate_idx >=0 ? +ieee80211_get_alt_retry_rate (dev, info,0 )->bitrate <<4 :0 ; entry->retry_limit = info->control.retry_limit; entry->flags =cpu_to_le32 (tx_flags);__skb_queue_tail (&ring->queue, skb);
@@ -855,6 +855,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev, priv = dev->priv; priv->pdev = pdev; + dev->max_altrates =1 ;SET_IEEE80211_DEV (dev, &pdev->dev);pci_set_drvdata (pdev, dev);
include/net/mac80211.h +27 -6
@@ -292,6 +292,20 @@ enum mac80211_tx_control_flags {#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) +/* maximum number of alternate rate retry stages */ +#define IEEE80211_TX_MAX_ALTRATE 3 + +/** +* struct ieee80211_tx_altrate - alternate rate selection/status +* +* @rate_idx: rate index to attempt to send with +* @limit: number of retries before fallback +*/ +struct ieee80211_tx_altrate { +s8 rate_idx; +u8 limit; +}; +/** * struct ieee80211_tx_info - skb transmit information *
@@ -335,14 +349,14 @@ struct ieee80211_tx_info {struct ieee80211_key_conf *hw_key;struct ieee80211_sta *sta;unsigned long jiffies; -s8 rts_cts_rate_idx, alt_retry_rate_idx; +s8 rts_cts_rate_idx;u8 retry_limit; -u8 icv_len; -u8 iv_len; +struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE ]; } control;struct {u64 ampdu_ack_map;int ack_signal; +struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE +1 ];u8 retry_count;bool excessive_retries;u8 ampdu_ack_len;
@@ -635,6 +649,8 @@ enum ieee80211_key_flags {*/ struct ieee80211_key_conf {enum ieee80211_key_alg alg; +u8 icv_len; +u8 iv_len;u8 hw_key_idx;u8 flags;s8 keyidx;
@@ -828,6 +844,9 @@ enum ieee80211_hw_flags {* within &struct ieee80211_vif. * @sta_data_size: size (in bytes) of the drv_priv data area * within &struct ieee80211_sta. +* +* @max_altrates: maximum number of alternate rate retry stages +* @max_altrate_tries: maximum number of tries for each stage */ struct ieee80211_hw {struct ieee80211_conf conf;
@@ -844,6 +863,8 @@ struct ieee80211_hw {u16 ampdu_queues;u16 max_listen_interval;s8 max_signal; +u8 max_altrates; +u8 max_altrate_tries; };struct ieee80211_hw *wiphy_to_hw (struct wiphy *wiphy);
@@ -900,11 +921,11 @@ ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,static inline struct ieee80211_rate *ieee80211_get_alt_retry_rate (const struct ieee80211_hw *hw, -const struct ieee80211_tx_info *c) +const struct ieee80211_tx_info *c,int idx) { -if (c->control.alt_retry_rate_idx <0 ) +if (c->control.retries[idx].rate_idx <0 )return NULL ; -return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; +return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx]; }/**
net/mac80211/Kconfig +13 -0
@@ -22,6 +22,11 @@ config MAC80211_RC_PID mac80211 that uses a PID controller to select the TX rate. +config MAC80211_RC_MINSTREL + bool "Minstrel" + ---help--- + This option enables the 'minstrel' TX rate control algorithm + choice prompt "Default rate control algorithm" default MAC80211_RC_DEFAULT_PID
@@ -39,11 +44,19 @@ config MAC80211_RC_DEFAULT_PID default rate control algorithm. You should choose this unless you know what you are doing. +config MAC80211_RC_DEFAULT_MINSTREL + bool "Minstrel" + depends on MAC80211_RC_MINSTREL + ---help--- + Select Minstrel as the default rate control algorithm. + + endchoice config MAC80211_RC_DEFAULT string default "pid" if MAC80211_RC_DEFAULT_PID + default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL default "" endmenu
net/mac80211/Makefile +4 -0
@@ -41,4 +41,8 @@ mac80211-$(CONFIG_MAC80211_MESH) += \ rc80211_pid-y := rc80211_pid_algo.o rc80211_pid-$(CONFIG_MAC80211_DEBUGFS) += rc80211_pid_debugfs.o +rc80211_minstrel-y := rc80211_minstrel.o +rc80211_minstrel-$(CONFIG_MAC80211_DEBUGFS) += rc80211_minstrel_debugfs.o + mac80211-$(CONFIG_MAC80211_RC_PID) += $(rc80211_pid-y) +mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
net/mac80211/key.c +14 -0
@@ -281,6 +281,20 @@ struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg, key->conf.alg = alg; key->conf.keyidx = idx; key->conf.keylen = key_len; +switch (alg) { +case ALG_WEP : + key->conf.iv_len =WEP_IV_LEN ; + key->conf.icv_len =WEP_ICV_LEN ; +break ; +case ALG_TKIP : + key->conf.iv_len =TKIP_IV_LEN ; + key->conf.icv_len =TKIP_ICV_LEN ; +break ; +case ALG_CCMP : + key->conf.iv_len =CCMP_HDR_LEN ; + key->conf.icv_len =CCMP_MIC_LEN ; +break ; + }memcpy (key->conf.key, key_data, key_len);INIT_LIST_HEAD (&key->list);INIT_LIST_HEAD (&key->todo);
net/mac80211/main.c +5 -0
@@ -1015,6 +1015,10 @@ static int __init ieee80211_init(void)BUILD_BUG_ON (offsetof(struct ieee80211_tx_info , driver_data) +IEEE80211_TX_INFO_DRIVER_DATA_SIZE >sizeof (skb->cb)); + ret =rc80211_minstrel_init (); +if (ret) +return ret; + ret =rc80211_pid_init ();if (ret)return ret;
@@ -1027,6 +1031,7 @@ static int __init ieee80211_init(void) static void __exit ieee80211_exit(void) {rc80211_pid_exit (); +rc80211_minstrel_exit ();/* * For key todo, it'll be empty by now but the work
net/mac80211/mlme.c +40 -7
60 lines not on this page · raw message
net/mac80211/rate.h +14 -0
@@ -125,4 +125,18 @@ static inline void rc80211_pid_exit(void) }#endif +#ifdef CONFIG_MAC80211_RC_MINSTREL +extern int rc80211_minstrel_init (void ); +extern void rc80211_minstrel_exit (void ); +#else +static inline int rc80211_minstrel_init (void ) +{ +return 0 ; +} +static inline void rc80211_minstrel_exit (void ) +{ +} +#endif + +#endif /* IEEE80211_RATE_H */
net/mac80211/rc80211_minstrel.c new file +583 -0
583 lines not on this page · raw message
net/mac80211/rc80211_minstrel.h new file +85 -0
85 lines not on this page · raw message
net/mac80211/rc80211_minstrel_debugfs.c new file +164 -0
164 lines not on this page · raw message
net/mac80211/tx.c +16 -20
@@ -454,15 +454,16 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)if (unlikely (rsel.probe_idx >=0 )) { info->flags |=IEEE80211_TX_CTL_RATE_CTRL_PROBE ; tx->flags |=IEEE80211_TX_PROBE_LAST_FRAG ; - info->control.alt_retry_rate_idx = tx->rate_idx; + info->control.retries[0 ].rate_idx = tx->rate_idx; + info->control.retries[0 ].limit = tx->local->hw.max_altrate_tries; tx->rate_idx = rsel.probe_idx; - }else - info->control.alt_retry_rate_idx =-1 ; + }else if (info->control.retries[0 ].limit ==0 ) + info->control.retries[0 ].rate_idx =-1 ;if (unlikely (tx->rate_idx <0 ))return TX_DROP ; }else - info->control.alt_retry_rate_idx =-1 ; + info->control.retries[0 ].rate_idx =-1 ;if (tx->sdata->bss_conf.use_cts_prot && (tx->flags &IEEE80211_TX_FRAGMENTED ) && (rsel.nonerp_idx >=0 )) {
@@ -521,7 +522,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)* frames. * TODO: The last fragment could still use multiple retry * rates. */ - info->control.alt_retry_rate_idx =-1 ; + info->control.retries[0 ].rate_idx =-1 ; }/* Use CTS protection for unicast frames sent using extended rates if
@@ -551,7 +552,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)int idx;/* Do not use multiple retry rates when using RTS/CTS */ - info->control.alt_retry_rate_idx =-1 ; + info->control.retries[0 ].rate_idx =-1 ;/* Use min(data rate, max base rate) as CTS/RTS rate */ rate = &sband->bitrates[tx->rate_idx];
@@ -1255,8 +1256,7 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,return 0 ; } -int ieee80211_master_start_xmit (struct sk_buff *skb, -struct net_device *dev) +int ieee80211_master_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct ieee80211_master_priv *mpriv =netdev_priv (dev);struct ieee80211_local *local = mpriv->local;
@@ -1296,20 +1296,16 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,if (ieee80211_vif_is_mesh (&osdata->vif) &&ieee80211_is_data (hdr->frame_control)) { -if (ieee80211_is_data (hdr->frame_control)) { -if (is_multicast_ether_addr (hdr->addr3)) -memcpy (hdr->addr1, hdr->addr3,ETH_ALEN ); -else -if (mesh_nexthop_lookup (skb, osdata)) -return 0 ; -if (memcmp (odev->dev_addr, hdr->addr4,ETH_ALEN ) !=0 ) -IEEE80211_IFSTA_MESH_CTR_INC (&osdata->u.mesh, - fwded_frames); - } +if (is_multicast_ether_addr (hdr->addr3)) +memcpy (hdr->addr1, hdr->addr3,ETH_ALEN ); +else +if (mesh_nexthop_lookup (skb, osdata)) +return 0 ; +if (memcmp (odev->dev_addr, hdr->addr4,ETH_ALEN ) !=0 ) +IEEE80211_IFSTA_MESH_CTR_INC (&osdata->u.mesh, + fwded_frames); }else if (unlikely (osdata->vif.type ==NL80211_IFTYPE_MONITOR )) {struct ieee80211_sub_if_data *sdata; -struct ieee80211_local *local = osdata->local; -struct ieee80211_hdr *hdr;int hdrlen;u16 len_rthdr;
net/mac80211/wep.c +0 -3
@@ -313,9 +313,6 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) {struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb); - info->control.iv_len =WEP_IV_LEN ; - info->control.icv_len =WEP_ICV_LEN ; -if (!(tx->key->flags &KEY_FLAG_UPLOADED_TO_HARDWARE )) {if (ieee80211_wep_encrypt (tx->local, skb, tx->key))return -1 ;
net/mac80211/wpa.c +0 -6
@@ -152,9 +152,6 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)int len, tail;u8 *pos; - info->control.icv_len =TKIP_ICV_LEN ; - info->control.iv_len =TKIP_IV_LEN ; -if ((tx->key->flags &KEY_FLAG_UPLOADED_TO_HARDWARE ) && !(tx->key->conf.flags &IEEE80211_KEY_FLAG_GENERATE_IV )) {/* hwaccel - with no need for preallocated room for IV/ICV */
@@ -374,9 +371,6 @@ static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)u8 *pos, *pn;int i; - info->control.icv_len =CCMP_MIC_LEN ; - info->control.iv_len =CCMP_HDR_LEN ; -if ((tx->key->flags &KEY_FLAG_UPLOADED_TO_HARDWARE ) && !(tx->key->conf.flags &IEEE80211_KEY_FLAG_GENERATE_IV )) {/* hwaccel - with no need for preallocated room for CCMP "
net/rfkill/rfkill.c +2 -3
@@ -125,6 +125,7 @@ static void rfkill_led_trigger_activate(struct led_classdev *led)static void notify_rfkill_state_change (struct rfkill *rfkill) { +rfkill_led_trigger (rfkill, rfkill->state);blocking_notifier_call_chain (&rfkill_notifier_list,RFKILL_STATE_CHANGED , rfkill);
@@ -217,10 +218,8 @@ static int rfkill_toggle_radio(struct rfkill *rfkill, rfkill->state = state; } -if (force || rfkill->state != oldstate) { -rfkill_led_trigger (rfkill, rfkill->state); +if (force || rfkill->state != oldstate)notify_rfkill_state_change (rfkill); - }return retval; }
net/wireless/Kconfig +1 -1
@@ -15,7 +15,7 @@ config NL80211 If unsure, say Y. config WIRELESS_OLD_REGULATORY - bool "Old wireless static regulatory defintions" + bool "Old wireless static regulatory definitions" default n ---help--- This option enables the old static regulatory information
Signature · 2 lines
John W. Linville Linux should be at the core [email protected] of your literate lifestyle.
From: "John W. Linville" <[email protected]>
Date: Mon, 6 Oct 2008 23:00:23 -0400
Quoted 5 lines
Here is the latest round of wireless updates intended for 2.6.28. There are a couple of merge damage fixups, a new rate scaling algorithm for mac80211, and some miscellaneous drivers fixes and such.
Let me know if there are problems!
Applied, thanks John.
I'll push this out to net-next-2.6 after some build testing.