kernels/linux-2.4.0/drivers/net/acenic.c
/*
 * Set the hardware MAC address.
 */
Set the hardware MAC address.
Set the hardware MAC address .
static int ace_set_mac_addr(struct net_device *dev, void *p)
{
	struct sockaddr *addr=p;
	struct ace_regs *regs;
	u8 *da;
	struct cmd cmd;
	if(netif_running(dev))
		return -EBUSY;
	memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
	da = (u8 *)dev->dev_addr;
	regs = ((struct ace_private *)dev->priv)->regs;
	writel(da[0] << 8 | da[1], &regs->MacAddrHi);
	writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5] , &regs->MacAddrLo);
	cmd.evt = C_SET_MAC_ADDR;
	cmd.code = 0;
	cmd.idx = 0;
	ace_issue_cmd(regs, &cmd);
	return 0;
}
static int ace_set_mac_addr ( struct net_device * dev , void * p ) { struct sockaddr * addr = p ; struct ace_regs * regs ; u8 * da ; struct cmd cmd ; if ( netif_running ( dev ) ) return - EBUSY ; memcpy ( dev -> dev_addr , addr -> sa_data , dev -> addr_len ) ; da = ( u8 * ) dev -> dev_addr ; regs = ( ( struct ace_private * ) dev -> priv ) -> regs ; writel ( da [ 0 ] << 8 | da [ 1 ] , & regs -> MacAddrHi ) ; writel ( ( da [ 2 ] << 24 ) | ( da [ 3 ] << 16 ) | ( da [ 4 ] << 8 ) | da [ 5 ] , & regs -> MacAddrLo ) ; cmd . evt = C_SET_MAC_ADDR ; cmd . code = 0 ; cmd . idx = 0 ; ace_issue_cmd ( regs , & cmd ) ; return 0 ; }
Set the hardware MAC address.
Set the hardware MAC address .