[][MAC80211][misc][remove hostapd/mt76 iBF patch temporarily]
[Description]
Remove patches to fix build fail.
[Release-log]
N/A
Change-Id: I16270426335a3c2ac7e4b5241583683512bbaef4
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6485358
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-add-ibf-control-vendor-cmd.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-add-ibf-control-vendor-cmd.patch
deleted file mode 100644
index 807d35d..0000000
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-add-ibf-control-vendor-cmd.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 74544c474f70e1998043b79e8f15db6a05894bcd Mon Sep 17 00:00:00 2001
-From: mtk27835 <shurong.wen@mediatek.com>
-Date: Thu, 25 Aug 2022 14:25:51 -0700
-Subject: [PATCH] [PATCH 1122] mt76: add ibf control vendor cmd
-
-Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
----
- mt7915/vendor.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++
- mt7915/vendor.h | 23 +++++++++++++++++
- 2 files changed, 92 insertions(+)
-
-diff --git a/mt7915/vendor.c b/mt7915/vendor.c
-index 7acb330..745266f 100644
---- a/mt7915/vendor.c
-+++ b/mt7915/vendor.c
-@@ -73,6 +73,16 @@ edcca_ctrl_policy[NUM_MTK_VENDOR_ATTRS_EDCCA_CTRL] = {
- [MTK_VENDOR_ATTR_EDCCA_CTRL_COMPENSATE] = { .type = NLA_S8 },
- };
-
-+static const struct nla_policy
-+ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = {
-+ [MTK_VENDOR_ATTR_IBF_CTRL_ENABLE] = { .type = NLA_U8 },
-+};
-+
-+static struct nla_policy
-+ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = {
-+ [MTK_VENDOR_ATTR_IBF_DUMP_ENABLE] = { .type = NLA_U8 },
-+};
-+
-
- struct csi_null_tone {
- u8 start;
-@@ -1091,6 +1101,53 @@ static int mt7915_vendor_edcca_ctrl(struct wiphy *wiphy,
- return 0;
- }
-
-+static int mt7915_vendor_ibf_ctrl(struct wiphy *wiphy,
-+ struct wireless_dev *wdev,
-+ const void *data,
-+ int data_len)
-+{
-+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
-+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
-+ struct mt7915_dev *dev = phy->dev;
-+ struct nlattr *tb[NUM_MTK_VENDOR_ATTRS_IBF_CTRL];
-+ int err;
-+ u8 val;
-+
-+ err = nla_parse(tb, MTK_VENDOR_ATTR_IBF_CTRL_MAX, data, data_len,
-+ ibf_ctrl_policy, NULL);
-+ if (err)
-+ return err;
-+
-+ if (tb[MTK_VENDOR_ATTR_IBF_CTRL_ENABLE]) {
-+ val = nla_get_u8(tb[MTK_VENDOR_ATTR_IBF_CTRL_ENABLE]);
-+
-+ dev->ibf = !!val;
-+
-+ err = mt7915_mcu_set_txbf(dev, MT_BF_TYPE_UPDATE);
-+ if (err)
-+ return err;
-+ }
-+ return 0;
-+}
-+
-+static int
-+mt7915_vendor_ibf_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
-+ struct sk_buff *skb, const void *data, int data_len,
-+ unsigned long *storage)
-+{
-+ struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
-+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
-+ struct mt7915_dev *dev = phy->dev;
-+
-+ if (*storage == 1)
-+ return -ENOENT;
-+ *storage = 1;
-+
-+ if (nla_put_u8(skb, MTK_VENDOR_ATTR_IBF_DUMP_ENABLE, dev->ibf))
-+ return -ENOMEM;
-+
-+ return 1;
-+}
-
- static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
- {
-@@ -1172,6 +1229,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
- .doit = mt7915_vendor_edcca_ctrl,
- .policy = edcca_ctrl_policy,
- .maxattr = MTK_VENDOR_ATTR_EDCCA_CTRL_MAX,
-+ },
-+ {
-+ .info = {
-+ .vendor_id = MTK_NL80211_VENDOR_ID,
-+ .subcmd = MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL,
-+ },
-+ .flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
-+ WIPHY_VENDOR_CMD_NEED_RUNNING,
-+ .doit = mt7915_vendor_ibf_ctrl,
-+ .dumpit = mt7915_vendor_ibf_ctrl_dump,
-+ .policy = ibf_ctrl_policy,
-+ .maxattr = MTK_VENDOR_ATTR_IBF_CTRL_MAX,
- }
- };
-
-diff --git a/mt7915/vendor.h b/mt7915/vendor.h
-index 57f52f3..2a7e23b 100644
---- a/mt7915/vendor.h
-+++ b/mt7915/vendor.h
-@@ -11,6 +11,7 @@ enum mtk_nl80211_vendor_subcmds {
- MTK_NL80211_VENDOR_SUBCMD_HEMU_CTRL = 0xc5,
- MTK_NL80211_VENDOR_SUBCMD_PHY_CAPA_CTRL = 0xc6,
- MTK_NL80211_VENDOR_SUBCMD_EDCCA_CTRL = 0xc7,
-+ MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL = 0xc8,
- };
-
-
-@@ -194,4 +195,26 @@ enum mtk_vendor_attr_phy_capa_dump {
- NUM_MTK_VENDOR_ATTRS_PHY_CAPA_DUMP - 1
- };
-
-+enum mtk_vendor_attr_ibf_ctrl {
-+ MTK_VENDOR_ATTR_IBF_CTRL_UNSPEC,
-+
-+ MTK_VENDOR_ATTR_IBF_CTRL_ENABLE,
-+
-+ /* keep last */
-+ NUM_MTK_VENDOR_ATTRS_IBF_CTRL,
-+ MTK_VENDOR_ATTR_IBF_CTRL_MAX =
-+ NUM_MTK_VENDOR_ATTRS_IBF_CTRL - 1
-+};
-+
-+enum mtk_vendor_attr_ibf_dump {
-+ MTK_VENDOR_ATTR_IBF_DUMP_UNSPEC,
-+
-+ MTK_VENDOR_ATTR_IBF_DUMP_ENABLE,
-+
-+ /* keep last */
-+ NUM_MTK_VENDOR_ATTRS_IBF_DUMP,
-+ MTK_VENDOR_ATTR_IBF_DUMP_MAX =
-+ NUM_MTK_VENDOR_ATTRS_IBF_DUMP - 1
-+};
-+
- #endif
---
-2.32.0
-
diff --git a/autobuild_mac80211_release/package/network/services/hostapd/patches/921-Add-hostapd-iBF-control.patch b/autobuild_mac80211_release/package/network/services/hostapd/patches/921-Add-hostapd-iBF-control.patch
deleted file mode 100755
index 183a48e..0000000
--- a/autobuild_mac80211_release/package/network/services/hostapd/patches/921-Add-hostapd-iBF-control.patch
+++ /dev/null
@@ -1,431 +0,0 @@
-From 0dfe074b2d59a6807cf5061b643eeece059ab9b8 Mon Sep 17 00:00:00 2001
-From: mtk27835 <shurong.wen@mediatek.com>
-Date: Wed, 24 Aug 2022 21:09:19 -0700
-Subject: [PATCH] [PATCH-921] Add hostapd iBF control
-
-Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
----
- hostapd/config_file.c | 3 +
- hostapd/ctrl_iface.c | 26 +++++
- hostapd/hostapd_cli.c | 9 ++
- src/ap/ap_config.c | 2 +
- src/ap/ap_config.h | 3 +
- src/ap/ap_drv_ops.c | 14 +++
- src/ap/ap_drv_ops.h | 2 +
- src/ap/hostapd.c | 2 +
- src/common/mtk_vendor.h | 33 ++++++
- src/drivers/driver.h | 19 +++
- src/drivers/driver_nl80211.c | 108 ++++++++++++++++++
- src/drivers/driver_nl80211.h | 1 +
- src/drivers/driver_nl80211_capa.c | 3 +
- 13 files changed, 225 insertions(+)
-
-diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 85d58cd..17a73ff 100644
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -4770,6 +4770,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- return 1;
- }
- conf->edcca_compensation = (s8) val;
-+ } else if (os_strcmp(buf, "ibf_enable") == 0) { /*ibf setting is per device*/
-+ int val = atoi(pos);
-+ conf->ibf_enable = !!val;
- } else {
- wpa_printf(MSG_ERROR,
- "Line %d: unknown configuration item '%s'",
-diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 5df5c84..75bf6e6 100644
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -3456,6 +3456,30 @@ hostapd_ctrl_iface_get_hemu(struct hostapd_data *hapd, char *buf,
- }
-
-
-+static int
-+hostapd_ctrl_iface_get_ibf(struct hostapd_data *hapd, char *buf,
-+ size_t buflen)
-+{
-+ u8 ibf_enable;
-+ int ret;
-+ char *pos, *end;
-+
-+ pos = buf;
-+ end = buf + buflen;
-+
-+ if (hostapd_drv_ibf_dump(hapd, &ibf_enable) == 0) {
-+ hapd->iconf->ibf_enable = ibf_enable;
-+ ret = os_snprintf(pos, end - pos, "ibf_enable: %u\n",
-+ ibf_enable);
-+ }
-+
-+ if (os_snprintf_error(end - pos, ret))
-+ return 0;
-+
-+ return ret;
-+}
-+
-+
- static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- char *buf, char *reply,
- int reply_size,
-@@ -4001,6 +4025,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- reply_size);
- } else if (os_strncmp(buf, "GET_HEMU", 8) == 0) {
- reply_len = hostapd_ctrl_iface_get_hemu(hapd, reply, reply_size);
-+ } else if (os_strncmp(buf, "GET_IBF", 7) == 0) {
-+ reply_len = hostapd_ctrl_iface_get_ibf(hapd, reply, reply_size);
- } else {
- os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
- reply_len = 16;
-diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 41d244a..e98a0a4 100644
---- a/hostapd/hostapd_cli.c
-+++ b/hostapd/hostapd_cli.c
-@@ -1577,6 +1577,13 @@ static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
- #endif /* ANDROID */
-
-
-+static int hostapd_cli_cmd_get_ibf(struct wpa_ctrl *ctrl, int argc,
-+ char *argv[])
-+{
-+ return hostapd_cli_cmd(ctrl, "GET_IBF", 0, NULL, NULL);
-+}
-+
-+
- struct hostapd_cli_cmd {
- const char *cmd;
- int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
-@@ -1774,6 +1781,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
- #endif /* ANDROID */
- { "inband_discovery", hostapd_cli_cmd_inband_discovery, NULL,
- "<tx type(0/1/2)> <interval> = runtime set inband discovery" },
-+ { "get_ibf", hostapd_cli_cmd_get_ibf, NULL,
-+ " = show iBF state (enabled/disabled)"},
- { NULL, NULL, NULL, NULL }
- };
-
-diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 79e215f..cb1f79e 100644
---- a/src/ap/ap_config.c
-+++ b/src/ap/ap_config.c
-@@ -298,6 +298,8 @@ struct hostapd_config * hostapd_config_defaults(void)
- conf->edcca_enable = EDCCA_MODE_AUTO;
- conf->edcca_compensation = EDCCA_DEFAULT_COMPENSATION;
-
-+ conf->ibf_enable = IBF_DEFAULT_ENABLE;
-+
- return conf;
- }
-
-diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 737cc2f..7bbc106 100644
---- a/src/ap/ap_config.h
-+++ b/src/ap/ap_config.h
-@@ -1153,6 +1153,8 @@ struct hostapd_config {
- unsigned int ch_switch_eht_config;
- u8 edcca_enable;
- s8 edcca_compensation;
-+
-+ u8 ibf_enable;
- };
-
- enum edcca_mode {
-@@ -1163,6 +1165,7 @@ enum edcca_mode {
- #define EDCCA_DEFAULT_COMPENSATION -6
- #define EDCCA_MIN_COMPENSATION -126
- #define EDCCA_MAX_COMPENSATION 126
-+#define IBF_DEFAULT_ENABLE 0
-
- static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf)
- {
-diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 3de6748..9617e68 100644
---- a/src/ap/ap_drv_ops.c
-+++ b/src/ap/ap_drv_ops.c
-@@ -1035,3 +1035,17 @@ int hostapd_drv_hemu_dump(struct hostapd_data *hapd, u8 *hemu_onoff)
- return 0;
- return hapd->driver->hemu_dump(hapd->drv_priv, hemu_onoff);
- }
-+
-+int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd)
-+{
-+ if (!hapd->driver || !hapd->driver->ibf_ctrl)
-+ return 0;
-+ return hapd->driver->ibf_ctrl(hapd->drv_priv, hapd->iconf->ibf_enable);
-+}
-+
-+int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable)
-+{
-+ if (!hapd->driver || !hapd->driver->ibf_dump)
-+ return 0;
-+ return hapd->driver->ibf_dump(hapd->drv_priv, ibf_enable);
-+}
-\ No newline at end of file
-diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 5bcb225..8377616 100644
---- a/src/ap/ap_drv_ops.h
-+++ b/src/ap/ap_drv_ops.h
-@@ -141,6 +141,8 @@ int hostapd_drv_dpp_listen(struct hostapd_data *hapd, bool enable);
- int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd);
- int hostapd_drv_hemu_ctrl(struct hostapd_data *hapd);
- int hostapd_drv_hemu_dump(struct hostapd_data *hapd, u8 *hemu_onoff);
-+int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
-+int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable);
-
- #include "drivers/driver.h"
-
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 3b752fc..c22e885 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -2299,6 +2299,8 @@ dfs_offload:
- goto fail;
- if (hostapd_drv_hemu_ctrl(hapd) < 0)
- goto fail;
-+ if (hostapd_drv_ibf_ctrl(hapd) < 0)
-+ goto fail;
-
- wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
- iface->bss[0]->conf->iface);
-diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 5c8f179..6f8efb2 100644
---- a/src/common/mtk_vendor.h
-+++ b/src/common/mtk_vendor.h
-@@ -13,6 +13,7 @@ enum mtk_nl80211_vendor_subcmds {
- MTK_NL80211_VENDOR_SUBCMD_HEMU_CTRL = 0xc5,
- MTK_NL80211_VENDOR_SUBCMD_PHY_CAPA_CTRL= 0xc6,
- MTK_NL80211_VENDOR_SUBCMD_EDCCA_CTRL = 0xc7,
-+ MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL = 0xc8,
- };
-
- enum mtk_vendor_attr_edcca_ctrl {
-@@ -181,6 +182,38 @@ enum mtk_vendor_attr_hemu_ctrl {
- NUM_MTK_VENDOR_ATTRS_HEMU_CTRL - 1
- };
-
-+enum mtk_vendor_attr_ibf_ctrl {
-+ MTK_VENDOR_ATTR_IBF_CTRL_UNSPEC,
-+
-+ MTK_VENDOR_ATTR_IBF_CTRL_ENABLE,
-+
-+ /* keep last */
-+ NUM_MTK_VENDOR_ATTRS_IBF_CTRL,
-+ MTK_VENDOR_ATTR_IBF_CTRL_MAX =
-+ NUM_MTK_VENDOR_ATTRS_IBF_CTRL - 1
-+};
-+
-+enum mtk_vendor_attr_ibf_dump {
-+ MTK_VENDOR_ATTR_IBF_DUMP_UNSPEC,
-+
-+ MTK_VENDOR_ATTR_IBF_DUMP_ENABLE,
-+
-+ /* keep last */
-+ NUM_MTK_VENDOR_ATTRS_IBF_DUMP,
-+ MTK_VENDOR_ATTR_IBF_DUMP_MAX =
-+ NUM_MTK_VENDOR_ATTRS_IBF_DUMP - 1
-+};
-+
-+static struct nla_policy
-+ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = {
-+ [MTK_VENDOR_ATTR_IBF_CTRL_ENABLE] = { .type = NLA_U8 },
-+};
-+
-+static struct nla_policy
-+ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = {
-+ [MTK_VENDOR_ATTR_IBF_DUMP_ENABLE] = { .type = NLA_U8 },
-+};
-+
-
- #define CSI_MAX_COUNT 256
- #define ETH_ALEN 6
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6cc7e9b..273f7c1 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -1627,6 +1627,11 @@ struct wpa_driver_ap_params {
- * hemu onoff=<val> (bitmap- UL MU-MIMO(bit3), DL MU-MIMO(bit2), UL OFDMA(bit1), DL OFDMA(bit0))
- */
- u8 hemu_onoff;
-+
-+ /**
-+ * ibf_enable=<val>
-+ */
-+ u8 ibf_enable;
- };
-
- struct wpa_driver_mesh_bss_params {
-@@ -4688,6 +4693,20 @@ struct wpa_driver_ops {
- */
- int (*hemu_ctrl)(void *priv, u8 hemu_onoff);
- int (*hemu_dump)(void *priv, u8 *hemu_onoff);
-+
-+ /**
-+ * ibf_ctrl - ctrl disable/enable for ibf
-+ * @priv: Private driver interface data
-+ *
-+ */
-+ int (*ibf_ctrl)(void *priv, u8 ibf_enable);
-+
-+ /**
-+ * ibf_dump - dump ibf
-+ * @priv: Private driver interface data
-+ *
-+ */
-+ int (*ibf_dump)(void *priv, u8 *ibf_enable);
- };
-
- /**
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 0009fb4..e547286 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -12500,6 +12500,112 @@ static int nl80211_configure_edcca_threshold(void *priv,
- return ret;
- }
-
-+static int nl80211_ibf_enable(void *priv, u8 ibf_enable)
-+{
-+ struct i802_bss *bss = priv;
-+ struct wpa_driver_nl80211_data *drv = bss->drv;
-+ struct nl_msg *msg;
-+ struct nlattr *data;
-+ int ret;
-+
-+ if (!drv->mtk_ibf_vendor_cmd_avail) {
-+ wpa_printf(MSG_INFO,
-+ "nl80211: Driver does not support setting ibf control");
-+ return 0;
-+ }
-+
-+ msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
-+ if (!msg)
-+ goto fail;
-+
-+ if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL))
-+ goto fail;
-+
-+ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-+ if (!data)
-+ goto fail;
-+
-+ nla_put_u8(msg, MTK_VENDOR_ATTR_IBF_CTRL_ENABLE, ibf_enable);
-+
-+ nla_nest_end(msg, data);
-+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+ if (ret) {
-+ wpa_printf(MSG_ERROR, "Failed to set ibf_enable. ret=%d (%s)", ret, strerror(-ret));
-+ }
-+
-+ return ret;
-+
-+fail:
-+ nlmsg_free(msg);
-+ return -ENOBUFS;
-+}
-+
-+static int ibf_dump_handler(struct nl_msg *msg, void *arg)
-+{
-+ u8 *ibf_enable = (u8 *) arg;
-+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
-+ struct nlattr *tb_vendor[MTK_VENDOR_ATTR_IBF_DUMP_MAX + 1];
-+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-+ struct nlattr *nl_vend, *attr;
-+
-+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
-+ genlmsg_attrlen(gnlh, 0), NULL);
-+
-+ nl_vend = tb[NL80211_ATTR_VENDOR_DATA];
-+ if (!nl_vend)
-+ return NL_SKIP;
-+
-+ nla_parse(tb_vendor, MTK_VENDOR_ATTR_IBF_DUMP_MAX,
-+ nla_data(nl_vend), nla_len(nl_vend), NULL);
-+
-+ attr = tb_vendor[MTK_VENDOR_ATTR_IBF_DUMP_ENABLE];
-+ if (!attr) {
-+ wpa_printf(MSG_ERROR, "nl80211: cannot find MTK_VENDOR_ATTR_IBF_DUMP_ENABLE");
-+ return NL_SKIP;
-+ }
-+
-+ *ibf_enable = nla_get_u8(attr);
-+
-+ return NL_SKIP;
-+}
-+
-+static int
-+nl80211_ibf_dump(void *priv, u8 *ibf_enable)
-+{
-+ struct i802_bss *bss = priv;
-+ struct wpa_driver_nl80211_data *drv = bss->drv;
-+ struct nl_msg *msg;
-+ struct nlattr *data;
-+ int ret;
-+
-+ msg = nl80211_drv_msg(drv, NLM_F_DUMP, NL80211_CMD_VENDOR);
-+ if (!msg)
-+ goto fail;
-+
-+ if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL))
-+ goto fail;
-+
-+ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
-+ if (!data)
-+ goto fail;
-+
-+ nla_nest_end(msg, data);
-+
-+ ret = send_and_recv_msgs(drv, msg, ibf_dump_handler, ibf_enable, NULL, NULL);
-+
-+ if (ret) {
-+ wpa_printf(MSG_ERROR, "Failed to dump ibf_enable. ret=%d (%s)", ret, strerror(-ret));
-+ }
-+
-+ return ret;
-+
-+fail:
-+ nlmsg_free(msg);
-+ return -ENOBUFS;
-+}
-+
-
- const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- .name = "nl80211",
-@@ -12650,4 +12756,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- #endif /* CONFIG_TESTING_OPTIONS */
- /* Need ifdef CONFIG_DRIVER_NL80211_MTK */
- .configure_edcca_threshold = nl80211_configure_edcca_threshold,
-+ .ibf_ctrl = nl80211_ibf_enable,
-+ .ibf_dump = nl80211_ibf_dump,
- };
-diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 62d9696..1cede07 100644
---- a/src/drivers/driver_nl80211.h
-+++ b/src/drivers/driver_nl80211.h
-@@ -182,6 +182,7 @@ struct wpa_driver_nl80211_data {
- unsigned int brcm_do_acs:1;
- unsigned int mtk_edcca_vendor_cmd_avail:1;
- unsigned int mtk_hemu_vendor_cmd_avail:1;
-+ unsigned int mtk_ibf_vendor_cmd_avail:1;
-
- u64 vendor_scan_cookie;
- u64 remain_on_chan_cookie;
-diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index b5cd2c5..e234aa1 100644
---- a/src/drivers/driver_nl80211_capa.c
-+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1053,6 +1053,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
- case MTK_NL80211_VENDOR_SUBCMD_HEMU_CTRL :
- drv->mtk_hemu_vendor_cmd_avail = 1;
- break;
-+ case MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL:
-+ drv->mtk_ibf_vendor_cmd_avail = 1;
-+ break;
- }
- }
-
---
-2.32.0
-