From owner-svn-src-head@freebsd.org Tue Sep 1 21:53:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EF1737C995; Tue, 1 Sep 2020 21:53:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bh16C1dQ3z4WQK; Tue, 1 Sep 2020 21:53:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B33A20248; Tue, 1 Sep 2020 21:53:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 081LrNEH046924; Tue, 1 Sep 2020 21:53:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 081LrLCi046915; Tue, 1 Sep 2020 21:53:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009012153.081LrLCi046915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 1 Sep 2020 21:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365154 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 365154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2020 21:53:23 -0000 Author: mjg Date: Tue Sep 1 21:53:21 2020 New Revision: 365154 URL: https://svnweb.freebsd.org/changeset/base/365154 Log: smartpqi: clean up empty lines in .c and .h files Modified: head/sys/dev/smartpqi/smartpqi_cam.c head/sys/dev/smartpqi/smartpqi_cmd.c head/sys/dev/smartpqi/smartpqi_defines.h head/sys/dev/smartpqi/smartpqi_discovery.c head/sys/dev/smartpqi/smartpqi_event.c head/sys/dev/smartpqi/smartpqi_helper.c head/sys/dev/smartpqi/smartpqi_includes.h head/sys/dev/smartpqi/smartpqi_init.c head/sys/dev/smartpqi/smartpqi_intr.c head/sys/dev/smartpqi/smartpqi_ioctl.c head/sys/dev/smartpqi/smartpqi_ioctl.h head/sys/dev/smartpqi/smartpqi_main.c head/sys/dev/smartpqi/smartpqi_mem.c head/sys/dev/smartpqi/smartpqi_misc.c head/sys/dev/smartpqi/smartpqi_prototypes.h head/sys/dev/smartpqi/smartpqi_queue.c head/sys/dev/smartpqi/smartpqi_request.c head/sys/dev/smartpqi/smartpqi_response.c head/sys/dev/smartpqi/smartpqi_sis.c head/sys/dev/smartpqi/smartpqi_structures.h head/sys/dev/smartpqi/smartpqi_tag.c Modified: head/sys/dev/smartpqi/smartpqi_cam.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_cam.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_cam.c Tue Sep 1 21:53:21 2020 (r365154) @@ -76,7 +76,7 @@ static void get_transport_settings(struct pqisrc_softs struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; DBG_FUNC("IN\n"); - + cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_SPC4; cts->transport = XPORT_SPI; @@ -126,7 +126,7 @@ void os_remove_device(pqisrc_softstate_t *softs, struct cam_path *tmppath; DBG_FUNC("IN\n"); - + if(softs->os_specific.sim_registered) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(softs->os_specific.sim), @@ -224,7 +224,6 @@ smartpqi_fix_ld_inquiry(pqisrc_softstate_t *softs, str (cdb[1] & SI_EVPD) == 0 && (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { - inq = (struct scsi_inquiry_data *)csio->data_ptr; device = softs->device_list[csio->ccb_h.target_id][csio->ccb_h.target_lun]; @@ -263,7 +262,7 @@ os_io_response_success(rcb_t *rcb) panic("rcb is null"); csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; - + if (csio == NULL) panic("csio is null"); @@ -332,7 +331,6 @@ void os_raid_response_error(rcb_t *rcb, raid_path_erro csio->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID | CAM_REQ_CMP_ERR; - } break; @@ -364,7 +362,6 @@ void os_raid_response_error(rcb_t *rcb, raid_path_erro DBG_IO("OUT\n"); } - /* * Error response handling for aio. */ @@ -564,7 +561,6 @@ static int pqi_map_request( rcb_t *rcb ) rcb->status = REQUEST_PENDING; error = pqisrc_build_send_io(softs, rcb); - } DBG_FUNC("OUT error = %d\n", error); @@ -605,7 +601,6 @@ static void smartpqi_lunrescan_cb(struct cam_periph *p xpt_free_ccb(ccb); } - /* * Function to rescan the lun */ @@ -717,7 +712,7 @@ static int pqisrc_io_start(struct cam_sim *sim, union pqi_scsi_dev_t *dvp; DBG_FUNC("IN\n"); - + if( softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun] == NULL ) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; DBG_INFO("Device = %d not there\n", ccb->ccb_h.target_id); @@ -1172,13 +1167,12 @@ int register_sim(struct pqisrc_softstate *softs, int c void deregister_sim(struct pqisrc_softstate *softs) { struct ccb_setasync csa; - + DBG_FUNC("IN\n"); if (softs->os_specific.mtx_init) { mtx_lock(&softs->os_specific.cam_lock); } - xpt_setup_ccb(&csa.ccb_h, softs->os_specific.path, 5); csa.ccb_h.func_code = XPT_SASYNC_CB; Modified: head/sys/dev/smartpqi/smartpqi_cmd.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_cmd.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_cmd.c Tue Sep 1 21:53:21 2020 (r365154) @@ -43,7 +43,7 @@ int pqisrc_submit_cmnd(pqisrc_softstate_t *softs, DBG_FUNC("IN\n"); PQI_LOCK(&ib_q->lock); - + /* Check queue full */ if ((ib_q->pi_local + 1) % ib_q->num_elem == *(ib_q->ci_virt_addr)) { DBG_WARN("OUT Q full\n"); Modified: head/sys/dev/smartpqi/smartpqi_defines.h ============================================================================== --- head/sys/dev/smartpqi/smartpqi_defines.h Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_defines.h Tue Sep 1 21:53:21 2020 (r365154) @@ -77,7 +77,7 @@ } \ } \ } - + #define FILL_QUEUE_ARRAY_ADDR(q,virt,dma) { \ q->array_virt_addr = virt; \ q->array_dma_addr = dma; \ @@ -105,7 +105,6 @@ enum INTR_TYPE { #define DMA_PHYS_LOW(mem) (((mem)->dma_addr) & 0x00000000ffffffff) #define DMA_PHYS_HIGH(mem) ((((mem)->dma_addr) & 0xffffffff00000000) >> 32) - typedef enum REQUEST_STATUS { REQUEST_SUCCESS = 0, REQUEST_PENDING = -1, @@ -135,7 +134,6 @@ typedef enum controller_state { PQI_BUS_RESET, }controller_state_t; - #define PQISRC_MAX_MSIX_SUPPORTED 64 /* SIS Specific */ @@ -187,8 +185,6 @@ typedef enum controller_state { #define PQISRC_MAX_ADMIN_IB_QUEUE_ELEM_NUM 16 #define PQISRC_MAX_ADMIN_OB_QUEUE_ELEM_NUM 16 - - #define PQI_MIN_OP_IB_QUEUE_ID 1 #define PQI_OP_EVENT_QUEUE_ID 1 #define PQI_MIN_OP_OB_QUEUE_ID 2 @@ -348,7 +344,6 @@ enum pqisrc_ctrl_mode{ #define PQI_MANAGEMENT_CMD_RESP_TIMEOUT 3000 #define PQISRC_EVENT_ACK_RESP_TIMEOUT 1000 - /* Supported Event types by controller */ #define PQI_NUM_SUPPORTED_EVENTS 7 @@ -371,7 +366,6 @@ enum pqisrc_ctrl_mode{ #define PQI_MAX_HEARTBEAT_REQUESTS 5 - /* Device flags */ #define PQISRC_DFLAG_VALID (1 << 0) #define PQISRC_DFLAG_CONFIGURING (1 << 1) @@ -409,7 +403,6 @@ enum pqisrc_ctrl_mode{ #define SOP_TASK_MANAGEMENT_FUNCTION_ABORT_TASK_SET 0x02 #define SOP_TASK_MANAGEMENT_LUN_RESET 0x8 - /* Additional CDB bytes */ #define PQI_ADDITIONAL_CDB_BYTES_0 0 /* 16 byte CDB */ #define PQI_ADDITIONAL_CDB_BYTES_4 1 /* 20 byte CDB */ @@ -471,7 +464,6 @@ enum pqisrc_ctrl_mode{ #define VPD_PAGE (1 << 8) - /* logical volume states */ #define SA_LV_OK 0x0 #define SA_LV_NOT_AVAILABLE 0xb @@ -495,8 +487,6 @@ enum pqisrc_ctrl_mode{ /* 0 = no limit */ #define PQI_LOGICAL_DISK_DEFAULT_MAX_QUEUE_DEPTH 0 - - #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" #define SA_CACHE_FLUSH 0x1 @@ -521,13 +511,11 @@ enum pqisrc_ctrl_mode{ #define ASCQ_LUN_NOT_READY_FORMAT_IN_PROGRESS 0x4 #define ASCQ_LUN_NOT_READY_INITIALIZING_CMD_REQ 0x2 - #define OBDR_SIG_OFFSET 43 #define OBDR_TAPE_SIG "$DR-10" #define OBDR_SIG_LEN (sizeof(OBDR_TAPE_SIG) - 1) #define OBDR_TAPE_INQ_SIZE (OBDR_SIG_OFFSET + OBDR_SIG_LEN) - #define IOACCEL_STATUS_BYTE 4 #define OFFLOAD_CONFIGURED_BIT 0x1 #define OFFLOAD_ENABLED_BIT 0x2 @@ -546,7 +534,6 @@ enum pqisrc_ctrl_mode{ #define TEST_UNIT_READY 0x00 #define SCSI_VPD_HEADER_LENGTH 64 - #define PQI_MAX_MULTILUN 256 #define PQI_MAX_LOGICALS 64 #define PQI_MAX_PHYSICALS 1024 @@ -588,7 +575,6 @@ typedef enum pqisrc_device_status { #define BMIC_FLASH_FIRMWARE 0xf7 #define BMIC_WRITE_HOST_WELLNESS 0xa5 - #define MASKED_DEVICE(lunid) ((lunid)[3] & 0xC0) #define BMIC_GET_LEVEL_2_BUS(lunid) ((lunid)[7] & 0x3F) #define BMIC_GET_LEVEL_TWO_TARGET(lunid) ((lunid)[6]) @@ -659,14 +645,12 @@ static inline void PUT_BE64(uint64_t val, uint8_t *p) PUT_BE32(val, p + 4); } - #define OS_FREEBSD #define SIS_POLL_WAIT #define OS_ATTRIBUTE_PACKED __attribute__((__packed__)) #define OS_ATTRIBUTE_ALIGNED(n) __attribute__((aligned(n))) - /* Management Interface */ #define CCISS_IOC_MAGIC 'C' #define SMARTPQI_IOCTL_BASE 'M' @@ -699,7 +683,6 @@ typedef struct _driver_info typedef uint8_t *passthru_buf_type_t; - #define PQISRC_DRIVER_MAJOR 1 #define PQISRC_DRIVER_MINOR 0 #define PQISRC_DRIVER_RELEASE 3 @@ -711,7 +694,7 @@ typedef uint8_t *passthru_buf_type_t; PQISRC_DRIVER_MINOR, \ PQISRC_DRIVER_RELEASE, \ PQISRC_DRIVER_REVISION) - + /* End Management interface */ #ifdef ASSERT @@ -724,7 +707,6 @@ typedef uint8_t *passthru_buf_type_t; } \ } - #define PQI_MAX_MSIX 64 /* vectors */ #define PQI_MSI_CTX_SIZE sizeof(pqi_intr_ctx)+1 #define IS_POLLING_REQUIRED(softs) if (cold) {\ @@ -764,7 +746,6 @@ typedef struct PCI_ACC_HANDLE { #define LEGACY_SIS_ODR_SHIFT 12 /* outbound doorbell shift */ #define LEGACY_SIS_IDR_SHIFT 9 /* inbound doorbell shift */ - /* * PQI Register definitions for the smartraid adapters */ @@ -792,10 +773,9 @@ typedef struct PCI_ACC_HANDLE { #define OS_BUSYWAIT(x) DELAY(x) #define OS_SLEEP(timeout) \ DELAY(timeout); - + #define OS_HOST_WELLNESS_TIMEOUT (24 * 3600) - #define LE_16(x) htole16(x) #define LE_32(x) htole32(x) #define LE_64(x) htole64(x) @@ -806,7 +786,6 @@ typedef struct PCI_ACC_HANDLE { #define PQI_HWIF_SRCV 0 #define PQI_HWIF_UNKNOWN -1 - #define SMART_STATE_SUSPEND (1<<0) #define SMART_STATE_UNUSED0 (1<<1) #define SMART_STATE_INTERRUPTS_ON (1<<2) @@ -818,7 +797,6 @@ typedef struct PCI_ACC_HANDLE { #define PQI_SIM_REGISTERED (1<<2) #define PQI_MTX_INIT (1<<3) - #define PQI_CMD_MAPPED (1<<2) /* Interrupt context to get oq_id */ @@ -946,7 +924,6 @@ static int logging_level = PQISRC_LOG_LEVEL; #define PQISRC_FLAGS_DISC 0x00000010 #define PQISRC_FLAGS_WARN 0x00000020 #define PQISRC_FLAGS_ERROR 0x00000040 - #define DBG_INIT(fmt,args...) \ do { \ Modified: head/sys/dev/smartpqi/smartpqi_discovery.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_discovery.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_discovery.c Tue Sep 1 21:53:21 2020 (r365154) @@ -58,7 +58,7 @@ int pqisrc_alloc_tid(pqisrc_softstate_t *softs) DBG_ERR("Target ID exhausted\n"); return INVALID_ELEM; } - + return softs->tid_pool.tid[softs->tid_pool.index--]; } @@ -68,7 +68,7 @@ void pqisrc_free_tid(pqisrc_softstate_t *softs, int ti DBG_ERR("Target ID queue is full\n"); return; } - + softs->tid_pool.index++; softs->tid_pool.tid[softs->tid_pool.index] = tid; } @@ -126,7 +126,7 @@ int pqisrc_build_send_raid_request(pqisrc_softstate_t void *buff, size_t datasize, uint8_t cmd, uint16_t vpd_page, uint8_t *scsi3addr, raid_path_error_info_elem_t *error_info) { - + uint8_t *cdb; int ret = PQI_STATUS_SUCCESS; uint32_t tag = 0; @@ -137,7 +137,7 @@ int pqisrc_build_send_raid_request(pqisrc_softstate_t ob_queue_t *ob_q = &softs->op_ob_q[PQI_DEFAULT_IB_QUEUE]; rcb_t *rcb = NULL; - + DBG_FUNC("IN\n"); memset(&device_mem, 0, sizeof(struct dma_mem)); @@ -149,7 +149,7 @@ int pqisrc_build_send_raid_request(pqisrc_softstate_t device_mem.align = PQISRC_DEFAULT_DMA_ALIGN; ret = os_dma_mem_alloc(softs, &device_mem); - + if (ret) { DBG_ERR("failed to allocate dma memory for device_mem return code %d\n", ret); return ret; @@ -160,7 +160,6 @@ int pqisrc_build_send_raid_request(pqisrc_softstate_t sgd->addr = device_mem.dma_addr; sgd->len = datasize; sgd->flags = SG_FLAG_LAST; - } /* Build raid path request */ @@ -278,7 +277,7 @@ int pqisrc_build_send_raid_request(pqisrc_softstate_t } os_dma_mem_free(softs, &device_mem); } - + ret = rcb->status; if (ret) { if(error_info) { @@ -422,7 +421,6 @@ static int pqisrc_get_phys_log_device_list(pqisrc_soft reportlun_data_ext_t *local_logdev_list; reportlun_data_ext_t *logdev_data; reportlun_header_t report_lun_header; - DBG_FUNC("IN\n"); @@ -438,7 +436,6 @@ static int pqisrc_get_phys_log_device_list(pqisrc_soft return ret; } - logdev_data = *logical_dev_list; if (logdev_data) { @@ -592,7 +589,7 @@ static uint8_t pqisrc_get_volume_offline_status(pqisrc uint8_t *buff = NULL; DBG_FUNC("IN\n"); - + buff = os_mem_alloc(softs, 64); if (!buff) return PQI_STATUS_FAILURE; @@ -621,7 +618,6 @@ out: return status; } - /* Determine offline status of a volume. Returns appropriate SA_LV_* status.*/ static uint8_t pqisrc_get_dev_vol_status(pqisrc_softstate_t *softs, uint8_t *scsi3addr) @@ -642,7 +638,7 @@ static uint8_t pqisrc_get_dev_vol_status(pqisrc_softst memset(&request, 0, sizeof(request)); ret = pqisrc_build_send_raid_request(softs, &request, NULL, 0, TEST_UNIT_READY, 0, scsi3addr, &error_info); - + if (ret) goto error; sense_data = error_info.data; @@ -824,7 +820,7 @@ static void pqisrc_get_dev_ioaccel_status(pqisrc_softs DBG_ERR("error in send scsi inquiry ret=%d\n", ret); goto err_out; } - + ioaccel_status = buff[IOACCEL_STATUS_BYTE]; device->offload_config = !!(ioaccel_status & OFFLOAD_CONFIGURED_BIT); @@ -835,7 +831,7 @@ static void pqisrc_get_dev_ioaccel_status(pqisrc_softs if (pqisrc_get_device_raidmap(softs, device)) device->offload_enabled_pending = false; } - + DBG_DISC("offload_config: 0x%x offload_enabled_pending: 0x%x \n", device->offload_config, device->offload_enabled_pending); @@ -995,7 +991,6 @@ static int pqisrc_identify_physical_disk(pqisrc_softst uint16_t bmic_device_index; pqisrc_raid_req_t request; - DBG_FUNC("IN\n"); memset(&request, 0, sizeof(request)); @@ -1046,7 +1041,6 @@ static void pqisrc_get_physical_device_info(pqisrc_sof DBG_FUNC("OUT\n"); } - /* Function used to find the entry of the device in a list */ static device_status_t pqisrc_scsi_find_entry(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device_to_find, @@ -1077,7 +1071,6 @@ static device_status_t pqisrc_scsi_find_entry(pqisrc_s return DEVICE_NOT_FOUND; } - /* Update the newly added devices as existed device */ static void pqisrc_exist_device_update(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device_exist, @@ -1241,7 +1234,6 @@ void pqisrc_remove_device(pqisrc_softstate_t *softs, DBG_FUNC("OUT\n"); } - /* * When exposing new device to OS fails then adjst list according to the * mid scsi list @@ -1331,7 +1323,7 @@ void pqisrc_device_mem_free(pqisrc_softstate_t *softs, } os_mem_free(softs, (char *)device,sizeof(*device)); DBG_FUNC("OUT\n"); - + } /* OS should call this function to free the scsi device */ @@ -1347,7 +1339,6 @@ void pqisrc_free_device(pqisrc_softstate_t * softs,pqi } - /* Update the newly added devices to the device list */ static void pqisrc_update_device_list(pqisrc_softstate_t *softs, pqi_scsi_dev_t *new_device_list[], int num_new_devices) @@ -1372,9 +1363,9 @@ static void pqisrc_update_device_list(pqisrc_softstate DBG_WARN("Out of memory \n"); goto free_and_out; } - + OS_ACQUIRE_SPINLOCK(&softs->devlist_lock); - + for(i = 0; i < PQI_MAX_DEVICES; i++) { for(j = 0; j < PQI_MAX_MULTILUN; j++) { if(softs->device_list[i][j] == NULL) @@ -1448,7 +1439,7 @@ static void pqisrc_update_device_list(pqisrc_softstate } pqisrc_update_log_dev_qdepth(softs); - + for(i = 0; i < PQI_MAX_DEVICES; i++) { for(j = 0; j < PQI_MAX_MULTILUN; j++) { if(softs->device_list[i][j] == NULL) @@ -1571,7 +1562,7 @@ int pqisrc_write_driver_version_to_host_wellness(pqisr BMIC_WRITE_HOST_WELLNESS, 0, (uint8_t *)RAID_CTLR_LUNID, NULL); os_mem_free(softs, (char *)host_wellness_driver_ver, data_length); - + DBG_FUNC("OUT"); return rval; } @@ -1613,10 +1604,10 @@ int pqisrc_write_current_time_to_host_wellness(pqisrc_ host_wellness_time->dont_write_tag[1] = 'W'; host_wellness_time->end_tag[0] = 'Z'; host_wellness_time->end_tag[1] = 'Z'; - + rval = pqisrc_build_send_raid_request(softs, &request, host_wellness_time,data_length, BMIC_WRITE_HOST_WELLNESS, 0, (uint8_t *)RAID_CTLR_LUNID, NULL); - + os_mem_free(softs, (char *)host_wellness_time, data_length); DBG_FUNC("OUT"); @@ -1645,7 +1636,6 @@ int pqisrc_scan_devices(pqisrc_softstate_t *softs) bmic_ident_physdev_t *bmic_phy_info = NULL; pqi_scsi_dev_t **new_device_list = NULL; pqi_scsi_dev_t *device = NULL; - DBG_FUNC("IN\n"); @@ -1657,7 +1647,7 @@ int pqisrc_scan_devices(pqisrc_softstate_t *softs) physical_cnt = BE_32(physical_dev_list->header.list_length) / sizeof(physical_dev_list->lun_entries[0]); - + logical_cnt = BE_32(logical_dev_list->header.list_length) / sizeof(logical_dev_list->lun_entries[0]); @@ -1695,7 +1685,6 @@ int pqisrc_scan_devices(pqisrc_softstate_t *softs) ndev_allocated = phy_log_dev_cnt; new_dev_cnt = 0; for (i = 0; i < phy_log_dev_cnt; i++) { - if (i < physical_cnt) { is_physical_device = true; lun_ext_entry = &physical_dev_list->lun_entries[i]; @@ -1803,7 +1792,7 @@ int pqisrc_scan_devices(pqisrc_softstate_t *softs) DBG_DISC("new_dev_cnt %d\n", new_dev_cnt); pqisrc_update_device_list(softs, new_device_list, new_dev_cnt); - + err_out: if (new_device_list) { for (i = 0; i < ndev_allocated; i++) { @@ -1824,7 +1813,7 @@ err_out: os_mem_free(softs, (char *)logical_dev_list, log_data_length); if (bmic_phy_info) os_mem_free(softs, (char *)bmic_phy_info, sizeof(*bmic_phy_info)); - + DBG_FUNC("OUT \n"); return ret; @@ -1839,7 +1828,7 @@ void pqisrc_cleanup_devices(pqisrc_softstate_t *softs) int i = 0,j = 0; pqi_scsi_dev_t *dvp = NULL; DBG_FUNC("IN\n"); - + for(i = 0; i < PQI_MAX_DEVICES; i++) { for(j = 0; j < PQI_MAX_MULTILUN; j++) { if (softs->device_list[i][j] == NULL) @@ -1850,4 +1839,3 @@ void pqisrc_cleanup_devices(pqisrc_softstate_t *softs) } DBG_FUNC("OUT\n"); } - Modified: head/sys/dev/smartpqi/smartpqi_event.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_event.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_event.c Tue Sep 1 21:53:21 2020 (r365154) @@ -35,15 +35,15 @@ int pqisrc_rescan_devices(pqisrc_softstate_t *softs) { int ret; - + DBG_FUNC("IN\n"); - + os_sema_lock(&softs->scan_lock); - + ret = pqisrc_scan_devices(softs); os_sema_unlock(&softs->scan_lock); - + DBG_FUNC("OUT\n"); return ret; @@ -62,7 +62,7 @@ static void pqisrc_acknowledge_event(pqisrc_softstate_t *softs, struct pqi_event *event) { - + pqi_event_acknowledge_request_t request; ib_queue_t *ib_q = &softs->op_raid_ib_q[0]; int tmo = PQISRC_EVENT_ACK_RESP_TIMEOUT; @@ -93,7 +93,7 @@ pqisrc_acknowledge_event(pqisrc_softstate_t *softs, DBG_ERR("wait for event acknowledge timed out\n"); DBG_ERR("tmo : %d\n",tmo); } - + DBG_FUNC(" OUT\n"); } @@ -109,7 +109,6 @@ pqisrc_ack_all_events(void *arg1) DBG_FUNC(" IN\n"); - pending_event = &softs->pending_events[0]; for (i=0; i < PQI_NUM_SUPPORTED_EVENTS; i++) { if (pending_event->pending == true) { @@ -118,13 +117,13 @@ pqisrc_ack_all_events(void *arg1) } pending_event++; } - + /* Rescan devices except for heartbeat event */ if ((pqisrc_rescan_devices(softs)) != PQI_STATUS_SUCCESS) { DBG_ERR(" Failed to Re-Scan devices\n "); } DBG_FUNC(" OUT\n"); - + } /* @@ -173,16 +172,16 @@ pqisrc_process_event_intr_src(pqisrc_softstate_t *soft ob_queue_t *event_q; struct pqi_event *pending_event; boolean_t need_delayed_work = false; - + DBG_FUNC(" IN\n"); - + OS_ATOMIC64_INC(softs, num_intrs); - + event_q = &softs->event_q; obq_ci = event_q->ci_local; obq_pi = *(event_q->pi_virt_addr); DBG_INFO("Initial Event_q ci : %d Event_q pi : %d\n", obq_ci, obq_pi); - + while(1) { int event_index; DBG_INFO("queue_id : %d ci : %d pi : %d\n",obq_id, obq_ci, obq_pi); @@ -223,7 +222,6 @@ pqisrc_process_event_intr_src(pqisrc_softstate_t *soft DBG_FUNC("OUT"); return PQI_STATUS_SUCCESS; - } @@ -236,7 +234,7 @@ int pqisrc_submit_management_req(pqisrc_softstate_t *s int ret = PQI_STATUS_SUCCESS; ib_queue_t *op_ib_q = &softs->op_raid_ib_q[0]; rcb_t *rcb = NULL; - + DBG_FUNC(" IN\n"); /* Get the tag */ @@ -267,7 +265,7 @@ int pqisrc_submit_management_req(pqisrc_softstate_t *s pqisrc_put_tag(&softs->taglist,request->request_id); DBG_FUNC("OUT\n"); return ret; - + err_cmd: os_reset_rcb(rcb); pqisrc_put_tag(&softs->taglist,request->request_id); @@ -285,9 +283,9 @@ pqi_event_configure(pqisrc_softstate_t *softs , dma_mem_t *buff) { int ret = PQI_STATUS_SUCCESS; - + DBG_FUNC(" IN\n"); - + request->header.comp_feature = 0x00; request->header.iu_length = sizeof(pqi_event_config_request_t) - PQI_REQUEST_HEADER_LENGTH; /* excluding IU header length */ @@ -304,7 +302,6 @@ pqi_event_configure(pqisrc_softstate_t *softs , ret = pqisrc_submit_management_req(softs,request); if(ret) goto err_out; - DBG_FUNC(" OUT\n"); return ret; @@ -328,14 +325,14 @@ int pqisrc_report_event_config(pqisrc_softstate_t *sof /*bytes to be allocaed for report event config data-in buffer */ uint32_t alloc_size = sizeof(pqi_event_config_t) ; memset(&request, 0 , sizeof(request)); - + DBG_FUNC(" IN\n"); - + memset(&buf_report_event, 0, sizeof(struct dma_mem)); buf_report_event.tag = "pqi_report_event_buf" ; buf_report_event.size = alloc_size; buf_report_event.align = PQISRC_DEFAULT_DMA_ALIGN; - + /* allocate memory */ ret = os_dma_mem_alloc(softs, &buf_report_event); if (ret) { @@ -346,13 +343,13 @@ int pqisrc_report_event_config(pqisrc_softstate_t *sof DBG_INFO("buf_report_event.virt_addr = %p \n",(void*)buf_report_event.virt_addr); request.header.iu_type = PQI_REQUEST_IU_REPORT_VENDOR_EVENT_CONFIG; - + /* Event configuration */ ret=pqi_event_configure(softs,&request,&buf_report_event); if(ret) goto free_mem; - + event_config_p = (pqi_event_config_t*)buf_report_event.virt_addr; softs->event_config.num_event_descriptors = MIN(event_config_p->num_event_descriptors, PQI_MAX_EVENT_DESCRIPTORS) ; @@ -415,7 +412,6 @@ int pqisrc_set_event_config(pqisrc_softstate_t *softs) event_config_p->num_event_descriptors = softs->event_config.num_event_descriptors; - for (i=0; i < softs->event_config.num_event_descriptors ; i++){ event_config_p->descriptors[i].event_type = softs->event_config.descriptors[i].event_type; @@ -424,7 +420,6 @@ int pqisrc_set_event_config(pqisrc_softstate_t *softs) else event_config_p->descriptors[i].oq_id = 0; /* Not supported this event. */ - } /* Event configuration */ ret = pqi_event_configure(softs,&request,&buf_set_event); @@ -435,7 +430,7 @@ int pqisrc_set_event_config(pqisrc_softstate_t *softs) DBG_FUNC(" OUT\n"); return ret; - + free_mem: os_dma_mem_free(softs, &buf_set_event); err_out: Modified: head/sys/dev/smartpqi/smartpqi_helper.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_helper.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_helper.c Tue Sep 1 21:53:21 2020 (r365154) @@ -47,18 +47,18 @@ void pqisrc_configure_legacy_intx(pqisrc_softstate_t * { uint32_t intx_mask; uint32_t *reg_addr = NULL; - + DBG_FUNC("IN\n"); - + if (enable_intx) reg_addr = &softs->pqi_reg->legacy_intr_mask_clr; else reg_addr = &softs->pqi_reg->legacy_intr_mask_set; - + intx_mask = PCI_MEM_GET32(softs, reg_addr, PQI_LEGACY_INTR_MASK_CLR); intx_mask |= PQISRC_LEGACY_INTX_MASK; PCI_MEM_PUT32(softs, reg_addr, PQI_LEGACY_INTR_MASK_CLR ,intx_mask); - + DBG_FUNC("OUT\n"); } @@ -150,12 +150,11 @@ take_ctrl_offline: * Conditional variable management routine for internal commands. */ int pqisrc_wait_on_condition(pqisrc_softstate_t *softs, rcb_t *rcb){ - DBG_FUNC("IN\n"); int ret = PQI_STATUS_SUCCESS; uint32_t loop_cnt = 0; - + while (rcb->req_pending == true) { OS_SLEEP(500); /* Micro sec */ @@ -170,13 +169,12 @@ int pqisrc_wait_on_condition(pqisrc_softstate_t *softs ret = PQI_STATUS_TIMEOUT; break; } - + if (pqisrc_ctrl_offline(softs)) { DBG_ERR("Controller is Offline"); ret = PQI_STATUS_FAILURE; break; } - } rcb->req_pending = true; Modified: head/sys/dev/smartpqi/smartpqi_includes.h ============================================================================== --- head/sys/dev/smartpqi/smartpqi_includes.h Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_includes.h Tue Sep 1 21:53:21 2020 (r365154) @@ -78,12 +78,9 @@ #include #include - - #include "smartpqi_defines.h" #include "smartpqi_structures.h" #include "smartpqi_prototypes.h" #include "smartpqi_ioctl.h" - #endif // _PQI_INCLUDES_H Modified: head/sys/dev/smartpqi/smartpqi_init.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_init.c Tue Sep 1 21:53:00 2020 (r365153) +++ head/sys/dev/smartpqi/smartpqi_init.c Tue Sep 1 21:53:21 2020 (r365154) @@ -34,7 +34,7 @@ static int pqisrc_report_pqi_capability(pqisrc_softstate_t *softs) { int ret = PQI_STATUS_SUCCESS; - + DBG_FUNC("IN\n"); gen_adm_req_iu_t admin_req; @@ -64,7 +64,7 @@ static int pqisrc_report_pqi_capability(pqisrc_softsta DBG_ERR("Failed to allocate capability DMA buffer : %d\n", ret); goto err_dma_alloc; } - + admin_req.fn_code = PQI_FUNCTION_REPORT_DEV_CAP; admin_req.req_type.general_func.buf_size = pqi_cap_dma_buf.size; admin_req.req_type.general_func.sg_desc.length = pqi_cap_dma_buf.size; @@ -107,7 +107,6 @@ static int pqisrc_report_pqi_capability(pqisrc_softsta DBG_INIT("softs->max_ib_iu_length_per_fw: %d\n", softs->max_ib_iu_length_per_fw); DBG_INIT("softs->ib_spanning_supported: %d\n", softs->ib_spanning_supported); DBG_INIT("softs->ob_spanning_supported: %d\n", softs->ob_spanning_supported); - os_mem_free(softs, (void *)capability, REPORT_PQI_DEV_CAP_DATA_BUF_SIZE); @@ -132,7 +131,7 @@ err_out: */ void pqisrc_free_rcb(pqisrc_softstate_t *softs, int req_count) { - + uint32_t num_req; size_t size; int i; @@ -147,7 +146,6 @@ void pqisrc_free_rcb(pqisrc_softstate_t *softs, int re DBG_FUNC("OUT\n"); } - /* * Allocate memory for rcb and SG descriptors. */ @@ -181,7 +179,7 @@ static int pqisrc_allocate_rcb(pqisrc_softstate_t *sof goto err_out; } softs->rcb = rcb; - + /* Allocate sg dma memory for sg chain */ sg_buf_size = softs->pqi_cap.max_sg_elem * sizeof(sgt_t); @@ -227,7 +225,7 @@ void pqisrc_decide_opq_config(pqisrc_softstate_t *soft DBG_INIT("softs->intr_count : %d softs->num_cpus_online : %d", softs->intr_count, softs->num_cpus_online); - + if (softs->intr_count == 1 || softs->num_cpus_online == 1) { /* Share the event and Operational queue. */ softs->num_op_obq = 1; @@ -247,7 +245,7 @@ void pqisrc_decide_opq_config(pqisrc_softstate_t *soft */ if (softs->intr_count > 1) softs->share_opq_and_eventq = false; - + DBG_INIT("softs->num_op_obq : %d\n",softs->num_op_obq); softs->num_op_raid_ibq = softs->num_op_obq; @@ -270,11 +268,11 @@ void pqisrc_decide_opq_config(pqisrc_softstate_t *soft Max.Outstanding IO and Max.Spanning element */ total_iq_elements = (softs->max_outstanding_io * (softs->max_ib_iu_length / softs->ibq_elem_size)); - + softs->num_elem_per_op_ibq = total_iq_elements / softs->num_op_raid_ibq; softs->num_elem_per_op_ibq = MIN(softs->num_elem_per_op_ibq, softs->pqi_dev_cap.max_iq_elements); - + softs->num_elem_per_op_obq = softs->max_outstanding_io / softs->num_op_obq; softs->num_elem_per_op_obq = MIN(softs->num_elem_per_op_obq, softs->pqi_dev_cap.max_oq_elements); @@ -298,7 +296,7 @@ void pqisrc_decide_opq_config(pqisrc_softstate_t *soft int pqisrc_configure_op_queues(pqisrc_softstate_t *softs) { int ret = PQI_STATUS_SUCCESS; - + /* Get the PQI capability, REPORT PQI DEVICE CAPABILITY request */ ret = pqisrc_report_pqi_capability(softs); @@ -313,7 +311,7 @@ int pqisrc_configure_op_queues(pqisrc_softstate_t *sof /* Decide the Op queue configuration */ pqisrc_decide_opq_config(softs); - + DBG_FUNC("OUT\n"); return ret; @@ -364,7 +362,6 @@ int pqisrc_check_pqimode(pqisrc_softstate_t *softs) goto err_out; } - tmo = PQISRC_PQIMODE_READY_TIMEOUT; /* Check the PQI device status register */ COND_WAIT(LE_32(PCI_MEM_GET32(softs, &softs->pqi_reg->pqi_dev_status, PQI_DEV_STATUS)) & @@ -417,7 +414,6 @@ int pqisrc_process_config_table(pqisrc_softstate_t *so softs->pqi_cap.conf_tab_off, (uint8_t*)conf_table, config_table_size); - if (memcmp(conf_table->sign, PQI_CONF_TABLE_SIGNATURE, sizeof(conf_table->sign)) != 0) { DBG_ERR("Invalid PQI config signature\n"); @@ -427,7 +423,6 @@ int pqisrc_process_config_table(pqisrc_softstate_t *so section_off = LE_32(conf_table->first_section_off); while (section_off) { - if (section_off+ sizeof(*section_hdr) >= config_table_size) { DBG_ERR("PQI config table section offset (%u) beyond \ end of config table (config table length: %u)\n", @@ -505,7 +500,7 @@ int pqi_reset(pqisrc_softstate_t *softs) DBG_FUNC("IN\n"); if (true == softs->ctrl_in_pqi_mode) { - + if (softs->pqi_reset_quiesce_allowed) { val = PCI_MEM_GET32(softs, &softs->ioa_reg->host_to_ioa_db, LEGACY_SIS_IDBR); @@ -555,7 +550,7 @@ int pqisrc_pqi_init(pqisrc_softstate_t *softs) PQI_SAVE_CTRL_MODE(softs, CTRL_PQI_MODE); softs->ctrl_in_pqi_mode = true; - + /* Get the No. of Online CPUs,NUMA/Processor config from OS */ ret = os_get_processor_config(softs); if (ret) { @@ -563,7 +558,7 @@ int pqisrc_pqi_init(pqisrc_softstate_t *softs) ret); goto err_out; } - + softs->intr_type = INTR_TYPE_NONE; /* Get the interrupt count, type, priority available from OS */ @@ -682,7 +677,7 @@ int pqisrc_wait_for_cmnd_complete(pqisrc_softstate_t * { int ret = PQI_STATUS_SUCCESS; int tmo = PQI_CMND_COMPLETE_TMO; - + COND_WAIT((softs->taglist.num_elem == softs->max_outstanding_io), tmo); if (!tmo) { DBG_ERR("Pending commands %x!!!",softs->taglist.num_elem); @@ -695,7 +690,7 @@ void pqisrc_complete_internal_cmds(pqisrc_softstate_t { int tag = 0; rcb_t *rcb; - + for (tag = 1; tag <= softs->max_outstanding_io; tag++) { rcb = &softs->rcb[tag]; if(rcb->req_pending && is_internal_req(rcb)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***