From: Lennert Buytenhek Date: Wed, 23 Nov 2005 11:49:47 +0000 (+0100) Subject: [PATCH] pm3386: add hook for setting MAC address X-Git-Tag: v2.6.16-rc1~474^2~22^2~7^2~56 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b85c0ebde63a41d57b6214977ac2752bf5a086f;p=linux-2.6 [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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c index 267b6bd5f7..870b486f5d 100644 --- a/drivers/net/ixp2000/pm3386.c +++ b/drivers/net/ixp2000/pm3386.c @@ -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; diff --git a/drivers/net/ixp2000/pm3386.h b/drivers/net/ixp2000/pm3386.h index 55ecb18342..117f50afcd 100644 --- a/drivers/net/ixp2000/pm3386.h +++ b/drivers/net/ixp2000/pm3386.h @@ -15,6 +15,7 @@ void pm3386_reset(void); void pm3386_init_port(int port); void pm3386_get_mac(int port, u8 *mac); +void pm3386_set_mac(int port, u8 *mac); void pm3386_get_stats(int port, struct net_device_stats *stats); int pm3386_is_link_up(int port); void pm3386_enable_rx(int port);