Skip to content

Commit ecbbec2

Browse files
committed
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
2 parents 36b07d1 + 25a1726 commit ecbbec2

28 files changed

Lines changed: 358 additions & 263 deletions

‎drivers/net/wireless/iwlwifi/dvm/calib.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,14 +833,14 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
833833
* To be safe, simply mask out any chains that we know
834834
* are not on the device.
835835
*/
836-
active_chains &= priv->eeprom_data->valid_rx_ant;
836+
active_chains &= priv->nvm_data->valid_rx_ant;
837837

838838
num_tx_chains = 0;
839839
for (i = 0; i < NUM_RX_CHAINS; i++) {
840840
/* loops on all the bits of
841841
* priv->hw_setting.valid_tx_ant */
842842
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))
844844
continue;
845845

846846
num_tx_chains++;
@@ -854,7 +854,7 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
854854
* connect the first valid tx chain
855855
*/
856856
first_chain =
857-
find_first_chain(priv->eeprom_data->valid_tx_ant);
857+
find_first_chain(priv->nvm_data->valid_tx_ant);
858858
data->disconn_array[first_chain] = 0;
859859
active_chains |= BIT(first_chain);
860860
IWL_DEBUG_CALIB(priv,
@@ -864,13 +864,13 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
864864
}
865865
}
866866

867-
if (active_chains != priv->eeprom_data->valid_rx_ant &&
867+
if (active_chains != priv->nvm_data->valid_rx_ant &&
868868
active_chains != priv->chain_noise_data.active_chains)
869869
IWL_DEBUG_CALIB(priv,
870870
"Detected that not all antennas are connected! "
871871
"Connected: %#x, valid: %#x.\n",
872872
active_chains,
873-
priv->eeprom_data->valid_rx_ant);
873+
priv->nvm_data->valid_rx_ant);
874874

875875
/* Save for use within RXON, TX, SCAN commands, etc. */
876876
data->active_chains = active_chains;
@@ -1055,7 +1055,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
10551055
priv->cfg->bt_params->advanced_bt_coexist) {
10561056
/* Disable disconnected antenna algorithm for advanced
10571057
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;
10591059
for (i = 0; i < NUM_RX_CHAINS; i++)
10601060
if (!(data->active_chains & (1<<i)))
10611061
data->disconn_array[i] = 1;
@@ -1086,7 +1086,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
10861086

10871087
iwlagn_gain_computation(
10881088
priv, average_noise,
1089-
find_first_chain(priv->eeprom_data->valid_rx_ant));
1089+
find_first_chain(priv->nvm_data->valid_rx_ant));
10901090

10911091
/* Some power changes may have been made during the calibration.
10921092
* Update and commit the RXON

‎drivers/net/wireless/iwlwifi/dvm/debugfs.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
305305
int pos = 0, ofs = 0, buf_size = 0;
306306
const u8 *ptr;
307307
char *buf;
308-
u16 eeprom_ver;
308+
u16 nvm_ver;
309309
size_t eeprom_len = priv->eeprom_blob_size;
310310
buf_size = 4 * eeprom_len + 256;
311311

@@ -321,9 +321,9 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
321321
if (!buf)
322322
return -ENOMEM;
323323

324-
eeprom_ver = priv->eeprom_data->eeprom_version;
324+
nvm_ver = priv->nvm_data->nvm_version;
325325
pos += scnprintf(buf + pos, buf_size - pos,
326-
"NVM version: 0x%x\n", eeprom_ver);
326+
"NVM version: 0x%x\n", nvm_ver);
327327
for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
328328
pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
329329
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,
13331333
if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) {
13341334
pos += scnprintf(buf + pos, bufsz - pos,
13351335
"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) &&
13371337
tx->tx_power.ant_a)
13381338
pos += scnprintf(buf + pos, bufsz - pos,
13391339
fmt_hex, "antenna A:",
13401340
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) &&
13421342
tx->tx_power.ant_b)
13431343
pos += scnprintf(buf + pos, bufsz - pos,
13441344
fmt_hex, "antenna B:",
13451345
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) &&
13471347
tx->tx_power.ant_c)
13481348
pos += scnprintf(buf + pos, bufsz - pos,
13491349
fmt_hex, "antenna C:",

‎drivers/net/wireless/iwlwifi/dvm/dev.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ struct iwl_priv {
843843
void *wowlan_sram;
844844
#endif /* CONFIG_IWLWIFI_DEBUGFS */
845845

846-
struct iwl_eeprom_data *eeprom_data;
846+
struct iwl_nvm_data *nvm_data;
847847
/* eeprom blob for debugfs/testmode */
848848
u8 *eeprom_blob;
849849
size_t eeprom_blob_size;

‎drivers/net/wireless/iwlwifi/dvm/devices.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ static s32 iwl_temp_calib_to_offset(struct iwl_priv *priv)
305305
{
306306
u16 temperature, voltage;
307307

308-
temperature = le16_to_cpu(priv->eeprom_data->kelvin_temperature);
309-
voltage = le16_to_cpu(priv->eeprom_data->kelvin_voltage);
308+
temperature = le16_to_cpu(priv->nvm_data->kelvin_temperature);
309+
voltage = le16_to_cpu(priv->nvm_data->kelvin_voltage);
310310

311311
/* offset = temp - volt / coeff */
312312
return (s32)(temperature -
@@ -460,13 +460,13 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
460460
break;
461461
case IWL_DEVICE_FAMILY_6050:
462462
/* Indicate calibration version to uCode. */
463-
if (priv->eeprom_data->calib_version >= 6)
463+
if (priv->nvm_data->calib_version >= 6)
464464
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
465465
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
466466
break;
467467
case IWL_DEVICE_FAMILY_6150:
468468
/* Indicate calibration version to uCode. */
469-
if (priv->eeprom_data->calib_version >= 6)
469+
if (priv->nvm_data->calib_version >= 6)
470470
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,
471471
CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
472472
iwl_set_bit(priv->trans, CSR_GP_DRIVER_REG,

‎drivers/net/wireless/iwlwifi/dvm/lib.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
5959
/* half dBm need to multiply */
6060
tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
6161

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) {
6363
/*
6464
* For the newer devices which using enhanced/extend tx power
6565
* 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)
7272
* half-dBm format), lower the tx power based on EEPROM
7373
*/
7474
tx_power_cmd.global_lmt =
75-
priv->eeprom_data->max_tx_pwr_half_dbm;
75+
priv->nvm_data->max_tx_pwr_half_dbm;
7676
}
7777
tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED;
7878
tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO;
@@ -159,7 +159,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv)
159159
IWL_PAN_SCD_MGMT_MSK |
160160
IWL_PAN_SCD_MULTICAST_MSK;
161161

162-
if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)
162+
if (priv->nvm_data->sku_cap_11n_enable)
163163
flush_cmd.queue_control |= IWL_AGG_TX_QUEUE_MSK;
164164

165165
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)
825825
if (priv->chain_noise_data.active_chains)
826826
active_chains = priv->chain_noise_data.active_chains;
827827
else
828-
active_chains = priv->eeprom_data->valid_rx_ant;
828+
active_chains = priv->nvm_data->valid_rx_ant;
829829

