Lines Matching refs:mac_addr

105 	struct fbnic_mac_addr *mac_addr;  in fbnic_bmc_rpc_all_multi_config()  local
114 mac_addr = &fbd->mac_addr[fbd->mac_addr_boundary - 1]; in fbnic_bmc_rpc_all_multi_config()
116 if (mac_addr->state != FBNIC_TCAM_S_VALID) { in fbnic_bmc_rpc_all_multi_config()
117 eth_zero_addr(mac_addr->value.addr8); in fbnic_bmc_rpc_all_multi_config()
118 eth_broadcast_addr(mac_addr->mask.addr8); in fbnic_bmc_rpc_all_multi_config()
119 mac_addr->value.addr8[0] ^= 1; in fbnic_bmc_rpc_all_multi_config()
120 mac_addr->mask.addr8[0] ^= 1; in fbnic_bmc_rpc_all_multi_config()
121 set_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam); in fbnic_bmc_rpc_all_multi_config()
122 mac_addr->state = FBNIC_TCAM_S_ADD; in fbnic_bmc_rpc_all_multi_config()
126 mac_addr->act_tcam); in fbnic_bmc_rpc_all_multi_config()
129 mac_addr->act_tcam); in fbnic_bmc_rpc_all_multi_config()
130 } else if (!test_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam) && in fbnic_bmc_rpc_all_multi_config()
131 !is_zero_ether_addr(mac_addr->mask.addr8) && in fbnic_bmc_rpc_all_multi_config()
132 mac_addr->state == FBNIC_TCAM_S_VALID) { in fbnic_bmc_rpc_all_multi_config()
133 clear_bit(FBNIC_MAC_ADDR_T_ALLMULTI, mac_addr->act_tcam); in fbnic_bmc_rpc_all_multi_config()
134 clear_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam); in fbnic_bmc_rpc_all_multi_config()
135 mac_addr->state = FBNIC_TCAM_S_DELETE; in fbnic_bmc_rpc_all_multi_config()
179 struct fbnic_mac_addr *mac_addr; in fbnic_bmc_rpc_init() local
195 mac_addr = __fbnic_mc_sync(fbd, bmc_mac); in fbnic_bmc_rpc_init()
197 mac_addr = &fbd->mac_addr[i++]; in fbnic_bmc_rpc_init()
199 if (!mac_addr) { in fbnic_bmc_rpc_init()
205 ether_addr_copy(mac_addr->value.addr8, bmc_mac); in fbnic_bmc_rpc_init()
206 eth_zero_addr(mac_addr->mask.addr8); in fbnic_bmc_rpc_init()
208 set_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam); in fbnic_bmc_rpc_init()
209 mac_addr->state = FBNIC_TCAM_S_ADD; in fbnic_bmc_rpc_init()
213 mac_addr = &fbd->mac_addr[FBNIC_RPC_TCAM_MACDA_BROADCAST_IDX]; in fbnic_bmc_rpc_init()
214 eth_broadcast_addr(mac_addr->value.addr8); in fbnic_bmc_rpc_init()
215 set_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam); in fbnic_bmc_rpc_init()
216 mac_addr->state = FBNIC_TCAM_S_ADD; in fbnic_bmc_rpc_init()
338 struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[i]; in __fbnic_uc_sync() local
340 if (mac_addr->state == FBNIC_TCAM_S_DISABLED) { in __fbnic_uc_sync()
341 avail_addr = mac_addr; in __fbnic_uc_sync()
342 } else if (ether_addr_equal(mac_addr->value.addr8, addr)) { in __fbnic_uc_sync()
343 avail_addr = mac_addr; in __fbnic_uc_sync()
369 struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[i]; in __fbnic_mc_sync() local
371 if (mac_addr->state == FBNIC_TCAM_S_DISABLED) { in __fbnic_mc_sync()
372 avail_addr = mac_addr; in __fbnic_mc_sync()
373 } else if (ether_addr_equal(mac_addr->value.addr8, addr)) { in __fbnic_mc_sync()
374 avail_addr = mac_addr; in __fbnic_mc_sync()
383 struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[i]; in __fbnic_mc_sync() local
385 if (!is_zero_ether_addr(mac_addr->mask.addr8)) in __fbnic_mc_sync()
389 if (!ether_addr_equal(mac_addr->value.addr8, addr)) in __fbnic_mc_sync()
394 memcpy(avail_addr, mac_addr, sizeof(*mac_addr)); in __fbnic_mc_sync()
395 mac_addr->state = FBNIC_TCAM_S_DELETE; in __fbnic_mc_sync()
411 int __fbnic_xc_unsync(struct fbnic_mac_addr *mac_addr, unsigned int tcam_idx) in __fbnic_xc_unsync() argument
413 if (!test_and_clear_bit(tcam_idx, mac_addr->act_tcam)) in __fbnic_xc_unsync()
416 if (bitmap_empty(mac_addr->act_tcam, FBNIC_RPC_TCAM_ACT_NUM_ENTRIES)) in __fbnic_xc_unsync()
417 mac_addr->state = FBNIC_TCAM_S_DELETE; in __fbnic_xc_unsync()
431 struct fbnic_mac_addr *dest_addr = &fbd->mac_addr[dest]; in fbnic_sift_macda()
437 struct fbnic_mac_addr *src_addr = &fbd->mac_addr[src++]; in fbnic_sift_macda()
477 for (idx = ARRAY_SIZE(fbd->mac_addr); idx--;) { in fbnic_clear_macda()
478 struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[idx]; in fbnic_clear_macda() local
480 if (mac_addr->state == FBNIC_TCAM_S_DISABLED) in fbnic_clear_macda()
483 if (test_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam)) { in fbnic_clear_macda()
493 if (mac_addr->state == FBNIC_TCAM_S_DELETE) { in fbnic_clear_macda()
494 memset(mac_addr, 0, sizeof(*mac_addr)); in fbnic_clear_macda()
501 mac_addr->state = FBNIC_TCAM_S_UPDATE; in fbnic_clear_macda()
506 struct fbnic_mac_addr *mac_addr) in fbnic_write_macda_entry() argument
511 mask = &mac_addr->mask.addr16[FBNIC_RPC_TCAM_MACDA_WORD_LEN - 1]; in fbnic_write_macda_entry()
512 value = &mac_addr->value.addr16[FBNIC_RPC_TCAM_MACDA_WORD_LEN - 1]; in fbnic_write_macda_entry()
528 for (idx = ARRAY_SIZE(fbd->mac_addr); idx--;) { in fbnic_write_macda()
529 struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[idx]; in fbnic_write_macda() local
532 if (!(mac_addr->state & FBNIC_TCAM_S_UPDATE)) in fbnic_write_macda()
536 if (mac_addr->state == FBNIC_TCAM_S_DELETE) { in fbnic_write_macda()
539 memset(mac_addr, 0, sizeof(*mac_addr)); in fbnic_write_macda()
544 fbnic_write_macda_entry(fbd, idx, mac_addr); in fbnic_write_macda()
546 mac_addr->state = FBNIC_TCAM_S_VALID; in fbnic_write_macda()