提交 00aaea2f 编写于 作者: J Jan-Bernd Themann 提交者: Jeff Garzik

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: NJan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 23bdfdd3
...@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) ...@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
mutex_lock(&ehea_bcmc_regs.lock); mutex_lock(&ehea_bcmc_regs.lock);
/* Deregister old MAC in pHYP */ /* Deregister old MAC in pHYP */
ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); if (port->state == EHEA_PORT_UP) {
if (ret) ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
goto out_upregs; if (ret)
goto out_upregs;
}
port->mac_addr = cb0->port_mac_addr << 16; port->mac_addr = cb0->port_mac_addr << 16;
/* Register new MAC in pHYP */ /* Register new MAC in pHYP */
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); if (port->state == EHEA_PORT_UP) {
if (ret) ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
goto out_upregs; if (ret)
goto out_upregs;
}
ret = 0; ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册