[PATCH] pm3386: add hook for setting MAC address
When we reset the pm3386, it loses its internally stored MAC addresses that were programmed into it by the bootloader (and are used by the hardware for the generation of PAUSE frames.) Add a hook to allow setting these addresses so that we can program them back by hand. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
committed by
Jeff Garzik
parent
7ed98bfdea
commit
0b85c0ebde
@@ -215,6 +215,13 @@ void pm3386_get_mac(int port, u8 *mac)
|
||||
mac[5] = (temp >> 8) & 0xff;
|
||||
}
|
||||
|
||||
void pm3386_set_mac(int port, u8 *mac)
|
||||
{
|
||||
pm3386_port_reg_write(port, 0x308, 0x100, (mac[1] << 8) | mac[0]);
|
||||
pm3386_port_reg_write(port, 0x309, 0x100, (mac[3] << 8) | mac[2]);
|
||||
pm3386_port_reg_write(port, 0x30a, 0x100, (mac[5] << 8) | mac[4]);
|
||||
}
|
||||
|
||||
static u32 pm3386_get_stat(int port, u16 base)
|
||||
{
|
||||
u32 value;
|
||||
|
Reference in New Issue
Block a user