qtnfmac: add support for TWT responder and spatial reuse
authorMikhail Karpenko <mkarpenko@quantenna.com>
Thu, 9 Jan 2020 13:17:55 +0000 (16:17 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 26 Jan 2020 15:44:02 +0000 (17:44 +0200)
Add support for 11ax features: TWT responder and spatial reuse.
Add separate structure for spatial reuse parameters and pass this
structure to firmware along with other parameters in start_ap
command. Pass TWT responder value to firmware. Bump qlink
protocol version.

Signed-off-by: Mikhail Karpenko <mkarpenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/commands.c
drivers/net/wireless/quantenna/qtnfmac/qlink.h

index fa932f7718560bbe9249d9128d7e511d295a713d..d0d7ec8794c455b556ce3f1a01e38c71dd67b442 100644 (file)
@@ -257,6 +257,14 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif,
        cmd->pbss = s->pbss;
        cmd->ht_required = s->ht_required;
        cmd->vht_required = s->vht_required;
+       cmd->twt_responder = s->twt_responder;
+       if (s->he_obss_pd.enable) {
+               cmd->sr_params.sr_control |= QLINK_SR_SRG_INFORMATION_PRESENT;
+               cmd->sr_params.srg_obss_pd_min_offset =
+                       s->he_obss_pd.min_offset;
+               cmd->sr_params.srg_obss_pd_max_offset =
+                       s->he_obss_pd.max_offset;
+       }
 
        aen = &cmd->aen;
        aen->auth_type = s->auth_type;
index 19e432b28de5f26d10b069a91bd04a6908e3ef42..b2edb03819d179d81f35185c375559e79eb3c155 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <linux/ieee80211.h>
 
-#define QLINK_PROTO_VER                15
+#define QLINK_PROTO_VER                16
 
 #define QLINK_MACID_RSVD               0xFF
 #define QLINK_VIFID_RSVD               0xFF
@@ -196,6 +196,45 @@ struct qlink_sta_info_state {
        __le32 value;
 } __packed;
 
+/**
+ * enum qlink_sr_ctrl_flags - control flags for spatial reuse parameter set
+ *
+ * @QLINK_SR_PSR_DISALLOWED: indicates whether or not PSR-based spatial reuse
+ * transmissions are allowed for STAs associated with the AP
+ * @QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED: indicates whether or not
+ * Non-SRG OBSS PD spatial reuse transmissions are allowed for STAs associated
+ * with the AP
+ * @NON_SRG_OFFSET_PRESENT: indicates whether or not Non-SRG OBSS PD Max offset
+ * field is valid in the element
+ * @QLINK_SR_SRG_INFORMATION_PRESENT: indicates whether or not SRG OBSS PD
+ * Min/Max offset fields ore valid in the element
+ */
+enum qlink_sr_ctrl_flags {
+       QLINK_SR_PSR_DISALLOWED                = BIT(0),
+       QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED = BIT(1),
+       QLINK_SR_NON_SRG_OFFSET_PRESENT        = BIT(2),
+       QLINK_SR_SRG_INFORMATION_PRESENT       = BIT(3),
+};
+
+/**
+ * struct qlink_sr_params - spatial reuse parameters
+ *
+ * @sr_control: spatial reuse control field; flags contained in this field are
+ * defined in @qlink_sr_ctrl_flags
+ * @non_srg_obss_pd_max: added to -82 dBm to generate the value of the
+ * Non-SRG OBSS PD Max parameter
+ * @srg_obss_pd_min_offset: added to -82 dBm to generate the value of the
+ * SRG OBSS PD Min parameter
+ * @srg_obss_pd_max_offset: added to -82 dBm to generate the value of the
+ * SRG PBSS PD Max parameter
+ */
+struct qlink_sr_params {
+       u8 sr_control;
+       u8 non_srg_obss_pd_max;
+       u8 srg_obss_pd_min_offset;
+       u8 srg_obss_pd_max_offset;
+} __packed;
+
 /* QLINK Command messages related definitions
  */
 
@@ -651,6 +690,8 @@ enum qlink_hidden_ssid {
  * @ht_required: stations must support HT
  * @vht_required: stations must support VHT
  * @aen: encryption info
+ * @sr_params: spatial reuse parameters
+ * @twt_responder: enable Target Wake Time
  * @info: variable configurations
  */
 struct qlink_cmd_start_ap {
@@ -666,6 +707,9 @@ struct qlink_cmd_start_ap {
        u8 ht_required;
        u8 vht_required;
        struct qlink_auth_encr aen;
+       struct qlink_sr_params sr_params;
+       u8 twt_responder;
+       u8 rsvd[3];
        u8 info[0];
 } __packed;