Skip to contentSkip to conversation

ath11k: fix some whitespace errors

PATCH In review John Crispin 3 participants 7 messages Apr 16, 2019 – Apr 19, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ath11k: fix some whitespace errors

---
 drivers/net/wireless/ath/ath11k/wmi.h | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.h +19 -19
index 0bd6fe18e6da..056ac06f1eb2 100644
@@ -4088,28 +4088,28 @@ struct wmi_init_country_cmd {
 
 #define MAX_SUPPORTED_RATES 128
 
-#define WMI_PEER_AUTH           0x00000001
-#define WMI_PEER_QOS            0x00000002
-#define WMI_PEER_NEED_PTK_4_WAY 0x00000004
-#define WMI_PEER_NEED_GTK_2_WAY 0x00000010
-#define WMI_PEER_HE             0x00000400
-#define WMI_PEER_APSD           0x00000800
-#define WMI_PEER_HT             0x00001000
-#define WMI_PEER_40MHZ          0x00002000
-#define WMI_PEER_STBC           0x00008000
-#define WMI_PEER_LDPC           0x00010000
-#define WMI_PEER_DYN_MIMOPS     0x00020000
-#define WMI_PEER_STATIC_MIMOPS  0x00040000
-#define WMI_PEER_SPATIAL_MUX    0x00200000
-#define WMI_PEER_VHT            0x02000000
-#define WMI_PEER_80MHZ          0x04000000
-#define WMI_PEER_PMF            0x08000000
+#define WMI_PEER_AUTH		0x00000001
+#define WMI_PEER_QOS		0x00000002
+#define WMI_PEER_NEED_PTK_4_WAY	0x00000004
+#define WMI_PEER_NEED_GTK_2_WAY	0x00000010
+#define WMI_PEER_HE		0x00000400
+#define WMI_PEER_APSD		0x00000800
+#define WMI_PEER_HT		0x00001000
+#define WMI_PEER_40MHZ		0x00002000
+#define WMI_PEER_STBC		0x00008000
+#define WMI_PEER_LDPC		0x00010000
+#define WMI_PEER_DYN_MIMOPS	0x00020000
+#define WMI_PEER_STATIC_MIMOPS	0x00040000
+#define WMI_PEER_SPATIAL_MUX	0x00200000
+#define WMI_PEER_VHT		0x02000000
+#define WMI_PEER_80MHZ		0x04000000
+#define WMI_PEER_PMF		0x08000000
 /* TODO: Place holder for WLAN_PEER_F_PS_PRESEND_REQUIRED = 0x10000000.
  * Need to be cleaned up
  */
-#define WMI_PEER_IS_P2P_CAPABLE 0x20000000
-#define WMI_PEER_160MHZ         0x40000000
-#define WMI_PEER_SAFEMODE_EN    0x80000000
+#define WMI_PEER_IS_P2P_CAPABLE	0x20000000
+#define WMI_PEER_160MHZ		0x40000000
+#define WMI_PEER_SAFEMODE_EN	0x80000000
 
 struct beacon_tmpl_params {
 	u8 vdev_id;
Signature · 7 lines
2.11.0


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw

PATCH 2/2 ath11k: add TWT support

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

---
 drivers/net/wireless/ath/ath11k/mac.c |  2 ++
 drivers/net/wireless/ath/ath11k/wmi.c | 55 +++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/wmi.h | 51 ++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +2 -0
index 6e6e90492b18..aa7603d5aa7f 100644
@@ -3606,6 +3606,8 @@ static int ath11k_start(struct ieee80211_hw *hw)
 
 	__ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);
 
+	ath11k_send_twt_enable_cmd(ar, ar->pdev_idx);
+
 	/* TODO: Do we need to enable ANI? */
 
 	ath11k_reg_update_chan_list(ar);
drivers/net/wireless/ath/ath11k/wmi.c +55 -0

79 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/wmi.h +51 -0

105 lines not on this page · raw message

Signature · 7 lines
2.11.0


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw

Re: [PATCH 2/2] ath11k: add TWT support

Quoted 46 lines · John Crispin

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

---
 drivers/net/wireless/ath/ath11k/mac.c |  2 ++
 drivers/net/wireless/ath/ath11k/wmi.c | 55 
+++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/wmi.h | 51 
++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +2 -0
index 6e6e90492b18..aa7603d5aa7f 100644
@@ -3606,6 +3606,8 @@ static int ath11k_start(struct ieee80211_hw *hw)
 
 	__ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);
 
+	ath11k_send_twt_enable_cmd(ar, ar->pdev_idx);
+
 	/* TODO: Do we need to enable ANI? */
 
 	ath11k_reg_update_chan_list(ar);
