Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: rtw89: add function to adjust and restore PLE quota

PLE RX quota, which is the setting of RX buffer, is needed to be adjusted
dynamically for WoWLAN mode, and restored when back to normal mode.
The action is not needed for rtw8852c chip.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221027052707.14605-4-pkshih@realtek.com

authored by

Chih-Kang Chang and committed by
Kalle Valo
7a68ec3d 5f05bdb0

+39
+1
drivers/net/wireless/realtek/rtw89/core.h
··· 2389 2389 enum rtw89_qta_mode { 2390 2390 RTW89_QTA_SCC, 2391 2391 RTW89_QTA_DLFW, 2392 + RTW89_QTA_WOW, 2392 2393 2393 2394 /* keep last */ 2394 2395 RTW89_QTA_INVALID,
+32
drivers/net/wireless/realtek/rtw89/mac.c
··· 1306 1306 .ple_qt47 = {525, 0, 32, 20, 1034, 13, 1199, 0, 1053, 62, 160, 1037,}, 1307 1307 /* PCIE 64 */ 1308 1308 .ple_qt58 = {147, 0, 16, 20, 157, 13, 229, 0, 172, 14, 24, 0,}, 1309 + /* 8852A PCIE WOW */ 1310 + .ple_qt_52a_wow = {264, 0, 32, 20, 64, 13, 1005, 0, 64, 128, 120,}, 1309 1311 }; 1310 1312 EXPORT_SYMBOL(rtw89_mac_size); 1311 1313 ··· 1480 1478 SET_QUOTA(tx_rpt, PLE, 11); 1481 1479 } 1482 1480 1481 + int rtw89_mac_resize_ple_rx_quota(struct rtw89_dev *rtwdev, bool wow) 1482 + { 1483 + const struct rtw89_ple_quota *min_cfg, *max_cfg; 1484 + const struct rtw89_dle_mem *cfg; 1485 + u32 val; 1486 + 1487 + if (rtwdev->chip->chip_id == RTL8852C) 1488 + return 0; 1489 + 1490 + if (rtwdev->mac.qta_mode != RTW89_QTA_SCC) { 1491 + rtw89_err(rtwdev, "[ERR]support SCC mode only\n"); 1492 + return -EINVAL; 1493 + } 1494 + 1495 + if (wow) 1496 + cfg = get_dle_mem_cfg(rtwdev, RTW89_QTA_WOW); 1497 + else 1498 + cfg = get_dle_mem_cfg(rtwdev, RTW89_QTA_SCC); 1499 + if (!cfg) { 1500 + rtw89_err(rtwdev, "[ERR]get_dle_mem_cfg\n"); 1501 + return -EINVAL; 1502 + } 1503 + 1504 + min_cfg = cfg->ple_min_qt; 1505 + max_cfg = cfg->ple_max_qt; 1506 + SET_QUOTA(cma0_dma, PLE, 6); 1507 + SET_QUOTA(cma1_dma, PLE, 7); 1508 + 1509 + return 0; 1510 + } 1483 1511 #undef SET_QUOTA 1484 1512 1485 1513 static void dle_quota_cfg(struct rtw89_dev *rtwdev,
+2
drivers/net/wireless/realtek/rtw89/mac.h
··· 719 719 const struct rtw89_ple_quota ple_qt46; 720 720 const struct rtw89_ple_quota ple_qt47; 721 721 const struct rtw89_ple_quota ple_qt58; 722 + const struct rtw89_ple_quota ple_qt_52a_wow; 722 723 }; 723 724 724 725 extern const struct rtw89_mac_size_set rtw89_mac_size; ··· 1027 1026 u16 rtw89_mac_dle_buf_req(struct rtw89_dev *rtwdev, u16 buf_len, bool wd); 1028 1027 int rtw89_mac_set_cpuio(struct rtw89_dev *rtwdev, 1029 1028 struct rtw89_cpuio_ctrl *ctrl_para, bool wd); 1029 + int rtw89_mac_resize_ple_rx_quota(struct rtw89_dev *rtwdev, bool wow); 1030 1030 1031 1031 #endif
+4
drivers/net/wireless/realtek/rtw89/rtw8852a.c
··· 48 48 &rtw89_mac_size.ple_size0, &rtw89_mac_size.wde_qt0, 49 49 &rtw89_mac_size.wde_qt0, &rtw89_mac_size.ple_qt4, 50 50 &rtw89_mac_size.ple_qt5}, 51 + [RTW89_QTA_WOW] = {RTW89_QTA_WOW, &rtw89_mac_size.wde_size0, 52 + &rtw89_mac_size.ple_size0, &rtw89_mac_size.wde_qt0, 53 + &rtw89_mac_size.wde_qt0, &rtw89_mac_size.ple_qt4, 54 + &rtw89_mac_size.ple_qt_52a_wow}, 51 55 [RTW89_QTA_DLFW] = {RTW89_QTA_DLFW, &rtw89_mac_size.wde_size4, 52 56 &rtw89_mac_size.ple_size4, &rtw89_mac_size.wde_qt4, 53 57 &rtw89_mac_size.wde_qt4, &rtw89_mac_size.ple_qt13,