lib/linux-5.18-rc3-smdk/drivers/net/ethernet/ti/davinci_emac.c
/**
 * emac_set_type2addr - Set EMAC Type2 mac address
 * @priv: The DaVinci EMAC private adapter structure
 * @ch: RX channel number
 * @mac_addr: MAC address to set in device
 * @index: index into RX address entries
 * @match: match parameter for RX address matching logic
 *
 * Called internally to set Type2 mac address of the adapter (Device)
 *
 * Returns success (0) or appropriate error code (none as of now)
 */


Called internally to set Type2 mac address of the adapter (Device)

Returns success (0) or appropriate error code (none as of now)
Called internally to set Type2 mac address of the adapter ( Device ) Returns success ( 0 ) or appropriate error code ( none as of now )
static void emac_set_type2addr(struct emac_priv *priv, u32 ch,
			       char *mac_addr, int index, int match)
{
	u32 val;
	emac_write(EMAC_MACINDEX, index);
	val = ((mac_addr[3] << 24) | (mac_addr[2] << 16) | \
	       (mac_addr[1] << 8) | (mac_addr[0]));
	emac_write(EMAC_MACADDRHI, val);
	val = ((mac_addr[5] << 8) | mac_addr[4] | ((ch & 0x7) << 16) | \
	       (match << 19) | BIT(20));
	emac_write(EMAC_MACADDRLO, val);
	emac_set_type0addr(priv, ch, mac_addr);
}
static void emac_set_type2addr ( struct emac_priv * priv , u32 ch , char * mac_addr , int index , int match ) { u32 val ; emac_write ( EMAC_MACINDEX , index ) ; val = ( ( mac_addr [ 3 ] << 24 ) | ( mac_addr [ 2 ] << 16 ) | ( mac_addr [ 1 ] << 8 ) | ( mac_addr [ 0 ] ) ) ; emac_write ( EMAC_MACADDRHI , val ) ; val = ( ( mac_addr [ 5 ] << 8 ) | mac_addr [ 4 ] | ( ( ch & 0x7 ) << 16 ) | ( match << 19 ) | BIT ( 20 ) ) ; emac_write ( EMAC_MACADDRLO , val ) ; emac_set_type0addr ( priv , ch , mac_addr ) ; }
emac_set_type2addr - Set EMAC Type2 mac address
 @priv: The DaVinci EMAC private adapter structure
 @ch: RX channel number
 @mac_addr: MAC address to set in device
 @index: index into RX address entries
 @match: match parameter for RX address matching logic
emac_set_type2addr - Set EMAC Type2 mac address @priv : The DaVinci EMAC private adapter structure @ch : RX channel number @mac_addr : MAC address to set in device @index : index into RX address entries @match : match parameter for RX address matching logic