Skip to content

Commit 982d728

Browse files
paliKalle Valo
authored andcommitted
mwifiex: Add support for NL80211_ATTR_MAX_AP_ASSOC_STA
SD8997 firmware sends TLV_TYPE_MAX_CONN with struct hw_spec_max_conn to inform kernel about maximum number of p2p connections and stations in AP mode. During initialization of SD8997 wifi chip kernel prints warning: mwifiex_sdio mmc0:0001:1: Unknown GET_HW_SPEC TLV type: 0x217 This patch adds support for parsing TLV_TYPE_MAX_CONN (0x217) and sets appropriate cfg80211 member 'max_ap_assoc_sta' from retrieved structure. It allows userspace to retrieve NL80211_ATTR_MAX_AP_ASSOC_STA attribute. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 86cffb2 commit 982d728

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

drivers/net/wireless/marvell/mwifiex/cfg80211.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4335,6 +4335,11 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
43354335
wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta;
43364336
wiphy->n_iface_combinations = 1;
43374337

4338+
if (adapter->max_sta_conn > adapter->max_p2p_conn)
4339+
wiphy->max_ap_assoc_sta = adapter->max_sta_conn;
4340+
else
4341+
wiphy->max_ap_assoc_sta = adapter->max_p2p_conn;
4342+
43384343
/* Initialize cipher suits */
43394344
wiphy->cipher_suites = mwifiex_cipher_suites;
43404345
wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites);

drivers/net/wireless/marvell/mwifiex/cmdevt.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
14951495
struct mwifiex_adapter *adapter = priv->adapter;
14961496
struct mwifiex_ie_types_header *tlv;
14971497
struct hw_spec_api_rev *api_rev;
1498+
struct hw_spec_max_conn *max_conn;
14981499
u16 resp_size, api_id;
14991500
int i, left_len, parsed_len = 0;
15001501

@@ -1604,6 +1605,17 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
16041605
break;
16051606
}
16061607
break;
1608+
case TLV_TYPE_MAX_CONN:
1609+
max_conn = (struct hw_spec_max_conn *)tlv;
1610+
adapter->max_p2p_conn = max_conn->max_p2p_conn;
1611+
adapter->max_sta_conn = max_conn->max_sta_conn;
1612+
mwifiex_dbg(adapter, INFO,
1613+
"max p2p connections: %u\n",
1614+
adapter->max_p2p_conn);
1615+
mwifiex_dbg(adapter, INFO,
1616+
"max sta connections: %u\n",
1617+
adapter->max_sta_conn);
1618+
break;
16071619
default:
16081620
mwifiex_dbg(adapter, FATAL,
16091621
"Unknown GET_HW_SPEC TLV type: %#x\n",

drivers/net/wireless/marvell/mwifiex/fw.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
220220
#define TLV_TYPE_BSS_MODE (PROPRIETARY_TLV_BASE_ID + 206)
221221
#define TLV_TYPE_RANDOM_MAC (PROPRIETARY_TLV_BASE_ID + 236)
222222
#define TLV_TYPE_CHAN_ATTR_CFG (PROPRIETARY_TLV_BASE_ID + 237)
223+
#define TLV_TYPE_MAX_CONN (PROPRIETARY_TLV_BASE_ID + 279)
223224

224225
#define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
225226

@@ -2388,4 +2389,11 @@ struct mwifiex_opt_sleep_confirm {
23882389
__le16 action;
23892390
__le16 resp_ctrl;
23902391
} __packed;
2392+
2393+
struct hw_spec_max_conn {
2394+
struct mwifiex_ie_types_header header;
2395+
u8 max_p2p_conn;
2396+
u8 max_sta_conn;
2397+
} __packed;
2398+
23912399
#endif /* !_MWIFIEX_FW_H_ */

drivers/net/wireless/marvell/mwifiex/main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,7 @@ struct mwifiex_adapter {
10221022
bool ext_scan;
10231023
u8 fw_api_ver;
10241024
u8 key_api_major_ver, key_api_minor_ver;
1025+
u8 max_p2p_conn, max_sta_conn;
10251026
struct memory_type_mapping *mem_type_mapping_tbl;
10261027
u8 num_mem_types;
10271028
bool scan_chan_gap_enabled;

0 commit comments

Comments
 (0)