Skip to content

Commit

Permalink
ehea: set mac address fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan-Bernd Themann authored and Jeff Garzik committed Jun 10, 2008
1 parent 23bdfdd commit 00aaea2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 00aaea2

Please sign in to comment.