diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2015-04-07 19:55:57 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-04-07 19:55:57 +0300 |
commit | 6dcaac59d08b77d5730f2ae824bca1c0bf8130dc (patch) | |
tree | 5d01321c7ceedb7a9a294ac20dadee372b301d0b /drivers/net/wireless/iwlwifi/pcie | |
parent | 7abccdba25be45630eede85053496f1f48d36ec8 (diff) | |
parent | 31755207afc5d5a30e3eea9e4f2a518fc5b680c1 (diff) |
Merge tag 'iwlwifi-next-for-kalle-2015-04-02' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
* some more work on LAR
* fixes for UMAC scan
* more work on debugging framework
* more work for 8000 devices
* cleanups and small bugfixes
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/rx.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 62 |
2 files changed, 28 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 7b7e2f223fb2..7ff69c642103 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c @@ -600,9 +600,11 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, if (pkt->len_n_flags == cpu_to_le32(FH_RSCSR_FRAME_INVALID)) break; - IWL_DEBUG_RX(trans, "cmd at offset %d: %s (0x%.2x)\n", - rxcb._offset, get_cmd_string(trans_pcie, pkt->hdr.cmd), - pkt->hdr.cmd); + IWL_DEBUG_RX(trans, + "cmd at offset %d: %s (0x%.2x, seq 0x%x)\n", + rxcb._offset, + get_cmd_string(trans_pcie, pkt->hdr.cmd), + pkt->hdr.cmd, le16_to_cpu(pkt->hdr.sequence)); len = iwl_rx_packet_len(pkt); len += sizeof(u32); /* account for status word */ diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index dc247325d8d7..2de8fbfe4edf 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -691,11 +691,15 @@ static int iwl_pcie_rsa_race_bug_wa(struct iwl_trans *trans) { u32 val, loop = 1000; - /* Check the RSA semaphore is accessible - if not, we are in trouble */ + /* + * Check the RSA semaphore is accessible. + * If the HW isn't locked and the rsa semaphore isn't accessible, + * we are in trouble. + */ val = iwl_read_prph(trans, PREG_AUX_BUS_WPROT_0); if (val & (BIT(1) | BIT(17))) { - IWL_ERR(trans, - "can't access the RSA semaphore it is write protected\n"); + IWL_INFO(trans, + "can't access the RSA semaphore it is write protected\n"); return 0; } @@ -719,10 +723,10 @@ static int iwl_pcie_rsa_race_bug_wa(struct iwl_trans *trans) return -EIO; } -static int iwl_pcie_load_cpu_sections_8000b(struct iwl_trans *trans, - const struct fw_img *image, - int cpu, - int *first_ucode_section) +static int iwl_pcie_load_cpu_sections_8000(struct iwl_trans *trans, + const struct fw_img *image, + int cpu, + int *first_ucode_section) { int shift_param; int i, ret = 0, sec_num = 0x1; @@ -917,20 +921,16 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, } /* release CPU reset */ - if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) - iwl_write_prph(trans, RELEASE_CPU_RESET, RELEASE_CPU_RESET_BIT); - else - iwl_write32(trans, CSR_RESET, 0); + iwl_write32(trans, CSR_RESET, 0); return 0; } -static int iwl_pcie_load_given_ucode_8000b(struct iwl_trans *trans, - const struct fw_img *image) +static int iwl_pcie_load_given_ucode_8000(struct iwl_trans *trans, + const struct fw_img *image) { int ret = 0; int first_ucode_section; - u32 reg; IWL_DEBUG_FW(trans, "working with %s CPU\n", image->is_dual_cpus ? "Dual" : "Single"); @@ -948,38 +948,23 @@ static int iwl_pcie_load_given_ucode_8000b(struct iwl_trans *trans, iwl_write_prph(trans, RELEASE_CPU_RESET, RELEASE_CPU_RESET_BIT); /* load to FW the binary Secured sections of CPU1 */ - ret = iwl_pcie_load_cpu_sections_8000b(trans, image, 1, - &first_ucode_section); + ret = iwl_pcie_load_cpu_sections_8000(trans, image, 1, + &first_ucode_section); if (ret) return ret; /* load to FW the binary sections of CPU2 */ - ret = iwl_pcie_load_cpu_sections_8000b(trans, image, 2, - &first_ucode_section); + ret = iwl_pcie_load_cpu_sections_8000(trans, image, 2, + &first_ucode_section); if (ret) return ret; - /* wait for image verification to complete */ - ret = iwl_poll_prph_bit(trans, LMPM_SECURE_BOOT_CPU1_STATUS_ADDR_B0, - LMPM_SECURE_BOOT_STATUS_SUCCESS, - LMPM_SECURE_BOOT_STATUS_SUCCESS, - LMPM_SECURE_TIME_OUT); - if (ret < 0) { - reg = iwl_read_prph(trans, - LMPM_SECURE_BOOT_CPU1_STATUS_ADDR_B0); - - IWL_ERR(trans, "Timeout on secure boot process, reg = %x\n", - reg); - return ret; - } - return 0; } static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, const struct fw_img *fw, bool run_in_rfkill) { - struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); int ret; bool hw_rfkill; @@ -1009,9 +994,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, return ret; } - /* init ref_count to 1 (should be cleared when ucode is loaded) */ - trans_pcie->ref_count = 1; - /* make sure rfkill handshake bits are cleared */ iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, @@ -1026,9 +1008,8 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); /* Load the given image to the HW */ - if ((trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) && - (CSR_HW_REV_STEP(trans->hw_rev) != SILICON_A_STEP)) - return iwl_pcie_load_given_ucode_8000b(trans, fw); + if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) + return iwl_pcie_load_given_ucode_8000(trans, fw); else return iwl_pcie_load_given_ucode(trans, fw); } @@ -1330,6 +1311,9 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans, trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; trans_pcie->scd_set_active = trans_cfg->scd_set_active; + /* init ref_count to 1 (should be cleared when ucode is loaded) */ + trans_pcie->ref_count = 1; + /* Initialize NAPI here - it should be before registering to mac80211 * in the opmode but after the HW struct is allocated. * As this function may be called again in some corner cases don't |