[2.6.26] ehea: set mac address fix
Subsystems (2)
PATCH 1/1 [2.6.26] 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 <[email protected]>
---
drivers/net/ehea/ehea_main.c +10 -6
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_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 ;
Jeff Garzik
AppliedQuoted 6 lines · Jan-Bernd Themann
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 <[email protected]>
applied