* ngbe_clear_rar - Remove Rx address register * @hw: pointer to hardware structure * @index: Receive address register to write * * Clears an ethernet address from a receive address register. **/
| 516 | * Clears an ethernet address from a receive address register. |
| 517 | **/ |
| 518 | s32 ngbe_clear_rar(struct ngbe_hw *hw, u32 index) |
| 519 | { |
| 520 | u32 rar_high; |
| 521 | u32 rar_entries = hw->mac.num_rar_entries; |
| 522 | |
| 523 | /* Make sure we are using a valid rar index range */ |
| 524 | if (index >= rar_entries) { |
| 525 | DEBUGOUT("RAR index %d is out of range.", index); |
| 526 | return NGBE_ERR_INVALID_ARGUMENT; |
| 527 | } |
| 528 | |
| 529 | /* |
| 530 | * Some parts put the VMDq setting in the extra RAH bits, |
| 531 | * so save everything except the lower 16 bits that hold part |
| 532 | * of the address and the address valid bit. |
| 533 | */ |
| 534 | wr32(hw, NGBE_ETHADDRIDX, index); |
| 535 | rar_high = rd32(hw, NGBE_ETHADDRH); |
| 536 | rar_high &= ~(NGBE_ETHADDRH_AD_MASK | NGBE_ETHADDRH_VLD); |
| 537 | |
| 538 | wr32(hw, NGBE_ETHADDRL, 0); |
| 539 | wr32(hw, NGBE_ETHADDRH, rar_high); |
| 540 | |
| 541 | /* clear VMDq pool/queue selection for this RAR */ |
| 542 | hw->mac.clear_vmdq(hw, index, BIT_MASK32); |
| 543 | |
| 544 | return 0; |
| 545 | } |
| 546 | |
| 547 | /** |
| 548 | * ngbe_init_rx_addrs - Initializes receive address filters. |
no test coverage detected