Skip to content

Commit

Permalink
Merge tag 'rtw-next-2024-04-04' of https://github.com/pkshih/rtw
Browse files Browse the repository at this point in the history
rtw-next patches for v6.10

Some fixes and changes of capabilities detailed in following:

rtl8xxxu:

 * enable MFP support

rtlwifi:

 * some cleanups

rtw88:

 * disable unsupported interface type of mesh point for all chips, and only
   support station mode for SDIO chips.

rtw89:

 * fixes of 8852b, 8852c and 8922a
  • Loading branch information
Kalle Valo committed Apr 5, 2024
2 parents 170861b + 155b10a commit 132c2a1
Show file tree
Hide file tree
Showing 26 changed files with 369 additions and 218 deletions.
9 changes: 7 additions & 2 deletions drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6473,7 +6473,9 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
rx_status->mactime = rx_desc->tsfl;
rx_status->flag |= RX_FLAG_MACTIME_START;

if (!rx_desc->swdec)
if (!rx_desc->swdec &&
!(_ieee80211_is_robust_mgmt_frame(hdr) &&
ieee80211_has_protected(hdr->frame_control)))
rx_status->flag |= RX_FLAG_DECRYPTED;
if (rx_desc->crc32)
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
Expand Down Expand Up @@ -6578,7 +6580,9 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
rx_status->mactime = rx_desc->tsfl;
rx_status->flag |= RX_FLAG_MACTIME_START;

if (!rx_desc->swdec)
if (!rx_desc->swdec &&
!(_ieee80211_is_robust_mgmt_frame(hdr) &&
ieee80211_has_protected(hdr->frame_control)))
rx_status->flag |= RX_FLAG_DECRYPTED;
if (rx_desc->crc32)
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
Expand Down Expand Up @@ -7998,6 +8002,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
ieee80211_hw_set(hw, HAS_RATE_CONTROL);
ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
ieee80211_hw_set(hw, MFP_CAPABLE);

wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);

Expand Down
195 changes: 52 additions & 143 deletions drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
}

