Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mrsas/mrsas.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
static int mrsas_get_ld_map_info(struct mrsas_softc *sc); | static int mrsas_get_ld_map_info(struct mrsas_softc *sc); | ||||
static int mrsas_sync_map_info(struct mrsas_softc *sc); | static int mrsas_sync_map_info(struct mrsas_softc *sc); | ||||
static int mrsas_get_pd_list(struct mrsas_softc *sc); | static int mrsas_get_pd_list(struct mrsas_softc *sc); | ||||
static int mrsas_get_ld_list(struct mrsas_softc *sc); | static int mrsas_get_ld_list(struct mrsas_softc *sc); | ||||
static int mrsas_setup_irq(struct mrsas_softc *sc); | static int mrsas_setup_irq(struct mrsas_softc *sc); | ||||
static int mrsas_alloc_mem(struct mrsas_softc *sc); | static int mrsas_alloc_mem(struct mrsas_softc *sc); | ||||
static int mrsas_init_fw(struct mrsas_softc *sc); | static int mrsas_init_fw(struct mrsas_softc *sc); | ||||
static int mrsas_setup_raidmap(struct mrsas_softc *sc); | static int mrsas_setup_raidmap(struct mrsas_softc *sc); | ||||
static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); | int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); | ||||
static int mrsas_clear_intr(struct mrsas_softc *sc); | static int mrsas_clear_intr(struct mrsas_softc *sc); | ||||
static int mrsas_get_ctrl_info(struct mrsas_softc *sc); | static int mrsas_get_ctrl_info(struct mrsas_softc *sc); | ||||
static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); | static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); | ||||
static int | static int | ||||
mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, | mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, | ||||
struct mrsas_mfi_cmd *cmd_to_abort); | struct mrsas_mfi_cmd *cmd_to_abort); | ||||
static struct mrsas_softc * | static struct mrsas_softc * | ||||
mrsas_get_softc_instance(struct cdev *dev, | mrsas_get_softc_instance(struct cdev *dev, | ||||
▲ Show 20 Lines • Show All 1,387 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* This function is called from mrsas_isr() to process reply request and clear | * This function is called from mrsas_isr() to process reply request and clear | ||||
* response interrupt. Processing of the reply request entails walking | * response interrupt. Processing of the reply request entails walking | ||||
* through the reply descriptor array for the command request pended from | * through the reply descriptor array for the command request pended from | ||||
* Firmware. We look at the Function field to determine the command type and | * Firmware. We look at the Function field to determine the command type and | ||||
* perform the appropriate action. Before we return, we clear the response | * perform the appropriate action. Before we return, we clear the response | ||||
* interrupt. | * interrupt. | ||||
*/ | */ | ||||
static int | int | ||||
mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) | mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) | ||||
{ | { | ||||
Mpi2ReplyDescriptorsUnion_t *desc; | Mpi2ReplyDescriptorsUnion_t *desc; | ||||
MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR *reply_desc; | MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR *reply_desc; | ||||
MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; | MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; | ||||
struct mrsas_mpt_cmd *cmd_mpt; | struct mrsas_mpt_cmd *cmd_mpt; | ||||
struct mrsas_mfi_cmd *cmd_mfi; | struct mrsas_mfi_cmd *cmd_mfi; | ||||
u_int8_t reply_descript_type; | u_int8_t reply_descript_type; | ||||
▲ Show 20 Lines • Show All 1,843 Lines • ▼ Show 20 Lines | mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) | ||||
if (mrsas_issue_dcmd(sc, cmd)) { | if (mrsas_issue_dcmd(sc, cmd)) { | ||||
device_printf(sc->mrsas_dev, "Cannot issue DCMD internal command.\n"); | device_printf(sc->mrsas_dev, "Cannot issue DCMD internal command.\n"); | ||||
return (1); | return (1); | ||||
} | } | ||||
sc->chan = (void *)&cmd; | sc->chan = (void *)&cmd; | ||||
while (1) { | while (1) { | ||||
if (cmd->cmd_status == ECONNREFUSED) { | if (cmd->cmd_status == ECONNREFUSED) { | ||||
tsleep((void *)&sc->chan, 0, "mrsas_sleep", hz); | /* DJA XXXX tsleep((void *)&sc->chan, 0, "mrsas_sleep", hz); */ | ||||
DELAY(1000); | |||||
} else | } else | ||||
break; | break; | ||||
total_time++; | total_time++; | ||||
if (total_time >= max_wait) { | if (total_time >= max_wait) { | ||||
device_printf(sc->mrsas_dev, | device_printf(sc->mrsas_dev, | ||||
"Internal command timed out after %d seconds.\n", max_wait); | "Internal command timed out after %d seconds.\n", max_wait); | ||||
retcode = 1; | retcode = 1; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 794 Lines • Show Last 20 Lines |