All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ath11k: fix some whitespace errors
@ 2019-04-16 19:08 John Crispin
  2019-04-16 19:08 ` [PATCH 2/2] ath11k: add TWT support John Crispin
  0 siblings, 1 reply; 7+ messages in thread
From: John Crispin @ 2019-04-16 19:08 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Shashidhar Lakkavalli, ath11k, John Crispin

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/wmi.h | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index 0bd6fe18e6da..056ac06f1eb2 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -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;
-- 
2.11.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ath11k: add TWT support
  2019-04-16 19:08 [PATCH 1/2] ath11k: fix some whitespace errors John Crispin
@ 2019-04-16 19:08 ` John Crispin
  2019-04-17  4:08   ` Vasanthakumar Thiagarajan
  2019-04-17  9:14   ` Rajkumar Manoharan
  0 siblings, 2 replies; 7+ messages in thread
From: John Crispin @ 2019-04-16 19:08 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Shashidhar Lakkavalli, ath11k, John Crispin

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

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 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(+)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 6e6e90492b18..aa7603d5aa7f 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -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);
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 5b5e6b0bb42a..9ba1166d5dac 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -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
@@ -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)
+{
+	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;
+	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;
+
+	ret = ath11k_wmi_cmd_send(wmi, skb,
+				  WMI_TWT_ENABLE_CMDID);
+	if (ret) {
+		ath11k_warn(ab, "Failed to send WMI_TWT_ENABLE_CMDID");
+		dev_kfree_skb(skb);
+	}
+	return ret;
+}
+
 static inline void ath11k_fill_band_to_mac_param(struct ath11k_base  *soc,
 				struct wmi_host_pdev_band_to_mac *band_to_mac)
 {
@@ -2769,6 +2819,9 @@ ath11k_wmi_copy_resource_config(struct wmi_resource_config *wmi_cfg,
 	wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id;
 	wmi_cfg->flag1 = tg_cfg->atf_config;
 	wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support;
+	wmi_cfg->sched_params = tg_cfg->sched_params;
+	wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count;
+	wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count;
 }
 
 static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
@@ -2960,6 +3013,8 @@ int ath11k_wmi_cmd_init(struct ath11k_base *sc)
 	config.beacon_tx_offload_max_vdev = sc->num_radios * TARGET_MAX_BCN_OFFLD;
 	config.rx_batchmode = TARGET_RX_BATCHMODE;
 	config.peer_map_unmap_v2_support = 1;
+	config.twt_ap_pdev_count = 2;
+	config.twt_ap_sta_count = 1000;
 
 	memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config));
 
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index 056ac06f1eb2..6b3b9ccee8fe 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -169,6 +169,10 @@ enum wmi_cmd_group {
 	WMI_GRP_MONITOR,        /* 0x39 */
 	WMI_GRP_REGULATORY,     /* 0x3a */
 	WMI_GRP_HW_DATA_FILTER, /* 0x3b */
+	WMI_GRP_WLM,            /* 0x3c */
+	WMI_GRP_11K_OFFLOAD,    /* 0x3d */
+	WMI_GRP_TWT,            /* 0x3e */
+
 };
 
 #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
