iwlwifi driver 08/04 updates
Subsystems (2)
cover iwlwifi driver 08/04 updates
Hi John,
Here is another series of iwlwifi driver update. Note, the patch 10/10 fixes a merge problem for wireless-testing GIT with upstream.
Thanks,
-yi
[PATCH 01/10] iwlwifi: HW bug fixes
[PATCH 02/10] iwlwifi: memory allocation optimization
[PATCH 03/10] iwlwifi: kill struct iwl4965_lq_mngr
[PATCH 04/10] iwlwifi: implement iwl5000_calc_rssi
[PATCH 05/10] iwlwifi: fix unhandled interrupt when HW rfkill is on [PATCH 06/10] iwlwifi: cleanup iwl_tx_skb
[PATCH 07/10] iwlwifi: add level for debugging host command [PATCH 08/10] iwlwifi: decrement rx skb counter in scan abort handler [PATCH 09/10] iwlwifi: grap nic access before accessing periphery registers [PATCH 10/10] iwl3945: fix merge mistake for packet injection
PATCH 1/10 iwlwifi: HW bug fixes
From: Tomas Winkler <[email protected]>
This patch adds few HW bug fixes.
--- drivers/net/wireless/iwlwifi/iwl-5000.c | 15 +++++++++++++++ drivers/net/wireless/iwlwifi/iwl-csr.h | 10 +++++++++- drivers/net/wireless/iwlwifi/iwl-prph.h | 12 +++++++----- net/mac80211/mlme.c | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-)
drivers/net/wireless/iwlwifi/iwl-5000.c +15 -0
@@ -93,6 +93,13 @@ static int iwl5000_apm_init(struct iwl_priv *priv)iwl_set_bit (priv,CSR_GIO_CHICKEN_BITS ,CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX ); +/* Set FH wait treshold to maximum (HW error during stress W/A) */ +iwl_set_bit (priv,CSR_DBG_HPET_MEM_REG ,CSR_DBG_HPET_MEM_REG_VAL ); + +/* enable HAP INTA to move device L1a -> L0s */ +iwl_set_bit (priv,CSR_HW_IF_CONFIG_REG , +CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A ); +iwl_set_bit (priv,CSR_ANA_PLL_CFG ,CSR50_ANA_PLL_CFG_VAL );/* set "initialization complete" bit to move adapter
@@ -230,6 +237,14 @@ static void iwl5000_nic_config(struct iwl_priv *priv)CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); +/* W/A : NIC is stuck in a reset state after Early PCIe power off +* (PCIe power is lost before PERST# is asserted), +* causing ME FW to lose ownership and not being able to obtain it back. +*/ +iwl_set_bits_mask_prph (priv,APMG_PS_CTRL_REG , +APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS , + ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS ); +spin_unlock_irqrestore (&priv->lock, flags); }
drivers/net/wireless/iwlwifi/iwl-csr.h +9 -1
@@ -104,6 +104,7 @@* 3-2: 0 = A, 1 = B, 2 = C, 3 = D step */ #define CSR_HW_REV_WA_REG (CSR_BASE+0x22C) +#define CSR_DBG_HPET_MEM_REG (CSR_BASE+0x240)/* Bits for CSR_HW_IF_CONFIG_REG */ #define CSR49_HW_IF_CONFIG_REG_BIT_4965_R (0x00000010)
@@ -118,7 +119,12 @@#define CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)#define CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000) -#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) +#define CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A (0x00080000) +#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) +#define CSR_HW_IF_CONFIG_REG_BIT_PCI_OWN_SEM (0x00400000) +#define CSR_HW_IF_CONFIG_REG_BIT_ME_OWN (0x02000000) +#define CSR_HW_IF_CONFIG_REG_BIT_WAKE_ME (0x08000000) +/* interrupt flags in INTA, set by uCode or hardware (e.g. dma), * acknowledged (reset) by host writing "1" to flagged bits. */
@@ -236,6 +242,8 @@#define CSR39_ANA_PLL_CFG_VAL (0x01000000)#define CSR50_ANA_PLL_CFG_VAL (0x00880300) +/* HPET MEM debug */ +#define CSR_DBG_HPET_MEM_REG_VAL (0xFFFF0000)/*=== HBUS (Host-side Bus) ===*/ #define HBUS_BASE (0x400)/*
drivers/net/wireless/iwlwifi/iwl-prph.h +7 -5
@@ -84,14 +84,16 @@#define APMG_CLK_VAL_DMA_CLK_RQT (0x00000200)#define APMG_CLK_VAL_BSM_CLK_RQT (0x00000800) -#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) -#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) +#define APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS (0x00400000) +#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) +#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) +#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) +#define APMG_PS_CTRL_VAL_PWR_SRC_MAX (0x01000000)/* 3945 only */ +#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x02000000) -#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) -#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) -#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x01000000) +#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800)/** * BSM (Bootstrap State Machine)
net/mac80211/mlme.c +1 -1
@@ -3920,7 +3920,7 @@ done:if (sdata->vif.type ==IEEE80211_IF_TYPE_IBSS ) {struct ieee80211_if_sta *ifsta = &sdata->u.sta;if (!(ifsta->flags &IEEE80211_STA_BSSID_SET ) || - (!ifsta->state ==IEEE80211_IBSS_JOINED && + (!(ifsta->state ==IEEE80211_IBSS_JOINED ) && !ieee80211_sta_active_ibss (dev)))ieee80211_sta_find_ibss (dev, ifsta); }
Signature · 1 line
1.5.3.6
PATCH 2/10 iwlwifi: memory allocation optimization
From: Gregory Greenman <[email protected]>
This patch optimizes memory allocation. The cmd member of iwl_tx_queue was allocated previously as a continuous block of memory. This patch allocates separate memory chunks for each command and maps/unmaps these chunks in the run time.
--- drivers/net/wireless/iwlwifi/iwl-5000.c | 6 +- drivers/net/wireless/iwlwifi/iwl-dev.h | 3 +- drivers/net/wireless/iwlwifi/iwl-hcmd.c | 2 +- drivers/net/wireless/iwlwifi/iwl-tx.c | 76 ++++++++++++++++++++++--------- 4 files changed, 59 insertions(+), 28 deletions(-)
drivers/net/wireless/iwlwifi/iwl-5000.c +3 -3
@@ -939,8 +939,8 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, len = byte_cnt +IWL_TX_CRC_SIZE +IWL_TX_DELIMITER_SIZE ;if (txq_id !=IWL_CMD_QUEUE_NUM ) { - sta = txq->cmd[txq->q.write_ptr].cmd.tx.sta_id; - sec_ctl = txq->cmd[txq->q.write_ptr].cmd.tx.sec_ctl; + sta = txq->cmd[txq->q.write_ptr]->cmd.tx.sta_id; + sec_ctl = txq->cmd[txq->q.write_ptr]->cmd.tx.sec_ctl;switch (sec_ctl &TX_CMD_SEC_MSK ) {case TX_CMD_SEC_CCM :
@@ -979,7 +979,7 @@ static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,u8 sta =0 ;if (txq_id !=IWL_CMD_QUEUE_NUM ) - sta = txq->cmd[txq->q.read_ptr].cmd.tx.sta_id; + sta = txq->cmd[txq->q.read_ptr]->cmd.tx.sta_id; shared_data->queues_byte_cnt_tbls[txq_id].tfd_offset[txq->q.read_ptr]. val =cpu_to_le16 (1 | (sta <<12 ));
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -2
@@ -135,8 +135,7 @@ struct iwl_tx_info {struct iwl_tx_queue {struct iwl_queue q;struct iwl_tfd_frame *bd; -struct iwl_cmd *cmd; -dma_addr_t dma_addr_cmd; +struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS ];struct iwl_tx_info *txb;int need_update;int sched_retry;
drivers/net/wireless/iwlwifi/iwl-hcmd.c +1 -1
@@ -228,7 +228,7 @@ cancel:* TX cmd queue. Otherwise in case the cmd comes * in later, it will possibly set an invalid * address (cmd->meta.source). */ - qcmd = &priv->txq[IWL_CMD_QUEUE_NUM ].cmd[cmd_idx]; + qcmd = priv->txq[IWL_CMD_QUEUE_NUM ].cmd[cmd_idx]; qcmd->meta.flags &= ~CMD_WANT_SKB ; } fail:
drivers/net/wireless/iwlwifi/iwl-tx.c +54 -22
161 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 3/10 iwlwifi: kill struct iwl4965_lq_mngr
From: Tomas Winkler <[email protected]>
This patch removes struct iwl4965_lq_mngr it is not used.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 1 - drivers/net/wireless/iwlwifi/iwl-dev.h | 15 --------------- 2 files changed, 0 insertions(+), 16 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +0 -1
@@ -877,7 +877,6 @@ int iwl_init_drv(struct iwl_priv *priv)spin_lock_init (&priv->power_data.lock);spin_lock_init (&priv->sta_lock);spin_lock_init (&priv->hcmd_lock); -spin_lock_init (&priv->lq_mngr.lock);INIT_LIST_HEAD (&priv->free_frames);
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -15
@@ -672,18 +672,6 @@ struct iwl_kw {#define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000 -struct iwl4965_lq_mngr { -spinlock_t lock; -s32 max_window_size; -s32 *expected_tpt; -u8 *next_higher_rate; -u8 *next_lower_rate; -unsigned long stamp; -unsigned long stamp_last; -u32 flush_time; -u32 tx_packets; -}; -/* Sensitivity and chain noise calibration */ #define INTERFERENCE_DATA_AVAILABLE __constant_cpu_to_le32(1)#define INITIALIZATION_VALUE 0xFFFF
@@ -939,9 +927,6 @@ struct iwl_priv {u8 last_phy_res[100 ];/* Rate scaling data */ -struct iwl4965_lq_mngr lq_mngr; - -/* Rate scaling data */ s8 data_retry_limit;u8 retry_rate;
Signature · 1 line
1.5.3.6
PATCH 4/10 iwlwifi: implement iwl5000_calc_rssi
From: Tomas Winkler <[email protected]>
This patch implements rssi calculation for 5000 HW.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 35 ++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-5000.c | 39 ++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-commands.h | 35 +++++++++++++---- drivers/net/wireless/iwlwifi/iwl-core.h | 2 + drivers/net/wireless/iwlwifi/iwl-rx.c | 57 +++++++-------------------- 5 files changed, 118 insertions(+), 50 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +35 -0
@@ -2258,6 +2258,40 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,IWL_ERROR ("TODO: Implement Tx ABORT REQUIRED!!!\n" ); } +static int iwl4965_calc_rssi (struct iwl_priv *priv, +struct iwl_rx_phy_res *rx_resp) +{ +/* data from PHY/DSP regarding signal strength, etc., +* contents are always there, not configurable by host. */ +struct iwl4965_rx_non_cfg_phy *ncphy = + (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy_buf; +u32 agc = (le16_to_cpu (ncphy->agc_info) &IWL49_AGC_DB_MASK ) + >>IWL49_AGC_DB_POS ; + +u32 valid_antennae = + (le16_to_cpu (rx_resp->phy_flags) &IWL49_RX_PHY_FLAGS_ANTENNAE_MASK ) + >>IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET ; +u8 max_rssi =0 ; +u32 i; + +/* Find max rssi among 3 possible receivers. +* These values are measured by the digital signal processor (DSP). +* They should stay fairly constant even as the signal strength varies, +* if the radio's automatic gain control (AGC) is working right. +* AGC value (see below) will provide the "interesting" info. */ +for (i =0 ; i <3 ; i++) +if (valid_antennae & (1 << i)) + max_rssi =max (ncphy->rssi_info[i <<1 ], max_rssi); + +IWL_DEBUG_STATS ("Rssi In A %d B %d C %d Max %d AGC dB %d\n" , + ncphy->rssi_info[0 ], ncphy->rssi_info[2 ], ncphy->rssi_info[4 ], + max_rssi, agc); + +/* dBm = max_rssi dB - agc dB - constant. +* Higher AGC (higher radio gain) means lower signal. */ +return max_rssi - agc -IWL_RSSI_OFFSET ; +} +/* Set up 4965-specific Rx frame reply handlers */ static void iwl4965_rx_handler_setup (struct iwl_priv *priv)
@@ -2289,6 +2323,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { .chain_noise_reset = iwl4965_chain_noise_reset, .gain_computation = iwl4965_gain_computation, .rts_tx_cmd_flag = iwl4965_rts_tx_cmd_flag, + .calc_rssi = iwl4965_calc_rssi, };static struct iwl_lib_ops iwl4965_lib = {
drivers/net/wireless/iwlwifi/iwl-5000.c +39 -0
@@ -1459,6 +1459,44 @@ static void iwl5000_temperature(struct iwl_priv *priv) priv->temperature =le32_to_cpu (priv->statistics.general.temperature); } +/* Calc max signal level (dBm) among 3 possible receivers */ +static int iwl5000_calc_rssi (struct iwl_priv *priv, +struct iwl_rx_phy_res *rx_resp) +{ +/* data from PHY/DSP regarding signal strength, etc., +* contents are always there, not configurable by host +*/ +struct iwl5000_non_cfg_phy *ncphy = + (struct iwl5000_non_cfg_phy *)rx_resp->non_cfg_phy_buf; +u32 val, rssi_a, rssi_b, rssi_c, max_rssi; +u8 agc; + + val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_AGC_IDX ]); + agc = (val &IWL50_OFDM_AGC_MSK ) >>IWL50_OFDM_AGC_BIT_POS ; + +/* Find max rssi among 3 possible receivers. +* These values are measured by the digital signal processor (DSP). +* They should stay fairly constant even as the signal strength varies, +* if the radio's automatic gain control (AGC) is working right. +* AGC value (see below) will provide the "interesting" info. +*/ + val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_AB_IDX ]); + rssi_a = (val &IWL50_OFDM_RSSI_A_MSK ) >>IWL50_OFDM_RSSI_A_BIT_POS ; + rssi_b = (val &IWL50_OFDM_RSSI_B_MSK ) >>IWL50_OFDM_RSSI_B_BIT_POS ; + val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_C_IDX ]); + rssi_c = (val &IWL50_OFDM_RSSI_C_MSK ) >>IWL50_OFDM_RSSI_C_BIT_POS ; + + max_rssi =max_t (u32, rssi_a, rssi_b); + max_rssi =max_t (u32, max_rssi, rssi_c); + +IWL_DEBUG_STATS ("Rssi In A %d B %d C %d Max %d AGC dB %d\n" , + rssi_a, rssi_b, rssi_c, max_rssi, agc); + +/* dBm = max_rssi dB - agc dB - constant. +* Higher AGC (higher radio gain) means lower signal. */ +return max_rssi - agc -IWL_RSSI_OFFSET ; +} +static struct iwl_hcmd_ops iwl5000_hcmd = { .rxon_assoc = iwl5000_send_rxon_assoc, };
@@ -1469,6 +1507,7 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { .gain_computation = iwl5000_gain_computation, .chain_noise_reset = iwl5000_chain_noise_reset, .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag, + .calc_rssi = iwl5000_calc_rssi, };static struct iwl_lib_ops iwl5000_lib = {
drivers/net/wireless/iwlwifi/iwl-commands.h +27 -8
@@ -1075,10 +1075,12 @@ struct iwl4965_rx_frame { } __attribute__ ((packed));/* Fixed (non-configurable) rx data from phy */ -#define RX_PHY_FLAGS_ANTENNAE_OFFSET (4) -#define RX_PHY_FLAGS_ANTENNAE_MASK (0x70) -#define IWL_AGC_DB_MASK (0x3f80)/* MASK(7,13) */ -#define IWL_AGC_DB_POS (7) + +#define IWL49_RX_RES_PHY_CNT 14 +#define IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET (4) +#define IWL49_RX_PHY_FLAGS_ANTENNAE_MASK (0x70) +#define IWL49_AGC_DB_MASK (0x3f80)/* MASK(7,13) */ +#define IWL49_AGC_DB_POS (7)struct iwl4965_rx_non_cfg_phy {__le16 ant_selection;/* ant A bit 4, ant B bit 5, ant C bit 6 */ __le16 agc_info;/* agc code 0:6, agc dB 7:13, reserved 14:15 */
@@ -1086,12 +1088,30 @@ struct iwl4965_rx_non_cfg_phy {u8 pad[0 ]; } __attribute__ ((packed)); + +#define IWL50_RX_RES_PHY_CNT 8 +#define IWL50_RX_RES_AGC_IDX 1 +#define IWL50_RX_RES_RSSI_AB_IDX 2 +#define IWL50_RX_RES_RSSI_C_IDX 3 +#define IWL50_OFDM_AGC_MSK 0xfe00 +#define IWL50_OFDM_AGC_BIT_POS 9 +#define IWL50_OFDM_RSSI_A_MSK 0x00ff +#define IWL50_OFDM_RSSI_A_BIT_POS 0 +#define IWL50_OFDM_RSSI_B_MSK 0xff0000 +#define IWL50_OFDM_RSSI_B_BIT_POS 16 +#define IWL50_OFDM_RSSI_C_MSK 0x00ff +#define IWL50_OFDM_RSSI_C_BIT_POS 0 + +struct iwl5000_non_cfg_phy { +__le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT ];/* upto 8 phy entries */ +} __attribute__ ((packed)); + +/* * REPLY_RX = 0xc3 (response only, not a command) * Used only for legacy (non 11n) frames. */ -#define RX_RES_PHY_CNT 14 -struct iwl4965_rx_phy_res { +struct iwl_rx_phy_res {u8 non_cfg_phy_cnt;/* non configurable DSP phy data byte count */ u8 cfg_phy_cnt;/* configurable DSP phy data byte count */ u8 stat_id;/* configurable DSP phy data set ID */
@@ -1100,8 +1120,7 @@ struct iwl4965_rx_phy_res {__le32 beacon_time_stamp;/* beacon at on-air rise */ __le16 phy_flags;/* general phy flags: band, modulation, ... */ __le16 channel;/* channel number */ -__le16 non_cfg_phy[RX_RES_PHY_CNT ];/* upto 14 phy entries */ -__le32 reserved2; +u8 non_cfg_phy_buf[32 ];/* for various implementations of non_cfg_phy */ __le32 rate_n_flags;/* RATE_MCS_* */ __le16 byte_count;/* frame's byte-count */ __le16 reserved3;
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -95,6 +95,8 @@ struct iwl_hcmd_utils_ops {void (*chain_noise_reset)(struct iwl_priv *priv);void (*rts_tx_cmd_flag)(struct ieee80211_tx_info *info,__le32 *tx_flags); +int (*calc_rssi)(struct iwl_priv *priv, +struct iwl_rx_phy_res *rx_resp); };struct iwl_lib_ops {
drivers/net/wireless/iwlwifi/iwl-rx.c +15 -42
107 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 5/10 iwlwifi: fix unhandled interrupt when HW rfkill is on
From: Tomas Winkler <[email protected]>
This patch fixes unhandled interrupt when HW rfkill is on during devices start up. The behavior changes, now open is successful even when rfkill is on. This is to align with the situation when rfkill is set on after opening.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +8 -10
@@ -2232,17 +2232,16 @@ static int __iwl4965_up(struct iwl_priv *priv) }/* If platform's RF_KILL switch is NOT set to KILL */ -if (iwl_read32 (priv,CSR_GP_CNTRL ) & -CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ) +if (iwl_read32 (priv,CSR_GP_CNTRL ) &CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW )clear_bit (STATUS_RF_KILL_HW , &priv->status);else set_bit (STATUS_RF_KILL_HW , &priv->status); -if (!test_bit (STATUS_IN_SUSPEND , &priv->status) && -iwl_is_rfkill (priv)) { +if (iwl_is_rfkill (priv)) { +iwl4965_enable_interrupts (priv);IWL_WARNING ("Radio disabled by %s RF Kill switch\n" ,test_bit (STATUS_RF_KILL_HW , &priv->status) ?"HW" :"SW" ); -return -ENODEV ; +return 0 ; }iwl_write32 (priv,CSR_INT ,0xFFFFFFFF );
@@ -2278,11 +2277,6 @@ static int __iwl4965_up(struct iwl_priv *priv)memcpy (priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr, priv->ucode_data.len); -/* We return success when we resume from suspend and rf_kill is on. */ -if (test_bit (STATUS_RF_KILL_HW , &priv->status) || -test_bit (STATUS_RF_KILL_SW , &priv->status)) -return 0 ; -for (i =0 ; i <MAX_HW_RESTARTS ; i++) {iwl_clear_stations_table (priv);
@@ -2651,6 +2645,9 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw)if (ret) goto out_release_irq; +if (iwl_is_rfkill (priv)) + goto out; +IWL_DEBUG_INFO ("Start UP work done.\n" );if (test_bit (STATUS_IN_SUSPEND , &priv->status))
@@ -2670,6 +2667,7 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) } } +out: priv->is_open =1 ;IWL_DEBUG_MAC80211 ("leave\n" );return 0 ;
Signature · 1 line
1.5.3.6
PATCH 6/10 iwlwifi: cleanup iwl_tx_skb
From: Tomas Winkler <[email protected]>
This patch cleans up iwl_tx_skb function.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 4 +- drivers/net/wireless/iwlwifi/iwl-debug.h | 3 +- drivers/net/wireless/iwlwifi/iwl-tx.c | 40 +++++++++++++---------------- 3 files changed, 22 insertions(+), 25 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +2 -2
@@ -2719,7 +2719,7 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) {struct iwl_priv *priv = hw->priv; -IWL_DEBUG_MAC80211 ("enter\n" ); +IWL_DEBUG_MACDUMP ("enter\n" );if (priv->iw_mode ==IEEE80211_IF_TYPE_MNTR ) {IWL_DEBUG_MAC80211 ("leave - monitor\n" );
@@ -2733,7 +2733,7 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)if (iwl_tx_skb (priv, skb))dev_kfree_skb_any (skb); -IWL_DEBUG_MAC80211 ("leave\n" ); +IWL_DEBUG_MACDUMP ("leave\n" );return 0 ; }
drivers/net/wireless/iwlwifi/iwl-debug.h +2 -1
@@ -114,7 +114,7 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)#define IWL_DL_MAC80211 (1 << 1)#define IWL_DL_HOST_COMMAND (1 << 2)#define IWL_DL_STATE (1 << 3) - +#define IWL_DL_MACDUMP (1 << 4)#define IWL_DL_RADIO (1 << 7)#define IWL_DL_POWER (1 << 8)#define IWL_DL_TEMP (1 << 9)
@@ -154,6 +154,7 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv) #define IWL_DEBUG_INFO(f, a...) IWL_DEBUG(IWL_DL_INFO, f, ## a) #define IWL_DEBUG_MAC80211(f, a...) IWL_DEBUG(IWL_DL_MAC80211, f, ## a) +#define IWL_DEBUG_MACDUMP(f, a...) IWL_DEBUG(IWL_DL_MACDUMP, f, ## a) #define IWL_DEBUG_TEMP(f, a...) IWL_DEBUG(IWL_DL_TEMP, f, ## a) #define IWL_DEBUG_SCAN(f, a...) IWL_DEBUG(IWL_DL_SCAN, f, ## a) #define IWL_DEBUG_RX(f, a...) IWL_DEBUG(IWL_DL_RX, f, ## a)
drivers/net/wireless/iwlwifi/iwl-tx.c +18 -22
@@ -764,20 +764,19 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);struct iwl_tfd_frame *tfd; -u32 *control_flags; -int txq_id =skb_get_queue_mapping (skb); -struct iwl_tx_queue *txq =NULL ; -struct iwl_queue *q =NULL ; +struct iwl_tx_queue *txq; +struct iwl_queue *q; +struct iwl_cmd *out_cmd; +struct iwl_tx_cmd *tx_cmd; +int swq_id, txq_id;dma_addr_t phys_addr;dma_addr_t txcmd_phys;dma_addr_t scratch_phys; -struct iwl_cmd *out_cmd =NULL ; -struct iwl_tx_cmd *tx_cmd;u16 len, idx, len_org;u16 seq_number =0 ; -u8 id, hdr_len, unicast; -u8 sta_id;__le16 fc; +u8 hdr_len, unicast; +u8 sta_id;u8 wait_write_ptr =0 ;u8 tid =0 ;u8 *qc =NULL ;
@@ -802,7 +801,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) } unicast = !is_multicast_ether_addr (hdr->addr1); - id =0 ; fc = hdr->frame_control;
@@ -840,14 +838,16 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)IWL_DEBUG_TX ("station Id %d\n" , sta_id); + swq_id =skb_get_queue_mapping (skb); + txq_id = swq_id;if (ieee80211_is_data_qos (fc)) { qc =ieee80211_get_qos_ctl (hdr); tid = qc[0 ] &0xf ; - seq_number = priv->stations[sta_id].tid[tid].seq_number & -IEEE80211_SCTL_SEQ ; - hdr->seq_ctrl =cpu_to_le16 (seq_number) | - (hdr->seq_ctrl & -__constant_cpu_to_le16 (IEEE80211_SCTL_FRAG )); + seq_number = priv->stations[sta_id].tid[tid].seq_number; + seq_number &=IEEE80211_SCTL_SEQ ; + hdr->seq_ctrl = hdr->seq_ctrl & +__constant_cpu_to_le16 (IEEE80211_SCTL_FRAG ); + hdr->seq_ctrl |=cpu_to_le16 (seq_number); seq_number +=0x10 ;/* aggregation is on for this <sta,tid> */ if (info->flags &IEEE80211_TX_CTL_AMPDU )
@@ -864,7 +864,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)/* Set up first empty TFD within this queue's circular TFD buffer */ tfd = &txq->bd[q->write_ptr];memset (tfd,0 ,sizeof (*tfd)); - control_flags = (u32 *) tfd; idx =get_cmd_index (q, q->write_ptr,0 );/* Set up driver data for this TFD */
@@ -983,8 +982,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)iwl_txq_update_write_ptr (priv, txq);spin_unlock_irqrestore (&priv->lock, flags); }else { -ieee80211_stop_queue (priv->hw, -skb_get_queue_mapping (skb)); +ieee80211_stop_queue (priv->hw, swq_id); } }
@@ -1013,13 +1011,12 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM ];struct iwl_queue *q = &txq->q;struct iwl_tfd_frame *tfd; -u32 *control_flags;struct iwl_cmd *out_cmd; -u32 idx; -u16 fix_size;dma_addr_t phys_addr; -int len, ret;unsigned long flags; +int len, ret; +u32 idx; +u16 fix_size; cmd->len = priv->cfg->ops->utils->get_hcmd_size (cmd->id, cmd->len); fix_size = (u16)(cmd->len +sizeof (out_cmd->hdr));
@@ -1045,7 +1042,6 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) tfd = &txq->bd[q->write_ptr];memset (tfd,0 ,sizeof (*tfd)); - control_flags = (u32 *) tfd; idx =get_cmd_index (q, q->write_ptr, cmd->meta.flags &CMD_SIZE_HUGE ); out_cmd = txq->cmd[idx];
Signature · 1 line
1.5.3.6
PATCH 7/10 iwlwifi: add level for debugging host command
From: Esti Kummer <[email protected]>
This patch adds another level for debugging host command. This adds an option to suppress the debug prints for sensitivity and link quality commands.
--- drivers/net/wireless/iwlwifi/iwl-debug.h | 12 +++++++----- drivers/net/wireless/iwlwifi/iwl-hcmd.c | 14 ++++++++++++-- drivers/net/wireless/iwlwifi/iwl-tx.c | 26 ++++++++++++++++++++------ 3 files changed, 39 insertions(+), 13 deletions(-)
drivers/net/wireless/iwlwifi/iwl-debug.h +7 -5
@@ -110,11 +110,12 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)* */ -#define IWL_DL_INFO (1 << 0) -#define IWL_DL_MAC80211 (1 << 1) -#define IWL_DL_HOST_COMMAND (1 << 2) -#define IWL_DL_STATE (1 << 3) +#define IWL_DL_INFO (1 << 0) +#define IWL_DL_MAC80211 (1 << 1) +#define IWL_DL_HCMD (1 << 2) +#define IWL_DL_STATE (1 << 3)#define IWL_DL_MACDUMP (1 << 4) +#define IWL_DL_HCMD_DUMP (1 << 5)#define IWL_DL_RADIO (1 << 7)#define IWL_DL_POWER (1 << 8)#define IWL_DL_TEMP (1 << 9)
@@ -162,7 +163,8 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv) #define IWL_DEBUG_ISR(f, a...) IWL_DEBUG(IWL_DL_ISR, f, ## a) #define IWL_DEBUG_LED(f, a...) IWL_DEBUG(IWL_DL_LED, f, ## a) #define IWL_DEBUG_WEP(f, a...) IWL_DEBUG(IWL_DL_WEP, f, ## a) -#define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HOST_COMMAND, f, ## a) +#define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HCMD, f, ## a) +#define IWL_DEBUG_HC_DUMP(f, a...) IWL_DEBUG(IWL_DL_HCMD_DUMP, f, ## a) #define IWL_DEBUG_CALIB(f, a...) IWL_DEBUG(IWL_DL_CALIB, f, ## a) #define IWL_DEBUG_FW(f, a...) IWL_DEBUG(IWL_DL_FW, f, ## a) #define IWL_DEBUG_RF_KILL(f, a...) IWL_DEBUG(IWL_DL_RF_KILL, f, ## a)
drivers/net/wireless/iwlwifi/iwl-hcmd.c +12 -2
@@ -121,8 +121,18 @@ static int iwl_generic_cmd_callback(struct iwl_priv *priv,return 1 ; } -IWL_DEBUG_HC ("back from %s (0x%08X)\n" , -get_cmd_string (cmd->hdr.cmd), pkt->hdr.flags); +#ifdef CONFIG_IWLWIFI_DEBUG +switch (cmd->hdr.cmd) { +case REPLY_TX_LINK_QUALITY_CMD : +case SENSITIVITY_CMD : +IWL_DEBUG_HC_DUMP ("back from %s (0x%08X)\n" , +get_cmd_string (cmd->hdr.cmd), pkt->hdr.flags); +break ; +default : +IWL_DEBUG_HC ("back from %s (0x%08X)\n" , +get_cmd_string (cmd->hdr.cmd), pkt->hdr.flags); + } +#endif /* Let iwl_tx_complete free the response skb */ return 1 ;
drivers/net/wireless/iwlwifi/iwl-tx.c +20 -6
@@ -1065,12 +1065,26 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) phys_addr += offsetof(struct iwl_cmd , hdr);iwl_hw_txq_attach_buf_to_tfd (priv, tfd, phys_addr, fix_size); -IWL_DEBUG_HC ("Sending command %s (#%x), seq: 0x%04X, " -"%d bytes at %d[%d]:%d\n" , -get_cmd_string (out_cmd->hdr.cmd), - out_cmd->hdr.cmd,le16_to_cpu (out_cmd->hdr.sequence), - fix_size, q->write_ptr, idx,IWL_CMD_QUEUE_NUM ); - +#ifdef CONFIG_IWLWIFI_DEBUG +switch (out_cmd->hdr.cmd) { +case REPLY_TX_LINK_QUALITY_CMD : +case SENSITIVITY_CMD : +IWL_DEBUG_HC_DUMP ("Sending command %s (#%x), seq: 0x%04X, " +"%d bytes at %d[%d]:%d\n" , +get_cmd_string (out_cmd->hdr.cmd), + out_cmd->hdr.cmd, +le16_to_cpu (out_cmd->hdr.sequence), fix_size, + q->write_ptr, idx,IWL_CMD_QUEUE_NUM ); +break ; +default : +IWL_DEBUG_HC ("Sending command %s (#%x), seq: 0x%04X, " +"%d bytes at %d[%d]:%d\n" , +get_cmd_string (out_cmd->hdr.cmd), + out_cmd->hdr.cmd, +le16_to_cpu (out_cmd->hdr.sequence), fix_size, + q->write_ptr, idx,IWL_CMD_QUEUE_NUM ); + } +#endif txq->need_update =1 ;/* Set up entry in queue's byte count circular buffer */
Signature · 1 line
1.5.3.6
PATCH 8/10 iwlwifi: decrement rx skb counter in scan abort handler
From: Emmanuel Grumbach <[email protected]>
This patch decrements rx skb counter in scan abort handler.
--- drivers/net/wireless/iwlwifi/iwl-scan.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-scan.c +1 -0
@@ -202,6 +202,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)clear_bit (STATUS_SCAN_HW , &priv->status); } + priv->alloc_rxb_skb--;dev_kfree_skb_any (cmd.meta.u.skb);return ret;
Signature · 1 line
1.5.3.6
PATCH 9/10 iwlwifi: grap nic access before accessing periphery registers
From: Tomas Winkler <[email protected]>
We need to grap nic access before accessing periphery registers.
--- drivers/net/wireless/iwlwifi/iwl-5000.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-5000.c +3 -1
@@ -241,9 +241,11 @@ static void iwl5000_nic_config(struct iwl_priv *priv)* (PCIe power is lost before PERST# is asserted), * causing ME FW to lose ownership and not being able to obtain it back. */ -iwl_set_bits_mask_prph (priv,APMG_PS_CTRL_REG , +iwl_grab_nic_access (priv); +iwl_set_bits_mask_prph (priv,APMG_PS_CTRL_REG ,APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS , ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS ); +iwl_release_nic_access (priv);spin_unlock_irqrestore (&priv->lock, flags); }
Signature · 1 line
1.5.3.6
PATCH 10/10 iwl3945: fix merge mistake for packet injection
We should allow packets transmission in monitor mode for 3945. The patch fixes a merge error with 2.6.26 kernel.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +0 -6
@@ -6589,12 +6589,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)IWL_DEBUG_MAC80211 ("enter\n" ); -if (priv->iw_mode ==IEEE80211_IF_TYPE_MNTR ) { -IWL_DEBUG_MAC80211 ("leave - monitor\n" ); -dev_kfree_skb_any (skb); -return 0 ; - } -IWL_DEBUG_TX ("dev->xmit(%d bytes) at rate 0x%02x\n" , skb->len,ieee80211_get_tx_rate (hw,IEEE80211_SKB_CB (skb))->bitrate);
Signature · 1 line
1.5.3.6
Re: [PATCH 08/10] iwlwifi: decrement rx skb counter in scan abort handler
In reply to Zhu Yithe exact same code is in iwl3945-base.c, looks to me as if it might require the same fix.
Quoted 23 lines · Zhu Yi
From: Emmanuel Grumbach <[email protected]>
This patch decrements rx skb counter in scan abort handler.
Signed-off-by Emmanuel Grumbach <[email protected]>Signed-off-by Tomas Winkler <[email protected]>Signed-off-by Zhu Yi <[email protected]>--- drivers/net/wireless/iwlwifi/iwl-scan.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/net/wireless/iwlwifi/iwl-scan.c +1
-0@@ -202,6 +202,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)clear_bit (STATUS_SCAN_HW , &priv->status); } + priv->alloc_rxb_skb--;dev_kfree_skb_any (cmd.meta.u.skb);return ret;
Quoted 8 lines · Zhu Yi
Hi John,
Here is another series of iwlwifi driver update. Note, the patch 10/10 fixes a merge problem for wireless-testing GIT with upstream.
Thanks,
-yi
Quoted 10 lines
[PATCH 01/10] iwlwifi: HW bug fixes
[PATCH 02/10] iwlwifi: memory allocation optimization
[PATCH 03/10] iwlwifi: kill structiwl4965_lq_mngr
[PATCH 04/10] iwlwifi: implementiwl5000_calc_rssi
[PATCH 05/10] iwlwifi: fix unhandled interrupt when HW rfkill is on [PATCH 06/10] iwlwifi: cleanupiwl_tx_skb
[PATCH 07/10] iwlwifi: add level for debugging host command [PATCH 08/10] iwlwifi: decrement rx skb counter in scan abort handler [PATCH 09/10] iwlwifi: grap nic access before accessing periphery registers [PATCH 10/10] iwl3945: fix merge mistake for packet injection
Hi John,
I see you merged only partial of this series. What's happen to the patches 03, 06 and 07?
Thanks,
-yi
Quoted 20 lines · Zhu Yi
Quoted 8 lines · Zhu Yi
Hi John,
Here is another series of iwlwifi driver update. Note, the patch 10/10 fixes a merge problem for wireless-testing GIT with upstream.
Thanks,
-yiQuoted 10 lines
[PATCH 01/10] iwlwifi: HW bug fixes
[PATCH 02/10] iwlwifi: memory allocation optimization
[PATCH 03/10] iwlwifi: kill structiwl4965_lq_mngr
[PATCH 04/10] iwlwifi: implementiwl5000_calc_rssi
[PATCH 05/10] iwlwifi: fix unhandled interrupt when HW rfkill is on [PATCH 06/10] iwlwifi: cleanupiwl_tx_skb
[PATCH 07/10] iwlwifi: add level for debugging host command [PATCH 08/10] iwlwifi: decrement rx skb counter in scan abort handler [PATCH 09/10] iwlwifi: grap nic access before accessing periphery registers [PATCH 10/10] iwl3945: fix merge mistake for packet injection
Quoted 4 lines
Hi John,
I see you merged only partial of this series. What's happen to the patches 03, 06 and 07?
I don't see those as fixes, only cleanups. The merge window is closed for 2.6.27. If those are in fact fixes then please explain.
Thanks,
John
Signature · 2 lines
John W. Linville [email protected]
Quoted 21 lines · John W. Linville
Quoted 20 lines · Zhu Yi
Quoted 18 lines · Zhu Yi
Hi John,
Here is another series of iwlwifi driver update. Note, the patch 10/10 fixes a merge problem for wireless-testing GIT with upstream.
Thanks,
-yi[PATCH 01/10] iwlwifi: HW bug fixes
[PATCH 02/10] iwlwifi: memory allocation optimization
[PATCH 03/10] iwlwifi: kill structiwl4965_lq_mngr
[PATCH 04/10] iwlwifi: implementiwl5000_calc_rssi
[PATCH 05/10] iwlwifi: fix unhandled interrupt when HW rfkill is on [PATCH 06/10] iwlwifi: cleanupiwl_tx_skb
[PATCH 07/10] iwlwifi: add level for debugging host command [PATCH 08/10] iwlwifi: decrement rx skb counter in scan abort handler [PATCH 09/10] iwlwifi: grap nic access before accessing periphery registers [PATCH 10/10] iwl3945: fix merge mistake for packet injection
Quoted 7 lines
Quoted 4 lines
Hi John,
I see you merged only partial of this series. What's happen to the patches 03, 06 and 07?
I don't see those as fixes, only cleanups. The merge window is closed for 2.6.27. If those are in fact fixes then please explain.
Fine with me, I just would ask you to include 06 anyway I see we have problem with queues in this code I would like to make fixes on top if it.
Thanks
Tomas
Quoted 5 lines · John W. Linville
Quoted 2 lines
I see you merged only partial of this series. What's happen to the patches 03, 06 and 07?
I don't see those as fixes, only cleanups. The merge window is closed for 2.6.27. If those are in fact fixes then please explain.
I'm not requesting to merge them into 2.6.27. I just want to see them on the wireless-testing master branch so that I can merge back them into my current iwlwifi-2.6 GIT.
Thanks,
-yi
Quoted 10 lines · Zhu Yi
Quoted 5 lines · John W. Linville
Quoted 2 lines
I see you merged only partial of this series. What's happen to the patches 03, 06 and 07?
I don't see those as fixes, only cleanups. The merge window is closed for 2.6.27. If those are in fact fixes then please explain.
I'm not requesting to merge them into 2.6.27. I just want to see them on the wireless-testing master branch so that I can merge back them into my current iwlwifi-2.6 GIT.
I will include them in my next update of wireless-testing.
John
Signature · 2 lines
John W. Linville [email protected]