All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
@ 2023-11-28  8:31 David Lin
  2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
                   ` (12 more replies)
  0 siblings, 13 replies; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Patch v7:

Changelogs since Patch v6:

1. Fix regression: Downlink throughput degraded by 70% in AP mode. 
2. Fix issue: On STAUT, kernel Oops occurs when there is no association
   response from AP. 
3. Fix issue: On STAUT, if AP leaves abruptly and deauth is missing,
   STA can't connect to AP anymore.
4. Fix regression: STA can't connect to AP when host_mlme is disabled
   (impact all chips). 
5. Address reviewer comments.

Patch v6:

Correct mailing sequence.

Patch v5:

1. Add host base MLME support to enable WPA3 functionalities for both STA
   and AP mode. 
2. This feature (WPA3) required a firmware with corresponding Key API V2
   support. 
3. QA validation and regression have been covered for IW416.
4. This feature (WPA3) is currently enabled and verified only for IW416.
5. Changelogs since patch V4:
	a. Add WPA3 support for AP mode.
	b. Bug fix: In WPA3 STA mode, deice gets disconnected from AP
           when group rekey occurs. 
	c. Bug fix: STAUT doesn't send WMM IE in association request when
           associate to a WMM-AP.


Patch v4:

1. Refine code segment per review comment. 
2. Add API to check firmware encryption key command version when host_mlme
   is enabled. 

Patch v3:

Cleanup commit message.

Patch v2:

1. Fix checkpatch error (pwe[1] -> pwe[0]).
2. Move module parameter 'host_mlme' to mwifiex_sdio_device structure.
   Default only enable for IW416.
3. Disable advertising NL80211_FEATURE_SAE if host_mlme is not enabled.

David Lin (12):
  wifi: mwifiex: added code to support host mlme.
  wifi: mwifiex: fixed group rekey issue for WPA3.
  wifi: mwifiex: fixed reassocation issue for WPA3.
  wifi: mwifiex: fixed missing WMM IE for assoc req.
  wifi: mwifiex: supported host mlme for AP mode.
  wifi: mwifiex: added mac address for AP config.
  wifi: mwifiex: fixed TLV error for station add cmd.
  wifi: mwifiex: fixed the way to handle assoc timeout.
  wifi: mwifiex: fixed the way to handle link lost.
  wifi: mwifiex: fixed AP issue without host mlme.
  wifi: mwifiex: misc modifications for review comments.
  wifi: mwifiex: fixed compile and coding errors.

 .../net/wireless/marvell/mwifiex/cfg80211.c   | 397 +++++++++++++++++-
 drivers/net/wireless/marvell/mwifiex/cmdevt.c |  35 +-
 drivers/net/wireless/marvell/mwifiex/decl.h   |  25 +-
 drivers/net/wireless/marvell/mwifiex/fw.h     |  61 +++
 drivers/net/wireless/marvell/mwifiex/init.c   |   6 +
 drivers/net/wireless/marvell/mwifiex/ioctl.h  |   6 +
 drivers/net/wireless/marvell/mwifiex/join.c   |  67 ++-
 drivers/net/wireless/marvell/mwifiex/main.c   |  54 +++
 drivers/net/wireless/marvell/mwifiex/main.h   |  17 +
 drivers/net/wireless/marvell/mwifiex/scan.c   |   6 +
 drivers/net/wireless/marvell/mwifiex/sdio.c   |  13 +
 drivers/net/wireless/marvell/mwifiex/sdio.h   |   2 +
 .../wireless/marvell/mwifiex/sta_cmdresp.c    |   2 +
 .../net/wireless/marvell/mwifiex/sta_event.c  |  36 +-
 .../net/wireless/marvell/mwifiex/sta_ioctl.c  |   3 +-
 drivers/net/wireless/marvell/mwifiex/sta_tx.c |   9 +-
 .../net/wireless/marvell/mwifiex/uap_cmd.c    | 180 ++++++++
 drivers/net/wireless/marvell/mwifiex/util.c   | 104 +++++
 18 files changed, 1003 insertions(+), 20 deletions(-)


base-commit: 783004b6dbda2cfe9a552a4cc9c1d168a2068f6c
-- 
2.25.1


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH v7 01/12] wifi: mwifiex: added code to support host mlme.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-11-28 22:51   ` kernel test robot
  2023-11-28  8:31 ` [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3 David Lin
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

1. For station mode first.
2. This feature is a must for WPA3.
3. Firmware key api version 2 is needed for this feature.
4. The code is only enabled and tested with IW416.
5. This feature is disabled for other chips.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   | 327 ++++++++++++++++++
 drivers/net/wireless/marvell/mwifiex/cmdevt.c |  14 +-
 drivers/net/wireless/marvell/mwifiex/decl.h   |  12 +
 drivers/net/wireless/marvell/mwifiex/fw.h     |  15 +
 drivers/net/wireless/marvell/mwifiex/init.c   |   3 +
 drivers/net/wireless/marvell/mwifiex/join.c   |  64 +++-
 drivers/net/wireless/marvell/mwifiex/main.h   |  10 +
 drivers/net/wireless/marvell/mwifiex/scan.c   |   6 +
 drivers/net/wireless/marvell/mwifiex/sdio.c   |  13 +
 drivers/net/wireless/marvell/mwifiex/sdio.h   |   2 +
 .../net/wireless/marvell/mwifiex/sta_event.c  |  18 +-
 .../net/wireless/marvell/mwifiex/sta_ioctl.c  |   3 +-
 drivers/net/wireless/marvell/mwifiex/sta_tx.c |   9 +-
 .../net/wireless/marvell/mwifiex/uap_cmd.c    |  26 ++
 drivers/net/wireless/marvell/mwifiex/util.c   |  73 ++++
 15 files changed, 582 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 7a15ea8072e6..40c39e4765f7 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -57,6 +57,31 @@ ieee80211_iface_combination mwifiex_iface_comb_ap_sta_drcs = {
 	.beacon_int_infra_match = true,
 };
 
+struct mwifiex_ieee80211_mgmt {
+	__le16 frame_control;
+	__le16 duration;
+	u8 da[ETH_ALEN];
+	u8 sa[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
+	__le16 seq_ctrl;
+	u8 addr4[ETH_ALEN];
+	union {
+		struct {
+			__le16 auth_alg;
+			__le16 auth_transaction;
+			__le16 status_code;
+			/* possibly followed by Challenge text */
+			u8 variable[];
+		} __packed auth;
+		struct {
+			__le16 capab_info;
+			__le16 listen_interval;
+			/* followed by SSID and Supported rates */
+			u8 variable[];
+		} __packed assoc_req;
+	} u;
+} __pack;
+
 /*
  * This function maps the nl802.11 channel type into driver channel type.
  *
@@ -268,6 +293,8 @@ mwifiex_cfg80211_update_mgmt_frame_registrations(struct wiphy *wiphy,
 
 	if (mask != priv->mgmt_frame_mask) {
 		priv->mgmt_frame_mask = mask;
+		if (priv->host_mlme_reg)
+			priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK;
 		mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
 				 HostCmd_ACT_GEN_SET, 0,
 				 &priv->mgmt_frame_mask, false);
@@ -848,6 +875,7 @@ static int mwifiex_deinit_priv_params(struct mwifiex_private *priv)
 	struct mwifiex_adapter *adapter = priv->adapter;
 	unsigned long flags;
 
+	priv->host_mlme_reg = false;
 	priv->mgmt_frame_mask = 0;
 	if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
 			     HostCmd_ACT_GEN_SET, 0,
@@ -4202,6 +4230,292 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev,
 	return ret;
 }
 
+static int
+mwifiex_cfg80211_authenticate(struct wiphy *wiphy,
+			      struct net_device *dev,
+			      struct cfg80211_auth_request *req)
+{
+	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
+	struct mwifiex_adapter *adapter = priv->adapter;
+	struct sk_buff *skb;
+	u16 pkt_len, auth_alg;
+	int ret;
+	struct mwifiex_ieee80211_mgmt *mgmt;
+	struct mwifiex_txinfo *tx_info;
+	u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT;
+	u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+	u8 trans = 1, status_code = 0;
+	u8 *varptr;
+
+	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) {
+		mwifiex_dbg(priv->adapter, ERROR, "Interface role is AP\n");
+		return -EFAULT;
+	}
+
+	if (priv->wdev.iftype != NL80211_IFTYPE_STATION) {
+		mwifiex_dbg(priv->adapter, ERROR,
+			    "Interface type is not correct (type %d)\n",
+			    priv->wdev.iftype);
+		return -EINVAL;
+	}
+
+	if (priv->auth_alg != WLAN_AUTH_SAE &&
+	    (priv->auth_flag & HOST_MLME_AUTH_PENDING)) {
+		mwifiex_dbg(priv->adapter, ERROR, "Pending auth on going\n");
+		return -EBUSY;
+	}
+
+	if (!priv->host_mlme_reg) {
+		priv->host_mlme_reg = true;
+		priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK;
+		mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
+				 HostCmd_ACT_GEN_SET, 0,
+				 &priv->mgmt_frame_mask, false);
+	}
+
+	switch (req->auth_type) {
+	case NL80211_AUTHTYPE_OPEN_SYSTEM:
+		auth_alg = WLAN_AUTH_OPEN;
+		break;
+	case NL80211_AUTHTYPE_SHARED_KEY:
+		auth_alg = WLAN_AUTH_SHARED_KEY;
+		break;
+	case NL80211_AUTHTYPE_FT:
+		auth_alg = WLAN_AUTH_FT;
+		break;
+	case NL80211_AUTHTYPE_NETWORK_EAP:
+		auth_alg = WLAN_AUTH_LEAP;
+		break;
+	case NL80211_AUTHTYPE_SAE:
+		auth_alg = WLAN_AUTH_SAE;
+		break;
+	default:
+		mwifiex_dbg(priv->adapter, ERROR,
+			    "unsupported auth type=%d\n", req->auth_type);
+		return -EOPNOTSUPP;
+	}
+
+	if (!priv->auth_flag) {
+		ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET,
+						 req->bss->channel,
+						 AUTH_TX_DEFAULT_WAIT_TIME);
+
+		if (!ret) {
+			priv->roc_cfg.cookie = get_random_u32() | 1;
+			priv->roc_cfg.chan = *req->bss->channel;
+		}
+	}
+
+	priv->sec_info.authentication_mode = auth_alg;
+
+	mwifiex_cancel_scan(adapter);
+
+	pkt_len = (u16)req->ie_len + req->auth_data_len +
+		     MWIFIEX_MGMT_HEADER_LEN + MWIFIEX_AUTH_BODY_LEN;
+	if (req->auth_data_len >= 4)
+		pkt_len -= 4;
+
+	skb = dev_alloc_skb(MWIFIEX_MIN_DATA_HEADER_LEN +
+			    MWIFIEX_MGMT_FRAME_HEADER_SIZE +
+			    pkt_len + sizeof(pkt_len));
+	if (!skb) {
+		mwifiex_dbg(priv->adapter, ERROR,
+			    "allocate skb failed for management frame\n");
+		return -ENOMEM;
+	}
+
+	tx_info = MWIFIEX_SKB_TXCB(skb);
+	memset(tx_info, 0, sizeof(*tx_info));
+	tx_info->bss_num = priv->bss_num;
+	tx_info->bss_type = priv->bss_type;
+	tx_info->pkt_len = pkt_len;
+
+	skb_reserve(skb, MWIFIEX_MIN_DATA_HEADER_LEN +
+		    MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(pkt_len));
+	memcpy(skb_push(skb, sizeof(pkt_len)), &pkt_len, sizeof(pkt_len));
+	memcpy(skb_push(skb, sizeof(tx_control)),
+	       &tx_control, sizeof(tx_control));
+	memcpy(skb_push(skb, sizeof(pkt_type)), &pkt_type, sizeof(pkt_type));
+
+	mgmt = (struct mwifiex_ieee80211_mgmt *)skb_put(skb, pkt_len);
+	memset(mgmt, 0, pkt_len);
+	mgmt->frame_control =
+		cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH);
+	memcpy(mgmt->da, req->bss->bssid, ETH_ALEN);
+	memcpy(mgmt->sa, priv->curr_addr, ETH_ALEN);
+	memcpy(mgmt->bssid, req->bss->bssid, ETH_ALEN);
+	memcpy(mgmt->addr4, addr, ETH_ALEN);
+
+	if (req->auth_data_len >= 4) {
+		if (req->auth_type == NL80211_AUTHTYPE_SAE) {
+			__le16 *pos = (__le16 *)req->auth_data;
+
+			trans = le16_to_cpu(pos[0]);
+			status_code = le16_to_cpu(pos[1]);
+		}
+		memcpy((u8 *)(&mgmt->u.auth.variable), req->auth_data + 4,
+		       req->auth_data_len - 4);
+		varptr = (u8 *)&mgmt->u.auth.variable +
+			 (req->auth_data_len - 4);
+	}
+
+	mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg);
+	mgmt->u.auth.auth_transaction = trans;
+	mgmt->u.auth.status_code = status_code;
+
+	if (req->ie && req->ie_len) {
+		if (!varptr)
+			varptr = (u8 *)&mgmt->u.auth.variable;
+		memcpy((u8 *)varptr, req->ie, req->ie_len);
+	}
+
+	priv->auth_flag = HOST_MLME_AUTH_PENDING;
+	priv->auth_alg = auth_alg;
+
+	skb->priority = WMM_HIGHEST_PRIORITY;
+	__net_timestamp(skb);
+
+	mwifiex_dbg(priv->adapter, MSG,
+		    "auth: send authentication to %pM\n", req->bss->bssid);
+
+	mwifiex_queue_tx_pkt(priv, skb);
+
+	return 0;
+}
+
+static int
+mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
+			   struct cfg80211_assoc_request *req)
+{
+	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
+	struct mwifiex_adapter *adapter = priv->adapter;
+	int ret;
+	struct cfg80211_ssid req_ssid;
+	const u8 *ssid_ie;
+	struct cfg80211_rx_assoc_resp assoc_resp = {
+		.uapsd_queues = -1,
+	};
+
+	if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
+		mwifiex_dbg(adapter, ERROR,
+			    "%s: reject infra assoc request in non-STA role\n",
+			    dev->name);
+		return -EINVAL;
+	}
+
+	if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags) ||
+	    test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags)) {
+		mwifiex_dbg(adapter, ERROR,
+			    "%s: Ignore association.\t"
+			    "Card removed or FW in bad state\n",
+			    dev->name);
+		return -EFAULT;
+	}
+
+	if (priv->auth_alg == WLAN_AUTH_SAE)
+		priv->auth_flag = HOST_MLME_AUTH_DONE;
+
+	if (priv->auth_flag && !(priv->auth_flag & HOST_MLME_AUTH_DONE))
+		return -EBUSY;
+
+	if (!mwifiex_stop_bg_scan(priv))
+		cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0);
+
+	memset(&req_ssid, 0, sizeof(struct cfg80211_ssid));
+	rcu_read_lock();
+	ssid_ie = ieee80211_bss_get_ie(req->bss, WLAN_EID_SSID);
+
+	if (!ssid_ie)
+		goto ssid_err;
+
+	req_ssid.ssid_len = ssid_ie[1];
+	if (req_ssid.ssid_len > IEEE80211_MAX_SSID_LEN) {
+		mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n");
+		goto ssid_err;
+	}
+
+	memcpy(req_ssid.ssid, ssid_ie + 2, req_ssid.ssid_len);
+	if (!req_ssid.ssid_len || req_ssid.ssid[0] < 0x20) {
+		mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n");
+		goto ssid_err;
+	}
+	rcu_read_unlock();
+
+	/* As this is new association, clear locally stored
+	 * keys and security related flags
+	 */
+	priv->sec_info.wpa_enabled = false;
+	priv->sec_info.wpa2_enabled = false;
+	priv->wep_key_curr_index = 0;
+	priv->sec_info.encryption_mode = 0;
+	priv->sec_info.is_authtype_auto = 0;
+	ret = mwifiex_set_encode(priv, NULL, NULL, 0, 0, NULL, 1);
+
+	if (req->crypto.n_ciphers_pairwise)
+		priv->sec_info.encryption_mode =
+			req->crypto.ciphers_pairwise[0];
+
+	if (req->crypto.cipher_group)
+		priv->sec_info.encryption_mode = req->crypto.cipher_group;
+
+	if (req->ie)
+		ret = mwifiex_set_gen_ie(priv, req->ie, req->ie_len);
+
+	memcpy(priv->cfg_bssid, req->bss->bssid, ETH_ALEN);
+
+	mwifiex_dbg(priv->adapter, MSG,
+		    "assoc: send association to %pM\n", req->bss->bssid);
+
+	cfg80211_ref_bss(priv->adapter->wiphy, req->bss);
+
+	ret = mwifiex_bss_start(priv, req->bss, &req_ssid);
+
+	if (!ret) {
+		assoc_resp.links[0].bss = priv->attempted_bss_desc->bss;
+		assoc_resp.buf = priv->assoc_rsp_buf;
+		assoc_resp.len = priv->assoc_rsp_size;
+		cfg80211_rx_assoc_resp(priv->netdev,
+				       &assoc_resp);
+	} else {
+		priv->auth_flag = 0;
+		priv->auth_alg = 0xFFFF;
+		eth_zero_addr(priv->cfg_bssid);
+	}
+
+	cfg80211_put_bss(priv->adapter->wiphy, req->bss);
+
+	return 0;
+
+ssid_err:
+
+	rcu_read_unlock();
+	return -EFAULT;
+}
+
+static int
+mwifiex_cfg80211_deauthenticate(struct wiphy *wiphy,
+				struct net_device *dev,
+				struct cfg80211_deauth_request *req)
+{
+	return mwifiex_cfg80211_disconnect(wiphy, dev, req->reason_code);
+}
+
+static int
+mwifiex_cfg80211_disassociate(struct wiphy *wiphy,
+			      struct net_device *dev,
+			      struct cfg80211_disassoc_request *req)
+{
+	return mwifiex_cfg80211_disconnect(wiphy, dev, req->reason_code);
+}
+
+static int
+mwifiex_cfg80211_probe_client(struct wiphy *wiphy,
+			      struct net_device *dev, const u8 *peer,
+			      u64 *cookie)
+{
+	return -1;
+}
+
 /* station cfg80211 operations */
 static struct cfg80211_ops mwifiex_cfg80211_ops = {
 	.add_virtual_intf = mwifiex_add_virtual_intf,
@@ -4347,6 +4661,16 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 			    "%s: creating new wiphy\n", __func__);
 		return -ENOMEM;
 	}
+	if (adapter->host_mlme) {
+		mwifiex_cfg80211_ops.auth = mwifiex_cfg80211_authenticate;
+		mwifiex_cfg80211_ops.assoc = mwifiex_cfg80211_associate;
+		mwifiex_cfg80211_ops.deauth = mwifiex_cfg80211_deauthenticate;
+		mwifiex_cfg80211_ops.disassoc = mwifiex_cfg80211_disassociate;
+		mwifiex_cfg80211_ops.disconnect = NULL;
+		mwifiex_cfg80211_ops.connect = NULL;
+		mwifiex_cfg80211_ops.probe_client =
+			mwifiex_cfg80211_probe_client;
+	}
 	wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH;
 	wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN;
 	wiphy->mgmt_stypes = mwifiex_mgmt_stypes;
@@ -4428,6 +4752,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 			   NL80211_FEATURE_LOW_PRIORITY_SCAN |
 			   NL80211_FEATURE_NEED_OBSS_SCAN;
 
+	if (adapter->host_mlme)
+		wiphy->features |= NL80211_FEATURE_SAE;
+
 	if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info))
 		wiphy->features |= NL80211_FEATURE_HT_IBSS;
 
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 3756aa247e77..311af5f40c3e 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -654,7 +654,7 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
 	if (ret) {
 		mwifiex_dbg(adapter, ERROR,
 			    "PREP_CMD: cmd %#x preparation failed\n",
-			cmd_no);
+			    cmd_no);
 		mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
 		return -1;
 	}
@@ -1477,6 +1477,17 @@ int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
 	return 0;
 }
 
+static void mwifiex_check_key_api_ver(struct mwifiex_adapter *adapter)
+{
+	if (adapter->host_mlme) {
+		if (adapter->key_api_major_ver != KEY_API_VER_MAJOR_V2)
+			adapter->host_mlme = false;
+		mwifiex_dbg(adapter, MSG, "host_mlme: %s, key_api: %d\n",
+			    adapter->host_mlme ? "enable" : "disable",
+			    adapter->key_api_major_ver);
+	}
+}
+
 /*
  * This function handles the command response of get hardware
  * specifications.
@@ -1586,6 +1597,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
 						    "key_api v%d.%d\n",
 						    adapter->key_api_major_ver,
 						    adapter->key_api_minor_ver);
+					mwifiex_check_key_api_ver(adapter);
 					break;
 				case FW_API_VER_ID:
 					adapter->fw_api_ver =
diff --git a/drivers/net/wireless/marvell/mwifiex/decl.h b/drivers/net/wireless/marvell/mwifiex/decl.h
index 326ffb05d791..f9b21b13d6c3 100644
--- a/drivers/net/wireless/marvell/mwifiex/decl.h
+++ b/drivers/net/wireless/marvell/mwifiex/decl.h
@@ -24,6 +24,18 @@
 #define MWIFIEX_RX_HEADROOM	    64
 #define MAX_TXPD_SZ		    32
 #define INTF_HDR_ALIGN		     4
+/* frmctl + durationid + addr1 + addr2 + addr3 + seqctl + addr4 */
+#define MWIFIEX_MGMT_HEADER_LEN   (2 + 2 + 6 + 6 + 6 + 2 + 6)
+/* 6   = auth_alg + auth_transaction + auth_status */
+#define MWIFIEX_AUTH_BODY_LEN     6
+
+#define HOST_MLME_AUTH_PENDING    BIT(0)
+#define HOST_MLME_AUTH_DONE       BIT(1)
+
+#define HOST_MLME_MGMT_MASK       (BIT(IEEE80211_STYPE_AUTH >> 4) | \
+				   BIT(IEEE80211_STYPE_DEAUTH >> 4) | \
+				   BIT(IEEE80211_STYPE_DISASSOC >> 4))
+#define AUTH_TX_DEFAULT_WAIT_TIME 2400
 
 #define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \
 				     MAX_TXPD_SZ)
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 8e6db904e5b2..8b22cd993a79 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -209,6 +209,9 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define TLV_TYPE_RANDOM_MAC         (PROPRIETARY_TLV_BASE_ID + 236)
 #define TLV_TYPE_CHAN_ATTR_CFG      (PROPRIETARY_TLV_BASE_ID + 237)
 #define TLV_TYPE_MAX_CONN           (PROPRIETARY_TLV_BASE_ID + 279)
+#define TLV_TYPE_HOST_MLME          (PROPRIETARY_TLV_BASE_ID + 307)
+#define TLV_TYPE_SAE_PWE_MODE       (PROPRIETARY_TLV_BASE_ID + 339)
+
 
 #define MWIFIEX_TX_DATA_BUF_SIZE_2K        2048
 
@@ -802,6 +805,11 @@ struct mwifiex_ie_types_ssid_param_set {
 	u8 ssid[];
 } __packed;
 
+struct mwifiex_ie_types_host_mlme {
+	struct mwifiex_ie_types_header header;
+	u8 host_mlme;
+} __packed;
+
 struct mwifiex_ie_types_num_probes {
 	struct mwifiex_ie_types_header header;
 	__le16 num_probes;
@@ -905,6 +913,13 @@ struct mwifiex_ie_types_tdls_idle_timeout {
 	__le16 value;
 } __packed;
 
+#define MWIFIEX_AUTHTYPE_SAE 6
+
+struct mwifiex_ie_types_sae_pwe_mode {
+	struct mwifiex_ie_types_header header;
+	u8 pwe[];
+} __packed;
+
 struct mwifiex_ie_types_rsn_param_set {
 	struct mwifiex_ie_types_header header;
 	u8 rsn_ie[];
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index c9c58419c37b..f86a527fd7ca 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -81,6 +81,9 @@ int mwifiex_init_priv(struct mwifiex_private *priv)
 	priv->bcn_avg_factor = DEFAULT_BCN_AVG_FACTOR;
 	priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR;
 
+	priv->auth_flag = 0;
+	priv->auth_alg = 0xFFFF;
+
 	priv->sec_info.wep_enabled = 0;
 	priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
 	priv->sec_info.encryption_mode = 0;
diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c
index a6e254a1185c..ef7cc40c3ba4 100644
--- a/drivers/net/wireless/marvell/mwifiex/join.c
+++ b/drivers/net/wireless/marvell/mwifiex/join.c
@@ -382,7 +382,9 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 	struct mwifiex_ie_types_ss_param_set *ss_tlv;
 	struct mwifiex_ie_types_rates_param_set *rates_tlv;
 	struct mwifiex_ie_types_auth_type *auth_tlv;
+	struct mwifiex_ie_types_sae_pwe_mode *sae_pwe_tlv;
 	struct mwifiex_ie_types_chan_list_param_set *chan_tlv;
+	struct mwifiex_ie_types_host_mlme *host_mlme_tlv;
 	u8 rates[MWIFIEX_SUPPORTED_RATES];
 	u32 rates_size;
 	u16 tmp_cap;
@@ -448,7 +450,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 	mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_CMD: rates size = %d\n",
 		    rates_size);
 
-	/* Add the Authentication type to be used for Auth frames */
+	/* Add the Authentication type */
 	auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
 	auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE);
 	auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type));
@@ -460,6 +462,24 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 
 	pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len);
 
+	if (priv->sec_info.authentication_mode == WLAN_AUTH_SAE) {
+		auth_tlv->auth_type = cpu_to_le16(MWIFIEX_AUTHTYPE_SAE);
+		if (bss_desc->bcn_rsnx_ie &&
+		    bss_desc->bcn_rsnx_ie->ieee_hdr.len &&
+		    (bss_desc->bcn_rsnx_ie->data[0] &
+		    WLAN_RSNX_CAPA_SAE_H2E)) {
+			sae_pwe_tlv =
+				(struct mwifiex_ie_types_sae_pwe_mode *)pos;
+			sae_pwe_tlv->header.type =
+				cpu_to_le16(TLV_TYPE_SAE_PWE_MODE);
+			sae_pwe_tlv->header.len =
+				cpu_to_le16(sizeof(sae_pwe_tlv->pwe[0]));
+			sae_pwe_tlv->pwe[0] = bss_desc->bcn_rsnx_ie->data[0];
+			pos += sizeof(sae_pwe_tlv->header) +
+				sizeof(sae_pwe_tlv->pwe[0]);
+		}
+	}
+
 	if (IS_SUPPORT_MULTI_BANDS(priv->adapter) &&
 	    !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) &&
 	    (!bss_desc->disable_11n) &&
@@ -491,6 +511,16 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 			sizeof(struct mwifiex_chan_scan_param_set);
 	}
 
+	if (priv->adapter->host_mlme) {
+		host_mlme_tlv = (struct mwifiex_ie_types_host_mlme *)pos;
+		host_mlme_tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME);
+		host_mlme_tlv->header.len =
+			cpu_to_le16(sizeof(host_mlme_tlv->host_mlme));
+		host_mlme_tlv->host_mlme = 1;
+		pos += sizeof(host_mlme_tlv->header) +
+			sizeof(host_mlme_tlv->host_mlme);
+	}
+
 	if (!priv->wps.session_enable) {
 		if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
 			rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
@@ -634,6 +664,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 	u16 cap_info, status_code, aid;
 	const u8 *ie_ptr;
 	struct ieee80211_ht_operation *assoc_resp_ht_oper;
+	struct ieee80211_mgmt *hdr;
 
 	if (!priv->attempted_bss_desc) {
 		mwifiex_dbg(priv->adapter, ERROR,
@@ -641,7 +672,19 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 		goto done;
 	}
 
-	assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params;
+	if (adapter->host_mlme) {
+		hdr = (struct ieee80211_mgmt *)&resp->params;
+		if (!memcmp(hdr->bssid,
+			    priv->attempted_bss_desc->mac_address,
+			    ETH_ALEN))
+			assoc_rsp = (struct ieee_types_assoc_rsp *)
+				&hdr->u.assoc_resp;
+		else
+			assoc_rsp =
+				(struct ieee_types_assoc_rsp *)&resp->params;
+	} else {
+		assoc_rsp = (struct ieee_types_assoc_rsp *)&resp->params;
+	}
 
 	cap_info = le16_to_cpu(assoc_rsp->cap_info_bitmap);
 	status_code = le16_to_cpu(assoc_rsp->status_code);
@@ -778,7 +821,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 
 	priv->adapter->dbg.num_cmd_assoc_success++;
 
-	mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_RESP: associated\n");
+	mwifiex_dbg(priv->adapter, MSG, "assoc: associated with %pM\n",
+		    priv->attempted_bss_desc->mac_address);
 
 	/* Add the ra_list here for infra mode as there will be only 1 ra
 	   always */
@@ -1491,6 +1535,20 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
 	if (!priv->media_connected)
 		return 0;
 
+	if (priv->adapter->host_mlme) {
+		priv->auth_flag = 0;
+		priv->auth_alg = 0xFFFF;
+		priv->host_mlme_reg = false;
+		priv->mgmt_frame_mask = 0;
+		if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
+				     HostCmd_ACT_GEN_SET, 0,
+				     &priv->mgmt_frame_mask, false)) {
+			mwifiex_dbg(priv->adapter, ERROR,
+				    "could not unregister mgmt frame rx\n");
+			return -1;
+		}
+	}
+
 	switch (priv->bss_mode) {
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_P2P_CLIENT:
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index d263eae6078c..83449ad84d15 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -384,6 +384,7 @@ struct ieee_types_aid {
 
 struct mwifiex_bssdescriptor {
 	u8 mac_address[ETH_ALEN];
+	struct cfg80211_bss *bss;
 	struct cfg80211_ssid ssid;
 	u32 privacy;
 	s32 rssi;
@@ -426,6 +427,8 @@ struct mwifiex_bssdescriptor {
 	u16 wpa_offset;
 	struct ieee_types_generic *bcn_rsn_ie;
 	u16 rsn_offset;
+	struct ieee_types_generic *bcn_rsnx_ie;
+	u16 rsnx_offset;
 	struct ieee_types_generic *bcn_wapi_ie;
 	u16 wapi_offset;
 	u8 *beacon_buf;
@@ -527,6 +530,8 @@ struct mwifiex_private {
 	u8 bss_priority;
 	u8 bss_num;
 	u8 bss_started;
+	u8 auth_flag;
+	u16 auth_alg;
 	u8 frame_type;
 	u8 curr_addr[ETH_ALEN];
 	u8 media_connected;
@@ -649,6 +654,7 @@ struct mwifiex_private {
 	u16 gen_idx;
 	u8 ap_11n_enabled;
 	u8 ap_11ac_enabled;
+	bool host_mlme_reg;
 	u32 mgmt_frame_mask;
 	struct mwifiex_roc_cfg roc_cfg;
 	bool scan_aborting;
@@ -998,6 +1004,7 @@ struct mwifiex_adapter {
 	bool is_up;
 
 	bool ext_scan;
+	bool host_mlme;
 	u8 fw_api_ver;
 	u8 key_api_major_ver, key_api_minor_ver;
 	u8 max_p2p_conn, max_sta_conn;
@@ -1063,6 +1070,9 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb);
 int mwifiex_uap_recv_packet(struct mwifiex_private *priv,
 			    struct sk_buff *skb);
 
+void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv,
+				  u16 reason_code, u8 *sa);
+
 int mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 				struct sk_buff *skb);
 
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 72904c275461..7ecff7ce06e4 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -1383,6 +1383,12 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 			bss_entry->rsn_offset = (u16) (current_ptr -
 							bss_entry->beacon_buf);
 			break;
+		case WLAN_EID_RSNX:
+			bss_entry->bcn_rsnx_ie =
+				(struct ieee_types_generic *)current_ptr;
+			bss_entry->rsnx_offset =
+				(u16)(current_ptr - bss_entry->beacon_buf);
+			break;
 		case WLAN_EID_BSS_AC_ACCESS_DELAY:
 			bss_entry->bcn_wapi_ie =
 				(struct ieee_types_generic *) current_ptr;
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 6462a0ffe698..f5039d158f46 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -331,6 +331,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = {
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = false,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
@@ -346,6 +347,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
@@ -361,6 +363,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
@@ -376,6 +379,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
 	.can_dump_fw = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = {
@@ -392,6 +396,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = {
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8978 = {
@@ -408,6 +413,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8978 = {
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = {
@@ -425,6 +431,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = {
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
@@ -440,6 +447,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
 	.can_dump_fw = false,
 	.can_auto_tdls = true,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8987 = {
@@ -456,6 +464,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8987 = {
 	.fw_dump_enh = true,
 	.can_auto_tdls = true,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
@@ -471,6 +480,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.host_mlme = false,
 };
 
 static struct memory_type_mapping generic_mem_type_map[] = {
@@ -563,6 +573,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 		card->fw_dump_enh = data->fw_dump_enh;
 		card->can_auto_tdls = data->can_auto_tdls;
 		card->can_ext_scan = data->can_ext_scan;
+		card->host_mlme = data->host_mlme;
 		INIT_WORK(&card->work, mwifiex_sdio_work);
 	}
 
@@ -2493,6 +2504,8 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 		adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl);
 	}
 
+	adapter->host_mlme = card->host_mlme;
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h
index b86a9263a6a8..4f253d8cae42 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.h
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
@@ -255,6 +255,7 @@ struct sdio_mmc_card {
 	bool fw_dump_enh;
 	bool can_auto_tdls;
 	bool can_ext_scan;
+	bool host_mlme;
 
 	struct mwifiex_sdio_mpa_tx mpa_tx;
 	struct mwifiex_sdio_mpa_rx mpa_rx;
@@ -278,6 +279,7 @@ struct mwifiex_sdio_device {
 	bool fw_dump_enh;
 	bool can_auto_tdls;
 	bool can_ext_scan;
+	bool host_mlme;
 };
 
 /*
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index df9cdd10a494..69426ddd9c3a 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -135,6 +135,9 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code,
 
 	priv->media_connected = false;
 
+	priv->auth_flag = 0;
+	priv->auth_alg = 0xFFFF;
+
 	priv->scan_block = false;
 	priv->port_open = false;
 
@@ -999,10 +1002,17 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 	case EVENT_REMAIN_ON_CHAN_EXPIRED:
 		mwifiex_dbg(adapter, EVENT,
 			    "event: Remain on channel expired\n");
-		cfg80211_remain_on_channel_expired(&priv->wdev,
-						   priv->roc_cfg.cookie,
-						   &priv->roc_cfg.chan,
-						   GFP_ATOMIC);
+
+		if (adapter->host_mlme &&
+		    (priv->auth_flag & HOST_MLME_AUTH_PENDING)) {
+			priv->auth_flag = 0;
+			priv->auth_alg = 0xFFFF;
+		} else {
+			cfg80211_remain_on_channel_expired(&priv->wdev,
+							   priv->roc_cfg.cookie,
+							   &priv->roc_cfg.chan,
+							   GFP_ATOMIC);
+		}
 
 		memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg));
 
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index a2ad2b53f016..046541713318 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -136,6 +136,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
 	const struct cfg80211_bss_ies *ies;
 
 	rcu_read_lock();
+	bss_desc->bss = bss;
 	ies = rcu_dereference(bss->ies);
 	beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC);
 	beacon_ie_len = ies->len;
@@ -339,7 +340,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
 			ret = mwifiex_associate(priv, bss_desc);
 		}
 
-		if (bss)
+		if (bss && !priv->adapter->host_mlme)
 			cfg80211_put_bss(priv->adapter->wiphy, bss);
 	} else {
 		/* Adhoc mode */
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_tx.c b/drivers/net/wireless/marvell/mwifiex/sta_tx.c
index 70c2790b8e35..9d0ef04ebe02 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_tx.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_tx.c
@@ -36,7 +36,7 @@ void mwifiex_process_sta_txpd(struct mwifiex_private *priv,
 	struct txpd *local_tx_pd;
 	struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
 	unsigned int pad;
-	u16 pkt_type, pkt_offset;
+	u16 pkt_type, pkt_length, pkt_offset;
 	int hroom = adapter->intf_hdr_len;
 
 	pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
@@ -49,9 +49,10 @@ void mwifiex_process_sta_txpd(struct mwifiex_private *priv,
 	memset(local_tx_pd, 0, sizeof(struct txpd));
 	local_tx_pd->bss_num = priv->bss_num;
 	local_tx_pd->bss_type = priv->bss_type;
-	local_tx_pd->tx_pkt_length = cpu_to_le16((u16)(skb->len -
-						       (sizeof(struct txpd) +
-							pad)));
+	pkt_length = (u16)(skb->len - (sizeof(struct txpd) + pad));
+	if (pkt_type == PKT_TYPE_MGMT)
+		pkt_length -= MWIFIEX_MGMT_FRAME_HEADER_SIZE;
+	local_tx_pd->tx_pkt_length = cpu_to_le16(pkt_length);
 
 	local_tx_pd->priority = (u8) skb->priority;
 	local_tx_pd->pkt_delay_2ms =
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index e78a201cd150..eb0b8016d43d 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -743,6 +743,29 @@ mwifiex_cmd_uap_sys_config(struct host_cmd_ds_command *cmd, u16 cmd_action,
 	return 0;
 }
 
+/* This function prepares AP start up command with or without host MLME
+ */
+static int mwifiex_cmd_uap_bss_start(struct mwifiex_private *priv,
+				     struct host_cmd_ds_command *cmd)
+{
+	struct mwifiex_ie_types_host_mlme *tlv;
+
+	cmd->command = cpu_to_le16(HostCmd_CMD_UAP_BSS_START);
+	cmd->size = S_DS_GEN;
+
+	if (priv->adapter->host_mlme) {
+		tlv = (struct mwifiex_ie_types_host_mlme *)((u8 *)cmd + cmd->size);
+		tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME);
+		tlv->header.len = cpu_to_le16(sizeof(tlv->host_mlme));
+		tlv->host_mlme = 1;
+		cmd->size += sizeof(struct mwifiex_ie_types_host_mlme);
+	}
+
+	cmd->size = cpu_to_le16(cmd->size);
+
+	return 0;
+}
+
 /* This function prepares AP specific deauth command with mac supplied in
  * function parameter.
  */
@@ -777,6 +800,9 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
 			return -1;
 		break;
 	case HostCmd_CMD_UAP_BSS_START:
+		if (mwifiex_cmd_uap_bss_start(priv, cmd))
+			return -1;
+		break;
 	case HostCmd_CMD_UAP_BSS_STOP:
 	case HOST_CMD_APCMD_SYS_RESET:
 	case HOST_CMD_APCMD_STA_LIST:
diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index 745b1d925b21..23675c1cecae 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -370,6 +370,46 @@ mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len,
 
 	return 0;
 }
+
+/* This function sends deauth packet to the kernel. */
+void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv,
+				  u16 reason_code, u8 *sa)
+{
+	u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+	u8 frame_buf[100];
+	struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)frame_buf;
+
+	memset(frame_buf, 0, sizeof(frame_buf));
+	mgmt->frame_control = (__force __le16)IEEE80211_STYPE_DEAUTH;
+	mgmt->duration = 0;
+	mgmt->seq_ctrl = 0;
+	mgmt->u.deauth.reason_code = (__force __le16)reason_code;
+
+	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) {
+		memcpy(mgmt->da, broadcast_addr, ETH_ALEN);
+		memcpy(mgmt->sa,
+		       priv->curr_bss_params.bss_descriptor.mac_address,
+		       ETH_ALEN);
+		memcpy(mgmt->bssid, priv->cfg_bssid, ETH_ALEN);
+		priv->auth_flag = 0;
+		priv->auth_alg = 0xFFFF;
+	} else {
+		memcpy(mgmt->da, priv->curr_addr, ETH_ALEN);
+		memcpy(mgmt->sa, sa, ETH_ALEN);
+		memcpy(mgmt->bssid, priv->curr_addr, ETH_ALEN);
+	}
+
+	if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) {
+		wiphy_lock(priv->wdev.wiphy);
+		cfg80211_rx_mlme_mgmt(priv->netdev, frame_buf, 26);
+		wiphy_unlock(priv->wdev.wiphy);
+	} else {
+		cfg80211_rx_mgmt(&priv->wdev,
+				 priv->bss_chandef.chan->center_freq,
+				 0, frame_buf, 26, 0);
+	}
+}
+
 /*
  * This function processes the received management packet and send it
  * to the kernel.
@@ -417,6 +457,39 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 	pkt_len -= ETH_ALEN;
 	rx_pd->rx_pkt_length = cpu_to_le16(pkt_len);
 
+	if (priv->host_mlme_reg &&
+	    (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP) &&
+	    (ieee80211_is_auth(ieee_hdr->frame_control) ||
+	     ieee80211_is_deauth(ieee_hdr->frame_control) ||
+	     ieee80211_is_disassoc(ieee_hdr->frame_control))) {
+		if (ieee80211_is_auth(ieee_hdr->frame_control)) {
+			if (priv->auth_flag & HOST_MLME_AUTH_PENDING) {
+				if (priv->auth_alg != WLAN_AUTH_SAE) {
+					priv->auth_flag &=
+						~HOST_MLME_AUTH_PENDING;
+					priv->auth_flag |=
+						HOST_MLME_AUTH_DONE;
+				}
+			} else {
+				return 0;
+			}
+
+			mwifiex_dbg(priv->adapter, MSG,
+				    "auth: receive authentication from %pM\n",
+				    ieee_hdr->addr3);
+		} else {
+			if (!priv->wdev.connected)
+				return 0;
+
+			if (ieee80211_is_deauth(ieee_hdr->frame_control)) {
+				priv->auth_flag = 0;
+				priv->auth_alg = 0xFFFF;
+			}
+		}
+
+		cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len);
+	}
+
 	cfg80211_rx_mgmt(&priv->wdev, priv->roc_cfg.chan.center_freq,
 			 CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len,
 			 0);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
  2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:15   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 03/12] wifi: mwifiex: fixed reassocation " David Lin
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

If host mlme is enabled, gropu rekey offload should be disabled.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +++
 drivers/net/wireless/marvell/mwifiex/main.c     | 4 ++++
 drivers/net/wireless/marvell/mwifiex/util.c     | 7 +++++++
 3 files changed, 14 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 40c39e4765f7..3d59e6a441b9 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -3657,6 +3657,9 @@ static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
 	if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info))
 		return -EOPNOTSUPP;
 
+	if (priv->adapter->host_mlme)
+		return 0;
+
 	return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
 				HostCmd_ACT_GEN_SET, 0, data, true);
 }
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index d99127dc466e..3bebb6c37604 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct mwifiex_private *priv,
 			    "bypass txqueue; eth type %#x, mgmt %d\n",
 			     ntohs(eth_hdr->h_proto),
 			     mwifiex_is_skb_mgmt_frame(skb));
+		if (ntohs(eth_hdr->h_proto) == ETH_P_PAE)
+			mwifiex_dbg(priv->adapter, MSG,
+				    "key: send EAPOL to %pM\n",
+				    eth_hdr->h_dest);
 		return true;
 	}
 
diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index 23675c1cecae..ff1b2f162c30 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -482,8 +482,15 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 				return 0;
 
 			if (ieee80211_is_deauth(ieee_hdr->frame_control)) {
+				mwifiex_dbg(priv->adapter, MSG,
+					    "auth: receive deauth from %pM\n",
+					    ieee_hdr->addr3);
 				priv->auth_flag = 0;
 				priv->auth_alg = 0xFFFF;
+			} else {
+				mwifiex_dbg(priv->adapter, MSG,
+					    "assoc: receive disasso from %pM\n",
+					    ieee_hdr->addr3);
 			}
 		}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 03/12] wifi: mwifiex: fixed reassocation issue for WPA3.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
  2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
  2023-11-28  8:31 ` [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3 David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:17   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req David Lin
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

This issue is related to resatart/reconfigure AP.

When AP is restarted or reconfigured, wpa_supplilcant will use cached
PMKSA to do association to AP.
Because association failure does not report to cfg80211/wpa_supplicant,
wpa_supplicant will always use cached PMKSA to do assocaiton.
Connection can't be established under this way.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   | 25 ++++++++-----------
 drivers/net/wireless/marvell/mwifiex/cmdevt.c | 18 +++++++++++++
 drivers/net/wireless/marvell/mwifiex/init.c   |  1 +
 drivers/net/wireless/marvell/mwifiex/main.c   |  6 +++++
 drivers/net/wireless/marvell/mwifiex/main.h   |  3 +++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 3d59e6a441b9..a21310f3807c 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4395,9 +4395,6 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 	int ret;
 	struct cfg80211_ssid req_ssid;
 	const u8 *ssid_ie;
-	struct cfg80211_rx_assoc_resp assoc_resp = {
-		.uapsd_queues = -1,
-	};
 
 	if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
 		mwifiex_dbg(adapter, ERROR,
@@ -4433,13 +4430,13 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 
 	req_ssid.ssid_len = ssid_ie[1];
 	if (req_ssid.ssid_len > IEEE80211_MAX_SSID_LEN) {
-		mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n");
+		mwifiex_dbg(adapter, ERROR, "invalid SSID - aborting\n");
 		goto ssid_err;
 	}
 
 	memcpy(req_ssid.ssid, ssid_ie + 2, req_ssid.ssid_len);
 	if (!req_ssid.ssid_len || req_ssid.ssid[0] < 0x20) {
-		mwifiex_dbg(priv->adapter, ERROR, "invalid SSID - aborting\n");
+		mwifiex_dbg(adapter, ERROR, "invalid SSID - aborting\n");
 		goto ssid_err;
 	}
 	rcu_read_unlock();
@@ -4466,25 +4463,25 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 
 	memcpy(priv->cfg_bssid, req->bss->bssid, ETH_ALEN);
 
-	mwifiex_dbg(priv->adapter, MSG,
+	mwifiex_dbg(adapter, MSG,
 		    "assoc: send association to %pM\n", req->bss->bssid);
 
-	cfg80211_ref_bss(priv->adapter->wiphy, req->bss);
+	cfg80211_ref_bss(adapter->wiphy, req->bss);
 
 	ret = mwifiex_bss_start(priv, req->bss, &req_ssid);
 
-	if (!ret) {
-		assoc_resp.links[0].bss = priv->attempted_bss_desc->bss;
-		assoc_resp.buf = priv->assoc_rsp_buf;
-		assoc_resp.len = priv->assoc_rsp_size;
-		cfg80211_rx_assoc_resp(priv->netdev,
-				       &assoc_resp);
-	} else {
+	if (ret) {
 		priv->auth_flag = 0;
 		priv->auth_alg = 0xFFFF;
 		eth_zero_addr(priv->cfg_bssid);
 	}
 
+	if (priv->assoc_rsp_size) {
+		priv->req_bss = req->bss;
+		adapter->assoc_resp_received = true;
+		queue_work(adapter->workqueue, &adapter->main_work);
+	}
+
 	cfg80211_put_bss(priv->adapter->wiphy, req->bss);
 
 	return 0;
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 311af5f40c3e..16777af50097 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -924,6 +924,24 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
 	return ret;
 }
 
+void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter)
+{
+	struct cfg80211_rx_assoc_resp assoc_resp = {
+		.uapsd_queues = -1,
+	};
+	struct mwifiex_private *priv =
+		mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
+
+	if (priv->assoc_rsp_size) {
+		assoc_resp.links[0].bss = priv->req_bss;
+		assoc_resp.buf = priv->assoc_rsp_buf;
+		assoc_resp.len = priv->assoc_rsp_size;
+		cfg80211_rx_assoc_resp(priv->netdev,
+				       &assoc_resp);
+		priv->assoc_rsp_size = 0;
+	}
+}
+
 /*
  * This function handles the timeout of command sending.
  *
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index f86a527fd7ca..4326e03a66d3 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -223,6 +223,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
 	adapter->cmd_resp_received = false;
 	adapter->event_received = false;
 	adapter->data_received = false;
+	adapter->assoc_resp_received = false;
 
 	clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags);
 
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 3bebb6c37604..1dac77946813 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -365,6 +365,12 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
 			}
 		}
 
+		/* Chekc for Assoc Resp */
+		if (adapter->assoc_resp_received) {
+			adapter->assoc_resp_received = false;
+			mwifiex_process_assoc_resp(adapter);
+		}
+
 		/* Check if we need to confirm Sleep Request
 		   received previously */
 		if (adapter->ps_state == PS_STATE_PRE_SLEEP)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 83449ad84d15..ae4b44ad6c50 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -615,6 +615,7 @@ struct mwifiex_private {
 #define MWIFIEX_ASSOC_RSP_BUF_SIZE  500
 	u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE];
 	u32 assoc_rsp_size;
+	struct cfg80211_bss *req_bss;
 
 #define MWIFIEX_GENIE_BUF_SIZE      256
 	u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE];
@@ -915,6 +916,7 @@ struct mwifiex_adapter {
 	u8 cmd_resp_received;
 	u8 event_received;
 	u8 data_received;
+	u8 assoc_resp_received;
 	u16 seq_num;
 	struct cmd_ctrl_node *cmd_pool;
 	struct cmd_ctrl_node *curr_cmd;
@@ -1104,6 +1106,7 @@ void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
 
 int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter);
 int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter);
