~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to drivers/scsi/bnx2fc/bnx2fc_fcoe.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-57i0gl3v99b3lkfg
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
664
664
        struct fcoe_port *port = lport_priv(lport);
665
665
        struct bnx2fc_hba *hba = port->priv;
666
666
        struct net_device *netdev = hba->netdev;
667
 
        struct ethtool_cmd ecmd = { ETHTOOL_GSET };
 
667
        struct ethtool_cmd ecmd;
668
668
 
669
669
        if (!dev_ethtool_get_settings(netdev, &ecmd)) {
670
670
                lport->link_supported_speeds &=
675
675
                if (ecmd.supported & SUPPORTED_10000baseT_Full)
676
676
                        lport->link_supported_speeds |= FC_PORTSPEED_10GBIT;
677
677
 
678
 
                if (ecmd.speed == SPEED_1000)
 
678
                switch (ethtool_cmd_speed(&ecmd)) {
 
679
                case SPEED_1000:
679
680
                        lport->link_speed = FC_PORTSPEED_1GBIT;
680
 
                if (ecmd.speed == SPEED_10000)
 
681
                        break;
 
682
                case SPEED_10000:
681
683
                        lport->link_speed = FC_PORTSPEED_10GBIT;
 
684
                        break;
 
685
                }
682
686
        }
683
 
        return;
684
687
}
685
688
static int bnx2fc_link_ok(struct fc_lport *lport)
686
689
{
1130
1133
        struct net_device *phys_dev;
1131
1134
 
1132
1135
        hba = container_of(kref, struct bnx2fc_hba, kref);
1133
 
        BNX2FC_HBA_DBG(hba->ctlr.lp, "Interface is being released\n");
 
1136
        BNX2FC_MISC_DBG("Interface is being released\n");
1134
1137
 
1135
1138
        netdev = hba->netdev;
1136
1139
        phys_dev = hba->phys_dev;
1254
1257
static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
1255
1258
                                  struct device *parent, int npiv)
1256
1259
{
1257
 
        struct fc_lport         *lport = NULL;
 
1260
        struct fc_lport         *lport, *n_port;
1258
1261
        struct fcoe_port        *port;
1259
1262
        struct Scsi_Host        *shost;
1260
1263
        struct fc_vport         *vport = dev_to_vport(parent);
1261
1264
        int                     rc = 0;
1262
1265
 
1263
1266
        /* Allocate Scsi_Host structure */
1264
 
        if (!npiv) {
1265
 
                lport = libfc_host_alloc(&bnx2fc_shost_template,
1266
 
                                          sizeof(struct fcoe_port));
1267
 
        } else {
1268
 
                lport = libfc_vport_create(vport,
1269
 
                                           sizeof(struct fcoe_port));
1270
 
        }
 
1267
        if (!npiv)
 
1268
                lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port));
 
1269
        else
 
1270
                lport = libfc_vport_create(vport, sizeof(*port));
1271
1271
 
1272
1272
        if (!lport) {
1273
1273
                printk(KERN_ERR PFX "could not allocate scsi host structure\n");
1285
1285
                goto lp_config_err;
1286
1286
 
1287
1287
        if (npiv) {
1288
 
                vport = dev_to_vport(parent);
1289
1288
                printk(KERN_ERR PFX "Setting vport names, 0x%llX 0x%llX\n",
1290
1289
                        vport->node_name, vport->port_name);
1291
1290
                fc_set_wwnn(lport, vport->node_name);
1314
1313
        fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN;
1315
1314
 
1316
1315
        /* Allocate exchange manager */
1317
 
        if (!npiv) {
 
1316
        if (!npiv)
1318
1317
                rc = bnx2fc_em_config(lport);
1319
 
                if (rc) {
1320
 
                        printk(KERN_ERR PFX "Error on bnx2fc_em_config\n");
1321
 
                        goto shost_err;
1322
 
                }
 
1318
        else {
 
1319
                shost = vport_to_shost(vport);
 
1320
                n_port = shost_priv(shost);
 
1321
                rc = fc_exch_mgr_list_clone(n_port, lport);
 
1322
        }
 
1323
 
 
1324
        if (rc) {
 
1325
                printk(KERN_ERR PFX "Error on bnx2fc_em_config\n");
 
1326
                goto shost_err;
1323
1327
        }
1324
1328
 
1325
1329
        bnx2fc_interface_get(hba);
1352
1356
        /* Free existing transmit skbs */
1353
1357
        fcoe_clean_pending_queue(lport);
1354
1358
 
1355
 
        bnx2fc_interface_put(hba);
1356
 
 
1357
1359
        /* Free queued packets for the receive thread */
1358
1360
        bnx2fc_clean_rx_queue(lport);
1359
1361
 
1372
1374
 
1373
1375
        /* Release Scsi_Host */
1374
1376
        scsi_host_put(lport->host);
 
1377
 
 
1378
        bnx2fc_interface_put(hba);
1375
1379
}
1376
1380
 
1377
1381
/**