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));
1534 csio_err(hw, "failed to kmap sg:%p of ioreq:%p\n",
1771 * - Gets a free ioreq structure (which is already initialized
1774 * - Initializes ioreq members.
1785 struct csio_ioreq *ioreq = NULL;
1824 /* Get a free ioreq structure - SM is already set to uninit */
1825 ioreq = csio_get_scsi_ioreq_lock(hw, scsim);
1826 if (!ioreq) {
1833 ioreq->nsge = nsge;
1834 ioreq->lnode = ln;
1835 ioreq->rnode = rn;
1836 ioreq->iq_idx = sqset->iq_idx;
1837 ioreq->eq_idx = sqset->eq_idx;
1838 ioreq->wr_status = 0;
1839 ioreq->drv_status = 0;
1840 csio_scsi_cmnd(ioreq) = (void *)cmnd;
1841 ioreq->tmo = 0;
1842 ioreq->datadir = cmnd->sc_data_direction;
1854 ioreq->io_cbfn = csio_scsi_cbfn;
1857 cmnd->host_scribble = (unsigned char *)ioreq;
1860 /* Kick off SCSI IO SM on the ioreq */
1862 retval = csio_scsi_start_io(ioreq);
1866 csio_err(hw, "ioreq: %p couldn't be started, status:%d\n",
1867 ioreq, retval);
1875 csio_put_scsi_ioreq_lock(hw, scsim, ioreq);
1888 csio_do_abrt_cls(struct csio_hw *hw, struct csio_ioreq *ioreq, bool abort)
1892 struct csio_lnode *ln = ioreq->lnode;
1895 ioreq->tmo = CSIO_SCSI_ABRT_TMO_MS;
1902 ioreq->eq_idx = sqset->eq_idx;
1905 rv = csio_scsi_abort(ioreq);
1907 rv = csio_scsi_close(ioreq);
1915 struct csio_ioreq *ioreq;
1928 ioreq = (struct csio_ioreq *)cmnd->host_scribble;
1929 if (!ioreq)
1936 "Request to abort ioreq:%p cmd:%p cdb:%08llx"
1938 ioreq, cmnd, *((uint64_t *)cmnd->cmnd), rn->flowid,
1939 cmnd->device->lun, csio_q_physiqid(hw, ioreq->iq_idx));
1941 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) != cmnd) {
1949 reinit_completion(&ioreq->cmplobj);
1951 rv = csio_do_abrt_cls(hw, ioreq, (ready ? SCSI_ABORT : SCSI_CLOSE));
1969 wait_for_completion_timeout(&ioreq->cmplobj, msecs_to_jiffies(tmo));
1972 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) {
1974 csio_err(hw, "Abort timed out -- req: %p\n", ioreq);
1978 if (ioreq->nsge > 0)
1982 csio_scsi_cmnd(ioreq) = NULL;
2012 * Cache the result in 'cmnd', since ioreq will be freed soon
2014 * the ioreq contents.
2068 struct csio_ioreq *ioreq = NULL;
2110 /* Get a free ioreq structure - SM is already set to uninit */
2111 ioreq = csio_get_scsi_ioreq_lock(hw, scsim);
2113 if (!ioreq) {
2120 ioreq->nsge = 0;
2121 ioreq->lnode = ln;
2122 ioreq->rnode = rn;
2123 ioreq->iq_idx = sqset->iq_idx;
2124 ioreq->eq_idx = sqset->eq_idx;
2126 csio_scsi_cmnd(ioreq) = cmnd;
2127 cmnd->host_scribble = (unsigned char *)ioreq;
2131 ioreq->tmo = CSIO_SCSI_LUNRST_TMO_MS / 1000;
2134 * FW times the LUN reset for ioreq->tmo, so we got to wait a little
2138 count = DIV_ROUND_UP((ioreq->tmo + 10) * 1000, CSIO_SCSI_TM_POLL_MS);
2141 ioreq->io_cbfn = csio_tm_cbfn;
2143 /* Save of the ioreq info for later use */
2145 sld.lnode = ioreq->lnode;
2146 sld.rnode = ioreq->rnode;
2150 /* Kick off TM SM on the ioreq */
2151 retval = csio_scsi_start_tm(ioreq);
2156 ioreq, retval);
2163 while ((((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd)
2168 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) {
2173 csio_scsi_drvcleanup(ioreq);
2174 list_del_init(&ioreq->sm.sm_list);
2220 csio_put_scsi_ioreq_lock(hw, scsim, ioreq);
2421 struct csio_ioreq *ioreq;
2437 ioreq = kzalloc(sizeof(struct csio_ioreq), GFP_KERNEL);
2438 if (!ioreq) {
2448 dma_buf = &ioreq->dma_buf;
2455 kfree(ioreq);
2462 csio_init_state(&ioreq->sm, csio_scsis_uninit);
2463 INIT_LIST_HEAD(&ioreq->gen_list);
2464 init_completion(&ioreq->cmplobj);
2466 list_add_tail(&ioreq->sm.sm_list, &scm->ioreq_freelist);
2486 ioreq = (struct csio_ioreq *)tmp;
2488 dma_buf = &ioreq->dma_buf;
2492 kfree(ioreq);
2508 struct csio_ioreq *ioreq;
2517 ioreq = (struct csio_ioreq *)tmp;
2519 dma_buf = &ioreq->dma_buf;
2523 kfree(ioreq);