drivers/net/wireless/ath/ath11k/wmi.c +4 -0
index 5b5e6b0bb42a..9ba1166d5dac 100644
@@ -1795,6 +1795,10 @@ ath11k_wmi_copy_peer_flags(struct
 wmi_peer_assoc_complete_cmd *cmd,
 			cmd->peer_flags |= WMI_PEER_VHT;
 		if (param->he_flag)
 			cmd->peer_flags |= WMI_PEER_HE;
+		if (param->twt_requester)
+			cmd->peer_flags |= WMI_PEER_TWT_REQ;
+		if (param->twt_responder)
+			cmd->peer_flags |= WMI_PEER_TWT_RESP;
 	}
 

/* Suppress authorization for all AUTH modes that need 4-way
handshake

drivers/net/wireless/ath/ath11k/wmi.c ath11k_wmi_send_init_country_cmd(struct ath11k · line 2688

Quoted 6 lines
drivers/net/wireless/ath/ath11k/wmi.c +2 -0
@@ -2679,6 +2683,52 @@ ath11k_wmi_send_init_country_cmd(struct ath11k 
 *ar,
 	return ret;
 }
 
+int
+ath11k_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id)

Please add ath11k_wmi prefix to the function names defined in wmi.c. It is possible this is not being strictly followed all the places but at some point of time these cases will be fixed.

Quoted 24 lines
drivers/net/wireless/ath/ath11k/wmi.c +24 -0
+{
+	struct ath11k_pdev_wmi *wmi = ar->wmi;
+	struct ath11k_base *ab = wmi->wmi_sc->sc;
+	struct wmi_twt_enable_params_cmd *cmd;
+	struct sk_buff *skb;
+	int ret, len;
+
+	len = sizeof(*cmd);
+
+	skb = ath11k_wmi_alloc_skb(wmi->wmi_sc, len);
+	if (!skb)
+		return -ENOMEM;
+
+	cmd = (void *)skb->data;
+	cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ENABLE_CMD) |
+			  FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE);
+	cmd->pdev_id = pdev_id;
+	cmd->sta_cong_timer_ms = 5000;
+	/* TODO add MBSSID support */
+	cmd->mbss_support = 0;
+	cmd->default_slot_size = 10;
+	cmd->congestion_thresh_setup = 50;
+	cmd->congestion_thresh_teardown = 20;
+	cmd->congestion_thresh_critical = 100;

drivers/net/wireless/ath/ath11k/wmi.c ath11k_wmi_send_init_country_cmd(struct ath11k *ar, · line 2721

Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +10 -0
+	cmd->interference_thresh_teardown = 80;
+	cmd->interference_thresh_setup = 50;
+	cmd->min_no_sta_setup = 10;
+	cmd->min_no_sta_teardown = 2;
+	cmd->no_of_bcast_mcast_slots = 2;
+	cmd->min_no_twt_slots = 2;
+	cmd->max_no_sta_twt = 500;
+	cmd->mode_check_interval = 10000;
+	cmd->add_sta_slot_interval = 1000;
+	cmd->remove_sta_slot_interval = 5000;

At any point do we expect any of these parameters from mac80211? Or these will be just fw/hw specific default values for ever? If the former is true, we can probably let mac to pass these parameters rather than filling it within wmi. Defining macros for all these parameter values will provide more clarity.

Vasanth

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#4 lore raw

Re: [PATCH 2/2] ath11k: add TWT support

In reply to John Crispin
Quoted 3 lines · John Crispin

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

Cool... Are you planning to provide option to disable and enable TWT through hostapd.

Also ath11k may need user interface to add/remove and pause/resume TWT dialog for given peer. no?

-Rajkumar

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#5 lore raw

Re: [PATCH 2/2] ath11k: add TWT support

Quoted 5 lines · Rajkumar Manoharan
Quoted 3 lines · John Crispin

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

Cool... Are you planning to provide option to disable and enable TWT through hostapd.

I think this would be a cfg80211 feature not a hostapd feature, but we can do that.

Quoted 2 lines

Also ath11k may need user interface to add/remove and pause/resume TWT dialog for given peer. no?

I asked this question during our call and was waiting on you to reply whether you consider this a required feature. right now there are QCA vendor specific functions inside hostapd to do this, we could add a foss alternative.

    John

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#3 lore raw

Re: [PATCH 2/2] ath11k: add TWT support

In reply to Vasanthakumar Thiagarajan
Quoted 96 lines · Vasanthakumar Thiagarajan
Quoted 45 lines · John Crispin

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

---
 drivers/net/wireless/ath/ath11k/mac.c |  2 ++
 drivers/net/wireless/ath/ath11k/wmi.c | 55
+++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/wmi.h | 51
++++++++++++++++++++++++++++++++

 3 files changed, 108 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +2 -0
index 6e6e90492b18..aa7603d5aa7f 100644
@@ -3606,6 +3606,8 @@ static int ath11k_start(struct ieee80211_hw *hw)
 
      __ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);
 
