Ejemplo n.º 1
0
static void armadillo8x0_get_mac_address(struct platform_info *pinfo, u8 *addr)
{
	struct board_private *priv = pinfo->private_data;
	u8 *mac;

	if (is_valid_mac(priv->umac1))
		mac = priv->umac1;
	else
		mac = priv->mac1;

	memcpy(addr, mac, 6);
}
Ejemplo n.º 2
0
static void __maybe_unused armadillo8x0_display_info(struct platform_info *pinfo)
{
	struct board_private *priv = pinfo->private_data;

	hprintf("      Board Type: 0x%x\n"
		"Product Revision: %d.%d\n"
		"      Lot Number: 0x%x\n"
		"   Serial Number: %d\n"
		"       Boot Mode: 0x%x (%s)\n",
		priv->hw_type,
		priv->product_rev_major, priv->product_rev_minor,
		priv->lot_num, priv->serial_num,
		priv->boot_mode,
		get_boot_mode_str(priv->boot_mode));

	hprintf(" ORIG MAC-1: ");
	print_mac(priv->mac1);
	if (is_valid_mac(priv->umac1)) {
		hprintf(" USER MAC-1: ");
		print_mac(priv->umac1);
	}
}
Ejemplo n.º 3
0
int l2_packet_get_own_src_addr(struct l2_packet_data *l2, u8 *addr)
{
	if (is_valid_mac(l2->san_mac_addr))
		memcpy(addr, l2->san_mac_addr, ETH_ALEN);
	else {
		/* get an appropriate src MAC to use if the port is
	 	* part of a bond.
		*/
		struct port *bond_port = porthead;
		while (bond_port != NULL) {
			if (bond_port->bond_master
			    && get_src_mac_from_bond(bond_port, l2->ifname,
						     addr))
				return 0;

			bond_port = bond_port->next;
		}
		memcpy(addr, l2->curr_mac_addr, ETH_ALEN);
	}

	return 0;
}