static void _rtl92cu_init_queue_reserved_page(struct ieee80211_hw *hw,
bool wmm_enable,
u8 out_ep_num,
u8 queue_sel)
{
Expand All @@ -505,66 +504,39 @@ static void _rtl92cu_init_queue_reserved_page(struct ieee80211_hw *hw,
u8 value8;
u32 txqpagenum, txqpageunit, txqremaininpage;

if (!wmm_enable) {
numpubq = (ischipn) ? CHIP_B_PAGE_NUM_PUBQ :
CHIP_A_PAGE_NUM_PUBQ;
txqpagenum = TX_TOTAL_PAGE_NUMBER - numpubq;

txqpageunit = txqpagenum / outepnum;
txqremaininpage = txqpagenum % outepnum;
if (queue_sel & TX_SELE_HQ)
numhq = txqpageunit;
if (queue_sel & TX_SELE_LQ)
numlq = txqpageunit;
/* HIGH priority queue always present in the configuration of
* 2 out-ep. Remainder pages have assigned to High queue */
if (outepnum > 1 && txqremaininpage)
numhq += txqremaininpage;
/* NOTE: This step done before writing REG_RQPN. */
if (ischipn) {
if (queue_sel & TX_SELE_NQ)
numnq = txqpageunit;
value8 = (u8)_NPQ(numnq);
rtl_write_byte(rtlpriv, REG_RQPN_NPQ, value8);
}
} else {
/* for WMM ,number of out-ep must more than or equal to 2! */
numpubq = ischipn ? WMM_CHIP_B_PAGE_NUM_PUBQ :
WMM_CHIP_A_PAGE_NUM_PUBQ;
if (queue_sel & TX_SELE_HQ) {
numhq = ischipn ? WMM_CHIP_B_PAGE_NUM_HPQ :
WMM_CHIP_A_PAGE_NUM_HPQ;
}
if (queue_sel & TX_SELE_LQ) {
numlq = ischipn ? WMM_CHIP_B_PAGE_NUM_LPQ :
WMM_CHIP_A_PAGE_NUM_LPQ;
}
/* NOTE: This step done before writing REG_RQPN. */
if (ischipn) {
if (queue_sel & TX_SELE_NQ)
numnq = WMM_CHIP_B_PAGE_NUM_NPQ;
value8 = (u8)_NPQ(numnq);
rtl_write_byte(rtlpriv, REG_RQPN_NPQ, value8);
}
numpubq = (ischipn) ? CHIP_B_PAGE_NUM_PUBQ :
CHIP_A_PAGE_NUM_PUBQ;
txqpagenum = TX_TOTAL_PAGE_NUMBER - numpubq;

txqpageunit = txqpagenum / outepnum;
txqremaininpage = txqpagenum % outepnum;
if (queue_sel & TX_SELE_HQ)
numhq = txqpageunit;
if (queue_sel & TX_SELE_LQ)
numlq = txqpageunit;
/* HIGH priority queue always present in the configuration of
* 2 out-ep. Remainder pages have assigned to High queue.
*/
if (outepnum > 1 && txqremaininpage)
numhq += txqremaininpage;
/* NOTE: This step done before writing REG_RQPN. */
if (ischipn) {
if (queue_sel & TX_SELE_NQ)
numnq = txqpageunit;
value8 = (u8)_NPQ(numnq);
rtl_write_byte(rtlpriv, REG_RQPN_NPQ, value8);
}
/* TX DMA */
value32 = _HPQ(numhq) | _LPQ(numlq) | _PUBQ(numpubq) | LD_RQPN;
rtl_write_dword(rtlpriv, REG_RQPN, value32);
}

static void _rtl92c_init_trx_buffer(struct ieee80211_hw *hw, bool wmm_enable)
static void _rtl92c_init_trx_buffer(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u8 txpktbuf_bndy;
u8 txpktbuf_bndy = TX_PAGE_BOUNDARY;
u8 value8;

if (!wmm_enable)
txpktbuf_bndy = TX_PAGE_BOUNDARY;
else /* for WMM */
txpktbuf_bndy = (IS_NORMAL_CHIP(rtlhal->version))
? WMM_CHIP_B_TX_PAGE_BOUNDARY
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
rtl_write_byte(rtlpriv, REG_TXPKTBUF_BCNQ_BDNY, txpktbuf_bndy);
rtl_write_byte(rtlpriv, REG_TXPKTBUF_MGQ_BDNY, txpktbuf_bndy);
rtl_write_byte(rtlpriv, REG_TXPKTBUF_WMAC_LBK_BF_HD, txpktbuf_bndy);
Expand All @@ -589,7 +561,6 @@ static void _rtl92c_init_chipn_reg_priority(struct ieee80211_hw *hw, u16 beq,
}

static void _rtl92cu_init_chipn_one_out_ep_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 queue_sel)
{
u16 value;
Expand All @@ -614,7 +585,6 @@ static void _rtl92cu_init_chipn_one_out_ep_priority(struct ieee80211_hw *hw,
}

static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 queue_sel)
{
u16 beq, bkq, viq, voq, mgtq, hiq;
Expand All @@ -638,67 +608,47 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
valuelow = QUEUE_NORMAL;
break;
}
if (!wmm_enable) {
beq = valuelow;
bkq = valuelow;
viq = valuehi;
voq = valuehi;
mgtq = valuehi;
hiq = valuehi;
} else {/* for WMM ,CONFIG_OUT_EP_WIFI_MODE */
beq = valuehi;
bkq = valuelow;
viq = valuelow;
voq = valuehi;
mgtq = valuehi;
hiq = valuehi;
}

beq = valuelow;
bkq = valuelow;
viq = valuehi;
voq = valuehi;
mgtq = valuehi;
hiq = valuehi;

_rtl92c_init_chipn_reg_priority(hw, beq, bkq, viq, voq, mgtq, hiq);
pr_info("Tx queue select: 0x%02x\n", queue_sel);
}

static void _rtl92cu_init_chipn_three_out_ep_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 queue_sel)
{
u16 beq, bkq, viq, voq, mgtq, hiq;

if (!wmm_enable) { /* typical setting */
beq = QUEUE_LOW;
bkq = QUEUE_LOW;
viq = QUEUE_NORMAL;
voq = QUEUE_HIGH;
mgtq = QUEUE_HIGH;
hiq = QUEUE_HIGH;
} else { /* for WMM */
beq = QUEUE_LOW;
bkq = QUEUE_NORMAL;
viq = QUEUE_NORMAL;
voq = QUEUE_HIGH;
mgtq = QUEUE_HIGH;
hiq = QUEUE_HIGH;
}
beq = QUEUE_LOW;
bkq = QUEUE_LOW;
viq = QUEUE_NORMAL;
voq = QUEUE_HIGH;
mgtq = QUEUE_HIGH;
hiq = QUEUE_HIGH;

_rtl92c_init_chipn_reg_priority(hw, beq, bkq, viq, voq, mgtq, hiq);
pr_info("Tx queue select :0x%02x..\n", queue_sel);
}

