Lines Matching +full:cam +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /* Copyright(c) 2019-2020 Realtek Corporation
5 #include "cam.h"
27 for (i = 0; i < 4; i++) { in rtw89_cam_get_sec_key_cmd()
29 j += ext_key ? 16 : 0; in rtw89_cam_get_sec_key_cmd()
30 key32[i] = FIELD_PREP(GENMASK(7, 0), sec_cam->key[j + 0]) | in rtw89_cam_get_sec_key_cmd()
31 FIELD_PREP(GENMASK(15, 8), sec_cam->key[j + 1]) | in rtw89_cam_get_sec_key_cmd()
32 FIELD_PREP(GENMASK(23, 16), sec_cam->key[j + 2]) | in rtw89_cam_get_sec_key_cmd()
33 FIELD_PREP(GENMASK(31, 24), sec_cam->key[j + 3]); in rtw89_cam_get_sec_key_cmd()
36 cmd = skb->data; in rtw89_cam_get_sec_key_cmd()
37 RTW89_SET_FWCMD_SEC_IDX(cmd, sec_cam->sec_cam_idx + (ext_key ? 1 : 0)); in rtw89_cam_get_sec_key_cmd()
38 RTW89_SET_FWCMD_SEC_OFFSET(cmd, sec_cam->offset); in rtw89_cam_get_sec_key_cmd()
39 RTW89_SET_FWCMD_SEC_LEN(cmd, sec_cam->len); in rtw89_cam_get_sec_key_cmd()
40 RTW89_SET_FWCMD_SEC_TYPE(cmd, sec_cam->type); in rtw89_cam_get_sec_key_cmd()
42 RTW89_SET_FWCMD_SEC_SPP_MODE(cmd, sec_cam->spp_mode); in rtw89_cam_get_sec_key_cmd()
43 RTW89_SET_FWCMD_SEC_KEY0(cmd, key32[0]); in rtw89_cam_get_sec_key_cmd()
60 return -ENOMEM; in rtw89_cam_send_sec_key_cmd()
67 H2C_FUNC_MAC_SEC_UPD, 1, 0, in rtw89_cam_send_sec_key_cmd()
76 if (!sec_cam->ext_key) in rtw89_cam_send_sec_key_cmd()
77 return 0; in rtw89_cam_send_sec_key_cmd()
82 return -ENOMEM; in rtw89_cam_send_sec_key_cmd()
90 1, 0, H2C_SEC_CAM_LEN); in rtw89_cam_send_sec_key_cmd()
98 return 0; in rtw89_cam_send_sec_key_cmd()
104 const struct rtw89_chip_info *chip = rtwdev->chip; in rtw89_cam_get_avail_sec_cam()
105 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_get_avail_sec_cam()
106 u8 sec_cam_num = chip->scam_num; in rtw89_cam_get_avail_sec_cam()
107 u8 idx = 0; in rtw89_cam_get_avail_sec_cam()
110 idx = find_first_zero_bit(cam_info->sec_cam_map, sec_cam_num); in rtw89_cam_get_avail_sec_cam()
112 return -EBUSY; in rtw89_cam_get_avail_sec_cam()
114 set_bit(idx, cam_info->sec_cam_map); in rtw89_cam_get_avail_sec_cam()
117 return 0; in rtw89_cam_get_avail_sec_cam()
121 idx = find_next_zero_bit(cam_info->sec_cam_map, sec_cam_num, idx); in rtw89_cam_get_avail_sec_cam()
122 if (idx >= sec_cam_num - 1) in rtw89_cam_get_avail_sec_cam()
123 return -EBUSY; in rtw89_cam_get_avail_sec_cam()
124 /* ext keys need two cam entries for 256-bit key */ in rtw89_cam_get_avail_sec_cam()
125 if (test_bit(idx + 1, cam_info->sec_cam_map)) { in rtw89_cam_get_avail_sec_cam()
130 set_bit(idx, cam_info->sec_cam_map); in rtw89_cam_get_avail_sec_cam()
131 set_bit(idx + 1, cam_info->sec_cam_map); in rtw89_cam_get_avail_sec_cam()
134 return 0; in rtw89_cam_get_avail_sec_cam()
145 * RTW89_ADDR_CAM_SEC_ALL_UNI : 0 - 6 unicast in rtw89_cam_get_addr_cam_key_idx()
146 * RTW89_ADDR_CAM_SEC_NORMAL : 0 - 1 unicast, 2 - 4 group, 5 - 6 BIP in rtw89_cam_get_addr_cam_key_idx()
147 * RTW89_ADDR_CAM_SEC_4GROUP : 0 - 1 unicast, 2 - 5 group, 6 BIP in rtw89_cam_get_addr_cam_key_idx()
149 switch (addr_cam->sec_ent_mode) { in rtw89_cam_get_addr_cam_key_idx()
151 return -EINVAL; in rtw89_cam_get_addr_cam_key_idx()
153 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) in rtw89_cam_get_addr_cam_key_idx()
154 return -EINVAL; in rtw89_cam_get_addr_cam_key_idx()
155 idx = find_first_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
158 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
162 if (sec_cam->type == RTW89_SEC_KEY_TYPE_BIP_CCMP128) { in rtw89_cam_get_addr_cam_key_idx()
163 idx = find_next_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
166 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
171 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { in rtw89_cam_get_addr_cam_key_idx()
172 idx = find_next_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
173 RTW89_SEC_CAM_IN_ADDR_CAM, 0); in rtw89_cam_get_addr_cam_key_idx()
175 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
181 idx = find_next_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
184 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
188 if (sec_cam->type == RTW89_SEC_KEY_TYPE_BIP_CCMP128) { in rtw89_cam_get_addr_cam_key_idx()
189 if (test_bit(6, addr_cam->sec_cam_map)) in rtw89_cam_get_addr_cam_key_idx()
190 return -EINVAL; in rtw89_cam_get_addr_cam_key_idx()
195 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { in rtw89_cam_get_addr_cam_key_idx()
196 idx = find_next_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
197 RTW89_SEC_CAM_IN_ADDR_CAM, 0); in rtw89_cam_get_addr_cam_key_idx()
199 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
205 idx = find_next_zero_bit(addr_cam->sec_cam_map, in rtw89_cam_get_addr_cam_key_idx()
208 return -EBUSY; in rtw89_cam_get_addr_cam_key_idx()
213 return 0; in rtw89_cam_get_addr_cam_key_idx()
225 u8 key_idx = 0; in rtw89_cam_attach_sec_cam()
229 rtw89_err(rtwdev, "No iface for adding sec cam\n"); in rtw89_cam_attach_sec_cam()
230 return -EINVAL; in rtw89_cam_attach_sec_cam()
233 rtwvif = (struct rtw89_vif *)vif->drv_priv; in rtw89_cam_attach_sec_cam()
237 rtw89_err(rtwdev, "failed to get addr cam key idx %d, %d\n", in rtw89_cam_attach_sec_cam()
238 addr_cam->sec_ent_mode, sec_cam->type); in rtw89_cam_attach_sec_cam()
242 key->hw_key_idx = key_idx; in rtw89_cam_attach_sec_cam()
243 addr_cam->sec_ent_keyid[key_idx] = key->keyidx; in rtw89_cam_attach_sec_cam()
244 addr_cam->sec_ent[key_idx] = sec_cam->sec_cam_idx; in rtw89_cam_attach_sec_cam()
245 addr_cam->sec_entries[key_idx] = sec_cam; in rtw89_cam_attach_sec_cam()
246 set_bit(key_idx, addr_cam->sec_cam_map); in rtw89_cam_attach_sec_cam()
249 rtw89_err(rtwdev, "failed to update dctl cam sec entry: %d\n", in rtw89_cam_attach_sec_cam()
255 rtw89_err(rtwdev, "failed to update addr cam sec entry: %d\n", in rtw89_cam_attach_sec_cam()
257 clear_bit(key_idx, addr_cam->sec_cam_map); in rtw89_cam_attach_sec_cam()
258 addr_cam->sec_entries[key_idx] = NULL; in rtw89_cam_attach_sec_cam()
262 return 0; in rtw89_cam_attach_sec_cam()
272 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_sec_key_install()
276 /* maximum key length 256-bit */ in rtw89_cam_sec_key_install()
277 if (key->keylen > 32) { in rtw89_cam_sec_key_install()
278 rtw89_err(rtwdev, "invalid sec key length %d\n", key->keylen); in rtw89_cam_sec_key_install()
279 return -EINVAL; in rtw89_cam_sec_key_install()
284 rtw89_warn(rtwdev, "no available sec cam: %d ext: %d\n", in rtw89_cam_sec_key_install()
291 ret = -ENOMEM; in rtw89_cam_sec_key_install()
295 sec_cam->sec_cam_idx = sec_cam_idx; in rtw89_cam_sec_key_install()
296 sec_cam->type = hw_key_type; in rtw89_cam_sec_key_install()
297 sec_cam->len = RTW89_SEC_CAM_LEN; in rtw89_cam_sec_key_install()
298 sec_cam->ext_key = ext_key; in rtw89_cam_sec_key_install()
299 memcpy(sec_cam->key, key->key, key->keylen); in rtw89_cam_sec_key_install()
306 /* associate with addr cam */ in rtw89_cam_sec_key_install()
309 rtw89_err(rtwdev, "failed to attach sec cam: %d\n", ret); in rtw89_cam_sec_key_install()
313 return 0; in rtw89_cam_sec_key_install()
317 clear_bit(sec_cam_idx, cam_info->sec_cam_map); in rtw89_cam_sec_key_install()
319 clear_bit(sec_cam_idx + 1, cam_info->sec_cam_map); in rtw89_cam_sec_key_install()
329 const struct rtw89_chip_info *chip = rtwdev->chip; in rtw89_cam_sec_key_add()
334 switch (key->cipher) { in rtw89_cam_sec_key_add()
343 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; in rtw89_cam_sec_key_add()
347 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; in rtw89_cam_sec_key_add()
352 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; in rtw89_cam_sec_key_add()
356 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; in rtw89_cam_sec_key_add()
360 return -EOPNOTSUPP; in rtw89_cam_sec_key_add()
363 if (!chip->hw_sec_hdr) in rtw89_cam_sec_key_add()
364 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; in rtw89_cam_sec_key_add()
374 return 0; in rtw89_cam_sec_key_add()
384 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_sec_key_del()
388 u8 key_idx = key->hw_key_idx; in rtw89_cam_sec_key_del()
390 int ret = 0; in rtw89_cam_sec_key_del()
393 rtw89_err(rtwdev, "No iface for deleting sec cam\n"); in rtw89_cam_sec_key_del()
394 return -EINVAL; in rtw89_cam_sec_key_del()
397 rtwvif = (struct rtw89_vif *)vif->drv_priv; in rtw89_cam_sec_key_del()
399 sec_cam = addr_cam->sec_entries[key_idx]; in rtw89_cam_sec_key_del()
401 return -EINVAL; in rtw89_cam_sec_key_del()
403 /* detach sec cam from addr cam */ in rtw89_cam_sec_key_del()
404 clear_bit(key_idx, addr_cam->sec_cam_map); in rtw89_cam_sec_key_del()
405 addr_cam->sec_entries[key_idx] = NULL; in rtw89_cam_sec_key_del()
409 rtw89_err(rtwdev, "failed to update dctl cam del key: %d\n", ret); in rtw89_cam_sec_key_del()
412 rtw89_err(rtwdev, "failed to update cam del key: %d\n", ret); in rtw89_cam_sec_key_del()
415 /* clear valid bit in addr cam will disable sec cam, in rtw89_cam_sec_key_del()
418 sec_cam_idx = sec_cam->sec_cam_idx; in rtw89_cam_sec_key_del()
419 clear_bit(sec_cam_idx, cam_info->sec_cam_map); in rtw89_cam_sec_key_del()
420 if (sec_cam->ext_key) in rtw89_cam_sec_key_del()
421 clear_bit(sec_cam_idx + 1, cam_info->sec_cam_map); in rtw89_cam_sec_key_del()
442 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_deinit_addr_cam()
444 addr_cam->valid = false; in rtw89_cam_deinit_addr_cam()
445 clear_bit(addr_cam->addr_cam_idx, cam_info->addr_cam_map); in rtw89_cam_deinit_addr_cam()
451 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_deinit_bssid_cam()
453 bssid_cam->valid = false; in rtw89_cam_deinit_bssid_cam()
454 clear_bit(bssid_cam->bssid_cam_idx, cam_info->bssid_cam_map); in rtw89_cam_deinit_bssid_cam()
459 struct rtw89_addr_cam_entry *addr_cam = &rtwvif->addr_cam; in rtw89_cam_deinit()
460 struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; in rtw89_cam_deinit()
469 ieee80211_iter_keys_rcu(rtwdev->hw, NULL, rtw89_cam_reset_key_iter, rtwdev); in rtw89_cam_reset_keys()
476 const struct rtw89_chip_info *chip = rtwdev->chip; in rtw89_cam_get_avail_addr_cam()
477 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_get_avail_addr_cam()
478 u8 addr_cam_num = chip->acam_num; in rtw89_cam_get_avail_addr_cam()
481 idx = find_first_zero_bit(cam_info->addr_cam_map, addr_cam_num); in rtw89_cam_get_avail_addr_cam()
483 return -EBUSY; in rtw89_cam_get_avail_addr_cam()
485 set_bit(idx, cam_info->addr_cam_map); in rtw89_cam_get_avail_addr_cam()
488 return 0; in rtw89_cam_get_avail_addr_cam()
499 if (unlikely(addr_cam->valid)) { in rtw89_cam_init_addr_cam()
501 "addr cam is already valid; skip init\n"); in rtw89_cam_init_addr_cam()
502 return 0; in rtw89_cam_init_addr_cam()
507 rtw89_err(rtwdev, "failed to get available addr cam\n"); in rtw89_cam_init_addr_cam()
511 addr_cam->addr_cam_idx = addr_cam_idx; in rtw89_cam_init_addr_cam()
512 addr_cam->len = ADDR_CAM_ENT_SIZE; in rtw89_cam_init_addr_cam()
513 addr_cam->offset = 0; in rtw89_cam_init_addr_cam()
514 addr_cam->valid = true; in rtw89_cam_init_addr_cam()
515 addr_cam->addr_mask = 0; in rtw89_cam_init_addr_cam()
516 addr_cam->mask_sel = RTW89_NO_MSK; in rtw89_cam_init_addr_cam()
517 addr_cam->sec_ent_mode = RTW89_ADDR_CAM_SEC_NORMAL; in rtw89_cam_init_addr_cam()
518 bitmap_zero(addr_cam->sec_cam_map, RTW89_SEC_CAM_IN_ADDR_CAM); in rtw89_cam_init_addr_cam()
520 for (i = 0; i < RTW89_SEC_CAM_IN_ADDR_CAM; i++) { in rtw89_cam_init_addr_cam()
521 addr_cam->sec_ent_keyid[i] = 0; in rtw89_cam_init_addr_cam()
522 addr_cam->sec_ent[i] = 0; in rtw89_cam_init_addr_cam()
525 /* associate addr cam with bssid cam */ in rtw89_cam_init_addr_cam()
526 addr_cam->bssid_cam_idx = bssid_cam->bssid_cam_idx; in rtw89_cam_init_addr_cam()
528 return 0; in rtw89_cam_init_addr_cam()
534 const struct rtw89_chip_info *chip = rtwdev->chip; in rtw89_cam_get_avail_bssid_cam()
535 struct rtw89_cam_info *cam_info = &rtwdev->cam_info; in rtw89_cam_get_avail_bssid_cam()
536 u8 bssid_cam_num = chip->bcam_num; in rtw89_cam_get_avail_bssid_cam()
539 idx = find_first_zero_bit(cam_info->bssid_cam_map, bssid_cam_num); in rtw89_cam_get_avail_bssid_cam()
541 return -EBUSY; in rtw89_cam_get_avail_bssid_cam()
543 set_bit(idx, cam_info->bssid_cam_map); in rtw89_cam_get_avail_bssid_cam()
546 return 0; in rtw89_cam_get_avail_bssid_cam()
557 if (unlikely(bssid_cam->valid)) { in rtw89_cam_init_bssid_cam()
559 "bssid cam is already valid; skip init\n"); in rtw89_cam_init_bssid_cam()
560 return 0; in rtw89_cam_init_bssid_cam()
565 rtw89_err(rtwdev, "failed to get available bssid cam\n"); in rtw89_cam_init_bssid_cam()
569 bssid_cam->bssid_cam_idx = bssid_cam_idx; in rtw89_cam_init_bssid_cam()
570 bssid_cam->phy_idx = rtwvif->phy_idx; in rtw89_cam_init_bssid_cam()
571 bssid_cam->len = BSSID_CAM_ENT_SIZE; in rtw89_cam_init_bssid_cam()
572 bssid_cam->offset = 0; in rtw89_cam_init_bssid_cam()
573 bssid_cam->valid = true; in rtw89_cam_init_bssid_cam()
574 ether_addr_copy(bssid_cam->bssid, bssid); in rtw89_cam_init_bssid_cam()
576 return 0; in rtw89_cam_init_bssid_cam()
581 struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; in rtw89_cam_bssid_changed()
583 ether_addr_copy(bssid_cam->bssid, rtwvif->bssid); in rtw89_cam_bssid_changed()
588 struct rtw89_addr_cam_entry *addr_cam = &rtwvif->addr_cam; in rtw89_cam_init()
589 struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; in rtw89_cam_init()
592 ret = rtw89_cam_init_bssid_cam(rtwdev, rtwvif, bssid_cam, rtwvif->bssid); in rtw89_cam_init()
594 rtw89_err(rtwdev, "failed to init bssid cam\n"); in rtw89_cam_init()
600 rtw89_err(rtwdev, "failed to init addr cam\n"); in rtw89_cam_init()
604 return 0; in rtw89_cam_init()
613 u8 bss_color = vif->bss_conf.he_bss_color.color; in rtw89_cam_fill_bssid_cam_info()
616 if (vif->bss_conf.nontransmitted) in rtw89_cam_fill_bssid_cam_info()
621 FWCMD_SET_ADDR_BSSID_IDX(cmd, bssid_cam->bssid_cam_idx); in rtw89_cam_fill_bssid_cam_info()
622 FWCMD_SET_ADDR_BSSID_OFFSET(cmd, bssid_cam->offset); in rtw89_cam_fill_bssid_cam_info()
623 FWCMD_SET_ADDR_BSSID_LEN(cmd, bssid_cam->len); in rtw89_cam_fill_bssid_cam_info()
624 FWCMD_SET_ADDR_BSSID_VALID(cmd, bssid_cam->valid); in rtw89_cam_fill_bssid_cam_info()
626 FWCMD_SET_ADDR_BSSID_BB_SEL(cmd, bssid_cam->phy_idx); in rtw89_cam_fill_bssid_cam_info()
629 FWCMD_SET_ADDR_BSSID_BSSID0(cmd, bssid_cam->bssid[0]); in rtw89_cam_fill_bssid_cam_info()
630 FWCMD_SET_ADDR_BSSID_BSSID1(cmd, bssid_cam->bssid[1]); in rtw89_cam_fill_bssid_cam_info()
631 FWCMD_SET_ADDR_BSSID_BSSID2(cmd, bssid_cam->bssid[2]); in rtw89_cam_fill_bssid_cam_info()
632 FWCMD_SET_ADDR_BSSID_BSSID3(cmd, bssid_cam->bssid[3]); in rtw89_cam_fill_bssid_cam_info()
633 FWCMD_SET_ADDR_BSSID_BSSID4(cmd, bssid_cam->bssid[4]); in rtw89_cam_fill_bssid_cam_info()
634 FWCMD_SET_ADDR_BSSID_BSSID5(cmd, bssid_cam->bssid[5]); in rtw89_cam_fill_bssid_cam_info()
636 return 0; in rtw89_cam_fill_bssid_cam_info()
641 u8 hash = 0; in rtw89_cam_addr_hash()
659 const u8 *sma = scan_mac_addr ? scan_mac_addr : rtwvif->mac_addr; in rtw89_cam_fill_addr_cam_info()
661 u8 sma_start = 0; in rtw89_cam_fill_addr_cam_info()
662 u8 tma_start = 0; in rtw89_cam_fill_addr_cam_info()
663 u8 *tma = sta ? sta->addr : rtwvif->bssid; in rtw89_cam_fill_addr_cam_info()
665 if (addr_cam->addr_mask != 0) { in rtw89_cam_fill_addr_cam_info()
666 addr_msk_start = __ffs(addr_cam->addr_mask); in rtw89_cam_fill_addr_cam_info()
667 if (addr_cam->mask_sel == RTW89_SMA) in rtw89_cam_fill_addr_cam_info()
669 else if (addr_cam->mask_sel == RTW89_TMA) in rtw89_cam_fill_addr_cam_info()
675 FWCMD_SET_ADDR_IDX(cmd, addr_cam->addr_cam_idx); in rtw89_cam_fill_addr_cam_info()
676 FWCMD_SET_ADDR_OFFSET(cmd, addr_cam->offset); in rtw89_cam_fill_addr_cam_info()
677 FWCMD_SET_ADDR_LEN(cmd, addr_cam->len); in rtw89_cam_fill_addr_cam_info()
679 FWCMD_SET_ADDR_VALID(cmd, addr_cam->valid); in rtw89_cam_fill_addr_cam_info()
680 FWCMD_SET_ADDR_NET_TYPE(cmd, rtwvif->net_type); in rtw89_cam_fill_addr_cam_info()
681 FWCMD_SET_ADDR_BCN_HIT_COND(cmd, rtwvif->bcn_hit_cond); in rtw89_cam_fill_addr_cam_info()
682 FWCMD_SET_ADDR_HIT_RULE(cmd, rtwvif->hit_rule); in rtw89_cam_fill_addr_cam_info()
683 FWCMD_SET_ADDR_BB_SEL(cmd, rtwvif->phy_idx); in rtw89_cam_fill_addr_cam_info()
684 FWCMD_SET_ADDR_ADDR_MASK(cmd, addr_cam->addr_mask); in rtw89_cam_fill_addr_cam_info()
685 FWCMD_SET_ADDR_MASK_SEL(cmd, addr_cam->mask_sel); in rtw89_cam_fill_addr_cam_info()
689 FWCMD_SET_ADDR_BSSID_CAM_IDX(cmd, addr_cam->bssid_cam_idx); in rtw89_cam_fill_addr_cam_info()
691 FWCMD_SET_ADDR_SMA0(cmd, sma[0]); in rtw89_cam_fill_addr_cam_info()
698 FWCMD_SET_ADDR_TMA0(cmd, tma[0]); in rtw89_cam_fill_addr_cam_info()
705 FWCMD_SET_ADDR_PORT_INT(cmd, rtwvif->port); in rtw89_cam_fill_addr_cam_info()
706 FWCMD_SET_ADDR_TSF_SYNC(cmd, rtwvif->port); in rtw89_cam_fill_addr_cam_info()
707 FWCMD_SET_ADDR_TF_TRS(cmd, rtwvif->trigger); in rtw89_cam_fill_addr_cam_info()
708 FWCMD_SET_ADDR_LSIG_TXOP(cmd, rtwvif->lsig_txop); in rtw89_cam_fill_addr_cam_info()
709 FWCMD_SET_ADDR_TGT_IND(cmd, rtwvif->tgt_ind); in rtw89_cam_fill_addr_cam_info()
710 FWCMD_SET_ADDR_FRM_TGT_IND(cmd, rtwvif->frm_tgt_ind); in rtw89_cam_fill_addr_cam_info()
711 FWCMD_SET_ADDR_MACID(cmd, rtwsta ? rtwsta->mac_id : rtwvif->mac_id); in rtw89_cam_fill_addr_cam_info()
712 if (rtwvif->net_type == RTW89_NET_TYPE_INFRA) in rtw89_cam_fill_addr_cam_info()
713 FWCMD_SET_ADDR_AID12(cmd, vif->cfg.aid & 0xfff); in rtw89_cam_fill_addr_cam_info()
714 else if (rtwvif->net_type == RTW89_NET_TYPE_AP_MODE) in rtw89_cam_fill_addr_cam_info()
715 FWCMD_SET_ADDR_AID12(cmd, sta ? sta->aid & 0xfff : 0); in rtw89_cam_fill_addr_cam_info()
716 FWCMD_SET_ADDR_WOL_PATTERN(cmd, rtwvif->wowlan_pattern); in rtw89_cam_fill_addr_cam_info()
717 FWCMD_SET_ADDR_WOL_UC(cmd, rtwvif->wowlan_uc); in rtw89_cam_fill_addr_cam_info()
718 FWCMD_SET_ADDR_WOL_MAGIC(cmd, rtwvif->wowlan_magic); in rtw89_cam_fill_addr_cam_info()
719 FWCMD_SET_ADDR_WAPI(cmd, addr_cam->wapi); in rtw89_cam_fill_addr_cam_info()
720 FWCMD_SET_ADDR_SEC_ENT_MODE(cmd, addr_cam->sec_ent_mode); in rtw89_cam_fill_addr_cam_info()
721 FWCMD_SET_ADDR_SEC_ENT0_KEYID(cmd, addr_cam->sec_ent_keyid[0]); in rtw89_cam_fill_addr_cam_info()
722 FWCMD_SET_ADDR_SEC_ENT1_KEYID(cmd, addr_cam->sec_ent_keyid[1]); in rtw89_cam_fill_addr_cam_info()
723 FWCMD_SET_ADDR_SEC_ENT2_KEYID(cmd, addr_cam->sec_ent_keyid[2]); in rtw89_cam_fill_addr_cam_info()
724 FWCMD_SET_ADDR_SEC_ENT3_KEYID(cmd, addr_cam->sec_ent_keyid[3]); in rtw89_cam_fill_addr_cam_info()
725 FWCMD_SET_ADDR_SEC_ENT4_KEYID(cmd, addr_cam->sec_ent_keyid[4]); in rtw89_cam_fill_addr_cam_info()
726 FWCMD_SET_ADDR_SEC_ENT5_KEYID(cmd, addr_cam->sec_ent_keyid[5]); in rtw89_cam_fill_addr_cam_info()
727 FWCMD_SET_ADDR_SEC_ENT6_KEYID(cmd, addr_cam->sec_ent_keyid[6]); in rtw89_cam_fill_addr_cam_info()
729 FWCMD_SET_ADDR_SEC_ENT_VALID(cmd, addr_cam->sec_cam_map[0] & 0xff); in rtw89_cam_fill_addr_cam_info()
730 FWCMD_SET_ADDR_SEC_ENT0(cmd, addr_cam->sec_ent[0]); in rtw89_cam_fill_addr_cam_info()
731 FWCMD_SET_ADDR_SEC_ENT1(cmd, addr_cam->sec_ent[1]); in rtw89_cam_fill_addr_cam_info()
732 FWCMD_SET_ADDR_SEC_ENT2(cmd, addr_cam->sec_ent[2]); in rtw89_cam_fill_addr_cam_info()
733 FWCMD_SET_ADDR_SEC_ENT3(cmd, addr_cam->sec_ent[3]); in rtw89_cam_fill_addr_cam_info()
734 FWCMD_SET_ADDR_SEC_ENT4(cmd, addr_cam->sec_ent[4]); in rtw89_cam_fill_addr_cam_info()
735 FWCMD_SET_ADDR_SEC_ENT5(cmd, addr_cam->sec_ent[5]); in rtw89_cam_fill_addr_cam_info()
736 FWCMD_SET_ADDR_SEC_ENT6(cmd, addr_cam->sec_ent[6]); in rtw89_cam_fill_addr_cam_info()
746 SET_DCTL_MACID_V1(cmd, rtwsta ? rtwsta->mac_id : rtwvif->mac_id); in rtw89_cam_fill_dctl_sec_cam_info_v1()
749 SET_DCTL_SEC_ENT0_KEYID_V1(cmd, addr_cam->sec_ent_keyid[0]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
750 SET_DCTL_SEC_ENT1_KEYID_V1(cmd, addr_cam->sec_ent_keyid[1]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
751 SET_DCTL_SEC_ENT2_KEYID_V1(cmd, addr_cam->sec_ent_keyid[2]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
752 SET_DCTL_SEC_ENT3_KEYID_V1(cmd, addr_cam->sec_ent_keyid[3]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
753 SET_DCTL_SEC_ENT4_KEYID_V1(cmd, addr_cam->sec_ent_keyid[4]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
754 SET_DCTL_SEC_ENT5_KEYID_V1(cmd, addr_cam->sec_ent_keyid[5]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
755 SET_DCTL_SEC_ENT6_KEYID_V1(cmd, addr_cam->sec_ent_keyid[6]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
757 SET_DCTL_SEC_ENT_VALID_V1(cmd, addr_cam->sec_cam_map[0] & 0xff); in rtw89_cam_fill_dctl_sec_cam_info_v1()
758 SET_DCTL_SEC_ENT0_V1(cmd, addr_cam->sec_ent[0]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
759 SET_DCTL_SEC_ENT1_V1(cmd, addr_cam->sec_ent[1]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
760 SET_DCTL_SEC_ENT2_V1(cmd, addr_cam->sec_ent[2]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
761 SET_DCTL_SEC_ENT3_V1(cmd, addr_cam->sec_ent[3]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
762 SET_DCTL_SEC_ENT4_V1(cmd, addr_cam->sec_ent[4]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
763 SET_DCTL_SEC_ENT5_V1(cmd, addr_cam->sec_ent[5]); in rtw89_cam_fill_dctl_sec_cam_info_v1()
764 SET_DCTL_SEC_ENT6_V1(cmd, addr_cam->sec_ent[6]); in rtw89_cam_fill_dctl_sec_cam_info_v1()