]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: enable low latency for soft ap
authorTova Mussai <tova.mussai@intel.com>
Mon, 2 Jul 2018 06:08:29 +0000 (09:08 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Sun, 11 Nov 2018 09:06:16 +0000 (11:06 +0200)
Enable low latency for softAP in all modes (standalone, SCM
and DCM).
This is in order to minimize the time the softAP leaves the channel for
other operations

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index 1aa6c7e930888e46593e95e4439b52c4ee370e14..e9767bbdea1ed60334bbebd9305fc3c6762826f1 100644 (file)
@@ -1299,10 +1299,11 @@ static ssize_t iwl_dbgfs_low_latency_read(struct file *file,
        int len;
 
        len = scnprintf(buf, sizeof(buf) - 1,
-                       "traffic=%d\ndbgfs=%d\nvcmd=%d\n",
+                       "traffic=%d\ndbgfs=%d\nvcmd=%d\nvif_type=%d\n",
                        !!(mvmvif->low_latency & LOW_LATENCY_TRAFFIC),
                        !!(mvmvif->low_latency & LOW_LATENCY_DEBUGFS),
-                       !!(mvmvif->low_latency & LOW_LATENCY_VCMD));
+                       !!(mvmvif->low_latency & LOW_LATENCY_VCMD),
+                       !!(mvmvif->low_latency & LOW_LATENCY_VIF_TYPE));
        return simple_read_from_buffer(user_buf, count, ppos, buf, len);
 }
 
index 505b0385d80003e546578fa2a1d8a4684ea1a9dd..5bdc638fc99981ae0aea9b0e98506fe243524a86 100644 (file)
@@ -2379,6 +2379,12 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
        /* must be set before quota calculations */
        mvmvif->ap_ibss_active = true;
 
+       if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) {
+               iwl_mvm_vif_set_low_latency(mvmvif, true,
+                                           LOW_LATENCY_VIF_TYPE);
+               iwl_mvm_send_low_latency_cmd(mvm, true, mvmvif->id);
+       }
+
        /* power updated needs to be done before quotas */
        iwl_mvm_power_update_mac(mvm);
 
@@ -2441,6 +2447,12 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
        mvmvif->ap_ibss_active = false;
        mvm->ap_last_beacon_gp2 = 0;
 
+       if (vif->type == NL80211_IFTYPE_AP && !vif->p2p) {
+               iwl_mvm_vif_set_low_latency(mvmvif, false,
+                                           LOW_LATENCY_VIF_TYPE);
+               iwl_mvm_send_low_latency_cmd(mvm, false,  mvmvif->id);
+       }
+
        iwl_mvm_bt_coex_vif_change(mvm);
 
        iwl_mvm_unref(mvm, IWL_MVM_REF_AP_IBSS);
index 8a933774a934934b1e31acd97b5aa898301fd5e3..03fdc8b1892df9955d6cf8672c11e2a9d3c948dd 100644 (file)
@@ -303,11 +303,13 @@ enum iwl_bt_force_ant_mode {
 * @LOW_LATENCY_TRAFFIC: indicates low latency traffic was detected
 * @LOW_LATENCY_DEBUGFS: low latency mode set from debugfs
 * @LOW_LATENCY_VCMD: low latency mode set from vendor command
+* @LOW_LATENCY_VIF_TYPE: low latency mode set because of vif type (ap)
 */
 enum iwl_mvm_low_latency_cause {
        LOW_LATENCY_TRAFFIC = BIT(0),
        LOW_LATENCY_DEBUGFS = BIT(1),
        LOW_LATENCY_VCMD = BIT(2),
+       LOW_LATENCY_VIF_TYPE = BIT(3),
 };
 
 /**
@@ -1845,6 +1847,8 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 /* get SystemLowLatencyMode - only needed for beacon threshold? */
 bool iwl_mvm_low_latency(struct iwl_mvm *mvm);
 bool iwl_mvm_low_latency_band(struct iwl_mvm *mvm, enum nl80211_band band);
+void iwl_mvm_send_low_latency_cmd(struct iwl_mvm *mvm, bool low_latency,
+                                 u16 mac_id);
 
 /* get VMACLowLatencyMode */
 static inline bool iwl_mvm_vif_low_latency(struct iwl_mvm_vif *mvmvif)
index 11730d018e20786bc65efc533ed10e3d68c99d72..3fd673128d5171b1cbe7c7f3b4cc4b00b45b39c0 100644 (file)
@@ -764,6 +764,29 @@ bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm)
        return result;
 }
 
+void iwl_mvm_send_low_latency_cmd(struct iwl_mvm *mvm,
+                                 bool low_latency, u16 mac_id)
+{
+       struct iwl_mac_low_latency_cmd cmd = {
+               .mac_id = cpu_to_le32(mac_id)
+       };
+
+       if (!fw_has_capa(&mvm->fw->ucode_capa,
+                        IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA))
+               return;
+
+       if (low_latency) {
+               /* currently we don't care about the direction */
+               cmd.low_latency_rx = 1;
+               cmd.low_latency_tx = 1;
+       }
+
+       if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(LOW_LATENCY_CMD,
+                                                MAC_CONF_GROUP, 0),
+                                0, sizeof(cmd), &cmd))
+               IWL_ERR(mvm, "Failed to send low latency command\n");
+}
+
 int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                               bool low_latency,
                               enum iwl_mvm_low_latency_cause cause)
@@ -782,24 +805,7 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        if (low_latency == prev)
                return 0;
 
-       if (fw_has_capa(&mvm->fw->ucode_capa,
-                       IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA)) {
-               struct iwl_mac_low_latency_cmd cmd = {
-                       .mac_id = cpu_to_le32(mvmvif->id)
-               };
-
-               if (low_latency) {
-                       /* currently we don't care about the direction */
-                       cmd.low_latency_rx = 1;
-                       cmd.low_latency_tx = 1;
-               }
-               res = iwl_mvm_send_cmd_pdu(mvm,
-                                          iwl_cmd_id(LOW_LATENCY_CMD,
-                                                     MAC_CONF_GROUP, 0),
-                                          0, sizeof(cmd), &cmd);
-               if (res)
-                       IWL_ERR(mvm, "Failed to send low latency command\n");
-       }
+       iwl_mvm_send_low_latency_cmd(mvm, low_latency, mvmvif->id);
 
        res = iwl_mvm_update_quotas(mvm, false, NULL);
        if (res)