static void _rtl92cu_init_chipn_queue_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 out_ep_num,
u8 queue_sel)
{
switch (out_ep_num) {
case 1:
_rtl92cu_init_chipn_one_out_ep_priority(hw, wmm_enable,
queue_sel);
_rtl92cu_init_chipn_one_out_ep_priority(hw, queue_sel);
break;
case 2:
_rtl92cu_init_chipn_two_out_ep_priority(hw, wmm_enable,
queue_sel);
_rtl92cu_init_chipn_two_out_ep_priority(hw, queue_sel);
break;
case 3:
_rtl92cu_init_chipn_three_out_ep_priority(hw, wmm_enable,
queue_sel);
_rtl92cu_init_chipn_three_out_ep_priority(hw, queue_sel);
break;
default:
WARN_ON(1); /* Shall not reach here! */
Expand All @@ -707,7 +657,6 @@ static void _rtl92cu_init_chipn_queue_priority(struct ieee80211_hw *hw,
}

static void _rtl92cu_init_chipt_queue_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 out_ep_num,
u8 queue_sel)
{
Expand All @@ -716,12 +665,7 @@ static void _rtl92cu_init_chipt_queue_priority(struct ieee80211_hw *hw,

switch (out_ep_num) {
case 2: /* (TX_SELE_HQ|TX_SELE_LQ) */
if (!wmm_enable) /* typical setting */
hq_sele = HQSEL_VOQ | HQSEL_VIQ | HQSEL_MGTQ |
HQSEL_HIQ;
else /* for WMM */
hq_sele = HQSEL_VOQ | HQSEL_BEQ | HQSEL_MGTQ |
HQSEL_HIQ;
hq_sele = HQSEL_VOQ | HQSEL_VIQ | HQSEL_MGTQ | HQSEL_HIQ;
break;
case 1:
if (TX_SELE_LQ == queue_sel) {
Expand All @@ -742,18 +686,15 @@ static void _rtl92cu_init_chipt_queue_priority(struct ieee80211_hw *hw,
}

static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
bool wmm_enable,
u8 out_ep_num,
u8 queue_sel)
{
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));

if (IS_NORMAL_CHIP(rtlhal->version))
_rtl92cu_init_chipn_queue_priority(hw, wmm_enable, out_ep_num,
queue_sel);
_rtl92cu_init_chipn_queue_priority(hw, out_ep_num, queue_sel);
else
_rtl92cu_init_chipt_queue_priority(hw, wmm_enable, out_ep_num,
queue_sel);
_rtl92cu_init_chipt_queue_priority(hw, out_ep_num, queue_sel);
}

static void _rtl92cu_init_wmac_setting(struct ieee80211_hw *hw)
Expand Down Expand Up @@ -810,8 +751,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
struct rtl_usb_priv *usb_priv = rtl_usbpriv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(usb_priv);
int err = 0;
u32 boundary = 0;
u8 wmm_enable = false; /* TODO */
u32 boundary = TX_PAGE_BOUNDARY;
u8 out_ep_nums = rtlusb->out_ep_nums;
u8 queue_sel = rtlusb->out_queue_sel;

Expand All @@ -821,22 +761,13 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
pr_err("Failed to init power on!\n");
return err;
}
if (!wmm_enable) {
boundary = TX_PAGE_BOUNDARY;
} else { /* for WMM */
boundary = (IS_NORMAL_CHIP(rtlhal->version))
? WMM_CHIP_B_TX_PAGE_BOUNDARY
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
}
if (!rtl92c_init_llt_table(hw, boundary)) {
pr_err("Failed to init LLT Table!\n");
return -EINVAL;
}
_rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
queue_sel);
_rtl92c_init_trx_buffer(hw, wmm_enable);
_rtl92cu_init_queue_priority(hw, wmm_enable, out_ep_nums,
queue_sel);
_rtl92cu_init_queue_reserved_page(hw, out_ep_nums, queue_sel);
_rtl92c_init_trx_buffer(hw);
_rtl92cu_init_queue_priority(hw, out_ep_nums, queue_sel);
/* Get Rx PHY status in order to report RSSI and others. */
rtl92c_init_driver_info_size(hw, RTL92C_DRIVER_INFO_SIZE);
rtl92c_init_interrupt(hw);
Expand Down Expand Up @@ -1553,7 +1484,6 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum wireless_mode wirelessmode = mac->mode;
u8 idx = 0;

