Date: Fri, 4 May 2012 16:22:13 +0000 (UTC) From: Doug Ambrisko <ambrisko@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r235016 - head/sys/dev/mfi Message-ID: <201205041622.q44GMDAa012350@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ambrisko Date: Fri May 4 16:22:13 2012 New Revision: 235016 URL: http://svn.freebsd.org/changeset/base/235016 Log: Some style improvements. Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_tbolt.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri May 4 16:18:57 2012 (r235015) +++ head/sys/dev/mfi/mfi.c Fri May 4 16:22:13 2012 (r235016) @@ -1319,7 +1319,7 @@ mfi_syspdprobe(struct mfi_softc *sc) /* Add SYSTEM PD's */ error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_LIST_QUERY, (void **)&pdlist, sizeof(*pdlist)); - if (error){ + if (error) { device_printf(sc->mfi_dev, "Error while forming SYSTEM PD list\n"); goto out; @@ -1958,6 +1958,7 @@ mfi_add_sys_pd_complete(struct mfi_comma mtx_unlock(&Giant); mtx_lock(&sc->mfi_io_lock); } + static struct mfi_command * mfi_bio_command(struct mfi_softc *sc) { @@ -1965,7 +1966,7 @@ mfi_bio_command(struct mfi_softc *sc) struct mfi_command *cm = NULL; /*reserving two commands to avoid starvation for IOCTL*/ - if (sc->mfi_qstat[MFIQ_FREE].q_length < 2){ + if (sc->mfi_qstat[MFIQ_FREE].q_length < 2) { return (NULL); } if ((bio = mfi_dequeue_bio(sc)) == NULL) { @@ -2694,12 +2695,12 @@ static int mfi_check_for_sscd(struct mfi int error = 0; if ((cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) && - (conf_data->ld[0].params.isSSCD == 1)){ + (conf_data->ld[0].params.isSSCD == 1)) { error = 1; } else if (cm->cm_frame->dcmd.opcode == MFI_DCMD_LD_DELETE) { error = mfi_dcmd_command (sc, &ld_cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); - if (error){ + if (error) { device_printf(sc->mfi_dev, "Failed to allocate" "MFI_DCMD_LD_GET_INFO %d", error); if (ld_info) @@ -2709,7 +2710,7 @@ static int mfi_check_for_sscd(struct mfi ld_cm->cm_flags = MFI_CMD_DATAIN; ld_cm->cm_frame->dcmd.mbox[0]= cm->cm_frame->dcmd.mbox[0]; ld_cm->cm_frame->header.target_id = cm->cm_frame->dcmd.mbox[0]; - if (mfi_wait_command(sc, ld_cm) != 0){ + if (mfi_wait_command(sc, ld_cm) != 0) { device_printf(sc->mfi_dev, "failed to get log drv\n"); mfi_release_command(ld_cm); free(ld_info, M_MFIBUF); Modified: head/sys/dev/mfi/mfi_disk.c ============================================================================== --- head/sys/dev/mfi/mfi_disk.c Fri May 4 16:18:57 2012 (r235015) +++ head/sys/dev/mfi/mfi_disk.c Fri May 4 16:22:13 2012 (r235016) @@ -256,17 +256,17 @@ mfi_disk_strategy(struct bio *bio) return; } - if (controller->adpreset){ + if (controller->adpreset) { bio->bio_error = EBUSY; return; } - if (controller->hw_crit_error){ + if (controller->hw_crit_error) { bio->bio_error = EBUSY; return; } - if (controller->issuepend_done == 0){ + if (controller->issuepend_done == 0) { bio->bio_error = EBUSY; return; } Modified: head/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- head/sys/dev/mfi/mfi_tbolt.c Fri May 4 16:18:57 2012 (r235015) +++ head/sys/dev/mfi/mfi_tbolt.c Fri May 4 16:22:13 2012 (r235016) @@ -141,11 +141,12 @@ mfi_tbolt_issue_cmd_ppc(struct mfi_softc MFI_WRITE4(sc, MFI_IQPH, (uint32_t)((uint64_t)bus_add >> 32)); } -/** +/* * mfi_tbolt_adp_reset - For controller reset * @regs: MFI register set */ -int mfi_tbolt_adp_reset(struct mfi_softc *sc) +int +mfi_tbolt_adp_reset(struct mfi_softc *sc) { int retry = 0, i = 0; int HostDiag; @@ -193,12 +194,10 @@ int mfi_tbolt_adp_reset(struct mfi_softc } /* - ******************************************************************************************* - * Description: - * This routine initialize Thunderbolt specific device information - ******************************************************************************************* + * This routine initialize Thunderbolt specific device information */ -void mfi_tbolt_init_globals(struct mfi_softc *sc) +void +mfi_tbolt_init_globals(struct mfi_softc *sc) { /* Initialize single reply size and Message size */ sc->reply_size = MEGASAS_THUNDERBOLT_REPLY_SIZE; @@ -240,16 +239,12 @@ void mfi_tbolt_init_globals(struct mfi_s } /* - **************************************************************************** - * Description: - * This function calculates the memory requirement for Thunderbolt - * controller - * Return Value: - * Total required memory in bytes - **************************************************************************** + * This function calculates the memory requirement for Thunderbolt + * controller, returns the total required memory in bytes */ -uint32_t mfi_tbolt_get_memory_requirement(struct mfi_softc *sc) +uint32_t +mfi_tbolt_get_memory_requirement(struct mfi_softc *sc) { uint32_t size; size = MEGASAS_THUNDERBOLT_MSG_ALLIGNMENT; /* for Alignment */ @@ -261,7 +256,6 @@ uint32_t mfi_tbolt_get_memory_requiremen } /* - **************************************************************************** * Description: * This function will prepare message pools for the Thunderbolt controller * Arguments: @@ -270,9 +264,9 @@ uint32_t mfi_tbolt_get_memory_requiremen * Return Value: * TRUE if successful * FALSE if failed - **************************************************************************** */ -int mfi_tbolt_init_desc_pool(struct mfi_softc *sc, uint8_t* mem_location, +int +mfi_tbolt_init_desc_pool(struct mfi_softc *sc, uint8_t* mem_location, uint32_t tbolt_contg_length) { uint32_t offset = 0; @@ -329,10 +323,7 @@ int mfi_tbolt_init_desc_pool(struct mfi_ } /* - **************************************************************************** - * Description: - * This routine prepare and issue INIT2 frame to the Firmware - **************************************************************************** + * This routine prepare and issue INIT2 frame to the Firmware */ int @@ -443,7 +434,8 @@ mfi_tbolt_init_MFI_queue(struct mfi_soft } -int mfi_tbolt_alloc_cmd(struct mfi_softc *sc) +int +mfi_tbolt_alloc_cmd(struct mfi_softc *sc) { struct mfi_cmd_tbolt *cmd; bus_addr_t io_req_base_phys; @@ -516,7 +508,8 @@ int mfi_tbolt_alloc_cmd(struct mfi_softc return 0; } -int mfi_tbolt_reset(struct mfi_softc *sc) +int +mfi_tbolt_reset(struct mfi_softc *sc) { uint32_t fw_state; @@ -551,7 +544,8 @@ int mfi_tbolt_reset(struct mfi_softc *sc /* * mfi_intr_tbolt - isr entry point */ -void mfi_intr_tbolt(void *arg) +void +mfi_intr_tbolt(void *arg) { struct mfi_softc *sc = (struct mfi_softc *)arg; @@ -569,7 +563,7 @@ void mfi_intr_tbolt(void *arg) return; } -/** +/* * map_cmd_status - Maps FW cmd status to OS cmd status * @cmd : Pointer to cmd * @status : status of cmd returned by FW @@ -582,7 +576,6 @@ map_tbolt_cmd_status(struct mfi_command { switch (status) { - case MFI_STAT_OK: mfi_cmd->cm_frame->header.cmd_status = 0; mfi_cmd->cm_frame->dcmd.header.cmd_status = 0; @@ -615,7 +608,7 @@ map_tbolt_cmd_status(struct mfi_command } } -/** +/* * mfi_tbolt_return_cmd - Return a cmd to free command pool * @instance: Adapter soft state * @cmd: Command packet to be returned to free command pool @@ -718,15 +711,15 @@ mfi_tbolt_complete_cmd(struct mfi_softc return; } -/** +/* * mfi_get_cmd - Get a command from the free pool * @instance: Adapter soft state * * Returns a free command from the pool */ -struct mfi_cmd_tbolt *mfi_tbolt_get_cmd(struct mfi_softc - *sc) +struct mfi_cmd_tbolt * +mfi_tbolt_get_cmd(struct mfi_softc *sc) { struct mfi_cmd_tbolt *cmd = NULL; @@ -831,7 +824,8 @@ mfi_tbolt_build_ldio(struct mfi_softc *s * MFI_SECTOR_LEN; } -int mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd) +int +mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd) { if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) @@ -841,7 +835,8 @@ int mfi_tbolt_is_ldio(struct mfi_command } int -mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd) +mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, + struct mfi_cmd_tbolt *cmd) { uint32_t device_id; uint32_t sge_count; @@ -930,8 +925,7 @@ mfi_tbolt_build_cdb(struct mfi_softc *sc cdb[3] = (uint8_t) (lba_lo >> 16); cdb[2] = (uint8_t) (lba_lo >> 24); cdb_len = 10; - } - else if ((num_lba > 0xFFFF) && (lba_hi == 0)) { + } else if ((num_lba > 0xFFFF) && (lba_hi == 0)) { if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) /* Read 12 or Write 12 */ cdb[0] = (uint8_t) (0xAA); @@ -1150,7 +1144,7 @@ mfi_tbolt_send_frame(struct mfi_softc *s if (tm <= 0) break; } - + if (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { device_printf(sc->mfi_dev, "Frame %p timed out " "command 0x%X\n", hdr, cm->cm_frame->dcmd.opcode); @@ -1159,7 +1153,8 @@ mfi_tbolt_send_frame(struct mfi_softc *s return 0; } -static void mfi_issue_pending_cmds_again (struct mfi_softc *sc) +static void +mfi_issue_pending_cmds_again (struct mfi_softc *sc) { struct mfi_command *cm, *tmp; @@ -1204,7 +1199,8 @@ static void mfi_issue_pending_cmds_again mfi_startio(sc); } -static void mfi_kill_hba (struct mfi_softc *sc) +static void +mfi_kill_hba (struct mfi_softc *sc) { if (sc->mfi_flags & MFI_FLAGS_TBOLT) MFI_WRITE4 (sc, 0x00,MFI_STOP_ADP); @@ -1212,7 +1208,8 @@ static void mfi_kill_hba (struct mfi_sof MFI_WRITE4 (sc, MFI_IDB,MFI_STOP_ADP); } -static void mfi_process_fw_state_chg_isr(void *arg) +static void +mfi_process_fw_state_chg_isr(void *arg) { struct mfi_softc *sc= (struct mfi_softc *)arg; struct mfi_cmd_tbolt *cmd; @@ -1296,7 +1293,7 @@ static void mfi_process_fw_state_chg_isr /* * The ThunderBolt HW has an option for the driver to directly - * access the underlying disks and operate on the RAID. To + * access the underlying disks and operate on the RAID. To * do this there needs to be a capability to keep the RAID controller * and driver in sync. The FreeBSD driver does not take advantage * of this feature since it adds a lot of complexity and slows down
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205041622.q44GMDAa012350>