830830
if (priv->cfg->bt_params &&
831831
priv->cfg->bt_params->advanced_bt_coexist &&

‎drivers/net/wireless/iwlwifi/dvm/mac80211.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
164164
hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
165165
*/
166166

167-
if (priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE)
167+
if (priv->nvm_data->sku_cap_11n_enable)
168168
hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
169169
IEEE80211_HW_SUPPORTS_STATIC_SMPS;
170170

@@ -242,12 +242,12 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
242242

243243
hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
244244

245-
if (priv->eeprom_data->bands[IEEE80211_BAND_2GHZ].n_channels)
245+
if (priv->nvm_data->bands[IEEE80211_BAND_2GHZ].n_channels)
246246
priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
247-
&priv->eeprom_data->bands[IEEE80211_BAND_2GHZ];
248-
if (priv->eeprom_data->bands[IEEE80211_BAND_5GHZ].n_channels)
247+
&priv->nvm_data->bands[IEEE80211_BAND_2GHZ];
248+
if (priv->nvm_data->bands[IEEE80211_BAND_5GHZ].n_channels)
249249
priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
250-
&priv->eeprom_data->bands[IEEE80211_BAND_5GHZ];
250+
&priv->nvm_data->bands[IEEE80211_BAND_5GHZ];
251251

252252
hw->wiphy->hw_version = priv->trans->hw_id;
253253

@@ -654,7 +654,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
654654
IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
655655
sta->addr, tid);
656656

657-
if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_11N_ENABLE))
657+
if (!(priv->nvm_data->sku_cap_11n_enable))
658658
return -EACCES;
659659

660660
IWL_DEBUG_MAC80211(priv, "enter\n");

‎drivers/net/wireless/iwlwifi/dvm/main.c‎

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
185185
rate = info->control.rates[0].idx;
186186

187187
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);
189189
rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
190190

191191
/* In mac80211, rates for 5 GHz start at 0 */
@@ -776,7 +776,7 @@ int iwl_alive_start(struct iwl_priv *priv)
776776
ieee80211_wake_queues(priv->hw);
777777

