From b5a475e944447faa6a2110eea0419a7d2a156a0c Mon Sep 17 00:00:00 2001 From: Raghava Aditya Renukunta Date: Tue, 26 Dec 2017 20:34:32 -0800 Subject: [PATCH] scsi: aacraid: Refactor and rename to make mirror existing changes Rename variables and functions to make bmic identify, report phy luns to make them consistent across code internal existing code bases Signed-off-by: Raghava Aditya Renukunta Signed-off-by: Martin K. Petersen --- drivers/scsi/aacraid/aachba.c | 36 ++++++++++++++++++---------------- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 1853bd28e3f3..801aff0ba7ce 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1753,17 +1753,18 @@ fib_error: return rcode; } -static int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target) +static int aac_issue_safw_bmic_identify(struct aac_dev *dev, + u32 bus, u32 target) { int rcode = -ENOMEM; - u16 datasize; + int datasize; struct aac_srb_unit srbu; struct aac_srb *srbcmd; - struct aac_ciss_identify_pd *identify_resp; + struct aac_ciss_identify_pd *identify_reply; datasize = sizeof(struct aac_ciss_identify_pd); - identify_resp = kmalloc(datasize, GFP_KERNEL); - if (!identify_resp) + identify_reply = kmalloc(datasize, GFP_KERNEL); + if (!identify_reply) goto out; memset(&srbu, 0, sizeof(struct aac_srb_unit)); @@ -1774,30 +1775,31 @@ static int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target) srbcmd->cdb[2] = (u8)((AAC_MAX_LUN + target) & 0x00FF); srbcmd->cdb[6] = CISS_IDENTIFY_PHYSICAL_DEVICE; - rcode = aac_send_safw_bmic_cmd(dev, &srbu, identify_resp, datasize); + rcode = aac_send_safw_bmic_cmd(dev, &srbu, identify_reply, datasize); if (unlikely(rcode < 0)) goto out; - if (identify_resp->current_queue_depth_limit <= 0 || - identify_resp->current_queue_depth_limit > 32) + if (identify_reply->current_queue_depth_limit <= 0 || + identify_reply->current_queue_depth_limit > 32) dev->hba_map[bus][target].qd_limit = 32; else dev->hba_map[bus][target].qd_limit = - identify_resp->current_queue_depth_limit; + identify_reply->current_queue_depth_limit; - kfree(identify_resp); + kfree(identify_reply); out: return rcode; } /** - * aac_update hba_map()- update current hba map with data from FW + * aac_set_safw_attr_all_targets- update current hba map with data from FW * @dev: aac_dev structure * @phys_luns: FW information from report phys luns + * @rescan: Indicates scan type * * Update our hba map with the information gathered from the FW */ -void aac_update_hba_map(struct aac_dev *dev, +static void aac_set_safw_attr_all_targets(struct aac_dev *dev, struct aac_ciss_phys_luns_resp *phys_luns, int rescan) { /* ok and extended reporting */ @@ -1839,7 +1841,7 @@ void aac_update_hba_map(struct aac_dev *dev, if (devtype != AAC_DEVTYPE_NATIVE_RAW) goto update_devtype; - if (aac_issue_bmic_identify(dev, bus, target) < 0) + if (aac_issue_safw_bmic_identify(dev, bus, target) < 0) dev->hba_map[bus][target].qd_limit = 32; update_devtype: @@ -1851,14 +1853,14 @@ update_devtype: } /** - * aac_report_phys_luns() Process topology change + * aac_get_safw_ciss_luns() Process topology change * @dev: aac_dev structure * @rescan: Indicates rescan * * Execute a CISS REPORT PHYS LUNS and process the results into * the current hba_map. */ -int aac_report_phys_luns(struct aac_dev *dev, int rescan) +int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) { int rcode = -ENOMEM; int datasize; @@ -1888,7 +1890,7 @@ int aac_report_phys_luns(struct aac_dev *dev, int rescan) /* analyse data */ if (rcode >= 0 && phys_luns->resp_flag == 2) { /* ok and extended reporting */ - aac_update_hba_map(dev, phys_luns, rescan); + aac_set_safw_attr_all_targets(dev, phys_luns, rescan); } kfree(phys_luns); @@ -2001,7 +2003,7 @@ int aac_get_adapter_info(struct aac_dev* dev) if (!dev->sync_mode && dev->sa_firmware && dev->supplement_adapter_info.virt_device_bus != 0xffff) { /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ - rcode = aac_report_phys_luns(dev, AAC_INIT); + rcode = aac_get_safw_ciss_luns(dev, AAC_INIT); } if (!dev->in_reset) { diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 3a201681852b..d81d0aac3ad4 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2639,7 +2639,7 @@ static inline int aac_adapter_check_health(struct aac_dev *dev) int aac_acquire_irq(struct aac_dev *dev); void aac_free_irq(struct aac_dev *dev); -int aac_report_phys_luns(struct aac_dev *dev, int rescan); +int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan); const char *aac_driverinfo(struct Scsi_Host *); void aac_fib_vector_assign(struct aac_dev *dev); struct fib *aac_fib_alloc(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index f70f1122b474..82ddc7449518 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1945,7 +1945,7 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) for (target = 0; target < AAC_MAX_TARGETS; target++) dev->hba_map[bus][target].new_devtype = 0; - rcode = aac_report_phys_luns(dev, AAC_RESCAN); + rcode = aac_get_safw_ciss_luns(dev, AAC_RESCAN); aac_resolve_luns(dev); -- 2.30.2