summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziv.xu <ziv.xu@starfive.com>2023-09-18 06:29:17 +0300
committerziv.xu <ziv.xu@starfive.com>2023-09-18 06:54:49 +0300
commit5a6a0cfc6ca05cf42efb94002eaf376f92b16732 (patch)
treec11355bdbec94bd4263ea334dfd81aa582fa63cd
parent8cc155d043c47ed1a3989c65e1848d4dc699f4af (diff)
downloadlinux-5a6a0cfc6ca05cf42efb94002eaf376f92b16732.tar.xz
net: wireless: eswin: update eswin wifi driver for kernel 6.1
update eswin wifi driver for kernel 6.1 Signed-off-by: ziv.xu <ziv.xu@starfive.com>
-rw-r--r--arch/riscv/configs/starfive_visionfive2_defconfig1
-rw-r--r--drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c2
-rw-r--r--drivers/net/wireless/eswin/ecrnx_compat.h10
-rw-r--r--drivers/net/wireless/eswin/ecrnx_debug.c2
-rw-r--r--drivers/net/wireless/eswin/ecrnx_mod_params.c3
-rw-r--r--drivers/net/wireless/eswin/ecrnx_msg_rx.c6
-rw-r--r--drivers/net/wireless/eswin/ecrnx_msg_tx.c24
-rw-r--r--drivers/net/wireless/eswin/fullmac/ecrnx_debugfs_func.h3
-rw-r--r--drivers/net/wireless/eswin/fullmac/ecrnx_defs.h6
-rw-r--r--drivers/net/wireless/eswin/fullmac/ecrnx_main.c46
10 files changed, 70 insertions, 33 deletions
diff --git a/arch/riscv/configs/starfive_visionfive2_defconfig b/arch/riscv/configs/starfive_visionfive2_defconfig
index 6fe51bb637f1..d5ab3ec03f63 100644
--- a/arch/riscv/configs/starfive_visionfive2_defconfig
+++ b/arch/riscv/configs/starfive_visionfive2_defconfig
@@ -154,6 +154,7 @@ CONFIG_IWLDVM=y
CONFIG_IWLMVM=y
CONFIG_HOSTAP=y
# CONFIG_RTL_CARDS is not set
+CONFIG_USB_WIFI_ECR6600U=y
CONFIG_AIC_WLAN_SUPPORT=y
CONFIG_AIC8800_WLAN_SUPPORT=m
CONFIG_AIC_LOADFW_SUPPORT=m
diff --git a/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c b/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
index 9ec30d76b540..221cc93f1a67 100644
--- a/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
@@ -9361,7 +9361,7 @@ if((g_rwnx_plat->usbdev->chipid == PRODUCT_ID_AIC8801) ||
vif = rwnx_interface_add(rwnx_hw, "wlan%d", NET_NAME_UNKNOWN,
NL80211_IFTYPE_STATION, NULL);
- vif = rwnx_interface_add(rwnx_hw, "wlan_ap%d", NET_NAME_UNKNOWN,
+ vif = rwnx_interface_add(rwnx_hw, "wlan-ap%d", NET_NAME_UNKNOWN,
NL80211_IFTYPE_AP, NULL);
#ifdef CONFIG_RWNX_MON_DATA
diff --git a/drivers/net/wireless/eswin/ecrnx_compat.h b/drivers/net/wireless/eswin/ecrnx_compat.h
index beba2e7bc967..bc22ff14e2a0 100644
--- a/drivers/net/wireless/eswin/ecrnx_compat.h
+++ b/drivers/net/wireless/eswin/ecrnx_compat.h
@@ -50,9 +50,9 @@
#define regulatory_set_wiphy_regd_sync_rtnl regulatory_set_wiphy_regd_sync
#endif
-#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 11, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 1, 0)
#define cfg80211_ch_switch_started_notify(dev, chandef, count) \
- cfg80211_ch_switch_started_notify(dev, chandef, count, 1)
+ cfg80211_ch_switch_started_notify(dev, chandef, count, 1, false)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
@@ -69,7 +69,11 @@
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US 0x80
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED 0xc0
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK 0xc0
-
+#else
+#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_0US 0x00
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x1
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x3
#endif // 5.1
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
diff --git a/drivers/net/wireless/eswin/ecrnx_debug.c b/drivers/net/wireless/eswin/ecrnx_debug.c
index d3dcd6183d5c..9c2f67eb506d 100644
--- a/drivers/net/wireless/eswin/ecrnx_debug.c
+++ b/drivers/net/wireless/eswin/ecrnx_debug.c
@@ -9,7 +9,7 @@
*
****************************************************************************************
*/
-#include <stdarg.h>
+#include <linux/stdarg.h>
#include <linux/init.h>
#include "ecrnx_defs.h"
#include "eswin_utils.h"
diff --git a/drivers/net/wireless/eswin/ecrnx_mod_params.c b/drivers/net/wireless/eswin/ecrnx_mod_params.c
index 5d6a722b7d45..9f9d6770659b 100644
--- a/drivers/net/wireless/eswin/ecrnx_mod_params.c
+++ b/drivers/net/wireless/eswin/ecrnx_mod_params.c
@@ -18,6 +18,7 @@
#include "ecrnx_cfgfile.h"
#include "reg_access.h"
#include "ecrnx_compat.h"
+#include "fullmac/ecrnx_defs.h"
#ifdef CONFIG_ECRNX_SOFTMAC
#define COMMON_PARAM(name, default_softmac, default_fullmac) \
@@ -1167,7 +1168,7 @@ static void ecrnx_set_he_capa(struct ecrnx_hw *ecrnx_hw, struct wiphy *wiphy)
dcm_max_ru;
he_cap->he_cap_elem.phy_cap_info[9] |= IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB |
IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB |
- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
+ IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US;
#if 0
if (__MDM_VERSION(phy_vers) > 30) {
he_cap->he_cap_elem.phy_cap_info[6] |= IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE;
diff --git a/drivers/net/wireless/eswin/ecrnx_msg_rx.c b/drivers/net/wireless/eswin/ecrnx_msg_rx.c
index 5e51e2c806aa..eab96aa57cb1 100644
--- a/drivers/net/wireless/eswin/ecrnx_msg_rx.c
+++ b/drivers/net/wireless/eswin/ecrnx_msg_rx.c
@@ -1071,9 +1071,9 @@ static inline int ecrnx_rx_sm_connect_ind(struct ecrnx_hw *ecrnx_hw,
struct cfg80211_roam_info info;
memset(&info, 0, sizeof(info));
if (ecrnx_vif->ch_index < NX_CHAN_CTXT_CNT)
- info.channel = ecrnx_hw->chanctx_table[ecrnx_vif->ch_index].chan_def.chan;
- info.bssid = (const u8 *)ind->bssid.array;
- info.req_ie = req_ie;
+ info.links[0].channel = ecrnx_hw->chanctx_table[ecrnx_vif->ch_index].chan_def.chan;
+ info.links[0].bssid = (const u8 *)ind->bssid.array;
+ info.req_ie = req_ie;
info.req_ie_len = ind->assoc_req_ie_len;
info.resp_ie = rsp_ie;
info.resp_ie_len = ind->assoc_rsp_ie_len;
diff --git a/drivers/net/wireless/eswin/ecrnx_msg_tx.c b/drivers/net/wireless/eswin/ecrnx_msg_tx.c
index bc51b9b90f51..8e1b97a13a18 100644
--- a/drivers/net/wireless/eswin/ecrnx_msg_tx.c
+++ b/drivers/net/wireless/eswin/ecrnx_msg_tx.c
@@ -1723,7 +1723,7 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
const u8 *mac, u8 inst_nbr, struct me_sta_add_cfm *cfm)
{
struct me_sta_add_req *req;
- u8 *ht_mcs = (u8 *)&params->ht_capa->mcs;
+ u8 *ht_mcs = (u8 *)&params->link_sta_params.ht_capa->mcs;
int i;
ECRNX_DBG(ECRNX_FN_ENTRY_STR);
@@ -1737,9 +1737,9 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
/* Set parameters for the MM_STA_ADD_REQ message */
memcpy(&(req->mac_addr.array[0]), mac, ETH_ALEN);
- req->rate_set.length = params->supported_rates_len;
- for (i = 0; i < params->supported_rates_len; i++)
- req->rate_set.array[i] = params->supported_rates[i];
+ req->rate_set.length = params->link_sta_params.supported_rates_len;
+ for (i = 0; i < params->link_sta_params.supported_rates_len; i++)
+ req->rate_set.array[i] = params->link_sta_params.supported_rates[i];
req->flags = 0;
@@ -1749,8 +1749,8 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
}
#endif
- if (params->ht_capa) {
- const struct ieee80211_ht_cap *ht_capa = params->ht_capa;
+ if (params->link_sta_params.ht_capa) {
+ const struct ieee80211_ht_cap *ht_capa = params->link_sta_params.ht_capa;
req->flags |= STA_HT_CAPA;
req->ht_cap.ht_capa_info = cpu_to_le16(ht_capa->cap_info);
@@ -1762,8 +1762,8 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
req->ht_cap.asel_capa = ht_capa->antenna_selection_info;
}
- if (params->vht_capa) {
- const struct ieee80211_vht_cap *vht_capa = params->vht_capa;
+ if (params->link_sta_params.vht_capa) {
+ const struct ieee80211_vht_cap *vht_capa = params->link_sta_params.vht_capa;
req->flags |= STA_VHT_CAPA;
req->vht_cap.vht_capa_info = cpu_to_le32(vht_capa->vht_cap_info);
@@ -1774,8 +1774,8 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) && defined(CONFIG_ECRNX_HE)
- if (params->he_capa) {
- const struct ieee80211_he_cap_elem *he_capa = params->he_capa;
+ if (params->link_sta_params.he_capa) {
+ const struct ieee80211_he_cap_elem *he_capa = params->link_sta_params.he_capa;
struct ieee80211_he_mcs_nss_supp *mcs_nss_supp =
(struct ieee80211_he_mcs_nss_supp *)(he_capa + 1);
@@ -1803,9 +1803,9 @@ int ecrnx_send_me_sta_add(struct ecrnx_hw *ecrnx_hw, struct station_parameters *
req->flags |= STA_MFP_CAPA;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
- if (params->opmode_notif_used) {
+ if (params->link_sta_params.opmode_notif_used) {
req->flags |= STA_OPMOD_NOTIF;
- req->opmode = params->opmode_notif;
+ req->opmode = params->link_sta_params.opmode_notif;
}
#endif
diff --git a/drivers/net/wireless/eswin/fullmac/ecrnx_debugfs_func.h b/drivers/net/wireless/eswin/fullmac/ecrnx_debugfs_func.h
index 905d3686e520..2b7a0f045ea6 100644
--- a/drivers/net/wireless/eswin/fullmac/ecrnx_debugfs_func.h
+++ b/drivers/net/wireless/eswin/fullmac/ecrnx_debugfs_func.h
@@ -171,7 +171,8 @@ int ecrnx_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
int idx, u8 *mac, struct station_info *sinfo);
int ecrnx_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
- struct cfg80211_chan_def *chandef);
+ unsigned int link_id,
+ struct cfg80211_chan_def *chandef);
int ecrnx_log_level_get(LOG_CTL_ST *log);
int ecrnx_fw_log_level_set(u32 level, u32 dir);
bool ecrnx_log_host_enable(void);
diff --git a/drivers/net/wireless/eswin/fullmac/ecrnx_defs.h b/drivers/net/wireless/eswin/fullmac/ecrnx_defs.h
index 3c015b18a636..e0ece21d546e 100644
--- a/drivers/net/wireless/eswin/fullmac/ecrnx_defs.h
+++ b/drivers/net/wireless/eswin/fullmac/ecrnx_defs.h
@@ -54,6 +54,7 @@
#define ECRNX_RXSIZE 1024
#define CONFIG_ESWIN_RX_REORDER 1
+#define IEEE80211_MAX_AMPDU_BUF IEEE80211_MAX_AMPDU_BUF_HE
#if defined(CONFIG_ECRNX_HE)
extern struct ieee80211_sta_he_cap ecrnx_he_cap;
@@ -990,6 +991,11 @@ struct ieee80211_sta_he_cap {
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US 0x80
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED 0xc0
#define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK 0xc0
+#else
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x0
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x1
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2
+#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x3
#endif
diff --git a/drivers/net/wireless/eswin/fullmac/ecrnx_main.c b/drivers/net/wireless/eswin/fullmac/ecrnx_main.c
index f3a87f38908e..a302b22fe71e 100644
--- a/drivers/net/wireless/eswin/fullmac/ecrnx_main.c
+++ b/drivers/net/wireless/eswin/fullmac/ecrnx_main.c
@@ -604,7 +604,7 @@ static void ecrnx_csa_finish(struct work_struct *ws)
} else
ecrnx_txq_vif_stop(vif, ECRNX_TXQ_STOP_CHAN, ecrnx_hw);
spin_unlock_bh(&ecrnx_hw->cb_lock);
- cfg80211_ch_switch_notify(vif->ndev, &csa->chandef);
+ cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
mutex_unlock(&vif->wdev.mtx);
__release(&vif->wdev.mtx);
}
@@ -1190,8 +1190,11 @@ static struct wireless_dev *ecrnx_interface_add(struct ecrnx_hw *ecrnx_hw,
else
#endif
{
- memcpy(ndev->dev_addr, ecrnx_hw->wiphy->perm_addr, ETH_ALEN);
- ndev->dev_addr[5] ^= vif_idx;
+ unsigned char mac_addr[6];
+ memcpy(mac_addr, ecrnx_hw->wiphy->perm_addr, ETH_ALEN);
+ mac_addr[5] ^= vif_idx;
+ eth_hw_addr_set(ndev, mac_addr);
+ memcpy(vif->wdev.address, ndev->dev_addr, ETH_ALEN);
}
if (params) {
@@ -1319,7 +1322,7 @@ static int ecrnx_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wd
return 0;
}
-static int ecrnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev);
+static int ecrnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id);
static int ecrnx_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code);
@@ -1344,7 +1347,7 @@ static int ecrnx_cfg80211_change_iface(struct wiphy *wiphy,
{
if((ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_AP) || (ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_P2P_GO))
{
- ecrnx_cfg80211_stop_ap(wiphy, dev);
+ ecrnx_cfg80211_stop_ap(wiphy, dev, NULL);
}
else if((ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_STATION) || (ECRNX_VIF_TYPE(vif) == NL80211_IFTYPE_P2P_CLIENT))
{
@@ -1506,6 +1509,10 @@ out:
* when adding a group key.
*/
static int ecrnx_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ int link_id,
+#endif
+
u8 key_index, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
@@ -1603,6 +1610,10 @@ static int ecrnx_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev
*
*/
static int ecrnx_cfg80211_get_key(struct wiphy *wiphy, struct net_device *netdev,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ int link_id,
+#endif
+
u8 key_index, bool pairwise, const u8 *mac_addr,
void *cookie,
void (*callback)(void *cookie, struct key_params*))
@@ -1618,6 +1629,10 @@ static int ecrnx_cfg80211_get_key(struct wiphy *wiphy, struct net_device *netdev
* and @key_index, return -ENOENT if the key doesn't exist.
*/
static int ecrnx_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ int link_id,
+#endif
+
u8 key_index, bool pairwise, const u8 *mac_addr)
{
struct ecrnx_hw *ecrnx_hw = wiphy_priv(wiphy);
@@ -1646,6 +1661,10 @@ static int ecrnx_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev
*/
static int ecrnx_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *netdev,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ int link_id,
+#endif
+
u8 key_index, bool unicast, bool multicast)
{
ECRNX_DBG(ECRNX_FN_ENTRY_STR);
@@ -1658,6 +1677,10 @@ static int ecrnx_cfg80211_set_default_key(struct wiphy *wiphy,
*/
static int ecrnx_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *netdev,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ int link_id,
+#endif
+
u8 key_index)
{
return 0;
@@ -1689,7 +1712,7 @@ static int ecrnx_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
key_params.key_len = sme->key_len;
key_params.seq_len = 0;
key_params.cipher = sme->crypto.cipher_group;
- ecrnx_cfg80211_add_key(wiphy, dev, sme->key_idx, false, NULL, &key_params);
+ ecrnx_cfg80211_add_key(wiphy, dev, NULL, sme->key_idx, false, NULL, &key_params);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
else if ((sme->auth_type == NL80211_AUTHTYPE_SAE) &&
@@ -1808,8 +1831,8 @@ static int ecrnx_cfg80211_add_station(struct wiphy *wiphy, struct net_device *de
sta->vif_idx = ecrnx_vif->vif_index;
sta->vlan_idx = sta->vif_idx;
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
- sta->ht = params->ht_capa ? 1 : 0;
- sta->vht = params->vht_capa ? 1 : 0;
+ sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
+ sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
sta->acm = 0;
sta->listen_interval = params->listen_interval;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
@@ -2054,8 +2077,8 @@ static int ecrnx_cfg80211_change_station(struct wiphy *wiphy, struct net_device
sta->vif_idx = ecrnx_vif->vif_index;
sta->vlan_idx = sta->vif_idx;
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
- sta->ht = params->ht_capa ? 1 : 0;
- sta->vht = params->vht_capa ? 1 : 0;
+ sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
+ sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
sta->acm = 0;
for (tid = 0; tid < NX_NB_TXQ_PER_STA; tid++) {
int uapsd_bit = ecrnx_hwq2uapsd[ecrnx_tid2hwq[tid]];
@@ -2307,7 +2330,7 @@ static int ecrnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *
/**
* * @stop_ap: Stop being an AP, including stopping beaconing.
*/
-static int ecrnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
+static int ecrnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id)
{
struct ecrnx_hw *ecrnx_hw = wiphy_priv(wiphy);
struct ecrnx_vif *ecrnx_vif = netdev_priv(dev);
@@ -2712,6 +2735,7 @@ static int ecrnx_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ne
*/
int ecrnx_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
+ unsigned int link_id,
struct cfg80211_chan_def *chandef) {
struct ecrnx_hw *ecrnx_hw = wiphy_priv(wiphy);
struct ecrnx_vif *ecrnx_vif = container_of(wdev, struct ecrnx_vif, wdev);