iwlwifi driver 06/12 updates
cover iwlwifi driver 06/12 updates
Hi John,
Here are the iwlwifi updates on 06/12. Please apply.
Thanks,
-yi
[PATCH 01/29] iwlwifi: removing IWL4965_HT config
[PATCH 02/29] iwlwifi: removes the RUN_TIME_CALIB ifdef
[PATCH 03/29] iwlwifi: clean up in setup/cancel deferred work [PATCH 04/29] iwlwifi: add possibility to disable tx_power calibration [PATCH 05/29] iwlwifi: map sw and hw ampdu queues
[PATCH 06/29] iwlwifi: add TX aggregation code for 5000 HW [PATCH 07/29] iwlwifi: use ieee80211_conf to examine rate capabilities [PATCH 08/29] iwlwifi: fix allow iwlwifi to aggregate according to tid load [PATCH 09/29] iwlwifi: remove unused flag
[PATCH 10/29] iwlwifi: remove redundant flags regarding to FAT channel [PATCH 11/29] iwlwifi: fix bug when moving from 11gn to 11a or 11an to 11g [PATCH 12/29] iwlwifi: format log prints for easier parsing [PATCH 13/29] iwlwifi: fix resume SW RF-kill
[PATCH 14/29] iwlwifi: fix resart flow after fw error
[PATCH 15/29] iwlwifi enabling IBSS (Ad-Hoc) mode
[PATCH 16/29] iwlwifi: Fix mode changes (ad-hoc <--> managed) [PATCH 17/29] iwlwifi: refactor tx aggregation response flow [PATCH 18/29] iwlwifi: refactor setting tx power
[PATCH 19/29] iwlwifi: add bad length check for WEP keys
[PATCH 20/29] iwlwifi: move scan to iwl-scan.c iwlcore
[PATCH 21/29] iwlwifi: move rate helpers to iwlcore
[PATCH 22/29] iwlwifi: cleans up scanning code
[PATCH 23/29] iwlwifi: move iwl4965_rf_kill_ct_config to iwl-core.c [PATCH 24/29] iwlwifi: retfactor get_temperature functions [PATCH 25/29] iwlwifi: remove dead code iwl4965_calc_db_from_ratio [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode
[PATCH 27/29] iwlwifi: fix software rf_kill problem when interface is down [PATCH 28/29] iwlwifi: general code clean up
[PATCH 29/29] iwlwifi: remove iwlcore_low_level_notify
PATCH 1/29 iwlwifi: removing IWL4965_HT config
From: Ron Rindjunsky <[email protected]>
This patch removes CONFIG_IWL4965_HT #ifdefs for iwl 4965 and 5000. 11n feature is stable in those drivers and its mode of operation is determined in mac80211, so this dependency is not needed any more.
--- drivers/net/wireless/iwlwifi/Kconfig | 8 --- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 46 +------------------- drivers/net/wireless/iwlwifi/iwl-4965.c | 62 +++++++++------------------ drivers/net/wireless/iwlwifi/iwl-5000.c | 44 +++++++++---------- drivers/net/wireless/iwlwifi/iwl-core.c | 18 -------- drivers/net/wireless/iwlwifi/iwl-core.h | 4 -- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 4 -- drivers/net/wireless/iwlwifi/iwl-dev.h | 14 ------ drivers/net/wireless/iwlwifi/iwl-sta.c | 10 ---- drivers/net/wireless/iwlwifi/iwl-tx.c | 10 ---- drivers/net/wireless/iwlwifi/iwl4965-base.c | 23 +--------- 11 files changed, 43 insertions(+), 200 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +0 -8
@@ -54,14 +54,6 @@ config IWL4965 say M here and read <file:Documentation/kbuild/modules.txt>. The module will be called iwl4965.ko. -config IWL4965_HT - bool "Enable 802.11n HT features in iwl4965 driver" - depends on EXPERIMENTAL - depends on IWL4965 - ---help--- - This option enables IEEE 802.11n High Throughput features - for the iwl4965 driver. - config IWL4965_LEDS bool "Enable LEDS features in iwl4965 driver" depends on IWL4965
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +1 -45
193 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-4965.c +21 -41
146 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-5000.c +20 -24
71 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-core.c +0 -18
@@ -321,7 +321,6 @@ void iwl_reset_qos(struct iwl_priv *priv) }EXPORT_SYMBOL (iwl_reset_qos); -#ifdef CONFIG_IWL4965_HT #define MAX_BIT_RATE_40_MHZ 0x96;/* 150 Mbps */ #define MAX_BIT_RATE_20_MHZ 0x48;/* 72 Mbps */ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,
@@ -374,13 +373,6 @@ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, ht_info->supp_mcs_set[12 ] |= ((tx_chains_num -1 ) <<2 ); } } -#else -static inline void iwlcore_init_ht_hw_capab (const struct iwl_priv *priv, -struct ieee80211_ht_info *ht_info, -enum ieee80211_band band) -{ -} -#endif /* CONFIG_IWL4965_HT */ static void iwlcore_init_hw_rates (struct iwl_priv *priv,struct ieee80211_rate *rates)
@@ -553,7 +545,6 @@ static void iwlcore_free_geos(struct iwl_priv *priv)clear_bit (STATUS_GEO_CONFIGURED , &priv->status); } -#ifdef CONFIG_IWL4965_HT static u8 is_single_rx_stream (struct iwl_priv *priv) { return !priv->current_ht_config.is_ht ||
@@ -660,13 +651,6 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info) }EXPORT_SYMBOL (iwl_set_rxon_ht); -#else -static inline u8 is_single_rx_stream (struct iwl_priv *priv) -{ -return 1 ; -} -#endif /*CONFIG_IWL4965_HT */ -/* * Determine how many receiver/antenna chains to use. * More provides better reception via diversity. Fewer saves power.
@@ -791,10 +775,8 @@ int iwl_setup_mac(struct iwl_priv *priv)IEEE80211_HW_NOISE_DBM ;/* Default value; 4 EDCA QOS priorities */ hw->queues =4 ; -#ifdef CONFIG_IWL4965_HT /* Enhanced value; more queues, to support 11n aggregation */ hw->ampdu_queues =12 ; -#endif /* CONFIG_IWL4965_HT */ hw->conf.beacon_int =100 ;
drivers/net/wireless/iwlwifi/iwl-core.h +0 -4
@@ -111,13 +111,11 @@ struct iwl_lib_ops {void (*txq_inval_byte_cnt_tbl)(struct iwl_priv *priv,struct iwl_tx_queue *txq);void (*txq_set_sched)(struct iwl_priv *priv,u32 mask); -#ifdef CONFIG_IWL4965_HT /* aggregations */ int (*txq_agg_enable)(struct iwl_priv *priv,int txq_id,int tx_fifo,int sta_id,int tid,u16 ssn_idx);int (*txq_agg_disable)(struct iwl_priv *priv,u16 txq_id,u16 ssn_idx,u8 tx_fifo); -#endif /* CONFIG_IWL4965_HT */ /* setup Rx handler */ void (*rx_handler_setup)(struct iwl_priv *priv);/* alive notification after init uCode load */
@@ -233,11 +231,9 @@ void iwl_hw_txq_ctx_free(struct iwl_priv *priv);int iwl_hw_txq_attach_buf_to_tfd (struct iwl_priv *priv,void *tfd,dma_addr_t addr,u16 len);int iwl_txq_update_write_ptr (struct iwl_priv *priv,struct iwl_tx_queue *txq); -#ifdef CONFIG_IWL4965_HT int iwl_tx_agg_start (struct iwl_priv *priv,const u8 *ra,u16 tid,u16 *ssn);int iwl_tx_agg_stop (struct iwl_priv *priv ,const u8 *ra,u16 tid);int iwl_txq_check_empty (struct iwl_priv *priv,int sta_id,u8 tid,int txq_id); -#endif /***************************************************** * S e n d i n g H o s t C o m m a n d s *
drivers/net/wireless/iwlwifi/iwl-debugfs.c +0 -4
@@ -255,21 +255,18 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, pos +=scnprintf (buf + pos, bufsz - pos,"tid data:\n" ); pos +=scnprintf (buf + pos, bufsz - pos,"seq_num\t\ttxq_id" ); -#ifdef CONFIG_IWL4965_HT pos +=scnprintf (buf + pos, bufsz - pos,"\tframe_count\twait_for_ba\t" ); pos +=scnprintf (buf + pos, bufsz - pos,"start_idx\tbitmap0\t" ); pos +=scnprintf (buf + pos, bufsz - pos,"bitmap1\trate_n_flags" ); -#endif pos +=scnprintf (buf + pos, bufsz - pos,"\n" );for (j =0 ; j <MAX_TID_COUNT ; j++) { pos +=scnprintf (buf + pos, bufsz - pos,"[%d]:\t\t%u" , j, station->tid[j].seq_number); -#ifdef CONFIG_IWL4965_HT pos += scnprintf(buf + pos, bufsz - pos, "\t%u\t\t%u\t\t%u\t\t", station->tid[j].agg.txq_id,
@@ -280,7 +277,6 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, station->tid[j].agg.start_idx, (unsigned long long )station->tid[j].agg.bitmap, station->tid[j].agg.rate_n_flags); -#endif pos +=scnprintf (buf + pos, bufsz - pos,"\n" ); } pos +=scnprintf (buf + pos, bufsz - pos,"\n" );
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -14
@@ -401,7 +401,6 @@ struct iwl_rx_queue {#define IWL_INVALID_RATE 0xFF#define IWL_INVALID_VALUE -1 -#ifdef CONFIG_IWL4965_HT /** * struct iwl_ht_agg -- aggregation status while waiting for block-ack * @txq_id: Tx queue used for Tx attempt
@@ -430,14 +429,11 @@ struct iwl_ht_agg {u8 state; }; -#endif /* CONFIG_IWL4965_HT */ struct iwl_tid_data {u16 seq_number;u16 tfds_in_queue; -#ifdef CONFIG_IWL4965_HT struct iwl_ht_agg agg; -#endif /* CONFIG_IWL4965_HT */ };struct iwl_hw_key {
@@ -752,7 +748,6 @@ extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv,u32 rate_n_flags, struct ieee80211_tx_info *info); -#ifdef CONFIG_IWL4965_HT extern void iwl4965_init_ht_hw_capab (const struct iwl_priv *priv,struct ieee80211_ht_info *ht_info,enum ieee80211_band band);
@@ -763,12 +758,7 @@ int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, const u8 *addr, u16 tid, u16 *ssn);int iwl4965_check_empty_hw_queue (struct iwl_priv *priv,int sta_id,u8 tid,int txq_id); -#else -static inline void iwl4965_init_ht_hw_capab (const struct iwl_priv *priv, -struct ieee80211_ht_info *ht_info, -enum ieee80211_band band) {} -#endif /*CONFIG_IWL4965_HT */ /* Structures, enum, and defines specific to the 4965 */ #define IWL_KW_SIZE 0x1000/*4k */
@@ -1073,9 +1063,7 @@ struct iwl_priv {__le16 sensitivity_tbl[HD_TABLE_SIZE ];#endif /*CONFIG_IWLWIFI_RUN_TIME_CALIB*/ -#ifdef CONFIG_IWL4965_HT struct iwl_ht_info current_ht_config; -#endif u8 last_phy_res[100 ];/* Rate scaling data */
@@ -1250,7 +1238,6 @@ static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }#endif -#ifdef CONFIG_IWL4965_HT static inline int iwl_get_ra_sta_id (struct iwl_priv *priv,struct ieee80211_hdr *hdr) {
@@ -1270,7 +1257,6 @@ static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv, txb[idx].skb[0 ]->data;return NULL ; } -#endif static inline int iwl_is_associated (struct iwl_priv *priv)
drivers/net/wireless/iwlwifi/iwl-sta.c +0 -10
@@ -156,8 +156,6 @@ int iwl_send_add_sta(struct iwl_priv *priv, }EXPORT_SYMBOL (iwl_send_add_sta); -#ifdef CONFIG_IWL4965_HT -static void iwl_set_ht_add_station (struct iwl_priv *priv,u8 index,struct ieee80211_ht_info *sta_ht_inf) {
@@ -202,12 +200,6 @@ static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, done:return ; } -#else -static inline void iwl_set_ht_add_station (struct iwl_priv *priv,u8 index, -struct ieee80211_ht_info *sta_ht_info) -{ -} -#endif /** * iwl_add_station_flags - Add station to tables in driver and device
@@ -842,7 +834,6 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap)u8 sta_id;/* Add station to device's station table */ -#ifdef CONFIG_IWL4965_HT struct ieee80211_conf *conf = &priv->hw->conf;struct ieee80211_ht_info *cur_ht_config = &conf->ht_conf;
@@ -852,7 +843,6 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap) sta_id =iwl_add_station_flags (priv, addr, is_ap,0 , cur_ht_config); else -#endif /* CONFIG_IWL4965_HT */ sta_id =iwl_add_station_flags (priv, addr, is_ap,0 ,NULL );
drivers/net/wireless/iwlwifi/iwl-tx.c +0 -10
@@ -36,8 +36,6 @@#include "iwl-io.h" #include "iwl-helpers.h" -#ifdef CONFIG_IWL4965_HT -static const u16 default_tid_to_tx_fifo[] = {IWL_TX_FIFO_AC1 ,IWL_TX_FIFO_AC0 ,
@@ -58,9 +56,6 @@ static const u16 default_tid_to_tx_fifo[] = { IWL_TX_FIFO_AC3 }; -#endif /*CONFIG_IWL4965_HT */ - -/** * iwl_hw_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr]
@@ -848,12 +843,10 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) (hdr->seq_ctrl &__constant_cpu_to_le16 (IEEE80211_SCTL_FRAG )); seq_number +=0x10 ; -#ifdef CONFIG_IWL4965_HT /* aggregation is on for this <sta,tid> */ if (info->flags &IEEE80211_TX_CTL_AMPDU ) txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; priv->stations[sta_id].tid[tid].tfds_in_queue++; -#endif /* CONFIG_IWL4965_HT */ }/* Descriptor for chosen Tx queue */
@@ -1196,8 +1189,6 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) }EXPORT_SYMBOL (iwl_tx_cmd_complete); - -#ifdef CONFIG_IWL4965_HT /* * Find first available (lowest unused) Tx Queue, mark it "active". * Called only when finding queue for aggregation.
@@ -1359,7 +1350,6 @@ int iwl_txq_check_empty(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id)return 0 ; }EXPORT_SYMBOL (iwl_txq_check_empty); -#endif /* CONFIG_IWL4965_HT */ #ifdef CONFIG_IWLWIF_DEBUG #define TX_STATUS_ENTRY (x) case TX_STATUS_FAIL_ ## x: return #x
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -22
@@ -634,7 +634,6 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate,return ret_rates; } -#ifdef CONFIG_IWL4965_HT static void iwl4965_ht_conf (struct iwl_priv *priv,struct ieee80211_bss_conf *bss_conf) {
@@ -707,17 +706,6 @@ static void iwl_ht_cap_to_ie(const struct ieee80211_supported_band *sband, IEEE80211_HT_CAP_AMPDU_DENSITY); *left -=sizeof (struct ieee80211_ht_cap ); } -#else -static inline void iwl4965_ht_conf (struct iwl_priv *priv, -struct ieee80211_bss_conf *bss_conf) -{ -} -static void iwl_ht_cap_to_ie (const struct ieee80211_supported_band *sband, -u8 *pos,int *left) -{ -} -#endif -/** * iwl4965_fill_probe_req - fill in all required fields and IE for probe request
@@ -862,10 +850,8 @@ static void iwl4965_activate_qos(struct iwl_priv *priv, u8 force) priv->qos_data.def_qos_parm.qos_flags |=QOS_PARAM_FLG_UPDATE_EDCA_MSK ; -#ifdef CONFIG_IWL4965_HT if (priv->current_ht_config.is_ht) priv->qos_data.def_qos_parm.qos_flags |=QOS_PARAM_FLG_TGN_MSK ; -#endif /* CONFIG_IWL4965_HT */ spin_unlock_irqrestore (&priv->lock, flags);
@@ -3515,10 +3501,9 @@ static void iwl4965_post_associate(struct iwl_priv *priv) priv->staging_rxon.filter_flags |=RXON_FILTER_ASSOC_MSK ; -#ifdef CONFIG_IWL4965_HT if (priv->current_ht_config.is_ht)iwl_set_rxon_ht (priv, &priv->current_ht_config); -#endif /* CONFIG_IWL4965_HT*/ +iwl_set_rxon_chain (priv); priv->staging_rxon.assoc_id =cpu_to_le16 (priv->assoc_id);
@@ -3854,7 +3839,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *cospin_lock_irqsave (&priv->lock, flags); -#ifdef CONFIG_IWL4965_HT /* if we are switching from ht to 2.4 clear flags * from any ht related info since 2.4 does not * support ht */
@@ -3864,7 +3848,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co#endif ) priv->staging_rxon.flags =0 ; -#endif /* CONFIG_IWL4965_HT */ iwl_set_rxon_channel (priv, conf->channel->band, channel);
@@ -4489,11 +4472,9 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)IWL_DEBUG_MAC80211 ("enter\n" ); priv->lq_mngr.lq_ready =0 ; -#ifdef CONFIG_IWL4965_HT spin_lock_irqsave (&priv->lock, flags);memset (&priv->current_ht_config,0 ,sizeof (struct iwl_ht_info ));spin_unlock_irqrestore (&priv->lock, flags); -#endif /* CONFIG_IWL4965_HT */ iwl_reset_qos (priv);
@@ -5100,9 +5081,7 @@ static struct ieee80211_ops iwl4965_hw_ops = { .reset_tsf = iwl4965_mac_reset_tsf, .beacon_update = iwl4965_mac_beacon_update, .bss_info_changed = iwl4965_bss_info_changed, -#ifdef CONFIG_IWL4965_HT .ampdu_action = iwl4965_mac_ampdu_action, -#endif /* CONFIG_IWL4965_HT */ .hw_scan = iwl4965_mac_hw_scan };
Signature · 1 line
1.5.3.6
PATCH 2/29 iwlwifi: removes the RUN_TIME_CALIB ifdef
From: Emmanuel Grumbach <[email protected]>
This patch removes the possibility not to compile the run time calibrations. It also renames priv->sensitivity_work to priv->run_time_calib_work, and moves bg_run_time_calib to iwl4965_base since it is common to both: 4965 and 5000.
--- drivers/net/wireless/iwlwifi/Kconfig | 28 ------------------- drivers/net/wireless/iwlwifi/Makefile | 3 +- drivers/net/wireless/iwlwifi/iwl-4965.c | 39 +-------------------------- drivers/net/wireless/iwlwifi/iwl-5000.c | 11 ------- drivers/net/wireless/iwlwifi/iwl-calib.c | 2 - drivers/net/wireless/iwlwifi/iwl-calib.h | 20 -------------- drivers/net/wireless/iwlwifi/iwl-core.h | 2 - drivers/net/wireless/iwlwifi/iwl-debug.h | 2 - drivers/net/wireless/iwlwifi/iwl-debugfs.c | 4 --- drivers/net/wireless/iwlwifi/iwl-dev.h | 12 +------- drivers/net/wireless/iwlwifi/iwl-rx.c | 2 - drivers/net/wireless/iwlwifi/iwl4965-base.c | 24 ++++++++++++++++ 12 files changed, 27 insertions(+), 122 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +0 -28
@@ -14,15 +14,6 @@ config IWLWIFI_LEDS bool default n -config IWLWIFI_RUN_TIME_CALIB - bool - depends on IWLCORE - default n - ---help--- - This option will enable run time calibration for the iwlwifi driver. - These calibrations are Sensitivity and Chain Noise. - - config IWLWIFI_RFKILL boolean "IWLWIFI RF kill support" depends on IWLCORE
@@ -68,15 +59,6 @@ config IWL4965_SPECTRUM_MEASUREMENT ---help--- This option will enable spectrum measurement for the iwl4965 driver. -config IWL4965_RUN_TIME_CALIB - bool "Enable run time Calibration for 4965 NIC" - select IWLWIFI_RUN_TIME_CALIB - depends on IWL4965 - default y - ---help--- - This option will enable run time calibration for the iwl4965 driver. - These calibrations are Sensitivity and Chain Noise. If unsure, say yes - config IWLWIFI_DEBUG bool "Enable full debugging output in iwl4965 driver" depends on IWL4965
@@ -110,16 +92,6 @@ config IWL5000 This option enables support for Intel Wireless WiFi Link 5000AGN Family Dependency on 4965 is temporary -config IWL5000_RUN_TIME_CALIB - bool "Enable run time Calibration for 5000 NIC" - select IWLWIFI_RUN_TIME_CALIB - depends on IWL5000 - default y - ---help--- - This option will enable run time calibration for the iwl5000 driver. - These calibrations are Sensitivity and Chain Noise. If unsure, say yes - - config IWLWIFI_DEBUGFS bool "Iwlwifi debugfs support" depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS
drivers/net/wireless/iwlwifi/Makefile +1 -2
@@ -1,10 +1,9 @@ obj-$(CONFIG_IWLCORE) += iwlcore.o -iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o +iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o iwl-calib.o iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o -iwlcore-$(CONFIG_IWLWIFI_RUN_TIME_CALIB) += iwl-calib.o obj-$(CONFIG_IWL3945) += iwl3945.o iwl3945-objs := iwl3945-base.o iwl-3945.o iwl-3945-rs.o
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -38
@@ -652,8 +652,6 @@ void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) cmd.critical_temperature_R); } -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB -/* Reset differential Rx gains in NIC to prepare for chain noise calibration. * Called after every association, but this runs only once! * ... once chain noise is calibrated the first time, it's good forever. */
@@ -741,30 +739,6 @@ static void iwl4965_gain_computation(struct iwl_priv *priv, data->beacon_count =0 ; } -static void iwl4965_bg_sensitivity_work (struct work_struct *work) -{ - struct iwl_priv *priv = container_of(work, struct iwl_priv, - sensitivity_work); - -mutex_lock (&priv->mutex); - -if (test_bit (STATUS_EXIT_PENDING , &priv->status) || -test_bit (STATUS_SCANNING , &priv->status)) { -mutex_unlock (&priv->mutex); -return ; - } - -if (priv->start_calib) { -iwl_chain_noise_calibration (priv, &priv->statistics); - -iwl_sensitivity_calibration (priv, &priv->statistics); - } - -mutex_unlock (&priv->mutex); -return ; -} -#endif /*CONFIG_IWL4965_RUN_TIME_CALIB*/ -static void iwl4965_bg_txpower_work (struct work_struct *work) { struct iwl_priv *priv = container_of(work, struct iwl_priv,
@@ -920,7 +894,6 @@ int iwl4965_alive_notify(struct iwl_priv *priv)return ret; } -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB static struct iwl_sensitivity_ranges iwl4965_sensitivity = { .min_nrg_cck =97 , .max_nrg_cck =0 ,
@@ -943,7 +916,6 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = { .nrg_th_cck = 100, .nrg_th_ofdm = 100, }; -#endif /** * iwl4965_hw_set_hw_params
@@ -983,9 +955,7 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv) priv->hw_params.valid_rx_ant =ANT_A |ANT_B ; priv->hw_params.ct_kill_threshold =CELSIUS_TO_KELVIN (CT_KILL_THRESHOLD ); -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB priv->hw_params.sens = &iwl4965_sensitivity; -#endif return 0 ; }
@@ -2123,9 +2093,7 @@ void iwl4965_hw_rx_statistics(struct iwl_priv *priv,if (unlikely (!test_bit (STATUS_SCANNING , &priv->status)) && (pkt->hdr.cmd ==STATISTICS_NOTIFICATION )) {iwl4965_rx_calc_noise (priv); -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB -queue_work (priv->workqueue, &priv->sensitivity_work); -#endif +queue_work (priv->workqueue, &priv->run_time_calib_work); }iwl_leds_background (priv);
@@ -3504,9 +3472,6 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv)void iwl4965_hw_setup_deferred_work (struct iwl_priv *priv) {INIT_WORK (&priv->txpower_work, iwl4965_bg_txpower_work); -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB -INIT_WORK (&priv->sensitivity_work, iwl4965_bg_sensitivity_work); -#endif init_timer (&priv->statistics_periodic); priv->statistics_periodic.data = (unsigned long )priv; priv->statistics_periodic.function = iwl4965_bg_statistics_periodic;
@@ -3527,10 +3492,8 @@ static struct iwl_hcmd_ops iwl4965_hcmd = {static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { .get_hcmd_size = iwl4965_get_hcmd_size, .build_addsta_hcmd = iwl4965_build_addsta_hcmd, -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB .chain_noise_reset = iwl4965_chain_noise_reset, .gain_computation = iwl4965_gain_computation, -#endif };static struct iwl_lib_ops iwl4965_lib = {
drivers/net/wireless/iwlwifi/iwl-5000.c +0 -11
@@ -300,8 +300,6 @@ err: } -#ifdef CONFIG_IWL5000_RUN_TIME_CALIB - static void iwl5000_gain_computation(struct iwl_priv *priv, u32 average_noise[NUM_RX_CHAINS], u16 min_average_noise_antenna_i,
@@ -354,7 +352,6 @@ static void iwl5000_gain_computation(struct iwl_priv *priv, data->beacon_count =0 ; } -static void iwl5000_chain_noise_reset (struct iwl_priv *priv) {struct iwl_chain_noise_data *data = &priv->chain_noise_data;
@@ -393,10 +390,6 @@ static struct iwl_sensitivity_ranges iwl5000_sensitivity = { .nrg_th_ofdm = 95, }; -#endif /* CONFIG_IWL5000_RUN_TIME_CALIB */ - - -static const u8 *iwl5000_eeprom_query_addr (const struct iwl_priv *priv,size_t offset) {
@@ -847,9 +840,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) priv->hw_params.max_bsm_size =BSM_SRAM_SIZE ; priv->hw_params.fat_channel =BIT (IEEE80211_BAND_2GHZ ) |BIT (IEEE80211_BAND_5GHZ ); -#ifdef CONFIG_IWL5000_RUN_TIME_CALIB priv->hw_params.sens = &iwl5000_sensitivity; -#endif switch (priv->hw_rev &CSR_HW_REV_TYPE_MSK ) {case CSR_HW_REV_TYPE_5100 :
@@ -1309,10 +1300,8 @@ static struct iwl_hcmd_ops iwl5000_hcmd = {static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { .get_hcmd_size = iwl5000_get_hcmd_size, .build_addsta_hcmd = iwl5000_build_addsta_hcmd, -#ifdef CONFIG_IWL5000_RUN_TIME_CALIB .gain_computation = iwl5000_gain_computation, .chain_noise_reset = iwl5000_chain_noise_reset, -#endif };static struct iwl_lib_ops iwl5000_lib = {
drivers/net/wireless/iwlwifi/iwl-calib.c +0 -2
@@ -435,8 +435,6 @@ void iwl_init_sensitivity(struct iwl_priv *priv) data = &(priv->sensitivity_data);if (ranges ==NULL ) -/* can happen if IWLWIFI_RUN_TIME_CALIB is selected -* but no IWLXXXX_RUN_TIME_CALIB for specific is selected */ return ;memset (data,0 ,sizeof (struct iwl_sensitivity_data ));
drivers/net/wireless/iwlwifi/iwl-calib.h +0 -20
@@ -71,7 +71,6 @@#include "iwl-core.h" #include "iwl-dev.h" -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB void iwl_chain_noise_calibration (struct iwl_priv *priv,struct iwl4965_notif_statistics *stat_resp); void iwl_sensitivity_calibration(struct iwl_priv *priv,
@@ -86,24 +85,5 @@ static inline void iwl_chain_noise_reset(struct iwl_priv *priv) priv->cfg->ops->utils->chain_noise_reset) priv->cfg->ops->utils->chain_noise_reset(priv); } -#else -static inline void iwl_chain_noise_calibration (struct iwl_priv *priv, -struct iwl4965_notif_statistics *stat_resp) -{ -} -static inline void iwl_sensitivity_calibration (struct iwl_priv *priv, -struct iwl4965_notif_statistics *resp) -{ -} -static inline void iwl_init_sensitivity (struct iwl_priv *priv) -{ -} -static inline void iwl_chain_noise_reset (struct iwl_priv *priv) -{ -} -static inline void iwl_reset_run_time_calib (struct iwl_priv *priv) -{ -} -#endif #endif /* __iwl_calib_h__ */
drivers/net/wireless/iwlwifi/iwl-core.h +0 -2
@@ -88,13 +88,11 @@ struct iwl_hcmd_ops {struct iwl_hcmd_utils_ops {u16 (*get_hcmd_size)(u8 cmd_id,u16 len);u16 (*build_addsta_hcmd)(const struct iwl_addsta_cmd *cmd,u8 *data); -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB void (*gain_computation)(struct iwl_priv *priv,u32 *average_noise,u16 min_average_noise_antennat_i,u32 min_average_noise);void (*chain_noise_reset)(struct iwl_priv *priv); -#endif };struct iwl_lib_ops {
drivers/net/wireless/iwlwifi/iwl-debug.h +0 -2
@@ -55,10 +55,8 @@ struct iwl_debugfs {struct dentry *file_log_event; } dbgfs_data_files;struct dir_rf_files { -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB struct dentry *file_disable_sensitivity;struct dentry *file_disable_chain_noise; -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ } dbgfs_rf_files;u32 sram_offset;u32 sram_len;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +0 -4
@@ -385,11 +385,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)DEBUGFS_ADD_FILE (stations, data);DEBUGFS_ADD_FILE (rx_statistics, data);DEBUGFS_ADD_FILE (tx_statistics, data); -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB DEBUGFS_ADD_BOOL (disable_sensitivity, rf, &priv->disable_sens_cal);DEBUGFS_ADD_BOOL (disable_chain_noise, rf, &priv->disable_chain_noise_cal); -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ return 0 ; err:
@@ -415,10 +413,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)DEBUGFS_REMOVE (priv->dbgfs->dbgfs_data_files.file_log_event);DEBUGFS_REMOVE (priv->dbgfs->dbgfs_data_files.file_stations);DEBUGFS_REMOVE (priv->dbgfs->dir_data); -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB DEBUGFS_REMOVE (priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);DEBUGFS_REMOVE (priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ DEBUGFS_REMOVE (priv->dbgfs->dir_rf);DEBUGFS_REMOVE (priv->dbgfs->dir_drv);kfree (priv->dbgfs);
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -11
@@ -602,9 +602,7 @@ struct iwl_hw_params {u32 max_data_size;u32 max_bsm_size;u32 ct_kill_threshold;/* value in hw-dependent units */ -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB const struct iwl_sensitivity_ranges *sens; -#endif };#define HT_SHORT_GI_20MHZ (1 << 0)
@@ -882,7 +880,6 @@ enum ucode_type {UCODE_RT }; -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB /* Sensitivity calib data */ struct iwl_sensitivity_data {u32 auto_corr_ofdm;
@@ -924,7 +921,6 @@ struct iwl_chain_noise_data {u8 delta_gain_code[NUM_RX_CHAINS ];u8 radio_write; }; -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ #define EEPROM_SEM_TIMEOUT 10/* milliseconds */ #define EEPROM_SEM_RETRY_LIMIT 1000/* number of attempts (not time) */
@@ -1057,11 +1053,9 @@ struct iwl_priv {u8 assoc_station_added;u8 use_ant_b_for_management_frame;/* Tx antenna selection */ u8 start_calib; -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB struct iwl_sensitivity_data sensitivity_data;struct iwl_chain_noise_data chain_noise_data;__le16 sensitivity_tbl[HD_TABLE_SIZE ]; -#endif /*CONFIG_IWLWIFI_RUN_TIME_CALIB*/ struct iwl_ht_info current_ht_config;u8 last_phy_res[100 ];
@@ -1211,13 +1205,9 @@ struct iwl_priv {#endif /* CONFIG_IWLWIFI_DEBUG */ struct work_struct txpower_work; -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB u32 disable_sens_cal;u32 disable_chain_noise_cal; -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ -#ifdef CONFIG_IWL4965_RUN_TIME_CALIB -struct work_struct sensitivity_work; -#endif /* CONFIG_IWL4965_RUN_TIME_CALIB */ +struct work_struct run_time_calib_work;struct timer_list statistics_periodic; };/*iwl_priv */
drivers/net/wireless/iwlwifi/iwl-rx.c +0 -2
@@ -451,7 +451,6 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) { -#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;struct iwl4965_missed_beacon_notif *missed_beacon;
@@ -465,6 +464,5 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,if (!test_bit (STATUS_SCANNING , &priv->status))iwl_init_sensitivity (priv); } -#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */ }EXPORT_SYMBOL (iwl_rx_missed_beacon_notif);
drivers/net/wireless/iwlwifi/iwl4965-base.c +24 -0
@@ -3423,6 +3423,29 @@ static void iwl4965_bg_request_scan(struct work_struct *data)mutex_unlock (&priv->mutex); } +static void iwl_bg_run_time_calib_work (struct work_struct *work) +{ + struct iwl_priv *priv = container_of(work, struct iwl_priv, + run_time_calib_work); + +mutex_lock (&priv->mutex); + +if (test_bit (STATUS_EXIT_PENDING , &priv->status) || +test_bit (STATUS_SCANNING , &priv->status)) { +mutex_unlock (&priv->mutex); +return ; + } + +if (priv->start_calib) { +iwl_chain_noise_calibration (priv, &priv->statistics); + +iwl_sensitivity_calibration (priv, &priv->statistics); + } + +mutex_unlock (&priv->mutex); +return ; +} +static void iwl4965_bg_up (struct work_struct *data) { struct iwl_priv *priv = container_of(data, struct iwl_priv, up);
@@ -5014,6 +5037,7 @@ static void iwl4965_setup_deferred_work(struct iwl_priv *priv)INIT_WORK (&priv->rf_kill, iwl4965_bg_rf_kill);INIT_WORK (&priv->beacon_update, iwl4965_bg_beacon_update);INIT_WORK (&priv->set_monitor, iwl4965_bg_set_monitor); +INIT_WORK (&priv->run_time_calib_work, iwl_bg_run_time_calib_work);INIT_DELAYED_WORK (&priv->post_associate, iwl4965_bg_post_associate);INIT_DELAYED_WORK (&priv->init_alive_start, iwl_bg_init_alive_start);INIT_DELAYED_WORK (&priv->alive_start, iwl_bg_alive_start);
Signature · 1 line
1.5.3.6
PATCH 3/29 iwlwifi: clean up in setup/cancel deferred work
From: Emmanuel Grumbach <[email protected]>
This patch makes some clean up in setup/cancel_deferred_work. iwl_setup_deferred_work does the work that is common to 4965 and 5000, then it calls to HW specific handlers.
This patch also removes uneeded work_struct from iwl_priv.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 33 +++------------------ drivers/net/wireless/iwlwifi/iwl-core.h | 4 ++ drivers/net/wireless/iwlwifi/iwl-dev.h | 3 -- drivers/net/wireless/iwlwifi/iwl4965-base.c | 41 ++++++++++++++++++++++---- 4 files changed, 43 insertions(+), 38 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +5 -28
@@ -608,26 +608,6 @@ out:#define REG_RECALIB_PERIOD (60) -/** -* iwl4965_bg_statistics_periodic - Timer callback to queue statistics -* -* This callback is provided in order to send a statistics request. -* -* This timer function is continually reset to execute within -* REG_RECALIB_PERIOD seconds since the last STATISTICS_NOTIFICATION -* was received. We need to ensure we receive the statistics in order -* to update the temperature used for calibrating the TXPOWER. -*/ -static void iwl4965_bg_statistics_periodic (unsigned long data) -{ -struct iwl_priv *priv = (struct iwl_priv *)data; - -if (test_bit (STATUS_EXIT_PENDING , &priv->status)) -return ; - -iwl_send_statistics_request (priv,CMD_ASYNC ); -} -void iwl4965_rf_kill_ct_config (struct iwl_priv *priv) {struct iwl4965_ct_kill_config cmd;
@@ -3469,19 +3449,14 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv) priv->rx_handlers[REPLY_COMPRESSED_BA ] = iwl4965_rx_reply_compressed_ba; } -void iwl4965_hw_setup_deferred_work (struct iwl_priv *priv) +static void iwl4965_setup_deferred_work (struct iwl_priv *priv) {INIT_WORK (&priv->txpower_work, iwl4965_bg_txpower_work); -init_timer (&priv->statistics_periodic); - priv->statistics_periodic.data = (unsigned long )priv; - priv->statistics_periodic.function = iwl4965_bg_statistics_periodic; } -void iwl4965_hw_cancel_deferred_work (struct iwl_priv *priv) +static void iwl4965_cancel_deferred_work (struct iwl_priv *priv) { -del_timer_sync (&priv->statistics_periodic); - -cancel_delayed_work (&priv->init_alive_start); +cancel_work_sync (&priv->txpower_work); }
@@ -3506,6 +3481,8 @@ static struct iwl_lib_ops iwl4965_lib = { .txq_agg_enable = iwl4965_txq_agg_enable, .txq_agg_disable = iwl4965_txq_agg_disable, .rx_handler_setup = iwl4965_rx_handler_setup, + .setup_deferred_work = iwl4965_setup_deferred_work, + .cancel_deferred_work = iwl4965_cancel_deferred_work, .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, .alive_notify = iwl4965_alive_notify, .init_alive_start = iwl4965_init_alive_start,
drivers/net/wireless/iwlwifi/iwl-core.h +4 -0
@@ -116,6 +116,10 @@ struct iwl_lib_ops { u8 tx_fifo);/* setup Rx handler */ void (*rx_handler_setup)(struct iwl_priv *priv); +/* setup deferred work */ +void (*setup_deferred_work)(struct iwl_priv *priv); +/* cancel deferred work */ +void (*cancel_deferred_work)(struct iwl_priv *priv);/* alive notification after init uCode load */ void (*init_alive_start)(struct iwl_priv *priv);/* alive notification */
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -3
@@ -1179,9 +1179,6 @@ struct iwl_priv {struct delayed_work init_alive_start;struct delayed_work alive_start; -struct delayed_work activity_timer; -struct delayed_work thermal_periodic; -struct delayed_work gather_stats;struct delayed_work scan_check;struct delayed_work post_associate;
drivers/net/wireless/iwlwifi/iwl4965-base.c +34 -7
89 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 4/29 iwlwifi: add possibility to disable tx_power calibration
From: Emmanuel Grumbach <[email protected]>
This patch adds the possibility to disable the tx_power calibration. In 5000 HW, this calibration is implemented in uCode, hence, it is disabled in driver by default.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 5 +++-- drivers/net/wireless/iwlwifi/iwl-5000.c | 7 +++++++ drivers/net/wireless/iwlwifi/iwl-debug.h | 1 + drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 ++ drivers/net/wireless/iwlwifi/iwl-dev.h | 1 + 5 files changed, 14 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +3 -2
@@ -2103,8 +2103,9 @@ void iwl4965_hw_rx_statistics(struct iwl_priv *priv, priv->temperature = temp;set_bit (STATUS_TEMPERATURE , &priv->status); -if (unlikely (!test_bit (STATUS_SCANNING , &priv->status)) && -iwl4965_is_temp_calib_needed (priv)) +if (!priv->disable_tx_power_cal && +unlikely (!test_bit (STATUS_SCANNING , &priv->status)) && +iwl4965_is_temp_calib_needed (priv))queue_work (priv->workqueue, &priv->txpower_work); }
drivers/net/wireless/iwlwifi/iwl-5000.c +7 -0
@@ -1229,6 +1229,12 @@ static u16 iwl5000_get_hcmd_size(u8 cmd_id, u16 len)return len; } +static void iwl5000_setup_deferred_work (struct iwl_priv *priv) +{ +/* in 5000 the tx power calibration is done in uCode */ + priv->disable_tx_power_cal =1 ; +} +static void iwl5000_rx_handler_setup (struct iwl_priv *priv) {/* init calibration handlers */
@@ -1313,6 +1319,7 @@ static struct iwl_lib_ops iwl5000_lib = { .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl, .txq_set_sched = iwl5000_txq_set_sched, .rx_handler_setup = iwl5000_rx_handler_setup, + .setup_deferred_work = iwl5000_setup_deferred_work, .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr, .load_ucode = iwl5000_load_ucode, .init_alive_start = iwl5000_init_alive_start,
drivers/net/wireless/iwlwifi/iwl-debug.h +1 -0
@@ -57,6 +57,7 @@ struct iwl_debugfs {struct dir_rf_files {struct dentry *file_disable_sensitivity;struct dentry *file_disable_chain_noise; +struct dentry *file_disable_tx_power; } dbgfs_rf_files;u32 sram_offset;u32 sram_len;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +2 -0
@@ -388,6 +388,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)DEBUGFS_ADD_BOOL (disable_sensitivity, rf, &priv->disable_sens_cal);DEBUGFS_ADD_BOOL (disable_chain_noise, rf, &priv->disable_chain_noise_cal); +DEBUGFS_ADD_BOOL (disable_tx_power, rf, &priv->disable_tx_power_cal);return 0 ; err:
@@ -415,6 +416,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)DEBUGFS_REMOVE (priv->dbgfs->dir_data);DEBUGFS_REMOVE (priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);DEBUGFS_REMOVE (priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); +DEBUGFS_REMOVE (priv->dbgfs->dbgfs_rf_files.file_disable_tx_power);DEBUGFS_REMOVE (priv->dbgfs->dir_rf);DEBUGFS_REMOVE (priv->dbgfs->dir_drv);kfree (priv->dbgfs);
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -0
@@ -1204,6 +1204,7 @@ struct iwl_priv {struct work_struct txpower_work;u32 disable_sens_cal;u32 disable_chain_noise_cal; +u32 disable_tx_power_cal;struct work_struct run_time_calib_work;struct timer_list statistics_periodic; };/*iwl_priv */
Signature · 1 line
1.5.3.6
PATCH 5/29 iwlwifi: map sw and hw ampdu queues
From: Ron Rindjunsky <[email protected]>
This patch maps sw and hw queues (for aggregations), so the right mac80211 queue will be waken when ieee80211_wake_queue is invoked.
--- drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 2 +- drivers/net/wireless/iwlwifi/iwl-4965.c | 17 +++++++++-------- drivers/net/wireless/iwlwifi/iwl-5000-hw.h | 2 +- drivers/net/wireless/iwlwifi/iwl-5000.c | 3 ++- drivers/net/wireless/iwlwifi/iwl-dev.h | 2 ++ 5 files changed, 15 insertions(+), 11 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-hw.h +1 -1
@@ -82,7 +82,7 @@*/ #define IWL_CMD_QUEUE_NUM 4#define IWL_CMD_FIFO_NUM 4 -#define IWL_BACK_QUEUE_FIRST_ID 7 +#define IWL49_FIRST_AMPDU_QUEUE 7/* Tx rates */ #define IWL_CCK_RATES 4
drivers/net/wireless/iwlwifi/iwl-4965.c +9 -8
@@ -913,6 +913,7 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv) } priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; + priv->hw_params.first_ampdu_q =IWL49_FIRST_AMPDU_QUEUE ; priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; priv->hw_params.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_params.max_rxq_log =RX_QUEUE_SIZE_LOG ;
@@ -2893,7 +2894,7 @@ static void iwl4965_tx_queue_stop_scheduler(struct iwl_priv *priv, }/** -* txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID +* txq_id must be greater than IWL49_FIRST_AMPDU_QUEUE * priv->lock must be held by the caller */ static int iwl4965_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
@@ -2901,9 +2902,9 @@ static int iwl4965_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, {int ret =0 ; -if (IWL_BACK_QUEUE_FIRST_ID > txq_id) { +if (IWL49_FIRST_AMPDU_QUEUE > txq_id) {IWL_WARNING ("queue number too small: %d, must be > %d\n" , - txq_id,IWL_BACK_QUEUE_FIRST_ID ); + txq_id,IWL49_FIRST_AMPDU_QUEUE );return -EINVAL ; }
@@ -2991,7 +2992,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,if (txq->q.read_ptr != (ba_resp_scd_ssn &0xff )) {/* calculate mac80211 ampdu sw queue to wake */ int ampdu_q = - scd_flow -IWL_BACK_QUEUE_FIRST_ID + priv->hw->queues; + scd_flow - priv->hw_params.first_ampdu_q + priv->hw->queues;int freed =iwl_tx_queue_reclaim (priv, scd_flow, index); priv->stations[ba_resp->sta_id]. tid[ba_resp->tid].tfds_in_queue -= freed;
@@ -3036,7 +3037,7 @@ static int iwl4965_tx_queue_set_q2ratid(struct iwl_priv *priv, u16 ra_tid,/** * iwl4965_tx_queue_agg_enable - Set up & enable aggregation for selected queue * -* NOTE: txq_id must be greater than IWL_BACK_QUEUE_FIRST_ID, +* NOTE: txq_id must be greater than IWL49_FIRST_AMPDU_QUEUE, * i.e. it must be one of the higher queues used for aggregation */ static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id,
@@ -3046,9 +3047,9 @@ static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id,int ret;u16 ra_tid; -if (IWL_BACK_QUEUE_FIRST_ID > txq_id) +if (IWL49_FIRST_AMPDU_QUEUE > txq_id)IWL_WARNING ("queue number too small: %d, must be > %d\n" , - txq_id,IWL_BACK_QUEUE_FIRST_ID ); + txq_id,IWL49_FIRST_AMPDU_QUEUE ); ra_tid =BUILD_RAxTID (sta_id, tid);
@@ -3398,7 +3399,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, txq_id >= 0 && priv->mac80211_registered && agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) {/* calculate mac80211 ampdu sw queue to wake */ - ampdu_q = txq_id -IWL_BACK_QUEUE_FIRST_ID + + ampdu_q = txq_id -IWL49_FIRST_AMPDU_QUEUE + priv->hw->queues;if (agg->state ==IWL_AGG_OFF )ieee80211_wake_queue (priv->hw, txq_id);
drivers/net/wireless/iwlwifi/iwl-5000-hw.h +1 -1
@@ -81,7 +81,7 @@#define IWL50_QUEUE_SIZE 256#define IWL50_CMD_FIFO_NUM 7#define IWL50_NUM_QUEUES 20 -#define IWL50_BACK_QUEUE_FIRST_ID 10 +#define IWL50_FIRST_AMPDU_QUEUE 10#define IWL_sta_id_POS 12#define IWL_sta_id_LEN 4
drivers/net/wireless/iwlwifi/iwl-5000.c +2 -1
@@ -825,6 +825,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) } priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; + priv->hw_params.first_ampdu_q =IWL50_FIRST_AMPDU_QUEUE ; priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto; priv->hw_params.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_params.max_rxq_log =RX_QUEUE_SIZE_LOG ;
@@ -1183,7 +1184,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, txq_id >= 0 && priv->mac80211_registered && agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) {/* calculate mac80211 ampdu sw queue to wake */ - ampdu_q = txq_id -IWL_BACK_QUEUE_FIRST_ID + + ampdu_q = txq_id -IWL50_FIRST_AMPDU_QUEUE + priv->hw->queues;if (agg->state ==IWL_AGG_OFF )ieee80211_wake_queue (priv->hw, txq_id);
drivers/net/wireless/iwlwifi/iwl-dev.h +2 -0
@@ -583,6 +583,7 @@ struct iwl_sensitivity_ranges {* @max_xxx_size: for ucode uses * @ct_kill_threshold: temperature threshold * @struct iwl_sensitivity_ranges: range of sensitivity values +* @first_ampdu_q: first HW queue available for ampdu */ struct iwl_hw_params {u16 max_txq_num;
@@ -603,6 +604,7 @@ struct iwl_hw_params {u32 max_bsm_size;u32 ct_kill_threshold;/* value in hw-dependent units */ const struct iwl_sensitivity_ranges *sens; +u8 first_ampdu_q; };#define HT_SHORT_GI_20MHZ (1 << 0)
Signature · 1 line
1.5.3.6
PATCH 6/29 iwlwifi: add TX aggregation code for 5000 HW
From: Tomas Winkler <[email protected]>
This patch adds TX aggregation handler for 5000 HW.
--- drivers/net/wireless/iwlwifi/iwl-5000.c | 132 +++++++++++++++++++++++++++++++ 1 files changed, 132 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-5000.c +132 -0
@@ -41,6 +41,7 @@#include "iwl-dev.h" #include "iwl-core.h" #include "iwl-io.h" +#include "iwl-sta.h" #include "iwl-helpers.h" #include "iwl-5000-hw.h"
@@ -976,6 +977,135 @@ static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, } } +static int iwl5000_tx_queue_set_q2ratid (struct iwl_priv *priv,u16 ra_tid, +u16 txq_id) +{ +u32 tbl_dw_addr; +u32 tbl_dw; +u16 scd_q2ratid; + + scd_q2ratid = ra_tid &IWL_SCD_QUEUE_RA_TID_MAP_RATID_MSK ; + + tbl_dw_addr = priv->scd_base_addr + +IWL50_SCD_TRANSLATE_TBL_OFFSET_QUEUE (txq_id); + + tbl_dw =iwl_read_targ_mem (priv, tbl_dw_addr); + +if (txq_id &0x1 ) + tbl_dw = (scd_q2ratid <<16 ) | (tbl_dw &0x0000FFFF ); +else + tbl_dw = scd_q2ratid | (tbl_dw &0xFFFF0000 ); + +iwl_write_targ_mem (priv, tbl_dw_addr, tbl_dw); + +return 0 ; +} +static void iwl5000_tx_queue_stop_scheduler (struct iwl_priv *priv,u16 txq_id) +{ +/* Simply stop the queue, but don't change any configuration; +* the SCD_ACT_EN bit is the write-enable mask for the ACTIVE bit. */ +iwl_write_prph (priv, +IWL50_SCD_QUEUE_STATUS_BITS (txq_id), + (0 <<IWL50_SCD_QUEUE_STTS_REG_POS_ACTIVE )| + (1 <<IWL50_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN )); +} + +static int iwl5000_txq_agg_enable (struct iwl_priv *priv,int txq_id, +int tx_fifo,int sta_id,int tid,u16 ssn_idx) +{ +unsigned long flags; +int ret; +u16 ra_tid; + +if (IWL50_FIRST_AMPDU_QUEUE > txq_id) +IWL_WARNING ("queue number too small: %d, must be > %d\n" , + txq_id,IWL50_FIRST_AMPDU_QUEUE ); + + ra_tid =BUILD_RAxTID (sta_id, tid); + +/* Modify device's station table to Tx this TID */ +iwl_sta_modify_enable_tid_tx (priv, sta_id, tid); + +spin_lock_irqsave (&priv->lock, flags); + ret =iwl_grab_nic_access (priv); +if (ret) { +spin_unlock_irqrestore (&priv->lock, flags); +return ret; + } + +/* Stop this Tx queue before configuring it */ +iwl5000_tx_queue_stop_scheduler (priv, txq_id); + +/* Map receiver-address / traffic-ID to this queue */ +iwl5000_tx_queue_set_q2ratid (priv, ra_tid, txq_id); + +/* Set this queue as a chain-building queue */ +iwl_set_bits_prph (priv,IWL50_SCD_QUEUECHAIN_SEL , (1 <<txq_id)); + +/* enable aggregations for the queue */ +iwl_set_bits_prph (priv,IWL50_SCD_AGGR_SEL , (1 <<txq_id)); + +/* Place first TFD at index corresponding to start sequence number. +* Assumes that ssn_idx is valid (!= 0xFFF) */ + priv->txq[txq_id].q.read_ptr = (ssn_idx &0xff ); + priv->txq[txq_id].q.write_ptr = (ssn_idx &0xff ); +iwl5000_set_wr_ptrs (priv, txq_id, ssn_idx); + +/* Set up Tx window size and frame limit for this queue */ +iwl_write_targ_mem (priv, priv->scd_base_addr + +IWL50_SCD_CONTEXT_QUEUE_OFFSET (txq_id) + +sizeof (u32), + ((SCD_WIN_SIZE << +IWL50_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS ) & +IWL50_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK ) | + ((SCD_FRAME_LIMIT << +IWL50_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS ) & +IWL50_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK )); + +iwl_set_bits_prph (priv,IWL50_SCD_INTERRUPT_MASK , (1 << txq_id)); + +/* Set up Status area in SRAM, map to Tx DMA/FIFO, activate the queue */ +iwl5000_tx_queue_set_status (priv, &priv->txq[txq_id], tx_fifo,1 ); + +iwl_release_nic_access (priv); +spin_unlock_irqrestore (&priv->lock, flags); + +return 0 ; +} + +static int iwl5000_txq_agg_disable (struct iwl_priv *priv,u16 txq_id, +u16 ssn_idx,u8 tx_fifo) +{ +int ret; + +if (IWL50_FIRST_AMPDU_QUEUE > txq_id) { +IWL_WARNING ("queue number too small: %d, must be > %d\n" , + txq_id,IWL50_FIRST_AMPDU_QUEUE ); +return -EINVAL ; + } + + ret =iwl_grab_nic_access (priv); +if (ret) +return ret; + +iwl5000_tx_queue_stop_scheduler (priv, txq_id); + +iwl_clear_bits_prph (priv,IWL50_SCD_AGGR_SEL , (1 << txq_id)); + + priv->txq[txq_id].q.read_ptr = (ssn_idx &0xff ); + priv->txq[txq_id].q.write_ptr = (ssn_idx &0xff ); +/* supposes that ssn_idx is valid (!= 0xFFF) */ +iwl5000_set_wr_ptrs (priv, txq_id, ssn_idx); + +iwl_clear_bits_prph (priv,IWL50_SCD_INTERRUPT_MASK , (1 << txq_id)); +iwl_txq_ctx_deactivate (priv, txq_id); +iwl5000_tx_queue_set_status (priv, &priv->txq[txq_id], tx_fifo,0 ); + +iwl_release_nic_access (priv); + +return 0 ; +} +static u16 iwl5000_build_addsta_hcmd (const struct iwl_addsta_cmd *cmd,u8 *data) {u16 size = (u16 )sizeof (struct iwl_addsta_cmd );
@@ -1319,6 +1449,8 @@ static struct iwl_lib_ops iwl5000_lib = { .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl, .txq_set_sched = iwl5000_txq_set_sched, + .txq_agg_enable = iwl5000_txq_agg_enable, + .txq_agg_disable = iwl5000_txq_agg_disable, .rx_handler_setup = iwl5000_rx_handler_setup, .setup_deferred_work = iwl5000_setup_deferred_work, .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
Signature · 1 line
1.5.3.6
PATCH 7/29 iwlwifi: use ieee80211_conf to examine rate capabilities
From: Ron Rindjunsky <[email protected]>
This patch switches the use of internal iwlwifi structure with ieee80211_conf in order to examine ht rate capabilities.
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +6 -12
@@ -2245,25 +2245,19 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,* active_siso_rate mask includes 9 MBits (bit 5), and CCK (bits 0-3), * supp_rates[] does not; shift to convert format, force 9 MBits off. */ - lq_sta->active_siso_rate = - priv->current_ht_config.supp_mcs_set[0 ] <<1 ; - lq_sta->active_siso_rate |= - priv->current_ht_config.supp_mcs_set[0 ] &0x1 ; + lq_sta->active_siso_rate = conf->ht_conf.supp_mcs_set[0 ] <<1 ; + lq_sta->active_siso_rate |= conf->ht_conf.supp_mcs_set[0 ] &0x1 ; lq_sta->active_siso_rate &= ~((u16 )0x2 ); lq_sta->active_siso_rate <<=IWL_FIRST_OFDM_RATE ;/* Same here */ - lq_sta->active_mimo2_rate = - priv->current_ht_config.supp_mcs_set[1 ] <<1 ; - lq_sta->active_mimo2_rate |= - priv->current_ht_config.supp_mcs_set[1 ] &0x1 ; + lq_sta->active_mimo2_rate = conf->ht_conf.supp_mcs_set[1 ] <<1 ; + lq_sta->active_mimo2_rate |= conf->ht_conf.supp_mcs_set[1 ] &0x1 ; lq_sta->active_mimo2_rate &= ~((u16 )0x2 ); lq_sta->active_mimo2_rate <<=IWL_FIRST_OFDM_RATE ; - lq_sta->active_mimo3_rate = - priv->current_ht_config.supp_mcs_set[2 ] <<1 ; - lq_sta->active_mimo3_rate |= - priv->current_ht_config.supp_mcs_set[2 ] &0x1 ; + lq_sta->active_mimo3_rate = conf->ht_conf.supp_mcs_set[2 ] <<1 ; + lq_sta->active_mimo3_rate |= conf->ht_conf.supp_mcs_set[2 ] &0x1 ; lq_sta->active_mimo3_rate &= ~((u16 )0x2 ); lq_sta->active_mimo3_rate <<=IWL_FIRST_OFDM_RATE ;
Signature · 1 line
1.5.3.6
PATCH 8/29 iwlwifi: fix allow iwlwifi to aggregate according to tid load
From: Ron Rindjunsky <[email protected]>
This fix opens back the aggregation decision path for iwlwifi.
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +8 -5
@@ -273,8 +273,8 @@ static void rs_tl_rm_old_stats(struct iwl4965_traffic_load *tl, u32 curr_time)* increment traffic load value for tid and also remove * any old values if passed the certain time period */ -static void rs_tl_add_packet (struct iwl4965_lq_sta *lq_data, -struct ieee80211_hdr *hdr) +static u8 rs_tl_add_packet (struct iwl4965_lq_sta *lq_data, +struct ieee80211_hdr *hdr) {u32 curr_time =jiffies_to_msecs (jiffies);u32 time_diff;
@@ -287,7 +287,7 @@ static void rs_tl_add_packet(struct iwl4965_lq_sta *lq_data,u8 *qc =ieee80211_get_qos_ctrl (hdr,ieee80211_get_hdrlen (fc)); tid = qc[0 ] &0xf ; }else -return ; +return MAX_TID_COUNT ; tl = &lq_data->load[tid];
@@ -300,7 +300,7 @@ static void rs_tl_add_packet(struct iwl4965_lq_sta *lq_data, tl->queue_count =1 ; tl->head =0 ; tl->packet_count[0 ] =1 ; -return ; +return MAX_TID_COUNT ; } time_diff =TIME_WRAP_AROUND (tl->time_stamp, curr_time);
@@ -317,6 +317,8 @@ static void rs_tl_add_packet(struct iwl4965_lq_sta *lq_data,if ((index +1 ) > tl->queue_count) tl->queue_count = index +1 ; + +return tid; }/*
@@ -1680,7 +1682,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, } lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; -rs_tl_add_packet (lq_sta, hdr); + tid =rs_tl_add_packet (lq_sta, hdr); +/* * Select rate-scale / modulation-mode table to work with in * the rest of this function: "search" if searching for better
Signature · 1 line
1.5.3.6
PATCH 9/29 iwlwifi: remove unused flag
From: Tomas Winkler <[email protected]>
This patch removes IEEE80211_CHAN_W_RADAR_DETECT flag.
--- drivers/net/wireless/iwlwifi/iwl-helpers.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-helpers.h +0 -2
@@ -139,8 +139,6 @@ static inline void iwl_set_bits16(__le16 *dst, u8 pos, u8 len, int val)#define IWL_MASK (lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo)))) -#define IEEE80211_CHAN_W_RADAR_DETECT 0x00000010 -static inline struct ieee80211_conf *ieee80211_get_hw_conf (struct ieee80211_hw *hw) {
Signature · 1 line
1.5.3.6
PATCH 10/29 iwlwifi: remove redundant flags regarding to FAT channel
From: Emmanuel Grumbach <[email protected]>
This patch removes redundant flags regarding to FAT channel. Use mac80211's flag instead.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 42 ++++++++------------------ drivers/net/wireless/iwlwifi/iwl-dev.h | 14 --------- drivers/net/wireless/iwlwifi/iwl-eeprom.c | 19 ++++++++---- drivers/net/wireless/iwlwifi/iwl4965-base.c | 6 ++- include/linux/ieee80211.h | 1 + 5 files changed, 31 insertions(+), 51 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +13 -29
@@ -478,24 +478,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv)if (ch->flags &EEPROM_CHANNEL_RADAR ) geo_ch->flags |=IEEE80211_CHAN_RADAR ; -switch (ch->fat_extension_channel) { -case HT_IE_EXT_CHANNEL_ABOVE : -/* only above is allowed, disable below */ - geo_ch->flags |=IEEE80211_CHAN_NO_FAT_BELOW ; -break ; -case HT_IE_EXT_CHANNEL_BELOW : -/* only below is allowed, disable above */ - geo_ch->flags |=IEEE80211_CHAN_NO_FAT_ABOVE ; -break ; -case HT_IE_EXT_CHANNEL_NONE : -/* fat not allowed: disable both*/ - geo_ch->flags |= (IEEE80211_CHAN_NO_FAT_ABOVE | -IEEE80211_CHAN_NO_FAT_BELOW ); -break ; -case HT_IE_EXT_CHANNEL_MAX : -/* both above and below are permitted */ -break ; - } + geo_ch->flags |= ch->fat_extension_channel;if (ch->max_power_avg > priv->max_channel_txpower_limit) priv->max_channel_txpower_limit =
@@ -507,7 +490,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv)/* Save flags for reg domain usage */ geo_ch->orig_flags = geo_ch->flags; - IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0%X\n", + IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0x%X\n", ch->channel, geo_ch->center_freq, is_channel_a_band(ch) ? "5.2" : "2.4", geo_ch->flags & IEEE80211_CHAN_DISABLED ?
@@ -552,6 +535,7 @@ static u8 is_single_rx_stream(struct iwl_priv *priv) (priv->current_ht_config.supp_mcs_set[2] == 0)) || priv->ps_mode ==IWL_MIMO_PS_STATIC ; } +static u8 iwl_is_channel_extension (struct iwl_priv *priv,enum ieee80211_band band,u16 channel,u8 extension_chan_offset)
@@ -562,12 +546,12 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv,if (!is_channel_valid (ch_info))return 0 ; -if (extension_chan_offset ==IWL_EXT_CHANNEL_OFFSET_NONE ) -return 0 ; - -if ((ch_info->fat_extension_channel == extension_chan_offset) || - (ch_info->fat_extension_channel ==HT_IE_EXT_CHANNEL_MAX )) -return 1 ; +if (extension_chan_offset ==IEEE80211_HT_IE_CHA_SEC_ABOVE ) +return !(ch_info->fat_extension_channel & +IEEE80211_CHAN_NO_FAT_ABOVE ); +else if (extension_chan_offset ==IEEE80211_HT_IE_CHA_SEC_BELOW ) +return !(ch_info->fat_extension_channel & +IEEE80211_CHAN_NO_FAT_BELOW );return 0 ; }
@@ -579,7 +563,7 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,if ((!iwl_ht_conf->is_ht) || (iwl_ht_conf->supported_chan_width !=IWL_CHANNEL_WIDTH_40MHZ ) || - (iwl_ht_conf->extension_chan_offset ==IWL_EXT_CHANNEL_OFFSET_NONE )) + (iwl_ht_conf->extension_chan_offset ==IEEE80211_HT_IE_CHA_SEC_NONE ))return 0 ;if (sta_ht_inf) {
@@ -619,13 +603,13 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)/* Note: control channel is opposite of extension channel */ switch (ht_info->extension_chan_offset) { -case IWL_EXT_CHANNEL_OFFSET_ABOVE : +case IEEE80211_HT_IE_CHA_SEC_ABOVE : rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK );break ; -case IWL_EXT_CHANNEL_OFFSET_BELOW : +case IEEE80211_HT_IE_CHA_SEC_BELOW : rxon->flags |=RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK ;break ; -case IWL_EXT_CHANNEL_OFFSET_NONE : +case IEEE80211_HT_IE_CHA_SEC_NONE :default : rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK ;break ;
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -14
@@ -179,15 +179,6 @@ struct iwl4965_scan_power_info {s8 requested_power;/* scan pwr (dBm) requested for chnl/rate */ }; -/* For fat_extension_channel */ -enum { -HT_IE_EXT_CHANNEL_NONE =0 , -HT_IE_EXT_CHANNEL_ABOVE , -HT_IE_EXT_CHANNEL_INVALID , -HT_IE_EXT_CHANNEL_BELOW , -HT_IE_EXT_CHANNEL_MAX -}; -/* * One for each channel, holds all channel setup data * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
@@ -782,11 +773,6 @@ struct iwl_kw {#define IWL_OPERATION_MODE_MIXED 2#define IWL_OPERATION_MODE_20MHZ 3 -#define IWL_EXT_CHANNEL_OFFSET_NONE 0 -#define IWL_EXT_CHANNEL_OFFSET_ABOVE 1 -#define IWL_EXT_CHANNEL_OFFSET_RESERVE1 2 -#define IWL_EXT_CHANNEL_OFFSET_BELOW 3 -#define IWL_TX_CRC_SIZE 4#define IWL_TX_DELIMITER_SIZE 4
drivers/net/wireless/iwlwifi/iwl-eeprom.c +13 -6
@@ -470,6 +470,11 @@ int iwl_init_channel_map(struct iwl_priv *priv)/* Copy the run-time flags so they are there even on * invalid channels */ ch_info->flags = eeprom_ch_info[ch].flags; +/* First write that fat is not enabled, and then enable +* one by one */ + ch_info->fat_extension_channel = + (IEEE80211_CHAN_NO_FAT_ABOVE | +IEEE80211_CHAN_NO_FAT_BELOW );if (!(is_channel_valid (ch_info))) { IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - "
@@ -534,12 +539,14 @@ int iwl_init_channel_map(struct iwl_priv *priv)for (ch =0 ; ch < eeprom_ch_count; ch++) {if ((band ==6 ) && - ((eeprom_ch_index[ch] ==5 ) || - (eeprom_ch_index[ch] ==6 ) || - (eeprom_ch_index[ch] ==7 ))) - fat_extension_chan =HT_IE_EXT_CHANNEL_MAX ; + ((eeprom_ch_index[ch] ==5 ) || + (eeprom_ch_index[ch] ==6 ) || + (eeprom_ch_index[ch] ==7 ))) +/* both are allowed: above and below */ + fat_extension_chan =0 ;else - fat_extension_chan =HT_IE_EXT_CHANNEL_ABOVE ; + fat_extension_chan = +IEEE80211_CHAN_NO_FAT_BELOW ;/* Set up driver's info for lower half */ iwl_set_fat_chan_info(priv, ieeeband,
@@ -551,7 +558,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)iwl_set_fat_chan_info (priv, ieeeband, (eeprom_ch_index[ch] +4 ), &(eeprom_ch_info[ch]), -HT_IE_EXT_CHANNEL_BELOW ); +IEEE80211_CHAN_NO_FAT_ABOVE ); } }
drivers/net/wireless/iwlwifi/iwl4965-base.c +4 -2
@@ -664,9 +664,11 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, iwl_conf->extension_chan_offset = ht_bss_conf->bss_cap &IEEE80211_HT_IE_CHA_SEC_OFFSET ;/* If no above or below channel supplied disable FAT channel */ -if (iwl_conf->extension_chan_offset !=IWL_EXT_CHANNEL_OFFSET_ABOVE && - iwl_conf->extension_chan_offset !=IWL_EXT_CHANNEL_OFFSET_BELOW ) +if (iwl_conf->extension_chan_offset !=IEEE80211_HT_IE_CHA_SEC_ABOVE && + iwl_conf->extension_chan_offset !=IEEE80211_HT_IE_CHA_SEC_BELOW ) { + iwl_conf->extension_chan_offset =IEEE80211_HT_IE_CHA_SEC_NONE ; iwl_conf->supported_chan_width =0 ; + } iwl_conf->tx_mimo_ps_mode = (u8)((ht_conf->cap &IEEE80211_HT_CAP_MIMO_PS ) >>2 );
include/linux/ieee80211.h +1 -0
@@ -320,6 +320,7 @@ struct ieee80211_ht_addt_info {#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10/* 802.11n HT IE masks */ #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 +#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03#define IEEE80211_HT_IE_CHA_WIDTH 0x04
Signature · 1 line
1.5.3.6
PATCH 11/29 iwlwifi: fix bug when moving from 11gn to 11a or 11an to 11g
From: Emmanuel Grumbach <[email protected]>
It is wrong to set the rxon channel according to the ht-channel in case there is a mismatch (e.g. when there is no ht).
--- drivers/net/wireless/iwlwifi/iwl-core.c | 1 - drivers/net/wireless/iwlwifi/iwl-dev.h | 2 -- 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +0 -1
@@ -597,7 +597,6 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)IWL_DEBUG_ASSOC ("control diff than current %d %d\n" ,le16_to_cpu (rxon->channel), ht_info->control_channel); - rxon->channel =cpu_to_le16 (ht_info->control_channel);return ; }
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -2
@@ -742,8 +742,6 @@ extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv,extern void iwl4965_init_ht_hw_capab (const struct iwl_priv *priv,struct ieee80211_ht_info *ht_info,enum ieee80211_band band); -void iwl4965_set_rxon_ht (struct iwl_priv *priv, -struct iwl_ht_info *ht_info);int iwl4965_mac_ampdu_action (struct ieee80211_hw *hw,enum ieee80211_ampdu_mlme_action action,const u8 *addr,u16 tid,u16 *ssn);
Signature · 1 line
1.5.3.6
PATCH 12/29 iwlwifi: format log prints for easier parsing
From: Tomas Winkler <[email protected]>
This patch changes uCode log print to for easier parsing.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +6 -4
@@ -1169,12 +1169,14 @@ void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, ptr +=sizeof (u32); time =iwl_read_targ_mem (priv, ptr); ptr +=sizeof (u32); -if (mode ==0 ) -IWL_ERROR ("0x%08x\t%04u\n" , time, ev);/* data, ev */ -else { +if (mode ==0 ) { +/* data, ev */ +IWL_ERROR ("EVT_LOG:0x%08x:%04u\n" , time, ev); + }else { data =iwl_read_targ_mem (priv, ptr); ptr +=sizeof (u32); -IWL_ERROR ("%010u\t0x%08x\t%04u\n" , time, data, ev); +IWL_ERROR ("EVT_LOGT:%010u:0x%08x:%04u\n" , + time, data, ev); } } }
Signature · 1 line
1.5.3.6
PATCH 13/29 iwlwifi: fix resume SW RF-kill
From: Mohamed Abbas <[email protected]>
This patch fixes SW RF-kill. If we resumed from S3 state with SW RF-kill set, the driver wouldn't be able to remove SW RF-kill. This patch fixes this.
--- drivers/net/wireless/iwlwifi/iwl-core.h | 2 +- drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +- drivers/net/wireless/iwlwifi/iwl4965-base.c | 31 +++++++++++++-------------- 3 files changed, 17 insertions(+), 18 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +1 -1
@@ -129,7 +129,7 @@ struct iwl_lib_ops {/* 1st ucode load */ int (*load_ucode)(struct iwl_priv *priv);/* rfkill */ -void (*radio_kill_sw)(struct iwl_priv *priv,int disable_radio); +int (*radio_kill_sw)(struct iwl_priv *priv,int disable_radio);/* power management */ struct {int (*init)(struct iwl_priv *priv);
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -1
@@ -725,7 +725,7 @@ static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)struct iwl_priv ; -extern void iwl4965_radio_kill_sw (struct iwl_priv *priv,int disable_radio); +extern int iwl4965_radio_kill_sw (struct iwl_priv *priv,int disable_radio);/* * Forward declare iwl-4965.c functions for iwl-base.c */
drivers/net/wireless/iwlwifi/iwl4965-base.c +15 -16
@@ -1260,12 +1260,12 @@ static void iwl4965_set_rate(struct iwl_priv *priv) (IWL_OFDM_BASIC_RATES_MASK >>IWL_FIRST_OFDM_RATE ) &0xFF ; } -void iwl4965_radio_kill_sw (struct iwl_priv *priv,int disable_radio) +int iwl4965_radio_kill_sw (struct iwl_priv *priv,int disable_radio) {unsigned long flags;if (!!disable_radio ==test_bit (STATUS_RF_KILL_SW , &priv->status)) -return ; +return 0 ;IWL_DEBUG_RF_KILL ("Manual SW RF KILL set to: RADIO %s\n" , disable_radio ?"OFF" :"ON" );
@@ -1290,7 +1290,7 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)if (priv->mac80211_registered)ieee80211_stop_queues (priv->hw); } -return ; +return 0 ; }spin_lock_irqsave (&priv->lock, flags);
@@ -1311,11 +1311,11 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)if (test_bit (STATUS_RF_KILL_HW , &priv->status)) {IWL_DEBUG_RF_KILL ("Can not turn radio back on - " "disabled by HW switch\n" ); -return ; +return 0 ; }queue_work (priv->workqueue, &priv->restart); -return ; +return 1 ; }#define IWL_PACKET_RETRY_TIME HZ
@@ -3028,13 +3028,6 @@ static int __iwl4965_up(struct iwl_priv *priv)return -EIO ; } -if (test_bit (STATUS_RF_KILL_SW , &priv->status)) { -IWL_WARNING ("Radio disabled by SW RF kill (module " -"parameter)\n" ); -iwl_rfkill_set_hw_state (priv); -return -ENODEV ; - } -if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {IWL_ERROR ("ucode not available for device bringup\n" );return -EIO ;
@@ -3088,7 +3081,8 @@ static int __iwl4965_up(struct iwl_priv *priv) priv->ucode_data.len);/* We return success when we resume from suspend and rf_kill is on. */ -if (test_bit (STATUS_RF_KILL_HW , &priv->status)) +if (test_bit (STATUS_RF_KILL_HW , &priv->status) || +test_bit (STATUS_RF_KILL_SW , &priv->status))return 0 ;for (i =0 ; i <MAX_HW_RESTARTS ; i++) {
@@ -3115,6 +3109,7 @@ static int __iwl4965_up(struct iwl_priv *priv)set_bit (STATUS_EXIT_PENDING , &priv->status);__iwl4965_down (priv); +clear_bit (STATUS_EXIT_PENDING , &priv->status);/* tried to restart and config the device for as long as our * patience could withstand */
@@ -3860,6 +3855,13 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co priv->add_radiotap = !!(conf->flags &IEEE80211_CONF_RADIOTAP ); + +if (priv->cfg->ops->lib->radio_kill_sw && + priv->cfg->ops->lib->radio_kill_sw (priv, !conf->radio_enabled)) { +IWL_DEBUG_MAC80211 ("leave - RF-KILL - waiting for uCode\n" ); +mutex_unlock (&priv->mutex); + } +if (!iwl_is_ready (priv)) {IWL_DEBUG_MAC80211 ("leave - not ready\n" ); ret = -EIO ;
@@ -3912,9 +3914,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co }#endif -if (priv->cfg->ops->lib->radio_kill_sw) - priv->cfg->ops->lib->radio_kill_sw (priv, !conf->radio_enabled); -if (!conf->radio_enabled) {IWL_DEBUG_MAC80211 ("leave - radio disabled\n" ); goto out;
Signature · 1 line
1.5.3.6
PATCH 14/29 iwlwifi: fix resart flow after fw error
From: Emmanuel Grumbach <[email protected]>
Clear STATUS_FW_ERROR in the _up_ flow before reseting NIC. UP flow will otherwise call restart again causing endless restart loop.
--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl4965-base.c +3 -3
@@ -2857,9 +2857,6 @@ static void iwl_alive_start(struct iwl_priv *priv)/* After the ALIVE response, we can send host commands to 4965 uCode */ set_bit (STATUS_ALIVE , &priv->status); -/* Clear out the uCode error bit if it is set */ -clear_bit (STATUS_FW_ERROR , &priv->status); -if (iwl_is_rfkill (priv))return ;
@@ -3099,6 +3096,9 @@ static int __iwl4965_up(struct iwl_priv *priv)continue ; } +/* Clear out the uCode error bit if it is set */ +clear_bit (STATUS_FW_ERROR , &priv->status); +/* start card; "initialize" will load runtime ucode */ iwl4965_nic_start (priv);
Signature · 1 line
1.5.3.6
PATCH 15/29 iwlwifi enabling IBSS (Ad-Hoc) mode
From: Assaf Krauss <[email protected]>
This patch enables ibss mode. It consists of two changes upon entering ibss mode:
1. Removing the redundant line which clears the driver's station table. This line creates a discrepancy between the driver and the FW's station table. This prevented the generation of beacons.
2. Assigning a default value to priv's assoc_id. Normally given by an AP in STA mode, this field is used as an indication for association. Being 0, it prevented normal TX flow.
3. Remove a redundant ADD_STA command that cause uCode error.
4. Delay the set_mode until after the uCode is ready.
--- drivers/net/wireless/iwlwifi/iwl-core.h | 1 + drivers/net/wireless/iwlwifi/iwl4965-base.c | 30 +++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +1 -0
@@ -284,6 +284,7 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv);#define STATUS_POWER_PMI 16#define STATUS_FW_ERROR 17#define STATUS_CONF_PENDING 18 +#define STATUS_MODE_PENDING 19static inline int iwl_is_ready (struct iwl_priv *priv)
drivers/net/wireless/iwlwifi/iwl4965-base.c +19 -11
@@ -2900,6 +2900,10 @@ static void iwl_alive_start(struct iwl_priv *priv)iwlcore_low_level_notify (priv,IWLCORE_START_EVT );ieee80211_notify_mac (priv->hw,IEEE80211_NOTIFY_RE_ASSOC ); + +if (test_and_clear_bit (STATUS_MODE_PENDING , &priv->status)) +iwl4965_set_mode (priv, priv->iw_mode); +return ; restart:
@@ -3189,16 +3193,20 @@ static void iwl4965_bg_set_monitor(struct work_struct *work) {struct iwl_priv *priv =container_of (work, struct iwl_priv, set_monitor); +int ret;IWL_DEBUG (IWL_DL_STATE ,"setting monitor mode\n" );mutex_lock (&priv->mutex); -if (!iwl_is_ready (priv)) -IWL_DEBUG (IWL_DL_STATE ,"leave - not ready\n" ); -else -if (iwl4965_set_mode (priv,IEEE80211_IF_TYPE_MNTR ) !=0 ) -IWL_ERROR ("iwl4965_set_mode() failed\n" ); + ret =iwl4965_set_mode (priv,IEEE80211_IF_TYPE_MNTR ); + +if (ret) { +if (ret == -EAGAIN ) +IWL_DEBUG (IWL_DL_STATE ,"leave - not ready\n" ); +else +IWL_ERROR ("iwl4965_set_mode() failed ret = %d\n" , ret); + }mutex_unlock (&priv->mutex); }
@@ -3575,10 +3583,9 @@ static void iwl4965_post_associate(struct iwl_priv *priv)case IEEE80211_IF_TYPE_IBSS : -/* clear out the station table */ -iwlcore_clear_stations_table (priv); +/* assume default assoc id */ + priv->assoc_id =1 ; -iwl_rxon_add_station (priv, iwl_bcast_addr,0 );iwl_rxon_add_station (priv, priv->bssid,0 );iwl4965_rate_scale_init (priv->hw,IWL_STA_ID );iwl4965_send_beacon_cmd (priv);
@@ -3826,8 +3833,9 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,memcpy (priv->mac_addr, conf->mac_addr,ETH_ALEN ); } -if (iwl_is_ready (priv)) -iwl4965_set_mode (priv, conf->type); +if (iwl4965_set_mode (priv, conf->type) == -EAGAIN ) +/* we are not ready, will run again when ready */ +set_bit (STATUS_MODE_PENDING , &priv->status);mutex_unlock (&priv->mutex);
@@ -4608,7 +4616,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skiwl_reset_qos (priv); -queue_work (priv->workqueue, &priv->post_associate.work); +iwl4965_post_associate (priv);mutex_unlock (&priv->mutex);
Signature · 1 line
1.5.3.6
PATCH 16/29 iwlwifi: Fix mode changes (ad-hoc <--> managed)
From: Assaf Krauss <[email protected]>
This fix allows to move between modes (ad-hoc to managed, and vice versa). Since mode changes can only be done while driver is down, check for ibss support can only be made when the channel is set (afte the driver goes up).
--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-)
drivers/net/wireless/iwlwifi/iwl4965-base.c +11 -14
@@ -1176,22 +1176,11 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)static int iwl4965_set_mode (struct iwl_priv *priv,int mode) { -if (mode ==IEEE80211_IF_TYPE_IBSS ) { -const struct iwl_channel_info *ch_info; - - ch_info =iwl_get_channel_info (priv, - priv->band, -le16_to_cpu (priv->staging_rxon.channel)); - -if (!ch_info || !is_channel_ibss (ch_info)) { -IWL_ERROR ("channel %d not IBSS channel\n" , -le16_to_cpu (priv->staging_rxon.channel)); -return -EINVAL ; - } - } - priv->iw_mode = mode; +/* init channel/phymode to values given at driver init */ +iwl_set_rxon_channel (priv,IEEE80211_BAND_2GHZ ,6 ); +iwl4965_connection_init_rx_config (priv);memcpy (priv->staging_rxon.node_addr, priv->mac_addr,ETH_ALEN );
@@ -3892,6 +3881,14 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co goto out; } +if (priv->iw_mode ==IEEE80211_IF_TYPE_IBSS && + !is_channel_ibss (ch_info)) { +IWL_ERROR ("channel %d in band %d not IBSS channel\n" , + conf->channel->hw_value, conf->channel->band); + ret = -EINVAL ; + goto out; + } +spin_lock_irqsave (&priv->lock, flags);/* if we are switching from ht to 2.4 clear flags
Signature · 1 line
1.5.3.6
PATCH 17/29 iwlwifi: refactor tx aggregation response flow
From: Tomas Winkler <[email protected]>
This patch refactors tx aggregation respnse flow
and fixes bug revealed by tx_info to cb patch
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 23 ++++++++--------------- drivers/net/wireless/iwlwifi/iwl-5000.c | 17 ++++++----------- drivers/net/wireless/iwlwifi/iwl-commands.h | 19 ++++--------------- drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +- 4 files changed, 19 insertions(+), 42 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +8 -15
@@ -3204,10 +3204,7 @@ static u16 iwl4965_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)static inline u32 iwl4965_get_scd_ssn (struct iwl4965_tx_resp *tx_resp) { -__le32 *scd_ssn = (__le32 *)((u32 *)&tx_resp->status + - tx_resp->frame_count); -return le32_to_cpu (*scd_ssn) &MAX_SN ; - +return le32_to_cpup (&tx_resp->u.status + tx_resp->frame_count) &MAX_SN ; }/**
@@ -3215,15 +3212,14 @@ static inline u32 iwl4965_get_scd_ssn(struct iwl4965_tx_resp *tx_resp)*/ static int iwl4965_tx_status_reply_tx (struct iwl_priv *priv,struct iwl_ht_agg *agg, -struct iwl4965_tx_resp_agg *tx_resp, -u16 start_idx) +struct iwl4965_tx_resp *tx_resp, +int txq_id,u16 start_idx) {u16 status; -struct agg_tx_status *frame_status = &tx_resp->status; +struct agg_tx_status *frame_status = tx_resp->u.agg_status;struct ieee80211_tx_info *info =NULL ;struct ieee80211_hdr *hdr =NULL ; -int i, sh; -int txq_id, idx; +int i, sh, idx;u16 seq;if (agg->wait_for_ba)
@@ -3238,9 +3234,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,if (agg->frame_count ==1 ) {/* Only one frame was attempted; no block-ack will arrive */ status =le16_to_cpu (frame_status[0 ].status); - seq =le16_to_cpu (frame_status[0 ].sequence); - idx =SEQ_TO_INDEX (seq); - txq_id =SEQ_TO_QUEUE (seq); + idx = start_idx;/* FIXME: code repetition */ IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
@@ -3341,7 +3335,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,struct iwl_tx_queue *txq = &priv->txq[txq_id];struct ieee80211_tx_info *info;struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0 ]; -u32 status =le32_to_cpu (tx_resp->status); +u32 status =le32_to_cpu (tx_resp->u.status);int tid =MAX_TID_COUNT , sta_id =IWL_INVALID_STATION ;u16 fc;struct ieee80211_hdr *hdr;
@@ -3380,8 +3374,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, agg = &priv->stations[sta_id].tid[tid].agg; -iwl4965_tx_status_reply_tx (priv, agg, - (struct iwl4965_tx_resp_agg *)tx_resp, index); +iwl4965_tx_status_reply_tx (priv, agg, tx_resp, txq_id, index);if ((tx_resp->frame_count ==1 ) && !iwl_is_tx_success (status)) {/* TODO: send BAR */
drivers/net/wireless/iwlwifi/iwl-5000.c +6 -11
@@ -1126,23 +1126,20 @@ static void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask)static inline u32 iwl5000_get_scd_ssn (struct iwl5000_tx_resp *tx_resp) { -__le32 *scd_ssn = (__le32 *)((u32 *)&tx_resp->status + - tx_resp->frame_count); -return le32_to_cpu (*scd_ssn) &MAX_SN ; - +return le32_to_cpup ((__le32 *)&tx_resp->status + + tx_resp->frame_count) &MAX_SN ; }static int iwl5000_tx_status_reply_tx (struct iwl_priv *priv,struct iwl_ht_agg *agg,struct iwl5000_tx_resp *tx_resp, -u16 start_idx) +int txq_id,u16 start_idx) {u16 status;struct agg_tx_status *frame_status = &tx_resp->status;struct ieee80211_tx_info *info =NULL ;struct ieee80211_hdr *hdr =NULL ; -int i, sh; -int txq_id, idx; +int i, sh, idx;u16 seq;if (agg->wait_for_ba)
@@ -1157,9 +1154,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,if (agg->frame_count ==1 ) {/* Only one frame was attempted; no block-ack will arrive */ status =le16_to_cpu (frame_status[0 ].status); - seq =le16_to_cpu (frame_status[0 ].sequence); - idx =SEQ_TO_INDEX (seq); - txq_id =SEQ_TO_QUEUE (seq); + idx = start_idx;/* FIXME: code repetition */ IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
@@ -1296,7 +1291,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, agg = &priv->stations[sta_id].tid[tid].agg; -iwl5000_tx_status_reply_tx (priv, agg, tx_resp, index); +iwl5000_tx_status_reply_tx (priv, agg, tx_resp, txq_id, index);if ((tx_resp->frame_count ==1 ) && !iwl_is_tx_success (status)) {/* TODO: send BAR */
drivers/net/wireless/iwlwifi/iwl-commands.h +4 -15
@@ -1481,21 +1481,10 @@ struct iwl4965_tx_resp {* table entry used for all frames in the new agg. * 31-16: Sequence # for this frame's Tx cmd (not SSN!) */ -__le32 status;/* TX status (for aggregation status of 1st frame) */ -} __attribute__ ((packed)); - -struct iwl4965_tx_resp_agg { -u8 frame_count;/* 1 no aggregation, >1 aggregation */ -u8 reserved1; -u8 failure_rts; -u8 failure_frame; -__le32 rate_n_flags; -__le16 wireless_media_time; -__le16 reserved3; -__le32 pa_power1; -__le32 pa_power2; -struct agg_tx_status status;/* TX status (for aggregation status */ -/* of 1st frame) */ +union { +__le32 status; +struct agg_tx_status agg_status[0 ];/* for each agg frame */ + } u; } __attribute__ ((packed));struct iwl5000_tx_resp {
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -1668,7 +1668,7 @@ static void iwl4965_rx_beacon_notif(struct iwl_priv *priv, IWL_DEBUG_RX("beacon status %x retries %d iss %d " "tsf %d %d rate %d\n", - le32_to_cpu(beacon->beacon_notify_hdr.status) & TX_STATUS_MSK, + le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK, beacon->beacon_notify_hdr.failure_frame, le32_to_cpu(beacon->ibss_mgr_status), le32_to_cpu(beacon->high_tsf),
Signature · 1 line
1.5.3.6
PATCH 18/29 iwlwifi: refactor setting tx power
From: Tomas Winkler <[email protected]>
This patch
1. Refactors settings of tx power
2. enables iwconfig txpower <value>
3. adds 5000 HW tx power
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 51 ++++++--------------------- drivers/net/wireless/iwlwifi/iwl-5000.c | 14 +++++++ drivers/net/wireless/iwlwifi/iwl-commands.h | 12 ++++++ drivers/net/wireless/iwlwifi/iwl-core.c | 37 +++++++++++++++++-- drivers/net/wireless/iwlwifi/iwl-core.h | 6 +++ drivers/net/wireless/iwlwifi/iwl-dev.h | 9 ++--- drivers/net/wireless/iwlwifi/iwl-eeprom.c | 12 +++--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 17 ++++++--- 8 files changed, 96 insertions(+), 62 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +11 -40
@@ -46,6 +46,8 @@#include "iwl-calib.h" #include "iwl-sta.h" +static int iwl4965_send_tx_power (struct iwl_priv *priv); +/* module parameters */ static struct iwl_mod_params iwl4965_mod_params = { .num_of_queues =IWL49_NUM_QUEUES ,
@@ -737,7 +739,7 @@ static void iwl4965_bg_txpower_work(struct work_struct *work)/* Regardless of if we are assocaited, we must reconfigure the * TX power since frames can be sent on non-radar channels while * not associated */ -iwl4965_hw_reg_send_txpower (priv); +iwl4965_send_tx_power (priv);/* Update last_temperature to keep is_calib_needed from running * when it isn't needed... */
@@ -952,11 +954,6 @@ static int iwl4965_set_power(struct iwl_priv *priv, cmd, NULL);return ret; } -int iwl4965_hw_reg_set_txpower (struct iwl_priv *priv,s8 power) -{ -IWL_ERROR ("TODO: Implement iwl4965_hw_reg_set_txpower!\n" ); -return -EINVAL ; -}static s32 iwl4965_math_div_round (s32 num,s32 denom,s32 *res) {
@@ -1007,20 +1004,6 @@ static s32 iwl4965_get_voltage_compensation(s32 eeprom_voltage,return comp; } -static const struct iwl_channel_info * -iwl4965_get_channel_txpower_info (struct iwl_priv *priv, -enum ieee80211_band band,u16 channel) -{ -const struct iwl_channel_info *ch_info; - - ch_info =iwl_get_channel_info (priv, band, channel); - -if (!is_channel_valid (ch_info)) -return NULL ; - -return ch_info; -} -static s32 iwl4965_get_tx_atten_grp (u16 channel) { if (channel >= CALIB_IWL_TX_ATTEN_GR5_FCH &&
@@ -1444,30 +1427,17 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,s32 factory_actual_pwr[2 ];s32 power_index; -/* Sanity check requested level (dBm) */ -if (priv->user_txpower_limit <IWL_TX_POWER_TARGET_POWER_MIN ) { -IWL_WARNING ("Requested user TXPOWER %d below limit.\n" , - priv->user_txpower_limit); -return -EINVAL ; - } -if (priv->user_txpower_limit >IWL_TX_POWER_TARGET_POWER_MAX ) { -IWL_WARNING ("Requested user TXPOWER %d above limit.\n" , - priv->user_txpower_limit); -return -EINVAL ; - } -/* user_txpower_limit is in dBm, convert to half-dBm (half-dB units * are used for indexing into txpower table) */ - user_target_power =2 * priv->user_txpower_limit; + user_target_power =2 * priv->tx_power_user_lmt;/* Get current (RXON) channel, band, width */ - ch_info = -iwl4965_get_channel_txpower_info (priv, priv->band, channel); -IWL_DEBUG_TXPOWER ("chan %d band %d is_fat %d\n" , channel, band, is_fat); -if (!ch_info) + ch_info =iwl_get_channel_info (priv, priv->band, channel); + +if (!is_channel_valid (ch_info))return -EINVAL ;/* get txatten group, used to select 1) thermal txpower adjustment
@@ -1668,12 +1638,12 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel, }/** -* iwl4965_hw_reg_send_txpower - Configure the TXPOWER level user limit +* iwl4965_send_tx_power - Configure the TXPOWER level user limit * * Uses the active RXON for channel, band, and characteristics (fat, high) -* The power limit is taken from priv->user_txpower_limit. +* The power limit is taken from priv->tx_power_user_lmt. */ -int iwl4965_hw_reg_send_txpower (struct iwl_priv *priv) +static int iwl4965_send_tx_power (struct iwl_priv *priv) {struct iwl4965_txpowertable_cmd cmd = {0 };int ret;
@@ -3507,6 +3477,7 @@ static struct iwl_lib_ops iwl4965_lib = { }, .radio_kill_sw = iwl4965_radio_kill_sw, .set_power = iwl4965_set_power, + .send_tx_power = iwl4965_send_tx_power, .update_chain_flags = iwl4965_update_chain_flags, };
drivers/net/wireless/iwlwifi/iwl-5000.c +14 -0
@@ -1424,6 +1424,19 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)return ret; } +static int iwl5000_send_tx_power (struct iwl_priv *priv) +{ +struct iwl5000_tx_power_dbm_cmd tx_power_cmd; + +/* half dBm need to multiply */ + tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); + tx_power_cmd.flags =0 ; + tx_power_cmd.srv_chan_lmt =IWL50_TX_POWER_AUTO ; +return iwl_send_cmd_pdu_async (priv,REPLY_TX_POWER_DBM_CMD , +sizeof (tx_power_cmd), &tx_power_cmd, +NULL ); +} +static struct iwl_hcmd_ops iwl5000_hcmd = { .rxon_assoc = iwl5000_send_rxon_assoc,
@@ -1452,6 +1465,7 @@ static struct iwl_lib_ops iwl5000_lib = { .load_ucode = iwl5000_load_ucode, .init_alive_start = iwl5000_init_alive_start, .alive_notify = iwl5000_alive_notify, + .send_tx_power = iwl5000_send_tx_power, .apm_ops = { .init = iwl5000_apm_init, .reset = iwl5000_apm_reset,
drivers/net/wireless/iwlwifi/iwl-commands.h +12 -0
@@ -126,6 +126,7 @@ enum {/* Miscellaneous commands */ QUIET_NOTIFICATION =0x96 ,/* not used */ REPLY_TX_PWR_TABLE_CMD =0x97 , +REPLY_TX_POWER_DBM_CMD =0x98 , MEASURE_ABORT_NOTIFICATION = 0x99, /* not used *//* Bluetooth device coexistance config command */
@@ -339,6 +340,17 @@ struct iwl4965_tx_power_db {struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES ]; } __attribute__ ((packed)); +/** +* Commad REPLY_TX_POWER_DBM_CMD = 0x98 +* struct iwl5000_tx_power_dbm_cmd +*/ +#define IWL50_TX_POWER_AUTO 0x7f +struct iwl5000_tx_power_dbm_cmd { +s8 global_lmt;/*in half-dBm (e.g. 30 = 15 dBm) */ +u8 flags; +s8 srv_chan_lmt;/*in half-dBm (e.g. 30 = 15 dBm) */ +u8 reserved; +} __attribute__ ((packed));/****************************************************************************** * (0a)
drivers/net/wireless/iwlwifi/iwl-core.c +33 -4
@@ -480,9 +480,8 @@ static int iwlcore_init_geos(struct iwl_priv *priv) geo_ch->flags |= ch->fat_extension_channel; -if (ch->max_power_avg > priv->max_channel_txpower_limit) - priv->max_channel_txpower_limit = - ch->max_power_avg; +if (ch->max_power_avg > priv->tx_power_channel_lmt) + priv->tx_power_channel_lmt = ch->max_power_avg; }else { geo_ch->flags |=IEEE80211_CHAN_DISABLED ; }
@@ -832,7 +831,7 @@ int iwl_init_drv(struct iwl_priv *priv) priv->rates_mask =IWL_RATES_MASK ;/* If power management is turned on, default to AC mode */ priv->power_mode =IWL_POWER_AC ; - priv->user_txpower_limit =IWL_DEFAULT_TX_POWER ; + priv->tx_power_user_lmt =IWL_TX_POWER_TARGET_POWER_MAX ; ret =iwl_init_channel_map (priv);if (ret) {
@@ -871,6 +870,34 @@ void iwl_free_calib_results(struct iwl_priv *priv) }EXPORT_SYMBOL (iwl_free_calib_results); +int iwl_set_tx_power (struct iwl_priv *priv,s8 tx_power,bool force) +{ +int ret =0 ; +if (tx_power <IWL_TX_POWER_TARGET_POWER_MIN ) { +IWL_WARNING ("Requested user TXPOWER %d below limit.\n" , + priv->tx_power_user_lmt); +return -EINVAL ; + } + +if (tx_power >IWL_TX_POWER_TARGET_POWER_MAX ) { +IWL_WARNING ("Requested user TXPOWER %d above limit.\n" , + priv->tx_power_user_lmt); +return -EINVAL ; + } + +if (priv->tx_power_user_lmt != tx_power) + force = true; + + priv->tx_power_user_lmt = tx_power; + +if (force && priv->cfg->ops->lib->send_tx_power) + ret = priv->cfg->ops->lib->send_tx_power (priv); + +return ret; +} +EXPORT_SYMBOL (iwl_set_tx_power); + +void iwl_uninit_drv (struct iwl_priv *priv) {iwl_free_calib_results (priv);
@@ -880,6 +907,8 @@ void iwl_uninit_drv(struct iwl_priv *priv) }EXPORT_SYMBOL (iwl_uninit_drv); + +/* Low level driver call this function to update iwlcore with * driver status. */
drivers/net/wireless/iwlwifi/iwl-core.h +6 -0
@@ -140,6 +140,7 @@ struct iwl_lib_ops { } apm_ops;/* power */ int (*set_power)(struct iwl_priv *priv,void *cmd); +int (*send_tx_power) (struct iwl_priv *priv);void (*update_chain_flags)(struct iwl_priv *priv);/* eeprom operations (as defined in iwl-eeprom.h) */ struct iwl_eeprom_ops eeprom_ops;
@@ -238,6 +239,11 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid);int iwl_txq_check_empty (struct iwl_priv *priv,int sta_id,u8 tid,int txq_id);/***************************************************** +* TX power +****************************************************/ +int iwl_set_tx_power (struct iwl_priv *priv,s8 tx_power,bool force); + +/***************************************************** * S e n d i n g H o s t C o m m a n d s * *****************************************************/
drivers/net/wireless/iwlwifi/iwl-dev.h +3 -6
@@ -683,8 +683,6 @@ extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,struct ieee80211_tx_info *info, struct ieee80211_hdr *hdr, int sta_id, int tx_id); -extern int iwl4965_hw_reg_send_txpower (struct iwl_priv *priv); -extern int iwl4965_hw_reg_set_txpower (struct iwl_priv *priv,s8 power);extern void iwl4965_hw_rx_statistics (struct iwl_priv *priv,struct iwl_rx_mem_buffer *rxb);extern void iwl4965_disable_events (struct iwl_priv *priv);
@@ -1167,10 +1165,9 @@ struct iwl_priv {struct delayed_work alive_start;struct delayed_work scan_check;struct delayed_work post_associate; - -#define IWL_DEFAULT_TX_POWER 0x0F -s8 user_txpower_limit; -s8 max_channel_txpower_limit; +/* TX Power */ +s8 tx_power_user_lmt; +s8 tx_power_channel_lmt;#ifdef CONFIG_PM u32 pm_state[16 ];
drivers/net/wireless/iwlwifi/iwl-eeprom.c +6 -6
@@ -382,8 +382,8 @@ static int iwl_set_fat_chan_info(struct iwl_priv *priv,if (!is_channel_valid (ch_info))return -1 ; - IWL_DEBUG_INFO("FAT Ch. %d [%sGHz] %s%s%s%s%s(0x%02x" - " %ddBm): Ad-Hoc %ssupported\n", + IWL_DEBUG_INFO("FAT Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):" + " Ad-Hoc %ssupported\n", ch_info->channel, is_channel_a_band(ch_info) ? "5.2" : "2.4",
@@ -493,8 +493,8 @@ int iwl_init_channel_map(struct iwl_priv *priv) ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; ch_info->min_power =0 ; - IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x" - " %ddBm): Ad-Hoc %ssupported\n", + IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x %ddBm):" + " Ad-Hoc %ssupported\n", ch_info->channel, is_channel_a_band(ch_info) ? "5.2" : "2.4",
@@ -515,8 +515,8 @@ int iwl_init_channel_map(struct iwl_priv *priv)/* Set the user_txpower_limit to the highest power * supported by any channel */ if (eeprom_ch_info[ch].max_power_avg > - priv->user_txpower_limit) - priv->user_txpower_limit = + priv->tx_power_user_lmt) + priv->tx_power_user_lmt = eeprom_ch_info[ch].max_power_avg; ch_info++;
drivers/net/wireless/iwlwifi/iwl4965-base.c +11 -6
@@ -367,9 +367,9 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)/* If we issue a new RXON command which required a tune then we must * send a new TXPOWER command or we won't be able to Tx any frames */ - rc =iwl4965_hw_reg_send_txpower (priv); + rc =iwl_set_tx_power (priv, priv->tx_power_user_lmt, true);if (rc) { -IWL_ERROR ("Error setting Tx power (%d).\n" , rc); +IWL_ERROR ("Error sending TX power (%d).\n" , rc);return rc; }
@@ -3637,7 +3637,7 @@ static void iwl4965_bg_scan_completed(struct work_struct *work)struct iwl_priv *priv = container_of(work, struct iwl_priv, scan_completed); -IWL_DEBUG (IWL_DL_SCAN ,"SCAN complete scan\n" ); +IWL_DEBUG_SCAN ("SCAN complete scan\n" );if (test_bit (STATUS_EXIT_PENDING , &priv->status))return ;
@@ -3650,7 +3650,7 @@ static void iwl4965_bg_scan_completed(struct work_struct *work)/* Since setting the TXPOWER may have been deferred while * performing the scan, fire one off */ mutex_lock (&priv->mutex); -iwl4965_hw_reg_send_txpower (priv); +iwl_set_tx_power (priv, priv->tx_power_user_lmt, true);mutex_unlock (&priv->mutex); }
@@ -3930,6 +3930,11 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co goto out; } +IWL_DEBUG_MAC80211 ("TX Power old=%d new=%d\n" , + priv->tx_power_user_lmt, conf->power_level); + +iwl_set_tx_power (priv, conf->power_level, false); +iwl4965_set_rate (priv); if (memcmp(&priv->active_rxon,
@@ -4713,7 +4718,7 @@ static ssize_t show_tx_power(struct device *d, struct device_attribute *attr, char *buf) { struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; -return sprintf (buf,"%d\n" , priv->user_txpower_limit); +return sprintf (buf,"%d\n" , priv->tx_power_user_lmt); } static ssize_t store_tx_power(struct device *d,
@@ -4729,7 +4734,7 @@ static ssize_t store_tx_power(struct device *d, printk(KERN_INFO DRV_NAME ": %s is not in decimal form.\n", buf); else -iwl4965_hw_reg_set_txpower (priv ,val ); +iwl_set_tx_power (priv ,val ,false );return count; }
Signature · 1 line
1.5.3.6
PATCH 19/29 iwlwifi: add bad length check for WEP keys
From: Emmanuel Grumbach <[email protected]>
This patch adds a check for bad length in set key flow. This solves the Oops reported by Thomas Backlund, Joonwoo Park and Ian Schram. It also adds some debug printing that can be useful.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 1 + drivers/net/wireless/iwlwifi/iwl-sta.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +1 -0
@@ -1002,6 +1002,7 @@ struct iwl_wep_cmd {#define WEP_KEY_WEP_TYPE 1#define WEP_KEYS_MAX 4#define WEP_INVALID_OFFSET 0xff +#define WEP_KEY_LEN_64 5#define WEP_KEY_LEN_128 13/******************************************************************************
drivers/net/wireless/iwlwifi/iwl-sta.c +17 -1
@@ -488,6 +488,8 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, priv->default_wep_key--;memset (&priv->wep_keys[keyconf->keyidx],0 ,sizeof (priv->wep_keys[0 ])); ret =iwl_send_static_wepkey_cmd (priv,1 ); +IWL_DEBUG_WEP ("Remove default WEP key: idx=%d ret=%d\n" , + keyconf->keyidx, ret);spin_unlock_irqrestore (&priv->sta_lock, flags);return ret;
@@ -500,6 +502,12 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,int ret;unsigned long flags; +if (keyconf->keylen !=WEP_KEY_LEN_128 && + keyconf->keylen !=WEP_KEY_LEN_64 ) { +IWL_DEBUG_WEP ("Bad WEP key length %d\n" , keyconf->keylen); +return -EINVAL ; + } + keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV ; keyconf->hw_key_idx =HW_KEY_DEFAULT ; priv->stations[IWL_AP_ID ].keyinfo.alg =ALG_WEP ;
@@ -516,6 +524,8 @@ int iwl_set_default_wep_key(struct iwl_priv *priv, keyconf->keylen); ret =iwl_send_static_wepkey_cmd (priv,0 ); +IWL_DEBUG_WEP ("Set default WEP key: len=%d idx=%d ret=%d\n" , + keyconf->keylen, keyconf->keyidx, ret);spin_unlock_irqrestore (&priv->sta_lock, flags);return ret;
@@ -662,6 +672,9 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, key_flags =le16_to_cpu (priv->stations[sta_id].sta.key.key_flags); keyidx = (key_flags >>STA_KEY_FLG_KEYID_POS ) &0x3 ; +IWL_DEBUG_WEP ("Remove dynamic key: idx=%d sta=%d\n" , + keyconf->keyidx, sta_id); +if (keyconf->keyidx != keyidx) {/* We need to remove a key with index different that the one * in the uCode. This means that the key we need to remove has
@@ -686,7 +699,6 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, priv->stations[sta_id].sta.sta.modify_mask =STA_MODIFY_KEY_MASK ; priv->stations[sta_id].sta.mode =STA_CONTROL_MODIFY_MSK ; -IWL_DEBUG_INFO ("hwcrypto: clear ucode station key info\n" ); ret =iwl_send_add_sta (priv, &priv->stations[sta_id].sta,CMD_ASYNC );spin_unlock_irqrestore (&priv->sta_lock, flags);return ret;
@@ -716,6 +728,10 @@ int iwl_set_dynamic_key(struct iwl_priv *priv, ret = -EINVAL ; } +IWL_DEBUG_WEP ("Set dynamic key: alg= %d len=%d idx=%d sta=%d ret=%d\n" , + keyconf->alg, keyconf->keylen, keyconf->keyidx, + sta_id, ret); +return ret; }EXPORT_SYMBOL (iwl_set_dynamic_key);
Signature · 1 line
1.5.3.6
PATCH 20/29 iwlwifi: move scan to iwl-scan.c iwlcore
From: Tomas Winkler <[email protected]>
This patch moves scan code to iwl-scan.c file in iwlcore module.
--- drivers/net/wireless/iwlwifi/Makefile | 5 +- drivers/net/wireless/iwlwifi/iwl-commands.h | 24 +- drivers/net/wireless/iwlwifi/iwl-core.h | 10 + drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 896 +++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl4965-base.c | 881 +------------------------- 6 files changed, 946 insertions(+), 872 deletions(-) create mode 100644 drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/iwlwifi/Makefile +3 -2
@@ -1,6 +1,7 @@ obj-$(CONFIG_IWLCORE) += iwlcore.o -iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o iwl-calib.o -iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o +iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o +iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o iwl-calib.o +iwlcore-objs += iwl-scan.o iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o
drivers/net/wireless/iwlwifi/iwl-commands.h +12 -12
@@ -2100,7 +2100,7 @@ struct iwl4965_ct_kill_config {*****************************************************************************/ /** -* struct iwl4965_scan_channel - entry in REPLY_SCAN_CMD channel table +* struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table * * One for each channel in the scan list. * Each channel can independently select:
@@ -2110,7 +2110,7 @@ struct iwl4965_ct_kill_config {* quiet_plcp_th, good_CRC_th) * * To avoid uCode errors, make sure the following are true (see comments -* under struct iwl4965_scan_cmd about max_out_time and quiet_time): +* under struct iwl_scan_cmd about max_out_time and quiet_time): * 1) If using passive_dwell (i.e. passive_dwell != 0): * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) * 2) quiet_time <= active_dwell
@@ -2118,7 +2118,7 @@ struct iwl4965_ct_kill_config {* passive_dwell < max_out_time * active_dwell < max_out_time */ -struct iwl4965_scan_channel { +struct iwl_scan_channel {/* * type is defined as: * 0:0 1 = active, 0 = passive
@@ -2134,13 +2134,13 @@ struct iwl4965_scan_channel { } __attribute__ ((packed));/** -* struct iwl4965_ssid_ie - directed scan network information element +* struct iwl_ssid_ie - directed scan network information element * * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field * in struct iwl4965_scan_channel; each channel may select different ssids from * among the 4 entries. SSID IEs get transmitted in reverse order of entry. */ -struct iwl4965_ssid_ie { +struct iwl_ssid_ie {u8 id;u8 len;u8 ssid[32 ];
@@ -2201,9 +2201,9 @@ struct iwl4965_ssid_ie {* Driver must use separate scan commands for 2.4 vs. 5 GHz bands. * * To avoid uCode errors, see timing restrictions described under -* struct iwl4965_scan_channel. +* struct iwl_scan_channel. */ -struct iwl4965_scan_cmd { +struct iwl_scan_cmd {__le16 len;u8 reserved0;u8 channel_count;/* # channels in channel list */
@@ -2227,7 +2227,7 @@ struct iwl4965_scan_cmd {struct iwl_tx_cmd tx_cmd;/* For directed active scans (set to all-0s otherwise) */ -struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX ]; +struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX ];/* * Probe request frame, followed by channel list.
@@ -2255,14 +2255,14 @@ struct iwl4965_scan_cmd {/* * REPLY_SCAN_CMD = 0x80 (response) */ -struct iwl4965_scanreq_notification { +struct iwl_scanreq_notification {__le32 status;/* 1: okay, 2: cannot fulfill request */ } __attribute__ ((packed));/* * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command) */ -struct iwl4965_scanstart_notification { +struct iwl_scanstart_notification {__le32 tsf_low;__le32 tsf_high;__le32 beacon_timer;
@@ -2279,7 +2279,7 @@ struct iwl4965_scanstart_notification {/* * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) */ -struct iwl4965_scanresults_notification { +struct iwl_scanresults_notification {u8 channel;u8 band;u8 reserved[2 ];
@@ -2291,7 +2291,7 @@ struct iwl4965_scanresults_notification {/* * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command) */ -struct iwl4965_scancomplete_notification { +struct iwl_scancomplete_notification {u8 scanned_channels;u8 status;u8 reserved;
drivers/net/wireless/iwlwifi/iwl-core.h +10 -0
@@ -243,6 +243,16 @@ int iwl_txq_check_empty(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id);****************************************************/ int iwl_set_tx_power (struct iwl_priv *priv,s8 tx_power,bool force); +/******************************************************************************* +* Scanning +******************************************************************************/ +int iwl_scan_cancel (struct iwl_priv *priv); +int iwl_scan_cancel_timeout (struct iwl_priv *priv,unsigned long ms); +const char *iwl_escape_essid (const char *essid,u8 essid_len); +int iwl_scan_initiate (struct iwl_priv *priv); +void iwl_setup_rx_scan_handlers (struct iwl_priv *priv); +void iwl_setup_scan_deferred_work (struct iwl_priv *priv); +/***************************************************** * S e n d i n g H o s t C o m m a n d s * *****************************************************/
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -1
@@ -976,7 +976,7 @@ struct iwl_priv {int one_direct_scan;u8 direct_ssid_len;u8 direct_ssid[IW_ESSID_MAX_SIZE ]; -struct iwl4965_scan_cmd *scan; +struct iwl_scan_cmd *scan;/* spinlock */ spinlock_t lock;/* protect general shared data */
drivers/net/wireless/iwlwifi/iwl-scan.c new file +896 -0
896 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl4965-base.c +24 -857
1,057 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 21/29 iwlwifi: move rate helpers to iwlcore
From: Tomas Winkler <[email protected]>
This patch moves rate helpers to iwlcore.
--- drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 13 ----- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 8 +-- drivers/net/wireless/iwlwifi/iwl-4965-rs.h | 2 - drivers/net/wireless/iwlwifi/iwl-4965.c | 79 ++++----------------------- drivers/net/wireless/iwlwifi/iwl-5000.c | 14 ++--- drivers/net/wireless/iwlwifi/iwl-core.c | 57 +++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-core.h | 21 +++++++ drivers/net/wireless/iwlwifi/iwl-dev.h | 3 - drivers/net/wireless/iwlwifi/iwl-scan.c | 9 ++-- drivers/net/wireless/iwlwifi/iwl-sta.c | 2 +- drivers/net/wireless/iwlwifi/iwl-tx.c | 2 +- drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +- 12 files changed, 106 insertions(+), 106 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-hw.h +0 -13
@@ -793,19 +793,6 @@ enum {/********************* END TXPOWER *****************************************/ -static inline u8 iwl4965_hw_get_rate (__le32 rate_n_flags) -{ -return le32_to_cpu (rate_n_flags) &0xFF ; -} -static inline u32 iwl4965_hw_get_rate_n_flags (__le32 rate_n_flags) -{ -return le32_to_cpu (rate_n_flags) &0x1FFFF ; -} -static inline __le32 iwl4965_hw_set_rate_n_flags (u8 rate,u16 flags) -{ -return cpu_to_le32 (flags|(u16 )rate); -} -/** * Tx/Rx Queues
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +3 -5
@@ -536,7 +536,7 @@ static int rs_get_tbl_info_from_mcs(const u32 rate_n_flags,u8 num_of_ant =get_num_of_ant_from_rate (rate_n_flags);u8 mcs; - *rate_idx =iwl4965_hwrate_to_plcp_idx (rate_n_flags); + *rate_idx =iwl_hwrate_to_plcp_idx (rate_n_flags);if (*rate_idx ==IWL_RATE_INVALID ) { *rate_idx =-1 ;
@@ -1811,8 +1811,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, tbl = &(lq_sta->lq_info[active_tbl]);/* Revert to "active" rate and throughput info */ - index =iwl4965_hwrate_to_plcp_idx ( - tbl->current_rate); + index =iwl_hwrate_to_plcp_idx (tbl->current_rate); current_tpt = lq_sta->last_tpt;/* Need to set up a new rate table in uCode */
@@ -1966,8 +1965,7 @@ lq_update:rs_rate_scale_clear_window (&(tbl->win[i]));/* Use new "search" start rate */ - index =iwl4965_hwrate_to_plcp_idx ( - tbl->current_rate); + index =iwl_hwrate_to_plcp_idx (tbl->current_rate);IWL_DEBUG_RATE ("Switch current mcs: %X index: %d\n" , tbl->current_rate, index);
drivers/net/wireless/iwlwifi/iwl-4965-rs.h +0 -2
@@ -286,8 +286,6 @@ static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index)return rate; } -extern int iwl4965_hwrate_to_plcp_idx (u32 rate_n_flags); -/** * iwl4965_fill_rs_info - Fill an output text buffer with the rate representation *
drivers/net/wireless/iwlwifi/iwl-4965.c +11 -68
152 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-5000.c +6 -8
@@ -1139,6 +1139,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,struct agg_tx_status *frame_status = &tx_resp->status;struct ieee80211_tx_info *info =NULL ;struct ieee80211_hdr *hdr =NULL ; +u32 rate_n_flags =le32_to_cpu (tx_resp->rate_n_flags);int i, sh, idx;u16 seq;
@@ -1147,7 +1148,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, agg->frame_count = tx_resp->frame_count; agg->start_idx = start_idx; - agg->rate_n_flags =le32_to_cpu (tx_resp->rate_n_flags); + agg->rate_n_flags = rate_n_flags; agg->bitmap =0 ;/* # frames attempted by Tx command */
@@ -1165,15 +1166,13 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, info->flags &= ~IEEE80211_TX_CTL_AMPDU ; info->flags |=iwl_is_tx_success (status)?IEEE80211_TX_STAT_ACK :0 ; -iwl4965_hwrate_to_tx_control (priv, -le32_to_cpu (tx_resp->rate_n_flags), - info); +iwl_hwrate_to_tx_control (priv, rate_n_flags, info); +/* FIXME: code repetition end */ IWL_DEBUG_TX_REPLY ("1 Frame 0x%x failure :%d\n" , status &0xff , tx_resp->failure_frame); -IWL_DEBUG_TX_REPLY ("Rate Info rate_n_flags=%x\n" , -iwl4965_hw_get_rate_n_flags (tx_resp->rate_n_flags)); +IWL_DEBUG_TX_REPLY ("Rate Info rate_n_flags=%x\n" , rate_n_flags); agg->wait_for_ba =0 ; }else {
@@ -1231,7 +1230,6 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, agg->bitmap = bitmap; agg->start_idx = start; - agg->rate_n_flags =le32_to_cpu (tx_resp->rate_n_flags);IWL_DEBUG_TX_REPLY ("Frames %d start_idx=%d bitmap=0x%llx\n" , agg->frame_count, agg->start_idx, (unsigned long long )agg->bitmap);
@@ -1322,7 +1320,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, info->status.retry_count = tx_resp->failure_frame; info->flags =iwl_is_tx_success (status) ?IEEE80211_TX_STAT_ACK :0 ; -iwl4965_hwrate_to_tx_control (priv, +iwl_hwrate_to_tx_control (priv,le32_to_cpu (tx_resp->rate_n_flags), info);
drivers/net/wireless/iwlwifi/iwl-core.c +57 -0
63 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-core.h +21 -0
@@ -244,6 +244,27 @@ int iwl_txq_check_empty(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id);int iwl_set_tx_power (struct iwl_priv *priv,s8 tx_power,bool force);/******************************************************************************* +* Rate +******************************************************************************/ + +void iwl_hwrate_to_tx_control (struct iwl_priv *priv,u32 rate_n_flags, +struct ieee80211_tx_info *info); +int iwl_hwrate_to_plcp_idx (u32 rate_n_flags); + +static inline u8 iwl_hw_get_rate (__le32 rate_n_flags) +{ +return le32_to_cpu (rate_n_flags) &0xFF ; +} +static inline u32 iwl_hw_get_rate_n_flags (__le32 rate_n_flags) +{ +return le32_to_cpu (rate_n_flags) &0x1FFFF ; +} +static inline __le32 iwl_hw_set_rate_n_flags (u8 rate,u32 flags) +{ +return cpu_to_le32 (flags|(u32 )rate); +} + +/******************************************************************************* * Scanning ******************************************************************************/ int iwl_scan_cancel (struct iwl_priv *priv);
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -3
@@ -733,9 +733,6 @@ extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv,extern int iwl4965_alive_notify (struct iwl_priv *priv);extern void iwl4965_update_rate_scaling (struct iwl_priv *priv,u8 mode);extern void iwl4965_rf_kill_ct_config (struct iwl_priv *priv); -extern void iwl4965_hwrate_to_tx_control (struct iwl_priv *priv, -u32 rate_n_flags, -struct ieee80211_tx_info *info); extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv, struct ieee80211_ht_info *ht_info,
drivers/net/wireless/iwlwifi/iwl-scan.c +5 -4
@@ -792,8 +792,9 @@ static void iwl_bg_request_scan(struct work_struct *data)case 2 : scan->flags =RXON_FLG_BAND_24G_MSK |RXON_FLG_AUTO_DETECT_MSK ; scan->tx_cmd.rate_n_flags = -iwl4965_hw_set_rate_n_flags (IWL_RATE_1M_PLCP , -RATE_MCS_ANT_B_MSK |RATE_MCS_CCK_MSK ); +iwl_hw_set_rate_n_flags (IWL_RATE_1M_PLCP , +RATE_MCS_ANT_B_MSK | +RATE_MCS_CCK_MSK ); scan->good_CRC_th =0 ; band =IEEE80211_BAND_2GHZ ;
@@ -801,8 +802,8 @@ static void iwl_bg_request_scan(struct work_struct *data)case 1 : scan->tx_cmd.rate_n_flags = -iwl4965_hw_set_rate_n_flags (IWL_RATE_6M_PLCP , -RATE_MCS_ANT_B_MSK ); +iwl_hw_set_rate_n_flags (IWL_RATE_6M_PLCP , +RATE_MCS_ANT_B_MSK ); scan->good_CRC_th =IWL_GOOD_CRC_TH ; band =IEEE80211_BAND_5GHZ ;break ;
drivers/net/wireless/iwlwifi/iwl-sta.c +1 -1
@@ -824,7 +824,7 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, int is_ap) rate_flags |=RATE_MCS_ANT_B_MSK ;/*FIXME:RS*/ link_cmd.rs_table[i].rate_n_flags = -iwl4965_hw_set_rate_n_flags (iwl_rates[r].plcp, rate_flags); +iwl_hw_set_rate_n_flags (iwl_rates[r].plcp, rate_flags); r =iwl4965_get_prev_ieee_rate (r); }
drivers/net/wireless/iwlwifi/iwl-tx.c +1 -1
@@ -696,7 +696,7 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, tx_cmd->rts_retry_limit = rts_retry_limit; tx_cmd->data_retry_limit = data_retry_limit; - tx_cmd->rate_n_flags =iwl4965_hw_set_rate_n_flags (rate_plcp, rate_flags); + tx_cmd->rate_n_flags =iwl_hw_set_rate_n_flags (rate_plcp, rate_flags); } static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -1331,7 +1331,7 @@ static void iwl4965_rx_beacon_notif(struct iwl_priv *priv,#ifdef CONFIG_IWLWIFI_DEBUG struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;struct iwl4965_beacon_notif *beacon = &(pkt->u.beacon_status); -u8 rate =iwl4965_hw_get_rate (beacon->beacon_notify_hdr.rate_n_flags); +u8 rate =iwl_hw_get_rate (beacon->beacon_notify_hdr.rate_n_flags); IWL_DEBUG_RX("beacon status %x retries %d iss %d " "tsf %d %d rate %d\n",
Signature · 1 line
1.5.3.6
PATCH 22/29 iwlwifi: cleans up scanning code
From: Tomas Winkler <[email protected]>
This patch
1. cleans up scanning code.
2. It adds round robin of TX antannas/chains.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 14 +-- drivers/net/wireless/iwlwifi/iwl-core.c | 1 + drivers/net/wireless/iwlwifi/iwl-core.h | 1 + drivers/net/wireless/iwlwifi/iwl-dev.h | 33 +----- drivers/net/wireless/iwlwifi/iwl-scan.c | 178 +++++++++++++++------------ 5 files changed, 107 insertions(+), 120 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +3 -11
@@ -281,16 +281,7 @@ struct iwl_cmd_header {#define RATE_MCS_ANT_C_MSK 0x10000#define RATE_MCS_ANT_ABC_MSK 0x1C000 - -/** -* struct iwl4965_tx_power - txpower format used in REPLY_SCAN_CMD -* -* Scan uses only one transmitter, so only one analog/dsp gain pair is needed. -*/ -struct iwl4965_tx_power { -u8 tx_gain;/* gain for analog radio */ -u8 dsp_atten;/* gain for DSP */ -} __attribute__ ((packed)); +#define RATE_MCS_ANT_INIT_IND 1#define POWER_TABLE_NUM_ENTRIES 33#define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32
@@ -2128,7 +2119,8 @@ struct iwl_scan_channel {*/ u8 type;u8 channel;/* band is selected by iwl4965_scan_cmd "flags" field */ -struct iwl4965_tx_power tpc; +u8 tx_gain;/* gain for analog radio */ +u8 dsp_atten;/* gain for DSP */ __le16 active_dwell;/* in 1024-uSec TU (time units), typ 5-50 */ __le16 passive_dwell;/* in 1024-uSec TU (time units), typ 20-500 */ } __attribute__ ((packed));
drivers/net/wireless/iwlwifi/iwl-core.c +1 -0
@@ -874,6 +874,7 @@ int iwl_init_drv(struct iwl_priv *priv)/* Choose which receivers/antennas to use */ iwl_set_rxon_chain (priv); +iwl_init_scan_params (priv);if (priv->cfg->mod_params->enable_qos) priv->qos_data.qos_enable =1 ;
drivers/net/wireless/iwlwifi/iwl-core.h +1 -0
@@ -267,6 +267,7 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags)/******************************************************************************* * Scanning ******************************************************************************/ +void iwl_init_scan_params (struct iwl_priv *priv);int iwl_scan_cancel (struct iwl_priv *priv);int iwl_scan_cancel_timeout (struct iwl_priv *priv,unsigned long ms);const char *iwl_escape_essid (const char *essid,u8 essid_len);
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -32
@@ -157,35 +157,11 @@ struct iwl4965_channel_tgh_info {s64 last_radar_time; }; -/* current Tx power values to use, one for each rate for each channel. -* requested power is limited by: -* -- regulatory EEPROM limits for this channel -* -- hardware capabilities (clip-powers) -* -- spectrum management -* -- user preference (e.g. iwconfig) -* when requested power is set, base power index must also be set. */ -struct iwl4965_channel_power_info { -struct iwl4965_tx_power tpc;/* actual radio and DSP gain settings */ -s8 power_table_index;/* actual (compenst'd) index into gain table */ -s8 base_power_index;/* gain index for power at factory temp. */ -s8 requested_power;/* power (dBm) requested for this chnl/rate */ -}; - -/* current scan Tx power values to use, one for each scan rate for each -* channel. */ -struct iwl4965_scan_power_info { -struct iwl4965_tx_power tpc;/* actual radio and DSP gain settings */ -s8 power_table_index;/* actual (compenst'd) index into gain table */ -s8 requested_power;/* scan pwr (dBm) requested for chnl/rate */ -}; -/* * One for each channel, holds all channel setup data * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant * with one another! */ -#define IWL4965_MAX_RATE (33) -struct iwl_channel_info {struct iwl4965_channel_tgd_info tgd;struct iwl4965_channel_tgh_info tgh;
@@ -204,11 +180,6 @@ struct iwl_channel_info {u8 band_index;/* 0-4, maps channel to band1/2/3/4/5 */ enum ieee80211_band band; -/* Radio/DSP gain settings for each "normal" data Tx rate. -* These include, in addition to RF and DSP gain, a few fields for -* remembering/modifying gain settings (indexes). */ -struct iwl4965_channel_power_info power_info[IWL4965_MAX_RATE ]; -/* FAT channel info */ s8 fat_max_power_avg;/* (dBm) regul. eeprom, normal Tx, any rate */ s8 fat_curr_txpow;/* (dBm) regulatory/spectrum/user (not h/w) */
@@ -216,9 +187,6 @@ struct iwl_channel_info {s8 fat_scan_power;/* (dBm) eeprom, direct scans, any rate */ u8 fat_flags;/* flags copied from EEPROM */ u8 fat_extension_channel;/* HT_IE_EXT_CHANNEL_* */ - -/* Radio/DSP gain settings for each scan rate, for directed scans. */ -struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES ]; };struct iwl4965_clip_group {
@@ -974,6 +942,7 @@ struct iwl_priv {u8 direct_ssid_len;u8 direct_ssid[IW_ESSID_MAX_SIZE ];struct iwl_scan_cmd *scan; +u32 scan_tx_ant[IEEE80211_NUM_BANDS ];/* spinlock */ spinlock_t lock;/* protect general shared data */
drivers/net/wireless/iwlwifi/iwl-scan.c +101 -77
356 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 23/29 iwlwifi: move iwl4965_rf_kill_ct_config to iwl-core.c
From: Emmanuel Grumbach <[email protected]>
This patch moves iwl4965_rf_kill_ct_config to iwl-core.c.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 24 ------------------------ drivers/net/wireless/iwlwifi/iwl-commands.h | 2 +- drivers/net/wireless/iwlwifi/iwl-core.c | 23 +++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-core.h | 1 + drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +0 -24
@@ -556,30 +556,6 @@ out:#define REG_RECALIB_PERIOD (60) -void iwl4965_rf_kill_ct_config (struct iwl_priv *priv) -{ -struct iwl4965_ct_kill_config cmd; -unsigned long flags; -int ret =0 ; - -spin_lock_irqsave (&priv->lock, flags); -iwl_write32 (priv,CSR_UCODE_DRV_GP1_CLR , -CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT ); -spin_unlock_irqrestore (&priv->lock, flags); - - cmd.critical_temperature_R = -cpu_to_le32 (priv->hw_params.ct_kill_threshold); - - ret =iwl_send_cmd_pdu (priv,REPLY_CT_KILL_CONFIG_CMD , -sizeof (cmd), &cmd); -if (ret) -IWL_ERROR ("REPLY_CT_KILL_CONFIG_CMD failed\n" ); -else -IWL_DEBUG_INFO ("REPLY_CT_KILL_CONFIG_CMD succeeded, " -"critical temperature is %d\n" , - cmd.critical_temperature_R); -} -/* Reset differential Rx gains in NIC to prepare for chain noise calibration. * Called after every association, but this runs only once! * ... once chain noise is calibrated the first time, it's good forever. */
drivers/net/wireless/iwlwifi/iwl-commands.h +1 -1
@@ -2078,7 +2078,7 @@ struct iwl4965_card_state_notif {#define RF_CARD_DISABLED 0x04#define RXON_CARD_DISABLED 0x10 -struct iwl4965_ct_kill_config { +struct iwl_ct_kill_config {__le32 reserved;__le32 critical_temperature_M;__le32 critical_temperature_R;
drivers/net/wireless/iwlwifi/iwl-core.c +23 -0
@@ -1326,4 +1326,27 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv) }EXPORT_SYMBOL (iwl_dump_nic_event_log); +void iwl_rf_kill_ct_config (struct iwl_priv *priv) +{ +struct iwl_ct_kill_config cmd; +unsigned long flags; +int ret =0 ; + +spin_lock_irqsave (&priv->lock, flags); +iwl_write32 (priv,CSR_UCODE_DRV_GP1_CLR , +CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT ); +spin_unlock_irqrestore (&priv->lock, flags); + + cmd.critical_temperature_R = +cpu_to_le32 (priv->hw_params.ct_kill_threshold); + ret =iwl_send_cmd_pdu (priv,REPLY_CT_KILL_CONFIG_CMD , +sizeof (cmd), &cmd); +if (ret) +IWL_ERROR ("REPLY_CT_KILL_CONFIG_CMD failed\n" ); +else +IWL_DEBUG_INFO ("REPLY_CT_KILL_CONFIG_CMD succeeded, " +"critical temperature is %d\n" , + cmd.critical_temperature_R); +} +EXPORT_SYMBOL (iwl_rf_kill_ct_config);
drivers/net/wireless/iwlwifi/iwl-core.h +1 -0
@@ -371,6 +371,7 @@ int iwlcore_low_level_notify(struct iwl_priv *priv, enum iwlcore_card_notify notify);extern int iwl_send_statistics_request (struct iwl_priv *priv,u8 flags);extern int iwl_verify_ucode (struct iwl_priv *priv); +extern void iwl_rf_kill_ct_config (struct iwl_priv *priv);int iwl_send_lq_cmd (struct iwl_priv *priv,struct iwl_link_quality_cmd *lq,u8 flags);
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -2295,7 +2295,7 @@ static void iwl_alive_start(struct iwl_priv *priv)iwl4965_commit_rxon (priv);/* At this point, the NIC is initialized and operational */ -iwl4965_rf_kill_ct_config (priv); +iwl_rf_kill_ct_config (priv);iwl_leds_register (priv);
Signature · 1 line
1.5.3.6
PATCH 24/29 iwlwifi: retfactor get_temperature functions
From: Emmanuel Grumbach <[email protected]>
This patch renames iwl4965_get_tempearture to iwl4965_hw_get_temperature and replaces usage of original iwl4965_hw_get_temperature by direct access to priv->temperature.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 24 +++++++++--------------- drivers/net/wireless/iwlwifi/iwl-core.h | 1 - drivers/net/wireless/iwlwifi/iwl-dev.h | 1 - drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +- 4 files changed, 10 insertions(+), 18 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +9 -15
@@ -47,6 +47,7 @@#include "iwl-sta.h" static int iwl4965_send_tx_power (struct iwl_priv *priv); +static int iwl4965_hw_get_temperature (const struct iwl_priv *priv);/* module parameters */ static struct iwl_mod_params iwl4965_mod_params = {
@@ -283,7 +284,7 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv) }/* Calculate temperature */ - priv->temperature =iwl4965_get_temperature (priv); + priv->temperature =iwl4965_hw_get_temperature (priv);/* Send pointers to protocol/runtime uCode image ... init code will * load and launch runtime uCode, which will send us another "Alive"
@@ -1691,11 +1692,6 @@ static int iwl4965_shared_mem_rx_idx(struct iwl_priv *priv)return le32_to_cpu (s->rb_closed) &0xFFF ; } -int iwl4965_hw_get_temperature (struct iwl_priv *priv) -{ -return priv->temperature; -} -unsigned int iwl4965_hw_get_beacon_cmd (struct iwl_priv *priv,struct iwl_frame *frame,u8 rate) {
@@ -1793,12 +1789,12 @@ static s32 sign_extend(u32 oper, int index) }/** -* iwl4965_get_temperature - return the calibrated temperature (in Kelvin) +* iwl4965_hw_get_temperature - return the calibrated temperature (in Kelvin) * @statistics: Provides the temperature reading from the uCode * * A return of <0 indicates bogus data in the statistics */ -int iwl4965_get_temperature (const struct iwl_priv *priv) +static int iwl4965_hw_get_temperature (const struct iwl_priv *priv) {s32 temperature;s32 vt;
@@ -1833,8 +1829,7 @@ int iwl4965_get_temperature(const struct iwl_priv *priv) vt =sign_extend (le32_to_cpu (priv->statistics.general.temperature),23 ); -IWL_DEBUG_TEMP ("Calib values R[1-3]: %d %d %d R4: %d\n" , -R1 ,R2 ,R3 , vt); +IWL_DEBUG_TEMP ("Calib values R[1-3]: %d %d %d R4: %d\n" ,R1 ,R2 ,R3 , vt);if (R3 ==R1 ) {IWL_ERROR ("Calibration conflict R1 == R3\n" );
@@ -1845,11 +1840,10 @@ int iwl4965_get_temperature(const struct iwl_priv *priv)* Add offset to center the adjustment around 0 degrees Centigrade. */ temperature =TEMPERATURE_CALIB_A_VAL * (vt -R2 ); temperature /= (R3 -R1 ); - temperature = (temperature *97 ) /100 + -TEMPERATURE_CALIB_KELVIN_OFFSET ; + temperature = (temperature *97 ) /100 +TEMPERATURE_CALIB_KELVIN_OFFSET ; -IWL_DEBUG_TEMP ("Calibrated temperature: %dK, %dC\n" , temperature, -KELVIN_TO_CELSIUS (temperature)); +IWL_DEBUG_TEMP ("Calibrated temperature: %dK, %dC\n" , + temperature,KELVIN_TO_CELSIUS (temperature));return temperature; }
@@ -1977,7 +1971,7 @@ void iwl4965_hw_rx_statistics(struct iwl_priv *priv,if (!change)return ; - temp =iwl4965_get_temperature (priv); + temp =iwl4965_hw_get_temperature (priv);if (temp <0 )return ;
drivers/net/wireless/iwlwifi/iwl-core.h +0 -1
@@ -359,7 +359,6 @@ static inline int iwl_is_ready_rf(struct iwl_priv *priv)return iwl_is_ready (priv); } -enum iwlcore_card_notify {IWLCORE_INIT_EVT =0 ,IWLCORE_START_EVT =1 ,
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -1
@@ -643,7 +643,6 @@ extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv);extern int iwl4965_hw_set_hw_params (struct iwl_priv *priv);extern int iwl_rxq_stop (struct iwl_priv *priv);extern void iwl_txq_ctx_stop (struct iwl_priv *priv); -extern int iwl4965_hw_get_temperature (struct iwl_priv *priv);extern unsigned int iwl4965_hw_get_beacon_cmd (struct iwl_priv *priv,struct iwl_frame *frame,u8 rate); extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
drivers/net/wireless/iwlwifi/iwl4965-base.c +1 -1
@@ -3867,7 +3867,7 @@ static ssize_t show_temperature(struct device *d,if (!iwl_is_alive (priv))return -EAGAIN ; -return sprintf (buf,"%d\n" ,iwl4965_hw_get_temperature (priv)); +return sprintf (buf,"%d\n" , priv->temperature); } static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
Signature · 1 line
1.5.3.6
PATCH 25/29 iwlwifi: remove dead code iwl4965_calc_db_from_ratio
From: Emmanuel Grumbach <[email protected]>
This patch removes iwl4965_calc_db_from_ratio which is dead code.
--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 36 --------------------------- 1 files changed, 0 insertions(+), 36 deletions(-)
drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -36
@@ -1597,42 +1597,6 @@ void iwl_rx_handle(struct iwl_priv *priv) priv->rxq.read = i;iwl_rx_queue_restock (priv); } -/* Convert linear signal-to-noise ratio into dB */ -static u8 ratio2dB[100 ] = { -/* 0 1 2 3 4 5 6 7 8 9 */ -0 ,0 ,6 ,10 ,12 ,14 ,16 ,17 ,18 ,19 ,/* 00 - 09 */ -20 ,21 ,22 ,22 ,23 ,23 ,24 ,25 ,26 ,26 ,/* 10 - 19 */ -26 ,26 ,26 ,27 ,27 ,28 ,28 ,28 ,29 ,29 ,/* 20 - 29 */ -29 ,30 ,30 ,30 ,31 ,31 ,31 ,31 ,32 ,32 ,/* 30 - 39 */ -32 ,32 ,32 ,33 ,33 ,33 ,33 ,33 ,34 ,34 ,/* 40 - 49 */ -34 ,34 ,34 ,34 ,35 ,35 ,35 ,35 ,35 ,35 ,/* 50 - 59 */ -36 ,36 ,36 ,36 ,36 ,36 ,36 ,37 ,37 ,37 ,/* 60 - 69 */ -37 ,37 ,37 ,37 ,37 ,38 ,38 ,38 ,38 ,38 ,/* 70 - 79 */ -38 ,38 ,38 ,38 ,38 ,39 ,39 ,39 ,39 ,39 ,/* 80 - 89 */ -39 ,39 ,39 ,39 ,39 ,40 ,40 ,40 ,40 ,40 /* 90 - 99 */ -}; - -/* Calculates a relative dB value from a ratio of linear -* (i.e. not dB) signal levels. -* Conversion assumes that levels are voltages (20*log), not powers (10*log). */ -int iwl4965_calc_db_from_ratio (int sig_ratio) -{ -/* 1000:1 or higher just report as 60 dB */ -if (sig_ratio >=1000 ) -return 60 ; - -/* 100:1 or higher, divide by 10 and use table, -* add 20 dB to make up for divide by 10 */ -if (sig_ratio >=100 ) -return (20 + (int )ratio2dB[sig_ratio/10 ]); - -/* We shouldn't see this */ -if (sig_ratio <1 ) -return 0 ; - -/* Use table for ratios 1:1 - 99:1 */ -return (int )ratio2dB[sig_ratio]; -}#define PERFECT_RSSI (-20)/* dBm */ #define WORST_RSSI (-95)/* dBm */
Signature · 1 line
1.5.3.6
PATCH 26/29 mac80211 : fix for iwconfig in ad-hoc mode
From: Abhijeet Kolekar <[email protected]>
The patch checks interface status, if it is in IBSS_JOINED mode show cell id it is associated with.
--- net/mac80211/wext.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/wext.c +2 -1
@@ -508,7 +508,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, sdata =IEEE80211_DEV_TO_SUB_IF (dev);if (sdata->vif.type ==IEEE80211_IF_TYPE_STA || sdata->vif.type ==IEEE80211_IF_TYPE_IBSS ) { -if (sdata->u.sta.state ==IEEE80211_ASSOCIATED ) { +if (sdata->u.sta.state ==IEEE80211_ASSOCIATED || + sdata->u.sta.state ==IEEE80211_IBSS_JOINED ) { ap_addr->sa_family =ARPHRD_ETHER ;memcpy (&ap_addr->sa_data, sdata->u.sta.bssid,ETH_ALEN );return 0 ;
Signature · 1 line
1.5.3.6
PATCH 27/29 iwlwifi: fix software rf_kill problem when interface is down
The patch fixes the problem that software rf_kill messes up the card status when it is disabled if the interface is down.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 3 ++- drivers/net/wireless/iwlwifi/iwl4965-base.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +2 -1
@@ -2875,7 +2875,8 @@ static void iwl3945_radio_kill_sw(struct iwl3945_priv *priv, int disable_radio)return ; } -queue_work (priv->workqueue, &priv->restart); +if (priv->is_open) +queue_work (priv->workqueue, &priv->restart);return ; }
drivers/net/wireless/iwlwifi/iwl4965-base.c +2 -1
@@ -970,7 +970,8 @@ int iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)return 0 ; } -queue_work (priv->workqueue, &priv->restart); +if (priv->is_open) +queue_work (priv->workqueue, &priv->restart);return 1 ; }
Signature · 1 line
1.5.3.6
PATCH 28/29 iwlwifi: general code clean up
From: Emmanuel Grumbach <[email protected]>
This patch cleans up iwlwifi's code: Add missing include, remove empty lines etc...
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 1 + drivers/net/wireless/iwlwifi/iwl-4965.c | 4 +- drivers/net/wireless/iwlwifi/iwl-calib.c | 2 - drivers/net/wireless/iwlwifi/iwl-calib.h | 9 +--- drivers/net/wireless/iwlwifi/iwl-dev.h | 62 +-------------------------- drivers/net/wireless/iwlwifi/iwl-sta.c | 23 ++++++---- drivers/net/wireless/iwlwifi/iwl-sta.h | 16 +++++-- 7 files changed, 32 insertions(+), 85 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +1 -0
@@ -38,6 +38,7 @@#include "../net/mac80211/rate.h" #include "iwl-dev.h" +#include "iwl-sta.h" #include "iwl-core.h" #include "iwl-helpers.h"
drivers/net/wireless/iwlwifi/iwl-4965.c +2 -2
@@ -722,7 +722,7 @@ static const u16 default_queue_to_tx_fifo[] = { IWL_TX_FIFO_HCCA_2 }; -int iwl4965_alive_notify (struct iwl_priv *priv) +static int iwl4965_alive_notify (struct iwl_priv *priv) {u32 a;int i =0 ;
@@ -827,7 +827,7 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = {* * Called when initializing driver */ -int iwl4965_hw_set_hw_params (struct iwl_priv *priv) +static int iwl4965_hw_set_hw_params (struct iwl_priv *priv) { if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) ||
drivers/net/wireless/iwlwifi/iwl-calib.c +0 -2
@@ -60,13 +60,11 @@* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include <linux/kernel.h> #include <net/mac80211.h> #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-calib.h" -#include "iwl-eeprom.h" /* "false alarms" are signals that our DSP tries to lock onto, * but then determines that they are either noise, or transmissions
drivers/net/wireless/iwlwifi/iwl-calib.h +2 -7
@@ -62,14 +62,9 @@#ifndef __iwl_calib_h__#define __iwl_calib_h__ -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/version.h> - -#include <net/mac80211.h> -#include "iwl-eeprom.h" -#include "iwl-core.h" #include "iwl-dev.h" +#include "iwl-core.h" +#include "iwl-commands.h" void iwl_chain_noise_calibration (struct iwl_priv *priv,struct iwl4965_notif_statistics *stat_resp);
drivers/net/wireless/iwlwifi/iwl-dev.h +3 -59
116 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-sta.c +13 -10
@@ -30,11 +30,9 @@#include <net/mac80211.h> #include <linux/etherdevice.h> -#include "iwl-eeprom.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-sta.h" -#include "iwl-io.h" #include "iwl-helpers.h"
@@ -74,6 +72,17 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr) }EXPORT_SYMBOL (iwl_find_station); +int iwl_get_ra_sta_id (struct iwl_priv *priv,struct ieee80211_hdr *hdr) +{ +if (priv->iw_mode ==IEEE80211_IF_TYPE_STA ) { +return IWL_AP_ID ; + }else { +u8 *da =ieee80211_get_DA (hdr); +return iwl_find_station (priv, da); + } +} +EXPORT_SYMBOL (iwl_get_ra_sta_id); +static int iwl_add_sta_callback (struct iwl_priv *priv,struct iwl_cmd *cmd,struct sk_buff *skb) {
@@ -105,8 +114,6 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,return 1 ; } - -int iwl_send_add_sta (struct iwl_priv *priv,struct iwl_addsta_cmd *sta,u8 flags) {
@@ -272,7 +279,6 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap, }EXPORT_SYMBOL (iwl_add_station_flags); -static int iwl_sta_ucode_deactivate (struct iwl_priv *priv,const char *addr) {unsigned long flags;
@@ -376,9 +382,9 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,return ret; } +/** * iwl_remove_station - Remove driver's knowledge of station. -* */ u8 iwl_remove_station (struct iwl_priv *priv,const u8 *addr,int is_ap) {
@@ -418,7 +424,7 @@ out:return 0 ; }EXPORT_SYMBOL (iwl_remove_station); -int iwl_get_free_ucode_key_index (struct iwl_priv *priv) +static int iwl_get_free_ucode_key_index (struct iwl_priv *priv) {int i;
@@ -869,7 +875,6 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap) }EXPORT_SYMBOL (iwl_rxon_add_station); -/** * iwl_get_sta_id - Find station's index within station table *
@@ -927,7 +932,6 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) }EXPORT_SYMBOL (iwl_get_sta_id); -/** * iwl_sta_modify_enable_tid_tx - Enable Tx for this TID in station table */
@@ -946,4 +950,3 @@ void iwl_sta_modify_enable_tid_tx(struct iwl_priv *priv, int sta_id, int tid) }EXPORT_SYMBOL (iwl_sta_modify_enable_tid_tx); -
drivers/net/wireless/iwlwifi/iwl-sta.h +11 -5
@@ -32,18 +32,24 @@#define HW_KEY_DYNAMIC 0#define HW_KEY_DEFAULT 1 -int iwl_get_free_ucode_key_index (struct iwl_priv *priv); +/** +* iwl_find_station - Find station id for a given BSSID +* @bssid: MAC address of station ID to find +*/ +u8 iwl_find_station (struct iwl_priv *priv,const u8 *bssid); +int iwl_send_static_wepkey_cmd (struct iwl_priv *priv,u8 send_if_empty);int iwl_remove_default_wep_key (struct iwl_priv *priv, -struct ieee80211_key_conf *key); +struct ieee80211_key_conf *key);int iwl_set_default_wep_key (struct iwl_priv *priv, -struct ieee80211_key_conf *key); +struct ieee80211_key_conf *key);int iwl_set_dynamic_key (struct iwl_priv *priv, -struct ieee80211_key_conf *key,u8 sta_id); +struct ieee80211_key_conf *key,u8 sta_id);int iwl_remove_dynamic_key (struct iwl_priv *priv, -struct ieee80211_key_conf *key,u8 sta_id); +struct ieee80211_key_conf *key,u8 sta_id);int iwl_rxon_add_station (struct iwl_priv *priv,const u8 *addr,int is_ap);u8 iwl_remove_station (struct iwl_priv *priv,const u8 *addr,int is_ap);int iwl_get_sta_id (struct iwl_priv *priv,struct ieee80211_hdr *hdr);void iwl_sta_modify_enable_tid_tx (struct iwl_priv *priv,int sta_id,int tid); +int iwl_get_ra_sta_id (struct iwl_priv *priv,struct ieee80211_hdr *hdr);#endif /* __iwl_sta_h__ */
Signature · 1 line
1.5.3.6
PATCH 29/29 iwlwifi: remove iwlcore_low_level_notify
From: Emmanuel Grumbach <[email protected]>
This patch removes the iwlcore_low_level_notify. The notification chain is not required in this level.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 31 --------------------------- drivers/net/wireless/iwlwifi/iwl-core.h | 9 ------- drivers/net/wireless/iwlwifi/iwl4965-base.c | 14 ++++++------ 3 files changed, 7 insertions(+), 47 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +0 -31
@@ -965,37 +965,6 @@ void iwl_uninit_drv(struct iwl_priv *priv) }EXPORT_SYMBOL (iwl_uninit_drv); - - -/* Low level driver call this function to update iwlcore with -* driver status. -*/ -int iwlcore_low_level_notify (struct iwl_priv *priv, -enum iwlcore_card_notify notify) -{ -int ret; -switch (notify) { -case IWLCORE_INIT_EVT : - ret =iwl_rfkill_init (priv); -if (ret) -IWL_ERROR ("Unable to initialize RFKILL system. " -"Ignoring error: %d\n" , ret); -iwl_power_initialize (priv); -break ; -case IWLCORE_START_EVT : -iwl_power_update_mode (priv,1 ); -break ; -case IWLCORE_STOP_EVT : -break ; -case IWLCORE_REMOVE_EVT : -iwl_rfkill_unregister (priv); -break ; - } - -return 0 ; -} -EXPORT_SYMBOL (iwlcore_low_level_notify); -int iwl_send_statistics_request (struct iwl_priv *priv,u8 flags) {u32 stat_flags =0 ;
drivers/net/wireless/iwlwifi/iwl-core.h +0 -9
@@ -359,15 +359,6 @@ static inline int iwl_is_ready_rf(struct iwl_priv *priv)return iwl_is_ready (priv); } -enum iwlcore_card_notify { -IWLCORE_INIT_EVT =0 , -IWLCORE_START_EVT =1 , -IWLCORE_STOP_EVT =2 , -IWLCORE_REMOVE_EVT =3 , -}; - -int iwlcore_low_level_notify (struct iwl_priv *priv, -enum iwlcore_card_notify notify);extern int iwl_send_statistics_request (struct iwl_priv *priv,u8 flags);extern int iwl_verify_ucode (struct iwl_priv *priv);extern void iwl_rf_kill_ct_config (struct iwl_priv *priv);
drivers/net/wireless/iwlwifi/iwl4965-base.c +7 -7
@@ -2271,7 +2271,7 @@ static void iwl_alive_start(struct iwl_priv *priv)if (priv->error_recovering)iwl4965_error_recovery (priv); -iwlcore_low_level_notify (priv,IWLCORE_START_EVT ); +iwl_power_update_mode (priv,1 );ieee80211_notify_mac (priv->hw,IEEE80211_NOTIFY_RE_ASSOC );if (test_and_clear_bit (STATUS_MODE_PENDING , &priv->status))
@@ -2297,8 +2297,6 @@ static void __iwl4965_down(struct iwl_priv *priv)iwl_leds_unregister (priv); -iwlcore_low_level_notify (priv,IWLCORE_STOP_EVT ); -iwlcore_clear_stations_table (priv);/* Unblock any waiting calls */
@@ -4460,8 +4458,11 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *eif (err)IWL_ERROR ("failed to create debugfs files\n" ); -/* notify iwlcore to init */ -iwlcore_low_level_notify (priv,IWLCORE_INIT_EVT ); + err =iwl_rfkill_init (priv); +if (err) +IWL_ERROR ("Unable to initialize RFKILL system. " +"Ignoring error: %d\n" , err); +iwl_power_initialize (priv);return 0 ; out_remove_sysfs:
@@ -4524,8 +4525,7 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) } } -iwlcore_low_level_notify (priv,IWLCORE_REMOVE_EVT ); - +iwl_rfkill_unregister (priv);iwl4965_dealloc_ucode_pci (priv);if (priv->rxq.bd)
Signature · 1 line
1.5.3.6
Re: [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode
In reply to Zhu YiQuoted 6 lines · Zhu Yi
From: Abhijeet Kolekar <[email protected]>
The patch checks interface status, if it is in
IBSS_JOINEDmode show cell id it is associated with.Signed-off-by Abhijeet Kolekar <[email protected]>
Good catch. This is actually a regression since 2.6.25.3 where the code didn't care about the state but was just:
if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
ap_addr->sa_family = ARPHRD_ETHER;
memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN);
return 0;John, this is a good candidate for 2.6.26 as it's technically a regression, even though impact is probably low.
Dan
Quoted 17 lines
net/mac80211/wext.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)net/mac80211/wext.c +2
-1@@ -508,7 +508,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, sdata =IEEE80211_DEV_TO_SUB_IF (dev);if (sdata->vif.type ==IEEE80211_IF_TYPE_STA || sdata->vif.type ==IEEE80211_IF_TYPE_IBSS ) { -if (sdata->u.sta.state ==IEEE80211_ASSOCIATED ) { +if (sdata->u.sta.state ==IEEE80211_ASSOCIATED || + sdata->u.sta.state ==IEEE80211_IBSS_JOINED ) { ap_addr->sa_family =ARPHRD_ETHER ;memcpy (&ap_addr->sa_data, sdata->u.sta.bssid,ETH_ALEN );return 0 ;
Quoted 6 lines · Zhu Yi
Hi John,
Here are the iwlwifi updates on 06/12. Please apply.
Thanks,
-yi
Since you're the one submitting the patches, shouldn't they have your Signed-off-by as well?
Cheers,
Harvey
Quoted 3 lines · Harvey Harrison
Since you're the one submitting the patches, shouldn't they have your Signed-off-by as well?
You're right. Will do it next time.
Thanks,
-yi
Quoted 6 lines · Zhu Yi
Quoted 3 lines · Harvey Harrison
Since you're the one submitting the patches, shouldn't they have your Signed-off-by as well?
You're right. Will do it next time.
I'll add your S-o-b if you would like?
John
Signature · 2 lines
John W. Linville [email protected]
Quoted 1 line · John W. Linville
I'll add your S-o-b if you would like?
Yeah, please.
Thanks,
-yi