switch (variable) {
Expand Down Expand Up @@ -1605,36 +1535,15 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
}
case HW_VAR_SLOT_TIME:{
u8 e_aci;
u8 QOS_MODE = 1;

rtl_write_byte(rtlpriv, REG_SLOT, val[0]);
rtl_dbg(rtlpriv, COMP_MLME, DBG_LOUD,
"HW_VAR_SLOT_TIME %x\n", val[0]);
if (QOS_MODE) {
for (e_aci = 0; e_aci < AC_MAX; e_aci++)
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_AC_PARAM,
&e_aci);
} else {
u8 sifstime = 0;
u8 u1baifs;

if (IS_WIRELESS_MODE_A(wirelessmode) ||
IS_WIRELESS_MODE_N_24G(wirelessmode) ||
IS_WIRELESS_MODE_N_5G(wirelessmode))
sifstime = 16;
else
sifstime = 10;
u1baifs = sifstime + (2 * val[0]);
rtl_write_byte(rtlpriv, REG_EDCA_VO_PARAM,
u1baifs);
rtl_write_byte(rtlpriv, REG_EDCA_VI_PARAM,
u1baifs);
rtl_write_byte(rtlpriv, REG_EDCA_BE_PARAM,
u1baifs);
rtl_write_byte(rtlpriv, REG_EDCA_BK_PARAM,
u1baifs);
}
for (e_aci = 0; e_aci < AC_MAX; e_aci++)
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_AC_PARAM,
&e_aci);
break;
}
case HW_VAR_ACK_PREAMBLE:{
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/realtek/rtw88/coex.c
Original file line number Diff line number Diff line change
Expand Up @@ -3937,7 +3937,9 @@ void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);

if (!coex_stat->bt_disabled && !coex_stat->bt_mailbox_reply) {
if (!coex_stat->wl_under_ips &&
(!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) &&
!coex_stat->bt_disabled && !coex_stat->bt_mailbox_reply) {
rtw_coex_get_bt_supported_version(rtwdev,
&coex_stat->bt_supported_version);
rtw_coex_get_bt_patch_version(rtwdev, &coex_stat->patch_ver);
Expand Down
Loading

0 comments on commit 132c2a1

Please sign in to comment.