Merge tag 'iwlwifi-next-for-kalle-2015-10-25' of https://git.kernel.org/pub/scm/linux...
authorKalle Valo <kvalo@codeaurora.org>
Wed, 28 Oct 2015 18:48:26 +0000 (20:48 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 28 Oct 2015 18:48:26 +0000 (20:48 +0200)
* bug fix for TDLS
* fixes and cleanups in scan
* support of several scan plans
* improvements in FTM
* fixes in FW API
* improvements in the failure paths when the bus is dead
* other various small things here and there

1  2 
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/mvm.h

@@@ -572,6 -572,14 +572,14 @@@ int iwl_mvm_mac_setup_register(struct i
        /* we create the 802.11 header and zero length SSID IE. */
        hw->wiphy->max_sched_scan_ie_len =
                SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2;
+       hw->wiphy->max_sched_scan_plans = IWL_MAX_SCHED_SCAN_PLANS;
+       hw->wiphy->max_sched_scan_plan_interval = U16_MAX;
+       /*
+        * the firmware uses u8 for num of iterations, but 0xff is saved for
+        * infinite loop, so the maximum number of iterations is actually 254.
+        */
+       hw->wiphy->max_sched_scan_plan_iterations = 254;
  
        hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN |
                               NL80211_FEATURE_LOW_PRIORITY_SCAN |
@@@ -1129,6 -1137,12 +1137,12 @@@ void iwl_mvm_fw_error_dump(struct iwl_m
  
        lockdep_assert_held(&mvm->mutex);
  
+       /* there's no point in fw dump if the bus is dead */
+       if (test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) {
+               IWL_ERR(mvm, "Skip fw error dump since bus is dead\n");
+               return;
+       }
        if (mvm->fw_dump_trig &&
            mvm->fw_dump_trig->mode & IWL_FW_DBG_TRIGGER_MONITOR_ONLY)
                monitor_dump_only = true;
        if (sram2_len)
                file_len += sizeof(*dump_data) + sizeof(*dump_mem) + sram2_len;
  
+       /* Make room for fw's virtual image pages, if it exists */
+       if (mvm->fw->img[mvm->cur_ucode].paging_mem_size)
+               file_len += mvm->num_of_paging_blk *
+                       (sizeof(*dump_data) +
+                        sizeof(struct iwl_fw_error_dump_paging) +
+                        PAGING_BLOCK_SIZE);
        /* If we only want a monitor dump, reset the file length */
        if (monitor_dump_only) {
                file_len = sizeof(*dump_file) + sizeof(*dump_data) +
                                         dump_mem->data, IWL8260_ICCM_LEN);
        }
  
+       /* Dump fw's virtual image */
+       if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) {
+               u32 i;
+               for (i = 1; i < mvm->num_of_paging_blk + 1; i++) {
+                       struct iwl_fw_error_dump_paging *paging;
+                       struct page *pages =
+                               mvm->fw_paging_db[i].fw_paging_block;
+                       dump_data = iwl_fw_error_next_data(dump_data);
+                       dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PAGING);
+                       dump_data->len = cpu_to_le32(sizeof(*paging) +
+                                                    PAGING_BLOCK_SIZE);
+                       paging = (void *)dump_data->data;
+                       paging->index = cpu_to_le32(i);
+                       memcpy(paging->data, page_address(pages),
+                              PAGING_BLOCK_SIZE);
+               }
+       }
  dump_trans_data:
        fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans,
                                                       mvm->fw_dump_trig);
@@@ -1754,7 -1795,7 +1795,7 @@@ static void iwl_mvm_prepare_mac_removal
                 * Flush them here.
                 */
                mutex_lock(&mvm->mutex);
-               iwl_mvm_flush_tx_path(mvm, tfd_msk, true);
+               iwl_mvm_flush_tx_path(mvm, tfd_msk, 0);
                mutex_unlock(&mvm->mutex);
  
                /*
        *total_flags = 0;
  }
  
+ static void iwl_mvm_config_iface_filter(struct ieee80211_hw *hw,
+                                       struct ieee80211_vif *vif,
+                                       unsigned int filter_flags,
+                                       unsigned int changed_flags)
+ {
+       struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+       /* We support only filter for probe requests */
+       if (!(changed_flags & FIF_PROBE_REQ))
+               return;
+       /* Supported only for p2p client interfaces */
+       if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc ||
+           !vif->p2p)
+               return;
+       mutex_lock(&mvm->mutex);
+       iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
+       mutex_unlock(&mvm->mutex);
+ }
  #ifdef CONFIG_IWLWIFI_BCAST_FILTERING
  struct iwl_bcast_iter_data {
        struct iwl_mvm *mvm;
@@@ -2373,7 -2435,6 +2435,7 @@@ static void iwl_mvm_stop_ap_ibss(struc
                iwl_mvm_remove_time_event(mvm, mvmvif,
                                          &mvmvif->time_event_data);
                RCU_INIT_POINTER(mvm->csa_vif, NULL);
 +              mvmvif->csa_countdown = false;
        }
  
        if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {
@@@ -3898,7 -3959,7 +3960,7 @@@ static void iwl_mvm_mac_flush(struct ie
        }
  
        if (drop) {
-               if (iwl_mvm_flush_tx_path(mvm, msk, true))
+               if (iwl_mvm_flush_tx_path(mvm, msk, 0))
                        IWL_ERR(mvm, "flush request fail\n");
                mutex_unlock(&mvm->mutex);
        } else {
@@@ -4135,6 -4196,7 +4197,7 @@@ const struct ieee80211_ops iwl_mvm_hw_o
        .config = iwl_mvm_mac_config,
        .prepare_multicast = iwl_mvm_prepare_multicast,
        .configure_filter = iwl_mvm_configure_filter,
+       .config_iface_filter = iwl_mvm_config_iface_filter,
        .bss_info_changed = iwl_mvm_bss_info_changed,
        .hw_scan = iwl_mvm_mac_hw_scan,
        .cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan,
@@@ -870,11 -870,6 +870,11 @@@ static inline bool iwl_mvm_is_radio_kil
               test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);
  }
  
 +static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm)
 +{
 +      return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
 +}
 +
  /* Must be called with rcu_read_lock() held and it can only be
   * released when mvmsta is not needed anymore.
   */
@@@ -1036,7 -1031,7 +1036,7 @@@ const char *iwl_mvm_get_tx_fail_reason(
  #else
  static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; }
  #endif
- int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, bool sync);
+ int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, u32 flags);
  void iwl_mvm_async_handlers_purge(struct iwl_mvm *mvm);
  
  static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info,