778778
/* 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);
780780

781781
if (iwl_is_associated_ctx(ctx) && !priv->wowlan) {
782782
struct iwl_rxon_cmd *active_rxon =
@@ -1191,30 +1191,38 @@ static void iwl_option_config(struct iwl_priv *priv)
11911191

11921192
static int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
11931193
{
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 &&
11951198
!priv->cfg->ht_params) {
11961199
IWL_ERR(priv, "Invalid 11n configuration\n");
11971200
return -EINVAL;
11981201
}
11991202

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) {
12011205
IWL_ERR(priv, "Invalid device sku\n");
12021206
return -EINVAL;
12031207
}
12041208

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");
12061214

12071215
priv->hw_params.tx_chains_num =
1208-
num_of_ant(priv->eeprom_data->valid_tx_ant);
1216+
num_of_ant(data->valid_tx_ant);
12091217
if (priv->cfg->rx_with_siso_diversity)
12101218
priv->hw_params.rx_chains_num = 1;
12111219
else
12121220
priv->hw_params.rx_chains_num =
1213-
num_of_ant(priv->eeprom_data->valid_rx_ant);
1221+
num_of_ant(data->valid_rx_ant);
12141222

12151223
IWL_DEBUG_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n",
1216-
priv->eeprom_data->valid_tx_ant,
1217-
priv->eeprom_data->valid_rx_ant);
1224+
data->valid_tx_ant,
1225+
data->valid_rx_ant);
12181226

12191227
return 0;
12201228
}
@@ -1374,24 +1382,24 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
13741382
/* Reset chip to save power until we load uCode during "up". */
13751383
iwl_trans_stop_hw(priv->trans, false);
13761384

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,
13781386
priv->eeprom_blob,
13791387
priv->eeprom_blob_size);
1380-
if (!priv->eeprom_data)
1388+
if (!priv->nvm_data)
13811389
goto out_free_eeprom_blob;
13821390

1383-
if (iwl_eeprom_check_version(priv->eeprom_data, priv->trans))
1391+
if (iwl_nvm_check_version(priv->nvm_data, priv->trans))
13841392
goto out_free_eeprom;
13851393

13861394
if (iwl_eeprom_init_hw_params(priv))
13871395
goto out_free_eeprom;
13881396

13891397
/* 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);
13911399
IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr);
13921400
priv->hw->wiphy->addresses = priv->addresses;
13931401
priv->hw->wiphy->n_addresses = 1;
1394-
num_mac = priv->eeprom_data->n_hw_addrs;
1402+
num_mac = priv->nvm_data->n_hw_addrs;
13951403
if (num_mac > 1) {
13961404
memcpy(priv->addresses[1].addr, priv->addresses[0].addr,
13971405
ETH_ALEN);
@@ -1404,7 +1412,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
14041412
************************/
14051413
iwl_set_hw_params(priv);
14061414

1407-
if (!(priv->eeprom_data->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) {
1415+
if (!(priv->nvm_data->sku_cap_ipan_enable)) {
14081416
IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN");
14091417
ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
14101418
/*
@@ -1486,7 +1494,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
14861494
out_free_eeprom_blob:
14871495
kfree(priv->eeprom_blob);
14881496
out_free_eeprom:
1489-
iwl_free_eeprom_data(priv->eeprom_data);
1497+
iwl_free_nvm_data(priv->nvm_data);
14901498
out_free_hw:
14911499
ieee80211_free_hw(priv->hw);
14921500
out:
@@ -1506,7 +1514,7 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
15061514
iwl_tt_exit(priv);
15071515

15081516
kfree(priv->eeprom_blob);
1509-
iwl_free_eeprom_data(priv->eeprom_data);
1517+
iwl_free_nvm_data(priv->nvm_data);
15101518

15111519
/*netif_stop_queue(dev); */
15121520
flush_workqueue(priv->workqueue);
@@ -1980,7 +1988,6 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
19801988
static void iwl_nic_config(struct iwl_op_mode *op_mode)
19811989
{
19821990
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
1983-
u16 radio_cfg = priv->eeprom_data->radio_cfg;
19841991

19851992
/* SKU Control */
19861993
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)
19921999
CSR_HW_IF_CONFIG_REG_POS_MAC_DASH));
19932000

19942001
/* 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) {
19962003
u32 reg_val =
1997-
EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <<
2004+
priv->nvm_data->radio_cfg_type <<
19982005
CSR_HW_IF_CONFIG_REG_POS_PHY_TYPE |
1999-
EEPROM_RF_CFG_STEP_MSK(radio_cfg) <<
2006+
priv->nvm_data->radio_cfg_step <<
20002007
CSR_HW_IF_CONFIG_REG_POS_PHY_STEP |
2001-
EEPROM_RF_CFG_DASH_MSK(radio_cfg) <<
2008+
priv->nvm_data->radio_cfg_dash <<
20022009
CSR_HW_IF_CONFIG_REG_POS_PHY_DASH;
20032010

20042011
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)
20072014
CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH, reg_val);
20082015

20092016
IWL_INFO(priv, "Radio type=0x%x-0x%x-0x%x\n",
2010-
EEPROM_RF_CFG_TYPE_MSK(radio_cfg),
2011-
EEPROM_RF_CFG_STEP_MSK(radio_cfg),
2012-
EEPROM_RF_CFG_DASH_MSK(radio_cfg));
2017+
priv->nvm_data->radio_cfg_type,
2018+
priv->nvm_data->radio_cfg_step,
2019+
priv->nvm_data->radio_cfg_dash);
20132020
} else {
20142021
WARN_ON(1);
20152022
}

0 commit comments

Comments
 (0)