@@ -530,6 +534,12 @@ enum wmi_tlv_cmd_id {
 	WMI_NDP_RESPONDER_REQ_CMDID,
 	WMI_NDP_END_REQ_CMDID,
 	WMI_HW_DATA_FILTER_CMDID = WMI_TLV_CMD(WMI_GRP_HW_DATA_FILTER),
+	WMI_TWT_ENABLE_CMDID = WMI_TLV_CMD(WMI_GRP_TWT),
+	WMI_TWT_DISABLE_CMDID,
+	WMI_TWT_ADD_DIALOG_CMDID,
+	WMI_TWT_DEL_DIALOG_CMDID,
+	WMI_TWT_PAUSE_DIALOG_CMDID,
+	WMI_TWT_RESUME_DIALOG_CMDID,
 };
 
 enum wmi_tlv_event_id {
@@ -712,6 +722,13 @@ enum wmi_tlv_event_id {
 	WMI_NDP_INDICATION_EVENTID,
 	WMI_NDP_CONFIRM_EVENTID,
 	WMI_NDP_END_INDICATION_EVENTID,
+
+	WMI_TWT_ENABLE_EVENTID = WMI_TLV_CMD(WMI_GRP_TWT),
+	WMI_TWT_DISABLE_EVENTID,
+	WMI_TWT_ADD_DIALOG_EVENTID,
+	WMI_TWT_DEL_DIALOG_EVENTID,
+	WMI_TWT_PAUSE_DIALOG_EVENTID,
+	WMI_TWT_RESUME_DIALOG_EVENTID,
 };
 
 enum wmi_tlv_pdev_param {
@@ -2732,6 +2749,9 @@ struct wmi_resource_config {
 	u32 max_num_dbs_scan_duty_cycle;
 	u32 max_num_group_keys;
 	u32 peer_map_unmap_v2_support;
+	u32 sched_params;
+	u32 twt_ap_pdev_count;
+	u32 twt_ap_sta_count;
 } __packed;
 
 struct wmi_service_ready_event {
@@ -3903,6 +3923,8 @@ struct peer_assoc_params {
 	u32 peer_he_mcs_count;
 	u32 peer_he_rx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
 	u32 peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
+	bool twt_responder;
+	bool twt_requester;
 	struct ath11k_ppe_threshold peer_ppet;
 };
 
@@ -4101,6 +4123,8 @@ struct wmi_init_country_cmd {
 #define WMI_PEER_DYN_MIMOPS	0x00020000
 #define WMI_PEER_STATIC_MIMOPS	0x00040000
 #define WMI_PEER_SPATIAL_MUX	0x00200000
+#define WMI_PEER_TWT_REQ	0x00400000
+#define WMI_PEER_TWT_RESP	0x00800000
 #define WMI_PEER_VHT		0x02000000
 #define WMI_PEER_80MHZ		0x04000000
 #define WMI_PEER_PMF		0x08000000
@@ -4976,6 +5000,27 @@ struct wmi_wmm_params_all_arg {
 	struct wmi_wmm_params_arg ac_vo;
 };
 
+struct wmi_twt_enable_params_cmd {
+	u32 tlv_header;
+	u32 pdev_id;
+	u32 sta_cong_timer_ms;
+	u32 mbss_support;
+	u32 default_slot_size;
+	u32 congestion_thresh_setup;
+	u32 congestion_thresh_teardown;
+	u32 congestion_thresh_critical;
+	u32 interference_thresh_teardown;
+	u32 interference_thresh_setup;
+	u32 min_no_sta_setup;
+	u32 min_no_sta_teardown;
+	u32 no_of_bcast_mcast_slots;
+	u32 min_no_twt_slots;
+	u32 max_no_sta_twt;
+	u32 mode_check_interval;
+	u32 add_sta_slot_interval;
+	u32 remove_sta_slot_interval;
+};
+
 struct target_resource_config {
 	u32 num_vdevs;
 	u32 num_peers;
@@ -5036,6 +5081,9 @@ struct target_resource_config {
 	u32 max_bssid_rx_filters;
 	u32 use_pdev_id;
 	u32 peer_map_unmap_v2_support;
+	u32 sched_params;
+	u32 twt_ap_pdev_count;
+	u32 twt_ap_sta_count;
 };
 
 #define WMI_MAX_MEM_REQS 32
@@ -5145,6 +5193,9 @@ int ath11k_wmi_send_bcn_offload_control_cmd(struct ath11k *ar,
 int
 ath11k_wmi_send_init_country_cmd(struct ath11k *ar,
 				 struct wmi_init_country_params init_cc_param);
+
+int ath11k_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id);
+
 int
 ath11k_wmi_rx_reord_queue_remove(struct ath11k *ar,
 				 struct rx_reorder_queue_remove_params *param);
-- 
2.11.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath11k: add TWT support
  2019-04-16 19:08 ` [PATCH 2/2] ath11k: add TWT support John Crispin
@ 2019-04-17  4:08   ` Vasanthakumar Thiagarajan
  2019-04-17  9:44     ` John Crispin
  2019-04-17  9:14   ` Rajkumar Manoharan
  1 sibling, 1 reply; 7+ messages in thread
From: Vasanthakumar Thiagarajan @ 2019-04-17  4:08 UTC (permalink / raw)
  To: John Crispin; +Cc: ath11k, Kalle Valo, Shashidhar Lakkavalli

On 2019-04-17 00:38, John Crispin wrote:
> Add target wait time wmi calls to the driver. Enable the support inside
> the FW by default.
> 
> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
> Signed-off-by: John Crispin <john@phrozen.org>
> ---
>  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(+)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c
> b/drivers/net/wireless/ath/ath11k/mac.c
> index 6e6e90492b18..aa7603d5aa7f 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -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);
> diff --git a/drivers/net/wireless/ath/ath11k/wmi.c
> b/drivers/net/wireless/ath/ath11k/wmi.c
> index 5b5e6b0bb42a..9ba1166d5dac 100644
> --- a/drivers/net/wireless/ath/ath11k/wmi.c
> +++ b/drivers/net/wireless/ath/ath11k/wmi.c
> @@ -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
> @@ -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.

> +{
> +	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;
> +	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
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath11k: add TWT support
  2019-04-16 19:08 ` [PATCH 2/2] ath11k: add TWT support John Crispin
  2019-04-17  4:08   ` Vasanthakumar Thiagarajan
@ 2019-04-17  9:14   ` Rajkumar Manoharan
  2019-04-17  9:36     ` John Crispin
  1 sibling, 1 reply; 7+ messages in thread
From: Rajkumar Manoharan @ 2019-04-17  9:14 UTC (permalink / raw)
  To: John Crispin; +Cc: ath11k, Kalle Valo, Shashidhar Lakkavalli

On 2019-04-16 12:08, John Crispin wrote:
> 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
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath11k: add TWT support
  2019-04-17  9:14   ` Rajkumar Manoharan
@ 2019-04-17  9:36     ` John Crispin
  2019-04-19  0:30       ` Rajkumar Manoharan
  0 siblings, 1 reply; 7+ messages in thread
From: John Crispin @ 2019-04-17  9:36 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: ath11k, Kalle Valo, Shashidhar Lakkavalli


On 17/04/2019 11:14, Rajkumar Manoharan wrote:
> On 2019-04-16 12:08, John Crispin wrote:
>> 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.


> 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
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath11k: add TWT support
  2019-04-17  4:08   ` Vasanthakumar Thiagarajan
@ 2019-04-17  9:44     ` John Crispin
  0 siblings, 0 replies; 7+ messages in thread
From: John Crispin @ 2019-04-17  9:44 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: ath11k, Kalle Valo, Shashidhar Lakkavalli


On 17/04/2019 06:08, Vasanthakumar Thiagarajan wrote:
> On 2019-04-17 00:38, John Crispin wrote:
>> Add target wait time wmi calls to the driver. Enable the support inside
>> the FW by default.
>>
>> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
>> Signed-off-by: John Crispin <john@phrozen.org>
>> ---
>>  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(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/mac.c
>> b/drivers/net/wireless/ath/ath11k/mac.c
>> index 6e6e90492b18..aa7603d5aa7f 100644
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -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);
>> diff --git a/drivers/net/wireless/ath/ath11k/wmi.c
>> b/drivers/net/wireless/ath/ath11k/wmi.c
>> index 5b5e6b0bb42a..9ba1166d5dac 100644
>> --- a/drivers/net/wireless/ath/ath11k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath11k/wmi.c
>> @@ -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
>> @@ -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.
>
>> +{
>> +    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;
>> +    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
>
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
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath11k: add TWT support
  2019-04-17  9:36     ` John Crispin
@ 2019-04-19  0:30       ` Rajkumar Manoharan
  0 siblings, 0 replies; 7+ messages in thread
From: Rajkumar Manoharan @ 2019-04-19  0:30 UTC (permalink / raw)
  To: John Crispin; +Cc: ath11k, Kalle Valo, Shashidhar Lakkavalli

On 2019-04-17 02:36, John Crispin wrote:
> On 17/04/2019 11:14, Rajkumar Manoharan wrote:
>> On 2019-04-16 12:08, John Crispin wrote:
>>> 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
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-19  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 19:08 [PATCH 1/2] ath11k: fix some whitespace errors John Crispin
2019-04-16 19:08 ` [PATCH 2/2] ath11k: add TWT support John Crispin
2019-04-17  4:08   ` Vasanthakumar Thiagarajan
2019-04-17  9:44     ` John Crispin
2019-04-17  9:14   ` Rajkumar Manoharan
2019-04-17  9:36     ` John Crispin
2019-04-19  0:30       ` Rajkumar Manoharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.