developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 1 | From 0ae156269553de37eb63d5f138197c1ecc108f49 Mon Sep 17 00:00:00 2001 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 2 | From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 3 | Date: Fri, 17 Mar 2023 16:17:14 +0800 |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 23/45] hostapd: mtk: Add vendor for CAPI certification |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 5 | commands |
| 6 | |
| 7 | --- |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 8 | hostapd/ctrl_iface.c | 97 +++++++++++++++++++++++++++++++ |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 9 | src/ap/ap_drv_ops.c | 21 +++++++ |
| 10 | src/ap/ap_drv_ops.h | 3 + |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 11 | src/common/mtk_vendor.h | 33 +---------- |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 12 | src/drivers/driver.h | 22 +++++++ |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 13 | src/drivers/driver_nl80211.c | 55 ++++++++++++++++++ |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 14 | src/drivers/driver_nl80211.h | 1 + |
| 15 | src/drivers/driver_nl80211_capa.c | 3 + |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 16 | 8 files changed, 204 insertions(+), 31 deletions(-) |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 17 | |
| 18 | diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 19 | index 464fe74..a9333b3 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 20 | --- a/hostapd/ctrl_iface.c |
| 21 | +++ b/hostapd/ctrl_iface.c |
| 22 | @@ -70,6 +70,7 @@ |
| 23 | #include "ctrl_iface.h" |
| 24 | #include "config_file.h" |
| 25 | |
| 26 | +#include "common/mtk_vendor.h" |
| 27 | |
| 28 | #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 |
| 29 | |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 30 | @@ -3837,6 +3838,98 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 31 | return pos - buf; |
| 32 | } |
| 33 | |
| 34 | +static int |
| 35 | +hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd, |
| 36 | + char *buf, size_t buflen) |
| 37 | +{ |
| 38 | + char *pos, *value, *config = cmd; |
| 39 | + enum mtk_vendor_attr_wireless_ctrl sub_cmd; |
| 40 | + |
| 41 | + pos = os_strchr(config, '='); |
| 42 | + if (pos == NULL) |
| 43 | + return -1; |
| 44 | + *pos++ = '\0'; |
| 45 | + |
| 46 | + if(pos == NULL) |
| 47 | + return -1; |
| 48 | + value = pos; |
| 49 | + |
| 50 | + if (os_strncmp(config, "fixed_mcs", 9) == 0) |
| 51 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_MCS; |
| 52 | + else if (os_strncmp(config, "ofdma", 5) == 0) |
| 53 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_OFDMA; |
| 54 | + else if (os_strncmp(config, "ppdu_type", 9) == 0) |
| 55 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE; |
| 56 | + else if (os_strncmp(config, "nusers_ofdma", 12) == 0) |
| 57 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA; |
| 58 | + else if (os_strncmp(config, "add_ba_req_bufsize", 18) == 0) |
| 59 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE; |
| 60 | + else if (os_strncmp(config, "mimo", 4) == 0) |
| 61 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO; |
| 62 | + else if (os_strncmp(config, "cert", 4) == 0) |
| 63 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT ; |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 64 | + else if (os_strncmp(config, "amsdu", 5) == 0) |
| 65 | + sub_cmd = MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU; |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 66 | + else { |
| 67 | + wpa_printf(MSG_ERROR, |
| 68 | + "Unsupported parameter %s for ap_wireless", config); |
| 69 | + return -1; |
| 70 | + } |
| 71 | + |
| 72 | + if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0) |
| 73 | + return -1; |
| 74 | + |
| 75 | + return os_snprintf(buf, buflen, "OK\n"); |
| 76 | +} |
| 77 | + |
| 78 | +static int |
| 79 | +hostapd_ctrl_iface_ap_rfeatures(struct hostapd_data *hapd, char *cmd, |
| 80 | + char *buf, size_t buflen) |
| 81 | +{ |
| 82 | + char *pos, *value, *type, *config = cmd; |
| 83 | + enum mtk_vendor_attr_rfeature_ctrl sub_cmd; |
| 84 | + |
| 85 | + pos = os_strchr(config, '='); |
| 86 | + if (pos == NULL) |
| 87 | + return -1; |
| 88 | + *pos++ = '\0'; |
| 89 | + |
| 90 | + if(pos == NULL) |
| 91 | + return -1; |
| 92 | + value = pos; |
| 93 | + |
| 94 | + if (os_strncmp(config, "he_gi", 5) == 0) |
| 95 | + sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI; |
| 96 | + else if (os_strncmp(config, "he_ltf", 6) == 0) |
| 97 | + sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_LTF; |
| 98 | + else if (os_strncmp(config, "trig_type", 9) == 0) { |
| 99 | + pos = os_strchr(value, ','); |
| 100 | + if (pos == NULL) |
| 101 | + return -1; |
| 102 | + *pos++ = '\0'; |
| 103 | + if(pos == NULL) |
| 104 | + return -1; |
| 105 | + type = pos; |
| 106 | + goto trigtype; |
| 107 | + } else if (os_strcmp(config, "ack_policy") == 0) |
| 108 | + sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY; |
| 109 | + else { |
| 110 | + wpa_printf(MSG_ERROR, |
| 111 | + "Unsupported parameter %s for ap_rfeatures", config); |
| 112 | + return -1; |
| 113 | + } |
| 114 | + |
| 115 | + if (hostapd_drv_ap_rfeatures(hapd, (u8) sub_cmd, atoi(value)) != 0) |
| 116 | + return -1; |
| 117 | + goto exit; |
| 118 | + |
| 119 | +trigtype: |
| 120 | + if (hostapd_drv_ap_trig_type(hapd, atoi(value), atoi(type)) != 0) |
| 121 | + return -1; |
| 122 | + |
| 123 | +exit: |
| 124 | + return os_snprintf(buf, buflen, "OK\n"); |
| 125 | +} |
| 126 | |
| 127 | static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, |
| 128 | char *buf, char *reply, |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 129 | @@ -4417,6 +4510,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 130 | reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size); |
| 131 | } else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) { |
| 132 | reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size); |
| 133 | + } else if (os_strncmp(buf, "ap_wireless ", 12) == 0) { |
| 134 | + reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size); |
| 135 | + } else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) { |
| 136 | + reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size); |
| 137 | } else { |
| 138 | os_memcpy(reply, "UNKNOWN COMMAND\n", 16); |
| 139 | reply_len = 16; |
| 140 | diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 141 | index 9615ca8..11444c7 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 142 | --- a/src/ap/ap_drv_ops.c |
| 143 | +++ b/src/ap/ap_drv_ops.c |
developer | 27057f8 | 2023-07-10 17:23:13 +0800 | [diff] [blame] | 144 | @@ -1222,3 +1222,24 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 145 | return 0; |
| 146 | return hapd->driver->get_aval_color_bmp(hapd->drv_priv, aval_color_bmp); |
| 147 | } |
| 148 | + |
| 149 | +int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value) |
| 150 | +{ |
| 151 | + if (!hapd->driver || !hapd->driver->ap_wireless) |
| 152 | + return 0; |
| 153 | + return hapd->driver->ap_wireless(hapd->drv_priv, sub_vendor_id, value); |
| 154 | +} |
| 155 | + |
| 156 | +int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value) |
| 157 | +{ |
| 158 | + if (!hapd->driver || !hapd->driver->ap_rfeatures) |
| 159 | + return 0; |
| 160 | + return hapd->driver->ap_rfeatures(hapd->drv_priv, sub_vendor_id, value); |
| 161 | +} |
| 162 | + |
| 163 | +int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type) |
| 164 | +{ |
| 165 | + if (!hapd->driver || !hapd->driver->ap_trigtype) |
| 166 | + return 0; |
| 167 | + return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type); |
| 168 | +} |
| 169 | diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 170 | index 136ea23..946ee2d 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 171 | --- a/src/ap/ap_drv_ops.h |
| 172 | +++ b/src/ap/ap_drv_ops.h |
| 173 | @@ -157,6 +157,9 @@ int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd); |
| 174 | int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu); |
| 175 | int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, |
| 176 | u64 *aval_color_bmp); |
| 177 | +int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value); |
| 178 | +int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value); |
| 179 | +int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type); |
| 180 | |
| 181 | #include "drivers/driver.h" |
| 182 | |
| 183 | diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 184 | index e27fe69..0b23c76 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 185 | --- a/src/common/mtk_vendor.h |
| 186 | +++ b/src/common/mtk_vendor.h |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 187 | @@ -50,17 +50,6 @@ enum mtk_vendor_attr_edcca_dump { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 188 | NUM_MTK_VENDOR_ATTRS_EDCCA_DUMP - 1 |
| 189 | }; |
| 190 | |
| 191 | - |
| 192 | -static struct nla_policy edcca_ctrl_policy[NUM_MTK_VENDOR_ATTRS_EDCCA_CTRL] = { |
| 193 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_MODE] = { .type = NLA_U8 }, |
| 194 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_PRI20_VAL] = { .type = NLA_U8 }, |
| 195 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC20_VAL] = { .type = NLA_U8 }, |
| 196 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC40_VAL] = { .type = NLA_U8 }, |
| 197 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC80_VAL] = { .type = NLA_U8 }, |
| 198 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_COMPENSATE] = { .type = NLA_U8 }, |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 199 | - [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC160_VAL] = { .type = NLA_U8 }, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 200 | -}; |
| 201 | - |
| 202 | enum mtk_vendor_attr_3wire_ctrl { |
| 203 | MTK_VENDOR_ATTR_3WIRE_CTRL_UNSPEC, |
| 204 | |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 205 | @@ -72,10 +61,6 @@ enum mtk_vendor_attr_3wire_ctrl { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 206 | NUM_MTK_VENDOR_ATTRS_3WIRE_CTRL - 1 |
| 207 | }; |
| 208 | |
| 209 | -static struct nla_policy three_wire_ctrl_policy[NUM_MTK_VENDOR_ATTRS_3WIRE_CTRL] = { |
| 210 | - [MTK_VENDOR_ATTR_3WIRE_CTRL_MODE] = {.type = NLA_U8 }, |
| 211 | -}; |
| 212 | - |
| 213 | enum mtk_vendor_attr_csi_ctrl { |
| 214 | MTK_VENDOR_ATTR_CSI_CTRL_UNSPEC, |
| 215 | |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 216 | @@ -172,7 +157,7 @@ enum mtk_vendor_attr_wireless_ctrl { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 217 | MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE, |
| 218 | MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO, |
| 219 | MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU, |
| 220 | - MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT, |
| 221 | + MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9, |
| 222 | MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA, |
| 223 | |
| 224 | /* keep last */ |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 225 | @@ -192,11 +177,6 @@ enum mtk_vendor_attr_wireless_dump { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 226 | NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP - 1 |
| 227 | }; |
| 228 | |
| 229 | -static const struct nla_policy |
| 230 | -wireless_dump_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP] = { |
| 231 | - [MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU] = { .type = NLA_U8 }, |
| 232 | -}; |
| 233 | - |
| 234 | enum mtk_vendor_attr_rfeature_ctrl { |
| 235 | MTK_VENDOR_ATTR_RFEATURE_CTRL_UNSPEC, |
| 236 | |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 237 | @@ -206,6 +186,7 @@ enum mtk_vendor_attr_rfeature_ctrl { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 238 | MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN, |
| 239 | MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE, |
| 240 | MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY, |
| 241 | + MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF, |
| 242 | |
| 243 | /* keep last */ |
| 244 | NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL, |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 245 | @@ -247,16 +228,6 @@ enum mtk_vendor_attr_ibf_dump { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 246 | NUM_MTK_VENDOR_ATTRS_IBF_DUMP - 1 |
| 247 | }; |
| 248 | |
| 249 | -static struct nla_policy |
| 250 | -ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = { |
| 251 | - [MTK_VENDOR_ATTR_IBF_CTRL_ENABLE] = { .type = NLA_U8 }, |
| 252 | -}; |
| 253 | - |
| 254 | -static struct nla_policy |
| 255 | -ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = { |
| 256 | - [MTK_VENDOR_ATTR_IBF_DUMP_ENABLE] = { .type = NLA_U8 }, |
| 257 | -}; |
| 258 | - |
| 259 | enum mtk_vendor_attr_bss_color_ctrl { |
| 260 | MTK_VENDOR_ATTR_BSS_COLOR_CTRL_UNSPEC, |
| 261 | |
| 262 | diff --git a/src/drivers/driver.h b/src/drivers/driver.h |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 263 | index 91cb475..3efea9f 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 264 | --- a/src/drivers/driver.h |
| 265 | +++ b/src/drivers/driver.h |
developer | 27057f8 | 2023-07-10 17:23:13 +0800 | [diff] [blame] | 266 | @@ -5141,6 +5141,28 @@ struct wpa_driver_ops { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 267 | * |
| 268 | */ |
| 269 | int (*get_aval_color_bmp)(void *priv, u64 *aval_color_bmp); |
| 270 | + |
| 271 | + /** |
| 272 | + * ap_wireless - set wireless command |
| 273 | + * @priv: Private driver interface data |
| 274 | + * @value: value |
| 275 | + */ |
| 276 | + int (*ap_wireless)(void *priv, u8 mode, int value); |
| 277 | + |
| 278 | + /** |
| 279 | + * ap_rfeatures - set ap rf features command |
| 280 | + * @priv: Private driver interface data |
| 281 | + * @value: value |
| 282 | + */ |
| 283 | + int (*ap_rfeatures)(void *priv, u8 mode, int value); |
| 284 | + |
| 285 | + /** |
| 286 | + * ap_trigtype - set trigger type |
| 287 | + * @priv: Private driver interface data |
| 288 | + * @enable: enable or disable |
| 289 | + * @type: trigger type |
| 290 | + */ |
| 291 | + int (*ap_trigtype)(void *priv, u8 enable, u8 type); |
| 292 | }; |
| 293 | |
| 294 | /** |
| 295 | diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 296 | index b873047..642d75b 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 297 | --- a/src/drivers/driver_nl80211.c |
| 298 | +++ b/src/drivers/driver_nl80211.c |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 299 | @@ -76,6 +76,58 @@ enum nlmsgerr_attrs { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 300 | #endif /* ANDROID */ |
| 301 | |
| 302 | |
| 303 | +static struct nla_policy |
| 304 | +ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = { |
| 305 | + [MTK_VENDOR_ATTR_IBF_CTRL_ENABLE] = { .type = NLA_U8 }, |
| 306 | +}; |
| 307 | + |
| 308 | +static struct nla_policy |
| 309 | +ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = { |
| 310 | + [MTK_VENDOR_ATTR_IBF_DUMP_ENABLE] = { .type = NLA_U8 }, |
| 311 | +}; |
| 312 | + |
| 313 | +static struct nla_policy three_wire_ctrl_policy[NUM_MTK_VENDOR_ATTRS_3WIRE_CTRL] = { |
| 314 | + [MTK_VENDOR_ATTR_3WIRE_CTRL_MODE] = {.type = NLA_U8 }, |
| 315 | +}; |
| 316 | + |
| 317 | +static struct nla_policy edcca_ctrl_policy[NUM_MTK_VENDOR_ATTRS_EDCCA_CTRL] = { |
| 318 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_MODE] = { .type = NLA_U8 }, |
| 319 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_PRI20_VAL] = { .type = NLA_U8 }, |
| 320 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC20_VAL] = { .type = NLA_U8 }, |
| 321 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC40_VAL] = { .type = NLA_U8 }, |
| 322 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC80_VAL] = { .type = NLA_U8 }, |
| 323 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_COMPENSATE] = { .type = NLA_U8 }, |
developer | 5adb5c5 | 2023-06-09 13:30:58 +0800 | [diff] [blame] | 324 | + [MTK_VENDOR_ATTR_EDCCA_CTRL_SEC160_VAL] = { .type = NLA_U8 }, |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 325 | +}; |
| 326 | + |
| 327 | +static const struct nla_policy |
| 328 | +wireless_dump_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP] = { |
| 329 | + [MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU] = { .type = NLA_U8 }, |
| 330 | +}; |
| 331 | + |
| 332 | +static const struct nla_policy |
| 333 | +rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = { |
| 334 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI] = {.type = NLA_U8 }, |
| 335 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_LTF] = { .type = NLA_U8 }, |
| 336 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG] = { .type = NLA_NESTED }, |
| 337 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN] = { .type = NLA_U8 }, |
| 338 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE] = { .type = NLA_U8 }, |
| 339 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY] = { .type = NLA_U8 }, |
| 340 | + [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF] = { .type = NLA_U8 }, |
| 341 | +}; |
| 342 | + |
| 343 | +static const struct nla_policy |
| 344 | +wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = { |
| 345 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_MCS] = {.type = NLA_U8 }, |
| 346 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_FIXED_OFDMA] = {.type = NLA_U8 }, |
| 347 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_PPDU_TX_TYPE] = {.type = NLA_U8 }, |
| 348 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA] = {.type = NLA_U8 }, |
| 349 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO] = {.type = NLA_U8 }, |
| 350 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE] = {.type = NLA_U16 }, |
| 351 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 }, |
| 352 | + [MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 }, |
| 353 | +}; |
| 354 | + |
| 355 | static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg) |
| 356 | { |
| 357 | struct nl_sock *handle; |
developer | 27057f8 | 2023-07-10 17:23:13 +0800 | [diff] [blame] | 358 | @@ -14525,4 +14577,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 359 | .amsdu_ctrl = nl80211_enable_amsdu, |
| 360 | .amsdu_dump = nl80211_dump_amsdu, |
| 361 | .get_aval_color_bmp = nl80211_get_aval_color_bmp, |
| 362 | + .ap_wireless = nl80211_ap_wireless, |
| 363 | + .ap_rfeatures = nl80211_ap_rfeatures, |
| 364 | + .ap_trigtype = nl80211_ap_trigtype, |
| 365 | }; |
| 366 | diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 367 | index fd1e57c..fc5217d 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 368 | --- a/src/drivers/driver_nl80211.h |
| 369 | +++ b/src/drivers/driver_nl80211.h |
developer | 27057f8 | 2023-07-10 17:23:13 +0800 | [diff] [blame] | 370 | @@ -208,6 +208,7 @@ struct wpa_driver_nl80211_data { |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 371 | unsigned int mtk_ibf_vendor_cmd_avail:1; |
| 372 | unsigned int mtk_wireless_vendor_cmd_avail:1; |
| 373 | unsigned int mtk_bss_color_vendor_cmd_avail:1; |
| 374 | + unsigned int mtk_rfeatures_vendor_cmd_avail:1; |
| 375 | |
| 376 | u64 vendor_scan_cookie; |
| 377 | u64 remain_on_chan_cookie; |
| 378 | diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 379 | index 4f8e920..c1cf5b5 100644 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 380 | --- a/src/drivers/driver_nl80211_capa.c |
| 381 | +++ b/src/drivers/driver_nl80211_capa.c |
developer | 27057f8 | 2023-07-10 17:23:13 +0800 | [diff] [blame] | 382 | @@ -1128,6 +1128,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 383 | case MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL : |
| 384 | drv->mtk_bss_color_vendor_cmd_avail = 1; |
| 385 | break; |
| 386 | + case MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL: |
| 387 | + drv->mtk_rfeatures_vendor_cmd_avail = 1; |
| 388 | + break; |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | -- |
developer | 0c138dd | 2023-08-21 10:40:19 +0800 | [diff] [blame^] | 393 | 2.39.0 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 394 | |