aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Klein <osstklei@de.ibm.com>2007-07-18 11:34:09 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-18 18:38:25 -0400
commitf9e29228e6f2058e7b086115ecb7008630ebd832 (patch)
tree6bdfb01bad0eeeabb7c75f651106c91081a0401f
parente190d6b140079c104ba57e5130a9b4ebea618e92 (diff)
eHEA: Fix bonding support
The driver didn't allow an interface's MAC address to be modified if the respective interface wasn't setup - a failing Hcall was the result. Thus bonding wasn't usable. The fix moves the failing Hcall which was registering a MAC address for the reception of BC packets in firmware from the port up and down functions to the port resources setup functions. Additionally the missing update of the last_rx member of the netdev structure was added. Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c37
2 files changed, 20 insertions, 19 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 6628fa622e2c..489c8b260dd8 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0070" 42#define DRV_VERSION "EHEA_0071"
43 43
44/* eHEA capability flags */ 44/* eHEA capability flags */
45#define DLPAR_PORT_ADD_REM 1 45#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 1d1571cf322e..4c70a9301c1b 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -466,6 +466,8 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
466 cqe->vlan_tag); 466 cqe->vlan_tag);
467 else 467 else
468 netif_receive_skb(skb); 468 netif_receive_skb(skb);
469
470 dev->last_rx = jiffies;
469 } else { 471 } else {
470 pr->p_stats.poll_receive_errors++; 472 pr->p_stats.poll_receive_errors++;
471 port_reset = ehea_treat_poll_error(pr, rq, cqe, 473 port_reset = ehea_treat_poll_error(pr, rq, cqe,
@@ -1433,7 +1435,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
1433 port->logical_port_id, 1435 port->logical_port_id,
1434 reg_type, port->mac_addr, 0, hcallid); 1436 reg_type, port->mac_addr, 0, hcallid);
1435 if (hret != H_SUCCESS) { 1437 if (hret != H_SUCCESS) {
1436 ehea_error("reg_dereg_bcmc failed (tagged)"); 1438 ehea_error("%sregistering bc address failed (tagged)",
1439 hcallid == H_REG_BCMC ? "" : "de");
1437 ret = -EIO; 1440 ret = -EIO;
1438 goto out_herr; 1441 goto out_herr;
1439 } 1442 }
@@ -1444,7 +1447,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
1444 port->logical_port_id, 1447 port->logical_port_id,
1445 reg_type, port->mac_addr, 0, hcallid); 1448 reg_type, port->mac_addr, 0, hcallid);
1446 if (hret != H_SUCCESS) { 1449 if (hret != H_SUCCESS) {
1447 ehea_error("reg_dereg_bcmc failed (vlan)"); 1450 ehea_error("%sregistering bc address failed (vlan)",
1451 hcallid == H_REG_BCMC ? "" : "de");
1448 ret = -EIO; 1452 ret = -EIO;
1449 } 1453 }
1450out_herr: 1454out_herr:
@@ -2170,7 +2174,6 @@ static int ehea_up(struct net_device *dev)
2170{ 2174{
2171 int ret, i; 2175 int ret, i;
2172 struct ehea_port *port = netdev_priv(dev); 2176 struct ehea_port *port = netdev_priv(dev);
2173 u64 mac_addr = 0;
2174 2177
2175 if (port->state == EHEA_PORT_UP) 2178 if (port->state == EHEA_PORT_UP)
2176 return 0; 2179 return 0;
@@ -2189,18 +2192,10 @@ static int ehea_up(struct net_device *dev)
2189 goto out_clean_pr; 2192 goto out_clean_pr;
2190 } 2193 }
2191 2194
2192 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2193 if (ret) {
2194 ret = -EIO;
2195 ehea_error("out_clean_pr");
2196 goto out_clean_pr;
2197 }
2198 mac_addr = (*(u64*)dev->dev_addr) >> 16;
2199
2200 ret = ehea_reg_interrupts(dev); 2195 ret = ehea_reg_interrupts(dev);
2201 if (ret) { 2196 if (ret) {
2202 ehea_error("out_dereg_bc"); 2197 ehea_error("reg_interrupts failed. ret:%d", ret);
2203 goto out_dereg_bc; 2198 goto out_clean_pr;
2204 } 2199 }
2205 2200
2206 for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { 2201 for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
@@ -2226,9 +2221,6 @@ static int ehea_up(struct net_device *dev)
2226out_free_irqs: 2221out_free_irqs:
2227 ehea_free_interrupts(dev); 2222 ehea_free_interrupts(dev);
2228 2223
2229out_dereg_bc:
2230 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2231
2232out_clean_pr: 2224out_clean_pr:
2233 ehea_clean_all_portres(port); 2225 ehea_clean_all_portres(port);
2234out: 2226out:
@@ -2273,7 +2265,6 @@ static int ehea_down(struct net_device *dev)
2273 &port->port_res[i].d_netdev->state)) 2265 &port->port_res[i].d_netdev->state))
2274 msleep(1); 2266 msleep(1);
2275 2267
2276 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2277 port->state = EHEA_PORT_DOWN; 2268 port->state = EHEA_PORT_DOWN;
2278 2269
2279 ret = ehea_clean_all_portres(port); 2270 ret = ehea_clean_all_portres(port);
@@ -2655,12 +2646,18 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
2655 2646
2656 INIT_WORK(&port->reset_task, ehea_reset_port); 2647 INIT_WORK(&port->reset_task, ehea_reset_port);
2657 2648
2649 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2650 if (ret) {
2651 ret = -EIO;
2652 goto out_unreg_port;
2653 }
2654
2658 ehea_set_ethtool_ops(dev); 2655 ehea_set_ethtool_ops(dev);
2659 2656
2660 ret = register_netdev(dev); 2657 ret = register_netdev(dev);
2661 if (ret) { 2658 if (ret) {
2662 ehea_error("register_netdev failed. ret=%d", ret); 2659 ehea_error("register_netdev failed. ret=%d", ret);
2663 goto out_unreg_port; 2660 goto out_dereg_bc;
2664 } 2661 }
2665 2662
2666 ret = ehea_get_jumboframe_status(port, &jumbo); 2663 ret = ehea_get_jumboframe_status(port, &jumbo);
@@ -2675,6 +2672,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
2675 2672
2676 return port; 2673 return port;
2677 2674
2675out_dereg_bc:
2676 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2677
2678out_unreg_port: 2678out_unreg_port:
2679 ehea_unregister_port(port); 2679 ehea_unregister_port(port);
2680 2680
@@ -2694,6 +2694,7 @@ static void ehea_shutdown_single_port(struct ehea_port *port)
2694{ 2694{
2695 unregister_netdev(port->netdev); 2695 unregister_netdev(port->netdev);
2696 ehea_unregister_port(port); 2696 ehea_unregister_port(port);
2697 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2697 kfree(port->mc_list); 2698 kfree(port->mc_list);
2698 free_netdev(port->netdev); 2699 free_netdev(port->netdev);
2699 port->adapter->active_ports--; 2700 port->adapter->active_ports--;