diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/fw.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/fw.c | 79 |
1 files changed, 59 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c index c03d39541f9e..7ce20062f32d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/iwlwifi/mvm/fw.c | |||
@@ -110,18 +110,48 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait, | |||
110 | container_of(notif_wait, struct iwl_mvm, notif_wait); | 110 | container_of(notif_wait, struct iwl_mvm, notif_wait); |
111 | struct iwl_mvm_alive_data *alive_data = data; | 111 | struct iwl_mvm_alive_data *alive_data = data; |
112 | struct mvm_alive_resp *palive; | 112 | struct mvm_alive_resp *palive; |
113 | 113 | struct mvm_alive_resp_ver2 *palive2; | |
114 | palive = (void *)pkt->data; | 114 | |
115 | 115 | if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive)) { | |
116 | mvm->error_event_table = le32_to_cpu(palive->error_event_table_ptr); | 116 | palive = (void *)pkt->data; |
117 | mvm->log_event_table = le32_to_cpu(palive->log_event_table_ptr); | 117 | |
118 | alive_data->scd_base_addr = le32_to_cpu(palive->scd_base_ptr); | 118 | mvm->support_umac_log = false; |
119 | 119 | mvm->error_event_table = | |
120 | alive_data->valid = le16_to_cpu(palive->status) == IWL_ALIVE_STATUS_OK; | 120 | le32_to_cpu(palive->error_event_table_ptr); |
121 | IWL_DEBUG_FW(mvm, | 121 | mvm->log_event_table = le32_to_cpu(palive->log_event_table_ptr); |
122 | "Alive ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", | 122 | alive_data->scd_base_addr = le32_to_cpu(palive->scd_base_ptr); |
123 | le16_to_cpu(palive->status), palive->ver_type, | 123 | |
124 | palive->ver_subtype, palive->flags); | 124 | alive_data->valid = le16_to_cpu(palive->status) == |
125 | IWL_ALIVE_STATUS_OK; | ||
126 | IWL_DEBUG_FW(mvm, | ||
127 | "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", | ||
128 | le16_to_cpu(palive->status), palive->ver_type, | ||
129 | palive->ver_subtype, palive->flags); | ||
130 | } else { | ||
131 | palive2 = (void *)pkt->data; | ||
132 | |||
133 | mvm->error_event_table = | ||
134 | le32_to_cpu(palive2->error_event_table_ptr); | ||
135 | mvm->log_event_table = | ||
136 | le32_to_cpu(palive2->log_event_table_ptr); | ||
137 | alive_data->scd_base_addr = le32_to_cpu(palive2->scd_base_ptr); | ||
138 | mvm->umac_error_event_table = | ||
139 | le32_to_cpu(palive2->error_info_addr); | ||
140 | |||
141 | alive_data->valid = le16_to_cpu(palive2->status) == | ||
142 | IWL_ALIVE_STATUS_OK; | ||
143 | if (mvm->umac_error_event_table) | ||
144 | mvm->support_umac_log = true; | ||
145 | |||
146 | IWL_DEBUG_FW(mvm, | ||
147 | "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", | ||
148 | le16_to_cpu(palive2->status), palive2->ver_type, | ||
149 | palive2->ver_subtype, palive2->flags); | ||
150 | |||
151 | IWL_DEBUG_FW(mvm, | ||
152 | "UMAC version: Major - 0x%x, Minor - 0x%x\n", | ||
153 | palive2->umac_major, palive2->umac_minor); | ||
154 | } | ||
125 | 155 | ||
126 | return true; | 156 | return true; |
127 | } | 157 | } |
@@ -292,7 +322,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) | |||
292 | } | 322 | } |
293 | 323 | ||
294 | /* Send TX valid antennas before triggering calibrations */ | 324 | /* Send TX valid antennas before triggering calibrations */ |
295 | ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw)); | 325 | ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant); |
296 | if (ret) | 326 | if (ret) |
297 | goto error; | 327 | goto error; |
298 | 328 | ||
@@ -328,8 +358,6 @@ out: | |||
328 | GFP_KERNEL); | 358 | GFP_KERNEL); |
329 | if (!mvm->nvm_data) | 359 | if (!mvm->nvm_data) |
330 | return -ENOMEM; | 360 | return -ENOMEM; |
331 | mvm->nvm_data->valid_rx_ant = 1; | ||
332 | mvm->nvm_data->valid_tx_ant = 1; | ||
333 | mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels; | 361 | mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels; |
334 | mvm->nvm_data->bands[0].n_channels = 1; | 362 | mvm->nvm_data->bands[0].n_channels = 1; |
335 | mvm->nvm_data->bands[0].n_bitrates = 1; | 363 | mvm->nvm_data->bands[0].n_bitrates = 1; |
@@ -341,8 +369,6 @@ out: | |||
341 | return ret; | 369 | return ret; |
342 | } | 370 | } |
343 | 371 | ||
344 | #define UCODE_CALIB_TIMEOUT (2*HZ) | ||
345 | |||
346 | int iwl_mvm_up(struct iwl_mvm *mvm) | 372 | int iwl_mvm_up(struct iwl_mvm *mvm) |
347 | { | 373 | { |
348 | int ret, i; | 374 | int ret, i; |
@@ -394,7 +420,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
394 | if (ret) | 420 | if (ret) |
395 | IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); | 421 | IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); |
396 | 422 | ||
397 | ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw)); | 423 | ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant); |
398 | if (ret) | 424 | if (ret) |
399 | goto error; | 425 | goto error; |
400 | 426 | ||
@@ -439,10 +465,23 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
439 | goto error; | 465 | goto error; |
440 | } | 466 | } |
441 | 467 | ||
442 | ret = iwl_mvm_power_update_device_mode(mvm); | 468 | /* Initialize tx backoffs to the minimal possible */ |
469 | iwl_mvm_tt_tx_backoff(mvm, 0); | ||
470 | |||
471 | if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT)) { | ||
472 | ret = iwl_power_legacy_set_cam_mode(mvm); | ||
473 | if (ret) | ||
474 | goto error; | ||
475 | } | ||
476 | |||
477 | ret = iwl_mvm_power_update_device(mvm); | ||
443 | if (ret) | 478 | if (ret) |
444 | goto error; | 479 | goto error; |
445 | 480 | ||
481 | /* allow FW/transport low power modes if not during restart */ | ||
482 | if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) | ||
483 | iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN); | ||
484 | |||
446 | IWL_DEBUG_INFO(mvm, "RT uCode started.\n"); | 485 | IWL_DEBUG_INFO(mvm, "RT uCode started.\n"); |
447 | return 0; | 486 | return 0; |
448 | error: | 487 | error: |
@@ -466,7 +505,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm) | |||
466 | goto error; | 505 | goto error; |
467 | } | 506 | } |
468 | 507 | ||
469 | ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw)); | 508 | ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant); |
470 | if (ret) | 509 | if (ret) |
471 | goto error; | 510 | goto error; |
472 | 511 | ||