diff options
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r-- | drivers/scsi/fnic/fnic_main.c | 11 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_scsi.c | 22 |
2 files changed, 11 insertions, 22 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 265e73d9cd6f..9eb7a9ebccae 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -617,7 +617,6 @@ static int __devinit fnic_probe(struct pci_dev *pdev, fnic->ctlr.send = fnic_eth_send; fnic->ctlr.update_mac = fnic_update_mac; fnic->ctlr.get_src_addr = fnic_get_mac; - fcoe_ctlr_init(&fnic->ctlr); if (fnic->config.flags & VFCF_FIP_CAPABLE) { shost_printk(KERN_INFO, fnic->lport->host, "firmware supports FIP\n"); @@ -625,10 +624,11 @@ static int __devinit fnic_probe(struct pci_dev *pdev, vnic_dev_packet_filter(fnic->vdev, 1, 1, 0, 0, 0); vnic_dev_add_addr(fnic->vdev, FIP_ALL_ENODE_MACS); vnic_dev_add_addr(fnic->vdev, fnic->ctlr.ctl_src_addr); + fcoe_ctlr_init(&fnic->ctlr, FIP_MODE_AUTO); } else { shost_printk(KERN_INFO, fnic->lport->host, "firmware uses non-FIP mode\n"); - fnic->ctlr.mode = FIP_ST_NON_FIP; + fcoe_ctlr_init(&fnic->ctlr, FIP_MODE_NON_FIP); } fnic->state = FNIC_IN_FC_MODE; @@ -673,7 +673,6 @@ static int __devinit fnic_probe(struct pci_dev *pdev, /* Start local port initiatialization */ lp->link_up = 0; - lp->tt = fnic_transport_template; lp->max_retry_count = fnic->config.flogi_retries; lp->max_rport_retry_count = fnic->config.plogi_retries; @@ -689,11 +688,7 @@ static int __devinit fnic_probe(struct pci_dev *pdev, fc_set_wwnn(lp, fnic->config.node_wwn); fc_set_wwpn(lp, fnic->config.port_wwn); - fc_lport_init(lp); - fc_exch_init(lp); - fc_elsct_init(lp); - fc_rport_init(lp); - fc_disc_init(lp); + fcoe_libfc_config(lp, &fnic->ctlr, &fnic_transport_template, 0); if (!fc_exch_mgr_alloc(lp, FC_CLASS_3, FCPIO_HOST_EXCH_RANGE_START, FCPIO_HOST_EXCH_RANGE_END, NULL)) { diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 3cc47c6e1ada..198cbab3e894 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -1246,11 +1246,10 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) lp = shost_priv(sc->device->host); fnic = lport_priv(lp); - FNIC_SCSI_DBG(KERN_DEBUG, - fnic->lport->host, - "Abort Cmd called FCID 0x%x, LUN 0x%x TAG %d\n", - (starget_to_rport(scsi_target(sc->device)))->port_id, - sc->device->lun, sc->request->tag); + rport = starget_to_rport(scsi_target(sc->device)); + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, + "Abort Cmd called FCID 0x%x, LUN 0x%x TAG %d\n", + rport->port_id, sc->device->lun, sc->request->tag); if (lp->state != LPORT_ST_READY || !(lp->link_up)) { ret = FAILED; @@ -1299,7 +1298,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) * port is up, then send abts to the remote port to terminate * the IO. Else, just locally terminate the IO in the firmware */ - rport = starget_to_rport(scsi_target(sc->device)); if (fc_remote_port_chkready(rport) == 0) task_req = FCPIO_ITMF_ABT_TASK; else @@ -1418,7 +1416,6 @@ static int fnic_clean_pending_aborts(struct fnic *fnic, unsigned long flags; int ret = 0; struct scsi_cmnd *sc; - struct fc_rport *rport; struct scsi_lun fc_lun; struct scsi_device *lun_dev = lr_sc->device; DECLARE_COMPLETION_ONSTACK(tm_done); @@ -1458,7 +1455,6 @@ static int fnic_clean_pending_aborts(struct fnic *fnic, /* Now queue the abort command to firmware */ int_to_scsilun(sc->device->lun, &fc_lun); - rport = starget_to_rport(scsi_target(sc->device)); if (fnic_queue_abort_io_req(fnic, tag, FCPIO_ITMF_ABT_TASK_TERM, @@ -1528,18 +1524,16 @@ int fnic_device_reset(struct scsi_cmnd *sc) lp = shost_priv(sc->device->host); fnic = lport_priv(lp); - FNIC_SCSI_DBG(KERN_DEBUG, - fnic->lport->host, - "Device reset called FCID 0x%x, LUN 0x%x\n", - (starget_to_rport(scsi_target(sc->device)))->port_id, - sc->device->lun); + rport = starget_to_rport(scsi_target(sc->device)); + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, + "Device reset called FCID 0x%x, LUN 0x%x\n", + rport->port_id, sc->device->lun); if (lp->state != LPORT_ST_READY || !(lp->link_up)) goto fnic_device_reset_end; /* Check if remote port up */ - rport = starget_to_rport(scsi_target(sc->device)); if (fc_remote_port_chkready(rport)) goto fnic_device_reset_end; |