+void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter);
 int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
 			     struct sk_buff *skb);
 int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (2 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 03/12] wifi: mwifiex: fixed reassocation " David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:18   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode David Lin
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Remain on channel must be removed after authentication is done.
Otherwise WMM setting for assoiation request will be removed.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index a21310f3807c..b99de9f4ca14 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4306,6 +4306,8 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy,
 		if (!ret) {
 			priv->roc_cfg.cookie = get_random_u32() | 1;
 			priv->roc_cfg.chan = *req->bss->channel;
+		} else {
+			return -EFAULT;
 		}
 	}
 
@@ -4418,6 +4420,16 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 	if (priv->auth_flag && !(priv->auth_flag & HOST_MLME_AUTH_DONE))
 		return -EBUSY;
 
+	if (priv->roc_cfg.cookie) {
+		ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE,
+						 &priv->roc_cfg.chan, 0);
+		if (!ret)
+			memset(&priv->roc_cfg, 0,
+			       sizeof(struct mwifiex_roc_cfg));
+		else
+			return -EFAULT;
+	}
+
 	if (!mwifiex_stop_bg_scan(priv))
 		cfg80211_sched_scan_stopped_locked(priv->wdev.wiphy, 0);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (3 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-11-28  8:31 ` [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config David Lin
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Added code to support host mlme for AP mode and let WPA3 work.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   |  81 +++++++++-
 drivers/net/wireless/marvell/mwifiex/cmdevt.c |   2 +
 drivers/net/wireless/marvell/mwifiex/fw.h     |  22 ++-
 drivers/net/wireless/marvell/mwifiex/ioctl.h  |   5 +
 .../wireless/marvell/mwifiex/sta_cmdresp.c    |   2 +
 .../net/wireless/marvell/mwifiex/uap_cmd.c    | 148 ++++++++++++++++++
 drivers/net/wireless/marvell/mwifiex/util.c   |  24 +++
 7 files changed, 276 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index b99de9f4ca14..2968db643ab4 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -246,6 +246,26 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		return 0;
 	}
 
+	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) {
+		if (ieee80211_is_auth(mgmt->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "auth: send auth to %pM\n", mgmt->da);
+		if (ieee80211_is_deauth(mgmt->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "auth: send deauth to %pM\n", mgmt->da);
+		if (ieee80211_is_disassoc(mgmt->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: send disassoc to %pM\n", mgmt->da);
+		if (ieee80211_is_assoc_resp(mgmt->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: send assoc resp to %pM\n",
+				    mgmt->da);
+		if (ieee80211_is_reassoc_resp(mgmt->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: send reassoc resp to %pM\n",
+				    mgmt->da);
+	}
+
 	pkt_len = len + ETH_ALEN;
 	skb = dev_alloc_skb(MWIFIEX_MIN_DATA_HEADER_LEN +
 			    MWIFIEX_MGMT_FRAME_HEADER_SIZE +
@@ -293,7 +313,8 @@ mwifiex_cfg80211_update_mgmt_frame_registrations(struct wiphy *wiphy,
 
 	if (mask != priv->mgmt_frame_mask) {
 		priv->mgmt_frame_mask = mask;
-		if (priv->host_mlme_reg)
+		if (priv->host_mlme_reg &&
+		    GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP)
 			priv->mgmt_frame_mask |= HOST_MLME_MGMT_MASK;
 		mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
 				 HostCmd_ACT_GEN_SET, 0,
@@ -530,6 +551,9 @@ mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
 
 	wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index);
 
+	if (priv->adapter->host_mlme)
+		return 0;
+
 	memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
 	encrypt_key.key_len = WLAN_KEY_LEN_CCMP;
 	encrypt_key.key_index = key_index;
@@ -1746,10 +1770,14 @@ mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = {
 		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
 	},
 	[NL80211_IFTYPE_AP] = {
-		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
-		      BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
-		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
-		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+		.tx = 0xffff,
+		.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+		      BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+		      BIT(IEEE80211_STYPE_AUTH >> 4) |
+		      BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+		      BIT(IEEE80211_STYPE_ACTION >> 4),
 	},
 	[NL80211_IFTYPE_P2P_CLIENT] = {
 		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
@@ -3974,12 +4002,43 @@ mwifiex_cfg80211_tdls_cancel_chan_switch(struct wiphy *wiphy,
 	}
 }
 
+static int
+mwifiex_cfg80211_uap_add_station(struct mwifiex_private *priv, const u8 *mac,
+				 struct station_parameters *params)
+{
+	struct mwifiex_sta_info add_sta;
+	int ret;
+
+	memcpy(add_sta.peer_mac, mac, ETH_ALEN);
+	add_sta.params = params;
+
+	ret = mwifiex_send_cmd(priv, HostCmd_CMD_ADD_NEW_STATION,
+			       HostCmd_ACT_ADD_STA, 0, (void *)&add_sta, true);
+
+	if (!ret) {
+		struct station_info *sinfo = NULL;
+
+		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
+
+		if (sinfo) {
+			cfg80211_new_sta(priv->netdev, mac, sinfo, GFP_KERNEL);
+			kfree(sinfo);
+		}
+	}
+
+	return ret;
+}
+
 static int
 mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev,
 			     const u8 *mac, struct station_parameters *params)
 {
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
+	if (priv->adapter->host_mlme &&
+	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP))
+		return mwifiex_cfg80211_uap_add_station(priv, mac, params);
+
 	if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)))
 		return -EOPNOTSUPP;
 
@@ -4217,6 +4276,10 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev,
 	int ret;
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
+	if (priv->adapter->host_mlme &&
+	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP))
+		return 0;
+
 	/* we support change_station handler only for TDLS peers*/
 	if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)))
 		return -EOPNOTSUPP;
@@ -4727,14 +4790,18 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 
 	ether_addr_copy(wiphy->perm_addr, adapter->perm_addr);
 	wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
-	wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
-			WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
+	wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
 			WIPHY_FLAG_AP_UAPSD |
 			WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
 			WIPHY_FLAG_HAS_CHANNEL_SWITCH |
 			WIPHY_FLAG_NETNS_OK |
 			WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
+	if (adapter->host_mlme)
+		wiphy->flags |= WIPHY_FLAG_REPORTS_OBSS;
+	else
+		wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME;
+
 	if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info))
 		wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
 				WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 16777af50097..c8d94cc6706f 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -635,6 +635,8 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
 		case HostCmd_CMD_UAP_STA_DEAUTH:
 		case HOST_CMD_APCMD_SYS_RESET:
 		case HOST_CMD_APCMD_STA_LIST:
+		case HostCmd_CMD_CHAN_REPORT_REQUEST:
+		case HostCmd_CMD_ADD_NEW_STATION:
 			ret = mwifiex_uap_prepare_cmd(priv, cmd_no, cmd_action,
 						      cmd_oid, data_buf,
 						      cmd_ptr);
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 8b22cd993a79..7080f8701952 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -210,9 +210,9 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define TLV_TYPE_CHAN_ATTR_CFG      (PROPRIETARY_TLV_BASE_ID + 237)
 #define TLV_TYPE_MAX_CONN           (PROPRIETARY_TLV_BASE_ID + 279)
 #define TLV_TYPE_HOST_MLME          (PROPRIETARY_TLV_BASE_ID + 307)
+#define TLV_TYPE_UAP_STA_FLAGS      (PROPRIETARY_TLV_BASE_ID + 313)
 #define TLV_TYPE_SAE_PWE_MODE       (PROPRIETARY_TLV_BASE_ID + 339)
 
-
 #define MWIFIEX_TX_DATA_BUF_SIZE_2K        2048
 
 #define SSN_MASK         0xfff0
@@ -407,6 +407,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define HostCmd_CMD_STA_CONFIGURE		      0x023f
 #define HostCmd_CMD_CHAN_REGION_CFG		      0x0242
 #define HostCmd_CMD_PACKET_AGGR_CTRL		      0x0251
+#define HostCmd_CMD_ADD_NEW_STATION		      0x025f
 
 #define PROTOCOL_NO_SECURITY        0x01
 #define PROTOCOL_STATIC_WEP         0x02
@@ -417,6 +418,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define KEY_MGMT_NONE               0x04
 #define KEY_MGMT_PSK                0x02
 #define KEY_MGMT_EAP                0x01
+#define KEY_MGMT_SAE                0x400
 #define CIPHER_TKIP                 0x04
 #define CIPHER_AES_CCMP             0x08
 #define VALID_CIPHER_BITMAP         0x0c
@@ -502,6 +504,9 @@ enum mwifiex_channel_flags {
 #define HostCmd_ACT_GET_TX              0x0008
 #define HostCmd_ACT_GET_BOTH            0x000c
 
+#define HostCmd_ACT_REMOVE_STA          0x0
+#define HostCmd_ACT_ADD_STA             0x1
+
 #define RF_ANTENNA_AUTO                 0xFFFF
 
 #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
@@ -2312,6 +2317,20 @@ struct host_cmd_ds_sta_configure {
 	u8 tlv_buffer[];
 } __packed;
 
+struct mwifiex_ie_types_sta_flag {
+	struct mwifiex_ie_types_header header;
+	__le32 sta_flags;
+} __packed;
+
+struct host_cmd_ds_add_station {
+	__le16 action;
+	__le16 aid;
+	u8 peer_mac[ETH_ALEN];
+	__le32 listen_interval;
+	__le16 cap_info;
+	u8 tlv[];
+} __packed;
+
 struct host_cmd_ds_command {
 	__le16 command;
 	__le16 size;
@@ -2390,6 +2409,7 @@ struct host_cmd_ds_command {
 		struct host_cmd_ds_chan_region_cfg reg_cfg;
 		struct host_cmd_ds_pkt_aggr_ctrl pkt_aggr_ctrl;
 		struct host_cmd_ds_sta_configure sta_cfg;
+		struct host_cmd_ds_add_station sta_info;
 	} params;
 } __packed;
 
diff --git a/drivers/net/wireless/marvell/mwifiex/ioctl.h b/drivers/net/wireless/marvell/mwifiex/ioctl.h
index 091e7ca79376..80ba79ca74c5 100644
--- a/drivers/net/wireless/marvell/mwifiex/ioctl.h
+++ b/drivers/net/wireless/marvell/mwifiex/ioctl.h
@@ -157,6 +157,11 @@ struct mwifiex_bss_info {
 	u8 bssid[ETH_ALEN];
 };
 
+struct mwifiex_sta_info {
+	u8 peer_mac[ETH_ALEN];
+	struct station_parameters *params;
+};
+
 #define MAX_NUM_TID     8
 
 #define MAX_RX_WINSIZE  64
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
index 7b69d27e0c0e..9c53825f222d 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
@@ -1398,6 +1398,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
 		break;
 	case HostCmd_CMD_UAP_STA_DEAUTH:
 		break;
+	case HostCmd_CMD_ADD_NEW_STATION:
+		break;
 	case HOST_CMD_APCMD_SYS_RESET:
 		break;
 	case HostCmd_CMD_MEF_CFG:
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index eb0b8016d43d..91a8a581e3f5 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -72,6 +72,10 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
 				bss_config->key_mgmt = KEY_MGMT_PSK;
 			}
 			break;
+		case WLAN_AKM_SUITE_SAE:
+			bss_config->protocol = PROTOCOL_WPA2;
+			bss_config->key_mgmt = KEY_MGMT_SAE;
+			break;
 		default:
 			break;
 		}
@@ -783,6 +787,145 @@ static int mwifiex_cmd_uap_sta_deauth(struct mwifiex_private *priv,
 	return 0;
 }
 
+/* This function prepares AP specific add station command.
+ */
+static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv,
+				       struct host_cmd_ds_command *cmd,
+				       u16 cmd_action, void *data_buf)
+{
+	struct host_cmd_ds_add_station *new_sta = &cmd->params.sta_info;
+	struct mwifiex_sta_info *add_sta = (struct mwifiex_sta_info *)data_buf;
+	struct station_parameters *params = add_sta->params;
+	struct mwifiex_sta_node *sta_ptr;
+	u8 *pos;
+	u8 qos_capa;
+	u16 header_len = sizeof(struct mwifiex_ie_types_header);
+	u16 tlv_len;
+	struct mwifiex_ie_types_header *tlv;
+	struct mwifiex_ie_types_sta_flag *sta_flag;
+	int i;
+
+	cmd->command = cpu_to_le16(HostCmd_CMD_ADD_NEW_STATION);
+	new_sta->action = cpu_to_le16(cmd_action);
+	cmd->size = sizeof(struct host_cmd_ds_add_station) + S_DS_GEN;
+
+	if (cmd_action == HostCmd_ACT_ADD_STA)
+		sta_ptr = mwifiex_add_sta_entry(priv, add_sta->peer_mac);
+	else
+		sta_ptr = mwifiex_get_sta_entry(priv, add_sta->peer_mac);
+
+	if (!sta_ptr)
+		return -1;
+
+	memcpy(new_sta->peer_mac, add_sta->peer_mac, ETH_ALEN);
+
+	if (cmd_action == HostCmd_ACT_REMOVE_STA)
+		goto done;
+
+	new_sta->aid = cpu_to_le16(params->aid);
+	new_sta->listen_interval = cpu_to_le32(params->listen_interval);
+	new_sta->cap_info = cpu_to_le16(params->capability);
+
+	pos = new_sta->tlv;
+
+	if (params->sta_flags_set & NL80211_STA_FLAG_WME)
+		sta_ptr->is_wmm_enabled = 1;
+	sta_flag = (struct mwifiex_ie_types_sta_flag *)pos;
+	sta_flag->header.type = cpu_to_le16(TLV_TYPE_UAP_STA_FLAGS);
+	sta_flag->header.len = cpu_to_le16(sizeof(__le32));
+	sta_flag->sta_flags = cpu_to_le32(params->sta_flags_set);
+	pos += sizeof(struct mwifiex_ie_types_sta_flag);
+	cmd->size += sizeof(struct mwifiex_ie_types_sta_flag);
+
+	if (params->ext_capab_len) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
+		tlv_len = params->ext_capab_len;
+		tlv->len = cpu_to_le16(tlv_len);
+		memcpy(tlv + header_len, params->ext_capab, tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+	}
+
+	if (params->link_sta_params.supported_rates_len) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_SUPP_RATES);
+		tlv_len = params->link_sta_params.supported_rates_len;
+		tlv->len = cpu_to_le16(tlv_len);
+		memcpy(tlv + header_len,
+		       params->link_sta_params.supported_rates, tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+	}
+
+	if (params->uapsd_queues || params->max_sp) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_QOS_CAPA);
+		tlv_len = sizeof(qos_capa);
+		tlv->len = cpu_to_le16(tlv_len);
+		qos_capa = params->uapsd_queues | (params->max_sp << 5);
+		memcpy(tlv + header_len, &qos_capa, tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+		sta_ptr->is_wmm_enabled = 1;
+	}
+
+	if (params->link_sta_params.ht_capa) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
+		tlv_len = sizeof(struct ieee80211_ht_cap);
+		tlv->len = cpu_to_le16(tlv_len);
+		memcpy(tlv + header_len, params->link_sta_params.ht_capa,
+		       tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+		sta_ptr->is_11n_enabled = 1;
+		sta_ptr->max_amsdu =
+			le16_to_cpu(params->link_sta_params.ht_capa->cap_info) &
+			IEEE80211_HT_CAP_MAX_AMSDU ?
+			MWIFIEX_TX_DATA_BUF_SIZE_8K :
+			MWIFIEX_TX_DATA_BUF_SIZE_4K;
+	}
+
+	if (params->link_sta_params.vht_capa) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY);
+		tlv_len = sizeof(struct ieee80211_vht_cap);
+		tlv->len = cpu_to_le16(tlv_len);
+		memcpy(tlv + header_len, params->link_sta_params.vht_capa,
+		       tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+		sta_ptr->is_11ac_enabled = 1;
+	}
+
+	if (params->link_sta_params.opmode_notif_used) {
+		tlv = (struct mwifiex_ie_types_header *)pos;
+		tlv->type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF);
+		tlv_len = sizeof(u8);
+		tlv->len = cpu_to_le16(tlv_len);
+		memcpy(tlv + header_len, params->link_sta_params.opmode_notif,
+		       tlv_len);
+		pos += (header_len + tlv_len);
+		cmd->size += (header_len + tlv_len);
+	}
+
+	for (i = 0; i < MAX_NUM_TID; i++) {
+		if (sta_ptr->is_11n_enabled)
+			sta_ptr->ampdu_sta[i] =
+				      priv->aggr_prio_tbl[i].ampdu_user;
+		else
+			sta_ptr->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED;
+	}
+
+	memset(sta_ptr->rx_seq, 0xff, sizeof(sta_ptr->rx_seq));
+
+done:
+	cmd->size = cpu_to_le16(cmd->size);
+
+	return 0;
+}
+
 /* This function prepares the AP specific commands before sending them
  * to the firmware.
  * This is a generic function which calls specific command preparation
@@ -818,6 +961,11 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
 							  data_buf))
 			return -1;
 		break;
+	case HostCmd_CMD_ADD_NEW_STATION:
+		if (mwifiex_cmd_uap_add_station(priv, cmd, cmd_action,
+						data_buf))
+			return -1;
+		break;
 	default:
 		mwifiex_dbg(priv->adapter, ERROR,
 			    "PREP_CMD: unknown cmd %#x\n", cmd_no);
diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index ff1b2f162c30..9e36bb4a8d67 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -497,6 +497,30 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 		cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len);
 	}
 
+	if (priv->adapter->host_mlme &&
+	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) {
+		if (ieee80211_is_auth(ieee_hdr->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "auth: receive auth from %pM\n",
+				    ieee_hdr->addr2);
+		if (ieee80211_is_deauth(ieee_hdr->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "auth: receive deauth from %pM\n",
+				    ieee_hdr->addr2);
+		if (ieee80211_is_disassoc(ieee_hdr->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: receive disassoc from %pM\n",
+				    ieee_hdr->addr2);
+		if (ieee80211_is_assoc_req(ieee_hdr->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: receive assoc req from %pM\n",
+				    ieee_hdr->addr2);
+		if (ieee80211_is_reassoc_req(ieee_hdr->frame_control))
+			mwifiex_dbg(priv->adapter, MSG,
+				    "assoc: receive reassoc req from %pM\n",
+				    ieee_hdr->addr2);
+	}
+
 	cfg80211_rx_mgmt(&priv->wdev, priv->roc_cfg.chan.center_freq,
 			 CAL_RSSI(rx_pd->snr, rx_pd->nf), skb->data, pkt_len,
 			 0);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (4 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:31   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd David Lin
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Added TLV command TLV_TYPE_UAP_MAC_ADDRESS for AP configuration.

Without this TLV command, client can't connect to AP after restart of
hostapd.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 ++
 drivers/net/wireless/marvell/mwifiex/fw.h       | 1 +
 drivers/net/wireless/marvell/mwifiex/ioctl.h    | 1 +
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c  | 8 ++++++++
 4 files changed, 12 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 2968db643ab4..40ab3e8d0c1c 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2103,6 +2103,8 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
 
 	mwifiex_set_sys_config_invalid_data(bss_cfg);
 
+	memcpy(bss_cfg->mac_addr, priv->curr_addr, ETH_ALEN);
+
 	if (params->beacon_interval)
 		bss_cfg->beacon_period = params->beacon_interval;
 	if (params->dtim_period)
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 7080f8701952..699c7ffcd0e5 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -165,6 +165,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define TLV_TYPE_STA_MAC_ADDR       (PROPRIETARY_TLV_BASE_ID + 32)
 #define TLV_TYPE_BSSID              (PROPRIETARY_TLV_BASE_ID + 35)
 #define TLV_TYPE_CHANNELBANDLIST    (PROPRIETARY_TLV_BASE_ID + 42)
+#define TLV_TYPE_UAP_MAC_ADDRESS    (PROPRIETARY_TLV_BASE_ID + 43)
 #define TLV_TYPE_UAP_BEACON_PERIOD  (PROPRIETARY_TLV_BASE_ID + 44)
 #define TLV_TYPE_UAP_DTIM_PERIOD    (PROPRIETARY_TLV_BASE_ID + 45)
 #define TLV_TYPE_UAP_BCAST_SSID     (PROPRIETARY_TLV_BASE_ID + 48)
diff --git a/drivers/net/wireless/marvell/mwifiex/ioctl.h b/drivers/net/wireless/marvell/mwifiex/ioctl.h
index 80ba79ca74c5..fbbb5aafb803 100644
--- a/drivers/net/wireless/marvell/mwifiex/ioctl.h
+++ b/drivers/net/wireless/marvell/mwifiex/ioctl.h
@@ -83,6 +83,7 @@ struct wep_key {
 #define MWIFIEX_OPERATING_CLASSES		16
 
 struct mwifiex_uap_bss_param {
+	u8 mac_addr[ETH_ALEN];
 	u8 channel;
 	u8 band_cfg;
 	u16 rts_threshold;
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index 91a8a581e3f5..c1133da28bc6 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -472,6 +472,7 @@ void mwifiex_config_uap_11d(struct mwifiex_private *priv,
 static int
 mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
 {
+	struct host_cmd_tlv_mac_addr *mac_tlv;
 	struct host_cmd_tlv_dtim_period *dtim_period;
 	struct host_cmd_tlv_beacon_period *beacon_period;
 	struct host_cmd_tlv_ssid *ssid;
@@ -491,6 +492,13 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
 	int i;
 	u16 cmd_size = *param_size;
 
+	mac_tlv = (struct host_cmd_tlv_mac_addr *)tlv;
+	mac_tlv->header.type = cpu_to_le16(TLV_TYPE_UAP_MAC_ADDRESS);
+	mac_tlv->header.len = cpu_to_le16(ETH_ALEN);
+	memcpy(mac_tlv->mac_addr, bss_cfg->mac_addr, ETH_ALEN);
+	cmd_size += sizeof(struct host_cmd_tlv_mac_addr);
+	tlv += sizeof(struct host_cmd_tlv_mac_addr);
+
 	if (bss_cfg->ssid.ssid_len) {
 		ssid = (struct host_cmd_tlv_ssid *)tlv;
 		ssid->header.type = cpu_to_le16(TLV_TYPE_UAP_SSID);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (5 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:36   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout David Lin
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

TLV commands setting for host command HostCmd_CMD_ADD_NEW_STATION is
not correct. This issue will set wrong station information to firmware.

Without this patch, transmission will get 50-70% low throughput for host
mlme AP mode.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/uap_cmd.c    | 52 +++++++++----------
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index c1133da28bc6..eb7e39146b8a 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -809,7 +809,7 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv,
 	u8 qos_capa;
 	u16 header_len = sizeof(struct mwifiex_ie_types_header);
 	u16 tlv_len;
-	struct mwifiex_ie_types_header *tlv;
+	struct mwifiex_ie_types_data *tlv;
 	struct mwifiex_ie_types_sta_flag *sta_flag;
 	int i;
 
@@ -846,45 +846,44 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv,
 	cmd->size += sizeof(struct mwifiex_ie_types_sta_flag);
 
 	if (params->ext_capab_len) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
 		tlv_len = params->ext_capab_len;
-		tlv->len = cpu_to_le16(tlv_len);
-		memcpy(tlv + header_len, params->ext_capab, tlv_len);
+		tlv->header.len = cpu_to_le16(tlv_len);
+		memcpy(tlv->data, params->ext_capab, tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
 	}
 
 	if (params->link_sta_params.supported_rates_len) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_SUPP_RATES);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES);
 		tlv_len = params->link_sta_params.supported_rates_len;
-		tlv->len = cpu_to_le16(tlv_len);
-		memcpy(tlv + header_len,
+		tlv->header.len = cpu_to_le16(tlv_len);
+		memcpy(tlv->data,
 		       params->link_sta_params.supported_rates, tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
 	}
 
 	if (params->uapsd_queues || params->max_sp) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_QOS_CAPA);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_QOS_CAPA);
 		tlv_len = sizeof(qos_capa);
-		tlv->len = cpu_to_le16(tlv_len);
+		tlv->header.len = cpu_to_le16(tlv_len);
 		qos_capa = params->uapsd_queues | (params->max_sp << 5);
-		memcpy(tlv + header_len, &qos_capa, tlv_len);
+		memcpy(tlv->data, &qos_capa, tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
 		sta_ptr->is_wmm_enabled = 1;
 	}
 
 	if (params->link_sta_params.ht_capa) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY);
 		tlv_len = sizeof(struct ieee80211_ht_cap);
-		tlv->len = cpu_to_le16(tlv_len);
-		memcpy(tlv + header_len, params->link_sta_params.ht_capa,
-		       tlv_len);
+		tlv->header.len = cpu_to_le16(tlv_len);
+		memcpy(tlv->data, params->link_sta_params.ht_capa, tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
 		sta_ptr->is_11n_enabled = 1;
@@ -896,23 +895,22 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv,
 	}
 
 	if (params->link_sta_params.vht_capa) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_VHT_CAPABILITY);
 		tlv_len = sizeof(struct ieee80211_vht_cap);
-		tlv->len = cpu_to_le16(tlv_len);
-		memcpy(tlv + header_len, params->link_sta_params.vht_capa,
-		       tlv_len);
+		tlv->header.len = cpu_to_le16(tlv_len);
+		memcpy(tlv->data, params->link_sta_params.vht_capa, tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
 		sta_ptr->is_11ac_enabled = 1;
 	}
 
 	if (params->link_sta_params.opmode_notif_used) {
-		tlv = (struct mwifiex_ie_types_header *)pos;
-		tlv->type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF);
+		tlv = (struct mwifiex_ie_types_data *)pos;
+		tlv->header.type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF);
 		tlv_len = sizeof(u8);
-		tlv->len = cpu_to_le16(tlv_len);
-		memcpy(tlv + header_len, params->link_sta_params.opmode_notif,
+		tlv->header.len = cpu_to_le16(tlv_len);
+		memcpy(tlv->data, params->link_sta_params.opmode_notif,
 		       tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (6 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:37   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost David Lin
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Without this patch, if there is no association response from AP with host
mlme enabled, kernel oops will occur.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/join.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c
index ef7cc40c3ba4..00720c6840ef 100644
--- a/drivers/net/wireless/marvell/mwifiex/join.c
+++ b/drivers/net/wireless/marvell/mwifiex/join.c
@@ -723,6 +723,9 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 				mwifiex_dbg(priv->adapter, ERROR,
 					    "ASSOC_RESP: UNSPECIFIED failure\n");
 			}
+
+			if (priv->adapter->host_mlme)
+				priv->assoc_rsp_size = 0;
 		} else {
 			ret = status_code;
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (7 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:38   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme David Lin
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

If host mlme is enabled, event EVENT_LINK_LOST must be handled with
sending deauthentication to upper layers.

Without this patch, if AP is leaving and station won't receive
deauthentication from AP, station won't reconnect to AP again.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   |  3 +-
 drivers/net/wireless/marvell/mwifiex/init.c   |  2 +
 drivers/net/wireless/marvell/mwifiex/main.c   | 56 +++++++++++++++++--
 drivers/net/wireless/marvell/mwifiex/main.h   |  4 ++
 .../net/wireless/marvell/mwifiex/sta_event.c  | 18 +++++-
 5 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 40ab3e8d0c1c..588a500fe1b9 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4556,7 +4556,8 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 	if (priv->assoc_rsp_size) {
 		priv->req_bss = req->bss;
 		adapter->assoc_resp_received = true;
-		queue_work(adapter->workqueue, &adapter->main_work);
+		queue_work(adapter->host_mlme_workqueue,
+			   &adapter->host_mlme_work);
 	}
 
 	cfg80211_put_bss(priv->adapter->wiphy, req->bss);
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index 4326e03a66d3..87121018abc6 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -224,6 +224,8 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
 	adapter->event_received = false;
 	adapter->data_received = false;
 	adapter->assoc_resp_received = false;
+	adapter->priv_link_lost = NULL;
+	adapter->host_mlme_link_lost = false;
 
 	clear_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags);
 
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 1dac77946813..f8cef2673502 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -365,12 +365,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
 			}
 		}
 
-		/* Chekc for Assoc Resp */
-		if (adapter->assoc_resp_received) {
-			adapter->assoc_resp_received = false;
-			mwifiex_process_assoc_resp(adapter);
-		}
-
 		/* Check if we need to confirm Sleep Request
 		   received previously */
 		if (adapter->ps_state == PS_STATE_PRE_SLEEP)
@@ -536,6 +530,11 @@ static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter)
 		destroy_workqueue(adapter->rx_workqueue);
 		adapter->rx_workqueue = NULL;
 	}
+
+	if (adapter->host_mlme_workqueue) {
+		destroy_workqueue(adapter->host_mlme_workqueue);
+		adapter->host_mlme_workqueue = NULL;
+	}
 }
 
 /*
@@ -1394,6 +1393,35 @@ int is_command_pending(struct mwifiex_adapter *adapter)
 	return !is_cmd_pend_q_empty;
 }
 
+/* This is the host mlme work queue function.
+ * It handles the host mlme operations.
+ */
+static void mwifiex_host_mlme_work_queue(struct work_struct *work)
+{
+	struct mwifiex_adapter *adapter =
+		container_of(work, struct mwifiex_adapter, host_mlme_work);
+
+	if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags))
+		return;
+
+	/* Check for host mlme disconnection */
+	if (adapter->host_mlme_link_lost) {
+		if (adapter->priv_link_lost) {
+			mwifiex_reset_connect_state(adapter->priv_link_lost,
+						    WLAN_REASON_DEAUTH_LEAVING,
+						    true);
+			adapter->priv_link_lost = NULL;
+		}
+		adapter->host_mlme_link_lost = false;
+	}
+
+	/* Check for host mlme Assoc Resp */
+	if (adapter->assoc_resp_received) {
+		mwifiex_process_assoc_resp(adapter);
+		adapter->assoc_resp_received = false;
+	}
+}
+
 /*
  * This is the RX work queue function.
  *
@@ -1568,6 +1596,14 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter)
 		INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue);
 	}
 
+	adapter->host_mlme_workqueue =
+		alloc_workqueue("MWIFIEX_HOST_MLME_WORK_QUEUE",
+				WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1);
+	if (!adapter->host_mlme_workqueue)
+		goto err_kmalloc;
+
+	INIT_WORK(&adapter->host_mlme_work, mwifiex_host_mlme_work_queue);
+
 	/* Register the device. Fill up the private data structure with
 	 * relevant information from the card. Some code extracted from
 	 * mwifiex_register_dev()
@@ -1724,6 +1760,14 @@ mwifiex_add_card(void *card, struct completion *fw_done,
 		INIT_WORK(&adapter->rx_work, mwifiex_rx_work_queue);
 	}
 
+	adapter->host_mlme_workqueue =
+		alloc_workqueue("MWIFIEX_HOST_MLME_WORK_QUEUE",
+				WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 1);
+	if (!adapter->host_mlme_workqueue)
+		goto err_kmalloc;
+
+	INIT_WORK(&adapter->host_mlme_work, mwifiex_host_mlme_work_queue);
+
 	/* Register the device. Fill up the private data structure with relevant
 	   information from the card. */
 	if (adapter->if_ops.register_dev(adapter)) {
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index ae4b44ad6c50..f0158d217bb8 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -885,6 +885,8 @@ struct mwifiex_adapter {
 	struct work_struct main_work;
 	struct workqueue_struct *rx_workqueue;
 	struct work_struct rx_work;
+	struct workqueue_struct *host_mlme_workqueue;
+	struct work_struct host_mlme_work;
 	bool rx_work_enabled;
 	bool rx_processing;
 	bool delay_main_work;
@@ -917,6 +919,8 @@ struct mwifiex_adapter {
 	u8 event_received;
 	u8 data_received;
 	u8 assoc_resp_received;
+	struct mwifiex_private *priv_link_lost;
+	u8 host_mlme_link_lost;
 	u16 seq_num;
 	struct cmd_ctrl_node *cmd_pool;
 	struct cmd_ctrl_node *curr_cmd;
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index 69426ddd9c3a..9c6fac91204c 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -225,8 +225,12 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code,
 		    priv->cfg_bssid, reason_code);
 	if (priv->bss_mode == NL80211_IFTYPE_STATION ||
 	    priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
-		cfg80211_disconnected(priv->netdev, reason_code, NULL, 0,
-				      !from_ap, GFP_KERNEL);
+		if (adapter->host_mlme && adapter->host_mlme_link_lost)
+			mwifiex_host_mlme_disconnect(adapter->priv_link_lost,
+						     reason_code, NULL);
+		else
+			cfg80211_disconnected(priv->netdev, reason_code, NULL,
+					      0, !from_ap, GFP_KERNEL);
 	}
 	eth_zero_addr(priv->cfg_bssid);
 
@@ -749,7 +753,15 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 		if (priv->media_connected) {
 			reason_code =
 				get_unaligned_le16(adapter->event_body);
-			mwifiex_reset_connect_state(priv, reason_code, true);
+			if (adapter->host_mlme) {
+				adapter->priv_link_lost = priv;
+				adapter->host_mlme_link_lost = true;
+				queue_work(adapter->host_mlme_workqueue,
+					   &adapter->host_mlme_work);
+			} else {
+				mwifiex_reset_connect_state(priv, reason_code,
+							    true);
+			}
 		}
 		break;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (8 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:39   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments David Lin
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

Without this patch, station can't connect to AP if host mlme is
disabled.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   | 25 ++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 588a500fe1b9..2792996e027f 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -1761,7 +1761,7 @@ static const u32 mwifiex_cipher_suites[] = {
 };
 
 /* Supported mgmt frame types to be advertised to cfg80211 */
-static const struct ieee80211_txrx_stypes
+static struct ieee80211_txrx_stypes
 mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = {
 	[NL80211_IFTYPE_STATION] = {
 		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
@@ -1770,14 +1770,10 @@ mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = {
 		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
 	},
 	[NL80211_IFTYPE_AP] = {
-		.tx = 0xffff,
-		.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
-		      BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
-		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
-		      BIT(IEEE80211_STYPE_DISASSOC >> 4) |
-		      BIT(IEEE80211_STYPE_AUTH >> 4) |
-		      BIT(IEEE80211_STYPE_DEAUTH >> 4) |
-		      BIT(IEEE80211_STYPE_ACTION >> 4),
+		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+		      BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+		      BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
 	},
 	[NL80211_IFTYPE_P2P_CLIENT] = {
 		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
@@ -4751,6 +4747,17 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 	}
 	wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH;
 	wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN;
+	if (adapter->host_mlme) {
+		mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].tx = 0xffff;
+		mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].rx =
+			BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+			BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+			BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+			BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+			BIT(IEEE80211_STYPE_AUTH >> 4) |
+			BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+			BIT(IEEE80211_STYPE_ACTION >> 4);
+	}
 	wiphy->mgmt_stypes = mwifiex_mgmt_stypes;
 	wiphy->max_remain_on_channel_duration = 5000;
 	wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (9 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:40   ` Francesco Dolcini
  2023-11-28  8:31 ` [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors David Lin
  2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

1. Moved struct mwifiex_ieee80211_mgmt from cfg80211.c to fw.h.
2. Defined WLAN_AUTH_NONE instead of using 0xFFFF directly.
3. Changed host_mlme of struct mwifiex_adapter to host_mlme_enabled.
4. Moved mwifiex_check_key_api_ver() to end of mwifiex_ret_get_hw_spec().
5. Redefined MWIFIEX_MGMT_HEADER_LEN and MWIFIEX_AUTH_BODY_LEN.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 .../net/wireless/marvell/mwifiex/cfg80211.c   | 47 +++++--------------
 drivers/net/wireless/marvell/mwifiex/cmdevt.c |  9 ++--
 drivers/net/wireless/marvell/mwifiex/decl.h   | 29 ++++++++----
 drivers/net/wireless/marvell/mwifiex/fw.h     | 25 ++++++++++
 drivers/net/wireless/marvell/mwifiex/init.c   |  2 +-
 drivers/net/wireless/marvell/mwifiex/join.c   | 10 ++--
 drivers/net/wireless/marvell/mwifiex/main.h   |  2 +-
 drivers/net/wireless/marvell/mwifiex/sdio.c   |  2 +-
 .../net/wireless/marvell/mwifiex/sta_event.c  | 10 ++--
 .../net/wireless/marvell/mwifiex/sta_ioctl.c  |  2 +-
 .../net/wireless/marvell/mwifiex/uap_cmd.c    |  2 +-
 drivers/net/wireless/marvell/mwifiex/util.c   |  6 +--
 12 files changed, 79 insertions(+), 67 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 2792996e027f..f840b0559bd3 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -57,31 +57,6 @@ ieee80211_iface_combination mwifiex_iface_comb_ap_sta_drcs = {
 	.beacon_int_infra_match = true,
 };
 
-struct mwifiex_ieee80211_mgmt {
-	__le16 frame_control;
-	__le16 duration;
-	u8 da[ETH_ALEN];
-	u8 sa[ETH_ALEN];
-	u8 bssid[ETH_ALEN];
-	__le16 seq_ctrl;
-	u8 addr4[ETH_ALEN];
-	union {
-		struct {
-			__le16 auth_alg;
-			__le16 auth_transaction;
-			__le16 status_code;
-			/* possibly followed by Challenge text */
-			u8 variable[];
-		} __packed auth;
-		struct {
-			__le16 capab_info;
-			__le16 listen_interval;
-			/* followed by SSID and Supported rates */
-			u8 variable[];
-		} __packed assoc_req;
-	} u;
-} __pack;
-
 /*
  * This function maps the nl802.11 channel type into driver channel type.
  *
@@ -551,7 +526,7 @@ mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
 
 	wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index);
 
-	if (priv->adapter->host_mlme)
+	if (priv->adapter->host_mlme_enabled)
 		return 0;
 
 	memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
@@ -3683,7 +3658,7 @@ static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
 	if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info))
 		return -EOPNOTSUPP;
 
-	if (priv->adapter->host_mlme)
+	if (priv->adapter->host_mlme_enabled)
 		return 0;
 
 	return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
@@ -4033,7 +4008,7 @@ mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev,
 {
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
-	if (priv->adapter->host_mlme &&
+	if (priv->adapter->host_mlme_enabled &&
 	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP))
 		return mwifiex_cfg80211_uap_add_station(priv, mac, params);
 
@@ -4274,7 +4249,7 @@ mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev,
 	int ret;
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
-	if (priv->adapter->host_mlme &&
+	if (priv->adapter->host_mlme_enabled &&
 	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP))
 		return 0;
 
@@ -4426,8 +4401,8 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy,
 	}
 
 	mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg);
-	mgmt->u.auth.auth_transaction = trans;
-	mgmt->u.auth.status_code = status_code;
+	mgmt->u.auth.auth_transaction = cpu_to_le16(trans);
+	mgmt->u.auth.status_code = cpu_to_le16(status_code);
 
 	if (req->ie && req->ie_len) {
 		if (!varptr)
@@ -4545,7 +4520,7 @@ mwifiex_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
 
 	if (ret) {
 		priv->auth_flag = 0;
-		priv->auth_alg = 0xFFFF;
+		priv->auth_alg = WLAN_AUTH_NONE;
 		eth_zero_addr(priv->cfg_bssid);
 	}
 
@@ -4735,7 +4710,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 			    "%s: creating new wiphy\n", __func__);
 		return -ENOMEM;
 	}
-	if (adapter->host_mlme) {
+	if (adapter->host_mlme_enabled) {
 		mwifiex_cfg80211_ops.auth = mwifiex_cfg80211_authenticate;
 		mwifiex_cfg80211_ops.assoc = mwifiex_cfg80211_associate;
 		mwifiex_cfg80211_ops.deauth = mwifiex_cfg80211_deauthenticate;
@@ -4747,7 +4722,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 	}
 	wiphy->max_scan_ssids = MWIFIEX_MAX_SSID_LIST_LENGTH;
 	wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN;
-	if (adapter->host_mlme) {
+	if (adapter->host_mlme_enabled) {
 		mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].tx = 0xffff;
 		mwifiex_mgmt_stypes[NL80211_IFTYPE_AP].rx =
 			BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
@@ -4807,7 +4782,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 			WIPHY_FLAG_NETNS_OK |
 			WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
-	if (adapter->host_mlme)
+	if (adapter->host_mlme_enabled)
 		wiphy->flags |= WIPHY_FLAG_REPORTS_OBSS;
 	else
 		wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME;
@@ -4841,7 +4816,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 			   NL80211_FEATURE_LOW_PRIORITY_SCAN |
 			   NL80211_FEATURE_NEED_OBSS_SCAN;
 
-	if (adapter->host_mlme)
+	if (adapter->host_mlme_enabled)
 		wiphy->features |= NL80211_FEATURE_SAE;
 
 	if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info))
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index c8d94cc6706f..85429c51c407 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -1499,11 +1499,11 @@ int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
 
 static void mwifiex_check_key_api_ver(struct mwifiex_adapter *adapter)
 {
-	if (adapter->host_mlme) {
+	if (adapter->host_mlme_enabled) {
 		if (adapter->key_api_major_ver != KEY_API_VER_MAJOR_V2)
-			adapter->host_mlme = false;
+			adapter->host_mlme_enabled = false;
 		mwifiex_dbg(adapter, MSG, "host_mlme: %s, key_api: %d\n",
-			    adapter->host_mlme ? "enable" : "disable",
+			    adapter->host_mlme_enabled ? "enable" : "disable",
 			    adapter->key_api_major_ver);
 	}
 }
@@ -1617,7 +1617,6 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
 						    "key_api v%d.%d\n",
 						    adapter->key_api_major_ver,
 						    adapter->key_api_minor_ver);
-					mwifiex_check_key_api_ver(adapter);
 					break;
 				case FW_API_VER_ID:
 					adapter->fw_api_ver =
@@ -1712,6 +1711,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
 	if (adapter->fw_api_ver == MWIFIEX_FW_V15)
 		adapter->scan_chan_gap_enabled = true;
 
+	mwifiex_check_key_api_ver(adapter);
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/marvell/mwifiex/decl.h b/drivers/net/wireless/marvell/mwifiex/decl.h
index f9b21b13d6c3..be42040822b2 100644
--- a/drivers/net/wireless/marvell/mwifiex/decl.h
+++ b/drivers/net/wireless/marvell/mwifiex/decl.h
@@ -24,10 +24,24 @@
 #define MWIFIEX_RX_HEADROOM	    64
 #define MAX_TXPD_SZ		    32
 #define INTF_HDR_ALIGN		     4
-/* frmctl + durationid + addr1 + addr2 + addr3 + seqctl + addr4 */
-#define MWIFIEX_MGMT_HEADER_LEN   (2 + 2 + 6 + 6 + 6 + 2 + 6)
-/* 6   = auth_alg + auth_transaction + auth_status */
-#define MWIFIEX_AUTH_BODY_LEN     6
+#define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \
+				     MAX_TXPD_SZ)
+
+#define MWIFIEX_MGMT_FRAME_HEADER_SIZE	8	/* sizeof(pkt_type)
+						 *   + sizeof(tx_control)
+						 */
+
+#define FRMCTL_LEN                2
+#define DURATION_LEN              2
+#define SEQCTL_LEN                2
+#define MWIFIEX_MGMT_HEADER_LEN   (FRMCTL_LEN + FRMCTL_LEN + ETH_ALEN + \
+				   ETH_ALEN + ETH_ALEN + SEQCTL_LEN + ETH_ALEN)
+
+#define AUTH_ALG_LEN              2
+#define AUTH_TRANSACTION_LEN      2
+#define AUTH_STATUS_LEN           2
+#define MWIFIEX_AUTH_BODY_LEN     (AUTH_ALG_LEN + AUTH_TRANSACTION_LEN + \
+				   AUTH_STATUS_LEN)
 
 #define HOST_MLME_AUTH_PENDING    BIT(0)
 #define HOST_MLME_AUTH_DONE       BIT(1)
@@ -35,13 +49,10 @@
 #define HOST_MLME_MGMT_MASK       (BIT(IEEE80211_STYPE_AUTH >> 4) | \
 				   BIT(IEEE80211_STYPE_DEAUTH >> 4) | \
 				   BIT(IEEE80211_STYPE_DISASSOC >> 4))
+
 #define AUTH_TX_DEFAULT_WAIT_TIME 2400
 
-#define MWIFIEX_MIN_DATA_HEADER_LEN (MWIFIEX_DMA_ALIGN_SZ + INTF_HDR_ALIGN + \
-				     MAX_TXPD_SZ)
-#define MWIFIEX_MGMT_FRAME_HEADER_SIZE	8	/* sizeof(pkt_type)
-						 *   + sizeof(tx_control)
-						 */
+#define WLAN_AUTH_NONE            0xFFFF
 
 #define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED	2
 #define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED	16
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 699c7ffcd0e5..0f9d860b5d59 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -752,6 +752,31 @@ struct uap_rxpd {
 	u8 flags;
 } __packed;
 
+struct mwifiex_ieee80211_mgmt {
+	__le16 frame_control;
+	__le16 duration;
+	u8 da[ETH_ALEN];
+	u8 sa[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
+	__le16 seq_ctrl;
+	u8 addr4[ETH_ALEN];
+	union {
+		struct {
+			__le16 auth_alg;
+			__le16 auth_transaction;
+			__le16 status_code;
+			/* possibly followed by Challenge text */
+			u8 variable[];
+		} __packed auth;
+		struct {
+			__le16 capab_info;
+			__le16 listen_interval;
+			/* followed by SSID and Supported rates */
+			u8 variable[];
+		} __packed assoc_req;
+	} u;
+} __packed;
+
 struct mwifiex_fw_chan_stats {
 	u8 chan_num;
 	u8 bandcfg;
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index 87121018abc6..a336d45b9677 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -82,7 +82,7 @@ int mwifiex_init_priv(struct mwifiex_private *priv)
 	priv->data_avg_factor = DEFAULT_DATA_AVG_FACTOR;
 
 	priv->auth_flag = 0;
-	priv->auth_alg = 0xFFFF;
+	priv->auth_alg = WLAN_AUTH_NONE;
 
 	priv->sec_info.wep_enabled = 0;
 	priv->sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c
index 00720c6840ef..06db8e358c01 100644
--- a/drivers/net/wireless/marvell/mwifiex/join.c
+++ b/drivers/net/wireless/marvell/mwifiex/join.c
@@ -511,7 +511,7 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 			sizeof(struct mwifiex_chan_scan_param_set);
 	}
 
-	if (priv->adapter->host_mlme) {
+	if (priv->adapter->host_mlme_enabled) {
 		host_mlme_tlv = (struct mwifiex_ie_types_host_mlme *)pos;
 		host_mlme_tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME);
 		host_mlme_tlv->header.len =
@@ -672,7 +672,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 		goto done;
 	}
 
-	if (adapter->host_mlme) {
+	if (adapter->host_mlme_enabled) {
 		hdr = (struct ieee80211_mgmt *)&resp->params;
 		if (!memcmp(hdr->bssid,
 			    priv->attempted_bss_desc->mac_address,
@@ -724,7 +724,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 					    "ASSOC_RESP: UNSPECIFIED failure\n");
 			}
 
-			if (priv->adapter->host_mlme)
+			if (priv->adapter->host_mlme_enabled)
 				priv->assoc_rsp_size = 0;
 		} else {
 			ret = status_code;
@@ -1538,9 +1538,9 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
 	if (!priv->media_connected)
 		return 0;
 
-	if (priv->adapter->host_mlme) {
+	if (priv->adapter->host_mlme_enabled) {
 		priv->auth_flag = 0;
-		priv->auth_alg = 0xFFFF;
+		priv->auth_alg = WLAN_AUTH_NONE;
 		priv->host_mlme_reg = false;
 		priv->mgmt_frame_mask = 0;
 		if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index f0158d217bb8..b5aef4c92b98 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -1010,7 +1010,7 @@ struct mwifiex_adapter {
 	bool is_up;
 
 	bool ext_scan;
-	bool host_mlme;
+	bool host_mlme_enabled;
 	u8 fw_api_ver;
 	u8 key_api_major_ver, key_api_minor_ver;
 	u8 max_p2p_conn, max_sta_conn;
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index f5039d158f46..e7b488fca52f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -2504,7 +2504,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 		adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl);
 	}
 
-	adapter->host_mlme = card->host_mlme;
+	adapter->host_mlme_enabled = card->host_mlme;
 
 	return 0;
 }
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index 9c6fac91204c..b5f3821a6a8f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -136,7 +136,7 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code,
 	priv->media_connected = false;
 
 	priv->auth_flag = 0;
-	priv->auth_alg = 0xFFFF;
+	priv->auth_alg = WLAN_AUTH_NONE;
 
 	priv->scan_block = false;
 	priv->port_open = false;
@@ -225,7 +225,7 @@ void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code,
 		    priv->cfg_bssid, reason_code);
 	if (priv->bss_mode == NL80211_IFTYPE_STATION ||
 	    priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
-		if (adapter->host_mlme && adapter->host_mlme_link_lost)
+		if (adapter->host_mlme_enabled && adapter->host_mlme_link_lost)
 			mwifiex_host_mlme_disconnect(adapter->priv_link_lost,
 						     reason_code, NULL);
 		else
@@ -753,7 +753,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 		if (priv->media_connected) {
 			reason_code =
 				get_unaligned_le16(adapter->event_body);
-			if (adapter->host_mlme) {
+			if (adapter->host_mlme_enabled) {
 				adapter->priv_link_lost = priv;
 				adapter->host_mlme_link_lost = true;
 				queue_work(adapter->host_mlme_workqueue,
@@ -1015,10 +1015,10 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
 		mwifiex_dbg(adapter, EVENT,
 			    "event: Remain on channel expired\n");
 
-		if (adapter->host_mlme &&
+		if (adapter->host_mlme_enabled &&
 		    (priv->auth_flag & HOST_MLME_AUTH_PENDING)) {
 			priv->auth_flag = 0;
-			priv->auth_alg = 0xFFFF;
+			priv->auth_alg = WLAN_AUTH_NONE;
 		} else {
 			cfg80211_remain_on_channel_expired(&priv->wdev,
 							   priv->roc_cfg.cookie,
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index 046541713318..23639aacf092 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -340,7 +340,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
 			ret = mwifiex_associate(priv, bss_desc);
 		}
 
-		if (bss && !priv->adapter->host_mlme)
+		if (bss && !priv->adapter->host_mlme_enabled)
 			cfg80211_put_bss(priv->adapter->wiphy, bss);
 	} else {
 		/* Adhoc mode */
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index eb7e39146b8a..e393cc78bb98 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -765,7 +765,7 @@ static int mwifiex_cmd_uap_bss_start(struct mwifiex_private *priv,
 	cmd->command = cpu_to_le16(HostCmd_CMD_UAP_BSS_START);
 	cmd->size = S_DS_GEN;
 
-	if (priv->adapter->host_mlme) {
+	if (priv->adapter->host_mlme_enabled) {
 		tlv = (struct mwifiex_ie_types_host_mlme *)((u8 *)cmd + cmd->size);
 		tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME);
 		tlv->header.len = cpu_to_le16(sizeof(tlv->host_mlme));
diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index 9e36bb4a8d67..c0614c246b5f 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -392,7 +392,7 @@ void mwifiex_host_mlme_disconnect(struct mwifiex_private *priv,
 		       ETH_ALEN);
 		memcpy(mgmt->bssid, priv->cfg_bssid, ETH_ALEN);
 		priv->auth_flag = 0;
-		priv->auth_alg = 0xFFFF;
+		priv->auth_alg = WLAN_AUTH_NONE;
 	} else {
 		memcpy(mgmt->da, priv->curr_addr, ETH_ALEN);
 		memcpy(mgmt->sa, sa, ETH_ALEN);
@@ -486,7 +486,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 					    "auth: receive deauth from %pM\n",
 					    ieee_hdr->addr3);
 				priv->auth_flag = 0;
-				priv->auth_alg = 0xFFFF;
+				priv->auth_alg = WLAN_AUTH_NONE;
 			} else {
 				mwifiex_dbg(priv->adapter, MSG,
 					    "assoc: receive disasso from %pM\n",
@@ -497,7 +497,7 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
 		cfg80211_rx_mlme_mgmt(priv->netdev, skb->data, pkt_len);
 	}
 
-	if (priv->adapter->host_mlme &&
+	if (priv->adapter->host_mlme_enabled &&
 	    (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) {
 		if (ieee80211_is_auth(ieee_hdr->frame_control))
 			mwifiex_dbg(priv->adapter, MSG,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (10 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments David Lin
@ 2023-11-28  8:31 ` David Lin
  2023-12-01 10:43   ` Francesco Dolcini
  2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
  12 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-11-28  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
	David Lin

1. struct cfg80211_rx_assoc_resp -> struct cfg80211_rx_assoc_resp_data.
2. Pointer should be used for memcpy.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/cmdevt.c  | 2 +-
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 85429c51c407..63246cdfed65 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -928,7 +928,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
 
 void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter)
 {
-	struct cfg80211_rx_assoc_resp assoc_resp = {
+	struct cfg80211_rx_assoc_resp_data assoc_resp = {
 		.uapsd_queues = -1,
 	};
 	struct mwifiex_private *priv =
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index e393cc78bb98..1ed3ba6aaefe 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -910,7 +910,7 @@ static int mwifiex_cmd_uap_add_station(struct mwifiex_private *priv,
 		tlv->header.type = cpu_to_le16(WLAN_EID_OPMODE_NOTIF);
 		tlv_len = sizeof(u8);
 		tlv->header.len = cpu_to_le16(tlv_len);
-		memcpy(tlv->data, params->link_sta_params.opmode_notif,
+		memcpy(tlv->data, &params->link_sta_params.opmode_notif,
 		       tlv_len);
 		pos += (header_len + tlv_len);
 		cmd->size += (header_len + tlv_len);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 01/12] wifi: mwifiex: added code to support host mlme.
  2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
@ 2023-11-28 22:51   ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2023-11-28 22:51 UTC (permalink / raw)
  To: David Lin, linux-wireless
  Cc: oe-kbuild-all, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh, David Lin

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 783004b6dbda2cfe9a552a4cc9c1d168a2068f6c]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Lin/wifi-mwifiex-added-code-to-support-host-mlme/20231128-165820
base:   783004b6dbda2cfe9a552a4cc9c1d168a2068f6c
patch link:    https://lore.kernel.org/r/20231128083115.613235-2-yu-hao.lin%40nxp.com
patch subject: [PATCH v7 01/12] wifi: mwifiex: added code to support host mlme.
config: parisc-randconfig-r112-20231128 (https://download.01.org/0day-ci/archive/20231129/202311290333.3zOCFRnN-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231129/202311290333.3zOCFRnN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311290333.3zOCFRnN-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:754:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] size @@     got unsigned int @@
   drivers/net/wireless/marvell/mwifiex/uap_cmd.c:754:19: sparse:     expected restricted __le16 [usertype] size
   drivers/net/wireless/marvell/mwifiex/uap_cmd.c:754:19: sparse:     got unsigned int
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:757:76: sparse: sparse: restricted __le16 degrades to integer
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:761:27: sparse: sparse: bad assignment (+=) to restricted __le16
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:764:21: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __le16 [usertype] size @@
   drivers/net/wireless/marvell/mwifiex/uap_cmd.c:764:21: sparse:     expected unsigned short [usertype] val
   drivers/net/wireless/marvell/mwifiex/uap_cmd.c:764:21: sparse:     got restricted __le16 [usertype] size
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:764:21: sparse: sparse: cast from restricted __le16
>> drivers/net/wireless/marvell/mwifiex/uap_cmd.c:764:21: sparse: sparse: cast from restricted __le16

vim +754 drivers/net/wireless/marvell/mwifiex/uap_cmd.c

   745	
   746	/* This function prepares AP start up command with or without host MLME
   747	 */
   748	static int mwifiex_cmd_uap_bss_start(struct mwifiex_private *priv,
   749					     struct host_cmd_ds_command *cmd)
   750	{
   751		struct mwifiex_ie_types_host_mlme *tlv;
   752	
   753		cmd->command = cpu_to_le16(HostCmd_CMD_UAP_BSS_START);
 > 754		cmd->size = S_DS_GEN;
   755	
   756		if (priv->adapter->host_mlme) {
 > 757			tlv = (struct mwifiex_ie_types_host_mlme *)((u8 *)cmd + cmd->size);
   758			tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME);
   759			tlv->header.len = cpu_to_le16(sizeof(tlv->host_mlme));
   760			tlv->host_mlme = 1;
 > 761			cmd->size += sizeof(struct mwifiex_ie_types_host_mlme);
   762		}
   763	
 > 764		cmd->size = cpu_to_le16(cmd->size);
   765	
   766		return 0;
   767	}
   768	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3.
  2023-11-28  8:31 ` [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3 David Lin
@ 2023-12-01 10:15   ` Francesco Dolcini
  2023-12-01 15:05     ` Jeff Johnson
  2023-12-01 22:41     ` David Lin
  0 siblings, 2 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:15 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:05PM +0800, David Lin wrote:
> If host mlme is enabled, gropu rekey offload should be disabled.
> 
> Signed-off-by: David Lin <yu-hao.lin@nxp.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +++
>  drivers/net/wireless/marvell/mwifiex/main.c     | 4 ++++
>  drivers/net/wireless/marvell/mwifiex/util.c     | 7 +++++++
>  3 files changed, 14 insertions(+)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> index 40c39e4765f7..3d59e6a441b9 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> @@ -3657,6 +3657,9 @@ static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
>  	if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info))
>  		return -EOPNOTSUPP;
>  
> +	if (priv->adapter->host_mlme)
> +		return 0;

this is a fixup of the previous patch, you should not introduce an issue
and fix it in the following patch. Please make it correct in the first
place fixing up that patch.


> +
>  	return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
>  				HostCmd_ACT_GEN_SET, 0, data, true);
>  }
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
> index d99127dc466e..3bebb6c37604 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.c
> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> @@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct mwifiex_private *priv,
>  			    "bypass txqueue; eth type %#x, mgmt %d\n",
>  			     ntohs(eth_hdr->h_proto),
>  			     mwifiex_is_skb_mgmt_frame(skb));
> +		if (ntohs(eth_hdr->h_proto) == ETH_P_PAE)
> +			mwifiex_dbg(priv->adapter, MSG,
> +				    "key: send EAPOL to %pM\n",
> +				    eth_hdr->h_dest);

this is just debug code, at a first glance not sure i
> diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
> index 23675c1cecae..ff1b2f162c30 100644
> --- a/drivers/net/wireless/marvell/mwifiex/util.c
> +++ b/drivers/net/wireless/marvell/mwifiex/util.c
> @@ -482,8 +482,15 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
>  				return 0;
>  
>  			if (ieee80211_is_deauth(ieee_hdr->frame_control)) {
> +				mwifiex_dbg(priv->adapter, MSG,
> +					    "auth: receive deauth from %pM\n",
> +					    ieee_hdr->addr3);
ditto

>  				priv->auth_flag = 0;
>  				priv->auth_alg = 0xFFFF;
> +			} else {
> +				mwifiex_dbg(priv->adapter, MSG,
> +					    "assoc: receive disasso from %pM\n",
> +					    ieee_hdr->addr3);
ditto


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 03/12] wifi: mwifiex: fixed reassocation issue for WPA3.
  2023-11-28  8:31 ` [PATCH v7 03/12] wifi: mwifiex: fixed reassocation " David Lin
@ 2023-12-01 10:17   ` Francesco Dolcini
  2023-12-01 22:44     ` [EXT] " David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:17 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:06PM +0800, David Lin wrote:
> This issue is related to resatart/reconfigure AP.
> 
> When AP is restarted or reconfigured, wpa_supplilcant will use cached
> PMKSA to do association to AP.
> Because association failure does not report to cfg80211/wpa_supplicant,
> wpa_supplicant will always use cached PMKSA to do assocaiton.
> Connection can't be established under this way.

Same comment as patch 2, this seems a fixup of commit 1, you should fix
that patch, not add a followup fixup commit.

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req.
  2023-11-28  8:31 ` [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req David Lin
@ 2023-12-01 10:18   ` Francesco Dolcini
  2023-12-01 22:47     ` [EXT] " David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:18 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:07PM +0800, David Lin wrote:
> Remain on channel must be removed after authentication is done.
> Otherwise WMM setting for assoiation request will be removed.

Same comment as patch 2, this seems a fixup of commit 1, you should fix
that patch, not add a followup fixup commit.

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
  2023-11-28  8:31 ` [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config David Lin
@ 2023-12-01 10:31   ` Francesco Dolcini
  2023-12-01 22:50     ` [EXT] " David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:31 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:09PM +0800, David Lin wrote:
> Added TLV command TLV_TYPE_UAP_MAC_ADDRESS for AP configuration.
> 
> Without this TLV command, client can't connect to AP after restart of
> hostapd.

Do I understand correctly this is a fix for an existing issue that has
nothing to do with the HOST MLE topic?

If so, that great to have this fixed (and it looks like something I am
affected by, I will try it in the coming days), but it should be:
 - separate patch from this series
 - fixes tag 
 - cc stable

Francesco



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd.
  2023-11-28  8:31 ` [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd David Lin
@ 2023-12-01 10:36   ` Francesco Dolcini
  2023-12-01 22:52     ` [EXT] " David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:36 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:10PM +0800, David Lin wrote:
> TLV commands setting for host command HostCmd_CMD_ADD_NEW_STATION is
> not correct. This issue will set wrong station information to firmware.
> 
> Without this patch, transmission will get 50-70% low throughput for host
> mlme AP mode.

Is this an issue affecting also the existing code, or it depends on the
host MLE one?

From the commit message to me it looks like it should be a dedicated and
separated patch, therefore should probably be before the other patch (or
maybe even a separated one, maybe is easier to get it done this way?)

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout.
  2023-11-28  8:31 ` [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout David Lin
@ 2023-12-01 10:37   ` Francesco Dolcini
  0 siblings, 0 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:37 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:11PM +0800, David Lin wrote:
> Without this patch, if there is no association response from AP with host
> mlme enabled, kernel oops will occur.

As commented on previous patches this should be done in the commit that
introduce the host mlme feature in the first place


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost.
  2023-11-28  8:31 ` [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost David Lin
@ 2023-12-01 10:38   ` Francesco Dolcini
  0 siblings, 0 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:38 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:12PM +0800, David Lin wrote:
> If host mlme is enabled, event EVENT_LINK_LOST must be handled with
> sending deauthentication to upper layers.
> 
> Without this patch, if AP is leaving and station won't receive
> deauthentication from AP, station won't reconnect to AP again.

As commented on previous patches this should be done in the commit that
introduce the host mlme feature in the first place.

No fixup for a non committed patch, you should just avoid introducing the
bug in the first place.

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme.
  2023-11-28  8:31 ` [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme David Lin
@ 2023-12-01 10:39   ` Francesco Dolcini
  0 siblings, 0 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:39 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:13PM +0800, David Lin wrote:
> Without this patch, station can't connect to AP if host mlme is
> disabled.

As commented on previous patches this should be done in the commit that
introduce the host mlme feature in the first place.

No fixup for a non committed patch, you should just avoid introducing the
bug in the first place.

Francesco

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments.
  2023-11-28  8:31 ` [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments David Lin
@ 2023-12-01 10:40   ` Francesco Dolcini
  0 siblings, 0 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:40 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:14PM +0800, David Lin wrote:
> 1. Moved struct mwifiex_ieee80211_mgmt from cfg80211.c to fw.h.
> 2. Defined WLAN_AUTH_NONE instead of using 0xFFFF directly.
> 3. Changed host_mlme of struct mwifiex_adapter to host_mlme_enabled.
> 4. Moved mwifiex_check_key_api_ver() to end of mwifiex_ret_get_hw_spec().
> 5. Redefined MWIFIEX_MGMT_HEADER_LEN and MWIFIEX_AUTH_BODY_LEN.

You should fix the existing patch, not create a fixup commit on top.

Francesco

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors.
  2023-11-28  8:31 ` [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors David Lin
@ 2023-12-01 10:43   ` Francesco Dolcini
  0 siblings, 0 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 10:43 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

On Tue, Nov 28, 2023 at 04:31:15PM +0800, David Lin wrote:
> 1. struct cfg80211_rx_assoc_resp -> struct cfg80211_rx_assoc_resp_data.
> 2. Pointer should be used for memcpy.

this is changing code that you just add on this series, no separate
patch.

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
                   ` (11 preceding siblings ...)
  2023-11-28  8:31 ` [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors David Lin
@ 2023-12-01 11:49 ` Francesco Dolcini
  2023-12-01 12:25   ` Kalle Valo
  2023-12-01 23:05   ` David Lin
  12 siblings, 2 replies; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-01 11:49 UTC (permalink / raw)
  To: David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
	tsung-hsien.hsieh

Hello Lin,
thanks for the patches here, I can clearly see that this code is going
through some real testing given the improvements you did lately.

I have commented on the single patches, and honestly I did not look into
the code details at the moment.

The major feedback from me is the following:
 1 - you should not add code with a bug and than fix a bug in the same
     series, you should have a non buggy patch in the first place (e.g.
     git --amend). (this applies till the patch is not merged into the
     maintainer tree, of course).
 2 - point 1 applies also to reviewer comments
 3 - if you have fixes that are not connected to the feature addition
     you are doing is beneficial to have those separated, this makes
     reviewing easier, they can be "prioritized" to some extent (given
     that they are fixes) and follow a slightly different patch flow
     (they can get applied, depending on the maintainers decision, when the
     merge window is closed and should be backported). Not to mention
     that smaller patch series are appreciated, "Maximum of 7-12 patches
     per patchset " from [1]

In general I would suggest you to have a look at [1], not sure how up to
date is that compared to the in-tree Documentation/process/.

On Tue, Nov 28, 2023 at 04:31:03PM +0800, David Lin wrote:
> 5. Address reviewer comments.
You should list the changes you did, something that generic is forcing
the reviewer to compare v7 vs v6 to known what changed.


[1] https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
@ 2023-12-01 12:25   ` Kalle Valo
  2023-12-01 23:12     ` [EXT] " David Lin
  2023-12-01 23:05   ` David Lin
  1 sibling, 1 reply; 41+ messages in thread
From: Kalle Valo @ 2023-12-01 12:25 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: David Lin, linux-wireless, linux-kernel, briannorris, tsung-hsien.hsieh

Francesco Dolcini <francesco@dolcini.it> writes:

> Hello Lin,
> thanks for the patches here, I can clearly see that this code is going
> through some real testing given the improvements you did lately.
>
> I have commented on the single patches, and honestly I did not look into
> the code details at the moment.
>
> The major feedback from me is the following:
>  1 - you should not add code with a bug and than fix a bug in the same
>      series, you should have a non buggy patch in the first place (e.g.
>      git --amend). (this applies till the patch is not merged into the
>      maintainer tree, of course).
>  2 - point 1 applies also to reviewer comments
>  3 - if you have fixes that are not connected to the feature addition
>      you are doing is beneficial to have those separated, this makes
>      reviewing easier, they can be "prioritized" to some extent (given
>      that they are fixes) and follow a slightly different patch flow
>      (they can get applied, depending on the maintainers decision, when the
>      merge window is closed and should be backported). Not to mention
>      that smaller patch series are appreciated, "Maximum of 7-12 patches
>      per patchset " from [1]
>
> In general I would suggest you to have a look at [1], not sure how up to
> date is that compared to the in-tree Documentation/process/.

I haven't looked at the actual patches but a generic comment from me is
that usually it's not a good idea for newcomers to submit a huge
patchset like this. Start with something small, just with one patch
first, learn the process and what we require from patches. After you
have gained more knowledge you can start doing more complex stuff.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3.
  2023-12-01 10:15   ` Francesco Dolcini
@ 2023-12-01 15:05     ` Jeff Johnson
  2023-12-01 23:18       ` [EXT] " David Lin
  2023-12-01 22:41     ` David Lin
  1 sibling, 1 reply; 41+ messages in thread
From: Jeff Johnson @ 2023-12-01 15:05 UTC (permalink / raw)
  To: Francesco Dolcini, David Lin
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, tsung-hsien.hsieh

On 12/1/2023 2:15 AM, Francesco Dolcini wrote:
> On Tue, Nov 28, 2023 at 04:31:05PM +0800, David Lin wrote:

>> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
>> index d99127dc466e..3bebb6c37604 100644
>> --- a/drivers/net/wireless/marvell/mwifiex/main.c
>> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
>> @@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct mwifiex_private *priv,
>>  			    "bypass txqueue; eth type %#x, mgmt %d\n",
>>  			     ntohs(eth_hdr->h_proto),
>>  			     mwifiex_is_skb_mgmt_frame(skb));
>> +		if (ntohs(eth_hdr->h_proto) == ETH_P_PAE)
>> +			mwifiex_dbg(priv->adapter, MSG,
>> +				    "key: send EAPOL to %pM\n",
>> +				    eth_hdr->h_dest);
> 
> this is just debug code, at a first glance not sure i

not only that, the usual pattern is:
if (eth_hdr->h_proto == htons(ETH_P_PAE))

you want to do endian conversion on a constant when possible since that
is a compile-time conversion and not a runtime conversion


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3.
  2023-12-01 10:15   ` Francesco Dolcini
  2023-12-01 15:05     ` Jeff Johnson
@ 2023-12-01 22:41     ` David Lin
  1 sibling, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-01 22:41 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:16 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for
> WPA3.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:05PM +0800, David Lin wrote:
> > If host mlme is enabled, gropu rekey offload should be disabled.
> >
> > Signed-off-by: David Lin <yu-hao.lin@nxp.com>
> > ---
> >  drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +++
> >  drivers/net/wireless/marvell/mwifiex/main.c     | 4 ++++
> >  drivers/net/wireless/marvell/mwifiex/util.c     | 7 +++++++
> >  3 files changed, 14 insertions(+)
> >
> > diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > index 40c39e4765f7..3d59e6a441b9 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > @@ -3657,6 +3657,9 @@ static int mwifiex_set_rekey_data(struct wiphy
> *wiphy, struct net_device *dev,
> >       if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info))
> >               return -EOPNOTSUPP;
> >
> > +     if (priv->adapter->host_mlme)
> > +             return 0;
> 
> this is a fixup of the previous patch, you should not introduce an issue and
> fix it in the following patch. Please make it correct in the first place fixing up
> that patch.
>

This is the main fix for this issue. If host mlme is enabled, there is no need for firmware to do group rekey off load.
 
> 
> > +
> >       return mwifiex_send_cmd(priv,
> HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
> >                               HostCmd_ACT_GEN_SET, 0, data,
> true);  }
> > diff --git a/drivers/net/wireless/marvell/mwifiex/main.c
> > b/drivers/net/wireless/marvell/mwifiex/main.c
> > index d99127dc466e..3bebb6c37604 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/main.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> > @@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct mwifiex_private
> *priv,
> >                           "bypass txqueue; eth type %#x, mgmt
> %d\n",
> >                            ntohs(eth_hdr->h_proto),
> >                            mwifiex_is_skb_mgmt_frame(skb));
> > +             if (ntohs(eth_hdr->h_proto) == ETH_P_PAE)
> > +                     mwifiex_dbg(priv->adapter, MSG,
> > +                                 "key: send EAPOL to %pM\n",
> > +                                 eth_hdr->h_dest);
> 
> this is just debug code, at a first glance not sure i

It will be helpful for driver to print out authentication, association and EAPoL key handshaking.
This kind of information will only be printed out when station is associated to AP. It won't affect
TP of driver.

> > diff --git a/drivers/net/wireless/marvell/mwifiex/util.c
> > b/drivers/net/wireless/marvell/mwifiex/util.c
> > index 23675c1cecae..ff1b2f162c30 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/util.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/util.c
> > @@ -482,8 +482,15 @@ mwifiex_process_mgmt_packet(struct
> mwifiex_private *priv,
> >                               return 0;
> >
> >                       if
> > (ieee80211_is_deauth(ieee_hdr->frame_control)) {
> > +                             mwifiex_dbg(priv->adapter, MSG,
> > +                                         "auth: receive deauth
> from %pM\n",
> > +                                         ieee_hdr->addr3);
> ditto
> 
> >                               priv->auth_flag = 0;
> >                               priv->auth_alg = 0xFFFF;
> > +                     } else {
> > +                             mwifiex_dbg(priv->adapter, MSG,
> > +                                         "assoc: receive disasso
> from %pM\n",
> > +                                         ieee_hdr->addr3);
> ditto


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 03/12] wifi: mwifiex: fixed reassocation issue for WPA3.
  2023-12-01 10:17   ` Francesco Dolcini
@ 2023-12-01 22:44     ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-01 22:44 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:18 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 03/12] wifi: mwifiex: fixed reassocation issue for
> WPA3.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:06PM +0800, David Lin wrote:
> > This issue is related to resatart/reconfigure AP.
> >
> > When AP is restarted or reconfigured, wpa_supplilcant will use cached
> > PMKSA to do association to AP.
> > Because association failure does not report to
> > cfg80211/wpa_supplicant, wpa_supplicant will always use cached PMKSA
> to do assocaiton.
> > Connection can't be established under this way.
> 
> Same comment as patch 2, this seems a fixup of commit 1, you should fix
> that patch, not add a followup fixup commit.
>

This patch is due to QA test result of patch 1, I wonder why this patch should be merged with patch 1?
 
> Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req.
  2023-12-01 10:18   ` Francesco Dolcini
@ 2023-12-01 22:47     ` David Lin
  2023-12-14  2:16       ` Brian Norris
  0 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-12-01 22:47 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:19 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for
> assoc req.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:07PM +0800, David Lin wrote:
> > Remain on channel must be removed after authentication is done.
> > Otherwise WMM setting for assoiation request will be removed.
> 
> Same comment as patch 2, this seems a fixup of commit 1, you should fix
> that patch, not add a followup fixup commit.

So you think patch 1 to 4 should be merged as a single patch? In fact, patch 2 to 4 is issues reported by our QA for patch 1. If you insisted merge all of them, I can do this for patch v8.
> 
> Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
  2023-12-01 10:31   ` Francesco Dolcini
@ 2023-12-01 22:50     ` David Lin
  2023-12-03 16:13       ` Jeff Johnson
  0 siblings, 1 reply; 41+ messages in thread
From: David Lin @ 2023-12-01 22:50 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:31 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP
> config.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:09PM +0800, David Lin wrote:
> > Added TLV command TLV_TYPE_UAP_MAC_ADDRESS for AP configuration.
> >
> > Without this TLV command, client can't connect to AP after restart of
> > hostapd.
> 
> Do I understand correctly this is a fix for an existing issue that has nothing
> to do with the HOST MLE topic?
> 

Yes.

> If so, that great to have this fixed (and it looks like something I am affected
> by, I will try it in the coming days), but it should be:
>  - separate patch from this series
>  - fixes tag
>  - cc stable
> 

I will sperate this patch from Patch v8 and let it as a single patch.

- fixes tag
- cc stable

I don't understand what does this mean?

> Francesco
> 


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd.
  2023-12-01 10:36   ` Francesco Dolcini
@ 2023-12-01 22:52     ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-01 22:52 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 6:37 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station
> add cmd.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Tue, Nov 28, 2023 at 04:31:10PM +0800, David Lin wrote:
> > TLV commands setting for host command
> HostCmd_CMD_ADD_NEW_STATION is
> > not correct. This issue will set wrong station information to firmware.
> >
> > Without this patch, transmission will get 50-70% low throughput for
> > host mlme AP mode.
> 
> Is this an issue affecting also the existing code, or it depends on the host
> MLE one?

This is related to host mlme for AP mode.

> 
> From the commit message to me it looks like it should be a dedicated and
> separated patch, therefore should probably be before the other patch (or
> maybe even a separated one, maybe is easier to get it done this way?)

No, this patch is related to host mlme. It won't affect original existed code.
> 
> Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
  2023-12-01 12:25   ` Kalle Valo
@ 2023-12-01 23:05   ` David Lin
  2023-12-05 19:46     ` Francesco Dolcini
  1 sibling, 1 reply; 41+ messages in thread
From: David Lin @ 2023-12-01 23:05 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Friday, December 1, 2023 7:49 PM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support
> host mlme.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> Hello Lin,
> thanks for the patches here, I can clearly see that this code is going through
> some real testing given the improvements you did lately.
> 
> I have commented on the single patches, and honestly I did not look into the
> code details at the moment.
> 
> The major feedback from me is the following:
>  1 - you should not add code with a bug and than fix a bug in the same
>      series, you should have a non buggy patch in the first place (e.g.
>      git --amend). (this applies till the patch is not merged into the
>      maintainer tree, of course).
>  2 - point 1 applies also to reviewer comments
>  3 - if you have fixes that are not connected to the feature addition
>      you are doing is beneficial to have those separated, this makes
>      reviewing easier, they can be "prioritized" to some extent (given
>      that they are fixes) and follow a slightly different patch flow
>      (they can get applied, depending on the maintainers decision, when
> the
>      merge window is closed and should be backported). Not to mention
>      that smaller patch series are appreciated, "Maximum of 7-12 patches
>      per patchset " from [1]
> 
> In general I would suggest you to have a look at [1], not sure how up to date
> is that compared to the in-tree Documentation/process/.
> 
> On Tue, Nov 28, 2023 at 04:31:03PM +0800, David Lin wrote:
> > 5. Address reviewer comments.
> You should list the changes you did, something that generic is forcing the
> reviewer to compare v7 vs v6 to known what changed.

Can I summary what should I do and hopefully I can make agreement with you:

1. Separate patch v7 6/12 as a single patch.
2. Merged all other patches as a single patch for host mlme.

So there should be no patch v8 and only have two patches, one for host mlme and another one to fix hostap restart issue.

> 
> 
> [1]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwireles
> s.wiki.kernel.org%2Fen%2Fdevelopers%2Fdocumentation%2Fsubmittingpatch
> es&data=05%7C01%7Cyu-hao.lin%40nxp.com%7Cde461eef26c44e28e80c08d
> bf2638639%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63837028
> 1495779090%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> oiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=y
> OW9SndPm%2FDuI%2BZU8fxBieerDxVZp5RzefQiSfFA%2BW0%3D&reserved=0
> 
> Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-12-01 12:25   ` Kalle Valo
@ 2023-12-01 23:12     ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-01 23:12 UTC (permalink / raw)
  To: Kalle Valo, Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, Pete Hsieh

> From: Kalle Valo <kvalo@kernel.org>
> Sent: Friday, December 1, 2023 8:25 PM
> To: Francesco Dolcini <francesco@dolcini.it>
> Cc: David Lin <yu-hao.lin@nxp.com>; linux-wireless@vger.kernel.org;
> linux-kernel@vger.kernel.org; briannorris@chromium.org; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support
> host mlme.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> Francesco Dolcini <francesco@dolcini.it> writes:
> 
> > Hello Lin,
> > thanks for the patches here, I can clearly see that this code is going
> > through some real testing given the improvements you did lately.
> >
> > I have commented on the single patches, and honestly I did not look
> > into the code details at the moment.
> >
> > The major feedback from me is the following:
> >  1 - you should not add code with a bug and than fix a bug in the same
> >      series, you should have a non buggy patch in the first place (e.g.
> >      git --amend). (this applies till the patch is not merged into the
> >      maintainer tree, of course).
> >  2 - point 1 applies also to reviewer comments
> >  3 - if you have fixes that are not connected to the feature addition
> >      you are doing is beneficial to have those separated, this makes
> >      reviewing easier, they can be "prioritized" to some extent (given
> >      that they are fixes) and follow a slightly different patch flow
> >      (they can get applied, depending on the maintainers decision, when
> the
> >      merge window is closed and should be backported). Not to mention
> >      that smaller patch series are appreciated, "Maximum of 7-12 patches
> >      per patchset " from [1]
> >
> > In general I would suggest you to have a look at [1], not sure how up
> > to date is that compared to the in-tree Documentation/process/.
> 
> I haven't looked at the actual patches but a generic comment from me is that
> usually it's not a good idea for newcomers to submit a huge patchset like
> this. Start with something small, just with one patch first, learn the process
> and what we require from patches. After you have gained more knowledge
> you can start doing more complex stuff.
> 

Can you help to check this patch?

https://patchwork.kernel.org/project/linux-wireless/patch/20231128082544.613179-1-yu-hao.lin@nxp.com/

This is a very small patch and it really fixed issue of mwifiex.
> --
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchw
> ork.kernel.org%2Fproject%2Flinux-wireless%2Flist%2F&data=05%7C01%7Cyu-
> hao.lin%40nxp.com%7C47171ff92b204d48d7be08dbf26894c4%7C686ea1d3b
> c2b4c6fa92cd99c5c301635%7C0%7C0%7C638370303262144837%7CUnknown
> %7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FwH3UEUxKckAwlAVJkh
> 5LpR2L76a1uyOmxXVWiyTUmQ%3D&reserved=0
> 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwireles
> s.wiki.kernel.org%2Fen%2Fdevelopers%2Fdocumentation%2Fsubmittingpatch
> es&data=05%7C01%7Cyu-hao.lin%40nxp.com%7C47171ff92b204d48d7be08d
> bf26894c4%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63837030
> 3262144837%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> oiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=F
> I%2BwsMoSatv3woPhT2yWhHeFIi5pP1uzFQYUrynAZO0%3D&reserved=0

^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3.
  2023-12-01 15:05     ` Jeff Johnson
@ 2023-12-01 23:18       ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-01 23:18 UTC (permalink / raw)
  To: Jeff Johnson, Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Jeff Johnson <quic_jjohnson@quicinc.com>
> Sent: Friday, December 1, 2023 11:05 PM
> To: Francesco Dolcini <francesco@dolcini.it>; David Lin
> <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for
> WPA3.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On 12/1/2023 2:15 AM, Francesco Dolcini wrote:
> > On Tue, Nov 28, 2023 at 04:31:05PM +0800, David Lin wrote:
> 
> >> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c
> >> b/drivers/net/wireless/marvell/mwifiex/main.c
> >> index d99127dc466e..3bebb6c37604 100644
> >> --- a/drivers/net/wireless/marvell/mwifiex/main.c
> >> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> >> @@ -802,6 +802,10 @@ mwifiex_bypass_tx_queue(struct
> mwifiex_private *priv,
> >>                          "bypass txqueue; eth type %#x, mgmt
> %d\n",
> >>                           ntohs(eth_hdr->h_proto),
> >>                           mwifiex_is_skb_mgmt_frame(skb));
> >> +            if (ntohs(eth_hdr->h_proto) == ETH_P_PAE)
> >> +                    mwifiex_dbg(priv->adapter, MSG,
> >> +                                "key: send EAPOL to %pM\n",
> >> +                                eth_hdr->h_dest);
> >
> > this is just debug code, at a first glance not sure i
> 
> not only that, the usual pattern is:
> if (eth_hdr->h_proto == htons(ETH_P_PAE))
> 
> you want to do endian conversion on a constant when possible since that is
> a compile-time conversion and not a runtime conversion

Thanks. I will fix it for next patch.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
  2023-12-01 22:50     ` [EXT] " David Lin
@ 2023-12-03 16:13       ` Jeff Johnson
  2023-12-04  1:56         ` David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Jeff Johnson @ 2023-12-03 16:13 UTC (permalink / raw)
  To: David Lin, Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

On 12/1/2023 2:50 PM, David Lin wrote:
> - fixes tag
> - cc stable
> 
> I don't understand what does this mean?

<https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>

<https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1>

^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config.
  2023-12-03 16:13       ` Jeff Johnson
@ 2023-12-04  1:56         ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-04  1:56 UTC (permalink / raw)
  To: Jeff Johnson, Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Jeff Johnson <quic_jjohnson@quicinc.com>
> Sent: Monday, December 4, 2023 12:13 AM
> To: David Lin <yu-hao.lin@nxp.com>; Francesco Dolcini
> <francesco@dolcini.it>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>
> Subject: Re: [EXT] Re: [PATCH v7 06/12] wifi: mwifiex: added mac address for
> AP config.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On 12/1/2023 2:50 PM, David Lin wrote:
> > - fixes tag
> > - cc stable
> >
> > I don't understand what does this mean?
> 
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> kernel.org%2Fdoc%2Fhtml%2Flatest%2Fprocess%2Fsubmitting-patches.html%
> 23using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes&data=05
> %7C01%7Cyu-hao.lin%40nxp.com%7Cb1c2bb38d9024e40659c08dbf41acb78
> %7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63837216815151639
> 0%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL
> CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=D2ZPx9Fxcm
> %2FYZimLDD9Qj%2BXtwvzoKWjpGbruB9zF4K8%3D&reserved=0>
> 
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> kernel.org%2Fdoc%2Fhtml%2Flatest%2Fprocess%2Fstable-kernel-rules.html%
> 23option-1&data=05%7C01%7Cyu-hao.lin%40nxp.com%7Cb1c2bb38d9024e4
> 0659c08dbf41acb78%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C
> 638372168151516390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
> DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C
> &sdata=r6va5Ynyztm57GwGYEk0zGFV8oBWdr8Iuspns%2BynrnM%3D&reserv
> ed=0>

Thanks for your information. I will base on Francesco's comment and your information to separate this commit to a single patch.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-12-01 23:05   ` David Lin
@ 2023-12-05 19:46     ` Francesco Dolcini
  2023-12-06  1:49       ` David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Francesco Dolcini @ 2023-12-05 19:46 UTC (permalink / raw)
  To: David Lin
  Cc: Francesco Dolcini, linux-wireless, linux-kernel, briannorris,
	kvalo, Pete Hsieh

On Fri, Dec 01, 2023 at 11:05:47PM +0000, David Lin wrote:
> > On Tue, Nov 28, 2023 at 04:31:03PM +0800, David Lin wrote:
> > > 5. Address reviewer comments.
> > You should list the changes you did, something that generic is forcing the
> > reviewer to compare v7 vs v6 to known what changed.
> 
> Can I summary what should I do and hopefully I can make agreement with you:
> 
> 1. Separate patch v7 6/12 as a single patch.
> 2. Merged all other patches as a single patch for host mlme.

I would suggest to proceed the following way:

 1. v8 of this series should have only 2 patches
   - PATCH v8 1/2 : add host mle station support.
   - PATCH v8 2/2 : add host mle AP support.

   Any kind of fix on these 2 new functionalities should be squashed in
   these single 2 patches. No commit to add a functionality with a bug
   that is fixed with a follow-up commit. If you discover bugs during
   your testing this is great, just amend the original commit that
   introduced it.

   I am assuming that is fair to implement station and AP support in
   separated patches, please speak up if this is not the case.

 2.  PATCH v7 06/12: this should be send as a new separate patch, with a
     Fixes: tag and Cc:stable. 

> So there should be no patch v8 and only have two patches, one for host
> mlme and another one to fix hostap restart issue.

It's ok to have a v8, restarting another series will be even more
confusing IMO.


Thanks!

Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme.
  2023-12-05 19:46     ` Francesco Dolcini
@ 2023-12-06  1:49       ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-06  1:49 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-wireless, linux-kernel, briannorris, kvalo, Pete Hsieh

> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Wednesday, December 6, 2023 3:47 AM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: Francesco Dolcini <francesco@dolcini.it>; linux-wireless@vger.kernel.org;
> linux-kernel@vger.kernel.org; briannorris@chromium.org; kvalo@kernel.org;
> Pete Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: Re: [EXT] Re: [PATCH v7 00/12] wifi: mwifiex: added code to support
> host mlme.
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On Fri, Dec 01, 2023 at 11:05:47PM +0000, David Lin wrote:
> > > On Tue, Nov 28, 2023 at 04:31:03PM +0800, David Lin wrote:
> > > > 5. Address reviewer comments.
> > > You should list the changes you did, something that generic is
> > > forcing the reviewer to compare v7 vs v6 to known what changed.
> >
> > Can I summary what should I do and hopefully I can make agreement with
> you:
> >
> > 1. Separate patch v7 6/12 as a single patch.
> > 2. Merged all other patches as a single patch for host mlme.
> 
> I would suggest to proceed the following way:
> 
>  1. v8 of this series should have only 2 patches
>    - PATCH v8 1/2 : add host mle station support.
>    - PATCH v8 2/2 : add host mle AP support.
> 
>    Any kind of fix on these 2 new functionalities should be squashed in
>    these single 2 patches. No commit to add a functionality with a bug
>    that is fixed with a follow-up commit. If you discover bugs during
>    your testing this is great, just amend the original commit that
>    introduced it.
> 
>    I am assuming that is fair to implement station and AP support in
>    separated patches, please speak up if this is not the case.
> 
>  2.  PATCH v7 06/12: this should be send as a new separate patch, with a
>      Fixes: tag and Cc:stable.
> 
> > So there should be no patch v8 and only have two patches, one for host
> > mlme and another one to fix hostap restart issue.
> 
> It's ok to have a v8, restarting another series will be even more confusing IMO.
> 

Thanks for your suggestions. I will follow your suggestions to generate following patches.

> 
> Thanks!
> 
> Francesco


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [EXT] Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req.
  2023-12-01 22:47     ` [EXT] " David Lin
@ 2023-12-14  2:16       ` Brian Norris
  2023-12-14  2:20         ` David Lin
  0 siblings, 1 reply; 41+ messages in thread
From: Brian Norris @ 2023-12-14  2:16 UTC (permalink / raw)
  To: David Lin
  Cc: Francesco Dolcini, linux-wireless, linux-kernel, kvalo, Pete Hsieh

On Fri, Dec 01, 2023 at 10:47:41PM +0000, David Lin wrote:
> > From: Francesco Dolcini <francesco@dolcini.it>
> > Sent: Friday, December 1, 2023 6:19 PM

> > On Tue, Nov 28, 2023 at 04:31:07PM +0800, David Lin wrote:
> > > Remain on channel must be removed after authentication is done.
> > > Otherwise WMM setting for assoiation request will be removed.
> > 
> > Same comment as patch 2, this seems a fixup of commit 1, you should fix
> > that patch, not add a followup fixup commit.
> 
> So you think patch 1 to 4 should be merged as a single patch? In fact,
> patch 2 to 4 is issues reported by our QA for patch 1. If you insisted
> merge all of them, I can do this for patch v8.

In case you didn't get a sufficient answer elsewhere: yes, probably? We
don't care to see:

  patch 1: introduce feature
  patch 2: fix bug in patch 1
  patch 3: fix bug in patch 1 and 2
  patch 4: ...


Just ... actually fix patch 1, and send 1 patch. (Or more, if you have
several logical changes. Be sure to read [1].)

In case you're used to GitHub: we don't work like GitHub, where people
tend to stack a bunch of incremental changes during review, and then the
changes get squashed together before committing. We expect each patch to
be a good commit, and that it will get committed as-is.

If we're interested in the history and evolution of your changes, we can
look at the mailing list archives.

Brian

[1] https://docs.kernel.org/process/submitting-patches.html#separate-your-changes

^ permalink raw reply	[flat|nested] 41+ messages in thread

* RE: [EXT] Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req.
  2023-12-14  2:16       ` Brian Norris
@ 2023-12-14  2:20         ` David Lin
  0 siblings, 0 replies; 41+ messages in thread
From: David Lin @ 2023-12-14  2:20 UTC (permalink / raw)
  To: Brian Norris
  Cc: Francesco Dolcini, linux-wireless, linux-kernel, kvalo, Pete Hsieh

> From: Brian Norris <briannorris@chromium.org>
> Sent: Thursday, December 14, 2023 10:16 AM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: Francesco Dolcini <francesco@dolcini.it>; linux-wireless@vger.kernel.org;
> linux-kernel@vger.kernel.org; kvalo@kernel.org; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>
> Subject: Re: [EXT] Re: [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE
> for assoc req.
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> On Fri, Dec 01, 2023 at 10:47:41PM +0000, David Lin wrote:
> > > From: Francesco Dolcini <francesco@dolcini.it>
> > > Sent: Friday, December 1, 2023 6:19 PM
>
> > > On Tue, Nov 28, 2023 at 04:31:07PM +0800, David Lin wrote:
> > > > Remain on channel must be removed after authentication is done.
> > > > Otherwise WMM setting for assoiation request will be removed.
> > >
> > > Same comment as patch 2, this seems a fixup of commit 1, you should
> > > fix that patch, not add a followup fixup commit.
> >
> > So you think patch 1 to 4 should be merged as a single patch? In fact,
> > patch 2 to 4 is issues reported by our QA for patch 1. If you insisted
> > merge all of them, I can do this for patch v8.
>
> In case you didn't get a sufficient answer elsewhere: yes, probably? We don't
> care to see:
>
>   patch 1: introduce feature
>   patch 2: fix bug in patch 1
>   patch 3: fix bug in patch 1 and 2
>   patch 4: ...
>
>
> Just ... actually fix patch 1, and send 1 patch. (Or more, if you have several
> logical changes. Be sure to read [1].)
>
> In case you're used to GitHub: we don't work like GitHub, where people tend
> to stack a bunch of incremental changes during review, and then the
> changes get squashed together before committing. We expect each patch to
> be a good commit, and that it will get committed as-is.
>
> If we're interested in the history and evolution of your changes, we can look
> at the mailing list archives.
>
> Brian

Thanks for your information. In fact Patch v8 is almost ready and it only includes two patches: one for client mode and one for AP mode.

David

>
> [1]
> https://docs.ke/
> rnel.org%2Fprocess%2Fsubmitting-patches.html%23separate-your-changes&
> data=05%7C02%7Cyu-hao.lin%40nxp.com%7Cc031726831234d8efdf108dbfc4
> aa160%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638381169686
> 467616%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l
> uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fg0y2
> dg6hCyUyHyDnBQS3PmMQqJD5n1h2lpq0ea9tys%3D&reserved=0

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2023-12-14  2:20 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28  8:31 [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme David Lin
2023-11-28  8:31 ` [PATCH v7 01/12] " David Lin
2023-11-28 22:51   ` kernel test robot
2023-11-28  8:31 ` [PATCH v7 02/12] wifi: mwifiex: fixed group rekey issue for WPA3 David Lin
2023-12-01 10:15   ` Francesco Dolcini
2023-12-01 15:05     ` Jeff Johnson
2023-12-01 23:18       ` [EXT] " David Lin
2023-12-01 22:41     ` David Lin
2023-11-28  8:31 ` [PATCH v7 03/12] wifi: mwifiex: fixed reassocation " David Lin
2023-12-01 10:17   ` Francesco Dolcini
2023-12-01 22:44     ` [EXT] " David Lin
2023-11-28  8:31 ` [PATCH v7 04/12] wifi: mwifiex: fixed missing WMM IE for assoc req David Lin
2023-12-01 10:18   ` Francesco Dolcini
2023-12-01 22:47     ` [EXT] " David Lin
2023-12-14  2:16       ` Brian Norris
2023-12-14  2:20         ` David Lin
2023-11-28  8:31 ` [PATCH v7 05/12] wifi: mwifiex: supported host mlme for AP mode David Lin
2023-11-28  8:31 ` [PATCH v7 06/12] wifi: mwifiex: added mac address for AP config David Lin
2023-12-01 10:31   ` Francesco Dolcini
2023-12-01 22:50     ` [EXT] " David Lin
2023-12-03 16:13       ` Jeff Johnson
2023-12-04  1:56         ` David Lin
2023-11-28  8:31 ` [PATCH v7 07/12] wifi: mwifiex: fixed TLV error for station add cmd David Lin
2023-12-01 10:36   ` Francesco Dolcini
2023-12-01 22:52     ` [EXT] " David Lin
2023-11-28  8:31 ` [PATCH v7 08/12] wifi: mwifiex: fixed the way to handle assoc timeout David Lin
2023-12-01 10:37   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 09/12] wifi: mwifiex: fixed the way to handle link lost David Lin
2023-12-01 10:38   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 10/12] wifi: mwifiex: fixed AP issue without host mlme David Lin
2023-12-01 10:39   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 11/12] wifi: mwifiex: misc modifications for review comments David Lin
2023-12-01 10:40   ` Francesco Dolcini
2023-11-28  8:31 ` [PATCH v7 12/12] wifi: mwifiex: fixed compile and coding errors David Lin
2023-12-01 10:43   ` Francesco Dolcini
2023-12-01 11:49 ` [PATCH v7 00/12] wifi: mwifiex: added code to support host mlme Francesco Dolcini
2023-12-01 12:25   ` Kalle Valo
2023-12-01 23:12     ` [EXT] " David Lin
2023-12-01 23:05   ` David Lin
2023-12-05 19:46     ` Francesco Dolcini
2023-12-06  1:49       ` David Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.