sec.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  2. /* Copyright(c) 2018-2019 Realtek Corporation
  3. */
  4. #ifndef __RTW_SEC_H_
  5. #define __RTW_SEC_H_
  6. #define RTW_SEC_CMD_REG 0x670
  7. #define RTW_SEC_WRITE_REG 0x674
  8. #define RTW_SEC_READ_REG 0x678
  9. #define RTW_SEC_CONFIG 0x680
  10. #define RTW_SEC_CAM_ENTRY_SHIFT 3
  11. #define RTW_SEC_DEFAULT_KEY_NUM 4
  12. #define RTW_SEC_CMD_WRITE_ENABLE BIT(16)
  13. #define RTW_SEC_CMD_CLEAR BIT(30)
  14. #define RTW_SEC_CMD_POLLING BIT(31)
  15. #define RTW_SEC_TX_UNI_USE_DK BIT(0)
  16. #define RTW_SEC_RX_UNI_USE_DK BIT(1)
  17. #define RTW_SEC_TX_DEC_EN BIT(2)
  18. #define RTW_SEC_RX_DEC_EN BIT(3)
  19. #define RTW_SEC_TX_BC_USE_DK BIT(6)
  20. #define RTW_SEC_RX_BC_USE_DK BIT(7)
  21. #define RTW_SEC_ENGINE_EN BIT(9)
  22. int rtw_sec_get_free_cam(struct rtw_sec_desc *sec);
  23. void rtw_sec_write_cam(struct rtw_dev *rtwdev,
  24. struct rtw_sec_desc *sec,
  25. struct ieee80211_sta *sta,
  26. struct ieee80211_key_conf *key,
  27. u8 hw_key_type, u8 hw_key_idx);
  28. void rtw_sec_clear_cam(struct rtw_dev *rtwdev,
  29. struct rtw_sec_desc *sec,
  30. u8 hw_key_idx);
  31. u8 rtw_sec_cam_pg_backup(struct rtw_dev *rtwdev, u8 *used_cam);
  32. void rtw_sec_enable_sec_engine(struct rtw_dev *rtwdev);
  33. #endif