]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/fcoe/fcoe.c
Merge remote-tracking branch 'trivial/for-next'
[karo-tx-linux.git] / drivers / scsi / fcoe / fcoe.c
index 34c8d82b74239fa7c82383aa5e0891f39aefab47..c8c3997f83880ace26e016503dd0014a55297d89 100644 (file)
@@ -137,7 +137,6 @@ static int fcoe_vport_create(struct fc_vport *, bool disabled);
 static int fcoe_vport_disable(struct fc_vport *, bool disable);
 static void fcoe_set_vport_symbolic_name(struct fc_vport *);
 static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *);
-static int fcoe_validate_vport_create(struct fc_vport *);
 
 static struct libfc_function_template fcoe_libfc_fcn_templ = {
        .frame_send = fcoe_xmit,
@@ -579,23 +578,6 @@ static int fcoe_lport_config(struct fc_lport *lport)
        return 0;
 }
 
-/**
- * fcoe_get_wwn() - Get the world wide name from LLD if it supports it
- * @netdev: the associated net device
- * @wwn: the output WWN
- * @type: the type of WWN (WWPN or WWNN)
- *
- * Returns: 0 for success
- */
-static int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type)
-{
-       const struct net_device_ops *ops = netdev->netdev_ops;
-
-       if (ops->ndo_fcoe_get_wwn)
-               return ops->ndo_fcoe_get_wwn(netdev, wwn, type);
-       return -EINVAL;
-}
-
 /**
  * fcoe_netdev_features_change - Updates the lport's offload flags based
  * on the LLD netdev's FCoE feature flags
@@ -1517,7 +1499,7 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
                        return -ENOMEM;
                }
                frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
-               cp = kmap_atomic(frag->page, KM_SKB_DATA_SOFTIRQ)
+               cp = kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ)
                        + frag->page_offset;
        } else {
                cp = (struct fcoe_crc_eof *)skb_put(skb, tlen);
@@ -2045,7 +2027,7 @@ int fcoe_link_speed_update(struct fc_lport *lport)
        struct net_device *netdev = fcoe_netdev(lport);
        struct ethtool_cmd ecmd;
 
-       if (!dev_ethtool_get_settings(netdev, &ecmd)) {
+       if (!__ethtool_get_settings(netdev, &ecmd)) {
                lport->link_supported_speeds &=
                        ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
                if (ecmd.supported & (SUPPORTED_1000baseT_Half |
@@ -2446,7 +2428,7 @@ static int fcoe_vport_create(struct fc_vport *vport, bool disabled)
 
        rc = fcoe_validate_vport_create(vport);
        if (rc) {
-               wwn_to_str(vport->port_name, buf, sizeof(buf));
+               fcoe_wwn_to_str(vport->port_name, buf, sizeof(buf));
                printk(KERN_ERR "fcoe: Failed to create vport, "
                        "WWPN (0x%s) already exists\n",
                        buf);
@@ -2454,7 +2436,9 @@ static int fcoe_vport_create(struct fc_vport *vport, bool disabled)
        }
 
        mutex_lock(&fcoe_config_mutex);
+       rtnl_lock();
        vn_port = fcoe_if_create(fcoe, &vport->dev, 1);
+       rtnl_unlock();
        mutex_unlock(&fcoe_config_mutex);
 
        if (IS_ERR(vn_port)) {
@@ -2598,49 +2582,3 @@ static void fcoe_set_port_id(struct fc_lport *lport,
        if (fp && fc_frame_payload_op(fp) == ELS_FLOGI)
                fcoe_ctlr_recv_flogi(&fcoe->ctlr, lport, fp);
 }
-
-/**
- * fcoe_validate_vport_create() - Validate a vport before creating it
- * @vport: NPIV port to be created
- *
- * This routine is meant to add validation for a vport before creating it
- * via fcoe_vport_create().
- * Current validations are:
- *      - WWPN supplied is unique for given lport
- *
- *
-*/
-static int fcoe_validate_vport_create(struct fc_vport *vport)
-{
-       struct Scsi_Host *shost = vport_to_shost(vport);
-       struct fc_lport *n_port = shost_priv(shost);
-       struct fc_lport *vn_port;
-       int rc = 0;
-       char buf[32];
-
-       mutex_lock(&n_port->lp_mutex);
-
-       wwn_to_str(vport->port_name, buf, sizeof(buf));
-       /* Check if the wwpn is not same as that of the lport */
-       if (!memcmp(&n_port->wwpn, &vport->port_name, sizeof(u64))) {
-               FCOE_DBG("vport WWPN 0x%s is same as that of the "
-                       "base port WWPN\n", buf);
-               rc = -EINVAL;
-               goto out;
-       }
-
-       /* Check if there is any existing vport with same wwpn */
-       list_for_each_entry(vn_port, &n_port->vports, list) {
-               if (!memcmp(&vn_port->wwpn, &vport->port_name, sizeof(u64))) {
-                       FCOE_DBG("vport with given WWPN 0x%s already "
-                       "exists\n", buf);
-                       rc = -EINVAL;
-                       break;
-               }
-       }
-
-out:
-       mutex_unlock(&n_port->lp_mutex);
-
-       return rc;
-}