Lines Matching defs:ioreq
76 * csio_scsi_match_io - Match an ioreq with the given SCSI level data.
77 * @ioreq: The I/O request
84 csio_scsi_match_io(struct csio_ioreq *ioreq, struct csio_scsi_level_data *sld)
86 struct scsi_cmnd *scmnd = csio_scsi_cmnd(ioreq);
93 return ((ioreq->lnode == sld->lnode) &&
94 (ioreq->rnode == sld->rnode) &&
98 return ((ioreq->lnode == sld->lnode) &&
99 (ioreq->rnode == sld->rnode));
101 return (ioreq->lnode == sld->lnode);
669 /* Since we re-use the same ioreq for abort as well */
896 "ioreq %p recvd cmpltd (wr_status:%d) "
972 * and left this ioreq in this state. For now, just ignore
993 "ioreq %p recvd cmpltd (wr_status:%d) "
1094 * It then gets the status, WR handle (ioreq pointer) and the len of
1096 * WR copied into the WR cache (ioreq->fw_wr).
1097 * The ioreq corresponding to the WR is returned to the caller.
1105 struct csio_ioreq *ioreq = NULL;
1128 ioreq = (struct csio_ioreq *)((uintptr_t)
1130 CSIO_DB_ASSERT(virt_addr_valid(ioreq));
1132 ioreq->wr_status = status;
1134 return ioreq;
1138 ioreq = (struct csio_ioreq *)((uintptr_t)
1140 CSIO_DB_ASSERT(virt_addr_valid(ioreq));
1142 ioreq->wr_status = status;
1143 return ioreq;
1162 struct csio_ioreq *ioreq;
1168 ioreq = (struct csio_ioreq *)tmp;
1169 csio_scsi_drvcleanup(ioreq);
1170 list_del_init(&ioreq->sm.sm_list);
1171 scmnd = csio_scsi_cmnd(ioreq);
1179 ioreq->io_cbfn(hw, ioreq);
1182 csio_put_scsi_ioreq(scm, ioreq);
1192 csio_abrt_cls(struct csio_ioreq *ioreq, struct scsi_cmnd *scmnd)
1194 struct csio_lnode *ln = ioreq->lnode;
1200 if (csio_scsi_cmnd(ioreq) != scmnd) {
1207 rv = csio_do_abrt_cls(hw, ioreq, (ready ? SCSI_ABORT : SCSI_CLOSE));
1530 csio_err(hw, "failed to kmap sg:%p of ioreq:%p\n",
1767 * - Gets a free ioreq structure (which is already initialized
1770 * - Initializes ioreq members.
1781 struct csio_ioreq *ioreq = NULL;
1820 /* Get a free ioreq structure - SM is already set to uninit */
1821 ioreq = csio_get_scsi_ioreq_lock(hw, scsim);
1822 if (!ioreq) {
1829 ioreq->nsge = nsge;
1830 ioreq->lnode = ln;
1831 ioreq->rnode = rn;
1832 ioreq->iq_idx = sqset->iq_idx;
1833 ioreq->eq_idx = sqset->eq_idx;
1834 ioreq->wr_status = 0;
1835 ioreq->drv_status = 0;
1836 csio_scsi_cmnd(ioreq) = (void *)cmnd;
1837 ioreq->tmo = 0;
1838 ioreq->datadir = cmnd->sc_data_direction;
1850 ioreq->io_cbfn = csio_scsi_cbfn;
1853 cmnd->host_scribble = (unsigned char *)ioreq;
1856 /* Kick off SCSI IO SM on the ioreq */
1858 retval = csio_scsi_start_io(ioreq);
1862 csio_err(hw, "ioreq: %p couldn't be started, status:%d\n",
1863 ioreq, retval);
1871 csio_put_scsi_ioreq_lock(hw, scsim, ioreq);
1884 csio_do_abrt_cls(struct csio_hw *hw, struct csio_ioreq *ioreq, bool abort)
1888 struct csio_lnode *ln = ioreq->lnode;
1891 ioreq->tmo = CSIO_SCSI_ABRT_TMO_MS;
1898 ioreq->eq_idx = sqset->eq_idx;
1901 rv = csio_scsi_abort(ioreq);
1903 rv = csio_scsi_close(ioreq);
1911 struct csio_ioreq *ioreq;
1924 ioreq = (struct csio_ioreq *)cmnd->host_scribble;
1925 if (!ioreq)
1932 "Request to abort ioreq:%p cmd:%p cdb:%08llx"
1934 ioreq, cmnd, *((uint64_t *)cmnd->cmnd), rn->flowid,
1935 cmnd->device->lun, csio_q_physiqid(hw, ioreq->iq_idx));
1937 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) != cmnd) {
1945 reinit_completion(&ioreq->cmplobj);
1947 rv = csio_do_abrt_cls(hw, ioreq, (ready ? SCSI_ABORT : SCSI_CLOSE));
1965 wait_for_completion_timeout(&ioreq->cmplobj, msecs_to_jiffies(tmo));
1968 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) {
1970 csio_err(hw, "Abort timed out -- req: %p\n", ioreq);
1974 if (ioreq->nsge > 0)
1978 csio_scsi_cmnd(ioreq) = NULL;
2008 * Cache the result in 'cmnd', since ioreq will be freed soon
2010 * the ioreq contents.
2064 struct csio_ioreq *ioreq = NULL;
2106 /* Get a free ioreq structure - SM is already set to uninit */
2107 ioreq = csio_get_scsi_ioreq_lock(hw, scsim);
2109 if (!ioreq) {
2116 ioreq->nsge = 0;
2117 ioreq->lnode = ln;
2118 ioreq->rnode = rn;
2119 ioreq->iq_idx = sqset->iq_idx;
2120 ioreq->eq_idx = sqset->eq_idx;
2122 csio_scsi_cmnd(ioreq) = cmnd;
2123 cmnd->host_scribble = (unsigned char *)ioreq;
2127 ioreq->tmo = CSIO_SCSI_LUNRST_TMO_MS / 1000;
2130 * FW times the LUN reset for ioreq->tmo, so we got to wait a little
2134 count = DIV_ROUND_UP((ioreq->tmo + 10) * 1000, CSIO_SCSI_TM_POLL_MS);
2137 ioreq->io_cbfn = csio_tm_cbfn;
2139 /* Save of the ioreq info for later use */
2141 sld.lnode = ioreq->lnode;
2142 sld.rnode = ioreq->rnode;
2146 /* Kick off TM SM on the ioreq */
2147 retval = csio_scsi_start_tm(ioreq);
2152 ioreq, retval);
2159 while ((((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd)
2164 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) {
2169 csio_scsi_drvcleanup(ioreq);
2170 list_del_init(&ioreq->sm.sm_list);
2215 csio_put_scsi_ioreq_lock(hw, scsim, ioreq);
2415 struct csio_ioreq *ioreq;
2431 ioreq = kzalloc(sizeof(struct csio_ioreq), GFP_KERNEL);
2432 if (!ioreq) {
2442 dma_buf = &ioreq->dma_buf;
2449 kfree(ioreq);
2456 csio_init_state(&ioreq->sm, csio_scsis_uninit);
2457 INIT_LIST_HEAD(&ioreq->gen_list);
2458 init_completion(&ioreq->cmplobj);
2460 list_add_tail(&ioreq->sm.sm_list, &scm->ioreq_freelist);
2480 ioreq = (struct csio_ioreq *)tmp;
2482 dma_buf = &ioreq->dma_buf;
2486 kfree(ioreq);
2502 struct csio_ioreq *ioreq;
2511 ioreq = (struct csio_ioreq *)tmp;
2513 dma_buf = &ioreq->dma_buf;
2517 kfree(ioreq);