wlan-ap-Telecominfraproject/feeds/qca/iw/patches/501-compilation-fix.patch
John Crispin 008ca9618d
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
ipq95xx: import ath12.4-cs kernel and drivers
Signed-off-by: John Crispin <john@phrozen.org>
2024-10-20 09:25:13 +02:00

337 lines
10 KiB
Diff

From 174541ec9c1e8f22d0bd74c9e064383454435e55 Mon Sep 17 00:00:00 2001
From: Gautham Kumar Senthilkumaran <quic_gauthamk@quicinc.com>
Date: Mon, 13 Nov 2023 13:19:27 +0530
Subject: [PATCH] iw: Adding new patch for rebased code
Adding this new patchset as part of code rebasing from mainline code.
This patchset is already available in the latest mainline code and added
here to match the functionality.
Below patches have hunks which is preset in mainline code by changing
the uptream patches directly. But now all upstream patches are present
in openwrt network directory and only changes authored by QCA are
present in openwrt-patches directory.
Below patches will add condition in the iw module to block some
functionality which is not currently required for ath driver module but
basic functionality is retained as mainline.
Signed-off-by: Gautham Kumar Senthilkumaran <quic_gauthamk@quicinc.com>
---
event.c | 8 ++++++--
info.c | 19 +++++++++++++------
nl80211.h | 4 ++++
phy.c | 2 --
scan.c | 22 +++++++++++++++++++---
util.c | 2 +-
6 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/event.c b/event.c
index e9f0077..70ebbdf 100644
--- a/event.c
+++ b/event.c
@@ -43,6 +43,7 @@ static int parse_beacon_hint_chan(struct nlattr *tb,
return 0;
}
+#ifdef IW_FULL
static void print_frame(struct print_event_args *args, struct nlattr *attr)
{
uint8_t *frame;
@@ -102,7 +103,7 @@ static void print_frame(struct print_event_args *args, struct nlattr *attr)
printf(" %.02x", frame[i]);
printf("]");
}
-
+#endif
static void parse_cqm_event(struct nlattr **attrs)
{
static struct nla_policy cqm_policy[NL80211_ATTR_CQM_MAX + 1] = {
@@ -911,15 +912,18 @@ static void parse_assoc_comeback(struct nlattr **attrs, int command)
static int print_event(struct nl_msg *msg, void *arg)
{
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
- struct nlattr *tb[NL80211_ATTR_MAX + 1], *nst;
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct print_event_args *args = arg;
char ifname[100];
char macbuf[6*3];
__u8 reg_type;
struct ieee80211_beacon_channel chan_before_beacon, chan_after_beacon;
__u32 wiphy_idx = 0;
+#ifdef IW_FULL
+ struct nlattr *nst;
int rem_nst;
__u16 status;
+#endif
if (args->time || args->reltime || args->ctime) {
unsigned long long usecs, previous;
diff --git a/info.c b/info.c
index 4ea6a53..8d1bdf5 100644
--- a/info.c
+++ b/info.c
@@ -19,6 +19,7 @@ static void print_flag(const char *name, int *open)
*open = 1;
}
+#ifdef IW_FULL
static char *cipher_name(__u32 c)
{
static char buf[20];
@@ -56,6 +57,7 @@ static char *cipher_name(__u32 c)
return buf;
}
}
+#endif
static int ext_feature_isset(const unsigned char *ext_features, int ext_features_len,
enum nl80211_ext_feature_index ftidx)
@@ -186,18 +188,21 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
};
+#ifdef IW_FULL
struct nlattr *tb_rate[NL80211_BITRATE_ATTR_MAX + 1];
static struct nla_policy rate_policy[NL80211_BITRATE_ATTR_MAX + 1] = {
[NL80211_BITRATE_ATTR_RATE] = { .type = NLA_U32 },
[NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE] = { .type = NLA_FLAG },
};
- struct nlattr *nl_band;
- struct nlattr *nl_freq;
struct nlattr *nl_rate;
struct nlattr *nl_cmd;
struct nlattr *nl_if, *nl_ftype;
- int rem_band, rem_freq, rem_rate, rem_cmd, rem_ftype, rem_if;
+ int rem_rate, rem_cmd, rem_ftype, rem_if;
+#endif
+ struct nlattr *nl_band;
+ struct nlattr *nl_freq;
+ int rem_band, rem_freq;
int open;
/*
* static variables only work here, other applications need to use the
@@ -551,10 +556,12 @@ broken_combination:
if (printed)
printf("\n");
}
- }
+ if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
+ printf("\tDevice supports T-DLS.\n");
+ if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH)
+ printf("\tDevice supports TDLS channel switching\n");
- if (tb_msg[NL80211_ATTR_SUPPORT_IBSS_RSN])
- printf("\tDevice supports RSN-IBSS.\n");
+ }
if (tb_msg[NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED]) {
struct nlattr *tb_wowlan[NUM_NL80211_WOWLAN_TRIG];
diff --git a/nl80211.h b/nl80211.h
index 9a16ad4..51bffe6 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -3283,6 +3283,10 @@ enum nl80211_attrs {
NL80211_ATTR_RX_HW_TIMESTAMP,
NL80211_ATTR_TD_BITMAP,
+ NL80211_ATTR_HE_MUEDCA_PARAMS,
+
+ NL80211_ATTR_BEACON_TX_MODE,
+
NL80211_ATTR_WIPHY_ANTENNA_GAIN,
/* add attributes here, update the policy in nl80211.c */
diff --git a/phy.c b/phy.c
index 1244513..cfbaea3 100644
--- a/phy.c
+++ b/phy.c
@@ -369,7 +369,6 @@ err_out:
free(cac_trigger_argv);
return err;
}
-#ifdef IW_FULL
TOPLEVEL(cac, "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
"freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
"freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
@@ -381,7 +380,6 @@ COMMAND(cac, trigger,
NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger,
"Start or trigger a channel availability check (CAC) looking to look for\n"
"radars on the given channel.");
-#endif
static int handle_fragmentation(struct nl80211_state *state,
struct nl_msg *msg,
diff --git a/scan.c b/scan.c
index 1e88aa8..775a958 100644
--- a/scan.c
+++ b/scan.c
@@ -568,6 +568,7 @@ static void print_ssid(const uint8_t type, uint8_t len, const uint8_t *data,
#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
+#ifdef IW_FULL
static void print_supprates(const uint8_t type, uint8_t len,
const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -590,6 +591,7 @@ static void print_supprates(const uint8_t type, uint8_t len,
}
printf("\n");
}
+#endif
static void print_rm_enabled_capabilities(const uint8_t type, uint8_t len,
const uint8_t *data,
@@ -1074,12 +1076,14 @@ static void print_rsn_ie(const char *defcipher, const char *defauth,
_print_rsn_ie(defcipher, defauth, len, data, 0);
}
+#ifdef IW_FULL
static void print_osen_ie(const char *defcipher, const char *defauth,
uint8_t len, const uint8_t *data)
{
printf("\n\t");
_print_rsn_ie(defcipher, defauth, len, data, 1);
}
+#endif
static void print_rsn(const uint8_t type, uint8_t len, const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -1097,6 +1101,7 @@ static void print_ht_capa(const uint8_t type, uint8_t len, const uint8_t *data,
print_ht_mcs(data + 3);
}
+#ifdef IW_FULL
static const char* ntype_11u(uint8_t t)
{
switch (t) {
@@ -1111,6 +1116,7 @@ static const char* ntype_11u(uint8_t t)
default: return "Reserved";
}
}
+#endif
static const char* vgroup_11u(uint8_t t)
{
@@ -1321,6 +1327,7 @@ static void print_ht_op(const uint8_t type, uint8_t len, const uint8_t *data,
printf("\t\t * PCO phase: %d\n", (data[5] & 0x8) >> 3);
}
+#ifdef IW_FULL
static void print_capabilities(const uint8_t type, uint8_t len,
const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -1481,6 +1488,8 @@ static void print_capabilities(const uint8_t type, uint8_t len,
printf("\n");
}
+#endif
+
static void print_tim(const uint8_t type, uint8_t len, const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -1526,6 +1535,7 @@ static void print_vht_oper(const uint8_t type, uint8_t len, const uint8_t *data,
printf("\t\t * VHT basic MCS set: 0x%.2x%.2x\n", data[4], data[3]);
}
+#ifdef IW_FULL
static void print_supp_op_classes(const uint8_t type, uint8_t len,
const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -1559,6 +1569,7 @@ static void print_supp_op_classes(const uint8_t type, uint8_t len,
break;
}
}
+#endif
static void print_measurement_pilot_tx(const uint8_t type, uint8_t len,
const uint8_t *data,
@@ -1634,6 +1645,7 @@ static void print_secchan_offs(const uint8_t type, uint8_t len,
printf(" %d\n", data[0]);
}
+#ifdef IW_FULL
static void print_bss_load(const uint8_t type, uint8_t len, const uint8_t *data,
const struct print_ies_data *ie_buffer)
{
@@ -1642,6 +1654,7 @@ static void print_bss_load(const uint8_t type, uint8_t len, const uint8_t *data,
printf("\t\t * channel utilisation: %d/255\n", data[2]);
printf("\t\t * available admission capacity: %d [*32us]\n", (data[4] << 8) | data[3]);
}
+#endif
static void print_mesh_conf(const uint8_t type, uint8_t len,
const uint8_t *data,
@@ -2083,13 +2096,13 @@ static void print_wifi_wps(const uint8_t type, uint8_t len, const uint8_t *data,
}
}
+#ifdef IW_FULL
static const struct ie_print wifiprinters[] = {
[1] = { "WPA", print_wifi_wpa, 2, 255, BIT(PRINT_SCAN), },
-#ifdef IW_FULL
[2] = { "WMM", print_wifi_wmm, 1, 255, BIT(PRINT_SCAN), },
[4] = { "WPS", print_wifi_wps, 0, 255, BIT(PRINT_SCAN), },
-#endif
};
+#endif
static inline void print_p2p(const uint8_t type, uint8_t len,
const uint8_t *data,
@@ -2185,6 +2198,7 @@ static inline void print_hs20_ind(const uint8_t type, uint8_t len,
printf("\t\tUnexpected length: %i\n", len);
}
+#ifdef IW_FULL
static void print_wifi_owe_tarns(const uint8_t type, uint8_t len,
const uint8_t *data,
const struct print_ies_data *ie_buffer)
@@ -2282,7 +2296,7 @@ static void print_vendor(unsigned char len, unsigned char *data,
printf(" %.2x", data[i]);
printf("\n");
}
-
+#endif
static void print_he_capa(const uint8_t type, uint8_t len, const uint8_t *data,
const struct print_ies_data *ie_buffer)
{
@@ -2337,6 +2351,7 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
ieprinters[ie[0]].flags & BIT(ptype)) {
print_ie(&ieprinters[ie[0]],
ie[0], ie[1], ie + 2, &ie_buffer);
+#ifdef IW_FULL
} else if (ie[0] == 221 /* vendor */) {
print_vendor(ie[1], ie + 2, unknown, ptype);
} else if (ie[0] == 255 /* extension */) {
@@ -2348,6 +2363,7 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
for (i=0; i<ie[1]; i++)
printf(" %.2x", ie[2+i]);
printf("\n");
+#endif
}
ielen -= ie[1] + 2;
ie += ie[1] + 2;
diff --git a/util.c b/util.c
index 1b15692..2ee2fea 100644
--- a/util.c
+++ b/util.c
@@ -147,13 +147,13 @@ const char *iftype_name(enum nl80211_iftype iftype)
return modebuf;
}
+#ifdef IW_FULL
static const char *commands[NL80211_CMD_MAX + 1] = {
#include "nl80211-commands.inc"
};
static char cmdbuf[100];
-#ifdef IW_FULL
const char *command_name(enum nl80211_commands cmd)
{
if (cmd <= NL80211_CMD_MAX && commands[cmd])
--
2.17.1