Skip to content

Commit

Permalink
Update to aic8800d_linux_sdk_V3.0_2023_1212_15dcf017
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Jan 2, 2024
1 parent af90394 commit ea15d85
Show file tree
Hide file tree
Showing 297 changed files with 95,080 additions and 626 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified src/AIC_Docs/AIC8800DCDW_wifi_test_测试手册_3.0.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CONFIG_USE_P2P0=n
CONFIG_BR_SUPPORT =n
BR_NAME = br0
CONFIG_FILTER_TCP_ACK =n
CONFIG_ONE_TXQ = n
CONFIG_ONE_TXQ = y
CONFIG_RFKILL_POLL = n

# Support of MU-MIMO transmission (need FW support)
Expand Down Expand Up @@ -142,8 +142,7 @@ $(MODULE_NAME)-y := \
aicwf_compat_8800dc.o \
aicwf_compat_8800d80.o \
regdb.o \
aicwf_rx_prealloc.o \
aicwf_tcp_ack.o
aicwf_rx_prealloc.o

$(MODULE_NAME)-$(CONFIG_BR_SUPPORT) += aic_br_ext.o
$(MODULE_NAME)-$(CONFIG_RWNX_RADAR) += rwnx_radar.o
Expand All @@ -155,6 +154,7 @@ $(MODULE_NAME)-$(CONFIG_RWNX_MUMIMO_TX) += rwnx_mu_group.o
$(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += sdio_host.o
$(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += aicwf_txrxif.o
$(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += aicwf_sdio.o
$(MODULE_NAME)-$(CONFIG_FILTER_TCP_ACK) += aicwf_tcp_ack.o

$(MODULE_NAME)-$(CONFIG_USB_SUPPORT) += usb_host.o
$(MODULE_NAME)-$(CONFIG_USB_SUPPORT) += aicwf_txrxif.o
Expand Down
3 changes: 3 additions & 0 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ static int aicwf_pcie_resume(struct pci_dev *pdev)
}
} else {
printk("resume skip reload\n");

g_rwnx_plat->pcidev->rwnx_hw->pci_suspending = 0;

return ret;
}
printk("%s end\n", __func__);
Expand Down
4 changes: 2 additions & 2 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/ipc_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* Number of Host buffers available for Emb->App MSGs sending (through DMA)
*/
#ifdef CONFIG_RWNX_FULLMAC
#define IPC_MSGE2A_BUF_CNT 16//64
#define IPC_MSGE2A_BUF_CNT 96//64
#endif
/*
* Number of Host buffers available for Debug Messages sending (through DMA)
Expand Down Expand Up @@ -542,8 +542,8 @@ struct ipc_e2a_msg {
u16_l dummy_dest_id;
u16_l dummy_src_id;
u16_l param_len; ///< Parameter embedded struct length.
u32_l pattern; ///< Used to stamp a valid MSG buffer
u32_l param[IPC_E2A_MSG_PARAM_SIZE]; ///< Parameter embedded struct. Must be word-aligned.
u32_l pattern; ///< Used to stamp a valid MSG buffer
};

/// Message structure for Debug messages from Emb to App
Expand Down
8 changes: 4 additions & 4 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/lmac_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2181,13 +2181,13 @@ struct apm_stop_req {
/// Structure containing the parameters of the @ref APM_START_CAC_REQ message.
struct apm_start_cac_req {
/// Control channel on which we have to start the CAC
struct mac_chan_def chan;
struct mac_chan_op chan;
/// Center frequency of the first segment
u32_l center_freq1;
//u32_l center_freq1;
/// Center frequency of the second segment (only in 80+80 configuration)
u32_l center_freq2;
//u32_l center_freq2;
/// Width of channel
u8_l ch_width;
//u8_l ch_width;
/// Index of the VIF for which the CAC is started
u8_l vif_idx;
};
Expand Down
6 changes: 5 additions & 1 deletion src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include "rwnx_gki.h"
#include "rwnx_compat.h"
#include "ipc_host.h"
#ifdef CONFIG_FILTER_TCP_ACK
#include "aicwf_tcp_ack.h"
#endif

#ifdef AICWF_SDIO_SUPPORT
#include "aicwf_sdio.h"
Expand Down Expand Up @@ -639,8 +641,10 @@ struct rwnx_hw {

u8 monitor_vif; /* FW id of the monitor interface, RWNX_INVALID_VIF if no monitor vif at fw level */

#ifdef CONFIG_FILTER_TCP_ACK
/* tcp ack management */
struct tcp_ack_manage ack_m;
#endif

/* RoC Management */
struct rwnx_roc_elem *roc_elem; /* Information provided by cfg80211 in its remain on channel request */
Expand Down Expand Up @@ -701,7 +705,7 @@ struct rwnx_hw {
struct rwnx_txq txq[NX_NB_TXQ];
struct rwnx_hwq hwq[NX_TXQ_CNT];

u8 avail_idx_map;
u64 avail_idx_map;
u8 vif_started;
bool adding_sta;
struct rwnx_phy_info phy;
Expand Down
15 changes: 4 additions & 11 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_irqs.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ void rwnx_task(unsigned long data)
printk("pattern error: 0x%x\n", msg->pattern);
}

if (msg->param_len == IPC_E2A_MSG_PARAM_SIZE) {
udelay(10);
} else if (msg->param[IPC_E2A_MSG_PARAM_SIZE - 1] == 0x12345678) {
printk("msg[%d] undone\n", rwnx_hw->ipc_env->msgbuf_idx);
udelay(1);
continue;
}

/* Relay further actions to the msg parser */
if(msg->pattern == IPC_MSGE2A_VALID_PATTERN)
Expand All @@ -125,7 +118,6 @@ void rwnx_task(unsigned long data)

/* Reset the msg buffer and re-use it */
msg->pattern = 0;
msg->param[IPC_E2A_MSG_PARAM_SIZE - 1] = 0x12345678;
//wmb();

dma_sync_single_for_device(&rwnx_hw->pcidev->pci_dev->dev, buf->dma_addr, sizeof(struct ipc_e2a_msg), DMA_TO_DEVICE);
Expand Down Expand Up @@ -169,7 +161,7 @@ void rwnx_task(unsigned long data)
}
break;
}
if(rxdata_successive_cnt >= 10) {
if(rxdata_successive_cnt >= 10 ){
if(*(volatile unsigned int *)(rwnx_hw->pcidev->pci_bar1_vaddr + PCIE_IRQ_STATUS_OFFSET) & PCIE_RX_MSG_BIT) {
rxdata_pause = true;
break;
Expand All @@ -179,6 +171,7 @@ void rwnx_task(unsigned long data)
rxbuf->pattern = 0;
wmb();


idx = data_cnt;
cnt = 0;

Expand All @@ -202,7 +195,7 @@ void rwnx_task(unsigned long data)

//rwnx_ipc_rxbuf_dealloc(rwnx_hw, ipc_buf);
if (buf->addr) {
dma_unmap_single(rwnx_hw->dev, buf->dma_addr, buf->size, DMA_TO_DEVICE);
dma_unmap_single(rwnx_hw->dev, buf->dma_addr, buf->size, DMA_FROM_DEVICE);
buf->addr = NULL;
}

Expand Down Expand Up @@ -261,7 +254,7 @@ void rwnx_task(unsigned long data)
txcfm_buf = &sw_txhdr->ipc_desc;
struct sk_buff *skb_tmp = sw_txhdr->skb;

if(txdata_successive_cnt >= 10) {
if(txdata_successive_cnt >= 10 ){
if(*(volatile unsigned int *)(rwnx_hw->pcidev->pci_bar1_vaddr + PCIE_IRQ_STATUS_OFFSET) & PCIE_RX_MSG_BIT) {
//printk("m%d\n",txcfm_idx);
txdata_pause = true;
Expand Down
51 changes: 40 additions & 11 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,10 +1363,16 @@ enum {
RDWR_EFUSE_PWROFST,
RDWR_EFUSE_DRVIBIT,
SET_PAPR,
SET_COB_CAL,
GET_COB_CAL_RES,
SETSUSPENDMODE,

SET_CAL_XTAL,
GET_CAL_XTAL_RES,
SET_COB_CAL,
GET_COB_CAL_RES,
RDWR_EFUSE_USRDATA,
SET_NOTCH,
RDWR_PWROFSTFINE,
RDWR_EFUSE_PWROFSTFINE,
RDWR_EFUSE_SDIOCFG,
RDWR_EFUSE_USBVIDPID,
};

typedef struct {
Expand All @@ -1375,6 +1381,7 @@ typedef struct {
u8_l mode;
u8_l rate;
u16_l length;
u16_l tx_intv_us;
} cmd_rf_settx_t;

typedef struct {
Expand Down Expand Up @@ -2206,8 +2213,13 @@ int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len)
settx_param.mode = command_strtoul(argv[3], NULL, 10);
settx_param.rate = command_strtoul(argv[4], NULL, 10);
settx_param.length = command_strtoul(argv[5], NULL, 10);
printk("txparam:%d,%d,%d,%d,%d\n", settx_param.chan, settx_param.bw,
settx_param.mode, settx_param.rate, settx_param.length);
if (argc > 6) {
settx_param.tx_intv_us = command_strtoul(argv[6], NULL, 10);
} else {
settx_param.tx_intv_us = 0;
}
printk("txparam:%d,%d,%d,%d,%d,%d\n", settx_param.chan, settx_param.bw,
settx_param.mode, settx_param.rate, settx_param.length, settx_param.tx_intv_us);
rwnx_send_rftest_req(p_rwnx_hw, SET_TX, sizeof(cmd_rf_settx_t), (u8_l *)&settx_param, NULL);
} else if (strcasecmp(argv[0], "SET_TXSTOP") == 0) {
printk("settx_stop\n");
Expand Down Expand Up @@ -2292,6 +2304,16 @@ int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len)

printk("pwr =%x\r\n", pwr);
rwnx_send_rftest_req(p_rwnx_hw, SET_POWER, sizeof(pwr), (u8_l *)&pwr, NULL);
} else if (strcasecmp(argv[0], "SET_NOTCH") == 0) {
if (argc > 1) {
u8_l func = command_strtoul(argv[1], NULL, 10);
printk("set notch: %d\n", func);
rwnx_send_rftest_req(p_rwnx_hw, SET_NOTCH, sizeof(func), (u8_l *)&func, NULL);
} else {
printk("wrong args\n");
bytes_written = -EINVAL;
break;
}
} else if (strcasecmp(argv[0], "SET_XTAL_CAP")==0) {
printk("set_xtal_cap\n");
if (argc < 2) {
Expand Down Expand Up @@ -4101,7 +4123,7 @@ static int rwnx_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
#endif
sme->key_idx, false, NULL, &key_params);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) //|| defined(CONFIG_WPA3_FOR_OLD_KERNEL)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) || defined(CONFIG_WPA3_FOR_OLD_KERNEL)
else if ((sme->auth_type == NL80211_AUTHTYPE_SAE) &&
!(sme->flags & CONNECT_REQ_EXTERNAL_AUTH_SUPPORT)) {
netdev_err(dev, "Doesn't support SAE without external authentication\n");
Expand Down Expand Up @@ -4185,7 +4207,7 @@ static int rwnx_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,

}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) //|| defined(CONFIG_WPA3_FOR_OLD_KERNEL)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) || defined(CONFIG_WPA3_FOR_OLD_KERNEL)
/**
* @external_auth: indicates result of offloaded authentication processing from
* user space
Expand Down Expand Up @@ -5336,6 +5358,11 @@ static int rwnx_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
return rwnx_send_cancel_roc(rwnx_hw);
}

#define IS_2P4GHZ(n) (n >= 2412 && n <= 2484)
#define IS_5GHZ(n) (n >= 4000 && n <= 5895)
#define DEFAULT_NOISE_FLOOR_2GHZ (-89)
#define DEFAULT_NOISE_FLOOR_5GHZ (-92)

/**
* @dump_survey: get site survey information.
*/
Expand Down Expand Up @@ -5380,7 +5407,9 @@ static int rwnx_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *net
if (rwnx_survey->filled != 0) {
SURVEY_TIME(info) = (u64)rwnx_survey->chan_time_ms;
SURVEY_TIME_BUSY(info) = (u64)rwnx_survey->chan_time_busy_ms;
info->noise = rwnx_survey->noise_dbm;
//info->noise = rwnx_survey->noise_dbm;
info->noise = ((IS_2P4GHZ(info->channel->center_freq)) ? DEFAULT_NOISE_FLOOR_2GHZ :
(IS_5GHZ(info->channel->center_freq)) ? DEFAULT_NOISE_FLOOR_5GHZ : DEFAULT_NOISE_FLOOR_5GHZ);

// Set the survey report as not used
rwnx_survey->filled = 0;
Expand Down Expand Up @@ -6697,7 +6726,7 @@ static struct cfg80211_ops rwnx_cfg80211_ops = {
.tdls_mgmt = rwnx_cfg80211_tdls_mgmt,
.tdls_oper = rwnx_cfg80211_tdls_oper,
.change_bss = rwnx_cfg80211_change_bss,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) //|| defined(CONFIG_WPA3_FOR_OLD_KERNEL)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) || defined(CONFIG_WPA3_FOR_OLD_KERNEL)
.external_auth = rwnx_cfg80211_external_auth,
#endif
#ifdef CONFIG_RFKILL_POLL
Expand Down Expand Up @@ -7089,7 +7118,7 @@ int rwnx_cfg80211_init(struct rwnx_plat *rwnx_plat, void **platform_data)
#endif
0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) //|| defined(CONFIG_WPA3_FOR_OLD_KERNEL)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) || defined(CONFIG_WPA3_FOR_OLD_KERNEL)
wiphy->features |= NL80211_FEATURE_SAE;
#endif

Expand Down
19 changes: 17 additions & 2 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_mod_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,11 @@ static void rwnx_set_he_capa(struct rwnx_hw *rwnx_hw, struct wiphy *wiphy)
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G;
he_cap->ppe_thres[0] |= 0x10;
}
if (rwnx_hw->mod_params->use_80) {
he_cap->ppe_thres[0] |= 0x20;
he_cap->ppe_thres[2] |= 0xc0;
he_cap->ppe_thres[3] |= 0x07;
}
//if (rwnx_hw->mod_params->use_80)
{
he_cap->he_cap_elem.phy_cap_info[0] |=
Expand Down Expand Up @@ -1296,6 +1301,11 @@ static void rwnx_set_he_capa(struct rwnx_hw *rwnx_hw, struct wiphy *wiphy)
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G;
he_cap->ppe_thres[0] |= 0x10;
}
if (rwnx_hw->mod_params->use_80) {
he_cap->ppe_thres[0] |= 0x20;
he_cap->ppe_thres[2] |= 0xc0;
he_cap->ppe_thres[3] |= 0x07;
}
//if (rwnx_hw->mod_params->use_80)
{
he_cap->he_cap_elem.phy_cap_info[0] |=
Expand Down Expand Up @@ -1411,6 +1421,11 @@ static void rwnx_set_he_capa(struct rwnx_hw *rwnx_hw, struct wiphy *wiphy)
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G;
he_cap->ppe_thres[0] |= 0x10;
}
if (rwnx_hw->mod_params->use_80) {
he_cap->ppe_thres[0] |= 0x20;
he_cap->ppe_thres[2] |= 0xc0;
he_cap->ppe_thres[3] |= 0x07;
}
//if (rwnx_hw->mod_params->use_80)
{
he_cap->he_cap_elem.phy_cap_info[0] |=
Expand Down Expand Up @@ -1691,8 +1706,8 @@ int rwnx_handle_dynparams(struct rwnx_hw *rwnx_hw, struct wiphy *wiphy)
#endif

/* Allocate the RX buffers according to the maximum AMSDU RX size */
ret = rwnx_ipc_rxbuf_init(rwnx_hw,
(4 * (rwnx_hw->mod_params->amsdu_rx_max + 1) + 1) * 1024);
ret = rwnx_ipc_rxbuf_init(rwnx_hw, 2048);
// (4 * (rwnx_hw->mod_params->amsdu_rx_max + 1) + 1) * 1024);
if (ret) {
wiphy_err(wiphy, "Cannot allocate the RX buffers\n");
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ static inline int rwnx_rx_sm_external_auth_required_ind(struct rwnx_hw *rwnx_hw,
struct sm_external_auth_required_ind *ind =
(struct sm_external_auth_required_ind *)msg->param;
struct rwnx_vif *rwnx_vif = rwnx_hw->vif_table[ind->vif_idx];
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) //|| defined(CONFIG_WPA3_FOR_OLD_KERNEL)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) || defined(CONFIG_WPA3_FOR_OLD_KERNEL)
struct net_device *dev = rwnx_vif->ndev;
struct cfg80211_external_auth_params params;

Expand Down
9 changes: 5 additions & 4 deletions src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2556,11 +2556,12 @@ int rwnx_send_apm_start_cac_req(struct rwnx_hw *rwnx_hw, struct rwnx_vif *vif,
/* Set parameters for the APM_START_CAC_REQ message */
req->vif_idx = vif->vif_index;
req->chan.band = chandef->chan->band;
req->chan.freq = chandef->chan->center_freq;
req->chan.type = bw2chnl[chandef->width];
req->chan.prim20_freq = chandef->chan->center_freq;
req->chan.center1_freq = chandef->center_freq1;
req->chan.center2_freq = chandef->center_freq2;
req->chan.tx_power = 20;
req->chan.flags = 0;
req->center_freq1 = chandef->center_freq1;
req->center_freq2 = chandef->center_freq2;
req->ch_width = bw2chnl[chandef->width];

/* Send the APM_START_CAC_REQ message to LMAC FW */
return rwnx_send_msg(rwnx_hw, req, 1, APM_START_CAC_CFM, cfm);
Expand Down
3 changes: 2 additions & 1 deletion src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ int aic_br_client_tx(struct rwnx_vif *vif, struct sk_buff **pskb)
}
#endif /* CONFIG_BR_SUPPORT */


#ifdef CONFIG_FILTER_TCP_ACK
/* return:
* 0, msg buf freed by the real driver
* others, skb need free by the caller,remember not use msg->skb!
Expand Down Expand Up @@ -1403,6 +1403,7 @@ int intf_tx(struct rwnx_hw *priv,struct msg_buf *msg)

return 0;//NETDEV_TX_OK;
}
#endif

/**
* netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
Expand Down
5 changes: 4 additions & 1 deletion src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,14 @@ int rwnx_ipc_rxbuf_alloc(struct rwnx_hw *rwnx_hw)

idx = rwnx_hw->rxbuf_idx;
while (rwnx_hw->rxbufs[idx].addr && (nb < RWNX_RXBUFF_MAX)) {
printk("w %d %x\n", idx, rwnx_hw->rxbufs[idx].addr);
idx = ( idx + 1 ) % RWNX_RXBUFF_MAX;
nb++;
}
if (nb == RWNX_RXBUFF_MAX) {
dev_err(rwnx_hw->dev, "No more free space for rxbuff");
spin_unlock_bh(&rwnx_hw->rxbuf_lock);
printk("No more free space for rxbuff %d %d %d \n",rwnx_hw->rxbuf_idx,rwnx_hw->rxbuf_cnt,rwnx_hw->ipc_env->rxbuf_idx);
spin_unlock_bh(&rwnx_hw->rxbuf_lock);
return -ENOMEM;
}

Expand All @@ -447,6 +449,7 @@ int rwnx_ipc_rxbuf_alloc(struct rwnx_hw *rwnx_hw)
//printk("alloc %d\n", idx);
err = rwnx_ipc_rxskb_alloc(rwnx_hw, buf, rwnx_hw->ipc_env->rxbuf_sz);
if (err){
printk("ipc_rxskb_alloc fail %d %d %d %d \n",rwnx_hw->rxbuf_idx,rwnx_hw->rxbuf_cnt,rwnx_hw->ipc_env->rxbuf_idx,err);
spin_unlock_bh(&rwnx_hw->rxbuf_lock);
return err;
}
Expand Down
Loading

0 comments on commit ea15d85

Please sign in to comment.