Merge tag 'iwlwifi-next-for-kalle-2017-06-06' of git://git.kernel.org/pub/scm/linux...
authorKalle Valo <kvalo@codeaurora.org>
Mon, 12 Jun 2017 16:29:39 +0000 (19:29 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 12 Jun 2017 16:29:39 +0000 (19:29 +0300)
First batch of iwlwifi driver patches 4.13

* Loads of FW API documentation improvements (for tools and htmldoc);
* Continued work for the new A000 family;
* Bumped the maximum supported FW API to 31;
* Improve the differentiation between 8000, 9000 and A000 families;
* A lot of fixes and cleanups here and there;

kvalo: There were conflicts iwl_mvm_stop_device() and
iwl_mvm_tcool_set_cur_state(). The former was easy but latter needed more
thought. Apparently the mutex was taken too late, so I fixed so that the mutex
is taken first and then check for iwl_mvm_firmware_running().

12 files changed:
1  2 
drivers/net/wireless/intel/iwlwifi/iwl-8000.c
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rs.h
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.h
drivers/net/wireless/intel/iwlwifi/mvm/tt.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

  #include "iwl-agn-hw.h"
  
  /* Highest firmware API version supported */
- #define IWL8000_UCODE_API_MAX 30
- #define IWL8265_UCODE_API_MAX 30
+ #define IWL8000_UCODE_API_MAX 31
+ #define IWL8265_UCODE_API_MAX 31
  
  /* Lowest firmware API version supported */
 -#define IWL8000_UCODE_API_MIN 17
 -#define IWL8265_UCODE_API_MIN 20
 +#define IWL8000_UCODE_API_MIN 22
 +#define IWL8265_UCODE_API_MIN 22
  
  /* NVM versions */
  #define IWL8000_NVM_VERSION           0x0a1d
@@@ -1755,8 -1771,7 +1774,8 @@@ static inline void iwl_mvm_stop_device(
  {
        if (!iwl_mvm_has_new_tx_api(mvm))
                iwl_free_fw_paging(mvm);
-       mvm->ucode_loaded = false;
+       clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
 +      mvm->fw_dbg_conf = FW_DBG_INVALID;
        iwl_trans_stop_device(mvm->trans);
  }
  
@@@ -790,9 -792,8 +792,10 @@@ static int iwl_mvm_tcool_set_cur_state(
        struct iwl_mvm *mvm = (struct iwl_mvm *)(cdev->devdata);
        int ret;
  
-       if (!mvm->ucode_loaded || !(mvm->cur_ucode == IWL_UCODE_REGULAR)) {
 +      mutex_lock(&mvm->mutex);
 +
+       if (!iwl_mvm_firmware_running(mvm) ||
+           mvm->cur_ucode != IWL_UCODE_REGULAR) {
                ret = -EIO;
                goto unlock;
        }