+    ath11k_send_twt_enable_cmd(ar, ar->pdev_idx);
+
      /* TODO: Do we need to enable ANI? */
 
      ath11k_reg_update_chan_list(ar);
drivers/net/wireless/ath/ath11k/wmi.c +4 -0
index 5b5e6b0bb42a..9ba1166d5dac 100644
@@ -1795,6 +1795,10 @@ ath11k_wmi_copy_peer_flags(struct
 wmi_peer_assoc_complete_cmd *cmd,
              cmd->peer_flags |= WMI_PEER_VHT;
          if (param->he_flag)
              cmd->peer_flags |= WMI_PEER_HE;
+        if (param->twt_requester)
+            cmd->peer_flags |= WMI_PEER_TWT_REQ;
+        if (param->twt_responder)
+            cmd->peer_flags |= WMI_PEER_TWT_RESP;
      }
 

     /* Suppress authorization for all AUTH modes that need 4-way handshake

drivers/net/wireless/ath/ath11k/wmi.c ath11k_wmi_send_init_country_cmd(struct ath11k · line 2688

Quoted 6 lines
drivers/net/wireless/ath/ath11k/wmi.c +2 -0
@@ -2679,6 +2683,52 @@ ath11k_wmi_send_init_country_cmd(struct ath11k 
 *ar,
      return ret;
  }
 
+int
+ath11k_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id)

Please add ath11k_wmi prefix to the function names defined in wmi.c. It is possible this is not being strictly followed all the places but at some point of time these cases will be fixed.

Quoted 24 lines
drivers/net/wireless/ath/ath11k/wmi.c +24 -0
+{
+    struct ath11k_pdev_wmi *wmi = ar->wmi;
+    struct ath11k_base *ab = wmi->wmi_sc->sc;
+    struct wmi_twt_enable_params_cmd *cmd;
+    struct sk_buff *skb;
+    int ret, len;
+
+    len = sizeof(*cmd);
+
+    skb = ath11k_wmi_alloc_skb(wmi->wmi_sc, len);
+    if (!skb)
+        return -ENOMEM;
+
+    cmd = (void *)skb->data;
+    cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ENABLE_CMD) |
+              FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE);
+    cmd->pdev_id = pdev_id;
+    cmd->sta_cong_timer_ms = 5000;
+    /* TODO add MBSSID support */
+    cmd->mbss_support = 0;
+    cmd->default_slot_size = 10;
+    cmd->congestion_thresh_setup = 50;
+    cmd->congestion_thresh_teardown = 20;
+    cmd->congestion_thresh_critical = 100;

drivers/net/wireless/ath/ath11k/wmi.c ath11k_wmi_send_init_country_cmd(struct ath11k *ar, · line 2721

Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.c +10 -0
+    cmd->interference_thresh_teardown = 80;
+    cmd->interference_thresh_setup = 50;
+    cmd->min_no_sta_setup = 10;
+    cmd->min_no_sta_teardown = 2;
+    cmd->no_of_bcast_mcast_slots = 2;
+    cmd->min_no_twt_slots = 2;
+    cmd->max_no_sta_twt = 500;
+    cmd->mode_check_interval = 10000;
+    cmd->add_sta_slot_interval = 1000;
+    cmd->remove_sta_slot_interval = 5000;

At any point do we expect any of these parameters from mac80211? Or these will be just fw/hw specific default values for ever? If the former is true, we can probably let mac to pass these parameters rather than filling it within wmi. Defining macros for all these parameter values will provide more clarity.

Quoted 2 lines

Vasanth

I am not sure what functional gain we would egt from using macros here. These values are the same defaults used by qsdk10. They are not generic so it might be hard to expose them via a common API. Maybe Kalle can chip in how he would like these values to be sent to the driver from userland.

    John

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#6 lore raw

Re: [PATCH 2/2] ath11k: add TWT support

In reply to John Crispin
Quoted 10 lines · John Crispin
Quoted 5 lines · Rajkumar Manoharan
Quoted 3 lines · John Crispin

Add target wait time wmi calls to the driver. Enable the support inside the FW by default.

Cool... Are you planning to provide option to disable and enable TWT through hostapd.

I think this would be a cfg80211 feature not a hostapd feature, but we can do that.

Hmm.. I was referring he_twt_required option in hostapd. I see that it used for HE operation. Either the same option can be used to enable/disable this feature in firmware or we may add new config in start_ap().

-Rajkumar

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k