diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/main.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/main.c | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index ac2681cd9b3f..8f11198eb83c 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 | } |