src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_init_rx_addrs(struct txgbe_hw *hw)
{
	u32 i;
	u32 psrctl;
	u32 rar_entries = hw->mac.num_rar_entries;

	DEBUGFUNC("txgbe_init_rx_addrs");

	/*
	 * If the current mac address is valid, assume it is a software override
	 * to the permanent address.
	 * Otherwise, use the permanent address from the eeprom.
	 */
	if (txgbe_validate_mac_addr(hw->mac.addr) ==
	    TXGBE_ERR_INVALID_MAC_ADDR) {
		/* Get the MAC address from the RAR0 for later reference */
		hw->mac.get_mac_addr(hw, hw->mac.addr);

		DEBUGOUT(" Keeping Current RAR0 Addr =%.2X %.2X %.2X ",
			  hw->mac.addr[0], hw->mac.addr[1],
			  hw->mac.addr[2]);
		DEBUGOUT("%.2X %.2X %.2X\n", hw->mac.addr[3],
			  hw->mac.addr[4], hw->mac.addr[5]);
	} else {
		/* Setup the receive address. */
		DEBUGOUT("Overriding MAC Address in RAR[0]\n");
		DEBUGOUT(" New MAC Addr =%.2X %.2X %.2X ",
			  hw->mac.addr[0], hw->mac.addr[1],
			  hw->mac.addr[2]);
		DEBUGOUT("%.2X %.2X %.2X\n", hw->mac.addr[3],
			  hw->mac.addr[4], hw->mac.addr[5]);

		hw->mac.set_rar(hw, 0, hw->mac.addr, 0, true);
	}

	/* clear VMDq pool/queue selection for RAR 0 */
	hw->mac.clear_vmdq(hw, 0, BIT_MASK32);

	hw->addr_ctrl.overflow_promisc = 0;

	hw->addr_ctrl.rar_used_count = 1;

	/* Zero out the other receive addresses. */
	DEBUGOUT("Clearing RAR[1-%d]\n", rar_entries - 1);
	for (i = 1; i < rar_entries; i++) {
		wr32(hw, TXGBE_ETHADDRIDX, i);
		wr32(hw, TXGBE_ETHADDRL, 0);
		wr32(hw, TXGBE_ETHADDRH, 0);
	}

	/* Clear the MTA */
	hw->addr_ctrl.mta_in_use = 0;
	psrctl = rd32(hw, TXGBE_PSRCTL);
	psrctl &= ~(TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA);
	psrctl |= TXGBE_PSRCTL_ADHF12(hw->mac.mc_filter_type);
	wr32(hw, TXGBE_PSRCTL, psrctl);

	DEBUGOUT(" Clearing MTA\n");
	for (i = 0; i < hw->mac.mcft_size; i++)
		wr32(hw, TXGBE_MCADDRTBL(i), 0);

	txgbe_init_uta_tables(hw);

	return 0;
}
/**
 *  txgbe_init_rx_addrs - Initializes receive address filters.
 *  @hw: pointer to hardware structure
 *
 *  Places the MAC address in receive address register 0 and clears the rest
 *  of the receive address registers. Clears the multicast table. Assumes
 *  the receiver is in reset when the routine is called.
 **/
Initializes receive address filters.
@hw: pointer to hardware structure

