Lines Matching refs:base_cmds
678 if (ioc->base_cmds.status == MPT2_CMD_NOT_USED) in mpt2sas_base_done()
681 ioc->base_cmds.status |= MPT2_CMD_COMPLETE; in mpt2sas_base_done()
683 ioc->base_cmds.status |= MPT2_CMD_REPLY_VALID; in mpt2sas_base_done()
684 memcpy(ioc->base_cmds.reply, mpi_reply, mpi_reply->MsgLength*4); in mpt2sas_base_done()
686 ioc->base_cmds.status &= ~MPT2_CMD_PENDING; in mpt2sas_base_done()
687 complete(&ioc->base_cmds.done); in mpt2sas_base_done()
2902 mutex_lock(&ioc->base_cmds.mutex); in mpt2sas_base_sas_iounit_control()
2904 if (ioc->base_cmds.status != MPT2_CMD_NOT_USED) { in mpt2sas_base_sas_iounit_control()
2937 ioc->base_cmds.status = MPT2_CMD_PENDING; in mpt2sas_base_sas_iounit_control()
2939 ioc->base_cmds.smid = smid; in mpt2sas_base_sas_iounit_control()
2945 init_completion(&ioc->base_cmds.done); in mpt2sas_base_sas_iounit_control()
2946 timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, in mpt2sas_base_sas_iounit_control()
2952 if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { in mpt2sas_base_sas_iounit_control()
2957 if (!(ioc->base_cmds.status & MPT2_CMD_RESET)) in mpt2sas_base_sas_iounit_control()
2961 if (ioc->base_cmds.status & MPT2_CMD_REPLY_VALID) in mpt2sas_base_sas_iounit_control()
2962 memcpy(mpi_reply, ioc->base_cmds.reply, in mpt2sas_base_sas_iounit_control()
2966 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in mpt2sas_base_sas_iounit_control()
2973 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in mpt2sas_base_sas_iounit_control()
2976 mutex_unlock(&ioc->base_cmds.mutex); in mpt2sas_base_sas_iounit_control()
3007 mutex_lock(&ioc->base_cmds.mutex); in mpt2sas_base_scsi_enclosure_processor()
3009 if (ioc->base_cmds.status != MPT2_CMD_NOT_USED) { in mpt2sas_base_scsi_enclosure_processor()
3042 ioc->base_cmds.status = MPT2_CMD_PENDING; in mpt2sas_base_scsi_enclosure_processor()
3044 ioc->base_cmds.smid = smid; in mpt2sas_base_scsi_enclosure_processor()
3047 init_completion(&ioc->base_cmds.done); in mpt2sas_base_scsi_enclosure_processor()
3048 timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, in mpt2sas_base_scsi_enclosure_processor()
3050 if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { in mpt2sas_base_scsi_enclosure_processor()
3055 if (!(ioc->base_cmds.status & MPT2_CMD_RESET)) in mpt2sas_base_scsi_enclosure_processor()
3059 if (ioc->base_cmds.status & MPT2_CMD_REPLY_VALID) in mpt2sas_base_scsi_enclosure_processor()
3060 memcpy(mpi_reply, ioc->base_cmds.reply, in mpt2sas_base_scsi_enclosure_processor()
3064 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in mpt2sas_base_scsi_enclosure_processor()
3071 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in mpt2sas_base_scsi_enclosure_processor()
3074 mutex_unlock(&ioc->base_cmds.mutex); in mpt2sas_base_scsi_enclosure_processor()
3312 if (ioc->base_cmds.status & MPT2_CMD_PENDING) { in _base_send_port_enable()
3325 ioc->base_cmds.status = MPT2_CMD_PENDING; in _base_send_port_enable()
3327 ioc->base_cmds.smid = smid; in _base_send_port_enable()
3334 init_completion(&ioc->base_cmds.done); in _base_send_port_enable()
3335 timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, in _base_send_port_enable()
3337 if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { in _base_send_port_enable()
3342 if (ioc->base_cmds.status & MPT2_CMD_RESET) in _base_send_port_enable()
3359 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in _base_send_port_enable()
3411 if (ioc->base_cmds.status & MPT2_CMD_PENDING) { in _base_event_notification()
3423 ioc->base_cmds.status = MPT2_CMD_PENDING; in _base_event_notification()
3425 ioc->base_cmds.smid = smid; in _base_event_notification()
3434 init_completion(&ioc->base_cmds.done); in _base_event_notification()
3435 timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ); in _base_event_notification()
3436 if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { in _base_event_notification()
3441 if (ioc->base_cmds.status & MPT2_CMD_RESET) in _base_event_notification()
3448 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in _base_event_notification()
3484 mutex_lock(&ioc->base_cmds.mutex); in mpt2sas_base_validate_event_type()
3486 mutex_unlock(&ioc->base_cmds.mutex); in mpt2sas_base_validate_event_type()
3876 mutex_init(&ioc->base_cmds.mutex); in mpt2sas_base_attach()
3877 ioc->base_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); in mpt2sas_base_attach()
3878 ioc->base_cmds.status = MPT2_CMD_NOT_USED; in mpt2sas_base_attach()
3906 if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply || in mpt2sas_base_attach()
3914 if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply || in mpt2sas_base_attach()
3959 kfree(ioc->base_cmds.reply); in mpt2sas_base_attach()
3964 ioc->base_cmds.reply = NULL; in mpt2sas_base_attach()
3995 kfree(ioc->base_cmds.reply); in mpt2sas_base_detach()
4032 if (ioc->base_cmds.status & MPT2_CMD_PENDING) { in _base_reset_handler()
4033 ioc->base_cmds.status |= MPT2_CMD_RESET; in _base_reset_handler()
4034 mpt2sas_base_free_smid(ioc, ioc->base_cmds.smid); in _base_reset_handler()
4035 complete(&ioc->base_cmds.done); in _base_reset_handler()