Lines Matching +full:cam +full:- +full:if

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /* Copyright(c) 2018-2019 Realtek Corporation
11 /* if default key search is enabled, the first 4 cam entries in rtw_sec_get_free_cam()
12 * are used to direct map to group key with its key->key_idx, so in rtw_sec_get_free_cam()
13 * driver should use cam entries after 4 to install pairwise key in rtw_sec_get_free_cam()
15 if (sec->default_key_search) in rtw_sec_get_free_cam()
16 return find_next_zero_bit(sec->cam_map, RTW_MAX_SEC_CAM_NUM, in rtw_sec_get_free_cam()
19 return find_first_zero_bit(sec->cam_map, RTW_MAX_SEC_CAM_NUM); in rtw_sec_get_free_cam()
28 struct rtw_cam_entry *cam = &sec->cam_table[hw_key_idx]; in rtw_sec_write_cam() local
35 set_bit(hw_key_idx, sec->cam_map); in rtw_sec_write_cam()
36 cam->valid = true; in rtw_sec_write_cam()
37 cam->group = !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE); in rtw_sec_write_cam()
38 cam->hw_key_type = hw_key_type; in rtw_sec_write_cam()
39 cam->key = key; in rtw_sec_write_cam()
40 if (sta) in rtw_sec_write_cam()
41 ether_addr_copy(cam->addr, sta->addr); in rtw_sec_write_cam()
43 eth_broadcast_addr(cam->addr); in rtw_sec_write_cam()
47 for (i = 7; i >= 0; i--) { in rtw_sec_write_cam()
50 content = ((key->keyidx & 0x3)) | in rtw_sec_write_cam()
52 (cam->group << 6) | in rtw_sec_write_cam()
53 (cam->valid << 15) | in rtw_sec_write_cam()
54 (cam->addr[0] << 16) | in rtw_sec_write_cam()
55 (cam->addr[1] << 24); in rtw_sec_write_cam()
58 content = (cam->addr[2]) | in rtw_sec_write_cam()
59 (cam->addr[3] << 8) | in rtw_sec_write_cam()
60 (cam->addr[4] << 16) | in rtw_sec_write_cam()
61 (cam->addr[5] << 24); in rtw_sec_write_cam()
68 j = (i - 2) << 2; in rtw_sec_write_cam()
69 content = (key->key[j]) | in rtw_sec_write_cam()
70 (key->key[j + 1] << 8) | in rtw_sec_write_cam()
71 (key->key[j + 2] << 16) | in rtw_sec_write_cam()
72 (key->key[j + 3] << 24); in rtw_sec_write_cam()
86 struct rtw_cam_entry *cam = &sec->cam_table[hw_key_idx]; in rtw_sec_clear_cam() local
91 clear_bit(hw_key_idx, sec->cam_map); in rtw_sec_clear_cam()
92 cam->valid = false; in rtw_sec_clear_cam()
93 cam->key = NULL; in rtw_sec_clear_cam()
94 eth_zero_addr(cam->addr); in rtw_sec_clear_cam()
105 struct rtw_sec_desc *sec = &rtwdev->sec; in rtw_sec_cam_pg_backup()
109 if (!used_cam) in rtw_sec_cam_pg_backup()
113 n = find_next_bit(sec->cam_map, RTW_MAX_SEC_CAM_NUM, offset); in rtw_sec_cam_pg_backup()
114 if (n == RTW_MAX_SEC_CAM_NUM) in rtw_sec_cam_pg_backup()
126 struct rtw_sec_desc *sec = &rtwdev->sec; in rtw_sec_enable_sec_engine()
131 sec->default_key_search = true; in rtw_sec_enable_sec_engine()
140 if (sec->default_key_search) in rtw_sec_enable_sec_engine()