aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea
diff options
context:
space:
mode:
authorJan-Bernd Themann <ossthema@de.ibm.com>2008-06-09 15:17:37 +0100
committerJeff Garzik <jgarzik@redhat.com>2008-06-10 18:20:23 -0400
commit00aaea2f95d73d4e2b5e45cf77c3cbb16c59e87f (patch)
treec758947730e4d9064581b8f5ee2febae0d1fd866 /drivers/net/ehea
parent23bdfdd388723b8213f597743b1d4aba0d62de9c (diff)
downloadkernel_samsung_tuna-00aaea2f95d73d4e2b5e45cf77c3cbb16c59e87f.zip
kernel_samsung_tuna-00aaea2f95d73d4e2b5e45cf77c3cbb16c59e87f.tar.gz
kernel_samsung_tuna-00aaea2f95d73d4e2b5e45cf77c3cbb16c59e87f.tar.bz2
ehea: set mac address fix
eHEA has to call firmware functions in order to change the mac address of a logical port. This patch checks if the logical port is up when calling the register / deregister mac address calls. If the port is down these firmware calls would fail and are therefore not executed. Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r--drivers/net/ehea/ehea_main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 287a619..faae01d 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
mutex_lock(&ehea_bcmc_regs.lock);
/* Deregister old MAC in pHYP */
- ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
- if (ret)
- goto out_upregs;
+ if (port->state == EHEA_PORT_UP) {
+ ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
+ if (ret)
+ goto out_upregs;
+ }
port->mac_addr = cb0->port_mac_addr << 16;
/* Register new MAC in pHYP */
- ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
- if (ret)
- goto out_upregs;
+ if (port->state == EHEA_PORT_UP) {
+ ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
+ if (ret)
+ goto out_upregs;
+ }
ret = 0;