iwlwifi: mvm: support p2p device frames tx on dqa queue #2
authorLiad Kaufman <liad.kaufman@intel.com>
Sun, 9 Aug 2015 16:26:56 +0000 (19:26 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 10 May 2016 15:34:25 +0000 (18:34 +0300)
Support sending P2P device frames should be sent from
queue #2, as required in DQA mode.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 206fd89e165e38cf1764a8d37f9669c4eb201cc2..41b80ae2d5f8088cf703de6b74eacabcaebb2f3e 100644 (file)
@@ -90,6 +90,7 @@ enum {
  * DQA queue numbers
  *
  * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
+ * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
  * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
  * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
  *     that we are never left without the possibility to connect to an AP.
@@ -107,6 +108,7 @@ enum {
  */
 enum iwl_mvm_dqa_txq {
        IWL_MVM_DQA_CMD_QUEUE = 0,
+       IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
        IWL_MVM_DQA_GCAST_QUEUE = 3,
        IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
        IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
index 0bcd8c78beb8521f1507d9d1f42a58251f4c784a..7aae068c02e54a1eb2050c0780bf907358502a7b 100644 (file)
@@ -501,9 +501,11 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
        switch (vif->type) {
        case NL80211_IFTYPE_P2P_DEVICE:
-               iwl_mvm_enable_ac_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
-                                     IWL_MVM_OFFCHANNEL_QUEUE,
-                                     IWL_MVM_TX_FIFO_VO, 0, wdg_timeout);
+               if (!iwl_mvm_is_dqa_supported(mvm))
+                       iwl_mvm_enable_ac_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
+                                             IWL_MVM_OFFCHANNEL_QUEUE,
+                                             IWL_MVM_TX_FIFO_VO, 0,
+                                             wdg_timeout);
                break;
        case NL80211_IFTYPE_AP:
                iwl_mvm_enable_ac_txq(mvm, vif->cab_queue, vif->cab_queue,
@@ -533,9 +535,11 @@ void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
        switch (vif->type) {
        case NL80211_IFTYPE_P2P_DEVICE:
-               iwl_mvm_disable_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
-                                   IWL_MVM_OFFCHANNEL_QUEUE, IWL_MAX_TID_COUNT,
-                                   0);
+               if (!iwl_mvm_is_dqa_supported(mvm))
+                       iwl_mvm_disable_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE,
+                                           IWL_MVM_OFFCHANNEL_QUEUE,
+                                           IWL_MAX_TID_COUNT, 0);
+
                break;
        case NL80211_IFTYPE_AP:
                iwl_mvm_disable_txq(mvm, vif->cab_queue, vif->cab_queue,
index 5350ca6f1f1d7a370fd6c7a920b5f1b1903a2873..701511dcf6d77b8baed2a37e5b09ee85d89b2254 100644 (file)
@@ -1016,6 +1016,10 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                    (mvmvif->bcast_sta.tfd_queue_msk &
                     BIT(IWL_MVM_DQA_AP_PROBE_RESP_QUEUE)))
                        queue = IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+               else if ((vif->type == NL80211_IFTYPE_P2P_DEVICE) &&
+                        (mvmvif->bcast_sta.tfd_queue_msk &
+                         BIT(IWL_MVM_DQA_P2P_DEVICE_QUEUE)))
+                       queue = IWL_MVM_DQA_P2P_DEVICE_QUEUE;
                else if (WARN(1, "Missed required TXQ for adding bcast STA\n"))
                        return -EINVAL;
 
@@ -1068,6 +1072,9 @@ int iwl_mvm_alloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 
                if (iwl_mvm_is_dqa_supported(mvm))
                        qmask |= BIT(IWL_MVM_DQA_AP_PROBE_RESP_QUEUE);
+       } else if (iwl_mvm_is_dqa_supported(mvm) &&
+                  vif->type == NL80211_IFTYPE_P2P_DEVICE) {
+               qmask |= BIT(IWL_MVM_DQA_P2P_DEVICE_QUEUE);
        }
 
        return iwl_mvm_allocate_int_sta(mvm, &mvmvif->bcast_sta, qmask,
index b4ac530f4f1dfa52f98fb42c9102eba68ae8e9bf..a8e5a6771375be64f8e1d15ed9e22f9fe388988e 100644 (file)
@@ -478,10 +478,14 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
 static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
                                      struct ieee80211_tx_info *info, __le16 fc)
 {
-       if (iwl_mvm_is_dqa_supported(mvm) &&
-           info->control.vif->type == NL80211_IFTYPE_AP &&
-           ieee80211_is_probe_resp(fc))
-               return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+       if (iwl_mvm_is_dqa_supported(mvm)) {
+               if (info->control.vif->type == NL80211_IFTYPE_AP &&
+                   ieee80211_is_probe_resp(fc))
+                       return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
+               else if (ieee80211_is_mgmt(fc) &&
+                        info->control.vif->type == NL80211_IFTYPE_P2P_DEVICE)
+                       return IWL_MVM_DQA_P2P_DEVICE_QUEUE;
+       }
 
        return info->hw_queue;
 }