diff options
author | Yan-Hsuan Chuang <yhchuang@realtek.com> | 2019-10-02 05:31:27 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-10-02 07:33:49 +0300 |
commit | 04b786e00987c5495dd9a374deb9c9d7f650a9da (patch) | |
tree | 92a710a04a1a369a3075689eb673a5721203a74d /drivers/net/wireless/realtek/rtw88/sec.c | |
parent | d3be4d115be05b1b4323286bc69de9e577fc9a0f (diff) | |
download | linux-04b786e00987c5495dd9a374deb9c9d7f650a9da.tar.xz |
rtw88: add deep PS PG mode for 8822c
Compare with LCLK mode, PG mode saves more power, by turning
off more circuits. Therefore, to recover from PG mode, driver
needs to backup some information into rsvd page. Such as CAM
entries, DPK results.
As CAM entries can change, it is required to re-download CAM
entries after set_key.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/sec.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/sec.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/sec.c b/drivers/net/wireless/realtek/rtw88/sec.c index c594fc02804d..d0d7fbb10d58 100644 --- a/drivers/net/wireless/realtek/rtw88/sec.c +++ b/drivers/net/wireless/realtek/rtw88/sec.c @@ -96,6 +96,27 @@ void rtw_sec_clear_cam(struct rtw_dev *rtwdev, rtw_write32(rtwdev, RTW_SEC_CMD_REG, command); } +u8 rtw_sec_cam_pg_backup(struct rtw_dev *rtwdev, u8 *used_cam) +{ + struct rtw_sec_desc *sec = &rtwdev->sec; + u8 offset = 0; + u8 count, n; + + if (!used_cam) + return 0; + + for (count = 0; count < MAX_PG_CAM_BACKUP_NUM; count++) { + n = find_next_bit(sec->cam_map, RTW_MAX_SEC_CAM_NUM, offset); + if (n == RTW_MAX_SEC_CAM_NUM) + break; + + used_cam[count] = n; + offset = n + 1; + } + + return count; +} + void rtw_sec_enable_sec_engine(struct rtw_dev *rtwdev) { struct rtw_sec_desc *sec = &rtwdev->sec; |