update for 3.4: iwlwifi 2012-03-06
Subsystems (2)
cover update for 3.4: iwlwifi 2012-03-06
Second set of major re-factor and clenup works happen in iwlwifi, we move the code to the proper place and get ready for the next generation of the devices
Johannes Berg (33):
iwlwifi: move ucode loading to op_mode
iwlwifi: split out firmware store
iwlwifi: remove iwl-wifi.h
iwlwifi: add wrappers for command sending
iwlwifi: move RF/CT kill check to command wrapper
iwlwifi: move lockdep assertion into DVM
iwlwifi: move mutex out of shared
iwlwifi: move rfkill status handling out of transport
iwlwifi: rename ucode.h to fw-file.h
iwlwifi: remove AMT check from transport
iwlwifi: remove shadow_reg_enable from hw_params
iwlwifi: move status check functions out of shared
iwlwifi: make tracing use device as identifier
iwlwifi: virtualize command queue full behaviour
iwlwifi: clean up iwl-core.h inclusions
iwlwifi: remove num_of_queues module parameter
iwlwifi: remove max_txq_num from hw_params
iwlwifi: keep plcp_delta_threshold in priv
iwlwifi: use watchdog timeout from hw_params
iwlwifi: put use_rts_for_aggregation into hw_params
iwlwifi: constify remaining config data
iwlwifi: fix notification wait bug
iwlwifi: abstract out notification wait support
iwlwifi: move ucode_owner to priv
iwlwifi: move all uCode load variables
iwlwifi: move irq to PCIe
iwlwifi: move packet to transport
iwlwifi: virtualize nic_config
iwlwifi: remove priv from shared
iwlwifi: remove PA type configuration
iwlwifi: don't include iwl-prph.h everywhere
iwlwifi: clean up iwl-commands.h
iwlwifi: make iwl_fill_probe_req static
these patches are also available from wireless-next branch on
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git
PATCH RESEND 1/33 iwlwifi: move ucode loading to op_mode
From: Johannes Berg <[email protected]>
uCode loading belongs to the op_mode, as it is dependent on various things there and the commands sent during it are specific to it. Move the prototypes to iwl-agn.h to indicate this. To make this possible, also move all the calibration handling (which is op_mode dependent after all).
--- drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 26 ++- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 9 +- drivers/net/wireless/iwlwifi/iwl-agn.h | 10 ++ drivers/net/wireless/iwlwifi/iwl-dev.h | 2 + drivers/net/wireless/iwlwifi/iwl-mac80211.c | 4 +- drivers/net/wireless/iwlwifi/iwl-shared.h | 14 +- drivers/net/wireless/iwlwifi/iwl-testmode.c | 8 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 1 - drivers/net/wireless/iwlwifi/iwl-trans.h | 19 --- drivers/net/wireless/iwlwifi/iwl-ucode.c | 205 ++++++++++++------------- drivers/net/wireless/iwlwifi/iwl-wifi.h | 8 - 13 files changed, 150 insertions(+), 160 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-calib.c +17 -9
@@ -75,6 +75,14 @@* INIT calibrations framework *****************************************************************************/ +/* Opaque calibration results */ +struct iwl_calib_result { +struct list_head list; +size_t cmd_len; +struct iwl_calib_hdr hdr; +/* data follows */ +}; +struct statistics_general_data {u32 beacon_silence_rssi_a;u32 beacon_silence_rssi_b;
@@ -84,7 +92,7 @@ struct statistics_general_data {u32 beacon_energy_c; }; -int iwl_send_calib_results (struct iwl_trans *trans) +int iwl_send_calib_results (struct iwl_priv *priv) {struct iwl_host_cmd hcmd = { .id =REPLY_PHY_CALIBRATION_CMD ,
@@ -92,15 +100,15 @@ int iwl_send_calib_results(struct iwl_trans *trans) };struct iwl_calib_result *res; -list_for_each_entry (res, &trans->calib_results, list) { +list_for_each_entry (res, &priv->calib_results, list) {int ret; hcmd.len[0 ] = res->cmd_len; hcmd.data[0 ] = &res->hdr; hcmd.dataflags[0 ] =IWL_HCMD_DFL_NOCOPY ; - ret =iwl_trans_send_cmd (trans, &hcmd); + ret =iwl_trans_send_cmd (trans (priv), &hcmd);if (ret) { -IWL_ERR (trans,"Error %d on calib cmd %d\n" , +IWL_ERR (priv,"Error %d on calib cmd %d\n" , ret, res->hdr.op_code);return ret; }
@@ -109,7 +117,7 @@ int iwl_send_calib_results(struct iwl_trans *trans)return 0 ; } -int iwl_calib_set (struct iwl_trans *trans, +int iwl_calib_set (struct iwl_priv *priv,const struct iwl_calib_hdr *cmd,int len) {struct iwl_calib_result *res, *tmp;
@@ -121,7 +129,7 @@ int iwl_calib_set(struct iwl_trans *trans,memcpy (&res->hdr, cmd, len); res->cmd_len = len; -list_for_each_entry (tmp, &trans->calib_results, list) { +list_for_each_entry (tmp, &priv->calib_results, list) {if (tmp->hdr.op_code == res->hdr.op_code) {list_replace (&tmp->list, &res->list);kfree (tmp);
@@ -130,16 +138,16 @@ int iwl_calib_set(struct iwl_trans *trans, }/* wasn't in list already */ -list_add_tail (&res->list, &trans->calib_results); +list_add_tail (&res->list, &priv->calib_results);return 0 ; } -void iwl_calib_free_results (struct iwl_trans *trans) +void iwl_calib_free_results (struct iwl_priv *priv) {struct iwl_calib_result *res, *tmp; -list_for_each_entry_safe (res, tmp, &trans->calib_results, list) { +list_for_each_entry_safe (res, tmp, &priv->calib_results, list) {list_del (&res->list);kfree (res); }
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
@@ -1195,7 +1195,7 @@ int iwlagn_suspend(struct iwl_priv *priv, priv->wowlan = true; - ret =iwl_load_ucode_wait_alive (trans (priv),IWL_UCODE_WOWLAN ); + ret =iwl_load_ucode_wait_alive (priv,IWL_UCODE_WOWLAN );if (ret) goto out;
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +1 -1
@@ -1177,7 +1177,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb, pkt->hdr.cmd); w->triggered = true;if (w->fn) - w->fn (trans (priv), pkt, w->fn_data); + w->fn (priv, pkt, w->fn_data); }spin_unlock (&priv->shrd->notif_wait_lock);
drivers/net/wireless/iwlwifi/iwl-agn.c +5 -4
@@ -671,14 +671,14 @@ int iwl_alive_start(struct iwl_priv *priv) priv->bt_valid =IWLAGN_BT_VALID_ENABLE_FLAGS ; priv->cur_rssi_ctx =NULL ; -iwl_send_prio_tbl (trans (priv)); +iwl_send_prio_tbl (priv);/* FIXME: w/a to force change uCode BT state machine */ - ret =iwl_send_bt_env (trans (priv),IWL_BT_COEX_ENV_OPEN , + ret =iwl_send_bt_env (priv,IWL_BT_COEX_ENV_OPEN ,BT_COEX_PRIO_TBL_EVT_INIT_CALIB2 );if (ret)return ret; - ret =iwl_send_bt_env (trans (priv),IWL_BT_COEX_ENV_CLOSE , + ret =iwl_send_bt_env (priv,IWL_BT_COEX_ENV_CLOSE ,BT_COEX_PRIO_TBL_EVT_INIT_CALIB2 );if (ret)return ret;
@@ -1040,7 +1040,7 @@ static int iwl_init_drv(struct iwl_priv *priv)mutex_init (&priv->shrd->mutex); -INIT_LIST_HEAD (&trans (priv)->calib_results); +INIT_LIST_HEAD (&priv->calib_results); priv->ieee_channels =NULL ; priv->ieee_rates =NULL ;
@@ -1105,6 +1105,7 @@ static void iwl_uninit_drv(struct iwl_priv *priv)kfree (priv->scan_cmd);kfree (priv->beacon_cmd);kfree (rcu_dereference_raw (priv->noa_data)); +iwl_calib_free_results (priv);#ifdef CONFIG_IWLWIFI_DEBUGFS kfree (priv->wowlan_sram);#endif
drivers/net/wireless/iwlwifi/iwl-agn.h +10 -0
@@ -113,6 +113,16 @@ int iwlagn_rx_calib_result(struct iwl_priv *priv,struct iwl_rx_cmd_buffer *rxb, struct iwl_device_cmd *cmd);void iwl_init_context (struct iwl_priv *priv,u32 ucode_flags); +int iwl_send_bt_env (struct iwl_priv *priv,u8 action,u8 type); +void iwl_send_prio_tbl (struct iwl_priv *priv); +int iwl_init_alive_start (struct iwl_priv *priv); +int iwl_run_init_ucode (struct iwl_priv *priv); +int iwl_load_ucode_wait_alive (struct iwl_priv *priv, +enum iwl_ucode_type ucode_type); +int iwl_send_calib_results (struct iwl_priv *priv); +int iwl_calib_set (struct iwl_priv *priv, +const struct iwl_calib_hdr *cmd,int len); +void iwl_calib_free_results (struct iwl_priv *priv);/* lib */ int iwlagn_send_tx_power (struct iwl_priv *priv);
drivers/net/wireless/iwlwifi/iwl-dev.h +2 -0
@@ -724,6 +724,8 @@ struct iwl_priv {struct ieee80211_rate *ieee_rates;struct kmem_cache *tx_cmd_pool; +struct list_head calib_results; +struct workqueue_struct *workqueue;enum ieee80211_band band;
drivers/net/wireless/iwlwifi/iwl-mac80211.c +2 -2
@@ -278,13 +278,13 @@ static int __iwl_up(struct iwl_priv *priv) } } - ret =iwl_run_init_ucode (trans (priv)); + ret =iwl_run_init_ucode (priv);if (ret) {IWL_ERR (priv,"Failed to run INIT ucode: %d\n" , ret); goto error; } - ret =iwl_load_ucode_wait_alive (trans (priv),IWL_UCODE_REGULAR ); + ret =iwl_load_ucode_wait_alive (priv,IWL_UCODE_REGULAR );if (ret) {IWL_ERR (priv,"Failed to start RT ucode: %d\n" , ret); goto error;
drivers/net/wireless/iwlwifi/iwl-shared.h +7 -7
@@ -233,7 +233,7 @@ enum iwl_ucode_type {struct iwl_notification_wait {struct list_head list; -void (*fn)(struct iwl_trans *trans,struct iwl_rx_packet *pkt, +void (*fn)(struct iwl_priv *priv,struct iwl_rx_packet *pkt,void *data);void *fn_data;
@@ -472,12 +472,12 @@ bool iwl_check_for_ct_kill(struct iwl_priv *priv);void iwl_abort_notification_waits (struct iwl_shared *shrd); void __acquires(wait_entry) iwl_init_notification_wait(struct iwl_shared *shrd, - struct iwl_notification_wait *wait_entry, - u8 cmd, - void (*fn)(struct iwl_trans *trans, - struct iwl_rx_packet *pkt, - void *data), - void *fn_data); + struct iwl_notification_wait *wait_entry, + u8 cmd, + void (*fn)(struct iwl_priv *priv, + struct iwl_rx_packet *pkt, + void *data), + void *fn_data); int __must_check __releases(wait_entry) iwl_wait_notification(struct iwl_shared *shrd, struct iwl_notification_wait *wait_entry,
drivers/net/wireless/iwlwifi/iwl-testmode.c +4 -4
@@ -422,7 +422,7 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)iwl_init_notification_wait (priv->shrd, &calib_wait,CALIBRATION_COMPLETE_NOTIFICATION ,NULL ,NULL ); - ret =iwl_init_alive_start (trans (priv)); + ret =iwl_init_alive_start (priv);if (ret) {IWL_ERR (priv,"Fail init calibration: %d\n" , ret); goto cfg_init_calib_error;
@@ -484,7 +484,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)break ;case IWL_TM_CMD_APP2DEV_LOAD_INIT_FW : - status =iwl_load_ucode_wait_alive (trans,IWL_UCODE_INIT ); + status =iwl_load_ucode_wait_alive (priv,IWL_UCODE_INIT );if (status)IWL_ERR (priv,"Error loading init ucode: %d\n" , status);break ;
@@ -495,7 +495,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)break ;case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW : - status =iwl_load_ucode_wait_alive (trans,IWL_UCODE_REGULAR ); + status =iwl_load_ucode_wait_alive (priv,IWL_UCODE_REGULAR );if (status) {IWL_ERR (priv,"Error loading runtime ucode: %d\n" , status);
@@ -510,7 +510,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)case IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW :iwl_scan_cancel_timeout (priv,200 );iwl_trans_stop_device (trans); - status =iwl_load_ucode_wait_alive (trans,IWL_UCODE_WOWLAN ); + status =iwl_load_ucode_wait_alive (priv,IWL_UCODE_WOWLAN );if (status) {IWL_ERR (priv,"Error loading WOWLAN ucode: %d\n" , status);
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +0 -1
@@ -1632,7 +1632,6 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); -iwl_calib_free_results (trans);iwl_trans_pcie_tx_free (trans);#ifndef CONFIG_IWLWIFI_IDI iwl_trans_pcie_rx_free (trans);
drivers/net/wireless/iwlwifi/iwl-trans.h +0 -19
@@ -315,14 +315,6 @@ struct iwl_trans_ops {u32 (*read32)(struct iwl_trans *trans,u32 ofs); }; -/* Opaque calibration results */ -struct iwl_calib_result { -struct list_head list; -size_t cmd_len; -struct iwl_calib_hdr hdr; -/* data follows */ -}; -/** * enum iwl_trans_state - state of the transport layer *
@@ -349,7 +341,6 @@ enum iwl_trans_state {* @ucode_write_complete: indicates that the ucode has been copied. * @nvm_device_type: indicates OTP or eeprom * @pm_support: set to true in start_hw if link pm is supported -* @calib_results: list head for init calibration results */ struct iwl_trans {const struct iwl_trans_ops *ops;
@@ -369,8 +360,6 @@ struct iwl_trans {int nvm_device_type;bool pm_support; -struct list_head calib_results; -/* pointer to trans specific struct */ /*Ensure that this pointer will always be aligned to sizeof pointer */ char trans_specific[0 ]__aligned(sizeof(void *)) ;
@@ -574,14 +563,6 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) }/***************************************************** -* Utils functions -******************************************************/ -int iwl_send_calib_results (struct iwl_trans *trans); -int iwl_calib_set (struct iwl_trans *trans, -const struct iwl_calib_hdr *cmd,int len); -void iwl_calib_free_results (struct iwl_trans *trans); - -/***************************************************** * Transport layers implementations + their allocation function ******************************************************/ struct pci_dev ;
drivers/net/wireless/iwlwifi/iwl-ucode.c +101 -104
531 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-wifi.h +0 -8
@@ -95,12 +95,4 @@ struct iwl_nic { struct completion request_firmware_complete; }; - - -int iwl_send_bt_env (struct iwl_trans *trans,u8 action,u8 type); -void iwl_send_prio_tbl (struct iwl_trans *trans); -int iwl_init_alive_start (struct iwl_trans *trans); -int iwl_run_init_ucode (struct iwl_trans *trans); -int iwl_load_ucode_wait_alive (struct iwl_trans *trans, -enum iwl_ucode_type ucode_type);#endif /* __iwl_wifi_h__ */
Signature · 1 line
1.7.0.4
PATCH RESEND 3/33 iwlwifi: remove iwl-wifi.h
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This file was recently introduced, but then
directly abused -- it contained private data
that shouldn't have been used by anything
but the implementation of firmware requests
and some very core code. Now that it is no
longer accessed by any code but the code iniwl-drv.c, we can dissolve it.
Also rename the iwl_nic struct to iwl_drv to
better reflect where and how it is used.
--- drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 1 - drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 - drivers/net/wireless/iwlwifi/iwl-agn.c | 1 - drivers/net/wireless/iwlwifi/iwl-core.c | 1 - drivers/net/wireless/iwlwifi/iwl-debugfs.c | 1 - drivers/net/wireless/iwlwifi/iwl-drv.c | 272 ++++++++++++---------- drivers/net/wireless/iwlwifi/iwl-mac80211.c | 1 - drivers/net/wireless/iwlwifi/iwl-shared.h | 2 +- drivers/net/wireless/iwlwifi/iwl-testmode.c | 1 - drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 1 - drivers/net/wireless/iwlwifi/iwl-ucode.c | 1 - drivers/net/wireless/iwlwifi/iwl-wifi.h | 88 ------- 12 files changed, 148 insertions(+), 223 deletions(-) delete mode 100644 drivers/net/wireless/iwlwifi/iwl-wifi.h
drivers/net/wireless/iwlwifi/iwl-agn-calib.c +0 -1
@@ -68,7 +68,6 @@#include "iwl-agn-calib.h" #include "iwl-trans.h" #include "iwl-agn.h" -#include "iwl-wifi.h" /***************************************************************************** * INIT calibrations framework
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +0 -1
@@ -32,7 +32,6 @@#include <linux/init.h> #include <linux/sched.h> -#include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-io.h"
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -1
@@ -42,7 +42,6 @@#include <asm/div64.h> #include "iwl-eeprom.h" -#include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-io.h"
drivers/net/wireless/iwlwifi/iwl-core.c +0 -1
@@ -41,7 +41,6 @@#include "iwl-shared.h" #include "iwl-agn.h" #include "iwl-trans.h" -#include "iwl-wifi.h" const u8 iwl_bcast_addr[ETH_ALEN ] = {0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF };
drivers/net/wireless/iwlwifi/iwl-debugfs.c +0 -1
@@ -40,7 +40,6 @@#include "iwl-core.h" #include "iwl-io.h" #include "iwl-agn.h" -#include "iwl-wifi.h" /* create and remove of files */ #define DEBUGFS_ADD_FILE (name, parent, mode) do { \
drivers/net/wireless/iwlwifi/iwl-drv.c +147 -125
585 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-mac80211.c +0 -1
@@ -43,7 +43,6 @@#include <asm/div64.h> #include "iwl-eeprom.h" -#include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-io.h"
drivers/net/wireless/iwlwifi/iwl-shared.h +1 -1
@@ -419,7 +419,7 @@ struct iwl_shared {const struct iwl_cfg *cfg;struct iwl_priv *priv;struct iwl_trans *trans; -void *nic; +void *drv;struct iwl_hw_params hw_params;const struct iwl_fw *fw;
drivers/net/wireless/iwlwifi/iwl-testmode.c +0 -1
@@ -70,7 +70,6 @@#include <net/mac80211.h> #include <net/netlink.h> -#include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-debug.h"
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +0 -1
@@ -34,7 +34,6 @@#include "iwl-core.h" #include "iwl-io.h" #include "iwl-trans-pcie-int.h" -#include "iwl-wifi.h" #include "iwl-op-mode.h" #ifdef CONFIG_IWLWIFI_IDI
drivers/net/wireless/iwlwifi/iwl-ucode.c +0 -1
@@ -31,7 +31,6 @@#include <linux/init.h> #include <linux/sched.h> -#include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h" #include "iwl-io.h"
drivers/net/wireless/iwlwifi/iwl-wifi.h deleted +0 -88
88 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH RESEND 2/33 iwlwifi: split out firmware store
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Through the driver, struct iwl_fw will
store the firmware. Split this out into
a separate file, iwl-fw.h, and make all
other code use it. To do this, also move
the log pointers into it, and remove the
knowledge of "nic" from everything.
Now the op_mode has a fw pointer, and
(unfortunately) for now the shared data
also needs to keep one for the transport
to access dump the error log -- I think
that will move later.
Since I wanted to constify the firmware
pointers, some more changes were needed.
--- drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 5 +- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 10 +- drivers/net/wireless/iwlwifi/iwl-agn.h | 2 +- drivers/net/wireless/iwlwifi/iwl-commands.h | 12 -- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 9 +- drivers/net/wireless/iwlwifi/iwl-dev.h | 1 + drivers/net/wireless/iwlwifi/iwl-drv.c | 49 +++++--- drivers/net/wireless/iwlwifi/iwl-fw.h | 146 ++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-mac80211.c | 10 +- drivers/net/wireless/iwlwifi/iwl-op-mode.h | 4 +- drivers/net/wireless/iwlwifi/iwl-shared.h | 5 +- drivers/net/wireless/iwlwifi/iwl-testmode.c | 16 ++-- drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 23 ++-- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 9 +- drivers/net/wireless/iwlwifi/iwl-trans.h | 5 +- drivers/net/wireless/iwlwifi/iwl-ucode.c | 21 ++-- drivers/net/wireless/iwlwifi/iwl-ucode.h | 60 --------- drivers/net/wireless/iwlwifi/iwl-wifi.h | 10 -- 19 files changed, 236 insertions(+), 163 deletions(-) create mode 100644 drivers/net/wireless/iwlwifi/iwl-fw.h
drivers/net/wireless/iwlwifi/iwl-agn-calib.c +2 -3
@@ -69,7 +69,6 @@#include "iwl-trans.h" #include "iwl-agn.h" #include "iwl-wifi.h" -#include "iwl-ucode.h" /***************************************************************************** * INIT calibrations framework
@@ -644,7 +643,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv) data->last_bad_plcp_cnt_cck =0 ; data->last_fa_cnt_cck =0 ; -if (nic (priv)->fw.enhance_sensitivity_table) +if (priv->fw->enhance_sensitivity_table) ret |=iwl_enhance_sensitivity_write (priv);else ret |=iwl_sensitivity_write (priv);
@@ -754,7 +753,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)iwl_sens_auto_corr_ofdm (priv, norm_fa_ofdm, rx_enable_time);iwl_sens_energy_cck (priv, norm_fa_cck, rx_enable_time, &statis); -if (nic (priv)->fw.enhance_sensitivity_table) +if (priv->fw->enhance_sensitivity_table)iwl_enhance_sensitivity_write (priv);else iwl_sensitivity_write (priv);
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
@@ -77,7 +77,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv) tx_power_cmd.flags =IWLAGN_TX_POWER_NO_CLOSED ; tx_power_cmd.srv_chan_lmt =IWLAGN_TX_POWER_AUTO ; -if (IWL_UCODE_API (nic (priv)->fw.ucode_ver) ==1 ) +if (IWL_UCODE_API (priv->fw->ucode_ver) ==1 ) tx_ant_cfg_cmd =REPLY_TX_POWER_DBM_CMD_V1 ;else tx_ant_cfg_cmd =REPLY_TX_POWER_DBM_CMD ;
drivers/net/wireless/iwlwifi/iwl-agn.c +6 -4
@@ -41,7 +41,6 @@#include <asm/div64.h> -#include "iwl-ucode.h" #include "iwl-eeprom.h" #include "iwl-wifi.h" #include "iwl-dev.h"
@@ -616,7 +615,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant) .valid = cpu_to_le32(valid_tx_ant), }; -if (IWL_UCODE_API (nic (priv)->fw.ucode_ver) >1 ) { +if (IWL_UCODE_API (priv->fw->ucode_ver) >1 ) {IWL_DEBUG_HC (priv,"select valid tx ant: %u\n" , valid_tx_ant); return iwl_trans_send_cmd_pdu(trans(priv), TX_ANT_CONFIGURATION_CMD,
@@ -1174,9 +1173,9 @@ static void iwl_debug_config(struct iwl_priv *priv)#endif } -static struct iwl_op_mode *iwl_op_mode_dvm_start (struct iwl_trans *trans) +static struct iwl_op_mode *iwl_op_mode_dvm_start (struct iwl_trans *trans, +const struct iwl_fw *fw) { -struct iwl_fw *fw = &nic (trans)->fw;int err =0 ;struct iwl_priv *priv;struct ieee80211_hw *hw;
@@ -1200,6 +1199,9 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans) priv =IWL_OP_MODE_GET_DVM (op_mode); priv->shrd = trans->shrd; priv->shrd->priv = priv; + priv->fw = fw; +/* TODO: remove fw from shared data later */ + priv->shrd->fw = fw;iwl_trans_configure (trans (priv), op_mode);
drivers/net/wireless/iwlwifi/iwl-agn.h +1 -1
@@ -93,7 +93,7 @@ void iwl_nic_error(struct iwl_op_mode *op_mode);/* MAC80211 */ struct ieee80211_hw *iwl_alloc_all (void );int iwlagn_mac_setup_register (struct iwl_priv *priv, -struct iwl_ucode_capabilities *capa); +const struct iwl_ucode_capabilities *capa);void iwlagn_mac_unregister (struct iwl_priv *priv);/* RXON */
drivers/net/wireless/iwlwifi/iwl-commands.h +0 -12
@@ -74,13 +74,6 @@struct iwl_priv ; -/* uCode version contains 4 values: Major/Minor/API/Serial */ -#define IWL_UCODE_MAJOR (ver) (((ver) & 0xFF000000) >> 24) -#define IWL_UCODE_MINOR (ver) (((ver) & 0x00FF0000) >> 16) -#define IWL_UCODE_API (ver) (((ver) & 0x0000FF00) >> 8) -#define IWL_UCODE_SERIAL (ver) ((ver) & 0x000000FF) - -/* Tx rates */ #define IWL_CCK_RATES 4#define IWL_OFDM_RATES 8
@@ -3151,8 +3144,6 @@ struct iwl_enhance_sensitivity_cmd {*/ /* Phy calibration command for series */ -/* The default calibrate table size if not specified by firmware */ -#define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18enum {IWL_PHY_CALIBRATE_DC_CMD =8 ,IWL_PHY_CALIBRATE_LO_CMD =9 ,
@@ -3161,11 +3152,8 @@ enum {IWL_PHY_CALIBRATE_BASE_BAND_CMD =16 ,IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD =17 , IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD = 18, - IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 19, }; -#define IWL_MAX_PHY_CALIBRATE_TBL_SIZE (253) -/* This enum defines the bitmap of various calibrations to enable in both * init ucode and runtime ucode through CALIBRATION_CFG_CMD. */
drivers/net/wireless/iwlwifi/iwl-debugfs.c +4 -5
@@ -235,12 +235,11 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,/* default is to dump the entire data segment */ if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { -struct iwl_nic *nic =nic (priv); priv->dbgfs_sram_offset =0x800000 ; -if (nic->shrd->ucode_type ==IWL_UCODE_INIT ) - priv->dbgfs_sram_len = nic->fw.ucode_init.data.len; +if (priv->shrd->ucode_type ==IWL_UCODE_INIT ) + priv->dbgfs_sram_len = priv->fw->ucode_init.data.len;else - priv->dbgfs_sram_len = nic->fw.ucode_rt.data.len; + priv->dbgfs_sram_len = priv->fw->ucode_rt.data.len; } len = priv->dbgfs_sram_len;
@@ -343,7 +342,7 @@ static ssize_t iwl_dbgfs_wowlan_sram_read(struct file *file,return simple_read_from_buffer (user_buf, count, ppos, priv->wowlan_sram, -nic (priv)->fw.ucode_wowlan.data.len); + priv->fw->ucode_wowlan.data.len); }static ssize_t iwl_dbgfs_stations_read (struct file *file,char __user *user_buf,size_t count,loff_t *ppos)
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -0
@@ -715,6 +715,7 @@ struct iwl_priv {/*data shared among all the driver's layers */ struct iwl_shared *shrd; +const struct iwl_fw *fw;spinlock_t sta_lock;
drivers/net/wireless/iwlwifi/iwl-drv.c +29 -20
99 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-fw.h new file +146 -0
146 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-mac80211.c +4 -6
@@ -42,7 +42,6 @@#include <asm/div64.h> -#include "iwl-ucode.h" #include "iwl-eeprom.h" #include "iwl-wifi.h" #include "iwl-dev.h"
@@ -136,7 +135,7 @@ iwlagn_iface_combinations_p2p[] = {* other mac80211 functions grouped here. */ int iwlagn_mac_setup_register (struct iwl_priv *priv, -struct iwl_ucode_capabilities *capa) +const struct iwl_ucode_capabilities *capa) {int ret;struct ieee80211_hw *hw = priv->hw;
@@ -195,7 +194,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,WIPHY_FLAG_DISABLE_BEACON_HINTS |WIPHY_FLAG_IBSS_RSN ; -if (nic (priv)->fw.ucode_wowlan.code.len && +if (priv->fw->ucode_wowlan.code.len &&trans (priv)->ops->wowlan_suspend &&device_can_wakeup (trans (priv)->dev)) { hw->wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
@@ -456,17 +455,16 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)#ifdef CONFIG_IWLWIFI_DEBUGFS if (ret ==0 ) { -struct iwl_nic *nic =nic (priv);if (!priv->wowlan_sram) priv->wowlan_sram = -kzalloc (nic->fw.ucode_wowlan.data.len, +kzalloc (priv->fw->ucode_wowlan.data.len,GFP_KERNEL );if (priv->wowlan_sram)_iwl_read_targ_mem_words (trans (priv),0x800000 , priv->wowlan_sram, - nic->fw.ucode_wowlan.data.len /4 ); + priv->fw->ucode_wowlan.data.len /4 ); }#endif }
drivers/net/wireless/iwlwifi/iwl-op-mode.h +3 -1
@@ -68,6 +68,7 @@ struct iwl_trans;struct sk_buff ;struct iwl_device_cmd ;struct iwl_rx_cmd_buffer ; +struct iwl_fw ;/** * DOC: Operational mode - what is it ?
@@ -123,7 +124,8 @@ struct iwl_rx_cmd_buffer;* @nic_error: error notification. Must be atomic */ struct iwl_op_mode_ops { -struct iwl_op_mode *(*start)(struct iwl_trans *trans); +struct iwl_op_mode *(*start)(struct iwl_trans *trans, +const struct iwl_fw *fw);void (*stop)(struct iwl_op_mode *op_mode);int (*rx)(struct iwl_op_mode *op_mode,struct iwl_rx_cmd_buffer *rxb,struct iwl_device_cmd *cmd);
drivers/net/wireless/iwlwifi/iwl-shared.h +3 -2
@@ -70,6 +70,7 @@#include <net/mac80211.h> #include "iwl-commands.h" +#include "iwl-fw.h" /** * DOC: shared area - role and goal
@@ -418,8 +419,9 @@ struct iwl_shared {const struct iwl_cfg *cfg;struct iwl_priv *priv;struct iwl_trans *trans; -struct iwl_nic *nic; +void *nic;struct iwl_hw_params hw_params; +const struct iwl_fw *fw;struct mutex mutex;
@@ -446,7 +448,6 @@ struct iwl_shared {/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */ #define priv (_m) ((_m)->shrd->priv)#define cfg (_m) ((_m)->shrd->cfg) -#define nic (_m) ((_m)->shrd->nic)#define trans (_m) ((_m)->shrd->trans)#define hw_params (_m) ((_m)->shrd->hw_params)
drivers/net/wireless/iwlwifi/iwl-testmode.c +8 -8
@@ -553,7 +553,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)case IWL_TM_CMD_APP2DEV_GET_FW_VERSION :IWL_INFO (priv,"uCode version raw: 0x%x\n" , -nic (priv)->fw.ucode_ver); + priv->fw->ucode_ver); skb =cfg80211_testmode_alloc_reply_skb (hw->wiphy,20 );if (!skb) {
@@ -561,7 +561,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)return -ENOMEM ; }NLA_PUT_U32 (skb,IWL_TM_ATTR_FW_VERSION , -nic (priv)->fw.ucode_ver); + priv->fw->ucode_ver); status =cfg80211_testmode_reply (skb);if (status <0 )IWL_ERR (priv,"Error sending msg : %d\n" , status);
@@ -590,16 +590,16 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) }switch (priv->shrd->ucode_type) {case IWL_UCODE_REGULAR : - inst_size =nic (priv)->fw.ucode_rt.code.len; - data_size =nic (priv)->fw.ucode_rt.data.len; + inst_size = priv->fw->ucode_rt.code.len; + data_size = priv->fw->ucode_rt.data.len;break ;case IWL_UCODE_INIT : - inst_size =nic (priv)->fw.ucode_init.code.len; - data_size =nic (priv)->fw.ucode_init.data.len; + inst_size = priv->fw->ucode_init.code.len; + data_size = priv->fw->ucode_init.data.len;break ;case IWL_UCODE_WOWLAN : - inst_size =nic (priv)->fw.ucode_wowlan.code.len; - data_size =nic (priv)->fw.ucode_wowlan.data.len; + inst_size = priv->fw->ucode_wowlan.code.len; + data_size = priv->fw->ucode_wowlan.data.len;break ;case IWL_UCODE_NONE :IWL_ERR (priv,"No uCode has not been loaded\n" );
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +10 -13
@@ -602,17 +602,16 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) {u32 base;struct iwl_error_event_table table; -struct iwl_nic *nic =nic (trans);struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); base = trans->shrd->device_pointers.error_event_table;if (trans->shrd->ucode_type ==IWL_UCODE_INIT ) {if (!base) - base = nic->init_errlog_ptr; + base = trans->shrd->fw->init_errlog_ptr; }else {if (!base) - base = nic->inst_errlog_ptr; + base = trans->shrd->fw->inst_errlog_ptr; }if (!iwlagn_hw_valid_rtc_data_addr (base)) {
@@ -634,7 +633,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) trans_pcie->isr_stats.err_code = table.error_id; - trace_iwlwifi_dev_ucode_error(priv(nic), table.error_id, table.tsf_low, + trace_iwlwifi_dev_ucode_error(priv(trans), table.error_id, table.tsf_low, table.data1, table.data2, table.line, table.blink1, table.blink2, table.ilink1, table.ilink2, table.bcon_time, table.gp1,
@@ -700,7 +699,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) }IWL_ERR (trans,"Loaded firmware version: %s\n" , -nic (trans)->fw.fw_version); + trans->shrd->fw->fw_version);iwl_dump_nic_error_log (trans);iwl_dump_csr (trans);
@@ -726,7 +725,6 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,u32 ptr;/* SRAM byte address of log data */ u32 ev, time, data;/* event log data */ unsigned long reg_flags; -struct iwl_nic *nic =nic (trans);if (num_events ==0 )return pos;
@@ -734,10 +732,10 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, base = trans->shrd->device_pointers.log_event_table;if (trans->shrd->ucode_type ==IWL_UCODE_INIT ) {if (!base) - base = nic->init_evtlog_ptr; + base = trans->shrd->fw->init_evtlog_ptr; }else {if (!base) - base = nic->inst_evtlog_ptr; + base = trans->shrd->fw->inst_evtlog_ptr; }if (mode ==0 )
@@ -843,17 +841,16 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,u32 logsize;int pos =0 ;size_t bufsz =0 ; -struct iwl_nic *nic =nic (trans); base = trans->shrd->device_pointers.log_event_table;if (trans->shrd->ucode_type ==IWL_UCODE_INIT ) { - logsize = nic->init_evtlog_size; + logsize = trans->shrd->fw->init_evtlog_size;if (!base) - base = nic->init_evtlog_ptr; + base = trans->shrd->fw->init_evtlog_ptr; }else { - logsize = nic->inst_evtlog_size; + logsize = trans->shrd->fw->inst_evtlog_size;if (!base) - base = nic->inst_evtlog_ptr; + base = trans->shrd->fw->inst_evtlog_ptr; }if (!iwlagn_hw_valid_rtc_data_addr (base)) {
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +5 -4
@@ -76,7 +76,6 @@#include "iwl-eeprom.h" #include "iwl-agn-hw.h" #include "iwl-core.h" -#include "iwl-ucode.h" #define IWL_MASK (lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
@@ -947,7 +946,7 @@ static const u8 iwlagn_pan_ac_to_queue[] = {* ucode */ static int iwl_load_section (struct iwl_trans *trans,const char *name, -struct fw_desc *image,u32 dst_addr) +const struct fw_desc *image,u32 dst_addr) {dma_addr_t phy_addr = image->p_addr;u32 byte_cnt = image->len;
@@ -995,7 +994,8 @@ static int iwl_load_section(struct iwl_trans *trans, const char *name,return 0 ; } -static int iwl_load_given_ucode (struct iwl_trans *trans,struct fw_img *image) +static int iwl_load_given_ucode (struct iwl_trans *trans, +const struct fw_img *image) {int ret =0 ;
@@ -1015,7 +1015,8 @@ static int iwl_load_given_ucode(struct iwl_trans *trans, struct fw_img *image)return 0 ; } -static int iwl_trans_pcie_start_fw (struct iwl_trans *trans,struct fw_img *fw) +static int iwl_trans_pcie_start_fw (struct iwl_trans *trans, +const struct fw_img *fw) {int ret; struct iwl_trans_pcie *trans_pcie =
drivers/net/wireless/iwlwifi/iwl-trans.h +3 -2
@@ -272,7 +272,7 @@ struct iwl_trans_ops {int (*start_hw)(struct iwl_trans *iwl_trans);void (*stop_hw)(struct iwl_trans *iwl_trans); -int (*start_fw)(struct iwl_trans *trans,struct fw_img *fw); +int (*start_fw)(struct iwl_trans *trans,const struct fw_img *fw);void (*fw_alive)(struct iwl_trans *trans);void (*stop_device)(struct iwl_trans *trans);
@@ -400,7 +400,8 @@ static inline void iwl_trans_fw_alive(struct iwl_trans *trans) trans->state =IWL_TRANS_FW_ALIVE ; } -static inline int iwl_trans_start_fw (struct iwl_trans *trans,struct fw_img *fw) +static inline int iwl_trans_start_fw (struct iwl_trans *trans, +const struct fw_img *fw) {might_sleep ();
drivers/net/wireless/iwlwifi/iwl-ucode.c +10 -11
@@ -31,7 +31,6 @@#include <linux/init.h> #include <linux/sched.h> -#include "iwl-ucode.h" #include "iwl-wifi.h" #include "iwl-dev.h" #include "iwl-core.h"
@@ -80,16 +79,16 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = {* ******************************************************************************/ -static inline struct fw_img *iwl_get_ucode_image (struct iwl_priv *priv, -enum iwl_ucode_type ucode_type) +static inline const struct fw_img * +iwl_get_ucode_image (struct iwl_priv *priv,enum iwl_ucode_type ucode_type) {switch (ucode_type) {case IWL_UCODE_INIT : -return &nic (priv)->fw.ucode_init; +return &priv->fw->ucode_init;case IWL_UCODE_WOWLAN : -return &nic (priv)->fw.ucode_wowlan; +return &priv->fw->ucode_wowlan;case IWL_UCODE_REGULAR : -return &nic (priv)->fw.ucode_rt; +return &priv->fw->ucode_rt;case IWL_UCODE_NONE :break ; }
@@ -355,7 +354,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)* it's a pretty good bet that everything between them is good, too. */ static int iwl_verify_inst_sparse (struct iwl_priv *priv, -struct fw_desc *fw_desc) +const struct fw_desc *fw_desc) {__le32 *image = (__le32 *)fw_desc->v_addr;u32 len = fw_desc->len;
@@ -379,7 +378,7 @@ static int iwl_verify_inst_sparse(struct iwl_priv *priv, }static void iwl_print_mismatch_inst (struct iwl_priv *priv, -struct fw_desc *fw_desc) +const struct fw_desc *fw_desc) {__le32 *image = (__le32 *)fw_desc->v_addr;u32 len = fw_desc->len;
@@ -413,7 +412,7 @@ static void iwl_print_mismatch_inst(struct iwl_priv *priv,static int iwl_verify_ucode (struct iwl_priv *priv,enum iwl_ucode_type ucode_type) { -struct fw_img *img =iwl_get_ucode_image (priv, ucode_type); +const struct fw_img *img =iwl_get_ucode_image (priv, ucode_type);if (!img) {IWL_ERR (priv,"Invalid ucode requested (%d)\n" , ucode_type);
@@ -531,7 +530,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, {struct iwl_notification_wait alive_wait;struct iwl_alive_data alive_data; -struct fw_img *fw; +const struct fw_img *fw;int ret;enum iwl_ucode_type old_type;
@@ -604,7 +603,7 @@ int iwl_run_init_ucode(struct iwl_priv *priv)lockdep_assert_held (&priv->shrd->mutex);/* No init ucode required? Curious, but maybe ok */ -if (!nic (priv)->fw.ucode_init.code.len) +if (!priv->fw->ucode_init.code.len)return 0 ;if (priv->shrd->ucode_type !=IWL_UCODE_NONE )
drivers/net/wireless/iwlwifi/iwl-ucode.h +0 -60
70 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-wifi.h +0 -10
@@ -64,7 +64,6 @@#define __iwl_wifi_h__#include "iwl-shared.h" -#include "iwl-ucode.h" /** * struct iwl_nic - nic common data
@@ -73,12 +72,6 @@* @op_mode: the running op_mode * @fw_index: firmware revision to try loading * @firmware_name: composite filename of ucode file to load -* @init_evtlog_ptr: event log offset for init ucode. -* @init_evtlog_size: event log size for init ucode. -* @init_errlog_ptr: error log offfset for init ucode. -* @inst_evtlog_ptr: event log offset for runtime ucode. -* @inst_evtlog_size: event log size for runtime ucode. -* @inst_errlog_ptr: error log offfset for runtime ucode. * @request_firmware_complete: the firmware has been obtained from user space */ struct iwl_nic {
@@ -90,9 +83,6 @@ struct iwl_nic {int fw_index;/* firmware we're trying to load */ char firmware_name[25 ];/* name of firmware file to load */ -u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr; -u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr; - struct completion request_firmware_complete; };#endif /* __iwl_wifi_h__ */
Signature · 1 line
1.7.0.4
PATCH RESEND 5/33 iwlwifi: move RF/CT kill check to command wrapper
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Currently, we cannot send any commands when the uCode is in RF or CT kill, but that will not be true for all new uCode versions, so we need to move the check into the uCode specific code.
Also remove the duplicate rfkill check.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 6 ++++++ drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 19 ++++--------------- 2 files changed, 10 insertions(+), 15 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +6 -0
@@ -1292,6 +1292,12 @@ int iwlagn_suspend(struct iwl_priv *priv,int iwl_dvm_send_cmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd) { +if (iwl_is_rfkill (priv->shrd) ||iwl_is_ctkill (priv->shrd)) { +IWL_WARN (priv,"Not sending command - %s KILL\n" , +iwl_is_rfkill (priv->shrd) ?"RF" :"CT" ); +return -EIO ; + } +return iwl_trans_send_cmd (trans (priv), cmd); }
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +4 -15
@@ -721,12 +721,6 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)if (WARN_ON (copy_size >TFD_MAX_PAYLOAD_SIZE ))return -EINVAL ; -if (iwl_is_rfkill (trans->shrd) ||iwl_is_ctkill (trans->shrd)) { -IWL_WARN (trans,"Not sending command - %s KILL\n" , -iwl_is_rfkill (trans->shrd) ?"RF" :"CT" ); -return -EIO ; - } -spin_lock_bh (&txq->lock);if (iwl_queue_space (q) < ((cmd->flags &CMD_ASYNC ) ?2 :1 )) {
@@ -965,7 +959,7 @@ static int iwl_send_cmd_async(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ret =iwl_enqueue_hcmd (trans, cmd);if (ret <0 ) { -IWL_DEBUG_QUIET_RFKILL (trans, +IWL_ERR (trans,"Error sending %s: enqueue_hcmd failed: %d\n" ,get_cmd_string (cmd->id), ret);return ret;
@@ -984,11 +978,6 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)IWL_DEBUG_INFO (trans,"Attempting to send sync command %s\n" ,get_cmd_string (cmd->id)); -if (test_bit (STATUS_RF_KILL_HW , &trans->shrd->status)) { -IWL_ERR (trans,"Command %s aborted: RF KILL Switch\n" , -get_cmd_string (cmd->id)); -return -ECANCELED ; - }if (test_bit (STATUS_FW_ERROR , &trans->shrd->status)) {IWL_ERR (trans,"Command %s failed: FW Error\n" ,get_cmd_string (cmd->id));
@@ -1002,7 +991,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)if (cmd_idx <0 ) { ret = cmd_idx;clear_bit (STATUS_HCMD_ACTIVE , &trans->shrd->status); -IWL_DEBUG_QUIET_RFKILL (trans, +IWL_ERR (trans,"Error sending %s: enqueue_hcmd failed: %d\n" ,get_cmd_string (cmd->id), ret);return ret;
@@ -1017,12 +1006,12 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) &trans_pcie->txq[trans->shrd->cmd_queue];struct iwl_queue *q = &txq->q; -IWL_DEBUG_QUIET_RFKILL (trans, +IWL_ERR (trans,"Error sending %s: time out after %dms.\n" ,get_cmd_string (cmd->id),jiffies_to_msecs (HOST_COMPLETE_TIMEOUT )); -IWL_DEBUG_QUIET_RFKILL (trans, +IWL_ERR (trans,"Current CMD queue read_ptr %d write_ptr %d\n" , q->read_ptr, q->write_ptr);
Signature · 1 line
1.7.0.4
PATCH RESEND 6/33 iwlwifi: move lockdep assertion into DVM
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The fact that the mutex must be held is an implementation detail of DVM, but something has to ensure that no two synchronous cmds are submitted concurrently. Move the lockdep assertion into the DVM-specific code, but also make the transport abort if there are two concurrently commands.
The assertion is much more useful though as the transport check can only catch it when
it actually happens, while the assertion makes sure it can't possibly happen.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 8 ++++++++ drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +8 -0
@@ -1298,6 +1298,14 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)return -EIO ; } +/* +* Synchronous commands from this op-mode must hold +* the mutex, this ensures we don't try to send two +* (or more) synchronous commands at a time. +*/ +if (cmd->flags &CMD_SYNC ) +lockdep_assert_held (&priv->shrd->mutex); +return iwl_trans_send_cmd (trans (priv), cmd); }
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +8 -3
@@ -973,8 +973,6 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)int cmd_idx;int ret; -lockdep_assert_held (&trans->shrd->mutex); -IWL_DEBUG_INFO (trans,"Attempting to send sync command %s\n" ,get_cmd_string (cmd->id));
@@ -983,7 +981,14 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) get_cmd_string(cmd->id));return -EIO ; } -set_bit (STATUS_HCMD_ACTIVE , &trans->shrd->status); + +if (WARN_ON (test_and_set_bit (STATUS_HCMD_ACTIVE , + &trans->shrd->status))) { +IWL_ERR (trans,"Command %s: a command is already active!\n" , +get_cmd_string (cmd->id)); +return -EIO ; + } +IWL_DEBUG_INFO (trans,"Setting HCMD_ACTIVE for command %s\n" ,get_cmd_string (cmd->id));
Signature · 1 line
1.7.0.4
PATCH RESEND 4/33 iwlwifi: add wrappers for command sending
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.
Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.
--- drivers/net/wireless/iwlwifi/Makefile | 1 - drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-6000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 8 +- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 38 +++++++++--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 16 +++--- drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 8 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 10 ++-- drivers/net/wireless/iwlwifi/iwl-agn.h | 5 ++ drivers/net/wireless/iwlwifi/iwl-core.c | 10 ++-- drivers/net/wireless/iwlwifi/iwl-led.c | 2 +- drivers/net/wireless/iwlwifi/iwl-power.c | 2 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 4 +- drivers/net/wireless/iwlwifi/iwl-testmode.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans.c | 77 -------------------------- drivers/net/wireless/iwlwifi/iwl-trans.h | 3 - drivers/net/wireless/iwlwifi/iwl-ucode.c | 8 +- 17 files changed, 70 insertions(+), 128 deletions(-) delete mode 100644 drivers/net/wireless/iwlwifi/iwl-trans.c
drivers/net/wireless/iwlwifi/Makefile +0 -1
@@ -14,7 +14,6 @@ iwlwifi-objs += iwl-1000.o iwlwifi-objs += iwl-2000.o iwlwifi-objs += iwl-pci.o iwlwifi-objs += iwl-drv.o -iwlwifi-objs += iwl-trans.o iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
drivers/net/wireless/iwlwifi/iwl-5000.c +1 -1
@@ -281,7 +281,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,return -EFAULT ; } -return iwl_trans_send_cmd (trans (priv), &hcmd); +return iwl_dvm_send_cmd (priv, &hcmd); }static struct iwl_lib_ops iwl5000_lib = {
drivers/net/wireless/iwlwifi/iwl-6000.c +1 -1
@@ -232,7 +232,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,return -EFAULT ; } -return iwl_trans_send_cmd (trans (priv), &hcmd); +return iwl_dvm_send_cmd (priv, &hcmd); }static struct iwl_lib_ops iwl6000_lib = {
drivers/net/wireless/iwlwifi/iwl-agn-calib.c +4 -4
@@ -104,7 +104,7 @@ int iwl_send_calib_results(struct iwl_priv *priv) hcmd.len[0 ] = res->cmd_len; hcmd.data[0 ] = &res->hdr; hcmd.dataflags[0 ] =IWL_HCMD_DFL_NOCOPY ; - ret =iwl_trans_send_cmd (trans (priv), &hcmd); + ret =iwl_dvm_send_cmd (priv, &hcmd);if (ret) {IWL_ERR (priv,"Error %d on calib cmd %d\n" , ret, res->hdr.op_code);
@@ -500,7 +500,7 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)memcpy (&(priv->sensitivity_tbl[0 ]), &(cmd.table[0 ]),sizeof (u16)*HD_TABLE_SIZE ); -return iwl_trans_send_cmd (trans (priv), &cmd_out); +return iwl_dvm_send_cmd (priv, &cmd_out); }/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
@@ -589,7 +589,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv) &(cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX ]), sizeof(u16)*ENHANCE_HD_TABLE_ENTRIES); -return iwl_trans_send_cmd (trans (priv), &cmd_out); +return iwl_dvm_send_cmd (priv, &cmd_out); }void iwl_init_sensitivity (struct iwl_priv *priv)
@@ -930,7 +930,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv, priv->phy_calib_chain_noise_gain_cmd); cmd.delta_gain_1 = data->delta_gain_code[1 ]; cmd.delta_gain_2 = data->delta_gain_code[2 ]; -iwl_trans_send_cmd_pdu (trans (priv),REPLY_PHY_CALIBRATION_CMD , +iwl_dvm_send_cmd_pdu (priv,REPLY_PHY_CALIBRATION_CMD ,CMD_ASYNC ,sizeof (cmd), &cmd); data->radio_write =1 ;
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +28 -10
@@ -81,7 +81,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)else tx_ant_cfg_cmd =REPLY_TX_POWER_DBM_CMD ; -return iwl_trans_send_cmd_pdu (trans (priv), tx_ant_cfg_cmd,CMD_SYNC , +return iwl_dvm_send_cmd_pdu (priv, tx_ant_cfg_cmd,CMD_SYNC ,sizeof (tx_power_cmd), &tx_power_cmd); }
@@ -241,7 +241,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control) flush_cmd.fifo_control); flush_cmd.flush_control =cpu_to_le16 (flush_control); -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd); }void iwlagn_dev_txfifo_flush (struct iwl_priv *priv,u16 flush_control)
@@ -435,12 +435,12 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)if (cfg (priv)->bt_params->bt_session_2) {memcpy (&bt_cmd_2000.basic, &basic,sizeof (basic)); - ret =iwl_trans_send_cmd_pdu (trans (priv),REPLY_BT_CONFIG , + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_BT_CONFIG ,CMD_SYNC ,sizeof (bt_cmd_2000), &bt_cmd_2000); }else {memcpy (&bt_cmd_6000.basic, &basic,sizeof (basic)); - ret =iwl_trans_send_cmd_pdu (trans (priv),REPLY_BT_CONFIG , + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_BT_CONFIG ,CMD_SYNC ,sizeof (bt_cmd_6000), &bt_cmd_6000); }if (ret)
@@ -1115,7 +1115,7 @@ int iwlagn_send_patterns(struct iwl_priv *priv, } cmd.data[0 ] = pattern_cmd; - err =iwl_trans_send_cmd (trans (priv), &cmd); + err =iwl_dvm_send_cmd (priv, &cmd);kfree (pattern_cmd);return err; }
@@ -1241,13 +1241,13 @@ int iwlagn_suspend(struct iwl_priv *priv, .len[0] = sizeof(key_data.rsc_tsc), }; - ret =iwl_trans_send_cmd (trans (priv), &rsc_tsc_cmd); + ret =iwl_dvm_send_cmd (priv, &rsc_tsc_cmd);if (ret) goto out; }if (key_data.use_tkip) { - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_WOWLAN_TKIP_PARAMS ,CMD_SYNC ,sizeof (tkip_cmd), &tkip_cmd);
@@ -1263,7 +1263,7 @@ int iwlagn_suspend(struct iwl_priv *priv, kek_kck_cmd.kek_len =cpu_to_le16 (NL80211_KEK_LEN ); kek_kck_cmd.replay_ctr = priv->replay_ctr; - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_WOWLAN_KEK_KCK_MATERIAL ,CMD_SYNC ,sizeof (kek_kck_cmd), &kek_kck_cmd);
@@ -1272,12 +1272,12 @@ int iwlagn_suspend(struct iwl_priv *priv, } } - ret =iwl_trans_send_cmd_pdu (trans (priv),REPLY_D3_CONFIG ,CMD_SYNC , + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_D3_CONFIG ,CMD_SYNC ,sizeof (d3_cfg_cmd), &d3_cfg_cmd);if (ret) goto out; - ret =iwl_trans_send_cmd_pdu (trans (priv),REPLY_WOWLAN_WAKEUP_FILTER , + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_WOWLAN_WAKEUP_FILTER ,CMD_SYNC ,sizeof (wakeup_filter_cmd), &wakeup_filter_cmd);if (ret)
@@ -1289,3 +1289,21 @@ int iwlagn_suspend(struct iwl_priv *priv, return ret; }#endif + +int iwl_dvm_send_cmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd) +{ +return iwl_trans_send_cmd (trans (priv), cmd); +} + +int iwl_dvm_send_cmd_pdu (struct iwl_priv *priv,u8 id, +u32 flags,u16 len,const void *data) +{ +struct iwl_host_cmd cmd = { + .id = id, + .len = { len, }, + .data = { data, }, + .flags = flags, + }; + +return iwl_dvm_send_cmd (priv, &cmd); +}
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +8 -8
@@ -39,7 +39,7 @@ static int iwlagn_disable_bss(struct iwl_priv *priv,int ret; send->filter_flags &= ~RXON_FILTER_ASSOC_MSK ; - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_cmd, + ret =iwl_dvm_send_cmd_pdu (priv, ctx->rxon_cmd,CMD_SYNC ,sizeof (*send), send); send->filter_flags = old_filter;
@@ -66,7 +66,7 @@ static int iwlagn_disable_pan(struct iwl_priv *priv, send->filter_flags &= ~RXON_FILTER_ASSOC_MSK ; send->dev_type =RXON_DEV_TYPE_P2P ; - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_cmd, + ret =iwl_dvm_send_cmd_pdu (priv, ctx->rxon_cmd,CMD_SYNC ,sizeof (*send), send); send->filter_flags = old_filter;
@@ -92,7 +92,7 @@ static int iwlagn_disconn_pan(struct iwl_priv *priv,int ret; send->filter_flags &= ~RXON_FILTER_ASSOC_MSK ; - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_cmd,CMD_SYNC , + ret =iwl_dvm_send_cmd_pdu (priv, ctx->rxon_cmd,CMD_SYNC ,sizeof (*send), send); send->filter_flags = old_filter;
@@ -121,7 +121,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv, ctx->qos_data.qos_active, ctx->qos_data.def_qos_parm.qos_flags); - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->qos_cmd,CMD_SYNC , + ret =iwl_dvm_send_cmd_pdu (priv, ctx->qos_cmd,CMD_SYNC ,sizeof (struct iwl_qosparam_cmd ), &ctx->qos_data.def_qos_parm);if (ret)
@@ -180,7 +180,7 @@ static int iwlagn_send_rxon_assoc(struct iwl_priv *priv, ctx->staging.ofdm_ht_triple_stream_basic_rates; rxon_assoc.acquisition_data = ctx->staging.acquisition_data; - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_assoc_cmd, + ret =iwl_dvm_send_cmd_pdu (priv, ctx->rxon_assoc_cmd,CMD_ASYNC ,sizeof (rxon_assoc), &rxon_assoc);return ret; }
@@ -266,7 +266,7 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,* Associated RXON doesn't clear the station table in uCode, * so we don't need to restore stations etc. after this. */ - ret =iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_cmd,CMD_SYNC , + ret =iwl_dvm_send_cmd_pdu (priv, ctx->rxon_cmd,CMD_SYNC ,sizeof (struct iwl_rxon_cmd ), &ctx->staging);if (ret) {IWL_ERR (priv,"Error setting new RXON (%d)\n" , ret);
@@ -385,7 +385,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv) cmd.slots[0 ].width =cpu_to_le16 (slot0); cmd.slots[1 ].width =cpu_to_le16 (slot1); - ret =iwl_trans_send_cmd_pdu (trans (priv),REPLY_WIPAN_PARAMS ,CMD_SYNC , + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_WIPAN_PARAMS ,CMD_SYNC ,sizeof (cmd), &cmd);if (ret)IWL_ERR (priv,"Error setting PAN parameters (%d)\n" , ret);
@@ -771,7 +771,7 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)memset (&cmd,0 ,sizeof (cmd));iwl_set_calib_hdr (&cmd.hdr, priv->phy_calib_chain_noise_reset_cmd); - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_PHY_CALIBRATION_CMD ,CMD_SYNC ,sizeof (cmd), &cmd);if (ret)
drivers/net/wireless/iwlwifi/iwl-agn-sta.c +4 -4
@@ -153,7 +153,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,might_sleep (); } - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret || (flags &CMD_ASYNC ))return ret;
@@ -447,7 +447,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv, cmd.flags |=CMD_WANT_SKB ; - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret)return ret;
@@ -785,7 +785,7 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx,return -EINVAL ;if (is_lq_table_valid (priv, ctx, lq)) - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);else ret = -EINVAL ;
@@ -970,7 +970,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, cmd.len[0 ] = cmd_size;if (not_empty || send_if_empty) -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd);else return 0 ; }
drivers/net/wireless/iwlwifi/iwl-agn.c +5 -5
@@ -197,7 +197,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) cmd.data[1 ] = priv->beacon_skb->data; cmd.dataflags[1 ] =IWL_HCMD_DFL_NOCOPY ; -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd); }static void iwl_bg_beacon_update (struct work_struct *work)
@@ -563,7 +563,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv) adv_cmd.critical_temperature_exit =cpu_to_le32 (hw_params (priv).ct_kill_exit_threshold); - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_CT_KILL_CONFIG_CMD ,CMD_SYNC ,sizeof (adv_cmd), &adv_cmd);if (ret)
@@ -578,7 +578,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv) cmd.critical_temperature_R =cpu_to_le32 (hw_params (priv).ct_kill_threshold); - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_CT_KILL_CONFIG_CMD ,CMD_SYNC ,sizeof (cmd), &cmd);if (ret)
@@ -604,7 +604,7 @@ static int iwlagn_send_calib_cfg_rt(struct iwl_priv *priv, u32 cfg) calib_cfg_cmd.ucd_calib_cfg.once.is_enable =IWL_CALIB_RT_CFG_ALL ; calib_cfg_cmd.ucd_calib_cfg.once.start =cpu_to_le32 (cfg); -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd); }
@@ -616,7 +616,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)if (IWL_UCODE_API (priv->fw->ucode_ver) >1 ) {IWL_DEBUG_HC (priv,"select valid tx ant: %u\n" , valid_tx_ant); - return iwl_trans_send_cmd_pdu(trans(priv), + return iwl_dvm_send_cmd_pdu(priv, TX_ANT_CONFIGURATION_CMD, CMD_SYNC, sizeof(struct iwl_tx_ant_config_cmd),
drivers/net/wireless/iwlwifi/iwl-agn.h +5 -0
@@ -96,6 +96,11 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, const struct iwl_ucode_capabilities *capa);void iwlagn_mac_unregister (struct iwl_priv *priv); +/* commands */ +int iwl_dvm_send_cmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd); +int iwl_dvm_send_cmd_pdu (struct iwl_priv *priv,u8 id, +u32 flags,u16 len,const void *data); +/* RXON */ int iwlagn_set_pan_params (struct iwl_priv *priv);int iwlagn_commit_rxon (struct iwl_priv *priv,struct iwl_rxon_context *ctx);
drivers/net/wireless/iwlwifi/iwl-core.c +5 -5
@@ -369,7 +369,7 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx)le32_to_cpu (ctx->timing.beacon_init_val), le16_to_cpu(ctx->timing.atim_window)); -return iwl_trans_send_cmd_pdu (trans (priv), ctx->rxon_timing_cmd, +return iwl_dvm_send_cmd_pdu (priv, ctx->rxon_timing_cmd,CMD_SYNC ,sizeof (ctx->timing), &ctx->timing); }
@@ -958,7 +958,7 @@ void iwl_send_bt_config(struct iwl_priv *priv)IWL_DEBUG_INFO (priv,"BT coex %s\n" , (bt_cmd.flags ==BT_COEX_DISABLE ) ?"disable" :"active" ); -if (iwl_trans_send_cmd_pdu (trans (priv),REPLY_BT_CONFIG , +if (iwl_dvm_send_cmd_pdu (priv,REPLY_BT_CONFIG ,CMD_SYNC ,sizeof (struct iwl_bt_cmd ), &bt_cmd))IWL_ERR (priv,"failed to send BT Coex Config\n" ); }
@@ -971,12 +971,12 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags, bool clear) };if (flags &CMD_ASYNC ) -return iwl_trans_send_cmd_pdu (trans (priv),REPLY_STATISTICS_CMD , +return iwl_dvm_send_cmd_pdu (priv,REPLY_STATISTICS_CMD ,CMD_ASYNC ,sizeof (struct iwl_statistics_cmd ), &statistics_cmd);else -return iwl_trans_send_cmd_pdu (trans (priv),REPLY_STATISTICS_CMD , +return iwl_dvm_send_cmd_pdu (priv,REPLY_STATISTICS_CMD ,CMD_SYNC ,sizeof (struct iwl_statistics_cmd ), &statistics_cmd);
@@ -1300,7 +1300,7 @@ int iwl_cmd_echo_test(struct iwl_priv *priv) .flags = CMD_SYNC, }; - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret)IWL_ERR (priv,"echo testing fail: 0X%x\n" , ret);else
drivers/net/wireless/iwlwifi/iwl-led.c +1 -1
@@ -112,7 +112,7 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)iwl_write32 (trans (priv),CSR_LED_REG , reg &CSR_LED_BSM_CTRL_MSK ); -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd); }/* Set led pattern command */
drivers/net/wireless/iwlwifi/iwl-power.c +1 -1
@@ -336,7 +336,7 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)le32_to_cpu (cmd->sleep_interval[3 ]), le32_to_cpu(cmd->sleep_interval[4])); -return iwl_trans_send_cmd_pdu (trans (priv),POWER_TABLE_CMD ,CMD_SYNC , +return iwl_dvm_send_cmd_pdu (priv,POWER_TABLE_CMD ,CMD_SYNC ,sizeof (struct iwl_powertable_cmd ), cmd); }
drivers/net/wireless/iwlwifi/iwl-scan.c +2 -2
@@ -72,7 +72,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv) test_bit(STATUS_FW_ERROR, &priv->shrd->status))return -EIO ; - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret)return ret;
@@ -887,7 +887,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)if (ret)return ret; - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret) {clear_bit (STATUS_SCAN_HW , &priv->shrd->status);iwlagn_set_pan_params (priv);
drivers/net/wireless/iwlwifi/iwl-testmode.c +1 -1
@@ -282,7 +282,7 @@ static int iwl_testmode_ucode(struct ieee80211_hw *hw, struct nlattr **tb)IWL_DEBUG_INFO (priv,"testmode ucode command ID 0x%x, flags 0x%x," " len %d\n" , cmd.id, cmd.flags, cmd.len[0 ]); - ret =iwl_trans_send_cmd (trans (priv), &cmd); + ret =iwl_dvm_send_cmd (priv, &cmd);if (ret) {IWL_ERR (priv,"Failed to send hcmd\n" );return ret;
drivers/net/wireless/iwlwifi/iwl-trans.c deleted +0 -77
77 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-trans.h +0 -3
@@ -443,9 +443,6 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans,return trans->ops->send_cmd (trans, cmd); } -int iwl_trans_send_cmd_pdu (struct iwl_trans *trans,u8 id, -u32 flags,u16 len,const void *data); -static inline int iwl_trans_tx (struct iwl_trans *trans,struct sk_buff *skb,struct iwl_device_cmd *dev_cmd,enum iwl_rxon_context_id ctx,u8 sta_id,u8 tid)
drivers/net/wireless/iwlwifi/iwl-ucode.c +4 -4
@@ -179,7 +179,7 @@ static int iwl_send_calib_cfg(struct iwl_priv *priv) calib_cfg_cmd.ucd_calib_cfg.flags =IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK ; -return iwl_trans_send_cmd (trans (priv), &cmd); +return iwl_dvm_send_cmd (priv, &cmd); } int iwlagn_rx_calib_result(struct iwl_priv *priv,
@@ -260,7 +260,7 @@ static int iwl_send_wimax_coex(struct iwl_priv *priv)/* coexistence is disabled */ memset (&coex_cmd,0 ,sizeof (coex_cmd)); } -return iwl_trans_send_cmd_pdu (trans (priv), +return iwl_dvm_send_cmd_pdu (priv,COEX_PRIORITY_TABLE_CMD ,CMD_SYNC ,sizeof (coex_cmd), &coex_cmd); }
@@ -293,7 +293,7 @@ void iwl_send_prio_tbl(struct iwl_priv *priv)memcpy (prio_tbl_cmd.prio_tbl, iwl_bt_prio_tbl,sizeof (iwl_bt_prio_tbl)); -if (iwl_trans_send_cmd_pdu (trans (priv), +if (iwl_dvm_send_cmd_pdu (priv,REPLY_BT_COEX_PRIO_TABLE ,CMD_SYNC ,sizeof (prio_tbl_cmd), &prio_tbl_cmd))IWL_ERR (priv,"failed to send BT prio tbl command\n" );
@@ -306,7 +306,7 @@ int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type) env_cmd.action = action; env_cmd.type = type; - ret =iwl_trans_send_cmd_pdu (trans (priv), + ret =iwl_dvm_send_cmd_pdu (priv,REPLY_BT_COEX_PROT_ENV ,CMD_SYNC ,sizeof (env_cmd), &env_cmd);if (ret)
Signature · 1 line
1.7.0.4
PATCH RESEND 8/33 iwlwifi: move rfkill status handling out of transport
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The transport layer should only check the
hardware RF kill status, not impose any
policy or reaction based on it, so move
that out of it into the op_mode.
For now keep the restriction on loading
firmware, that will have to be removed
later.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 5 +++ drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 24 +++---------- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 39 +++++++--------------- 3 files changed, 22 insertions(+), 46 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +5 -0
@@ -1470,6 +1470,11 @@ void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) {struct iwl_priv *priv =IWL_OP_MODE_GET_DVM (op_mode); +if (state) +set_bit (STATUS_RF_KILL_HW , &priv->shrd->status); +else +clear_bit (STATUS_RF_KILL_HW , &priv->shrd->status); +wiphy_rfkill_set_hw_state (priv->hw->wiphy, state); }
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +5 -19
@@ -1016,30 +1016,16 @@ void iwl_irq_tasklet(struct iwl_trans *trans)/* HW RF KILL switch toggled */ if (inta &CSR_INT_BIT_RF_KILL ) { -int hw_rf_kill =0 ; -if (!(iwl_read32 (trans,CSR_GP_CNTRL ) & -CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW )) - hw_rf_kill =1 ; +bool hw_rfkill; + hw_rfkill = !(iwl_read32 (trans,CSR_GP_CNTRL ) & +CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW );IWL_WARN (trans,"RF_KILL bit toggled to %s.\n" , - hw_rf_kill ?"disable radio" :"enable radio" ); + hw_rfkill ?"disable radio" :"enable radio" ); isr_stats->rfkill++; -/* driver only loads ucode once setting the interface up. -* the driver allows loading the ucode even if the radio -* is killed. Hence update the killswitch state here. The -* rfkill handler will care about restarting if needed. -*/ -if (!test_bit (STATUS_ALIVE , &trans->shrd->status)) { -if (hw_rf_kill) -set_bit (STATUS_RF_KILL_HW , - &trans->shrd->status); -else -clear_bit (STATUS_RF_KILL_HW , - &trans->shrd->status); -iwl_op_mode_hw_rf_kill (trans->op_mode, hw_rf_kill); - } +iwl_op_mode_hw_rf_kill (trans->op_mode, hw_rfkill); handled |=CSR_INT_BIT_RF_KILL ; }
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +12 -27
@@ -1021,6 +1021,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,int ret;struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +bool hw_rfkill; trans->shrd->ucode_owner =IWL_OWNERSHIP_DRIVER ; trans_pcie->ac_to_queue[IWL_RXON_CTX_BSS ] = iwlagn_bss_ac_to_queue;
@@ -1039,14 +1040,11 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, }/* If platform's RF_KILL switch is NOT set to KILL */ -if (iwl_read32 (trans,CSR_GP_CNTRL ) & -CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ) -clear_bit (STATUS_RF_KILL_HW , &trans->shrd->status); -else -set_bit (STATUS_RF_KILL_HW , &trans->shrd->status); + hw_rfkill = !(iwl_read32 (trans,CSR_GP_CNTRL ) & +CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ); +iwl_op_mode_hw_rf_kill (trans->op_mode, hw_rfkill); -if (iwl_is_rfkill (trans->shrd)) { -iwl_op_mode_hw_rf_kill (trans->op_mode, true); +if (hw_rfkill) {iwl_enable_interrupts (trans);return -ERFKILL ; }
@@ -1506,6 +1504,7 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);int err; +bool hw_rfkill; trans_pcie->inta_mask =CSR_INI_SET_MASK ;
@@ -1535,16 +1534,9 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)iwl_apm_init (trans); -/* If platform's RF_KILL switch is NOT set to KILL */ -if (iwl_read32 (trans, -CSR_GP_CNTRL ) &CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ) -clear_bit (STATUS_RF_KILL_HW , &trans->shrd->status); -else -set_bit (STATUS_RF_KILL_HW , &trans->shrd->status); - -iwl_op_mode_hw_rf_kill (trans->op_mode, -test_bit (STATUS_RF_KILL_HW , - &trans->shrd->status)); + hw_rfkill = !(iwl_read32 (trans,CSR_GP_CNTRL ) & +CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ); +iwl_op_mode_hw_rf_kill (trans->op_mode, hw_rfkill);return err;
@@ -1659,19 +1651,12 @@ static int iwl_trans_pcie_suspend(struct iwl_trans *trans)static int iwl_trans_pcie_resume (struct iwl_trans *trans) { -bool hw_rfkill = false; +bool hw_rfkill;iwl_enable_interrupts (trans); -if (!(iwl_read32 (trans,CSR_GP_CNTRL ) & -CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW )) - hw_rfkill = true; - -if (hw_rfkill) -set_bit (STATUS_RF_KILL_HW , &trans->shrd->status); -else -clear_bit (STATUS_RF_KILL_HW , &trans->shrd->status); - + hw_rfkill = !(iwl_read32 (trans,CSR_GP_CNTRL ) & +CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW );iwl_op_mode_hw_rf_kill (trans->op_mode, hw_rfkill);return 0 ;
Signature · 1 line
1.7.0.4
PATCH RESEND 7/33 iwlwifi: move mutex out of shared
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Now the mutex no longer needs to be
shared, so move it into iwl_priv.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 20 +++--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 20 +++--- drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 18 +++--- drivers/net/wireless/iwlwifi/iwl-agn-tt.c | 8 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 32 +++++----- drivers/net/wireless/iwlwifi/iwl-core.c | 4 +- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 12 ++-- drivers/net/wireless/iwlwifi/iwl-dev.h | 2 + drivers/net/wireless/iwlwifi/iwl-mac80211.c | 82 +++++++++++++------------- drivers/net/wireless/iwlwifi/iwl-power.c | 2 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 32 +++++----- drivers/net/wireless/iwlwifi/iwl-shared.h | 4 - drivers/net/wireless/iwlwifi/iwl-testmode.c | 8 +- drivers/net/wireless/iwlwifi/iwl-ucode.c | 2 +- 14 files changed, 122 insertions(+), 124 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +10 -10
@@ -246,7 +246,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)void iwlagn_dev_txfifo_flush (struct iwl_priv *priv,u16 flush_control) { -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);ieee80211_stop_queues (priv->hw);if (iwlagn_txfifo_flush (priv,IWL_DROP_ALL )) {IWL_ERR (priv,"flush request fail\n" );
@@ -256,7 +256,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)iwl_trans_wait_tx_queue_empty (trans (priv)); done:ieee80211_wake_queues (priv->hw); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }/*
@@ -453,7 +453,7 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena)struct iwl_rxon_context *ctx, *found_ctx =NULL ;bool found_ap = false; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);/* Check whether AP or GO mode is active. */ if (rssi_ena) {
@@ -566,7 +566,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)break ; } -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);/* * We can not send command to firmware while scanning. When the scan
@@ -594,7 +594,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)*/ iwlagn_bt_coex_rssi_monitor (priv); out: -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }/*
@@ -969,7 +969,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,u16 p1k[IWLAGN_P1K_SIZE ];int ret, i; -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex); if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 || key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
@@ -1075,7 +1075,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,break ; } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); } int iwlagn_send_patterns(struct iwl_priv *priv,
@@ -1222,11 +1222,11 @@ int iwlagn_suspend(struct iwl_priv *priv,* constraints. Since we're in the suspend path * that isn't really a problem though. */ -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);ieee80211_iter_keys (priv->hw, ctx->vif, iwlagn_wowlan_program_keys, &key_data); -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (key_data.error) { ret = -EIO ; goto out;
@@ -1304,7 +1304,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)* (or more) synchronous commands at a time. */ if (cmd->flags &CMD_SYNC ) -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);return iwl_trans_send_cmd (trans (priv), cmd); }
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +10 -10
@@ -131,7 +131,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,static int iwlagn_update_beacon (struct iwl_priv *priv,struct ieee80211_vif *vif) { -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);dev_kfree_skb (priv->beacon_skb); priv->beacon_skb =ieee80211_beacon_get (priv->hw, vif);
@@ -313,7 +313,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)BUILD_BUG_ON (NUM_IWL_RXON_CTX !=2 ); -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex); ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS ]; ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN ];
@@ -418,7 +418,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)bool new_assoc = !!(ctx->staging.filter_flags &RXON_FILTER_ASSOC_MSK );int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!iwl_is_alive (priv->shrd))return -EBUSY ;
@@ -549,7 +549,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)IWL_DEBUG_MAC80211 (priv,"enter: changed %#x" , changed); -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (unlikely (test_bit (STATUS_SCANNING , &priv->shrd->status))) {IWL_DEBUG_MAC80211 (priv,"leave - scanning\n" );
@@ -650,7 +650,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)iwlagn_commit_rxon (priv, ctx); } out: -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);IWL_DEBUG_MAC80211 (priv,"leave\n" );return ret;
@@ -667,7 +667,7 @@ static void iwlagn_check_needed_chains(struct iwl_priv *priv,struct ieee80211_sta_ht_cap *ht_cap;bool need_multiple; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);switch (vif->type) {case NL80211_IFTYPE_STATION :
@@ -792,17 +792,17 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,int ret;bool force = false; -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (unlikely (!iwl_is_ready (priv->shrd))) {IWL_DEBUG_MAC80211 (priv,"leave - not ready\n" ); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return ; }if (unlikely (!ctx->vif)) {IWL_DEBUG_MAC80211 (priv,"leave - vif is NULL\n" ); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return ; }
@@ -931,7 +931,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,IWL_ERR (priv,"Error sending IBSS beacon\n" ); } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }void iwlagn_post_scan (struct iwl_priv *priv)
drivers/net/wireless/iwlwifi/iwl-agn-sta.c +9 -9
@@ -811,7 +811,7 @@ void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,u32 rate_flags =0 ;__le32 rate_n_flags; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);memset (link_cmd,0 ,sizeof (*link_cmd));
@@ -978,7 +978,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv,int iwl_restore_default_wep_keys (struct iwl_priv *priv,struct iwl_rxon_context *ctx) { -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);return iwl_send_static_wepkey_cmd (priv, ctx, false); }
@@ -989,7 +989,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, {int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);IWL_DEBUG_WEP (priv,"Removing default WEP key: idx=%d\n" , keyconf->keyidx);
@@ -1014,7 +1014,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv, {int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (keyconf->keylen !=WEP_KEY_LEN_128 && keyconf->keylen !=WEP_KEY_LEN_64 ) {
@@ -1166,7 +1166,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,if (sta_id ==IWL_INVALID_STATION )return 0 ; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex); ctx->key_mapping_keys--;
@@ -1206,7 +1206,7 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,if (sta_id ==IWL_INVALID_STATION )return -EINVAL ; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex); keyconf->hw_key_idx =iwl_get_free_ucode_key_offset (priv);if (keyconf->hw_key_idx ==WEP_INVALID_OFFSET )
@@ -1340,7 +1340,7 @@ int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid) {struct iwl_addsta_cmd sta_cmd; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);/* Remove "disable" flag, to enable Tx for this TID */ spin_lock_bh (&priv->sta_lock);
@@ -1359,7 +1359,7 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,int sta_id;struct iwl_addsta_cmd sta_cmd; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex); sta_id =iwl_sta_id (sta);if (sta_id ==IWL_INVALID_STATION )
@@ -1383,7 +1383,7 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,int sta_id;struct iwl_addsta_cmd sta_cmd; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex); sta_id =iwl_sta_id (sta);if (sta_id ==IWL_INVALID_STATION ) {
drivers/net/wireless/iwlwifi/iwl-agn-tt.c +4 -4
@@ -310,7 +310,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force) tt->tt_power_mode =IWL_POWER_INDEX_5 ;break ; } -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (old_state ==IWL_TI_CT_KILL )clear_bit (STATUS_CT_KILL , &priv->shrd->status); if (tt->state != IWL_TI_CT_KILL &&
@@ -341,7 +341,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force)IWL_DEBUG_TEMP (priv,"Power Index change to %u\n" , tt->tt_power_mode); } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); } }
@@ -451,7 +451,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)* in case get disabled before */ iwl_set_rxon_ht (priv, &priv->current_ht_config); } -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (old_state ==IWL_TI_CT_KILL )clear_bit (STATUS_CT_KILL , &priv->shrd->status); if (tt->state != IWL_TI_CT_KILL &&
@@ -486,7 +486,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)iwl_perform_ct_kill_task (priv, false); } } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); } }
drivers/net/wireless/iwlwifi/iwl-agn.c +16 -16
@@ -132,7 +132,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)* beacon contents. */ -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!priv->beacon_ctx) {IWL_ERR (priv,"trying to build beacon w/o beacon context!\n" );
@@ -206,7 +206,7 @@ static void iwl_bg_beacon_update(struct work_struct *work) container_of(work, struct iwl_priv, beacon_update);struct sk_buff *beacon; -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (!priv->beacon_ctx) {IWL_ERR (priv,"updating beacon w/o beacon context!\n" ); goto out;
@@ -236,7 +236,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)iwlagn_send_beacon_cmd (priv); out: -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }static void iwl_bg_bt_runtime_config (struct work_struct *work)
@@ -259,7 +259,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work) container_of(work, struct iwl_priv, bt_full_concurrency);struct iwl_rxon_context *ctx; -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (test_bit (STATUS_EXIT_PENDING , &priv->shrd->status)) goto out;
@@ -283,7 +283,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)iwlagn_send_advance_bt_config (priv); out: -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }/**
@@ -774,7 +774,7 @@ void iwl_down(struct iwl_priv *priv)IWL_DEBUG_INFO (priv,DRV_NAME " is going down\n" ); -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);iwl_scan_cancel_timeout (priv,200 );
@@ -844,11 +844,11 @@ 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->shrd->mutex); +mutex_lock (&priv->mutex);if (test_bit (STATUS_EXIT_PENDING , &priv->shrd->status) ||test_bit (STATUS_SCANNING , &priv->shrd->status)) { -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return ; }
@@ -857,7 +857,7 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)iwl_sensitivity_calibration (priv); } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }void iwlagn_prepare_restart (struct iwl_priv *priv)
@@ -869,7 +869,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)u8 bt_status;bool bt_is_sco; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);for_each_context (priv, ctx) ctx->vif =NULL ;
@@ -907,9 +907,9 @@ static void iwl_bg_restart(struct work_struct *data)return ;if (test_and_clear_bit (STATUS_FW_ERROR , &priv->shrd->status)) { -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwlagn_prepare_restart (priv); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);iwl_cancel_deferred_work (priv);ieee80211_restart_hw (priv->hw); }else {
@@ -924,7 +924,7 @@ void iwlagn_disable_roc(struct iwl_priv *priv) {struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN ]; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!priv->hw_roc_setup)return ;
@@ -947,9 +947,9 @@ static void iwlagn_disable_roc_work(struct work_struct *work) struct iwl_priv *priv = container_of(work, struct iwl_priv, hw_roc_disable_work.work); -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwlagn_disable_roc (priv); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }/*****************************************************************************
@@ -1036,7 +1036,7 @@ static int iwl_init_drv(struct iwl_priv *priv)spin_lock_init (&priv->sta_lock); -mutex_init (&priv->shrd->mutex); +mutex_init (&priv->mutex);INIT_LIST_HEAD (&priv->calib_results);
drivers/net/wireless/iwlwifi/iwl-core.c +2 -2
@@ -316,7 +316,7 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx) conf = &priv->hw->conf; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);memset (&ctx->timing,0 ,sizeof (struct iwl_rxon_time_cmd ));
@@ -892,7 +892,7 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)bool defer;struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS ]; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (priv->tx_power_user_lmt == tx_power && !force)return 0 ;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +6 -6
@@ -761,9 +761,9 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file, priv->power_data.debug_sleep_level_override = value; -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_power_update_mode (priv, true); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return count; }
@@ -1708,9 +1708,9 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,return -EINVAL ;/* make request to uCode to retrieve statistics information */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex); ret =iwl_send_statistics_request (priv,CMD_SYNC , false); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);if (ret) { IWL_ERR(priv,
@@ -2106,9 +2106,9 @@ static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file,return -EFAULT ;/* make request to uCode to retrieve statistics information */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_send_statistics_request (priv,CMD_SYNC , true); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return count; }
drivers/net/wireless/iwlwifi/iwl-dev.h +2 -0
@@ -36,6 +36,7 @@#include <linux/wait.h> #include <linux/leds.h> #include <linux/slab.h> +#include <linux/mutex.h> #include <net/ieee80211_radiotap.h> #include "iwl-eeprom.h"
@@ -718,6 +719,7 @@ struct iwl_priv {const struct iwl_fw *fw;spinlock_t sta_lock; +struct mutex mutex;/* ieee device used by generic ieee processing code */ struct ieee80211_hw *hw;
drivers/net/wireless/iwlwifi/iwl-mac80211.c +41 -41
314 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-power.c +1 -1
@@ -383,7 +383,7 @@ int iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd,int ret;bool update_chains; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);/* Don't update the RX chain when chain noise calibration is running */ update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE ||
drivers/net/wireless/iwlwifi/iwl-scan.c +16 -16
@@ -115,7 +115,7 @@ static void iwl_process_scan_complete(struct iwl_priv *priv) {bool aborted; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!test_and_clear_bit (STATUS_SCAN_COMPLETE , &priv->shrd->status))return ;
@@ -172,7 +172,7 @@ out_settings:void iwl_force_scan_end (struct iwl_priv *priv) { -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!test_bit (STATUS_SCANNING , &priv->shrd->status)) {IWL_DEBUG_SCAN (priv,"Forcing scan end while not scanning\n" );
@@ -191,7 +191,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv) {int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (!test_bit (STATUS_SCANNING , &priv->shrd->status)) {IWL_DEBUG_SCAN (priv,"Not performing scan to abort\n" );
@@ -230,7 +230,7 @@ void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) {unsigned long timeout = jiffies +msecs_to_jiffies (ms); -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);IWL_DEBUG_SCAN (priv,"Scan cancel timeout\n" );
@@ -595,7 +595,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)u8 scan_tx_antennas =hw_params (priv).valid_tx_ant;int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);if (vif) ctx =iwl_rxon_ctx_from_vif (vif);
@@ -912,7 +912,7 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv, {int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);cancel_delayed_work (&priv->scan_check);
@@ -972,7 +972,7 @@ static void iwl_bg_start_internal_scan(struct work_struct *work)IWL_DEBUG_SCAN (priv,"Start internal scan\n" ); -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);if (priv->scan_type ==IWL_SCAN_RADIO_RESET ) {IWL_DEBUG_SCAN (priv,"Internal scan already in progress\n" );
@@ -987,7 +987,7 @@ static void iwl_bg_start_internal_scan(struct work_struct *work)if (iwl_scan_initiate (priv,NULL ,IWL_SCAN_RADIO_RESET , priv->band))IWL_DEBUG_SCAN (priv,"failed to start internal short scan\n" ); unlock: -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }static void iwl_bg_scan_check (struct work_struct *data)
@@ -1000,9 +1000,9 @@ static void iwl_bg_scan_check(struct work_struct *data)/* Since we are here firmware does not finish scan and * most likely is in bad shape, so we don't bother to * send abort command, just force scan complete to mac80211 */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_force_scan_end (priv); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }/**
@@ -1060,9 +1060,9 @@ static void iwl_bg_abort_scan(struct work_struct *work)/* We keep scan_check work queued in case when firmware will not * report back scan completed notification */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_scan_cancel_timeout (priv,200 ); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }static void iwl_bg_scan_completed (struct work_struct *work)
@@ -1070,9 +1070,9 @@ static void iwl_bg_scan_completed(struct work_struct *work)struct iwl_priv *priv = container_of(work, struct iwl_priv, scan_completed); -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_process_scan_complete (priv); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); }void iwl_setup_scan_deferred_work (struct iwl_priv *priv)
@@ -1090,8 +1090,8 @@ void iwl_cancel_scan_deferred_work(struct iwl_priv *priv)cancel_work_sync (&priv->scan_completed);if (cancel_delayed_work_sync (&priv->scan_check)) { -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);iwl_force_scan_end (priv); -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex); } }
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -4
@@ -65,7 +65,6 @@#include <linux/types.h> #include <linux/spinlock.h> -#include <linux/mutex.h> #include <linux/gfp.h> #include <net/mac80211.h>
@@ -399,7 +398,6 @@ struct iwl_cfg {* @nic: pointer to the nic data * @hw_params: see struct iwl_hw_params * @lock: protect general shared data -* @mutex: * @wait_command_queue: the wait_queue for SYNC host command nad uCode load * @eeprom: pointer to the eeprom/OTP image * @ucode_type: indicator of loaded ucode image
@@ -423,8 +421,6 @@ struct iwl_shared {struct iwl_hw_params hw_params;const struct iwl_fw *fw; -struct mutex mutex; -wait_queue_head_t wait_command_queue;/* eeprom -- this is in the card's little endian byte order */
drivers/net/wireless/iwlwifi/iwl-testmode.c +4 -4
@@ -975,7 +975,7 @@ int iwlagn_mac_testmode_cmd(struct ieee80211_hw *hw, void *data, int len)return -ENOMSG ; }/* in case multiple accesses to the device happens */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);switch (nla_get_u32 (tb[IWL_TM_ATTR_COMMAND ])) {case IWL_TM_CMD_APP2DEV_UCODE :
@@ -1027,7 +1027,7 @@ int iwlagn_mac_testmode_cmd(struct ieee80211_hw *hw, void *data, int len)break ; } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return result; }
@@ -1062,7 +1062,7 @@ int iwlagn_mac_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb, }/* in case multiple accesses to the device happens */ -mutex_lock (&priv->shrd->mutex); +mutex_lock (&priv->mutex);switch (cmd) {case IWL_TM_CMD_APP2DEV_READ_TRACE :IWL_DEBUG_INFO (priv,"uCode trace cmd to driver\n" );
@@ -1077,6 +1077,6 @@ int iwlagn_mac_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,break ; } -mutex_unlock (&priv->shrd->mutex); +mutex_unlock (&priv->mutex);return result; }
drivers/net/wireless/iwlwifi/iwl-ucode.c +1 -1
@@ -599,7 +599,7 @@ int iwl_run_init_ucode(struct iwl_priv *priv)struct iwl_notification_wait calib_wait;int ret; -lockdep_assert_held (&priv->shrd->mutex); +lockdep_assert_held (&priv->mutex);/* No init ucode required? Curious, but maybe ok */ if (!priv->fw->ucode_init.code.len)
Signature · 1 line
1.7.0.4
PATCH RESEND 9/33 iwlwifi: rename ucode.h to fw-file.h
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
That name better reflects the contents
of the file and the fact that it isn't
related to iwl-ucode.c.
--- drivers/net/wireless/iwlwifi/iwl-drv.c | 2 +- drivers/net/wireless/iwlwifi/iwl-fw-file.h | 160 ++++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-ucode.h | 160 ---------------------------- 3 files changed, 161 insertions(+), 161 deletions(-) create mode 100644 drivers/net/wireless/iwlwifi/iwl-fw-file.h delete mode 100644 drivers/net/wireless/iwlwifi/iwl-ucode.h
drivers/net/wireless/iwlwifi/iwl-drv.c +1 -1
@@ -71,7 +71,7 @@#include "iwl-op-mode.h" /* private includes */ -#include "iwl-ucode.h" +#include "iwl-fw-file.h" /** * struct iwl_drv - drv common data
drivers/net/wireless/iwlwifi/iwl-fw-file.h new file +160 -0
160 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-ucode.h deleted +0 -160
160 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH RESEND 11/33 iwlwifi: remove shadow_reg_enable from hw_params
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
There's no need to copy shadow_reg_enable into hw_params since it is a pure hardware parameter that will never change, we can access it from the config directly.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 2 -- drivers/net/wireless/iwlwifi/iwl-power.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-shared.h | 1 - drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -2
@@ -1127,8 +1127,6 @@ static void iwl_set_hw_params(struct iwl_priv *priv)hw_params (priv).num_ampdu_queues =cfg (priv)->base_params->num_of_ampdu_queues; -hw_params (priv).shadow_reg_enable = -cfg (priv)->base_params->shadow_reg_enable;hw_params (priv).wd_timeout =cfg (priv)->base_params->wd_timeout;/* Device-specific setup */
drivers/net/wireless/iwlwifi/iwl-power.c +2 -2
@@ -215,7 +215,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,else cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK ; -if (hw_params (priv).shadow_reg_enable) +if (cfg (priv)->base_params->shadow_reg_enable) cmd->flags |=IWL_POWER_SHADOW_REG_ENA ;else cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA ;
@@ -301,7 +301,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,if (priv->power_data.bus_pm) cmd->flags |=IWL_POWER_PCI_PM_MSK ; -if (hw_params (priv).shadow_reg_enable) +if (cfg (priv)->base_params->shadow_reg_enable) cmd->flags |=IWL_POWER_SHADOW_REG_ENA ;else cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA ;
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -1
@@ -185,7 +185,6 @@ struct iwl_hw_params {u8 valid_tx_ant;u8 valid_rx_ant;u8 ht40_channel; -bool shadow_reg_enable;u16 sku;u32 rx_page_order;u32 ct_kill_threshold;
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +1 -1
@@ -141,7 +141,7 @@ void iwl_rx_queue_update_write_ptr(struct iwl_trans *trans,if (q->need_update ==0 ) goto exit_unlock; -if (hw_params (trans).shadow_reg_enable) { +if (cfg (trans)->base_params->shadow_reg_enable) {/* shadow register enabled */ /* Device expects a multiple of 8 */ q->write_actual = (q->write & ~0x7 );
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +1 -1
@@ -136,7 +136,7 @@ void iwl_txq_update_write_ptr(struct iwl_trans *trans, struct iwl_tx_queue *txq)if (txq->need_update ==0 )return ; -if (hw_params (trans).shadow_reg_enable) { +if (cfg (trans)->base_params->shadow_reg_enable) {/* shadow register enabled */ iwl_write32 (trans,HBUS_TARG_WRPTR , txq->q.write_ptr | (txq_id <<8 ));
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +1 -1
@@ -828,7 +828,7 @@ static int iwl_nic_init(struct iwl_trans *trans)if (iwl_tx_init (trans))return -ENOMEM ; -if (hw_params (trans).shadow_reg_enable) { +if (cfg (trans)->base_params->shadow_reg_enable) {/* enable shadow regs in HW */ iwl_set_bit (trans,CSR_MAC_SHADOW_REG_CTRL ,0x800FFFFF );
Signature · 1 line
1.7.0.4
PATCH RESEND 12/33 iwlwifi: move status check functions out of shared
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
They are only used in the DVM op_mode.
Also move the rfkill debug macros that
depend on them.
--- drivers/net/wireless/iwlwifi/iwl-agn-tt.c | 1 + drivers/net/wireless/iwlwifi/iwl-agn.h | 64 +++++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-debug.h | 16 ------- drivers/net/wireless/iwlwifi/iwl-shared.h | 42 ------------------- 4 files changed, 65 insertions(+), 58 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-tt.c +1 -0
@@ -34,6 +34,7 @@#include <net/mac80211.h> +#include "iwl-agn.h" #include "iwl-eeprom.h" #include "iwl-dev.h" #include "iwl-core.h"
drivers/net/wireless/iwlwifi/iwl-agn.h +64 -0
68 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-debug.h +0 -16
@@ -76,24 +76,8 @@ do { \print_hex_dump (KERN_DEBUG ,"iwl data: " , \DUMP_PREFIX_OFFSET ,16 ,1 , p, len,1 ); \ } while (0) -#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \ -do { \ - if (!iwl_is_rfkill((m)->shrd)) \ - IWL_ERR(m, fmt, ##args); \ - else \ - __iwl_err(trans(m)->dev, true, \ - !iwl_have_debug_level(IWL_DL_RADIO), \ - fmt, ##args); \ -} while (0) #else#define iwl_print_hex_dump (m, level, p, len) -#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \ -do { \ - if (!iwl_is_rfkill((m)->shrd)) \ - IWL_ERR(m, fmt, ##args); \ - else \ - __iwl_err(trans(m)->dev, true, true, fmt, ##args); \ -} while (0)#endif /* CONFIG_IWLWIFI_DEBUG */ #ifdef CONFIG_IWLWIFI_DEBUGFS
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -42
46 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH RESEND 10/33 iwlwifi: remove AMT check from transport
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
As iwl_prepare_card_hw() is idempotent (and many cards support AMT anyway) there's no point in calling iwl_prepare_card_hw() only for AMT capable devices -- call it always
and simplify the code that way.
--- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +2 -2
@@ -1033,8 +1033,8 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, trans_pcie->mcast_queue[IWL_RXON_CTX_BSS ] =0 ; trans_pcie->mcast_queue[IWL_RXON_CTX_PAN ] =IWL_IPAN_MCAST_QUEUE ; -if ((hw_params (trans).sku &EEPROM_SKU_CAP_AMT_ENABLE ) && -iwl_prepare_card_hw (trans)) { +/* This may fail if AMT took ownership of the device */ +if (iwl_prepare_card_hw (trans)) {IWL_WARN (trans,"Exit HW not ready\n" );return -EIO ; }
Signature · 1 line
1.7.0.4
PATCH RESEND 13/33 iwlwifi: make tracing use device as identifier
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Tracing used the priv pointer as an identifier, which has the problem that we don't have it in all code, and also some people say no pointers should be "leaked" to userspace.
Use the device name instead, it is more useful anyway.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 9 +- drivers/net/wireless/iwlwifi/iwl-devtrace.h | 141 +++++++++++----------- drivers/net/wireless/iwlwifi/iwl-io.h | 6 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 16 ++-- drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 2 +- 6 files changed, 90 insertions(+), 86 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +5 -4
@@ -353,11 +353,12 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, ev =iwl_read32 (trans (priv),HBUS_TARG_MEM_RDAT ); time =iwl_read32 (trans (priv),HBUS_TARG_MEM_RDAT );if (mode ==0 ) { -trace_iwlwifi_dev_ucode_cont_event (priv,0 , time, ev); +trace_iwlwifi_dev_ucode_cont_event ( +trans (priv)->dev,0 , time, ev); }else { data =iwl_read32 (trans (priv),HBUS_TARG_MEM_RDAT ); -trace_iwlwifi_dev_ucode_cont_event (priv, time, - data, ev); +trace_iwlwifi_dev_ucode_cont_event ( +trans (priv)->dev, time, data, ev); } }/* Allow device to power down */
@@ -422,7 +423,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)else priv->event_log.wraps_once_count++; -trace_iwlwifi_dev_ucode_wrap_event (priv, +trace_iwlwifi_dev_ucode_wrap_event (trans (priv)->dev, num_wraps - priv->event_log.num_wraps, next_entry, priv->event_log.next_entry);
drivers/net/wireless/iwlwifi/iwl-devtrace.h +72 -69
324 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-io.h +3 -3
@@ -35,20 +35,20 @@static inline void iwl_write8 (struct iwl_trans *trans,u32 ofs,u8 val) { -trace_iwlwifi_dev_iowrite8 (priv (trans), ofs, val); +trace_iwlwifi_dev_iowrite8 (trans->dev, ofs, val);iwl_trans_write8 (trans, ofs, val); }static inline void iwl_write32 (struct iwl_trans *trans,u32 ofs,u32 val) { -trace_iwlwifi_dev_iowrite32 (priv (trans), ofs, val); +trace_iwlwifi_dev_iowrite32 (trans->dev, ofs, val);iwl_trans_write32 (trans, ofs, val); }static inline u32 iwl_read32 (struct iwl_trans *trans,u32 ofs) {u32 val =iwl_trans_read32 (trans, ofs); -trace_iwlwifi_dev_ioread32 (priv (trans), ofs, val); +trace_iwlwifi_dev_ioread32 (trans->dev, ofs, val);return val; }
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +8 -8
@@ -388,7 +388,7 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans, len =le32_to_cpu (pkt->len_n_flags) &FH_RSCSR_FRAME_SIZE_MSK ; len +=sizeof (u32);/* account for status word */ -trace_iwlwifi_dev_rx (priv (trans), pkt, len); +trace_iwlwifi_dev_rx (trans->dev, pkt, len);/* Reclaim a command buffer only if this packet is a response * to a (driver-originated) command.
@@ -632,7 +632,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) trans_pcie->isr_stats.err_code = table.error_id; - trace_iwlwifi_dev_ucode_error(priv(trans), table.error_id, table.tsf_low, + trace_iwlwifi_dev_ucode_error(trans->dev, table.error_id, table.tsf_low, table.data1, table.data2, table.line, table.blink1, table.blink2, table.ilink1, table.ilink2, table.bcon_time, table.gp1,
@@ -764,7 +764,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,"EVT_LOG:0x%08x:%04u\n" , time, ev); }else { -trace_iwlwifi_dev_ucode_event (priv (trans),0 , +trace_iwlwifi_dev_ucode_event (trans->dev,0 , time, ev);IWL_ERR (trans,"EVT_LOG:0x%08x:%04u\n" , time, ev);
@@ -778,7 +778,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, }else {IWL_ERR (trans,"EVT_LOGT:%010u:0x%08x:%04u\n" , time, data, ev); -trace_iwlwifi_dev_ucode_event (priv (trans), time, +trace_iwlwifi_dev_ucode_event (trans->dev, time, data, ev); } }
@@ -1262,7 +1262,7 @@ static irqreturn_t iwl_isr(int irq, void *data)if (!trans)return IRQ_NONE ; -trace_iwlwifi_dev_irq (priv (trans)); +trace_iwlwifi_dev_irq (trans->dev); trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);
@@ -1352,7 +1352,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)if (!trans_pcie->use_ict)return iwl_isr (irq, data); -trace_iwlwifi_dev_irq (priv (trans)); +trace_iwlwifi_dev_irq (trans->dev);spin_lock_irqsave (&trans_pcie->irq_lock, flags);
@@ -1369,7 +1369,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)* This may be due to IRQ shared with another device, * or due to sporadic interrupts thrown from our NIC. */ read =le32_to_cpu (trans_pcie->ict_tbl[trans_pcie->ict_index]); -trace_iwlwifi_dev_ict_read (priv (trans), trans_pcie->ict_index, read); +trace_iwlwifi_dev_ict_read (trans->dev, trans_pcie->ict_index, read);if (!read) {IWL_DEBUG_ISR (trans,"Ignore interrupt, inta == 0\n" ); goto none;
@@ -1388,7 +1388,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)iwl_queue_inc_wrap (trans_pcie->ict_index,ICT_COUNT ); read =le32_to_cpu (trans_pcie->ict_tbl[trans_pcie->ict_index]); -trace_iwlwifi_dev_ict_read (priv (trans), trans_pcie->ict_index, +trace_iwlwifi_dev_ict_read (trans->dev, trans_pcie->ict_index, read); }while (read);
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +1 -1
@@ -820,7 +820,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)/* check that tracing gets all possible blocks */ BUILD_BUG_ON (IWL_MAX_CMD_TFDS +1 !=3 );#ifdef CONFIG_IWLWIFI_DEVICE_TRACING -trace_iwlwifi_dev_hcmd (priv (trans), cmd->flags, +trace_iwlwifi_dev_hcmd (trans->dev, cmd->flags, trace_bufs[0 ], trace_lens[0 ], trace_bufs[1 ], trace_lens[1 ], trace_bufs[2 ], trace_lens[2 ]);
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +1 -1
@@ -1468,7 +1468,7 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,dma_sync_single_for_device (trans->dev, txcmd_phys, firstlen,DMA_BIDIRECTIONAL ); - trace_iwlwifi_dev_tx(priv(trans), + trace_iwlwifi_dev_tx(trans->dev, &((struct iwl_tfd *)txq->tfds)[txq->q.write_ptr], sizeof(struct iwl_tfd), &dev_cmd->hdr, firstlen,
Signature · 1 line
1.7.0.4
PATCH RESEND 14/33 iwlwifi: virtualize command queue full behaviour
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
When the command queue is full, the transport will return -ENOSPC, but the reaction to that depends on the op_mode. Virtualize that, the DVM op_mode checks for CT-kill and restarts the hardware otherwise.
We may be able to get rid of this callback by putting the behaviour check into the wrapper but that needs more careful evaluation.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 11 +++++++++++ drivers/net/wireless/iwlwifi/iwl-agn.h | 2 ++ drivers/net/wireless/iwlwifi/iwl-op-mode.h | 7 +++++++ drivers/net/wireless/iwlwifi/iwl-shared.h | 2 -- drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 7 +------ 5 files changed, 21 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +11 -0
@@ -1403,6 +1403,16 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)ieee80211_free_hw (priv->hw); } +static void iwl_cmd_queue_full (struct iwl_op_mode *op_mode) +{ +struct iwl_priv *priv =IWL_OP_MODE_GET_DVM (op_mode); + +if (!iwl_check_for_ct_kill (priv)) { +IWL_ERR (priv,"Restarting adapter queue is full\n" ); +iwl_nic_error (op_mode); + } +} +const struct iwl_op_mode_ops iwl_dvm_ops = { .start = iwl_op_mode_dvm_start, .stop = iwl_op_mode_dvm_stop,
@@ -1412,6 +1422,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { .hw_rf_kill = iwl_set_hw_rfkill_state, .free_skb = iwl_free_skb, .nic_error = iwl_nic_error, + .cmd_queue_full = iwl_cmd_queue_full, };/*****************************************************************************
drivers/net/wireless/iwlwifi/iwl-agn.h +2 -0
@@ -90,6 +90,8 @@ void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state);void iwl_stop_sw_queue (struct iwl_op_mode *op_mode,u8 ac);void iwl_nic_error (struct iwl_op_mode *op_mode); +bool iwl_check_for_ct_kill (struct iwl_priv *priv); +/* MAC80211 */ struct ieee80211_hw *iwl_alloc_all (void ); int iwlagn_mac_setup_register(struct iwl_priv *priv,
drivers/net/wireless/iwlwifi/iwl-op-mode.h +7 -0
@@ -122,6 +122,7 @@ struct iwl_fw;* there are Tx packets pending in the transport layer. * Must be atomic * @nic_error: error notification. Must be atomic +* @cmd_queue_full: Called when the command queue gets full. Must be atomic. */ struct iwl_op_mode_ops { struct iwl_op_mode *(*start)(struct iwl_trans *trans,
@@ -134,6 +135,7 @@ struct iwl_op_mode_ops {void (*hw_rf_kill)(struct iwl_op_mode *op_mode,bool state);void (*free_skb)(struct iwl_op_mode *op_mode,struct sk_buff *skb);void (*nic_error)(struct iwl_op_mode *op_mode); +void (*cmd_queue_full)(struct iwl_op_mode *op_mode); };/**
@@ -192,6 +194,11 @@ static inline void iwl_op_mode_nic_error(struct iwl_op_mode *op_mode) op_mode->ops->nic_error (op_mode); } +static inline void iwl_op_mode_cmd_queue_full (struct iwl_op_mode *op_mode) +{ + op_mode->ops->cmd_queue_full (op_mode); +} +/***************************************************** * Op mode layers implementations ******************************************************/
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -2
@@ -461,8 +461,6 @@ enum iwl_rxon_context_id {int iwlagn_hw_valid_rtc_data_addr (u32 addr);void iwl_nic_config (struct iwl_priv *priv);const char *get_cmd_string (u8 cmd); -bool iwl_check_for_ct_kill (struct iwl_priv *priv); -/* notification wait support */ void iwl_abort_notification_waits (struct iwl_shared *shrd);
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +1 -6
@@ -671,7 +671,6 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)dma_addr_t phys_addr;u32 idx;u16 copy_size, cmd_size; -bool is_ct_kill = false;bool had_nocopy = false;int i;u8 *cmd_dest;
@@ -727,11 +726,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)spin_unlock_bh (&txq->lock);IWL_ERR (trans,"No space in command queue\n" ); - is_ct_kill =iwl_check_for_ct_kill (priv (trans)); -if (!is_ct_kill) { -IWL_ERR (trans,"Restarting adapter queue is full\n" ); -iwl_op_mode_nic_error (trans->op_mode); - } +iwl_op_mode_cmd_queue_full (trans->op_mode);return -ENOSPC ; }
Signature · 1 line
1.7.0.4
PATCH RESEND 15/33 iwlwifi: clean up iwl-core.h inclusions
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The transport doesn't need to include iwl-core.h any more.
--- drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 3 +-- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 1 - 2 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +1 -2
@@ -30,8 +30,7 @@#include <linux/wait.h> #include <linux/gfp.h> -/*TODO: Remove include to iwl-core.h*/ -#include "iwl-core.h" +#include "iwl-prph.h" #include "iwl-io.h" #include "iwl-trans-pcie-int.h" #include "iwl-op-mode.h"
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +0 -1
@@ -75,7 +75,6 @@#include "iwl-shared.h" #include "iwl-eeprom.h" #include "iwl-agn-hw.h" -#include "iwl-core.h" #define IWL_MASK (lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
Signature · 1 line
1.7.0.4
PATCH RESEND 16/33 iwlwifi: remove num_of_queues module parameter
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This is a hardware parameter, so it shouldn't be configurable by the user. Users can disable aggregation (which is the only thing affected) with 11n_disable.
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 5 ----- drivers/net/wireless/iwlwifi/iwl-2000.c | 5 ----- drivers/net/wireless/iwlwifi/iwl-5000.c | 10 ---------- drivers/net/wireless/iwlwifi/iwl-6000.c | 5 ----- drivers/net/wireless/iwlwifi/iwl-agn.c | 2 -- drivers/net/wireless/iwlwifi/iwl-shared.h | 2 -- 6 files changed, 0 insertions(+), 29 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +0 -5
@@ -122,11 +122,6 @@ static struct iwl_sensitivity_ranges iwl1000_sensitivity = {static void iwl1000_hw_set_hw_params (struct iwl_priv *priv) { -if (iwlagn_mod_params.num_of_queues >=IWL_MIN_NUM_QUEUES && - iwlagn_mod_params.num_of_queues <=IWLAGN_NUM_QUEUES ) -cfg (priv)->base_params->num_of_queues = - iwlagn_mod_params.num_of_queues; -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues;hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ );
drivers/net/wireless/iwlwifi/iwl-2000.c +0 -5
@@ -118,11 +118,6 @@ static struct iwl_sensitivity_ranges iwl2000_sensitivity = {static void iwl2000_hw_set_hw_params (struct iwl_priv *priv) { -if (iwlagn_mod_params.num_of_queues >=IWL_MIN_NUM_QUEUES && - iwlagn_mod_params.num_of_queues <=IWLAGN_NUM_QUEUES ) -cfg (priv)->base_params->num_of_queues = - iwlagn_mod_params.num_of_queues; -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues;hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ );
drivers/net/wireless/iwlwifi/iwl-5000.c +0 -10
@@ -157,11 +157,6 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv)static void iwl5000_hw_set_hw_params (struct iwl_priv *priv) { -if (iwlagn_mod_params.num_of_queues >=IWL_MIN_NUM_QUEUES && - iwlagn_mod_params.num_of_queues <=IWLAGN_NUM_QUEUES ) -cfg (priv)->base_params->num_of_queues = - iwlagn_mod_params.num_of_queues; -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
@@ -180,11 +175,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)static void iwl5150_hw_set_hw_params (struct iwl_priv *priv) { -if (iwlagn_mod_params.num_of_queues >=IWL_MIN_NUM_QUEUES && - iwlagn_mod_params.num_of_queues <=IWLAGN_NUM_QUEUES ) -cfg (priv)->base_params->num_of_queues = - iwlagn_mod_params.num_of_queues; -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
drivers/net/wireless/iwlwifi/iwl-6000.c +0 -5
@@ -139,11 +139,6 @@ static struct iwl_sensitivity_ranges iwl6000_sensitivity = {static void iwl6000_hw_set_hw_params (struct iwl_priv *priv) { -if (iwlagn_mod_params.num_of_queues >=IWL_MIN_NUM_QUEUES && - iwlagn_mod_params.num_of_queues <=IWLAGN_NUM_QUEUES ) -cfg (priv)->base_params->num_of_queues = - iwlagn_mod_params.num_of_queues; -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -2
@@ -1471,8 +1471,6 @@ MODULE_PARM_DESC(debug, "debug output mask");module_param_named (swcrypto, iwlagn_mod_params.sw_crypto, int,S_IRUGO );MODULE_PARM_DESC (swcrypto,"using crypto in software (default 0 [hardware])" ); -module_param_named (queues_num, iwlagn_mod_params.num_of_queues, int,S_IRUGO ); -MODULE_PARM_DESC (queues_num,"number of hw queues." ); module_param_named(11n_disable, iwlagn_mod_params.disable_11n, uint, S_IRUGO); MODULE_PARM_DESC(11n_disable,"disable 11n functionality, bitmap: 1: full, 2: agg TX, 4: agg RX" );
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -2
@@ -115,7 +115,6 @@ extern struct iwl_mod_params iwlagn_mod_params;* Holds the module parameters * * @sw_crypto: using hardware encryption, default = 0 -* @num_of_queues: number of tx queue, HW dependent * @disable_11n: disable 11n capabilities, default = 0, * use IWL_DISABLE_HT_* constants * @amsdu_size_8K: enable 8K amsdu size, default = 1
@@ -137,7 +136,6 @@ extern struct iwl_mod_params iwlagn_mod_params;*/ struct iwl_mod_params {int sw_crypto; -int num_of_queues;unsigned int disable_11n;int amsdu_size_8K;int antenna;
Signature · 1 line
1.7.0.4
PATCH RESEND 17/33 iwlwifi: remove max_txq_num from hw_params
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This can be used directly from the config now.
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 2 - drivers/net/wireless/iwlwifi/iwl-2000.c | 2 - drivers/net/wireless/iwlwifi/iwl-5000.c | 4 -- drivers/net/wireless/iwlwifi/iwl-6000.c | 2 - drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-core.c | 3 +- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 +- drivers/net/wireless/iwlwifi/iwl-prph.h | 4 -- drivers/net/wireless/iwlwifi/iwl-shared.h | 2 - drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 3 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 35 ++++++++++++++------- 12 files changed, 30 insertions(+), 33 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +0 -2
@@ -122,8 +122,6 @@ static struct iwl_sensitivity_ranges iwl1000_sensitivity = {static void iwl1000_hw_set_hw_params (struct iwl_priv *priv) { -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; -hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ ); hw_params(priv).tx_chains_num =
drivers/net/wireless/iwlwifi/iwl-2000.c +0 -2
@@ -118,8 +118,6 @@ static struct iwl_sensitivity_ranges iwl2000_sensitivity = {static void iwl2000_hw_set_hw_params (struct iwl_priv *priv) { -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; -hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ ); hw_params(priv).tx_chains_num =
drivers/net/wireless/iwlwifi/iwl-5000.c +0 -4
@@ -157,8 +157,6 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv)static void iwl5000_hw_set_hw_params (struct iwl_priv *priv) { -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; -hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ ) |BIT (IEEE80211_BAND_5GHZ );
@@ -175,8 +173,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)static void iwl5150_hw_set_hw_params (struct iwl_priv *priv) { -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; -hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ ) |BIT (IEEE80211_BAND_5GHZ );
drivers/net/wireless/iwlwifi/iwl-6000.c +0 -2
@@ -139,8 +139,6 @@ static struct iwl_sensitivity_ranges iwl6000_sensitivity = {static void iwl6000_hw_set_hw_params (struct iwl_priv *priv) { -hw_params (priv).max_txq_num =cfg (priv)->base_params->num_of_queues; -hw_params (priv).ht40_channel =BIT (IEEE80211_BAND_2GHZ ) |BIT (IEEE80211_BAND_5GHZ );
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +1 -1
@@ -1129,7 +1129,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,* (in Tx queue's circular buffer) of first TFD/frame in window */ u16 ba_resp_scd_ssn =le16_to_cpu (ba_resp->scd_ssn); -if (scd_flow >=hw_params (priv).max_txq_num) { +if (scd_flow >=cfg (priv)->base_params->num_of_queues) {IWL_ERR (priv,"BUG_ON scd_flow is bigger than number of queues\n" );return 0 ;
drivers/net/wireless/iwlwifi/iwl-core.c +2 -1
@@ -1350,7 +1350,8 @@ void iwl_bg_watchdog(unsigned long data)/* monitor and check for other stuck queues */ if (iwl_is_any_associated (priv)) { -for (cnt =0 ; cnt <hw_params (priv).max_txq_num; cnt++) { +for (cnt =0 ; cnt <cfg (priv)->base_params->num_of_queues; + cnt++) {/* skip as we already checked the command queue */ if (cnt == priv->shrd->cmd_queue)continue ;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +1 -1
@@ -834,7 +834,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,char *buf;int bufsz = ((IWL_TRAFFIC_ENTRIES *IWL_TRAFFIC_ENTRY_SIZE *64 ) *2 ) + - (hw_params (priv).max_txq_num *32 *8 ) +400 ; + (cfg (priv)->base_params->num_of_queues *32 *8 ) +400 ;const u8 *ptr;ssize_t ret;
drivers/net/wireless/iwlwifi/iwl-prph.h +0 -4
@@ -216,10 +216,6 @@#define SCD_TRANS_TBL_OFFSET_QUEUE (x) \ ((SCD_TRANS_TBL_MEM_LOWER_BOUND + ((x) * 2)) & 0xfffc) -#define SCD_QUEUECHAIN_SEL_ALL (priv) \ - (((1<<hw_params(priv).max_txq_num) - 1) &\ - (~(1<<(priv)->shrd->cmd_queue))) -#define SCD_BASE (PRPH_BASE + 0xa02c00)#define SCD_SRAM_BASE_ADDR (SCD_BASE + 0x0)
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -2
@@ -160,7 +160,6 @@ struct iwl_mod_params {* * Holds the module parameters * -* @max_txq_num: Max # Tx queues supported * @num_ampdu_queues: num of ampdu queues * @tx_chains_num: Number of TX chains * @rx_chains_num: Number of RX chains
@@ -176,7 +175,6 @@ struct iwl_mod_params {* @struct iwl_sensitivity_ranges: range of sensitivity values */ struct iwl_hw_params { -u8 max_txq_num;u8 num_ampdu_queues;u8 tx_chains_num;u8 rx_chains_num;
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +1 -1
@@ -1049,7 +1049,7 @@ void iwl_irq_tasklet(struct iwl_trans *trans)if (inta &CSR_INT_BIT_WAKEUP ) {IWL_DEBUG_ISR (trans,"Wakeup interrupt\n" );iwl_rx_queue_update_write_ptr (trans, &trans_pcie->rxq); -for (i =0 ; i <hw_params (trans).max_txq_num; i++) +for (i =0 ; i <cfg (trans)->base_params->num_of_queues; i++)iwl_txq_update_write_ptr (trans, &trans_pcie->txq[i]);
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +2 -1
@@ -595,7 +595,8 @@ static int iwlagn_txq_ctx_activate_free(struct iwl_trans *trans)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);int txq_id; -for (txq_id =0 ; txq_id <hw_params (trans).max_txq_num; txq_id++) +for (txq_id =0 ; txq_id <cfg (trans)->base_params->num_of_queues; + txq_id++)if (!test_and_set_bit (txq_id, &trans_pcie->txq_ctx_active_msk))return txq_id;
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +23 -12
@@ -78,6 +78,11 @@#define IWL_MASK (lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo)))) +#define SCD_QUEUECHAIN_SEL_ALL (trans) \ + (((1<<cfg(trans)->base_params->num_of_queues) - 1) &\ + (~(1<<(trans)->shrd->cmd_queue))) + +static int iwl_trans_rx_alloc (struct iwl_trans *trans) { struct iwl_trans_pcie *trans_pcie =
@@ -492,7 +497,7 @@ static void iwl_trans_pcie_tx_free(struct iwl_trans *trans)/* Tx queues */ if (trans_pcie->txq) {for (txq_id =0 ; - txq_id <hw_params (trans).max_txq_num; txq_id++) + txq_id <cfg (trans)->base_params->num_of_queues; txq_id++)iwl_tx_queue_free (trans, txq_id); }
@@ -517,7 +522,7 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)int txq_id, slots_num;struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); -u16 scd_bc_tbls_size =hw_params (trans).max_txq_num * +u16 scd_bc_tbls_size =cfg (trans)->base_params->num_of_queues *sizeof (struct iwlagn_scd_bc_tbl );/*It is not allowed to alloc twice, so warn when this happens.
@@ -541,7 +546,7 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans) goto error; } - trans_pcie->txq =kcalloc (hw_params (trans).max_txq_num, + trans_pcie->txq =kcalloc (cfg (trans)->base_params->num_of_queues,sizeof (struct iwl_tx_queue ),GFP_KERNEL );if (!trans_pcie->txq) {IWL_ERR (trans,"Not enough memory for txq\n" );
@@ -550,7 +555,8 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans) }/* Alloc and init all Tx queues, including the command queue (#4/#9) */ -for (txq_id =0 ; txq_id <hw_params (trans).max_txq_num; txq_id++) { +for (txq_id =0 ; txq_id <cfg (trans)->base_params->num_of_queues; + txq_id++) { slots_num = (txq_id == trans->shrd->cmd_queue) ?TFD_CMD_SLOTS :TFD_TX_CMD_SLOTS ; ret = iwl_trans_txq_alloc(trans, &trans_pcie->txq[txq_id],
@@ -595,7 +601,8 @@ static int iwl_tx_init(struct iwl_trans *trans)spin_unlock_irqrestore (&trans_pcie->irq_lock, flags);/* Alloc and init all Tx queues, including the command queue (#4/#9) */ -for (txq_id =0 ; txq_id <hw_params (trans).max_txq_num; txq_id++) { +for (txq_id =0 ; txq_id <cfg (trans)->base_params->num_of_queues; + txq_id++) { slots_num = (txq_id == trans->shrd->cmd_queue) ?TFD_CMD_SLOTS :TFD_TX_CMD_SLOTS ; ret = iwl_trans_txq_init(trans, &trans_pcie->txq[txq_id],
@@ -1113,7 +1120,8 @@ static void iwl_tx_start(struct iwl_trans *trans) a += 4)iwl_write_targ_mem (trans, a,0 );for (; a < trans_pcie->scd_base_addr + -SCD_TRANS_TBL_OFFSET_QUEUE (hw_params (trans).max_txq_num); +SCD_TRANS_TBL_OFFSET_QUEUE ( +cfg (trans)->base_params->num_of_queues); a +=4 )iwl_write_targ_mem (trans, a,0 );
@@ -1136,7 +1144,7 @@ static void iwl_tx_start(struct iwl_trans *trans)iwl_write_prph (trans,SCD_AGGR_SEL ,0 );/* initiate the queues */ -for (i =0 ; i <hw_params (trans).max_txq_num; i++) { +for (i =0 ; i <cfg (trans)->base_params->num_of_queues; i++) {iwl_write_prph (trans,SCD_QUEUE_RDPTR (i),0 );iwl_write_direct32 (trans,HBUS_TARG_WRPTR ,0 | (i <<8 )); iwl_write_targ_mem(trans, trans_pcie->scd_base_addr +
@@ -1153,7 +1161,7 @@ static void iwl_tx_start(struct iwl_trans *trans) }iwl_write_prph (trans,SCD_INTERRUPT_MASK , -IWL_MASK (0 ,hw_params (trans).max_txq_num)); +IWL_MASK (0 ,cfg (trans)->base_params->num_of_queues));/* Activate all Tx DMA/FIFO channels */ iwl_trans_txq_set_sched (trans,IWL_MASK (0 ,7 ));
@@ -1242,7 +1250,8 @@ static int iwl_trans_tx_stop(struct iwl_trans *trans) }/* Unmap DMA from host system and free skb's */ -for (txq_id =0 ; txq_id <hw_params (trans).max_txq_num; txq_id++) +for (txq_id =0 ; txq_id <cfg (trans)->base_params->num_of_queues; + txq_id++)iwl_tx_queue_unmap (trans, txq_id);return 0 ;
@@ -1700,7 +1709,7 @@ static int iwl_trans_pcie_wait_tx_queue_empty(struct iwl_trans *trans)int ret =0 ;/* waiting for all the tx frames complete might take a while */ -for (cnt =0 ; cnt <hw_params (trans).max_txq_num; cnt++) { +for (cnt =0 ; cnt <cfg (trans)->base_params->num_of_queues; cnt++) {if (cnt == trans->shrd->cmd_queue)continue ; txq = &trans_pcie->txq[cnt];
@@ -1946,7 +1955,9 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,int pos =0 ;int cnt;int ret; -const size_t bufsz =sizeof (char ) *64 *hw_params (trans).max_txq_num; +size_t bufsz; + + bufsz =sizeof (char ) *64 *cfg (trans)->base_params->num_of_queues;if (!trans_pcie->txq) {IWL_ERR (trans,"txq not ready\n" );
@@ -1956,7 +1967,7 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,if (!buf)return -ENOMEM ; -for (cnt =0 ; cnt <hw_params (trans).max_txq_num; cnt++) { +for (cnt =0 ; cnt <cfg (trans)->base_params->num_of_queues; cnt++) { txq = &trans_pcie->txq[cnt]; q = &txq->q; pos += scnprintf(buf + pos, bufsz - pos,
Signature · 1 line
1.7.0.4
PATCH RESEND 18/33 iwlwifi: keep plcp_delta_threshold in priv
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The base_params shouldn't be writable, so keep
a copy of this in priv that can be modified.
--- drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 3 +++ drivers/net/wireless/iwlwifi/iwl-debugfs.c | 6 +++--- drivers/net/wireless/iwlwifi/iwl-dev.h | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +1 -1
@@ -320,7 +320,7 @@ static bool iwlagn_good_plcp_health(struct iwl_priv *priv, unsigned int msecs) {int delta; -int threshold =cfg (priv)->base_params->plcp_delta_threshold; +int threshold = priv->plcp_delta_threshold;if (threshold ==IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE ) {IWL_DEBUG_RADIO (priv,"plcp_err check disabled\n" );
drivers/net/wireless/iwlwifi/iwl-agn.c +3 -0
@@ -1045,6 +1045,9 @@ static int iwl_init_drv(struct iwl_priv *priv) priv->ieee_rates =NULL ; priv->band =IEEE80211_BAND_2GHZ ; + priv->plcp_delta_threshold = +cfg (priv)->base_params->plcp_delta_threshold; + priv->iw_mode =NL80211_IFTYPE_STATION ; priv->current_ht_config.smps =IEEE80211_SMPS_STATIC ; priv->missed_beacon_threshold =IWL_MISSED_BEACON_THRESHOLD_DEF ;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +3 -3
@@ -2241,7 +2241,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,const size_t bufsz =sizeof (buf); pos +=scnprintf (buf + pos, bufsz - pos,"%u\n" , -cfg (priv)->base_params->plcp_delta_threshold); + priv->plcp_delta_threshold);return simple_read_from_buffer (user_buf, count, ppos, buf, pos); }
@@ -2263,10 +2263,10 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file,return -EINVAL ;if ((plcp <IWL_MAX_PLCP_ERR_THRESHOLD_MIN ) || (plcp >IWL_MAX_PLCP_ERR_THRESHOLD_MAX )) -cfg (priv)->base_params->plcp_delta_threshold = + priv->plcp_delta_threshold =IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE ;else -cfg (priv)->base_params->plcp_delta_threshold = plcp; + priv->plcp_delta_threshold = plcp;return count; }
drivers/net/wireless/iwlwifi/iwl-dev.h +2 -0
@@ -770,6 +770,8 @@ struct iwl_priv {struct iwl_channel_info *channel_info;/* channel info array */ u8 channel_count;/* # of channels */ +u8 plcp_delta_threshold; +/* thermal calibration */ s32 temperature;/* Celsius */ s32 last_temperature;
Signature · 1 line
1.7.0.4
PATCH RESEND 19/33 iwlwifi: use watchdog timeout from hw_params
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This is the version that can be modified, the
config params should be read-only.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +2 -2
@@ -1340,7 +1340,7 @@ void iwl_bg_watchdog(unsigned long data)if (iwl_is_rfkill (priv->shrd))return ; - timeout =cfg (priv)->base_params->wd_timeout; + timeout =hw_params (priv).wd_timeout;if (timeout ==0 )return ;
@@ -1366,7 +1366,7 @@ void iwl_bg_watchdog(unsigned long data)void iwl_setup_watchdog (struct iwl_priv *priv) { -unsigned int timeout =cfg (priv)->base_params->wd_timeout; +unsigned int timeout =hw_params (priv).wd_timeout;if (!iwlagn_mod_params.wd_disable) {/* use system default */
drivers/net/wireless/iwlwifi/iwl-debugfs.c +1 -1
@@ -2368,7 +2368,7 @@ static ssize_t iwl_dbgfs_wd_timeout_write(struct file *file,if (timeout <0 || timeout >IWL_MAX_WD_TIMEOUT ) timeout =IWL_DEF_WD_TIMEOUT ; -cfg (priv)->base_params->wd_timeout = timeout; +hw_params (priv).wd_timeout = timeout;iwl_setup_watchdog (priv);return count; }
Signature · 1 line
1.7.0.4
PATCH RESEND 20/33 iwlwifi: put use_rts_for_aggregation into hw_params
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The hardware config ht_params shouldn't be modified, so copy the use_rts_for_aggregation parameter into hw_params and use/modify it there.
--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 3 +-- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 3 +-- drivers/net/wireless/iwlwifi/iwl-agn.c | 4 ++++ drivers/net/wireless/iwlwifi/iwl-debugfs.c | 6 +++--- drivers/net/wireless/iwlwifi/iwl-mac80211.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-shared.h | 2 ++ 6 files changed, 13 insertions(+), 9 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +1 -2
@@ -436,8 +436,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)* force CTS-to-self frames protection if RTS-CTS is not preferred * one aggregation protection method */ -if (!(cfg (priv)->ht_params && -cfg (priv)->ht_params->use_rts_for_aggregation)) +if (!hw_params (priv).use_rts_for_aggregation) ctx->staging.flags |=RXON_FLG_SELF_CTS_EN ; if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +1 -2
@@ -594,8 +594,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, sta_priv->max_agg_bufsize =min (sta_priv->max_agg_bufsize, buf_size); -if (cfg (priv)->ht_params && -cfg (priv)->ht_params->use_rts_for_aggregation) { +if (hw_params (priv).use_rts_for_aggregation) {/* * switch to RTS/CTS if it is the prefer protection * method for HT traffic
drivers/net/wireless/iwlwifi/iwl-agn.c +4 -0
@@ -1119,6 +1119,10 @@ static void iwl_uninit_drv(struct iwl_priv *priv)static void iwl_set_hw_params (struct iwl_priv *priv) { +if (cfg (priv)->ht_params) +hw_params (priv).use_rts_for_aggregation = +cfg (priv)->ht_params->use_rts_for_aggregation; +if (iwlagn_mod_params.amsdu_size_8K)hw_params (priv).rx_page_order =get_order (IWL_RX_BUF_SIZE_8K );
drivers/net/wireless/iwlwifi/iwl-debugfs.c +3 -3
@@ -2431,7 +2431,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,if (cfg (priv)->ht_params) pos +=scnprintf (buf + pos, bufsz - pos,"use %s for aggregation\n" , - (cfg (priv)->ht_params->use_rts_for_aggregation) ? + (hw_params (priv).use_rts_for_aggregation) ?"rts/cts" :"cts-to-self" );else pos +=scnprintf (buf + pos, bufsz - pos,"N/A" );
@@ -2458,9 +2458,9 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,if (sscanf (buf,"%d" , &rts) !=1 )return -EINVAL ;if (rts) -cfg (priv)->ht_params->use_rts_for_aggregation = true; +hw_params (priv).use_rts_for_aggregation = true;else -cfg (priv)->ht_params->use_rts_for_aggregation = false; +hw_params (priv).use_rts_for_aggregation = false;return count; }
drivers/net/wireless/iwlwifi/iwl-mac80211.c +2 -2
@@ -660,8 +660,8 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,IWL_DEBUG_HT (priv,"priv->agg_tids_count = %u\n" , priv->agg_tids_count); } -if (!priv->agg_tids_count &&cfg (priv)->ht_params && -cfg (priv)->ht_params->use_rts_for_aggregation) { +if (!priv->agg_tids_count && +hw_params (priv).use_rts_for_aggregation) {/* * switch off RTS/CTS if it was previously enabled */
drivers/net/wireless/iwlwifi/iwl-shared.h +2 -0
@@ -173,6 +173,7 @@ struct iwl_mod_params {* relevant for 1000, 6000 and up * @wd_timeout: TX queues watchdog timeout * @struct iwl_sensitivity_ranges: range of sensitivity values +* @use_rts_for_aggregation: use rts/cts protection for HT traffic */ struct iwl_hw_params {u8 num_ampdu_queues;
@@ -181,6 +182,7 @@ struct iwl_hw_params {u8 valid_tx_ant;u8 valid_rx_ant;u8 ht40_channel; +bool use_rts_for_aggregation;u16 sku;u32 rx_page_order;u32 ct_kill_threshold;
Signature · 1 line
1.7.0.4
PATCH RESEND 21/33 iwlwifi: constify remaining config data
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The HW configuration settings base_params, ht_params and bt_params all should be const, make it so.
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 5 +++-- drivers/net/wireless/iwlwifi/iwl-2000.c | 8 ++++---- drivers/net/wireless/iwlwifi/iwl-5000.c | 5 +++-- drivers/net/wireless/iwlwifi/iwl-6000.c | 11 ++++++----- drivers/net/wireless/iwlwifi/iwl-shared.h | 6 +++--- 5 files changed, 19 insertions(+), 16 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +3 -2
@@ -155,7 +155,7 @@ static struct iwl_lib_ops iwl1000_lib = { .temperature = iwlagn_temperature, }; -static struct iwl_base_params iwl1000_base_params = { +static const struct iwl_base_params iwl1000_base_params = { .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES , .eeprom_size =OTP_LOW_IMAGE_SIZE ,
@@ -170,7 +170,8 @@ static struct iwl_base_params iwl1000_base_params = { .max_event_log_size = 128, .wd_disable = true, }; -static struct iwl_ht_params iwl1000_ht_params = { + +static const struct iwl_ht_params iwl1000_ht_params = { .ht_greenfield_support = true, .use_rts_for_aggregation = true,/* use rts/cts protection */ .smps_mode =IEEE80211_SMPS_DYNAMIC ,
drivers/net/wireless/iwlwifi/iwl-2000.c +4 -4
@@ -173,7 +173,7 @@ static struct iwl_lib_ops iwl2030_lib = { .temperature = iwlagn_temperature, }; -static struct iwl_base_params iwl2000_base_params = { +static const struct iwl_base_params iwl2000_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -192,7 +192,7 @@ static struct iwl_base_params iwl2000_base_params = { }; -static struct iwl_base_params iwl2030_base_params = { +static const struct iwl_base_params iwl2030_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -210,12 +210,12 @@ static struct iwl_base_params iwl2030_base_params = { .hd_v2 = true, }; -static struct iwl_ht_params iwl2000_ht_params = { +static const struct iwl_ht_params iwl2000_ht_params = { .ht_greenfield_support = true, .use_rts_for_aggregation = true,/* use rts/cts protection */ }; -static struct iwl_bt_params iwl2030_bt_params = { +static const struct iwl_bt_params iwl2030_bt_params = {/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .advanced_bt_coexist = true, .agg_time_limit =BT_AGG_THRESHOLD_DEF ,
drivers/net/wireless/iwlwifi/iwl-5000.c +3 -2
@@ -306,7 +306,7 @@ static struct iwl_lib_ops iwl5150_lib = { .temperature = iwl5150_temperature, }; -static struct iwl_base_params iwl5000_base_params = { +static const struct iwl_base_params iwl5000_base_params = { .eeprom_size =IWLAGN_EEPROM_IMG_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -319,7 +319,8 @@ static struct iwl_base_params iwl5000_base_params = { .no_idle_support = true, .wd_disable = true, }; -static struct iwl_ht_params iwl5000_ht_params = { + +static const struct iwl_ht_params iwl5000_ht_params = { .ht_greenfield_support = true, };
drivers/net/wireless/iwlwifi/iwl-6000.c +6 -5
@@ -269,7 +269,7 @@ static struct iwl_lib_ops iwl6030_lib = { .temperature = iwlagn_temperature, }; -static struct iwl_base_params iwl6000_base_params = { +static const struct iwl_base_params iwl6000_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -286,7 +286,7 @@ static struct iwl_base_params iwl6000_base_params = { .shadow_reg_enable = true, }; -static struct iwl_base_params iwl6050_base_params = { +static const struct iwl_base_params iwl6050_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -302,7 +302,8 @@ static struct iwl_base_params iwl6050_base_params = { .max_event_log_size = 1024, .shadow_reg_enable = true, }; -static struct iwl_base_params iwl6000_g2_base_params = { + +static const struct iwl_base_params iwl6000_g2_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE , .num_of_queues =IWLAGN_NUM_QUEUES , .num_of_ampdu_queues =IWLAGN_NUM_AMPDU_QUEUES ,
@@ -319,12 +320,12 @@ static struct iwl_base_params iwl6000_g2_base_params = { .shadow_reg_enable = true, }; -static struct iwl_ht_params iwl6000_ht_params = { +static const struct iwl_ht_params iwl6000_ht_params = { .ht_greenfield_support = true, .use_rts_for_aggregation = true,/* use rts/cts protection */ }; -static struct iwl_bt_params iwl6000_bt_params = { +static const struct iwl_bt_params iwl6000_bt_params = {/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .advanced_bt_coexist = true, .agg_time_limit =BT_AGG_THRESHOLD_DEF ,
drivers/net/wireless/iwlwifi/iwl-shared.h +3 -3
@@ -364,10 +364,10 @@ struct iwl_cfg {const struct iwl_lib_ops *lib;void (*additional_nic_config)(struct iwl_priv *priv);/* params not likely to change within a device family */ -struct iwl_base_params *base_params; +const struct iwl_base_params *base_params;/* params likely to change within a device family */ -struct iwl_ht_params *ht_params; -struct iwl_bt_params *bt_params; +const struct iwl_ht_params *ht_params; +const struct iwl_bt_params *bt_params;enum iwl_pa_type pa_type;/* if used set to IWL_PA_SYSTEM */ const bool need_temp_offset_calib;/* if used set to true */ const bool no_xtal_calib;
Signature · 1 line
1.7.0.4
PATCH RESEND 22/33 iwlwifi: fix notification wait bug
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
In "iwlwifi: consolidate the start_device flow" Emmanuel added the return if the fw isn't there but forgot to take into account that the struct for notification wait needs to be added only after the check -- fix that.
--- drivers/net/wireless/iwlwifi/iwl-ucode.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-ucode.c +3 -3
@@ -533,9 +533,6 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,int ret;enum iwl_ucode_type old_type; -iwl_init_notification_wait (priv->shrd, &alive_wait,REPLY_ALIVE , - iwl_alive_fn, &alive_data); - old_type = priv->shrd->ucode_type; priv->shrd->ucode_type = ucode_type; fw =iwl_get_ucode_image (priv, ucode_type);
@@ -543,6 +540,9 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,if (!fw)return -EINVAL ; +iwl_init_notification_wait (priv->shrd, &alive_wait,REPLY_ALIVE , + iwl_alive_fn, &alive_data); + ret =iwl_trans_start_fw (trans (priv), fw);if (ret) { priv->shrd->ucode_type = old_type;
Signature · 1 line
1.7.0.4
PATCH RESEND 24/33 iwlwifi: move ucode_owner to priv
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The transport doesn't really need to know as we can enforce it in the command wrapper. Move the ucode_owner variable into priv and do all enforcing there.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 6 ++++++ drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 2 ++ drivers/net/wireless/iwlwifi/iwl-dev.h | 4 ++++ drivers/net/wireless/iwlwifi/iwl-shared.h | 4 ---- drivers/net/wireless/iwlwifi/iwl-testmode.c | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 6 ------ drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 1 - 8 files changed, 14 insertions(+), 13 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +6 -0
@@ -1306,6 +1306,12 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)if (cmd->flags &CMD_SYNC )lockdep_assert_held (&priv->mutex); +if (priv->ucode_owner ==IWL_OWNERSHIP_TM && + !(cmd->flags &CMD_ON_DEMAND )) { +IWL_DEBUG_HC (priv,"tm own the uCode, no regular hcmd send\n" ); +return -EIO ; + } +return iwl_trans_send_cmd (trans (priv), cmd); }
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +1 -1
@@ -1165,7 +1165,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,iwl_notification_wait_notify (&priv->notif_wait, pkt);if (priv->pre_rx_handler && - priv->shrd->ucode_owner ==IWL_OWNERSHIP_TM ) + priv->ucode_owner ==IWL_OWNERSHIP_TM ) priv->pre_rx_handler (priv, rxb);else {/* Based on type of command response or notification,
drivers/net/wireless/iwlwifi/iwl-agn.c +2 -0
@@ -1053,6 +1053,8 @@ static int iwl_init_drv(struct iwl_priv *priv) priv->missed_beacon_threshold =IWL_MISSED_BEACON_THRESHOLD_DEF ; priv->agg_tids_count =0 ; + priv->ucode_owner =IWL_OWNERSHIP_DRIVER ; +/* initialize force reset */ priv->force_reset[IWL_RF_RESET ].reset_duration =IWL_DELAY_NEXT_FORCE_RF_RESET ;
drivers/net/wireless/iwlwifi/iwl-dev.h +4 -0
@@ -748,6 +748,10 @@ struct iwl_priv {struct iwl_spectrum_notification measure_report;u8 measurement_status; +#define IWL_OWNERSHIP_DRIVER 0 +#define IWL_OWNERSHIP_TM 1 +u8 ucode_owner; +/* ucode beacon time */ u32 ucode_beacon_time;int missed_beacon_threshold;
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -4
@@ -354,7 +354,6 @@ struct iwl_cfg {/** * struct iwl_shared - shared fields for all the layers of the driver * -* @ucode_owner: IWL_OWNERSHIP_* * @cmd_queue: command queue number * @status: STATUS_* * @wowlan: are we running wowlan uCode
@@ -372,9 +371,6 @@ struct iwl_cfg {* @device_pointers: pointers to ucode event tables */ struct iwl_shared { -#define IWL_OWNERSHIP_DRIVER 0 -#define IWL_OWNERSHIP_TM 1 -u8 ucode_owner;u8 cmd_queue;unsigned long status;u8 valid_contexts;
drivers/net/wireless/iwlwifi/iwl-testmode.c +1 -1
@@ -770,7 +770,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb) owner =nla_get_u8 (tb[IWL_TM_ATTR_UCODE_OWNER ]);if ((owner ==IWL_OWNERSHIP_DRIVER ) || (owner ==IWL_OWNERSHIP_TM )) - priv->shrd->ucode_owner = owner; + priv->ucode_owner = owner;else {IWL_ERR (priv,"Invalid owner\n" );return -EINVAL ;
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +0 -6
@@ -686,12 +686,6 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)return -EIO ; } -if ((trans->shrd->ucode_owner ==IWL_OWNERSHIP_TM ) && - !(cmd->flags &CMD_ON_DEMAND )) { -IWL_DEBUG_HC (trans,"tm own the uCode, no regular hcmd send\n" ); -return -EIO ; - } - copy_size =sizeof (out_cmd->hdr); cmd_size =sizeof (out_cmd->hdr);
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +0 -1
@@ -1029,7 +1029,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,IWL_TRANS_GET_PCIE_TRANS (trans);bool hw_rfkill; - trans->shrd->ucode_owner =IWL_OWNERSHIP_DRIVER ; trans_pcie->ac_to_queue[IWL_RXON_CTX_BSS ] = iwlagn_bss_ac_to_queue; trans_pcie->ac_to_queue[IWL_RXON_CTX_PAN ] = iwlagn_pan_ac_to_queue;
Signature · 1 line
1.7.0.4
PATCH RESEND 25/33 iwlwifi: move all uCode load variables
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
All variables related to uCode loading (the waitqueue and done indication) should be in the PCI-E transport's private data as this
is transport specific. Move them there.
--- drivers/net/wireless/iwlwifi/iwl-shared.h | 2 +- drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 6 ++++++ drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 8 +++++--- drivers/net/wireless/iwlwifi/iwl-trans.h | 3 --- 5 files changed, 14 insertions(+), 9 deletions(-)
drivers/net/wireless/iwlwifi/iwl-shared.h +1 -1
@@ -365,7 +365,7 @@ struct iwl_cfg {* @nic: pointer to the nic data * @hw_params: see struct iwl_hw_params * @lock: protect general shared data -* @wait_command_queue: the wait_queue for SYNC host command nad uCode load +* @wait_command_queue: the wait_queue for SYNC host commands * @eeprom: pointer to the eeprom/OTP image * @ucode_type: indicator of loaded ucode image * @device_pointers: pointers to ucode event tables
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +6 -0
@@ -32,6 +32,7 @@#include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/skbuff.h> +#include <linux/wait.h> #include <linux/pci.h> #include "iwl-fh.h"
@@ -243,6 +244,8 @@ struct iwl_tx_queue {* queue_stop_count: tracks what SW queue is stopped * @pci_dev: basic pci-network driver stuff * @hw_base: pci hardware address support +* @ucode_write_complete: indicates that the ucode has been copied. +* @ucode_write_waitq: wait queue for uCode load */ struct iwl_trans_pcie {struct iwl_rx_queue rxq;
@@ -279,6 +282,9 @@ struct iwl_trans_pcie {/* PCI bus related data */ struct pci_dev *pci_dev;void __iomem *hw_base; + +bool ucode_write_complete; +wait_queue_head_t ucode_write_waitq; };#define IWL_TRANS_GET_PCIE_TRANS (_iwl_trans) \
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +2 -2
@@ -1114,8 +1114,8 @@ void iwl_irq_tasklet(struct iwl_trans *trans) isr_stats->tx++; handled |=CSR_INT_BIT_FH_TX ;/* Wake up uCode load routine, now that load is complete */ - trans->ucode_write_complete =1 ; -wake_up (&trans->shrd->wait_command_queue); + trans_pcie->ucode_write_complete = true; +wake_up (&trans_pcie->ucode_write_waitq); }if (inta & ~handled) {
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +5 -3
@@ -954,11 +954,12 @@ static const u8 iwlagn_pan_ac_to_queue[] = {static int iwl_load_section (struct iwl_trans *trans,const char *name,const struct fw_desc *image,u32 dst_addr) { +struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);dma_addr_t phy_addr = image->p_addr;u32 byte_cnt = image->len;int ret; - trans->ucode_write_complete =0 ; + trans_pcie->ucode_write_complete = false; iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(FH_SRVC_CHNL),
@@ -989,8 +990,8 @@ static int iwl_load_section(struct iwl_trans *trans, const char *name, FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);IWL_DEBUG_FW (trans,"%s uCode section being loaded...\n" , name); - ret =wait_event_timeout (trans->shrd->wait_command_queue, - trans->ucode_write_complete,5 *HZ ); + ret =wait_event_timeout (trans_pcie->ucode_write_waitq, + trans_pcie->ucode_write_complete,5 *HZ );if (!ret) {IWL_ERR (trans,"Could not load the %s uCode section\n" , name);
@@ -2266,6 +2267,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, trans->shrd = shrd; trans_pcie->trans = trans;spin_lock_init (&trans_pcie->irq_lock); +init_waitqueue_head (&trans_pcie->ucode_write_waitq);/* W/A - seems to solve weird behavior. We need to remove this if we * don't want to stay in L1 all the time. This wastes a lot of power */
drivers/net/wireless/iwlwifi/iwl-trans.h +0 -3
@@ -338,7 +338,6 @@ enum iwl_trans_state {* @hw_id: a u32 with the ID of the device / subdevice. * Set during transport allocation. * @hw_id_str: a string with info about HW ID. Set during transport allocation. -* @ucode_write_complete: indicates that the ucode has been copied. * @nvm_device_type: indicates OTP or eeprom * @pm_support: set to true in start_hw if link pm is supported */
@@ -355,8 +354,6 @@ struct iwl_trans {u32 hw_id;char hw_id_str[52 ]; -u8 ucode_write_complete; -int nvm_device_type;bool pm_support;
Signature · 1 line
1.7.0.4
PATCH RESEND 23/33 iwlwifi: abstract out notification wait support
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This will be sharable, but needs to live in theop_mode as it is dependent on command processing.
Make a library out of the notification wait code.
Since I wrote all of the code originally and only
Intel employees changed it, we can also relicense
it to dual BSD/GPL.
--- drivers/net/wireless/iwlwifi/Makefile | 1 + drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 24 +---- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 11 +- drivers/net/wireless/iwlwifi/iwl-core.c | 2 +- drivers/net/wireless/iwlwifi/iwl-dev.h | 3 + drivers/net/wireless/iwlwifi/iwl-notif-wait.c | 157 +++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-notif-wait.h | 130 ++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-shared.h | 55 --------- drivers/net/wireless/iwlwifi/iwl-testmode.c | 10 +- drivers/net/wireless/iwlwifi/iwl-ucode.c | 81 ++----------- 10 files changed, 314 insertions(+), 160 deletions(-) create mode 100644 drivers/net/wireless/iwlwifi/iwl-notif-wait.c create mode 100644 drivers/net/wireless/iwlwifi/iwl-notif-wait.h
drivers/net/wireless/iwlwifi/Makefile +1 -0
@@ -14,6 +14,7 @@ iwlwifi-objs += iwl-1000.o iwlwifi-objs += iwl-2000.o iwlwifi-objs += iwl-pci.o iwlwifi-objs += iwl-drv.o +iwlwifi-objs += iwl-notif-wait.o iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +2 -22
@@ -1142,9 +1142,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) priv->rx_handlers[REPLY_TX ] = iwlagn_rx_reply_tx;/* set up notification wait support */ -spin_lock_init (&priv->shrd->notif_wait_lock); -INIT_LIST_HEAD (&priv->shrd->notif_waits); -init_waitqueue_head (&priv->shrd->notif_waitq); +iwl_notification_wait_init (&priv->notif_wait);/* Set up BT Rx handlers */ if (cfg (priv)->lib->bt_rx_handler_setup)
@@ -1164,25 +1162,7 @@ int iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,* even if the RX handler consumes the RXB we have * access to it in the notification wait entry. */ -if (!list_empty (&priv->shrd->notif_waits)) { -struct iwl_notification_wait *w; - -spin_lock (&priv->shrd->notif_wait_lock); -list_for_each_entry (w, &priv->shrd->notif_waits, list) { -if (w->cmd != pkt->hdr.cmd) -continue ; -IWL_DEBUG_RX (priv, -"Notif: %s, 0x%02x - wake the callers up\n" , -get_cmd_string (pkt->hdr.cmd), - pkt->hdr.cmd); - w->triggered = true; -if (w->fn) - w->fn (priv, pkt, w->fn_data); - } -spin_unlock (&priv->shrd->notif_wait_lock); - -wake_up_all (&priv->shrd->notif_waitq); - } +iwl_notification_wait_notify (&priv->notif_wait, pkt);if (priv->pre_rx_handler && priv->shrd->ucode_owner ==IWL_OWNERSHIP_TM )
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +6 -5
@@ -60,9 +60,9 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,u8 old_dev_type = send->dev_type;int ret; -iwl_init_notification_wait (priv->shrd, &disable_wait, -REPLY_WIPAN_DEACTIVATION_COMPLETE , -NULL ,NULL ); +iwl_init_notification_wait (&priv->notif_wait, &disable_wait, +REPLY_WIPAN_DEACTIVATION_COMPLETE , +NULL ,NULL ); send->filter_flags &= ~RXON_FILTER_ASSOC_MSK ; send->dev_type =RXON_DEV_TYPE_P2P ;
@@ -74,9 +74,10 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,if (ret) {IWL_ERR (priv,"Error disabling PAN (%d)\n" , ret); -iwl_remove_notification (priv->shrd, &disable_wait); +iwl_remove_notification (&priv->notif_wait, &disable_wait); }else { - ret =iwl_wait_notification (priv->shrd, &disable_wait,HZ ); + ret =iwl_wait_notification (&priv->notif_wait, + &disable_wait,HZ );if (ret)IWL_ERR (priv,"Timed out waiting for PAN disable\n" ); }
drivers/net/wireless/iwlwifi/iwl-core.c +1 -1
@@ -845,7 +845,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)/* Cancel currently queued command. */ clear_bit (STATUS_HCMD_ACTIVE , &priv->shrd->status); -iwl_abort_notification_waits (priv->shrd); +iwl_abort_notification_waits (&priv->notif_wait);/* Keep the restart process from trying to send host * commands by clearing the ready bit */
drivers/net/wireless/iwlwifi/iwl-dev.h +3 -0
@@ -51,6 +51,7 @@#include "iwl-trans.h" #include "iwl-shared.h" #include "iwl-op-mode.h" +#include "iwl-notif-wait.h" struct iwl_tx_queue ;
@@ -739,6 +740,8 @@ struct iwl_priv {struct iwl_rx_cmd_buffer *rxb, struct iwl_device_cmd *cmd); +struct iwl_notif_wait_data notif_wait; +struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS ];/* spectrum measurement report caching */
drivers/net/wireless/iwlwifi/iwl-notif-wait.c new file +157 -0
157 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-notif-wait.h new file +130 -0
130 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -55
79 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-testmode.c +5 -5
@@ -418,23 +418,23 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)struct iwl_notification_wait calib_wait;int ret; -iwl_init_notification_wait (priv->shrd, &calib_wait, -CALIBRATION_COMPLETE_NOTIFICATION , -NULL ,NULL ); +iwl_init_notification_wait (&priv->notif_wait, &calib_wait, +CALIBRATION_COMPLETE_NOTIFICATION , +NULL ,NULL ); ret =iwl_init_alive_start (priv);if (ret) {IWL_ERR (priv,"Fail init calibration: %d\n" , ret); goto cfg_init_calib_error; } - ret =iwl_wait_notification (priv->shrd, &calib_wait,2 *HZ ); + ret =iwl_wait_notification (&priv->notif_wait, &calib_wait,2 *HZ );if (ret)IWL_ERR (priv,"Error detecting" " CALIBRATION_COMPLETE_NOTIFICATION: %d\n" , ret);return ret; cfg_init_calib_error: -iwl_remove_notification (priv->shrd, &calib_wait); +iwl_remove_notification (&priv->notif_wait, &calib_wait);return ret; }
drivers/net/wireless/iwlwifi/iwl-ucode.c +9 -72
136 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH RESEND 26/33 iwlwifi: move irq to PCIe
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Even if the variable might also be used by other transports, there's no need for anything outside of the transport itself to access it, so move it into the private area.
--- drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 2 ++ drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 12 ++++++------ drivers/net/wireless/iwlwifi/iwl-trans.h | 2 -- 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +2 -0
@@ -231,6 +231,7 @@ struct iwl_tx_queue {* @rxq: all the RX queue data * @rx_replenish: work that will be called when buffers need to be allocated * @trans: pointer to the generic transport area +* @irq - the irq number for the device * @irq_requested: true when the irq has been requested * @scd_base_addr: scheduler sram base address in SRAM * @scd_bc_tbls: pointer to the byte count table of the scheduler
@@ -262,6 +263,7 @@ struct iwl_trans_pcie {struct tasklet_struct irq_tasklet;struct isr_statistics isr_stats; +unsigned int irq;spinlock_t irq_lock;u32 inta_mask;u32 scd_base_addr;
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +6 -6
@@ -1303,7 +1303,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)spin_unlock_irqrestore (&trans_pcie->irq_lock, flags);/* wait to make sure we flush pending tasklet*/ -synchronize_irq (trans->irq); +synchronize_irq (trans_pcie->irq);tasklet_kill (&trans_pcie->irq_tasklet);cancel_work_sync (&trans_pcie->rx_replenish);
@@ -1522,11 +1522,11 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)iwl_alloc_isr_ict (trans); - err =request_irq (trans->irq, iwl_isr_ict,IRQF_SHARED , + err =request_irq (trans_pcie->irq, iwl_isr_ict,IRQF_SHARED ,DRV_NAME , trans);if (err) {IWL_ERR (trans,"Error allocating IRQ %d\n" , - trans->irq); + trans_pcie->irq); goto error; }
@@ -1549,7 +1549,7 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)return err; err_free_irq: -free_irq (trans->irq, trans); +free_irq (trans_pcie->irq, trans); error:iwl_free_isr_ict (trans);tasklet_kill (&trans_pcie->irq_tasklet);
@@ -1638,7 +1638,7 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans)iwl_trans_pcie_rx_free (trans);#endif if (trans_pcie->irq_requested == true) { -free_irq (trans->irq, trans); +free_irq (trans_pcie->irq, trans);iwl_free_isr_ict (trans); }
@@ -2329,7 +2329,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, "pci_enable_msi failed(0X%x)", err); trans->dev = &pdev->dev; - trans->irq = pdev->irq; + trans_pcie->irq = pdev->irq; trans_pcie->pci_dev = pdev; trans->hw_rev =iwl_read32 (trans,CSR_HW_REV ); trans->hw_id = (pdev->device <<16 ) + pdev->subsystem_device;
drivers/net/wireless/iwlwifi/iwl-trans.h +0 -2
@@ -334,7 +334,6 @@ enum iwl_trans_state {* @shrd - pointer to iwl_shared which holds shared data from the upper layer * @reg_lock - protect hw register access * @dev - pointer to struct device * that represents the device -* @irq - the irq number for the device * @hw_id: a u32 with the ID of the device / subdevice. * Set during transport allocation. * @hw_id_str: a string with info about HW ID. Set during transport allocation.
@@ -349,7 +348,6 @@ struct iwl_trans {spinlock_t reg_lock;struct device *dev; -unsigned int irq;u32 hw_rev;u32 hw_id;char hw_id_str[52 ];
Signature · 1 line
1.7.0.4
PATCH RESEND 27/33 iwlwifi: move packet to transport
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The base packet structure will (hopefully) be the same for all transports, but what is in it differs. Remove the union of all the possible contents and move the packet itself into the transport header file. This requires changing all users of the union to just use pkt->data.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 50 ++++++++------- drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 8 ++- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 4 +- drivers/net/wireless/iwlwifi/iwl-commands.h | 84 ------------------------- drivers/net/wireless/iwlwifi/iwl-notif-wait.h | 3 +- drivers/net/wireless/iwlwifi/iwl-scan.c | 21 +++--- drivers/net/wireless/iwlwifi/iwl-trans.h | 56 ++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-ucode.c | 4 +- 9 files changed, 103 insertions(+), 129 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
@@ -710,7 +710,7 @@ int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif; +struct iwl_bt_coex_profile_notif *coex = (void *)pkt->data;struct iwl_bt_uart_msg *uart_msg = &coex->last_bt_uart_msg;if (priv->bt_enable_flag ==IWLAGN_BT_FLAG_COEX_MODE_DISABLED ) {
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +26 -24
149 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-agn-sta.c +5 -3
@@ -64,6 +64,7 @@ static int iwl_process_add_sta_resp(struct iwl_priv *priv,struct iwl_addsta_cmd *addsta, struct iwl_rx_packet *pkt) { + struct iwl_add_sta_resp *add_sta_resp = (void *)pkt->data;u8 sta_id = addsta->sta.sta_id;int ret = -EIO ;
@@ -78,7 +79,7 @@ static int iwl_process_add_sta_resp(struct iwl_priv *priv,spin_lock (&priv->sta_lock); -switch (pkt->u.add_sta.status) { +switch (add_sta_resp->status) {case ADD_STA_SUCCESS_MSK :IWL_DEBUG_INFO (priv,"REPLY_ADD_STA PASSED\n" ); ret =iwl_sta_ucode_activate (priv, sta_id);
@@ -97,7 +98,7 @@ static int iwl_process_add_sta_resp(struct iwl_priv *priv,break ;default :IWL_DEBUG_ASSOC (priv,"Received REPLY_ADD_STA:(0x%08X)\n" , - pkt->u.add_sta.status); + add_sta_resp->status);break ; }
@@ -460,7 +461,8 @@ static int iwl_send_remove_station(struct iwl_priv *priv, }if (!ret) { -switch (pkt->u.rem_sta.status) { +struct iwl_rem_sta_resp *rem_sta_resp = (void *)pkt->data; +switch (rem_sta_resp->status) {case REM_STA_SUCCESS_MSK :if (!temporary) {spin_lock_bh (&priv->sta_lock);
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +2 -2
@@ -983,7 +983,7 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,u16 sequence =le16_to_cpu (pkt->hdr.sequence);int txq_id =SEQ_TO_QUEUE (sequence);int cmd_index__maybe_unused =SEQ_TO_INDEX (sequence); -struct iwlagn_tx_resp *tx_resp = (void *)&pkt->u.raw[0 ]; +struct iwlagn_tx_resp *tx_resp = (void *)pkt->data;struct ieee80211_hdr *hdr;u32 status =le16_to_cpu (tx_resp->status.status);u16 ssn =iwlagn_get_scd_ssn (tx_resp);
@@ -1111,7 +1111,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_compressed_ba_resp *ba_resp = &pkt->u.compressed_ba; +struct iwl_compressed_ba_resp *ba_resp = (void *)pkt->data;struct iwl_ht_agg *agg;struct sk_buff_head reclaimed_skbs;struct ieee80211_tx_info *info;
drivers/net/wireless/iwlwifi/iwl-commands.h +0 -84
96 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-notif-wait.h +1 -2
@@ -64,8 +64,7 @@#include <linux/wait.h> -/* TODO: remove later */ -#include "iwl-commands.h" +#include "iwl-trans.h" struct iwl_notif_wait_data {struct list_head notif_waits;
drivers/net/wireless/iwlwifi/iwl-scan.c +10 -11
@@ -57,11 +57,11 @@static int iwl_send_scan_abort (struct iwl_priv *priv) {int ret; -struct iwl_rx_packet *pkt;struct iwl_host_cmd cmd = { .id =REPLY_SCAN_ABORT_CMD , .flags =CMD_SYNC |CMD_WANT_SKB , }; +__le32 *status;/* Exit instantly with error when device is not ready * to receive scan abort command or it does not perform
@@ -76,15 +76,16 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)if (ret)return ret; - pkt = cmd.resp_pkt; -if (pkt->u.status !=CAN_ABORT_STATUS ) { + status = (void *)cmd.resp_pkt->data; +if (*status !=CAN_ABORT_STATUS ) {/* The scan abort will return 1 for success or * 2 for "failure". A failure condition can be * due to simply not being in an active scan which * can occur if we send the scan abort before we * the microcode has notified us that a scan is * completed. */ -IWL_DEBUG_SCAN (priv,"SCAN_ABORT ret %d.\n" , pkt->u.status); +IWL_DEBUG_SCAN (priv,"SCAN_ABORT ret %d.\n" , +le32_to_cpu (*status)); ret = -EIO ; }
@@ -265,8 +266,7 @@ static int iwl_rx_reply_scan(struct iwl_priv *priv, {#ifdef CONFIG_IWLWIFI_DEBUG struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_scanreq_notification *notif = - (struct iwl_scanreq_notification *)pkt->u.raw; +struct iwl_scanreq_notification *notif = (void *)pkt->data;IWL_DEBUG_SCAN (priv,"Scan request status = 0x%x\n" , notif->status);#endif
@@ -279,8 +279,8 @@ static int iwl_rx_scan_start_notif(struct iwl_priv *priv, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_scanstart_notification *notif = - (struct iwl_scanstart_notification *)pkt->u.raw; +struct iwl_scanstart_notification *notif = (void *)pkt->data; + priv->scan_start_tsf =le32_to_cpu (notif->tsf_low);IWL_DEBUG_SCAN (priv,"Scan start: " "%d [802.11%s] "
@@ -307,8 +307,7 @@ static int iwl_rx_scan_results_notif(struct iwl_priv *priv, {#ifdef CONFIG_IWLWIFI_DEBUG struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_scanresults_notification *notif = - (struct iwl_scanresults_notification *)pkt->u.raw; +struct iwl_scanresults_notification *notif = (void *)pkt->data;IWL_DEBUG_SCAN (priv,"Scan ch.res: " "%d [802.11%s] "
@@ -332,7 +331,7 @@ static int iwl_rx_scan_complete_notif(struct iwl_priv *priv, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; +struct iwl_scancomplete_notification *scan_notif = (void *)pkt->data; IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", scan_notif->scanned_channels,
drivers/net/wireless/iwlwifi/iwl-trans.h +56 -0
62 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-ucode.c +2 -2
@@ -186,7 +186,7 @@ int iwlagn_rx_calib_result(struct iwl_priv *priv, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_calib_hdr *hdr = (struct iwl_calib_hdr *)pkt->u.raw; +struct iwl_calib_hdr *hdr = (struct iwl_calib_hdr *)pkt->data;int len =le32_to_cpu (pkt->len_n_flags) &FH_RSCSR_FRAME_SIZE_MSK ;/* reduce the size of the length field itself */
@@ -442,7 +442,7 @@ static void iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,struct iwl_alive_data *alive_data = data;struct iwl_alive_resp *palive; - palive = &pkt->u.alive_frame; + palive = (void *)pkt->data; IWL_DEBUG_FW(priv, "Alive ucode status 0x%08X revision " "0x%01X 0x%01X\n",
Signature · 1 line
1.7.0.4
PATCH RESEND 28/33 iwlwifi: virtualize nic_config
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
The nic_config sets uCode dependent register
bits, so it must be virtual in the op_mode.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 8 ++++++++ drivers/net/wireless/iwlwifi/iwl-core.c | 5 ----- drivers/net/wireless/iwlwifi/iwl-op-mode.h | 9 +++++++++ drivers/net/wireless/iwlwifi/iwl-shared.h | 1 - drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +8 -0
@@ -1422,6 +1422,13 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode) } } +static void iwl_nic_config (struct iwl_op_mode *op_mode) +{ +struct iwl_priv *priv =IWL_OP_MODE_GET_DVM (op_mode); + +cfg (priv)->lib->nic_config (priv); +} +const struct iwl_op_mode_ops iwl_dvm_ops = { .start = iwl_op_mode_dvm_start, .stop = iwl_op_mode_dvm_stop,
@@ -1432,6 +1439,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { .free_skb = iwl_free_skb, .nic_error = iwl_nic_error, .cmd_queue_full = iwl_cmd_queue_full, + .nic_config = iwl_nic_config, };/*****************************************************************************
drivers/net/wireless/iwlwifi/iwl-core.c +0 -5
@@ -1479,11 +1479,6 @@ void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)wiphy_rfkill_set_hw_state (priv->hw->wiphy, state); } -void iwl_nic_config (struct iwl_priv *priv) -{ -cfg (priv)->lib->nic_config (priv); -} -void iwl_free_skb (struct iwl_op_mode *op_mode,struct sk_buff *skb) {struct iwl_priv *priv =IWL_OP_MODE_GET_DVM (op_mode);
drivers/net/wireless/iwlwifi/iwl-op-mode.h +9 -0
@@ -123,6 +123,8 @@ struct iwl_fw;* Must be atomic * @nic_error: error notification. Must be atomic * @cmd_queue_full: Called when the command queue gets full. Must be atomic. +* @nic_config: configure NIC, called before firmware is started. +* May sleep */ struct iwl_op_mode_ops { struct iwl_op_mode *(*start)(struct iwl_trans *trans,
@@ -136,6 +138,7 @@ struct iwl_op_mode_ops {void (*free_skb)(struct iwl_op_mode *op_mode,struct sk_buff *skb);void (*nic_error)(struct iwl_op_mode *op_mode);void (*cmd_queue_full)(struct iwl_op_mode *op_mode); +void (*nic_config)(struct iwl_op_mode *op_mode); };/**
@@ -199,6 +202,12 @@ static inline void iwl_op_mode_cmd_queue_full(struct iwl_op_mode *op_mode) op_mode->ops->cmd_queue_full (op_mode); } +static inline void iwl_op_mode_nic_config (struct iwl_op_mode *op_mode) +{ +might_sleep (); + op_mode->ops->nic_config (op_mode); +} +/***************************************************** * Op mode layers implementations ******************************************************/
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -1
@@ -416,7 +416,6 @@ enum iwl_rxon_context_id { };int iwlagn_hw_valid_rtc_data_addr (u32 addr); -void iwl_nic_config (struct iwl_priv *priv);const char *get_cmd_string (u8 cmd);#define IWL_CMD (x) case x: return #x
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +1 -1
@@ -823,7 +823,7 @@ static int iwl_nic_init(struct iwl_trans *trans)iwl_set_pwr_vmain (trans); -iwl_nic_config (priv (trans)); +iwl_op_mode_nic_config (trans->op_mode);#ifndef CONFIG_IWLWIFI_IDI /* Allocate the RX queue, or reset if it is already allocated */
Signature · 1 line
1.7.0.4
PATCH RESEND 29/33 iwlwifi: remove priv from shared
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Finally nothing needs to access priv
from shared any more, so remove it.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 1 - drivers/net/wireless/iwlwifi/iwl-shared.h | 2 -- 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -1
@@ -1205,7 +1205,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, op_mode->ops = &iwl_dvm_ops; priv =IWL_OP_MODE_GET_DVM (op_mode); priv->shrd = trans->shrd; - priv->shrd->priv = priv; priv->fw = fw;/* TODO: remove fw from shared data later */ priv->shrd->fw = fw;
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -2
@@ -376,7 +376,6 @@ struct iwl_shared {u8 valid_contexts;const struct iwl_cfg *cfg; -struct iwl_priv *priv;struct iwl_trans *trans;void *drv;struct iwl_hw_params hw_params;
@@ -398,7 +397,6 @@ struct iwl_shared { };/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */ -#define priv (_m) ((_m)->shrd->priv)#define cfg (_m) ((_m)->shrd->cfg)#define trans (_m) ((_m)->shrd->trans)#define hw_params (_m) ((_m)->shrd->hw_params)
Signature · 1 line
1.7.0.4
PATCH RESEND 30/33 iwlwifi: remove PA type configuration
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
No need to have a special config variable
for the PA type, we can just use the
additional NIC config function to config
the hardware correctly.
--- drivers/net/wireless/iwlwifi/iwl-6000.c | 17 +++++++++-------- drivers/net/wireless/iwlwifi/iwl-shared.h | 12 ------------ 2 files changed, 9 insertions(+), 20 deletions(-)
drivers/net/wireless/iwlwifi/iwl-6000.c +9 -8
@@ -96,20 +96,21 @@ static void iwl6150_additional_nic_config(struct iwl_priv *priv) CSR_GP_DRIVER_REG_BIT_6050_1x2); } +static void iwl6000i_additional_nic_config (struct iwl_priv *priv) +{ +/* 2x2 IPA phy type */ +iwl_write32 (trans (priv),CSR_GP_DRIVER_REG , + CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA); +} +/* NIC configuration for 6000 series */ static void iwl6000_nic_config (struct iwl_priv *priv) {iwl_rf_config (priv); -/* no locking required for register write */ -if (cfg (priv)->pa_type ==IWL_PA_INTERNAL ) { -/* 2x2 IPA phy type */ -iwl_write32 (trans (priv),CSR_GP_DRIVER_REG , - CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA); - }/* do additional nic configuration if needed */ if (cfg (priv)->additional_nic_config) -cfg (priv)->additional_nic_config (priv); +cfg (priv)->additional_nic_config (priv); }static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
@@ -471,8 +472,8 @@ const struct iwl_cfg iwl130_bg_cfg = { .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \ .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ .lib = &iwl6000_lib, \ + .additional_nic_config = iwl6000i_additional_nic_config,\ .base_params = &iwl6000_base_params, \ - .pa_type = IWL_PA_INTERNAL, \ .led_mode = IWL_LED_BLINKconst struct iwl_cfg iwl6000i_2agn_cfg = {
drivers/net/wireless/iwlwifi/iwl-shared.h +0 -12
@@ -209,16 +209,6 @@ enum iwl_ucode_type { IWL_UCODE_WOWLAN, }; -/** -* enum iwl_pa_type - Power Amplifier type -* @IWL_PA_SYSTEM: based on uCode configuration -* @IWL_PA_INTERNAL: use Internal only -*/ -enum iwl_pa_type { -IWL_PA_SYSTEM =0 , -IWL_PA_INTERNAL =1 , -}; -/* * LED mode * IWL_LED_DEFAULT: use device default
@@ -299,7 +289,6 @@ struct iwl_base_params {* @base_params: pointer to basic parameters * @ht_params: point to ht patameters * @bt_params: pointer to bt parameters -* @pa_type: used by 6000 series only to identify the type of Power Amplifier * @need_temp_offset_calib: need to perform temperature offset calibration * @no_xtal_calib: some devices do not need crystal calibration data, * don't send it to those
@@ -339,7 +328,6 @@ struct iwl_cfg {/* params likely to change within a device family */ const struct iwl_ht_params *ht_params;const struct iwl_bt_params *bt_params; -enum iwl_pa_type pa_type;/* if used set to IWL_PA_SYSTEM */ const bool need_temp_offset_calib;/* if used set to true */ const bool no_xtal_calib;u8 scan_rx_antennas[IEEE80211_NUM_BANDS ];
Signature · 1 line
1.7.0.4
PATCH RESEND 31/33 iwlwifi: don't include iwl-prph.h everywhere
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
It's only needed in a few places.
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 1 + drivers/net/wireless/iwlwifi/iwl-5000.c | 1 + drivers/net/wireless/iwlwifi/iwl-dev.h | 2 -- drivers/net/wireless/iwlwifi/iwl-eeprom.c | 1 + drivers/net/wireless/iwlwifi/iwl-testmode.c | 1 + 5 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +1 -0
@@ -43,6 +43,7 @@#include "iwl-agn-hw.h" #include "iwl-shared.h" #include "iwl-cfg.h" +#include "iwl-prph.h" /* Highest firmware API version supported */ #define IWL1000_UCODE_API_MAX 6
drivers/net/wireless/iwlwifi/iwl-5000.c +1 -0
@@ -45,6 +45,7 @@#include "iwl-trans.h" #include "iwl-shared.h" #include "iwl-cfg.h" +#include "iwl-prph.h" /* Highest firmware API version supported */ #define IWL5000_UCODE_API_MAX 5
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -2
@@ -37,11 +37,9 @@#include <linux/leds.h> #include <linux/slab.h> #include <linux/mutex.h> -#include <net/ieee80211_radiotap.h> #include "iwl-eeprom.h" #include "iwl-csr.h" -#include "iwl-prph.h" #include "iwl-debug.h" #include "iwl-agn-hw.h" #include "iwl-led.h"
drivers/net/wireless/iwlwifi/iwl-eeprom.c +1 -0
@@ -75,6 +75,7 @@#include "iwl-agn.h" #include "iwl-eeprom.h" #include "iwl-io.h" +#include "iwl-prph.h" /************************** EEPROM BANDS **************************** *
drivers/net/wireless/iwlwifi/iwl-testmode.c +1 -0
@@ -78,6 +78,7 @@#include "iwl-testmode.h" #include "iwl-trans.h" #include "iwl-fh.h" +#include "iwl-prph.h" /* Periphery registers absolute lower bound. This is used in order to
Signature · 1 line
1.7.0.4
PATCH RESEND 32/33 iwlwifi: clean up iwl-commands.h
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Do some cleanups here:
* remove an unused prototype
* remove some unused constants
* clean up includes
--- drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 2 +- drivers/net/wireless/iwlwifi/iwl-commands.h | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-sta.c +1 -1
@@ -26,7 +26,7 @@* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * *****************************************************************************/ - +#include <linux/etherdevice.h> #include <net/mac80211.h> #include "iwl-dev.h"
drivers/net/wireless/iwlwifi/iwl-commands.h +1 -9
@@ -69,15 +69,9 @@#ifndef __iwl_commands_h__#define __iwl_commands_h__ -#include <linux/etherdevice.h> #include <linux/ieee80211.h> +#include <linux/types.h> -struct iwl_priv ; - -/* Tx rates */ -#define IWL_CCK_RATES 4 -#define IWL_OFDM_RATES 8 -#define IWL_MAX_RATES (IWL_CCK_RATES + IWL_OFDM_RATES)enum { REPLY_ALIVE = 0x1,
@@ -3851,8 +3845,6 @@ struct iwlagn_wowlan_kek_kck_material_cmd {__le64 replay_ctr; } __packed; -int iwl_agn_check_rxon_cmd (struct iwl_priv *priv); -/* * REPLY_WIPAN_PARAMS = 0xb2 (Commands and Notification) */
Signature · 1 line
1.7.0.4
PATCH RESEND 33/33 iwlwifi: make iwl_fill_probe_req static
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
This function is only used in iwl-scan.c, so
if we move it up a little in the file it can
be made static.
--- drivers/net/wireless/iwlwifi/iwl-core.h | 2 - drivers/net/wireless/iwlwifi/iwl-scan.c | 98 +++++++++++++++--------------- 2 files changed, 49 insertions(+), 51 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +0 -2
@@ -202,8 +202,6 @@ void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms);void iwl_force_scan_end (struct iwl_priv *priv);void iwl_internal_short_hw_scan (struct iwl_priv *priv);int iwl_force_reset (struct iwl_priv *priv,int mode,bool external); -u16 iwl_fill_probe_req (struct iwl_priv *priv,struct ieee80211_mgmt *frame, -const u8 *ta,const u8 *ie,int ie_len,int left);void iwl_setup_rx_scan_handlers (struct iwl_priv *priv);void iwl_setup_scan_deferred_work (struct iwl_priv *priv);void iwl_cancel_scan_deferred_work (struct iwl_priv *priv);
drivers/net/wireless/iwlwifi/iwl-scan.c +49 -49
122 lines not on this page · raw message
Signature · 1 line
1.7.0.4