Skip to content

Commit

Permalink
lpfc: Convert runtime references to old xlane cfg param to fof cfg param
Browse files Browse the repository at this point in the history
Convert runtime references to old xlane cfg param to fof cfg param

Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-By: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
James Smart authored and Christoph Hellwig committed Jun 2, 2014
1 parent 0293635 commit f38fa0b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
12 changes: 6 additions & 6 deletions drivers/scsi/lpfc/lpfc_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@ lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr,
uint8_t wwpn[WWN_SZ];
int rc;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

/* count may include a LF at end of string */
Expand Down Expand Up @@ -2437,7 +2437,7 @@ lpfc_oas_vpt_store(struct device *dev, struct device_attribute *attr,
uint8_t wwpn[WWN_SZ];
int rc;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

/* count may include a LF at end of string */
Expand Down Expand Up @@ -2504,7 +2504,7 @@ lpfc_oas_lun_state_store(struct device *dev, struct device_attribute *attr,
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
int val = 0;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

if (!isdigit(buf[0]))
Expand Down Expand Up @@ -2570,7 +2570,7 @@ lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[],

int rc = 0;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

if (oas_state) {
Expand Down Expand Up @@ -2675,7 +2675,7 @@ lpfc_oas_lun_show(struct device *dev, struct device_attribute *attr,
uint64_t oas_lun;
int len = 0;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0)
Expand Down Expand Up @@ -2721,7 +2721,7 @@ lpfc_oas_lun_store(struct device *dev, struct device_attribute *attr,
uint64_t scsi_lun;
ssize_t rc;

if (!phba->cfg_EnableXLane)
if (!phba->cfg_fof)
return -EPERM;

if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0)
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ lpfc_idiag_queinfo_read(struct file *file, char __user *buf, size_t nbytes,
goto too_big;
}

if (phba->cfg_EnableXLane) {
if (phba->cfg_fof) {

/* OAS CQ */
qp = phba->sli4_hba.oas_cq;
Expand Down
9 changes: 4 additions & 5 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -10938,7 +10938,7 @@ lpfc_sli4_oas_verify(struct lpfc_hba *phba)
if (phba->sli4_hba.pc_sli4_params.oas_supported) {
phba->cfg_fof = 1;
} else {
phba->cfg_EnableXLane = 0;
phba->cfg_fof = 0;
if (phba->device_data_mem_pool)
mempool_destroy(phba->device_data_mem_pool);
phba->device_data_mem_pool = NULL;
Expand Down Expand Up @@ -10968,7 +10968,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba)
if (rc)
return -ENOMEM;

if (phba->cfg_EnableXLane) {
if (phba->cfg_fof) {

rc = lpfc_cq_create(phba, phba->sli4_hba.oas_cq,
phba->sli4_hba.fof_eq, LPFC_WCQ, LPFC_FCP);
Expand All @@ -10987,8 +10987,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba)
return 0;

out_oas_wq:
if (phba->cfg_EnableXLane)
lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq);
lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq);
out_oas_cq:
lpfc_eq_destroy(phba, phba->sli4_hba.fof_eq);
return rc;
Expand Down Expand Up @@ -11022,7 +11021,7 @@ lpfc_fof_queue_create(struct lpfc_hba *phba)

phba->sli4_hba.fof_eq = qdesc;

if (phba->cfg_EnableXLane) {
if (phba->cfg_fof) {

/* Create OAS CQ */
qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize,
Expand Down
20 changes: 10 additions & 10 deletions drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ lpfc_rport_data_from_scsi_device(struct scsi_device *sdev)
{
struct lpfc_vport *vport = (struct lpfc_vport *)sdev->host->hostdata;

if (vport->phba->cfg_EnableXLane)
if (vport->phba->cfg_fof)
return ((struct lpfc_device_data *)sdev->hostdata)->rport_data;
else
return (struct lpfc_rport_data *)sdev->hostdata;
Expand Down Expand Up @@ -3462,7 +3462,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
* If the OAS driver feature is enabled and the lun is enabled for
* OAS, set the oas iocb related flags.
*/
if ((phba->cfg_EnableXLane) && ((struct lpfc_device_data *)
if ((phba->cfg_fof) && ((struct lpfc_device_data *)
scsi_cmnd->device->hostdata)->oas_enabled)
lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_OAS;
return 0;
Expand Down Expand Up @@ -5504,7 +5504,7 @@ lpfc_slave_alloc(struct scsi_device *sdev)
if (!rport || fc_remote_port_chkready(rport))
return -ENXIO;

if (phba->cfg_EnableXLane) {
if (phba->cfg_fof) {

/*
* Check to see if the device data structure for the lun
Expand Down Expand Up @@ -5629,7 +5629,7 @@ lpfc_slave_destroy(struct scsi_device *sdev)
struct lpfc_device_data *device_data = sdev->hostdata;

atomic_dec(&phba->sdev_cnt);
if ((phba->cfg_EnableXLane) && (device_data)) {
if ((phba->cfg_fof) && (device_data)) {
spin_lock_irqsave(&phba->devicelock, flags);
device_data->available = false;
if (!device_data->oas_enabled)
Expand Down Expand Up @@ -5668,7 +5668,7 @@ lpfc_create_device_data(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
int memory_flags;

if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
!(phba->cfg_EnableXLane))
!(phba->cfg_fof))
return NULL;

/* Attempt to create the device data to contain lun info */
Expand Down Expand Up @@ -5706,7 +5706,7 @@ lpfc_delete_device_data(struct lpfc_hba *phba,
{

if (unlikely(!phba) || !lun_info ||
!(phba->cfg_EnableXLane))
!(phba->cfg_fof))
return;

if (!list_empty(&lun_info->listentry))
Expand Down Expand Up @@ -5740,7 +5740,7 @@ __lpfc_get_device_data(struct lpfc_hba *phba, struct list_head *list,
struct lpfc_device_data *lun_info;

if (unlikely(!phba) || !list || !vport_wwpn || !target_wwpn ||
!phba->cfg_EnableXLane)
!phba->cfg_fof)
return NULL;

/* Check to see if the lun is already enabled for OAS. */
Expand Down Expand Up @@ -5802,7 +5802,7 @@ lpfc_find_next_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
!starting_lun || !found_vport_wwpn ||
!found_target_wwpn || !found_lun || !found_lun_status ||
(*starting_lun == NO_MORE_OAS_LUN) ||
!phba->cfg_EnableXLane)
!phba->cfg_fof)
return false;

lun = *starting_lun;
Expand Down Expand Up @@ -5886,7 +5886,7 @@ lpfc_enable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
unsigned long flags;

if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
!phba->cfg_EnableXLane)
!phba->cfg_fof)
return false;

spin_lock_irqsave(&phba->devicelock, flags);
Expand Down Expand Up @@ -5943,7 +5943,7 @@ lpfc_disable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
unsigned long flags;

if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
!phba->cfg_EnableXLane)
!phba->cfg_fof)
return false;

spin_lock_irqsave(&phba->devicelock, flags);
Expand Down
7 changes: 3 additions & 4 deletions drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@ lpfc_sli4_arm_cqeq_intr(struct lpfc_hba *phba)
} while (++fcp_eqidx < phba->cfg_fcp_io_channel);
}

if (phba->cfg_EnableXLane)
if (phba->cfg_fof)
lpfc_sli4_cq_release(phba->sli4_hba.oas_cq, LPFC_QUEUE_REARM);

if (phba->sli4_hba.hba_eq) {
Expand Down Expand Up @@ -8714,8 +8714,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number,

if ((piocb->iocb_flag & LPFC_IO_FCP) ||
(piocb->iocb_flag & LPFC_USE_FCPWQIDX)) {
if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag &
LPFC_IO_OAS))) {
if (!phba->cfg_fof || (!(piocb->iocb_flag & LPFC_IO_OAS))) {
wq = phba->sli4_hba.fcp_wq[piocb->fcp_wqidx];
} else {
wq = phba->sli4_hba.oas_wq;
Expand Down Expand Up @@ -8810,7 +8809,7 @@ lpfc_sli_issue_iocb(struct lpfc_hba *phba, uint32_t ring_number,

if (phba->sli_rev == LPFC_SLI_REV4) {
if (piocb->iocb_flag & LPFC_IO_FCP) {
if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag &
if (!phba->cfg_fof || (!(piocb->iocb_flag &
LPFC_IO_OAS))) {
if (unlikely(!phba->sli4_hba.fcp_wq))
return IOCB_ERROR;
Expand Down

0 comments on commit f38fa0b

Please sign in to comment.