Lines Matching refs:srb
4001 static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha, in qla4xxx_get_new_srb()
4005 struct srb *srb; in qla4xxx_get_new_srb() local
4007 srb = mempool_alloc(ha->srb_mempool, GFP_ATOMIC); in qla4xxx_get_new_srb()
4008 if (!srb) in qla4xxx_get_new_srb()
4009 return srb; in qla4xxx_get_new_srb()
4011 kref_init(&srb->srb_ref); in qla4xxx_get_new_srb()
4012 srb->ha = ha; in qla4xxx_get_new_srb()
4013 srb->ddb = ddb_entry; in qla4xxx_get_new_srb()
4014 srb->cmd = cmd; in qla4xxx_get_new_srb()
4015 srb->flags = 0; in qla4xxx_get_new_srb()
4016 CMD_SP(cmd) = (void *)srb; in qla4xxx_get_new_srb()
4018 return srb; in qla4xxx_get_new_srb()
4021 static void qla4xxx_srb_free_dma(struct scsi_qla_host *ha, struct srb *srb) in qla4xxx_srb_free_dma() argument
4023 struct scsi_cmnd *cmd = srb->cmd; in qla4xxx_srb_free_dma()
4025 if (srb->flags & SRB_DMA_VALID) { in qla4xxx_srb_free_dma()
4027 srb->flags &= ~SRB_DMA_VALID; in qla4xxx_srb_free_dma()
4034 struct srb *srb = container_of(ref, struct srb, srb_ref); in qla4xxx_srb_compl() local
4035 struct scsi_cmnd *cmd = srb->cmd; in qla4xxx_srb_compl()
4036 struct scsi_qla_host *ha = srb->ha; in qla4xxx_srb_compl()
4038 qla4xxx_srb_free_dma(ha, srb); in qla4xxx_srb_compl()
4040 mempool_free(srb, ha->srb_mempool); in qla4xxx_srb_compl()
4063 struct srb *srb; in qla4xxx_queuecommand() local
4098 srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd); in qla4xxx_queuecommand()
4099 if (!srb) in qla4xxx_queuecommand()
4102 rval = qla4xxx_send_command_to_isp(ha, srb); in qla4xxx_queuecommand()
4109 qla4xxx_srb_free_dma(ha, srb); in qla4xxx_queuecommand()
4110 mempool_free(srb, ha->srb_mempool); in qla4xxx_queuecommand()
4764 struct srb *srb; in qla4xxx_abort_active_cmds() local
4770 srb = qla4xxx_del_from_active_array(ha, i); in qla4xxx_abort_active_cmds()
4771 if (srb != NULL) { in qla4xxx_abort_active_cmds()
4772 srb->cmd->result = res; in qla4xxx_abort_active_cmds()
4773 kref_put(&srb->srb_ref, qla4xxx_srb_compl); in qla4xxx_abort_active_cmds()
9065 struct srb *qla4xxx_del_from_active_array(struct scsi_qla_host *ha, in qla4xxx_del_from_active_array()
9068 struct srb *srb = NULL; in qla4xxx_del_from_active_array() local
9073 return srb; in qla4xxx_del_from_active_array()
9075 srb = (struct srb *)CMD_SP(cmd); in qla4xxx_del_from_active_array()
9076 if (!srb) in qla4xxx_del_from_active_array()
9077 return srb; in qla4xxx_del_from_active_array()
9080 if (srb->flags & SRB_DMA_VALID) { in qla4xxx_del_from_active_array()
9081 ha->iocb_cnt -= srb->iocb_cnt; in qla4xxx_del_from_active_array()
9082 if (srb->cmd) in qla4xxx_del_from_active_array()
9083 srb->cmd->host_scribble = in qla4xxx_del_from_active_array()
9086 return srb; in qla4xxx_del_from_active_array()
9101 struct srb *rp; in qla4xxx_eh_wait_on_command()
9117 rp = (struct srb *) CMD_SP(cmd); in qla4xxx_eh_wait_on_command()
9196 struct srb *srb = NULL; in qla4xxx_eh_abort() local
9204 srb = (struct srb *) CMD_SP(cmd); in qla4xxx_eh_abort()
9205 if (!srb) { in qla4xxx_eh_abort()
9211 kref_get(&srb->srb_ref); in qla4xxx_eh_abort()
9214 if (qla4xxx_abort_task(ha, srb) != QLA_SUCCESS) { in qla4xxx_eh_abort()
9224 kref_put(&srb->srb_ref, qla4xxx_srb_compl); in qla4xxx_eh_abort()
9861 srb_cachep = kmem_cache_create("qla4xxx_srbs", sizeof(struct srb), 0, in qla4xxx_module_init()