diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-12-11 16:03:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-11 16:03:03 -0500 |
commit | ecbbec2eb093d2ef205de371af986f0360fca539 (patch) | |
tree | 57ab3b0c684f957aee568230fadb32995e00da6b /drivers/net/wireless | |
parent | 36b07d15a656b657beaf9e6357a341768192fad2 (diff) | |
parent | 25a172655f837bdb032e451f95441bb4acec51bb (diff) |
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
Diffstat (limited to 'drivers/net/wireless')
28 files changed, 358 insertions, 263 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/calib.c b/drivers/net/wireless/iwlwifi/dvm/calib.c index f2dd671d7dc8..de54713b680c 100644 --- a/drivers/net/wireless/iwlwifi/dvm/calib.c +++ b/drivers/net/wireless/iwlwifi/dvm/calib.c | |||
@@ -833,14 +833,14 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig, | |||
833 | * To be safe, simply mask out any chains that we know | 833 | * To be safe, simply mask out any chains that we know |
834 | * are not on the device. | 834 | * are not on the device. |
835 | */ | 835 | */ |
836 | active_chains &= priv->eeprom_data->valid_rx_ant; | 836 | active_chains &= priv->nvm_data->valid_rx_ant; |
837 | 837 | ||
838 | num_tx_chains = 0; | 838 | num_tx_chains = 0; |
839 | for (i = 0; i < NUM_RX_CHAINS; i++) { | 839 | for (i = 0; i < NUM_RX_CHAINS; i++) { |
840 | /* loops on all the bits of | 840 | /* loops on all the bits of |
841 | * priv->hw_setting.valid_tx_ant */ | 841 | * priv->hw_setting.valid_tx_ant */ |
842 | u8 ant_msk = (1 << i); | 842 | u8 ant_msk = (1 << i); |
843 | if (!(priv->eeprom_data->valid_tx_ant & ant_msk)) | 843 | if (!(priv->nvm_data->valid_tx_ant & ant_msk)) |
844 | continue; | 844 | continue; |
845 | 845 | ||
846 | num_tx_chains++; | 846 | num_tx_chains++; |
@@ -854,7 +854,7 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig, | |||
854 | * connect the first valid tx chain | 854 | * connect the first valid tx chain |
855 | */ | 855 | */ |
856 | first_chain = | 856 | first_chain = |
857 | find_first_chain(priv->eeprom_data->valid_tx_ant); | 857 | find_first_chain(priv->nvm_data->valid_tx_ant); |
858 | data->disconn_array[first_chain] = 0; | 858 | data->disconn_array[first_chain] = 0; |
859 | active_chains |= BIT(first_chain); | 859 | active_chains |= BIT(first_chain); |
860 | IWL_DEBUG_CALIB(priv, | 860 | IWL_DEBUG_CALIB(priv, |
@@ -864,13 +864,13 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig, | |||
864 | } | 864 | } |
865 | } | 865 | } |
866 | 866 | ||
867 | if (active_chains != priv->eeprom_data->valid_rx_ant && | 867 | if (active_chains != priv->nvm_data->valid_rx_ant && |
868 | active_chains != priv->chain_noise_data.active_chains) | 868 | active_chains != priv->chain_noise_data.active_chains) |
869 | IWL_DEBUG_CALIB(priv, | 869 | IWL_DEBUG_CALIB(priv, |
870 | "Detected that not all antennas are connected! " | 870 | "Detected that not all antennas are connected! " |
871 | "Connected: %#x, valid: %#x.\n", | 871 | "Connected: %#x, valid: %#x.\n", |
872 | active_chains, | 872 | active_chains, |
873 | priv->eeprom_data->valid_rx_ant); | 873 | priv->nvm_data->valid_rx_ant); |
874 | 874 | ||
875 | /* Save for use within RXON, TX, SCAN commands, etc. */ | 875 | /* Save for use within RXON, TX, SCAN commands, etc. */ |
876 | data->active_chains = active_chains; | 876 | data->active_chains = active_chains; |
@@ -1055,7 +1055,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv) | |||
1055 | priv->cfg->bt_params->advanced_bt_coexist) { | 1055 | priv->cfg->bt_params->advanced_bt_coexist) { |
1056 | /* Disable disconnected antenna algorithm for advanced | 1056 | /* Disable disconnected antenna algorithm for advanced |
1057 | bt coex, assuming valid antennas are connected */ | 1057 | bt coex, assuming valid antennas are connected */ |
1058 | data->active_chains = priv->eeprom_data->valid_rx_ant; | 1058 | data->active_chains = priv->nvm_data->valid_rx_ant; |
1059 | for (i = 0; i < NUM_RX_CHAINS; i++) | 1059 | for (i = 0; i < NUM_RX_CHAINS; i++) |
1060 | if (!(data->active_chains & (1<<i))) | 1060 | if (!(data->active_chains & (1<<i))) |
1061 | data->disconn_array[i] = 1; | 1061 | data->disconn_array[i] = 1; |
@@ -1086,7 +1086,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv) | |||
1086 | 1086 | ||
1087 | iwlagn_gain_computation( | 1087 | iwlagn_gain_computation( |
1088 | priv, average_noise, | 1088 | priv, average_noise, |
1089 | find_first_chain(priv->eeprom_data->valid_rx_ant)); | 1089 | find_first_chain(priv->nvm_data->valid_rx_ant)); |
1090 | 1090 | ||
1091 | /* Some power changes may have been made during the calibration. | 1091 | /* Some power changes may have been made during the calibration. |
1092 | * Update and commit the RXON | 1092 | * Update and commit the RXON |
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c index 769a08bca86f..5b9533eef54d 100644 --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c | |||
@@ -305,7 +305,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, | |||
305 | int pos = 0, ofs = 0, buf_size = 0; | 305 | int pos = 0, ofs = 0, buf_size = 0; |
306 | const u8 *ptr; | 306 | const u8 *ptr; |
307 | char *buf; | 307 | char *buf; |
308 | u16 eeprom_ver; | 308 | u16 nvm_ver; |
309 | size_t eeprom_len = priv->eeprom_blob_size; | 309 | size_t eeprom_len = priv->eeprom_blob_size; |
310 | buf_size = 4 * eeprom_len + 256; | 310 | buf_size = 4 * eeprom_len + 256; |
311 | 311 | ||
@@ -321,9 +321,9 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, | |||
321 | if (!buf) | 321 | if (!buf) |
322 | return -ENOMEM; | 322 | return -ENOMEM; |
323 | 323 | ||
324 | eeprom_ver = priv->eeprom_data->eeprom_version; | 324 | nvm_ver = priv->nvm_data->nvm_version; |
325 | pos += scnprintf(buf + pos, buf_size - pos, | 325 | pos += scnprintf(buf + pos, buf_size - pos, |
326 | "NVM version: 0x%x\n", eeprom_ver); | 326 | "NVM version: 0x%x\n", nvm_ver); |
327 | for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { | 327 | for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { |
328 | pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); | 328 | pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); |
329 | hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, | 329 | hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, |
@@ -1333,17 +1333,17 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, | |||
1333 | if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { | 1333 | if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { |
1334 | pos += scnprintf(buf + pos, bufsz - pos, | 1334 | pos += scnprintf(buf + pos, bufsz - pos, |
1335 | "tx power: (1/2 dB step)\n"); | 1335 | "tx power: (1/2 dB step)\n"); |
1336 | if ((priv->eeprom_data->valid_tx_ant & ANT_A) && | 1336 | if ((priv->nvm_data->valid_tx_ant & ANT_A) && |
1337 | tx->tx_power.ant_a) | 1337 | tx->tx_power.ant_a) |
1338 | pos += scnprintf(buf + pos, bufsz - pos, | 1338 | pos += scnprintf(buf + pos, bufsz - pos, |
1339 | fmt_hex, "antenna A:", | 1339 | fmt_hex, "antenna A:", |
1340 | tx->tx_power.ant_a); | 1340 | tx->tx_power.ant_a); |
1341 | if ((priv->eeprom_data->valid_tx_ant & ANT_B) && | 1341 | if ((priv->nvm_data->valid_tx_ant & ANT_B) && |
1342 | tx->tx_power.ant_b) | 1342 | tx->tx_power.ant_b) |
1343 | pos += scnprintf(buf + pos, bufsz - pos, | 1343 | pos += scnprintf(buf + pos, bufsz - pos, |
1344 | fmt_hex, "antenna B:", | 1344 | fmt_hex, "antenna B:", |
1345 | tx->tx_power.ant_b); | 1345 | tx->tx_power.ant_b); |
1346 | if ((priv->eeprom_data->valid_tx_ant & ANT_C) && | 1346 | if ((priv->nvm_data->valid_tx_ant & ANT_C) && |
1347 | tx->tx_power.ant_c) | 1347 | tx->tx_power.ant_c) |
1348 | pos += scnprintf(buf + pos, bufsz - pos, | 1348 | pos += scnprintf(buf + pos, bufsz - pos, |
1349 | fmt_hex, "antenna C:", | 1349 | fmt_hex, "antenna C:", |
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h index 29c571a56251..2653a891cc7e 100644 --- a/drivers/net/wireless/iwlwifi/dvm/dev.h +++ b/drivers/net/wireless/iwlwifi/dvm/dev.h | |||
@@ -843,7 +843,7 @@ struct iwl_priv { | |||
843 | void *wowlan_sram; | 843 | void *wowlan_sram; |
844 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | 844 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ |
845 | 845 | ||
846 | struct iwl_eeprom_data *eeprom_data; | 846 | struct iwl_nvm_data *nvm_data; |
847 | /* eeprom blob for debugfs/testmode */ | 847 | /* eeprom blob for debugfs/testmode */ |
848 | u8 *eeprom_blob; | 848 | u8 *eeprom_blob; |
849 | size_t eeprom_blob_size; | 849 | size_t eeprom_blob_size; |
diff --git a/drivers/net/wireless/iwlwifi/dvm/devices.c b/drivers/net/wireless/iwlwifi/dvm/devices.c index da5862064195..8c72be3f37c1 100644 --- a/drivers/net/wireless/iwlwifi/dvm/devices.c +++ b/drivers/net/wireless/iwlwifi/dvm/devices.c | |||
@@ -305,8 +305,8 @@ static s32 iwl_temp_calib_to_offset(struct iwl_priv *priv) | |||
305 | { | 305 | { |
306 | u16 temperature, voltage; | 306 | u16 temperature, voltage; |
307 | 307 | ||
308 | temperature = le16_to_cpu(priv->eeprom_data->kelvin_temperature); | 308 | temperature = le16_to_cpu(priv->nvm_data->kelvin_temperature); |
309 | voltage = le16_to_cpu(priv->eeprom_data->kelvin_voltage); | 309 | voltage = le16_to_cpu(priv->nvm_data->kelvin_voltage); |
310 | 310 | ||
311 | /* offset = temp - volt / coeff */ | 311 | /* offset = temp - volt / coeff */ |
312 | return (s32)(temperature - | 312 | return (s32)(temperature - |
@@ -460,13 +460,13 @@ static void iwl6000_nic_config(struct iwl_priv *priv) | |||
460 | break; | 460 | break; |
461 | case IWL_DEVICE_FAMILY_6050: | 461 | case IWL_DEVICE_FAMILY_6050: |
462 | /* Indicate calibration version to uCode. */ | 462 | /* Indicate calibration version to uCode. */ |
463 | if (priv->eeprom_data->calib_version >= 6) | 463 | if (priv->nvm_data->calib_version >= 6) |
464 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, | 464 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, |
465 | CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); | 465 | CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); |
466 | break; | 466 | break; |
467 | case IWL_DEVICE_FAMILY_6150: | 467 | case IWL_DEVICE_FAMILY_6150: |
468 | /* Indicate calibration version to uCode. */ | 468 | /* Indicate calibration version to uCode. */ |
469 | if (priv->eeprom_data->calib_version >= 6) | 469 | if (priv->nvm_data->calib_version >= 6) |
470 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, | 470 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, |
471 | CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); | 471 | CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6); |
472 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, | 472 | iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG, |
diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c index 7e59be4b89b8..6ff46605ad4f 100644 --- a/drivers/net/wireless/iwlwifi/dvm/lib.c +++ b/drivers/net/wireless/iwlwifi/dvm/lib.c | |||
@@ -59,7 +59,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv) | |||
59 | /* half dBm need to multiply */ | 59 | /* half dBm need to multiply */ |
60 | tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); | 60 | tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); |
61 | 61 | ||
62 | if (tx_power_cmd.global_lmt > priv->eeprom_data->max_tx_pwr_half_dbm) { | 62 | if (tx_power_cmd.global_lmt > priv->nvm_data->max_tx_pwr_half_dbm) { |
63 | /* | 63 | /* |
64 | * For the newer devices which using enhanced/extend tx power | 64 | * For the newer devices which using enhanced/extend tx power |
65 | * table in EEPROM, the format is in half dBm. driver need to | 65 | * table in EEPROM, the format is in half dBm. driver need to |
@@ -72,7 +72,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv) | |||
72 | * half-dBm format), lower the tx power based on EEPROM | 72 | * half-dBm format), lower the tx power based on EEPROM |
73 | */ | 73 | */ |
74 | tx_power_cmd.global_lmt = | 74 | tx_power_cmd.global_lmt = |
75 | priv->eeprom_data->max_tx_pwr_half_dbm; | 75 | priv->nvm_data->max_tx_pwr_half_dbm; |
76 | } | 76 | } |
77 | tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED; | 77 | tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED; |
78 | tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO; | 78 | tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO; |
@@ -159,7 +159,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv) | |||
159 | IWL_PAN_SCD_MGMT_MSK | | 159 | IWL_PAN_SCD_MGMT_MSK | |
160 | IWL_PAN_SCD_MULTICAST_MSK; | 160 | IWL_PAN_SCD_MULTICAST_MSK; |
161 | 161 | ||
162 | if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE) | 162 | if (priv->nvm_data->sku_cap_11n_enable) |
163 | flush_cmd.queue_control |= IWL_AGG_TX_QUEUE_MSK; | 163 | flush_cmd.queue_control |= IWL_AGG_TX_QUEUE_MSK; |
164 | 164 | ||
165 | IWL_DEBUG_INFO(priv, "queue control: 0x%x\n", | 165 | IWL_DEBUG_INFO(priv, "queue control: 0x%x\n", |
@@ -825,7 +825,7 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
825 | if (priv->chain_noise_data.active_chains) | 825 | if (priv->chain_noise_data.active_chains) |
826 | active_chains = priv->chain_noise_data.active_chains; | 826 | active_chains = priv->chain_noise_data.active_chains; |
827 | else | 827 | else |
828 | active_chains = priv->eeprom_data->valid_rx_ant; | 828 | active_chains = priv->nvm_data->valid_rx_ant; |
829 | 829 | ||
830 | if (priv->cfg->bt_params && | 830 | if (priv->cfg->bt_params && |
831 | priv->cfg->bt_params->advanced_bt_coexist && | 831 | priv->cfg->bt_params->advanced_bt_coexist && |
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c index fb959b00b208..3163e0f38c25 100644 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c | |||
@@ -164,7 +164,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
164 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; | 164 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; |
165 | */ | 165 | */ |
166 | 166 | ||
167 | if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE) | 167 | if (priv->nvm_data->sku_cap_11n_enable) |
168 | hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | | 168 | hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | |
169 | IEEE80211_HW_SUPPORTS_STATIC_SMPS; | 169 | IEEE80211_HW_SUPPORTS_STATIC_SMPS; |
170 | 170 | ||
@@ -242,12 +242,12 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
242 | 242 | ||
243 | hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; | 243 | hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; |
244 | 244 | ||
245 | if (priv->eeprom_data->bands[IEEE80211_BAND_2GHZ].n_channels) | 245 | if (priv->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels) |
246 | priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = | 246 | priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = |
247 | &priv->eeprom_data->bands[IEEE80211_BAND_2GHZ]; | 247 | &priv->nvm_data->bands[IEEE80211_BAND_2GHZ]; |
248 | if (priv->eeprom_data->bands[IEEE80211_BAND_5GHZ].n_channels) | 248 | if (priv->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels) |
249 | priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = | 249 | priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = |
250 | &priv->eeprom_data->bands[IEEE80211_BAND_5GHZ]; | 250 | &priv->nvm_data->bands[IEEE80211_BAND_5GHZ]; |
251 | 251 | ||
252 | hw->wiphy->hw_version = priv->trans->hw_id; | 252 | hw->wiphy->hw_version = priv->trans->hw_id; |
253 | 253 | ||
@@ -654,7 +654,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, | |||
654 | IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", | 654 | IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", |
655 | sta->addr, tid); | 655 | sta->addr, tid); |
656 | 656 | ||
657 | if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)) | 657 | if (!(priv->nvm_data->sku_cap_11n_enable)) |
658 | return -EACCES; | 658 | return -EACCES; |
659 | 659 | ||
660 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 660 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index e3a07c916812..faa05932efae 100644 --- a/drivers/net/wireless/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/iwlwifi/dvm/main.c | |||
@@ -185,7 +185,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) | |||
185 | rate = info->control.rates[0].idx; | 185 | rate = info->control.rates[0].idx; |
186 | 186 | ||
187 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, | 187 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, |
188 | priv->eeprom_data->valid_tx_ant); | 188 | priv->nvm_data->valid_tx_ant); |
189 | rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); | 189 | rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); |
190 | 190 | ||
191 | /* In mac80211, rates for 5 GHz start at 0 */ | 191 | /* In mac80211, rates for 5 GHz start at 0 */ |
@@ -776,7 +776,7 @@ int iwl_alive_start(struct iwl_priv *priv) | |||
776 | ieee80211_wake_queues(priv->hw); | 776 | ieee80211_wake_queues(priv->hw); |
777 | 777 | ||
778 | /* Configure Tx antenna selection based on H/W config */ | 778 | /* Configure Tx antenna selection based on H/W config */ |
779 | iwlagn_send_tx_ant_config(priv, priv->eeprom_data->valid_tx_ant); | 779 | iwlagn_send_tx_ant_config(priv, priv->nvm_data->valid_tx_ant); |
780 | 780 | ||
781 | if (iwl_is_associated_ctx(ctx) && !priv->wowlan) { | 781 | if (iwl_is_associated_ctx(ctx) && !priv->wowlan) { |
782 | struct iwl_rxon_cmd *active_rxon = | 782 | struct iwl_rxon_cmd *active_rxon = |
@@ -1191,30 +1191,38 @@ static void iwl_option_config(struct iwl_priv *priv) | |||
1191 | 1191 | ||
1192 | static int iwl_eeprom_init_hw_params(struct iwl_priv *priv) | 1192 | static int iwl_eeprom_init_hw_params(struct iwl_priv *priv) |
1193 | { | 1193 | { |
1194 | if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE && | 1194 | struct iwl_nvm_data *data = priv->nvm_data; |
1195 | char *debug_msg; | ||
1196 | |||
1197 | if (data->sku_cap_11n_enable && | ||
1195 | !priv->cfg->ht_params) { | 1198 | !priv->cfg->ht_params) { |
1196 | IWL_ERR(priv, "Invalid 11n configuration\n"); | 1199 | IWL_ERR(priv, "Invalid 11n configuration\n"); |
1197 | return -EINVAL; | 1200 | return -EINVAL; |
1198 | } | 1201 | } |
1199 | 1202 | ||
1200 | if (!priv->eeprom_data->sku) { | 1203 | if (!data->sku_cap_11n_enable && !data->sku_cap_band_24GHz_enable && |
1204 | !data->sku_cap_band_52GHz_enable) { | ||
1201 | IWL_ERR(priv, "Invalid device sku\n"); | 1205 | IWL_ERR(priv, "Invalid device sku\n"); |
1202 | return -EINVAL; | 1206 | return -EINVAL; |
1203 | } | 1207 | } |
1204 | 1208 | ||
1205 | IWL_DEBUG_INFO(priv, "Device SKU: 0x%X\n", priv->eeprom_data->sku); | 1209 | debug_msg = "Device SKU: 24GHz %s %s, 52GHz %s %s, 11.n %s %s\n"; |
1210 | IWL_DEBUG_INFO(priv, debug_msg, | ||
1211 | data->sku_cap_band_24GHz_enable ? "" : "NOT", "enabled", | ||
1212 | data->sku_cap_band_52GHz_enable ? "" : "NOT", "enabled", | ||
1213 | data->sku_cap_11n_enable ? "" : "NOT", "enabled"); | ||
1206 | 1214 | ||
1207 | priv->hw_params.tx_chains_num = | 1215 | priv->hw_params.tx_chains_num = |
1208 | num_of_ant(priv->eeprom_data->valid_tx_ant); | 1216 | num_of_ant(data->valid_tx_ant); |
1209 | if (priv->cfg->rx_with_siso_diversity) | 1217 | if (priv->cfg->rx_with_siso_diversity) |
1210 | priv->hw_params.rx_chains_num = 1; | 1218 | priv->hw_params.rx_chains_num = 1; |
1211 | else | 1219 | else |
1212 | priv->hw_params.rx_chains_num = | 1220 | priv->hw_params.rx_chains_num = |
1213 | num_of_ant(priv->eeprom_data->valid_rx_ant); | 1221 | num_of_ant(data->valid_rx_ant); |
1214 | 1222 | ||
1215 | IWL_DEBUG_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", | 1223 | IWL_DEBUG_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", |
1216 | priv->eeprom_data->valid_tx_ant, | 1224 | data->valid_tx_ant, |
1217 | priv->eeprom_data->valid_rx_ant); | 1225 | data->valid_rx_ant); |
1218 | 1226 | ||
1219 | return 0; | 1227 | return 0; |
1220 | } | 1228 | } |
@@ -1374,24 +1382,24 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, | |||
1374 | /* Reset chip to save power until we load uCode during "up". */ | 1382 | /* Reset chip to save power until we load uCode during "up". */ |
1375 | iwl_trans_stop_hw(priv->trans, false); | 1383 | iwl_trans_stop_hw(priv->trans, false); |
1376 | 1384 | ||
1377 | priv->eeprom_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg, | 1385 | priv->nvm_data = iwl_parse_eeprom_data(priv->trans->dev, priv->cfg, |
1378 | priv->eeprom_blob, | 1386 | priv->eeprom_blob, |
1379 | priv->eeprom_blob_size); | 1387 | priv->eeprom_blob_size); |
1380 | if (!priv->eeprom_data) | 1388 | if (!priv->nvm_data) |
1381 | goto out_free_eeprom_blob; | 1389 | goto out_free_eeprom_blob; |
1382 | 1390 | ||
1383 | if (iwl_eeprom_check_version(priv->eeprom_data, priv->trans)) | 1391 | if (iwl_nvm_check_version(priv->nvm_data, priv->trans)) |
1384 | goto out_free_eeprom; | 1392 | goto out_free_eeprom; |
1385 | 1393 | ||
1386 | if (iwl_eeprom_init_hw_params(priv)) | 1394 | if (iwl_eeprom_init_hw_params(priv)) |
1387 | goto out_free_eeprom; | 1395 | goto out_free_eeprom; |
1388 | 1396 | ||
1389 | /* extract MAC Address */ | 1397 | /* extract MAC Address */ |
1390 | memcpy(priv->addresses[0].addr, priv->eeprom_data->hw_addr, ETH_ALEN); | 1398 | memcpy(priv->addresses[0].addr, priv->nvm_data->hw_addr, ETH_ALEN); |
1391 | IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr); | 1399 | IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr); |
1392 | priv->hw->wiphy->addresses = priv->addresses; | 1400 | priv->hw->wiphy->addresses = priv->addresses; |
1393 | priv->hw->wiphy->n_addresses = 1; | 1401 | priv->hw->wiphy->n_addresses = 1; |
1394 | num_mac = priv->eeprom_data->n_hw_addrs; | 1402 | num_mac = priv->nvm_data->n_hw_addrs; |
1395 | if (num_mac > 1) { | 1403 | if (num_mac > 1) { |
1396 | memcpy(priv->addresses[1].addr, priv->addresses[0].addr, | 1404 | memcpy(priv->addresses[1].addr, priv->addresses[0].addr, |
1397 | ETH_ALEN); | 1405 | ETH_ALEN); |
@@ -1404,7 +1412,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, | |||
1404 | ************************/ | 1412 | ************************/ |
1405 | iwl_set_hw_params(priv); | 1413 | iwl_set_hw_params(priv); |
1406 | 1414 | ||
1407 | if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) { | 1415 | if (!(priv->nvm_data->sku_cap_ipan_enable)) { |
1408 | IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN"); | 1416 | IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN"); |
1409 | ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN; | 1417 | ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN; |
1410 | /* | 1418 | /* |
@@ -1486,7 +1494,7 @@ out_destroy_workqueue: | |||
1486 | out_free_eeprom_blob: | 1494 | out_free_eeprom_blob: |
1487 | kfree(priv->eeprom_blob); | 1495 | kfree(priv->eeprom_blob); |
1488 | out_free_eeprom: | 1496 | out_free_eeprom: |
1489 | iwl_free_eeprom_data(priv->eeprom_data); | 1497 | iwl_free_nvm_data(priv->nvm_data); |
1490 | out_free_hw: | 1498 | out_free_hw: |
1491 | ieee80211_free_hw(priv->hw); | 1499 | ieee80211_free_hw(priv->hw); |
1492 | out: | 1500 | out: |
@@ -1506,7 +1514,7 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode) | |||
1506 | iwl_tt_exit(priv); | 1514 | iwl_tt_exit(priv); |
1507 | 1515 | ||
1508 | kfree(priv->eeprom_blob); | 1516 | kfree(priv->eeprom_blob); |
1509 | iwl_free_eeprom_data(priv->eeprom_data); | 1517 | iwl_free_nvm_data(priv->nvm_data); |
1510 | 1518 | ||
1511 | /*netif_stop_queue(dev); */ | 1519 | /*netif_stop_queue(dev); */ |
1512 | flush_workqueue(priv->workqueue); | 1520 | flush_workqueue(priv->workqueue); |
@@ -1980,7 +1988,6 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode) | |||
1980 | static void iwl_nic_config(struct iwl_op_mode *op_mode) | 1988 | static void iwl_nic_config(struct iwl_op_mode *op_mode) |
1981 | { | 1989 | { |
1982 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | 1990 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); |
1983 | u16 radio_cfg = priv->eeprom_data->radio_cfg; | ||
1984 | 1991 | ||
1985 | /* SKU Control */ | 1992 | /* SKU Control */ |
1986 | iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, | 1993 | iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, |
@@ -1992,13 +1999,13 @@ static void iwl_nic_config(struct iwl_op_mode *op_mode) | |||
1992 | CSR_HW_IF_CONFIG_REG_POS_MAC_DASH)); | 1999 | CSR_HW_IF_CONFIG_REG_POS_MAC_DASH)); |
1993 | 2000 | ||
1994 | /* write radio config values to register */ | 2001 | /* write radio config values to register */ |
1995 | if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX) { | 2002 | if (priv->nvm_data->radio_cfg_type <= EEPROM_RF_CONFIG_TYPE_MAX) { |
1996 | u32 reg_val = | 2003 | u32 reg_val = |
1997 | EEPROM_RF_CFG_TYPE_MSK(radio_cfg) << | 2004 | priv->nvm_data->radio_cfg_type << |
1998 | CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE | | 2005 | CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE | |
1999 | EEPROM_RF_CFG_STEP_MSK(radio_cfg) << | 2006 | priv->nvm_data->radio_cfg_step << |
2000 | CSR_HW_IF_CONFIG_REG_POS_PHY_STEP | | 2007 | CSR_HW_IF_CONFIG_REG_POS_PHY_STEP | |
2001 | EEPROM_RF_CFG_DASH_MSK(radio_cfg) << | 2008 | priv->nvm_data->radio_cfg_dash << |
2002 | CSR_HW_IF_CONFIG_REG_POS_PHY_DASH; | 2009 | CSR_HW_IF_CONFIG_REG_POS_PHY_DASH; |
2003 | 2010 | ||
2004 | iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, | 2011 | iwl_set_bits_mask(priv->trans, CSR_HW_IF_CONFIG_REG, |
@@ -2007,9 +2014,9 @@ static void iwl_nic_config(struct iwl_op_mode *op_mode) | |||
2007 | CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val); | 2014 | CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val); |
2008 | 2015 | ||
2009 | IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n", | 2016 | IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n", |
2010 | EEPROM_RF_CFG_TYPE_MSK(radio_cfg), | 2017 | priv->nvm_data->radio_cfg_type, |
2011 | EEPROM_RF_CFG_STEP_MSK(radio_cfg), | 2018 | priv->nvm_data->radio_cfg_step, |
2012 | EEPROM_RF_CFG_DASH_MSK(radio_cfg)); | 2019 | priv->nvm_data->radio_cfg_dash); |
2013 | } else { | 2020 | } else { |
2014 | WARN_ON(1); | 2021 | WARN_ON(1); |
2015 | } | 2022 | } |
diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c index a82f46c10f5e..f3dd0da60d8a 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rs.c +++ b/drivers/net/wireless/iwlwifi/dvm/rs.c | |||
@@ -820,7 +820,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta, | |||
820 | 820 | ||
821 | if (num_of_ant(tbl->ant_type) > 1) | 821 | if (num_of_ant(tbl->ant_type) > 1) |
822 | tbl->ant_type = | 822 | tbl->ant_type = |
823 | first_antenna(priv->eeprom_data->valid_tx_ant); | 823 | first_antenna(priv->nvm_data->valid_tx_ant); |
824 | 824 | ||
825 | tbl->is_ht40 = 0; | 825 | tbl->is_ht40 = 0; |
826 | tbl->is_SGI = 0; | 826 | tbl->is_SGI = 0; |
@@ -1448,7 +1448,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv, | |||
1448 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1448 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1449 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1449 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1450 | u8 start_action; | 1450 | u8 start_action; |
1451 | u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 1451 | u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; |
1452 | u8 tx_chains_num = priv->hw_params.tx_chains_num; | 1452 | u8 tx_chains_num = priv->hw_params.tx_chains_num; |
1453 | int ret = 0; | 1453 | int ret = 0; |
1454 | u8 update_search_tbl_counter = 0; | 1454 | u8 update_search_tbl_counter = 0; |
@@ -1466,7 +1466,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv, | |||
1466 | case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: | 1466 | case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: |
1467 | /* avoid antenna B and MIMO */ | 1467 | /* avoid antenna B and MIMO */ |
1468 | valid_tx_ant = | 1468 | valid_tx_ant = |
1469 | first_antenna(priv->eeprom_data->valid_tx_ant); | 1469 | first_antenna(priv->nvm_data->valid_tx_ant); |
1470 | if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 && | 1470 | if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 && |
1471 | tbl->action != IWL_LEGACY_SWITCH_SISO) | 1471 | tbl->action != IWL_LEGACY_SWITCH_SISO) |
1472 | tbl->action = IWL_LEGACY_SWITCH_SISO; | 1472 | tbl->action = IWL_LEGACY_SWITCH_SISO; |
@@ -1490,7 +1490,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv, | |||
1490 | else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) | 1490 | else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) |
1491 | tbl->action = IWL_LEGACY_SWITCH_SISO; | 1491 | tbl->action = IWL_LEGACY_SWITCH_SISO; |
1492 | valid_tx_ant = | 1492 | valid_tx_ant = |
1493 | first_antenna(priv->eeprom_data->valid_tx_ant); | 1493 | first_antenna(priv->nvm_data->valid_tx_ant); |
1494 | } | 1494 | } |
1495 | 1495 | ||
1496 | start_action = tbl->action; | 1496 | start_action = tbl->action; |
@@ -1624,7 +1624,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1624 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1624 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1625 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1625 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1626 | u8 start_action; | 1626 | u8 start_action; |
1627 | u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 1627 | u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; |
1628 | u8 tx_chains_num = priv->hw_params.tx_chains_num; | 1628 | u8 tx_chains_num = priv->hw_params.tx_chains_num; |
1629 | u8 update_search_tbl_counter = 0; | 1629 | u8 update_search_tbl_counter = 0; |
1630 | int ret; | 1630 | int ret; |
@@ -1642,7 +1642,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1642 | case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: | 1642 | case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: |
1643 | /* avoid antenna B and MIMO */ | 1643 | /* avoid antenna B and MIMO */ |
1644 | valid_tx_ant = | 1644 | valid_tx_ant = |
1645 | first_antenna(priv->eeprom_data->valid_tx_ant); | 1645 | first_antenna(priv->nvm_data->valid_tx_ant); |
1646 | if (tbl->action != IWL_SISO_SWITCH_ANTENNA1) | 1646 | if (tbl->action != IWL_SISO_SWITCH_ANTENNA1) |
1647 | tbl->action = IWL_SISO_SWITCH_ANTENNA1; | 1647 | tbl->action = IWL_SISO_SWITCH_ANTENNA1; |
1648 | break; | 1648 | break; |
@@ -1660,7 +1660,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1660 | /* configure as 1x1 if bt full concurrency */ | 1660 | /* configure as 1x1 if bt full concurrency */ |
1661 | if (priv->bt_full_concurrent) { | 1661 | if (priv->bt_full_concurrent) { |
1662 | valid_tx_ant = | 1662 | valid_tx_ant = |
1663 | first_antenna(priv->eeprom_data->valid_tx_ant); | 1663 | first_antenna(priv->nvm_data->valid_tx_ant); |
1664 | if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) | 1664 | if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) |
1665 | tbl->action = IWL_SISO_SWITCH_ANTENNA1; | 1665 | tbl->action = IWL_SISO_SWITCH_ANTENNA1; |
1666 | } | 1666 | } |
@@ -1796,7 +1796,7 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv, | |||
1796 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1796 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1797 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1797 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1798 | u8 start_action; | 1798 | u8 start_action; |
1799 | u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 1799 | u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; |
1800 | u8 tx_chains_num = priv->hw_params.tx_chains_num; | 1800 | u8 tx_chains_num = priv->hw_params.tx_chains_num; |
1801 | u8 update_search_tbl_counter = 0; | 1801 | u8 update_search_tbl_counter = 0; |
1802 | int ret; | 1802 | int ret; |
@@ -1966,7 +1966,7 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv, | |||
1966 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1966 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1967 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1967 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1968 | u8 start_action; | 1968 | u8 start_action; |
1969 | u8 valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 1969 | u8 valid_tx_ant = priv->nvm_data->valid_tx_ant; |
1970 | u8 tx_chains_num = priv->hw_params.tx_chains_num; | 1970 | u8 tx_chains_num = priv->hw_params.tx_chains_num; |
1971 | int ret; | 1971 | int ret; |
1972 | u8 update_search_tbl_counter = 0; | 1972 | u8 update_search_tbl_counter = 0; |
@@ -2700,7 +2700,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, | |||
2700 | 2700 | ||
2701 | i = lq_sta->last_txrate_idx; | 2701 | i = lq_sta->last_txrate_idx; |
2702 | 2702 | ||
2703 | valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 2703 | valid_tx_ant = priv->nvm_data->valid_tx_ant; |
2704 | 2704 | ||
2705 | if (!lq_sta->search_better_tbl) | 2705 | if (!lq_sta->search_better_tbl) |
2706 | active_tbl = lq_sta->active_tbl; | 2706 | active_tbl = lq_sta->active_tbl; |
@@ -2894,15 +2894,15 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i | |||
2894 | 2894 | ||
2895 | /* These values will be overridden later */ | 2895 | /* These values will be overridden later */ |
2896 | lq_sta->lq.general_params.single_stream_ant_msk = | 2896 | lq_sta->lq.general_params.single_stream_ant_msk = |
2897 | first_antenna(priv->eeprom_data->valid_tx_ant); | 2897 | first_antenna(priv->nvm_data->valid_tx_ant); |
2898 | lq_sta->lq.general_params.dual_stream_ant_msk = | 2898 | lq_sta->lq.general_params.dual_stream_ant_msk = |
2899 | priv->eeprom_data->valid_tx_ant & | 2899 | priv->nvm_data->valid_tx_ant & |
2900 | ~first_antenna(priv->eeprom_data->valid_tx_ant); | 2900 | ~first_antenna(priv->nvm_data->valid_tx_ant); |
2901 | if (!lq_sta->lq.general_params.dual_stream_ant_msk) { | 2901 | if (!lq_sta->lq.general_params.dual_stream_ant_msk) { |
2902 | lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; | 2902 | lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; |
2903 | } else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) { | 2903 | } else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) { |
2904 | lq_sta->lq.general_params.dual_stream_ant_msk = | 2904 | lq_sta->lq.general_params.dual_stream_ant_msk = |
2905 | priv->eeprom_data->valid_tx_ant; | 2905 | priv->nvm_data->valid_tx_ant; |
2906 | } | 2906 | } |
2907 | 2907 | ||
2908 | /* as default allow aggregation for all tids */ | 2908 | /* as default allow aggregation for all tids */ |
@@ -2948,7 +2948,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, | |||
2948 | if (priv && priv->bt_full_concurrent) { | 2948 | if (priv && priv->bt_full_concurrent) { |
2949 | /* 1x1 only */ | 2949 | /* 1x1 only */ |
2950 | tbl_type.ant_type = | 2950 | tbl_type.ant_type = |
2951 | first_antenna(priv->eeprom_data->valid_tx_ant); | 2951 | first_antenna(priv->nvm_data->valid_tx_ant); |
2952 | } | 2952 | } |
2953 | 2953 | ||
2954 | /* How many times should we repeat the initial rate? */ | 2954 | /* How many times should we repeat the initial rate? */ |
@@ -2980,7 +2980,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, | |||
2980 | if (priv->bt_full_concurrent) | 2980 | if (priv->bt_full_concurrent) |
2981 | valid_tx_ant = ANT_A; | 2981 | valid_tx_ant = ANT_A; |
2982 | else | 2982 | else |
2983 | valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 2983 | valid_tx_ant = priv->nvm_data->valid_tx_ant; |
2984 | } | 2984 | } |
2985 | 2985 | ||
2986 | /* Fill rest of rate table */ | 2986 | /* Fill rest of rate table */ |
@@ -3014,7 +3014,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, | |||
3014 | if (priv && priv->bt_full_concurrent) { | 3014 | if (priv && priv->bt_full_concurrent) { |
3015 | /* 1x1 only */ | 3015 | /* 1x1 only */ |
3016 | tbl_type.ant_type = | 3016 | tbl_type.ant_type = |
3017 | first_antenna(priv->eeprom_data->valid_tx_ant); | 3017 | first_antenna(priv->nvm_data->valid_tx_ant); |
3018 | } | 3018 | } |
3019 | 3019 | ||
3020 | /* Indicate to uCode which entries might be MIMO. | 3020 | /* Indicate to uCode which entries might be MIMO. |
@@ -3101,7 +3101,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | |||
3101 | u8 ant_sel_tx; | 3101 | u8 ant_sel_tx; |
3102 | 3102 | ||
3103 | priv = lq_sta->drv; | 3103 | priv = lq_sta->drv; |
3104 | valid_tx_ant = priv->eeprom_data->valid_tx_ant; | 3104 | valid_tx_ant = priv->nvm_data->valid_tx_ant; |
3105 | if (lq_sta->dbg_fixed_rate) { | 3105 | if (lq_sta->dbg_fixed_rate) { |
3106 | ant_sel_tx = | 3106 | ant_sel_tx = |
3107 | ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) | 3107 | ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) |
@@ -3172,9 +3172,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | |||
3172 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", | 3172 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", |
3173 | lq_sta->dbg_fixed_rate); | 3173 | lq_sta->dbg_fixed_rate); |
3174 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", | 3174 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", |
3175 | (priv->eeprom_data->valid_tx_ant & ANT_A) ? "ANT_A," : "", | 3175 | (priv->nvm_data->valid_tx_ant & ANT_A) ? "ANT_A," : "", |
3176 | (priv->eeprom_data->valid_tx_ant & ANT_B) ? "ANT_B," : "", | 3176 | (priv->nvm_data->valid_tx_ant & ANT_B) ? "ANT_B," : "", |
3177 | (priv->eeprom_data->valid_tx_ant & ANT_C) ? "ANT_C" : ""); | 3177 | (priv->nvm_data->valid_tx_ant & ANT_C) ? "ANT_C" : ""); |
3178 | desc += sprintf(buff+desc, "lq type %s\n", | 3178 | desc += sprintf(buff+desc, "lq type %s\n", |
3179 | (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); | 3179 | (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); |
3180 | if (is_Ht(tbl->lq_type)) { | 3180 | if (is_Ht(tbl->lq_type)) { |
diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c index 2830ea290502..9a891e6e60e8 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rxon.c +++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c | |||
@@ -420,10 +420,10 @@ static int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) | |||
420 | return -EINVAL; | 420 | return -EINVAL; |
421 | } | 421 | } |
422 | 422 | ||
423 | if (tx_power > DIV_ROUND_UP(priv->eeprom_data->max_tx_pwr_half_dbm, 2)) { | 423 | if (tx_power > DIV_ROUND_UP(priv->nvm_data->max_tx_pwr_half_dbm, 2)) { |
424 | IWL_WARN(priv, | 424 | IWL_WARN(priv, |
425 | "Requested user TXPOWER %d above upper limit %d.\n", | 425 | "Requested user TXPOWER %d above upper limit %d.\n", |
426 | tx_power, priv->eeprom_data->max_tx_pwr_half_dbm); | 426 | tx_power, priv->nvm_data->max_tx_pwr_half_dbm); |
427 | return -EINVAL; | 427 | return -EINVAL; |
428 | } | 428 | } |
429 | 429 | ||
diff --git a/drivers/net/wireless/iwlwifi/dvm/scan.c b/drivers/net/wireless/iwlwifi/dvm/scan.c index bb9f6252d28f..610ed2204e1f 100644 --- a/drivers/net/wireless/iwlwifi/dvm/scan.c +++ b/drivers/net/wireless/iwlwifi/dvm/scan.c | |||
@@ -660,12 +660,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
660 | u16 rx_chain = 0; | 660 | u16 rx_chain = 0; |
661 | enum ieee80211_band band; | 661 | enum ieee80211_band band; |
662 | u8 n_probes = 0; | 662 | u8 n_probes = 0; |
663 | u8 rx_ant = priv->eeprom_data->valid_rx_ant; | 663 | u8 rx_ant = priv->nvm_data->valid_rx_ant; |
664 | u8 rate; | 664 | u8 rate; |
665 | bool is_active = false; | 665 | bool is_active = false; |
666 | int chan_mod; | 666 | int chan_mod; |
667 | u8 active_chains; | 667 | u8 active_chains; |
668 | u8 scan_tx_antennas = priv->eeprom_data->valid_tx_ant; | 668 | u8 scan_tx_antennas = priv->nvm_data->valid_tx_ant; |
669 | int ret; | 669 | int ret; |
670 | int scan_cmd_size = sizeof(struct iwl_scan_cmd) + | 670 | int scan_cmd_size = sizeof(struct iwl_scan_cmd) + |
671 | MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + | 671 | MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + |
@@ -673,8 +673,9 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
673 | const u8 *ssid = NULL; | 673 | const u8 *ssid = NULL; |
674 | u8 ssid_len = 0; | 674 | u8 ssid_len = 0; |
675 | 675 | ||
676 | if (WARN_ON_ONCE(priv->scan_request && | 676 | if (WARN_ON(priv->scan_type == IWL_SCAN_NORMAL && |
677 | priv->scan_request->n_channels > MAX_SCAN_CHANNEL)) | 677 | (!priv->scan_request || |
678 | priv->scan_request->n_channels > MAX_SCAN_CHANNEL))) | ||
678 | return -EINVAL; | 679 | return -EINVAL; |
679 | 680 | ||
680 | lockdep_assert_held(&priv->mutex); | 681 | lockdep_assert_held(&priv->mutex); |
@@ -881,7 +882,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
881 | 882 | ||
882 | /* MIMO is not used here, but value is required */ | 883 | /* MIMO is not used here, but value is required */ |
883 | rx_chain |= | 884 | rx_chain |= |
884 | priv->eeprom_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS; | 885 | priv->nvm_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS; |
885 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS; | 886 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS; |
886 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; | 887 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; |
887 | rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; | 888 | rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; |
@@ -998,7 +999,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
998 | 999 | ||
999 | void iwl_init_scan_params(struct iwl_priv *priv) | 1000 | void iwl_init_scan_params(struct iwl_priv *priv) |
1000 | { | 1001 | { |
1001 | u8 ant_idx = fls(priv->eeprom_data->valid_tx_ant) - 1; | 1002 | u8 ant_idx = fls(priv->nvm_data->valid_tx_ant) - 1; |
1002 | if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ]) | 1003 | if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ]) |
1003 | priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; | 1004 | priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; |
1004 | if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ]) | 1005 | if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ]) |
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c index cd9b6de4273e..bdba9543c351 100644 --- a/drivers/net/wireless/iwlwifi/dvm/sta.c +++ b/drivers/net/wireless/iwlwifi/dvm/sta.c | |||
@@ -634,23 +634,23 @@ static void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
634 | if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) | 634 | if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) |
635 | rate_flags |= RATE_MCS_CCK_MSK; | 635 | rate_flags |= RATE_MCS_CCK_MSK; |
636 | 636 | ||
637 | rate_flags |= first_antenna(priv->eeprom_data->valid_tx_ant) << | 637 | rate_flags |= first_antenna(priv->nvm_data->valid_tx_ant) << |
638 | RATE_MCS_ANT_POS; | 638 | RATE_MCS_ANT_POS; |
639 | rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); | 639 | rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); |
640 | for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) | 640 | for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) |
641 | link_cmd->rs_table[i].rate_n_flags = rate_n_flags; | 641 | link_cmd->rs_table[i].rate_n_flags = rate_n_flags; |
642 | 642 | ||
643 | link_cmd->general_params.single_stream_ant_msk = | 643 | link_cmd->general_params.single_stream_ant_msk = |
644 | first_antenna(priv->eeprom_data->valid_tx_ant); | 644 | first_antenna(priv->nvm_data->valid_tx_ant); |
645 | 645 | ||
646 | link_cmd->general_params.dual_stream_ant_msk = | 646 | link_cmd->general_params.dual_stream_ant_msk = |
647 | priv->eeprom_data->valid_tx_ant & | 647 | priv->nvm_data->valid_tx_ant & |
648 | ~first_antenna(priv->eeprom_data->valid_tx_ant); | 648 | ~first_antenna(priv->nvm_data->valid_tx_ant); |
649 | if (!link_cmd->general_params.dual_stream_ant_msk) { | 649 | if (!link_cmd->general_params.dual_stream_ant_msk) { |
650 | link_cmd->general_params.dual_stream_ant_msk = ANT_AB; | 650 | link_cmd->general_params.dual_stream_ant_msk = ANT_AB; |
651 | } else if (num_of_ant(priv->eeprom_data->valid_tx_ant) == 2) { | 651 | } else if (num_of_ant(priv->nvm_data->valid_tx_ant) == 2) { |
652 | link_cmd->general_params.dual_stream_ant_msk = | 652 | link_cmd->general_params.dual_stream_ant_msk = |
653 | priv->eeprom_data->valid_tx_ant; | 653 | priv->nvm_data->valid_tx_ant; |
654 | } | 654 | } |
655 | 655 | ||
656 | link_cmd->agg_params.agg_dis_start_th = | 656 | link_cmd->agg_params.agg_dis_start_th = |
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c index 4ae031f6726b..da21328ca8ed 100644 --- a/drivers/net/wireless/iwlwifi/dvm/tx.c +++ b/drivers/net/wireless/iwlwifi/dvm/tx.c | |||
@@ -188,7 +188,7 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, | |||
188 | if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS || | 188 | if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS || |
189 | (rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY)) | 189 | (rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY)) |
190 | rate_idx = rate_lowest_index( | 190 | rate_idx = rate_lowest_index( |
191 | &priv->eeprom_data->bands[info->band], sta); | 191 | &priv->nvm_data->bands[info->band], sta); |
192 | /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ | 192 | /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ |
193 | if (info->band == IEEE80211_BAND_5GHZ) | 193 | if (info->band == IEEE80211_BAND_5GHZ) |
194 | rate_idx += IWL_FIRST_OFDM_RATE; | 194 | rate_idx += IWL_FIRST_OFDM_RATE; |
@@ -207,11 +207,11 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, | |||
207 | priv->bt_full_concurrent) { | 207 | priv->bt_full_concurrent) { |
208 | /* operated as 1x1 in full concurrency mode */ | 208 | /* operated as 1x1 in full concurrency mode */ |
209 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, | 209 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, |
210 | first_antenna(priv->eeprom_data->valid_tx_ant)); | 210 | first_antenna(priv->nvm_data->valid_tx_ant)); |
211 | } else | 211 | } else |
212 | priv->mgmt_tx_ant = iwl_toggle_tx_ant( | 212 | priv->mgmt_tx_ant = iwl_toggle_tx_ant( |
213 | priv, priv->mgmt_tx_ant, | 213 | priv, priv->mgmt_tx_ant, |
214 | priv->eeprom_data->valid_tx_ant); | 214 | priv->nvm_data->valid_tx_ant); |
215 | rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant); | 215 | rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant); |
216 | 216 | ||
217 | /* Set the rate in the TX cmd */ | 217 | /* Set the rate in the TX cmd */ |
@@ -305,7 +305,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
305 | u8 hdr_len; | 305 | u8 hdr_len; |
306 | u16 len, seq_number = 0; | 306 | u16 len, seq_number = 0; |
307 | u8 sta_id, tid = IWL_MAX_TID_COUNT; | 307 | u8 sta_id, tid = IWL_MAX_TID_COUNT; |
308 | bool is_agg = false; | 308 | bool is_agg = false, is_data_qos = false; |
309 | int txq_id; | 309 | int txq_id; |
310 | 310 | ||
311 | if (info->control.vif) | 311 | if (info->control.vif) |
@@ -378,9 +378,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
378 | iwl_sta_modify_sleep_tx_count(priv, sta_id, 1); | 378 | iwl_sta_modify_sleep_tx_count(priv, sta_id, 1); |
379 | } | 379 | } |
380 | 380 | ||
381 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | ||
382 | is_agg = true; | ||
383 | |||
384 | dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans); | 381 | dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans); |
385 | 382 | ||
386 | if (unlikely(!dev_cmd)) | 383 | if (unlikely(!dev_cmd)) |
@@ -442,6 +439,10 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
442 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | 439 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); |
443 | hdr->seq_ctrl |= cpu_to_le16(seq_number); | 440 | hdr->seq_ctrl |= cpu_to_le16(seq_number); |
444 | seq_number += 0x10; | 441 | seq_number += 0x10; |
442 | |||
443 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | ||
444 | is_agg = true; | ||
445 | is_data_qos = true; | ||
445 | } | 446 | } |
446 | 447 | ||
447 | /* Copy MAC header from skb into command buffer */ | 448 | /* Copy MAC header from skb into command buffer */ |
@@ -474,8 +475,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
474 | if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id)) | 475 | if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id)) |
475 | goto drop_unlock_sta; | 476 | goto drop_unlock_sta; |
476 | 477 | ||
477 | if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) && | 478 | if (is_data_qos && !ieee80211_has_morefrags(fc)) |
478 | !ieee80211_has_morefrags(fc)) | ||
479 | priv->tid_data[sta_id][tid].seq_number = seq_number; | 479 | priv->tid_data[sta_id][tid].seq_number = seq_number; |
480 | 480 | ||
481 | spin_unlock(&priv->sta_lock); | 481 | spin_unlock(&priv->sta_lock); |
@@ -1097,29 +1097,6 @@ static void iwl_check_abort_status(struct iwl_priv *priv, | |||
1097 | } | 1097 | } |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | static int iwl_reclaim(struct iwl_priv *priv, int sta_id, int tid, | ||
1101 | int txq_id, int ssn, struct sk_buff_head *skbs) | ||
1102 | { | ||
1103 | if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE && | ||
1104 | tid != IWL_TID_NON_QOS && | ||
1105 | txq_id != priv->tid_data[sta_id][tid].agg.txq_id)) { | ||
1106 | /* | ||
1107 | * FIXME: this is a uCode bug which need to be addressed, | ||
1108 | * log the information and return for now. | ||
1109 | * Since it is can possibly happen very often and in order | ||
1110 | * not to fill the syslog, don't use IWL_ERR or IWL_WARN | ||
1111 | */ | ||
1112 | IWL_DEBUG_TX_QUEUES(priv, | ||
1113 | "Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n", | ||
1114 | txq_id, sta_id, tid, | ||
1115 | priv->tid_data[sta_id][tid].agg.txq_id); | ||
1116 | return 1; | ||
1117 | } | ||
1118 | |||
1119 | iwl_trans_reclaim(priv->trans, txq_id, ssn, skbs); | ||
1120 | return 0; | ||
1121 | } | ||
1122 | |||
1123 | int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | 1100 | int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, |
1124 | struct iwl_device_cmd *cmd) | 1101 | struct iwl_device_cmd *cmd) |
1125 | { | 1102 | { |
@@ -1181,9 +1158,8 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | |||
1181 | next_reclaimed); | 1158 | next_reclaimed); |
1182 | } | 1159 | } |
1183 | 1160 | ||
1184 | /*we can free until ssn % q.n_bd not inclusive */ | 1161 | iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); |
1185 | WARN_ON_ONCE(iwl_reclaim(priv, sta_id, tid, | 1162 | |
1186 | txq_id, ssn, &skbs)); | ||
1187 | iwlagn_check_ratid_empty(priv, sta_id, tid); | 1163 | iwlagn_check_ratid_empty(priv, sta_id, tid); |
1188 | freed = 0; | 1164 | freed = 0; |
1189 | 1165 | ||
@@ -1308,16 +1284,27 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
1308 | return 0; | 1284 | return 0; |
1309 | } | 1285 | } |
1310 | 1286 | ||
1287 | if (unlikely(scd_flow != agg->txq_id)) { | ||
1288 | /* | ||
1289 | * FIXME: this is a uCode bug which need to be addressed, | ||
1290 | * log the information and return for now. | ||
1291 | * Since it is can possibly happen very often and in order | ||
1292 | * not to fill the syslog, don't use IWL_ERR or IWL_WARN | ||
1293 | */ | ||
1294 | IWL_DEBUG_TX_QUEUES(priv, | ||
1295 | "Bad queue mapping txq_id=%d, agg_txq[sta:%d,tid:%d]=%d\n", | ||
1296 | scd_flow, sta_id, tid, agg->txq_id); | ||
1297 | spin_unlock(&priv->sta_lock); | ||
1298 | return 0; | ||
1299 | } | ||
1300 | |||
1311 | __skb_queue_head_init(&reclaimed_skbs); | 1301 | __skb_queue_head_init(&reclaimed_skbs); |
1312 | 1302 | ||
1313 | /* Release all TFDs before the SSN, i.e. all TFDs in front of | 1303 | /* Release all TFDs before the SSN, i.e. all TFDs in front of |
1314 | * block-ack window (we assume that they've been successfully | 1304 | * block-ack window (we assume that they've been successfully |
1315 | * transmitted ... if not, it's too late anyway). */ | 1305 | * transmitted ... if not, it's too late anyway). */ |
1316 | if (iwl_reclaim(priv, sta_id, tid, scd_flow, | 1306 | iwl_trans_reclaim(priv->trans, scd_flow, ba_resp_scd_ssn, |
1317 | ba_resp_scd_ssn, &reclaimed_skbs)) { | 1307 | &reclaimed_skbs); |
1318 | spin_unlock(&priv->sta_lock); | ||
1319 | return 0; | ||
1320 | } | ||
1321 | 1308 | ||
1322 | IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, " | 1309 | IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, " |
1323 | "sta_id = %d\n", | 1310 | "sta_id = %d\n", |
diff --git a/drivers/net/wireless/iwlwifi/dvm/ucode.c b/drivers/net/wireless/iwlwifi/dvm/ucode.c index 95e6d33f5159..c6467e5554f5 100644 --- a/drivers/net/wireless/iwlwifi/dvm/ucode.c +++ b/drivers/net/wireless/iwlwifi/dvm/ucode.c | |||
@@ -61,7 +61,7 @@ iwl_get_ucode_image(struct iwl_priv *priv, enum iwl_ucode_type ucode_type) | |||
61 | static int iwl_set_Xtal_calib(struct iwl_priv *priv) | 61 | static int iwl_set_Xtal_calib(struct iwl_priv *priv) |
62 | { | 62 | { |
63 | struct iwl_calib_xtal_freq_cmd cmd; | 63 | struct iwl_calib_xtal_freq_cmd cmd; |
64 | __le16 *xtal_calib = priv->eeprom_data->xtal_calib; | 64 | __le16 *xtal_calib = priv->nvm_data->xtal_calib; |
65 | 65 | ||
66 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD); | 66 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD); |
67 | cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]); | 67 | cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]); |
@@ -75,7 +75,7 @@ static int iwl_set_temperature_offset_calib(struct iwl_priv *priv) | |||
75 | 75 | ||
76 | memset(&cmd, 0, sizeof(cmd)); | 76 | memset(&cmd, 0, sizeof(cmd)); |
77 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); | 77 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); |
78 | cmd.radio_sensor_offset = priv->eeprom_data->raw_temperature; | 78 | cmd.radio_sensor_offset = priv->nvm_data->raw_temperature; |
79 | if (!(cmd.radio_sensor_offset)) | 79 | if (!(cmd.radio_sensor_offset)) |
80 | cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; | 80 | cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; |
81 | 81 | ||
@@ -90,14 +90,14 @@ static int iwl_set_temperature_offset_calib_v2(struct iwl_priv *priv) | |||
90 | 90 | ||
91 | memset(&cmd, 0, sizeof(cmd)); | 91 | memset(&cmd, 0, sizeof(cmd)); |
92 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); | 92 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); |
93 | cmd.radio_sensor_offset_high = priv->eeprom_data->kelvin_temperature; | 93 | cmd.radio_sensor_offset_high = priv->nvm_data->kelvin_temperature; |
94 | cmd.radio_sensor_offset_low = priv->eeprom_data->raw_temperature; | 94 | cmd.radio_sensor_offset_low = priv->nvm_data->raw_temperature; |
95 | if (!cmd.radio_sensor_offset_low) { | 95 | if (!cmd.radio_sensor_offset_low) { |
96 | IWL_DEBUG_CALIB(priv, "no info in EEPROM, use default\n"); | 96 | IWL_DEBUG_CALIB(priv, "no info in EEPROM, use default\n"); |
97 | cmd.radio_sensor_offset_low = DEFAULT_RADIO_SENSOR_OFFSET; | 97 | cmd.radio_sensor_offset_low = DEFAULT_RADIO_SENSOR_OFFSET; |
98 | cmd.radio_sensor_offset_high = DEFAULT_RADIO_SENSOR_OFFSET; | 98 | cmd.radio_sensor_offset_high = DEFAULT_RADIO_SENSOR_OFFSET; |
99 | } | 99 | } |
100 | cmd.burntVoltageRef = priv->eeprom_data->calib_voltage; | 100 | cmd.burntVoltageRef = priv->nvm_data->calib_voltage; |
101 | 101 | ||
102 | IWL_DEBUG_CALIB(priv, "Radio sensor offset high: %d\n", | 102 | IWL_DEBUG_CALIB(priv, "Radio sensor offset high: %d\n", |
103 | le16_to_cpu(cmd.radio_sensor_offset_high)); | 103 | le16_to_cpu(cmd.radio_sensor_offset_high)); |
@@ -257,7 +257,7 @@ static int iwl_alive_notify(struct iwl_priv *priv) | |||
257 | iwl_trans_fw_alive(priv->trans, 0); | 257 | iwl_trans_fw_alive(priv->trans, 0); |
258 | 258 | ||
259 | if (priv->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN && | 259 | if (priv->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN && |
260 | priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE) { | 260 | priv->nvm_data->sku_cap_ipan_enable) { |
261 | n_queues = ARRAY_SIZE(iwlagn_ipan_queue_to_tx_fifo); | 261 | n_queues = ARRAY_SIZE(iwlagn_ipan_queue_to_tx_fifo); |
262 | queue_to_txf = iwlagn_ipan_queue_to_tx_fifo; | 262 | queue_to_txf = iwlagn_ipan_queue_to_tx_fifo; |
263 | } else { | 263 | } else { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index 196266aa5a9d..864219d2136a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -226,8 +226,8 @@ struct iwl_eeprom_params { | |||
226 | * @max_data_size: The maximal length of the fw data section | 226 | * @max_data_size: The maximal length of the fw data section |
227 | * @valid_tx_ant: valid transmit antenna | 227 | * @valid_tx_ant: valid transmit antenna |
228 | * @valid_rx_ant: valid receive antenna | 228 | * @valid_rx_ant: valid receive antenna |
229 | * @eeprom_ver: EEPROM version | 229 | * @nvm_ver: NVM version |
230 | * @eeprom_calib_ver: EEPROM calibration version | 230 | * @nvm_calib_ver: NVM calibration version |
231 | * @lib: pointer to the lib ops | 231 | * @lib: pointer to the lib ops |
232 | * @base_params: pointer to basic parameters | 232 | * @base_params: pointer to basic parameters |
233 | * @ht_params: point to ht patameters | 233 | * @ht_params: point to ht patameters |
@@ -257,8 +257,8 @@ struct iwl_cfg { | |||
257 | const u32 max_inst_size; | 257 | const u32 max_inst_size; |
258 | u8 valid_tx_ant; | 258 | u8 valid_tx_ant; |
259 | u8 valid_rx_ant; | 259 | u8 valid_rx_ant; |
260 | u16 eeprom_ver; | 260 | u16 nvm_ver; |
261 | u16 eeprom_calib_ver; | 261 | u16 nvm_calib_ver; |
262 | /* params not likely to change within a device family */ | 262 | /* params not likely to change within a device family */ |
263 | const struct iwl_base_params *base_params; | 263 | const struct iwl_base_params *base_params; |
264 | /* params likely to change within a device family */ | 264 | /* params likely to change within a device family */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h index b3fde5f7b9bc..dc7e26b2f383 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h | |||
@@ -133,6 +133,40 @@ TRACE_EVENT(iwlwifi_dev_iowrite32, | |||
133 | __get_str(dev), __entry->offs, __entry->val) | 133 | __get_str(dev), __entry->offs, __entry->val) |
134 | ); | 134 | ); |
135 | 135 | ||
136 | TRACE_EVENT(iwlwifi_dev_iowrite_prph32, | ||
137 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
138 | TP_ARGS(dev, offs, val), | ||
139 | TP_STRUCT__entry( | ||
140 | DEV_ENTRY | ||
141 | __field(u32, offs) | ||
142 | __field(u32, val) | ||
143 | ), | ||
144 | TP_fast_assign( | ||
145 | DEV_ASSIGN; | ||
146 | __entry->offs = offs; | ||
147 | __entry->val = val; | ||
148 | ), | ||
149 | TP_printk("[%s] write PRPH[%#x] = %#x)", | ||
150 | __get_str(dev), __entry->offs, __entry->val) | ||
151 | ); | ||
152 | |||
153 | TRACE_EVENT(iwlwifi_dev_ioread_prph32, | ||
154 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
155 | TP_ARGS(dev, offs, val), | ||
156 | TP_STRUCT__entry( | ||
157 | DEV_ENTRY | ||
158 | __field(u32, offs) | ||
159 | __field(u32, val) | ||
160 | ), | ||
161 | TP_fast_assign( | ||
162 | DEV_ASSIGN; | ||
163 | __entry->offs = offs; | ||
164 | __entry->val = val; | ||
165 | ), | ||
166 | TP_printk("[%s] read PRPH[%#x] = %#x", | ||
167 | __get_str(dev), __entry->offs, __entry->val) | ||
168 | ); | ||
169 | |||
136 | TRACE_EVENT(iwlwifi_dev_irq, | 170 | TRACE_EVENT(iwlwifi_dev_irq, |
137 | TP_PROTO(const struct device *dev), | 171 | TP_PROTO(const struct device *dev), |
138 | TP_ARGS(dev), | 172 | TP_ARGS(dev), |
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 198634b75ed0..d3549f493a17 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c | |||
@@ -1032,6 +1032,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans, | |||
1032 | 1032 | ||
1033 | if (!drv->dbgfs_drv) { | 1033 | if (!drv->dbgfs_drv) { |
1034 | IWL_ERR(drv, "failed to create debugfs directory\n"); | 1034 | IWL_ERR(drv, "failed to create debugfs directory\n"); |
1035 | ret = -ENOMEM; | ||
1035 | goto err_free_drv; | 1036 | goto err_free_drv; |
1036 | } | 1037 | } |
1037 | 1038 | ||
@@ -1040,12 +1041,12 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans, | |||
1040 | 1041 | ||
1041 | if (!drv->trans->dbgfs_dir) { | 1042 | if (!drv->trans->dbgfs_dir) { |
1042 | IWL_ERR(drv, "failed to create transport debugfs directory\n"); | 1043 | IWL_ERR(drv, "failed to create transport debugfs directory\n"); |
1044 | ret = -ENOMEM; | ||
1043 | goto err_free_dbgfs; | 1045 | goto err_free_dbgfs; |
1044 | } | 1046 | } |
1045 | #endif | 1047 | #endif |
1046 | 1048 | ||
1047 | ret = iwl_request_firmware(drv, true); | 1049 | ret = iwl_request_firmware(drv, true); |
1048 | |||
1049 | if (ret) { | 1050 | if (ret) { |
1050 | IWL_ERR(trans, "Couldn't request the fw\n"); | 1051 | IWL_ERR(trans, "Couldn't request the fw\n"); |
1051 | goto err_fw; | 1052 | goto err_fw; |
@@ -1060,9 +1061,8 @@ err_free_dbgfs: | |||
1060 | err_free_drv: | 1061 | err_free_drv: |
1061 | #endif | 1062 | #endif |
1062 | kfree(drv); | 1063 | kfree(drv); |
1063 | drv = NULL; | ||
1064 | 1064 | ||
1065 | return drv; | 1065 | return ERR_PTR(ret); |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | void iwl_drv_stop(struct iwl_drv *drv) | 1068 | void iwl_drv_stop(struct iwl_drv *drv) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c index 4a9dc9629efe..471986690cf0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | |||
@@ -116,6 +116,24 @@ struct iwl_eeprom_calib_hdr { | |||
116 | #define EEPROM_KELVIN_TEMPERATURE ((2*0x12A) | EEPROM_CALIB_ALL) | 116 | #define EEPROM_KELVIN_TEMPERATURE ((2*0x12A) | EEPROM_CALIB_ALL) |
117 | #define EEPROM_RAW_TEMPERATURE ((2*0x12B) | EEPROM_CALIB_ALL) | 117 | #define EEPROM_RAW_TEMPERATURE ((2*0x12B) | EEPROM_CALIB_ALL) |
118 | 118 | ||
119 | /* SKU Capabilities (actual values from EEPROM definition) */ | ||
120 | enum eeprom_sku_bits { | ||
121 | EEPROM_SKU_CAP_BAND_24GHZ = BIT(4), | ||
122 | EEPROM_SKU_CAP_BAND_52GHZ = BIT(5), | ||
123 | EEPROM_SKU_CAP_11N_ENABLE = BIT(6), | ||
124 | EEPROM_SKU_CAP_AMT_ENABLE = BIT(7), | ||
125 | EEPROM_SKU_CAP_IPAN_ENABLE = BIT(8) | ||
126 | }; | ||
127 | |||
128 | /* radio config bits (actual values from EEPROM definition) */ | ||
129 | #define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */ | ||
130 | #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */ | ||
131 | #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */ | ||
132 | #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */ | ||
133 | #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ | ||
134 | #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ | ||
135 | |||
136 | |||
119 | /* | 137 | /* |
120 | * EEPROM bands | 138 | * EEPROM bands |
121 | * These are the channel numbers from each band in the order | 139 | * These are the channel numbers from each band in the order |
@@ -251,7 +269,7 @@ static const u8 *iwl_eeprom_query_addr(const u8 *eeprom, size_t eeprom_size, | |||
251 | } | 269 | } |
252 | 270 | ||
253 | static int iwl_eeprom_read_calib(const u8 *eeprom, size_t eeprom_size, | 271 | static int iwl_eeprom_read_calib(const u8 *eeprom, size_t eeprom_size, |
254 | struct iwl_eeprom_data *data) | 272 | struct iwl_nvm_data *data) |
255 | { | 273 | { |
256 | struct iwl_eeprom_calib_hdr *hdr; | 274 | struct iwl_eeprom_calib_hdr *hdr; |
257 | 275 | ||
@@ -330,7 +348,7 @@ struct iwl_eeprom_enhanced_txpwr { | |||
330 | s8 mimo3_max; | 348 | s8 mimo3_max; |
331 | } __packed; | 349 | } __packed; |
332 | 350 | ||
333 | static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_eeprom_data *data, | 351 | static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_nvm_data *data, |
334 | struct iwl_eeprom_enhanced_txpwr *txp) | 352 | struct iwl_eeprom_enhanced_txpwr *txp) |
335 | { | 353 | { |
336 | s8 result = 0; /* (.5 dBm) */ | 354 | s8 result = 0; /* (.5 dBm) */ |
@@ -364,7 +382,7 @@ static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_eeprom_data *data, | |||
364 | ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "") | 382 | ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "") |
365 | 383 | ||
366 | static void | 384 | static void |
367 | iwl_eeprom_enh_txp_read_element(struct iwl_eeprom_data *data, | 385 | iwl_eeprom_enh_txp_read_element(struct iwl_nvm_data *data, |
368 | struct iwl_eeprom_enhanced_txpwr *txp, | 386 | struct iwl_eeprom_enhanced_txpwr *txp, |
369 | int n_channels, s8 max_txpower_avg) | 387 | int n_channels, s8 max_txpower_avg) |
370 | { | 388 | { |
@@ -392,7 +410,7 @@ iwl_eeprom_enh_txp_read_element(struct iwl_eeprom_data *data, | |||
392 | } | 410 | } |
393 | 411 | ||
394 | static void iwl_eeprom_enhanced_txpower(struct device *dev, | 412 | static void iwl_eeprom_enhanced_txpower(struct device *dev, |
395 | struct iwl_eeprom_data *data, | 413 | struct iwl_nvm_data *data, |
396 | const u8 *eeprom, size_t eeprom_size, | 414 | const u8 *eeprom, size_t eeprom_size, |
397 | int n_channels) | 415 | int n_channels) |
398 | { | 416 | { |
@@ -504,7 +522,7 @@ static void iwl_init_band_reference(const struct iwl_cfg *cfg, | |||
504 | ((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "") | 522 | ((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "") |
505 | 523 | ||
506 | static void iwl_mod_ht40_chan_info(struct device *dev, | 524 | static void iwl_mod_ht40_chan_info(struct device *dev, |
507 | struct iwl_eeprom_data *data, int n_channels, | 525 | struct iwl_nvm_data *data, int n_channels, |
508 | enum ieee80211_band band, u16 channel, | 526 | enum ieee80211_band band, u16 channel, |
509 | const struct iwl_eeprom_channel *eeprom_ch, | 527 | const struct iwl_eeprom_channel *eeprom_ch, |
510 | u8 clear_ht40_extension_channel) | 528 | u8 clear_ht40_extension_channel) |
@@ -547,7 +565,7 @@ static void iwl_mod_ht40_chan_info(struct device *dev, | |||
547 | ((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "") | 565 | ((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "") |
548 | 566 | ||
549 | static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | 567 | static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, |
550 | struct iwl_eeprom_data *data, | 568 | struct iwl_nvm_data *data, |
551 | const u8 *eeprom, size_t eeprom_size) | 569 | const u8 *eeprom, size_t eeprom_size) |
552 | { | 570 | { |
553 | int band, ch_idx; | 571 | int band, ch_idx; |
@@ -685,7 +703,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, | |||
685 | return n_channels; | 703 | return n_channels; |
686 | } | 704 | } |
687 | 705 | ||
688 | static int iwl_init_sband_channels(struct iwl_eeprom_data *data, | 706 | static int iwl_init_sband_channels(struct iwl_nvm_data *data, |
689 | struct ieee80211_supported_band *sband, | 707 | struct ieee80211_supported_band *sband, |
690 | int n_channels, enum ieee80211_band band) | 708 | int n_channels, enum ieee80211_band band) |
691 | { | 709 | { |
@@ -711,7 +729,7 @@ static int iwl_init_sband_channels(struct iwl_eeprom_data *data, | |||
711 | #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ | 729 | #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ |
712 | 730 | ||
713 | static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg, | 731 | static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg, |
714 | struct iwl_eeprom_data *data, | 732 | struct iwl_nvm_data *data, |
715 | struct ieee80211_sta_ht_cap *ht_info, | 733 | struct ieee80211_sta_ht_cap *ht_info, |
716 | enum ieee80211_band band) | 734 | enum ieee80211_band band) |
717 | { | 735 | { |
@@ -725,7 +743,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg, | |||
725 | else | 743 | else |
726 | rx_chains = hweight8(data->valid_rx_ant); | 744 | rx_chains = hweight8(data->valid_rx_ant); |
727 | 745 | ||
728 | if (!(data->sku & EEPROM_SKU_CAP_11N_ENABLE) || !cfg->ht_params) { | 746 | if (!(data->sku_cap_11n_enable) || !cfg->ht_params) { |
729 | ht_info->ht_supported = false; | 747 | ht_info->ht_supported = false; |
730 | return; | 748 | return; |
731 | } | 749 | } |
@@ -773,7 +791,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg, | |||
773 | } | 791 | } |
774 | 792 | ||
775 | static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, | 793 | static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, |
776 | struct iwl_eeprom_data *data, | 794 | struct iwl_nvm_data *data, |
777 | const u8 *eeprom, size_t eeprom_size) | 795 | const u8 *eeprom, size_t eeprom_size) |
778 | { | 796 | { |
779 | int n_channels = iwl_init_channel_map(dev, cfg, data, | 797 | int n_channels = iwl_init_channel_map(dev, cfg, data, |
@@ -804,12 +822,13 @@ static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, | |||
804 | 822 | ||
805 | /* EEPROM data functions */ | 823 | /* EEPROM data functions */ |
806 | 824 | ||
807 | struct iwl_eeprom_data * | 825 | struct iwl_nvm_data * |
808 | iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, | 826 | iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, |
809 | const u8 *eeprom, size_t eeprom_size) | 827 | const u8 *eeprom, size_t eeprom_size) |
810 | { | 828 | { |
811 | struct iwl_eeprom_data *data; | 829 | struct iwl_nvm_data *data; |
812 | const void *tmp; | 830 | const void *tmp; |
831 | u16 radio_cfg, sku; | ||
813 | 832 | ||
814 | if (WARN_ON(!cfg || !cfg->eeprom_params)) | 833 | if (WARN_ON(!cfg || !cfg->eeprom_params)) |
815 | return NULL; | 834 | return NULL; |
@@ -849,18 +868,27 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, | |||
849 | data->kelvin_temperature = *(__le16 *)tmp; | 868 | data->kelvin_temperature = *(__le16 *)tmp; |
850 | data->kelvin_voltage = *((__le16 *)tmp + 1); | 869 | data->kelvin_voltage = *((__le16 *)tmp + 1); |
851 | 870 | ||
852 | data->radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size, | 871 | radio_cfg = iwl_eeprom_query16(eeprom, eeprom_size, |
853 | EEPROM_RADIO_CONFIG); | 872 | EEPROM_RADIO_CONFIG); |
854 | data->sku = iwl_eeprom_query16(eeprom, eeprom_size, | 873 | data->radio_cfg_dash = EEPROM_RF_CFG_DASH_MSK(radio_cfg); |
855 | EEPROM_SKU_CAP); | 874 | data->radio_cfg_pnum = EEPROM_RF_CFG_PNUM_MSK(radio_cfg); |
875 | data->radio_cfg_step = EEPROM_RF_CFG_STEP_MSK(radio_cfg); | ||
876 | data->radio_cfg_type = EEPROM_RF_CFG_TYPE_MSK(radio_cfg); | ||
877 | data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); | ||
878 | data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); | ||
879 | |||
880 | sku = iwl_eeprom_query16(eeprom, eeprom_size, | ||
881 | EEPROM_SKU_CAP); | ||
882 | data->sku_cap_11n_enable = sku & EEPROM_SKU_CAP_11N_ENABLE; | ||
883 | data->sku_cap_amt_enable = sku & EEPROM_SKU_CAP_AMT_ENABLE; | ||
884 | data->sku_cap_band_24GHz_enable = sku & EEPROM_SKU_CAP_BAND_24GHZ; | ||
885 | data->sku_cap_band_52GHz_enable = sku & EEPROM_SKU_CAP_BAND_52GHZ; | ||
886 | data->sku_cap_ipan_enable = sku & EEPROM_SKU_CAP_IPAN_ENABLE; | ||
856 | if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL) | 887 | if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_ALL) |
857 | data->sku &= ~EEPROM_SKU_CAP_11N_ENABLE; | 888 | data->sku_cap_11n_enable = false; |
858 | |||
859 | data->eeprom_version = iwl_eeprom_query16(eeprom, eeprom_size, | ||
860 | EEPROM_VERSION); | ||
861 | 889 | ||
862 | data->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(data->radio_cfg); | 890 | data->nvm_version = iwl_eeprom_query16(eeprom, eeprom_size, |
863 | data->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(data->radio_cfg); | 891 | EEPROM_VERSION); |
864 | 892 | ||
865 | /* check overrides (some devices have wrong EEPROM) */ | 893 | /* check overrides (some devices have wrong EEPROM) */ |
866 | if (cfg->valid_tx_ant) | 894 | if (cfg->valid_tx_ant) |
@@ -884,20 +912,20 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, | |||
884 | EXPORT_SYMBOL_GPL(iwl_parse_eeprom_data); | 912 | EXPORT_SYMBOL_GPL(iwl_parse_eeprom_data); |
885 | 913 | ||
886 | /* helper functions */ | 914 | /* helper functions */ |
887 | int iwl_eeprom_check_version(struct iwl_eeprom_data *data, | 915 | int iwl_nvm_check_version(struct iwl_nvm_data *data, |
888 | struct iwl_trans *trans) | 916 | struct iwl_trans *trans) |
889 | { | 917 | { |
890 | if (data->eeprom_version >= trans->cfg->eeprom_ver || | 918 | if (data->nvm_version >= trans->cfg->nvm_ver || |
891 | data->calib_version >= trans->cfg->eeprom_calib_ver) { | 919 | data->calib_version >= trans->cfg->nvm_calib_ver) { |
892 | IWL_DEBUG_INFO(trans, "device EEPROM VER=0x%x, CALIB=0x%x\n", | 920 | IWL_DEBUG_INFO(trans, "device EEPROM VER=0x%x, CALIB=0x%x\n", |
893 | data->eeprom_version, data->calib_version); | 921 | data->nvm_version, data->calib_version); |
894 | return 0; | 922 | return 0; |
895 | } | 923 | } |
896 | 924 | ||
897 | IWL_ERR(trans, | 925 | IWL_ERR(trans, |
898 | "Unsupported (too old) EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", | 926 | "Unsupported (too old) EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", |
899 | data->eeprom_version, trans->cfg->eeprom_ver, | 927 | data->nvm_version, trans->cfg->nvm_ver, |
900 | data->calib_version, trans->cfg->eeprom_calib_ver); | 928 | data->calib_version, trans->cfg->nvm_calib_ver); |
901 | return -EINVAL; | 929 | return -EINVAL; |
902 | } | 930 | } |
903 | EXPORT_SYMBOL_GPL(iwl_eeprom_check_version); | 931 | EXPORT_SYMBOL_GPL(iwl_nvm_check_version); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h index a5e425718f56..555f0eb61d48 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h | |||
@@ -66,22 +66,7 @@ | |||
66 | #include <linux/if_ether.h> | 66 | #include <linux/if_ether.h> |
67 | #include "iwl-trans.h" | 67 | #include "iwl-trans.h" |
68 | 68 | ||
69 | /* SKU Capabilities (actual values from EEPROM definition) */ | 69 | struct iwl_nvm_data { |
70 | #define EEPROM_SKU_CAP_BAND_24GHZ (1 << 4) | ||
71 | #define EEPROM_SKU_CAP_BAND_52GHZ (1 << 5) | ||
72 | #define EEPROM_SKU_CAP_11N_ENABLE (1 << 6) | ||
73 | #define EEPROM_SKU_CAP_AMT_ENABLE (1 << 7) | ||
74 | #define EEPROM_SKU_CAP_IPAN_ENABLE (1 << 8) | ||
75 | |||
76 | /* radio config bits (actual values from EEPROM definition) */ | ||
77 | #define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */ | ||
78 | #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */ | ||
79 | #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */ | ||
80 | #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */ | ||
81 | #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ | ||
82 | #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ | ||
83 | |||
84 | struct iwl_eeprom_data { | ||
85 | int n_hw_addrs; | 70 | int n_hw_addrs; |
86 | u8 hw_addr[ETH_ALEN]; | 71 | u8 hw_addr[ETH_ALEN]; |
87 | 72 | ||
@@ -93,13 +78,21 @@ struct iwl_eeprom_data { | |||
93 | __le16 kelvin_voltage; | 78 | __le16 kelvin_voltage; |
94 | __le16 xtal_calib[2]; | 79 | __le16 xtal_calib[2]; |
95 | 80 | ||
96 | u16 sku; | 81 | bool sku_cap_band_24GHz_enable; |
97 | u16 radio_cfg; | 82 | bool sku_cap_band_52GHz_enable; |
98 | u16 eeprom_version; | 83 | bool sku_cap_11n_enable; |
99 | s8 max_tx_pwr_half_dbm; | 84 | bool sku_cap_amt_enable; |
85 | bool sku_cap_ipan_enable; | ||
100 | 86 | ||
87 | u8 radio_cfg_type; | ||
88 | u8 radio_cfg_step; | ||
89 | u8 radio_cfg_dash; | ||
90 | u8 radio_cfg_pnum; | ||
101 | u8 valid_tx_ant, valid_rx_ant; | 91 | u8 valid_tx_ant, valid_rx_ant; |
102 | 92 | ||
93 | u16 nvm_version; | ||
94 | s8 max_tx_pwr_half_dbm; | ||
95 | |||
103 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; | 96 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; |
104 | struct ieee80211_channel channels[]; | 97 | struct ieee80211_channel channels[]; |
105 | }; | 98 | }; |
@@ -115,22 +108,22 @@ struct iwl_eeprom_data { | |||
115 | * This function parses all EEPROM values we need and then | 108 | * This function parses all EEPROM values we need and then |
116 | * returns a (newly allocated) struct containing all the | 109 | * returns a (newly allocated) struct containing all the |
117 | * relevant values for driver use. The struct must be freed | 110 | * relevant values for driver use. The struct must be freed |
118 | * later with iwl_free_eeprom_data(). | 111 | * later with iwl_free_nvm_data(). |
119 | */ | 112 | */ |
120 | struct iwl_eeprom_data * | 113 | struct iwl_nvm_data * |
121 | iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, | 114 | iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg, |
122 | const u8 *eeprom, size_t eeprom_size); | 115 | const u8 *eeprom, size_t eeprom_size); |
123 | 116 | ||
124 | /** | 117 | /** |
125 | * iwl_free_eeprom_data - free EEPROM data | 118 | * iwl_free_nvm_data - free NVM data |
126 | * @data: the data to free | 119 | * @data: the data to free |
127 | */ | 120 | */ |
128 | static inline void iwl_free_eeprom_data(struct iwl_eeprom_data *data) | 121 | static inline void iwl_free_nvm_data(struct iwl_nvm_data *data) |
129 | { | 122 | { |
130 | kfree(data); | 123 | kfree(data); |
131 | } | 124 | } |
132 | 125 | ||
133 | int iwl_eeprom_check_version(struct iwl_eeprom_data *data, | 126 | int iwl_nvm_check_version(struct iwl_nvm_data *data, |
134 | struct iwl_trans *trans); | 127 | struct iwl_trans *trans); |
135 | 128 | ||
136 | #endif /* __iwl_eeprom_parse_h__ */ | 129 | #endif /* __iwl_eeprom_parse_h__ */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.c b/drivers/net/wireless/iwlwifi/iwl-io.c index 54c41b44bffe..cdaff9572059 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.c +++ b/drivers/net/wireless/iwlwifi/iwl-io.c | |||
@@ -214,84 +214,84 @@ int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask, | |||
214 | } | 214 | } |
215 | EXPORT_SYMBOL_GPL(iwl_poll_direct_bit); | 215 | EXPORT_SYMBOL_GPL(iwl_poll_direct_bit); |
216 | 216 | ||
217 | static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg) | 217 | static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs) |
218 | { | 218 | { |
219 | iwl_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); | 219 | u32 val = iwl_trans_read_prph(trans, ofs); |
220 | return iwl_read32(trans, HBUS_TARG_PRPH_RDAT); | 220 | trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val); |
221 | return val; | ||
221 | } | 222 | } |
222 | 223 | ||
223 | static inline void __iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) | 224 | static inline void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) |
224 | { | 225 | { |
225 | iwl_write32(trans, HBUS_TARG_PRPH_WADDR, | 226 | trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val); |
226 | ((addr & 0x0000FFFF) | (3 << 24))); | 227 | iwl_trans_write_prph(trans, ofs, val); |
227 | iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val); | ||
228 | } | 228 | } |
229 | 229 | ||
230 | u32 iwl_read_prph(struct iwl_trans *trans, u32 reg) | 230 | u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs) |
231 | { | 231 | { |
232 | unsigned long flags; | 232 | unsigned long flags; |
233 | u32 val; | 233 | u32 val; |
234 | 234 | ||
235 | spin_lock_irqsave(&trans->reg_lock, flags); | 235 | spin_lock_irqsave(&trans->reg_lock, flags); |
236 | iwl_grab_nic_access(trans); | 236 | iwl_grab_nic_access(trans); |
237 | val = __iwl_read_prph(trans, reg); | 237 | val = __iwl_read_prph(trans, ofs); |
238 | iwl_release_nic_access(trans); | 238 | iwl_release_nic_access(trans); |
239 | spin_unlock_irqrestore(&trans->reg_lock, flags); | 239 | spin_unlock_irqrestore(&trans->reg_lock, flags); |
240 | return val; | 240 | return val; |
241 | } | 241 | } |
242 | EXPORT_SYMBOL_GPL(iwl_read_prph); | 242 | EXPORT_SYMBOL_GPL(iwl_read_prph); |
243 | 243 | ||
244 | void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) | 244 | void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val) |
245 | { | 245 | { |
246 | unsigned long flags; | 246 | unsigned long flags; |
247 | 247 | ||
248 | spin_lock_irqsave(&trans->reg_lock, flags); | 248 | spin_lock_irqsave(&trans->reg_lock, flags); |
249 | if (likely(iwl_grab_nic_access(trans))) { | 249 | if (likely(iwl_grab_nic_access(trans))) { |
250 | __iwl_write_prph(trans, addr, val); | 250 | __iwl_write_prph(trans, ofs, val); |
251 | iwl_release_nic_access(trans); | 251 | iwl_release_nic_access(trans); |
252 | } | 252 | } |
253 | spin_unlock_irqrestore(&trans->reg_lock, flags); | 253 | spin_unlock_irqrestore(&trans->reg_lock, flags); |
254 | } | 254 | } |
255 | EXPORT_SYMBOL_GPL(iwl_write_prph); | 255 | EXPORT_SYMBOL_GPL(iwl_write_prph); |
256 | 256 | ||
257 | void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) | 257 | void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) |
258 | { | 258 | { |
259 | unsigned long flags; | 259 | unsigned long flags; |
260 | 260 | ||
261 | spin_lock_irqsave(&trans->reg_lock, flags); | 261 | spin_lock_irqsave(&trans->reg_lock, flags); |
262 | if (likely(iwl_grab_nic_access(trans))) { | 262 | if (likely(iwl_grab_nic_access(trans))) { |
263 | __iwl_write_prph(trans, reg, | 263 | __iwl_write_prph(trans, ofs, |
264 | __iwl_read_prph(trans, reg) | mask); | 264 | __iwl_read_prph(trans, ofs) | mask); |
265 | iwl_release_nic_access(trans); | 265 | iwl_release_nic_access(trans); |
266 | } | 266 | } |
267 | spin_unlock_irqrestore(&trans->reg_lock, flags); | 267 | spin_unlock_irqrestore(&trans->reg_lock, flags); |
268 | } | 268 | } |
269 | EXPORT_SYMBOL_GPL(iwl_set_bits_prph); | 269 | EXPORT_SYMBOL_GPL(iwl_set_bits_prph); |
270 | 270 | ||
271 | void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, | 271 | void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs, |
272 | u32 bits, u32 mask) | 272 | u32 bits, u32 mask) |
273 | { | 273 | { |
274 | unsigned long flags; | 274 | unsigned long flags; |
275 | 275 | ||
276 | spin_lock_irqsave(&trans->reg_lock, flags); | 276 | spin_lock_irqsave(&trans->reg_lock, flags); |
277 | if (likely(iwl_grab_nic_access(trans))) { | 277 | if (likely(iwl_grab_nic_access(trans))) { |
278 | __iwl_write_prph(trans, reg, | 278 | __iwl_write_prph(trans, ofs, |
279 | (__iwl_read_prph(trans, reg) & mask) | bits); | 279 | (__iwl_read_prph(trans, ofs) & mask) | bits); |
280 | iwl_release_nic_access(trans); | 280 | iwl_release_nic_access(trans); |
281 | } | 281 | } |
282 | spin_unlock_irqrestore(&trans->reg_lock, flags); | 282 | spin_unlock_irqrestore(&trans->reg_lock, flags); |
283 | } | 283 | } |
284 | EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph); | 284 | EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph); |
285 | 285 | ||
286 | void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) | 286 | void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask) |
287 | { | 287 | { |
288 | unsigned long flags; | 288 | unsigned long flags; |
289 | u32 val; | 289 | u32 val; |
290 | 290 | ||
291 | spin_lock_irqsave(&trans->reg_lock, flags); | 291 | spin_lock_irqsave(&trans->reg_lock, flags); |
292 | if (likely(iwl_grab_nic_access(trans))) { | 292 | if (likely(iwl_grab_nic_access(trans))) { |
293 | val = __iwl_read_prph(trans, reg); | 293 | val = __iwl_read_prph(trans, ofs); |
294 | __iwl_write_prph(trans, reg, (val & ~mask)); | 294 | __iwl_write_prph(trans, ofs, (val & ~mask)); |
295 | iwl_release_nic_access(trans); | 295 | iwl_release_nic_access(trans); |
296 | } | 296 | } |
297 | spin_unlock_irqrestore(&trans->reg_lock, flags); | 297 | spin_unlock_irqrestore(&trans->reg_lock, flags); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h index e1aa69f66de6..48dc753e3742 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-io.h | |||
@@ -69,12 +69,12 @@ u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg); | |||
69 | void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value); | 69 | void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value); |
70 | 70 | ||
71 | 71 | ||
72 | u32 iwl_read_prph(struct iwl_trans *trans, u32 reg); | 72 | u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs); |
73 | void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val); | 73 | void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val); |
74 | void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask); | 74 | void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask); |
75 | void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, | 75 | void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs, |
76 | u32 bits, u32 mask); | 76 | u32 bits, u32 mask); |
77 | void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask); | 77 | void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask); |
78 | 78 | ||
79 | void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr, | 79 | void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr, |
80 | void *buf, int dwords); | 80 | void *buf, int dwords); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index e378ea6dca9c..b76532e238c1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -385,6 +385,8 @@ struct iwl_trans; | |||
385 | * @write8: write a u8 to a register at offset ofs from the BAR | 385 | * @write8: write a u8 to a register at offset ofs from the BAR |
386 | * @write32: write a u32 to a register at offset ofs from the BAR | 386 | * @write32: write a u32 to a register at offset ofs from the BAR |
387 | * @read32: read a u32 register at offset ofs from the BAR | 387 | * @read32: read a u32 register at offset ofs from the BAR |
388 | * @read_prph: read a DWORD from a periphery register | ||
389 | * @write_prph: write a DWORD to a periphery register | ||
388 | * @configure: configure parameters required by the transport layer from | 390 | * @configure: configure parameters required by the transport layer from |
389 | * the op_mode. May be called several times before start_fw, can't be | 391 | * the op_mode. May be called several times before start_fw, can't be |
390 | * called after that. | 392 | * called after that. |
@@ -420,6 +422,8 @@ struct iwl_trans_ops { | |||
420 | void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); | 422 | void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); |
421 | void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); | 423 | void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); |
422 | u32 (*read32)(struct iwl_trans *trans, u32 ofs); | 424 | u32 (*read32)(struct iwl_trans *trans, u32 ofs); |
425 | u32 (*read_prph)(struct iwl_trans *trans, u32 ofs); | ||
426 | void (*write_prph)(struct iwl_trans *trans, u32 ofs, u32 val); | ||
423 | void (*configure)(struct iwl_trans *trans, | 427 | void (*configure)(struct iwl_trans *trans, |
424 | const struct iwl_trans_config *trans_cfg); | 428 | const struct iwl_trans_config *trans_cfg); |
425 | void (*set_pmi)(struct iwl_trans *trans, bool state); | 429 | void (*set_pmi)(struct iwl_trans *trans, bool state); |
@@ -489,10 +493,6 @@ struct iwl_trans { | |||
489 | static inline void iwl_trans_configure(struct iwl_trans *trans, | 493 | static inline void iwl_trans_configure(struct iwl_trans *trans, |
490 | const struct iwl_trans_config *trans_cfg) | 494 | const struct iwl_trans_config *trans_cfg) |
491 | { | 495 | { |
492 | /* | ||
493 | * only set the op_mode for the moment. Later on, this function will do | ||
494 | * more | ||
495 | */ | ||
496 | trans->op_mode = trans_cfg->op_mode; | 496 | trans->op_mode = trans_cfg->op_mode; |
497 | 497 | ||
498 | trans->ops->configure(trans, trans_cfg); | 498 | trans->ops->configure(trans, trans_cfg); |
@@ -512,6 +512,9 @@ static inline void iwl_trans_stop_hw(struct iwl_trans *trans, | |||
512 | 512 | ||
513 | trans->ops->stop_hw(trans, op_mode_leaving); | 513 | trans->ops->stop_hw(trans, op_mode_leaving); |
514 | 514 | ||
515 | if (op_mode_leaving) | ||
516 | trans->op_mode = NULL; | ||
517 | |||
515 | trans->state = IWL_TRANS_NO_FW; | 518 | trans->state = IWL_TRANS_NO_FW; |
516 | } | 519 | } |
517 | 520 | ||
@@ -665,6 +668,17 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) | |||
665 | return trans->ops->read32(trans, ofs); | 668 | return trans->ops->read32(trans, ofs); |
666 | } | 669 | } |
667 | 670 | ||
671 | static inline u32 iwl_trans_read_prph(struct iwl_trans *trans, u32 ofs) | ||
672 | { | ||
673 | return trans->ops->read_prph(trans, ofs); | ||
674 | } | ||
675 | |||
676 | static inline void iwl_trans_write_prph(struct iwl_trans *trans, u32 ofs, | ||
677 | u32 val) | ||
678 | { | ||
679 | return trans->ops->write_prph(trans, ofs, val); | ||
680 | } | ||
681 | |||
668 | static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state) | 682 | static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state) |
669 | { | 683 | { |
670 | trans->ops->set_pmi(trans, state); | 684 | trans->ops->set_pmi(trans, state); |
diff --git a/drivers/net/wireless/iwlwifi/pcie/1000.c b/drivers/net/wireless/iwlwifi/pcie/1000.c index 81b83f484f08..f8620ecae6b4 100644 --- a/drivers/net/wireless/iwlwifi/pcie/1000.c +++ b/drivers/net/wireless/iwlwifi/pcie/1000.c | |||
@@ -94,8 +94,8 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = { | |||
94 | .device_family = IWL_DEVICE_FAMILY_1000, \ | 94 | .device_family = IWL_DEVICE_FAMILY_1000, \ |
95 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 95 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
96 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 96 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
97 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ | 97 | .nvm_ver = EEPROM_1000_EEPROM_VERSION, \ |
98 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ | 98 | .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ |
99 | .base_params = &iwl1000_base_params, \ | 99 | .base_params = &iwl1000_base_params, \ |
100 | .eeprom_params = &iwl1000_eeprom_params, \ | 100 | .eeprom_params = &iwl1000_eeprom_params, \ |
101 | .led_mode = IWL_LED_BLINK | 101 | .led_mode = IWL_LED_BLINK |
@@ -119,8 +119,8 @@ const struct iwl_cfg iwl1000_bg_cfg = { | |||
119 | .device_family = IWL_DEVICE_FAMILY_100, \ | 119 | .device_family = IWL_DEVICE_FAMILY_100, \ |
120 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 120 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
121 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 121 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
122 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ | 122 | .nvm_ver = EEPROM_1000_EEPROM_VERSION, \ |
123 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ | 123 | .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ |
124 | .base_params = &iwl1000_base_params, \ | 124 | .base_params = &iwl1000_base_params, \ |
125 | .eeprom_params = &iwl1000_eeprom_params, \ | 125 | .eeprom_params = &iwl1000_eeprom_params, \ |
126 | .led_mode = IWL_LED_RF_STATE, \ | 126 | .led_mode = IWL_LED_RF_STATE, \ |
diff --git a/drivers/net/wireless/iwlwifi/pcie/2000.c b/drivers/net/wireless/iwlwifi/pcie/2000.c index 9fbde32f7559..244019cec3e1 100644 --- a/drivers/net/wireless/iwlwifi/pcie/2000.c +++ b/drivers/net/wireless/iwlwifi/pcie/2000.c | |||
@@ -138,8 +138,8 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = { | |||
138 | .device_family = IWL_DEVICE_FAMILY_2000, \ | 138 | .device_family = IWL_DEVICE_FAMILY_2000, \ |
139 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 139 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
140 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 140 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
141 | .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ | 141 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
142 | .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ | 142 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
143 | .base_params = &iwl2000_base_params, \ | 143 | .base_params = &iwl2000_base_params, \ |
144 | .eeprom_params = &iwl20x0_eeprom_params, \ | 144 | .eeprom_params = &iwl20x0_eeprom_params, \ |
145 | .need_temp_offset_calib = true, \ | 145 | .need_temp_offset_calib = true, \ |
@@ -166,8 +166,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = { | |||
166 | .device_family = IWL_DEVICE_FAMILY_2030, \ | 166 | .device_family = IWL_DEVICE_FAMILY_2030, \ |
167 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 167 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
168 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 168 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
169 | .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ | 169 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
170 | .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ | 170 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
171 | .base_params = &iwl2030_base_params, \ | 171 | .base_params = &iwl2030_base_params, \ |
172 | .bt_params = &iwl2030_bt_params, \ | 172 | .bt_params = &iwl2030_bt_params, \ |
173 | .eeprom_params = &iwl20x0_eeprom_params, \ | 173 | .eeprom_params = &iwl20x0_eeprom_params, \ |
@@ -190,8 +190,8 @@ const struct iwl_cfg iwl2030_2bgn_cfg = { | |||
190 | .device_family = IWL_DEVICE_FAMILY_105, \ | 190 | .device_family = IWL_DEVICE_FAMILY_105, \ |
191 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 191 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
192 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 192 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
193 | .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ | 193 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
194 | .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ | 194 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
195 | .base_params = &iwl2000_base_params, \ | 195 | .base_params = &iwl2000_base_params, \ |
196 | .eeprom_params = &iwl20x0_eeprom_params, \ | 196 | .eeprom_params = &iwl20x0_eeprom_params, \ |
197 | .need_temp_offset_calib = true, \ | 197 | .need_temp_offset_calib = true, \ |
@@ -220,8 +220,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = { | |||
220 | .device_family = IWL_DEVICE_FAMILY_135, \ | 220 | .device_family = IWL_DEVICE_FAMILY_135, \ |
221 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 221 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
222 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 222 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
223 | .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ | 223 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
224 | .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ | 224 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
225 | .base_params = &iwl2030_base_params, \ | 225 | .base_params = &iwl2030_base_params, \ |
226 | .bt_params = &iwl2030_bt_params, \ | 226 | .bt_params = &iwl2030_bt_params, \ |
227 | .eeprom_params = &iwl20x0_eeprom_params, \ | 227 | .eeprom_params = &iwl20x0_eeprom_params, \ |
diff --git a/drivers/net/wireless/iwlwifi/pcie/5000.c b/drivers/net/wireless/iwlwifi/pcie/5000.c index d1665fa6d15a..83ca40321ff1 100644 --- a/drivers/net/wireless/iwlwifi/pcie/5000.c +++ b/drivers/net/wireless/iwlwifi/pcie/5000.c | |||
@@ -92,8 +92,8 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = { | |||
92 | .device_family = IWL_DEVICE_FAMILY_5000, \ | 92 | .device_family = IWL_DEVICE_FAMILY_5000, \ |
93 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 93 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
94 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 94 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
95 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \ | 95 | .nvm_ver = EEPROM_5000_EEPROM_VERSION, \ |
96 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ | 96 | .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ |
97 | .base_params = &iwl5000_base_params, \ | 97 | .base_params = &iwl5000_base_params, \ |
98 | .eeprom_params = &iwl5000_eeprom_params, \ | 98 | .eeprom_params = &iwl5000_eeprom_params, \ |
99 | .led_mode = IWL_LED_BLINK | 99 | .led_mode = IWL_LED_BLINK |
@@ -139,8 +139,8 @@ const struct iwl_cfg iwl5350_agn_cfg = { | |||
139 | .device_family = IWL_DEVICE_FAMILY_5000, | 139 | .device_family = IWL_DEVICE_FAMILY_5000, |
140 | .max_inst_size = IWLAGN_RTC_INST_SIZE, | 140 | .max_inst_size = IWLAGN_RTC_INST_SIZE, |
141 | .max_data_size = IWLAGN_RTC_DATA_SIZE, | 141 | .max_data_size = IWLAGN_RTC_DATA_SIZE, |
142 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, | 142 | .nvm_ver = EEPROM_5050_EEPROM_VERSION, |
143 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, | 143 | .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
144 | .base_params = &iwl5000_base_params, | 144 | .base_params = &iwl5000_base_params, |
145 | .eeprom_params = &iwl5000_eeprom_params, | 145 | .eeprom_params = &iwl5000_eeprom_params, |
146 | .ht_params = &iwl5000_ht_params, | 146 | .ht_params = &iwl5000_ht_params, |
@@ -156,8 +156,8 @@ const struct iwl_cfg iwl5350_agn_cfg = { | |||
156 | .device_family = IWL_DEVICE_FAMILY_5150, \ | 156 | .device_family = IWL_DEVICE_FAMILY_5150, \ |
157 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 157 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
158 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 158 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
159 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \ | 159 | .nvm_ver = EEPROM_5050_EEPROM_VERSION, \ |
160 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ | 160 | .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ |
161 | .base_params = &iwl5000_base_params, \ | 161 | .base_params = &iwl5000_base_params, \ |
162 | .eeprom_params = &iwl5000_eeprom_params, \ | 162 | .eeprom_params = &iwl5000_eeprom_params, \ |
163 | .no_xtal_calib = true, \ | 163 | .no_xtal_calib = true, \ |
diff --git a/drivers/net/wireless/iwlwifi/pcie/6000.c b/drivers/net/wireless/iwlwifi/pcie/6000.c index 4a57624afc40..d4df976d4709 100644 --- a/drivers/net/wireless/iwlwifi/pcie/6000.c +++ b/drivers/net/wireless/iwlwifi/pcie/6000.c | |||
@@ -160,8 +160,8 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = { | |||
160 | .device_family = IWL_DEVICE_FAMILY_6005, \ | 160 | .device_family = IWL_DEVICE_FAMILY_6005, \ |
161 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 161 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
162 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 162 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
163 | .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \ | 163 | .nvm_ver = EEPROM_6005_EEPROM_VERSION, \ |
164 | .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ | 164 | .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ |
165 | .base_params = &iwl6000_g2_base_params, \ | 165 | .base_params = &iwl6000_g2_base_params, \ |
166 | .eeprom_params = &iwl6000_eeprom_params, \ | 166 | .eeprom_params = &iwl6000_eeprom_params, \ |
167 | .need_temp_offset_calib = true, \ | 167 | .need_temp_offset_calib = true, \ |
@@ -215,8 +215,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = { | |||
215 | .device_family = IWL_DEVICE_FAMILY_6030, \ | 215 | .device_family = IWL_DEVICE_FAMILY_6030, \ |
216 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 216 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
217 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 217 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
218 | .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ | 218 | .nvm_ver = EEPROM_6030_EEPROM_VERSION, \ |
219 | .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ | 219 | .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ |
220 | .base_params = &iwl6000_g2_base_params, \ | 220 | .base_params = &iwl6000_g2_base_params, \ |
221 | .bt_params = &iwl6000_bt_params, \ | 221 | .bt_params = &iwl6000_bt_params, \ |
222 | .eeprom_params = &iwl6000_eeprom_params, \ | 222 | .eeprom_params = &iwl6000_eeprom_params, \ |
@@ -254,8 +254,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = { | |||
254 | .device_family = IWL_DEVICE_FAMILY_6030, \ | 254 | .device_family = IWL_DEVICE_FAMILY_6030, \ |
255 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 255 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
256 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 256 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
257 | .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ | 257 | .nvm_ver = EEPROM_6030_EEPROM_VERSION, \ |
258 | .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ | 258 | .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ |
259 | .base_params = &iwl6000_g2_base_params, \ | 259 | .base_params = &iwl6000_g2_base_params, \ |
260 | .bt_params = &iwl6000_bt_params, \ | 260 | .bt_params = &iwl6000_bt_params, \ |
261 | .eeprom_params = &iwl6000_eeprom_params, \ | 261 | .eeprom_params = &iwl6000_eeprom_params, \ |
@@ -306,8 +306,8 @@ const struct iwl_cfg iwl130_bg_cfg = { | |||
306 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 306 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
307 | .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \ | 307 | .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \ |
308 | .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \ | 308 | .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \ |
309 | .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \ | 309 | .nvm_ver = EEPROM_6000_EEPROM_VERSION, \ |
310 | .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ | 310 | .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ |
311 | .base_params = &iwl6000_base_params, \ | 311 | .base_params = &iwl6000_base_params, \ |
312 | .eeprom_params = &iwl6000_eeprom_params, \ | 312 | .eeprom_params = &iwl6000_eeprom_params, \ |
313 | .led_mode = IWL_LED_BLINK | 313 | .led_mode = IWL_LED_BLINK |
@@ -337,8 +337,8 @@ const struct iwl_cfg iwl6000i_2bg_cfg = { | |||
337 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 337 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
338 | .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \ | 338 | .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \ |
339 | .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \ | 339 | .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \ |
340 | .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \ | 340 | .nvm_ver = EEPROM_6050_EEPROM_VERSION, \ |
341 | .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ | 341 | .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ |
342 | .base_params = &iwl6050_base_params, \ | 342 | .base_params = &iwl6050_base_params, \ |
343 | .eeprom_params = &iwl6000_eeprom_params, \ | 343 | .eeprom_params = &iwl6000_eeprom_params, \ |
344 | .led_mode = IWL_LED_BLINK, \ | 344 | .led_mode = IWL_LED_BLINK, \ |
@@ -362,8 +362,8 @@ const struct iwl_cfg iwl6050_2abg_cfg = { | |||
362 | .device_family = IWL_DEVICE_FAMILY_6150, \ | 362 | .device_family = IWL_DEVICE_FAMILY_6150, \ |
363 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 363 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
364 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 364 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
365 | .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \ | 365 | .nvm_ver = EEPROM_6150_EEPROM_VERSION, \ |
366 | .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ | 366 | .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ |
367 | .base_params = &iwl6050_base_params, \ | 367 | .base_params = &iwl6050_base_params, \ |
368 | .eeprom_params = &iwl6000_eeprom_params, \ | 368 | .eeprom_params = &iwl6000_eeprom_params, \ |
369 | .led_mode = IWL_LED_BLINK, \ | 369 | .led_mode = IWL_LED_BLINK, \ |
@@ -389,8 +389,8 @@ const struct iwl_cfg iwl6000_3agn_cfg = { | |||
389 | .device_family = IWL_DEVICE_FAMILY_6000, | 389 | .device_family = IWL_DEVICE_FAMILY_6000, |
390 | .max_inst_size = IWL60_RTC_INST_SIZE, | 390 | .max_inst_size = IWL60_RTC_INST_SIZE, |
391 | .max_data_size = IWL60_RTC_DATA_SIZE, | 391 | .max_data_size = IWL60_RTC_DATA_SIZE, |
392 | .eeprom_ver = EEPROM_6000_EEPROM_VERSION, | 392 | .nvm_ver = EEPROM_6000_EEPROM_VERSION, |
393 | .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, | 393 | .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, |
394 | .base_params = &iwl6000_base_params, | 394 | .base_params = &iwl6000_base_params, |
395 | .eeprom_params = &iwl6000_eeprom_params, | 395 | .eeprom_params = &iwl6000_eeprom_params, |
396 | .ht_params = &iwl6000_ht_params, | 396 | .ht_params = &iwl6000_ht_params, |
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index 2b7e8a0b1cd4..c2e141af353c 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -267,6 +267,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
267 | const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); | 267 | const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); |
268 | struct iwl_trans *iwl_trans; | 268 | struct iwl_trans *iwl_trans; |
269 | struct iwl_trans_pcie *trans_pcie; | 269 | struct iwl_trans_pcie *trans_pcie; |
270 | int ret; | ||
270 | 271 | ||
271 | iwl_trans = iwl_trans_pcie_alloc(pdev, ent, cfg); | 272 | iwl_trans = iwl_trans_pcie_alloc(pdev, ent, cfg); |
272 | if (iwl_trans == NULL) | 273 | if (iwl_trans == NULL) |
@@ -276,11 +277,15 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
276 | 277 | ||
277 | trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); | 278 | trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); |
278 | trans_pcie->drv = iwl_drv_start(iwl_trans, cfg); | 279 | trans_pcie->drv = iwl_drv_start(iwl_trans, cfg); |
279 | if (!trans_pcie->drv) | 280 | |
281 | if (IS_ERR_OR_NULL(trans_pcie->drv)) { | ||
282 | ret = PTR_ERR(trans_pcie->drv); | ||
280 | goto out_free_trans; | 283 | goto out_free_trans; |
284 | } | ||
281 | 285 | ||
282 | /* register transport layer debugfs here */ | 286 | /* register transport layer debugfs here */ |
283 | if (iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir)) | 287 | ret = iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir); |
288 | if (ret) | ||
284 | goto out_free_drv; | 289 | goto out_free_drv; |
285 | 290 | ||
286 | return 0; | 291 | return 0; |
@@ -290,7 +295,7 @@ out_free_drv: | |||
290 | out_free_trans: | 295 | out_free_trans: |
291 | iwl_trans_pcie_free(iwl_trans); | 296 | iwl_trans_pcie_free(iwl_trans); |
292 | pci_set_drvdata(pdev, NULL); | 297 | pci_set_drvdata(pdev, NULL); |
293 | return -EFAULT; | 298 | return ret; |
294 | } | 299 | } |
295 | 300 | ||
296 | static void iwl_pci_remove(struct pci_dev *pdev) | 301 | static void iwl_pci_remove(struct pci_dev *pdev) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index bb32510fdd62..dad4c4aad91f 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -717,7 +717,7 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans) | |||
717 | 717 | ||
718 | /* uCode's read index (stored in shared DRAM) indicates the last Rx | 718 | /* uCode's read index (stored in shared DRAM) indicates the last Rx |
719 | * buffer that the driver may process (last buffer filled by ucode). */ | 719 | * buffer that the driver may process (last buffer filled by ucode). */ |
720 | r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF; | 720 | r = le16_to_cpu(ACCESS_ONCE(rxq->rb_stts->closed_rb_num)) & 0x0FFF; |
721 | i = rxq->read; | 721 | i = rxq->read; |
722 | 722 | ||
723 | /* Rx interrupt, but nothing sent from uCode */ | 723 | /* Rx interrupt, but nothing sent from uCode */ |
@@ -1122,12 +1122,20 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) | |||
1122 | * back-to-back ISRs and sporadic interrupts from our NIC. | 1122 | * back-to-back ISRs and sporadic interrupts from our NIC. |
1123 | * If we have something to service, the tasklet will re-enable ints. | 1123 | * If we have something to service, the tasklet will re-enable ints. |
1124 | * If we *don't* have something, we'll re-enable before leaving here. */ | 1124 | * If we *don't* have something, we'll re-enable before leaving here. */ |
1125 | inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */ | 1125 | inta_mask = iwl_read32(trans, CSR_INT_MASK); |
1126 | iwl_write32(trans, CSR_INT_MASK, 0x00000000); | 1126 | iwl_write32(trans, CSR_INT_MASK, 0x00000000); |
1127 | 1127 | ||
1128 | /* Discover which interrupts are active/pending */ | 1128 | /* Discover which interrupts are active/pending */ |
1129 | inta = iwl_read32(trans, CSR_INT); | 1129 | inta = iwl_read32(trans, CSR_INT); |
1130 | 1130 | ||
1131 | if (inta & (~inta_mask)) { | ||
1132 | IWL_DEBUG_ISR(trans, | ||
1133 | "We got a masked interrupt (0x%08x)...Ack and ignore\n", | ||
1134 | inta & (~inta_mask)); | ||
1135 | iwl_write32(trans, CSR_INT, inta & (~inta_mask)); | ||
1136 | inta &= inta_mask; | ||
1137 | } | ||
1138 | |||
1131 | /* Ignore interrupt if there's nothing in NIC to service. | 1139 | /* Ignore interrupt if there's nothing in NIC to service. |
1132 | * This may be due to IRQ shared with another device, | 1140 | * This may be due to IRQ shared with another device, |
1133 | * or due to sporadic interrupts thrown from our NIC. */ | 1141 | * or due to sporadic interrupts thrown from our NIC. */ |
@@ -1209,7 +1217,7 @@ irqreturn_t iwl_pcie_isr_ict(int irq, void *data) | |||
1209 | * If we have something to service, the tasklet will re-enable ints. | 1217 | * If we have something to service, the tasklet will re-enable ints. |
1210 | * If we *don't* have something, we'll re-enable before leaving here. | 1218 | * If we *don't* have something, we'll re-enable before leaving here. |
1211 | */ | 1219 | */ |
1212 | inta_mask = iwl_read32(trans, CSR_INT_MASK); /* just for debug */ | 1220 | inta_mask = iwl_read32(trans, CSR_INT_MASK); |
1213 | iwl_write32(trans, CSR_INT_MASK, 0x00000000); | 1221 | iwl_write32(trans, CSR_INT_MASK, 0x00000000); |
1214 | 1222 | ||
1215 | /* Ignore interrupt if there's nothing in NIC to service. | 1223 | /* Ignore interrupt if there's nothing in NIC to service. |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index f6c21e7edaf2..d66cad4a7d6a 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -633,6 +633,8 @@ static void iwl_trans_pcie_stop_hw(struct iwl_trans *trans, | |||
633 | iwl_disable_interrupts(trans); | 633 | iwl_disable_interrupts(trans); |
634 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 634 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); |
635 | 635 | ||
636 | iwl_pcie_disable_ict(trans); | ||
637 | |||
636 | if (!op_mode_leaving) { | 638 | if (!op_mode_leaving) { |
637 | /* | 639 | /* |
638 | * Even if we stop the HW, we still want the RF kill | 640 | * Even if we stop the HW, we still want the RF kill |
@@ -666,6 +668,20 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) | |||
666 | return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); | 668 | return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); |
667 | } | 669 | } |
668 | 670 | ||
671 | static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) | ||
672 | { | ||
673 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); | ||
674 | return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); | ||
675 | } | ||
676 | |||
677 | static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, | ||
678 | u32 val) | ||
679 | { | ||
680 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, | ||
681 | ((addr & 0x0000FFFF) | (3 << 24))); | ||
682 | iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); | ||
683 | } | ||
684 | |||
669 | static void iwl_trans_pcie_configure(struct iwl_trans *trans, | 685 | static void iwl_trans_pcie_configure(struct iwl_trans *trans, |
670 | const struct iwl_trans_config *trans_cfg) | 686 | const struct iwl_trans_config *trans_cfg) |
671 | { | 687 | { |
@@ -1221,6 +1237,8 @@ static const struct iwl_trans_ops trans_ops_pcie = { | |||
1221 | .write8 = iwl_trans_pcie_write8, | 1237 | .write8 = iwl_trans_pcie_write8, |
1222 | .write32 = iwl_trans_pcie_write32, | 1238 | .write32 = iwl_trans_pcie_write32, |
1223 | .read32 = iwl_trans_pcie_read32, | 1239 | .read32 = iwl_trans_pcie_read32, |
1240 | .read_prph = iwl_trans_pcie_read_prph, | ||
1241 | .write_prph = iwl_trans_pcie_write_prph, | ||
1224 | .configure = iwl_trans_pcie_configure, | 1242 | .configure = iwl_trans_pcie_configure, |
1225 | .set_pmi = iwl_trans_pcie_set_pmi, | 1243 | .set_pmi = iwl_trans_pcie_set_pmi, |
1226 | }; | 1244 | }; |