Places the MAC address in receive address register 0 and clears the rest
of the receive address registers. Clears the multicast table. Assumes
the receiver is in reset when the routine is called.
Initializes receive address filters . @hw : pointer to hardware structure Places the MAC address in receive address register 0 and clears the rest of the receive address registers . Clears the multicast table . Assumes the receiver is in reset when the routine is called .
s32 txgbe_init_rx_addrs(struct txgbe_hw *hw)
{
	u32 i;
	u32 psrctl;
	u32 rar_entries = hw->mac.num_rar_entries;
	DEBUGFUNC("txgbe_init_rx_addrs");
	if (txgbe_validate_mac_addr(hw->mac.addr) ==
	    TXGBE_ERR_INVALID_MAC_ADDR) {
		hw->mac.get_mac_addr(hw, hw->mac.addr);
		DEBUGOUT(" Keeping Current RAR0 Addr =%.2X %.2X %.2X ",
			  hw->mac.addr[0], hw->mac.addr[1],
			  hw->mac.addr[2]);
		DEBUGOUT("%.2X %.2X %.2X\n", hw->mac.addr[3],
			  hw->mac.addr[4], hw->mac.addr[5]);
	} else {
		DEBUGOUT("Overriding MAC Address in RAR[0]\n");
		DEBUGOUT(" New MAC Addr =%.2X %.2X %.2X ",
			  hw->mac.addr[0], hw->mac.addr[1],
			  hw->mac.addr[2]);
		DEBUGOUT("%.2X %.2X %.2X\n", hw->mac.addr[3],
			  hw->mac.addr[4], hw->mac.addr[5]);
		hw->mac.set_rar(hw, 0, hw->mac.addr, 0, true);
	}
	hw->mac.clear_vmdq(hw, 0, BIT_MASK32);
	hw->addr_ctrl.overflow_promisc = 0;
	hw->addr_ctrl.rar_used_count = 1;
	DEBUGOUT("Clearing RAR[1-%d]\n", rar_entries - 1);
	for (i = 1; i < rar_entries; i++) {
		wr32(hw, TXGBE_ETHADDRIDX, i);
		wr32(hw, TXGBE_ETHADDRL, 0);
		wr32(hw, TXGBE_ETHADDRH, 0);
	}
	hw->addr_ctrl.mta_in_use = 0;
	psrctl = rd32(hw, TXGBE_PSRCTL);
	psrctl &= ~(TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA);
	psrctl |= TXGBE_PSRCTL_ADHF12(hw->mac.mc_filter_type);
	wr32(hw, TXGBE_PSRCTL, psrctl);
	DEBUGOUT(" Clearing MTA\n");
	for (i = 0; i < hw->mac.mcft_size; i++)
		wr32(hw, TXGBE_MCADDRTBL(i), 0);
	txgbe_init_uta_tables(hw);
	return 0;
}
s32 txgbe_init_rx_addrs ( struct txgbe_hw * hw ) { u32 i ; u32 psrctl ; u32 rar_entries = hw -> mac . num_rar_entries ; DEBUGFUNC ( " " ) ; if ( txgbe_validate_mac_addr ( hw -> mac . addr ) == TXGBE_ERR_INVALID_MAC_ADDR ) { hw -> mac . get_mac_addr ( hw , hw -> mac . addr ) ; DEBUGOUT ( " " , hw -> mac . addr [ 0 ] , hw -> mac . addr [ 1 ] , hw -> mac . addr [ 2 ] ) ; DEBUGOUT ( " \n " , hw -> mac . addr [ 3 ] , hw -> mac . addr [ 4 ] , hw -> mac . addr [ 5 ] ) ; } else { DEBUGOUT ( " \n " ) ; DEBUGOUT ( " " , hw -> mac . addr [ 0 ] , hw -> mac . addr [ 1 ] , hw -> mac . addr [ 2 ] ) ; DEBUGOUT ( " \n " , hw -> mac . addr [ 3 ] , hw -> mac . addr [ 4 ] , hw -> mac . addr [ 5 ] ) ; hw -> mac . set_rar ( hw , 0 , hw -> mac . addr , 0 , true ) ; } hw -> mac . clear_vmdq ( hw , 0 , BIT_MASK32 ) ; hw -> addr_ctrl . overflow_promisc = 0 ; hw -> addr_ctrl . rar_used_count = 1 ; DEBUGOUT ( " \n " , rar_entries - 1 ) ; for ( i = 1 ; i < rar_entries ; i ++ ) { wr32 ( hw , TXGBE_ETHADDRIDX , i ) ; wr32 ( hw , TXGBE_ETHADDRL , 0 ) ; wr32 ( hw , TXGBE_ETHADDRH , 0 ) ; } hw -> addr_ctrl . mta_in_use = 0 ; psrctl = rd32 ( hw , TXGBE_PSRCTL ) ; psrctl &= ~ ( TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA ) ; psrctl |= TXGBE_PSRCTL_ADHF12 ( hw -> mac . mc_filter_type ) ; wr32 ( hw , TXGBE_PSRCTL , psrctl ) ; DEBUGOUT ( " \n " ) ; for ( i = 0 ; i < hw -> mac . mcft_size ; i ++ ) wr32 ( hw , TXGBE_MCADDRTBL ( i ) , 0 ) ; txgbe_init_uta_tables ( hw ) ; return 0 ; }
txgbe_init_rx_addrs - Initializes receive address filters.
txgbe_init_rx_addrs - Initializes receive address filters .
/*
	 * If the current mac address is valid, assume it is a software override
	 * to the permanent address.
	 * Otherwise, use the permanent address from the eeprom.
	 */ /* Get the MAC address from the RAR0 for later reference */ /* Setup the receive address. */ /* clear VMDq pool/queue selection for RAR 0 */ /* Zero out the other receive addresses. */ /* Clear the MTA */