[SCSI] fcoe: reset FIP ctlr link state on disable/enable
[pandora-kernel.git] / drivers / scsi / fcoe / fcoe.c
index 927b3e6..0d8127e 100644 (file)
@@ -1901,9 +1901,10 @@ static int fcoe_disable(const char *buffer, struct kernel_param *kp)
        fcoe = fcoe_hostlist_lookup_port(netdev);
        rtnl_unlock();
 
-       if (fcoe)
+       if (fcoe) {
                fc_fabric_logoff(fcoe->ctlr.lp);
-       else
+               fcoe_ctlr_link_down(&fcoe->ctlr);
+       } else
                rc = -ENODEV;
 
        dev_put(netdev);
@@ -1950,9 +1951,11 @@ static int fcoe_enable(const char *buffer, struct kernel_param *kp)
        fcoe = fcoe_hostlist_lookup_port(netdev);
        rtnl_unlock();
 
-       if (fcoe)
+       if (fcoe) {
+               if (!fcoe_link_ok(fcoe->ctlr.lp))
+                       fcoe_ctlr_link_up(&fcoe->ctlr);
                rc = fc_fabric_login(fcoe->ctlr.lp);
-       else
+       else
                rc = -ENODEV;
 
        dev_put(netdev);