Merge branch 'for-upstream' of git://openrisc.net/jonas/linux
[pandora-kernel.git] / drivers / net / bnx2x / bnx2x_cmn.c
index 5854a6c..5b0dba6 100644 (file)
@@ -1989,6 +1989,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
                return -EINVAL;
        }
 
+       /* Stop Tx */
+       bnx2x_tx_disable(bp);
+
 #ifdef BCM_CNIC
        bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
 #endif
@@ -1997,9 +2000,6 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
 
        bp->rx_mode = BNX2X_RX_MODE_NONE;
 
-       /* Stop Tx */
-       bnx2x_tx_disable(bp);
-
        del_timer_sync(&bp->timer);
 
        /* Set ALWAYS_ALIVE bit in shmem */
@@ -2042,6 +2042,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
         */
        bnx2x_squeeze_objects(bp);
 
+       /* There should be no more pending SP commands at this stage */
+       bp->sp_state = 0;
+
        bp->port.pmf = 0;
 
        /* Free SKBs, SGEs, TPA pool and driver internals */
@@ -3327,6 +3330,29 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp)
        return LINK_CONFIG_IDX(sel_phy_idx);
 }
 
+#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)
+int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
+{
+       struct bnx2x *bp = netdev_priv(dev);
+       struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
+
+       switch (type) {
+       case NETDEV_FCOE_WWNN:
+               *wwn = HILO_U64(cp->fcoe_wwn_node_name_hi,
+                               cp->fcoe_wwn_node_name_lo);
+               break;
+       case NETDEV_FCOE_WWPN:
+               *wwn = HILO_U64(cp->fcoe_wwn_port_name_hi,
+                               cp->fcoe_wwn_port_name_lo);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+#endif
+
 /* called with rtnl_lock */
 int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
 {