Lines Matching refs:req
114 struct request *req; in hp_sw_tur() local
118 req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO); in hp_sw_tur()
119 if (IS_ERR(req)) in hp_sw_tur()
122 blk_rq_set_block_pc(req); in hp_sw_tur()
123 req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | in hp_sw_tur()
125 req->cmd_len = COMMAND_SIZE(TEST_UNIT_READY); in hp_sw_tur()
126 req->cmd[0] = TEST_UNIT_READY; in hp_sw_tur()
127 req->timeout = HP_SW_TIMEOUT; in hp_sw_tur()
128 req->sense = h->sense; in hp_sw_tur()
129 memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); in hp_sw_tur()
130 req->sense_len = 0; in hp_sw_tur()
132 ret = blk_execute_rq(req->q, NULL, req, 1); in hp_sw_tur()
134 if (req->sense_len > 0) { in hp_sw_tur()
139 HP_SW_NAME, req->errors); in hp_sw_tur()
147 blk_put_request(req); in hp_sw_tur()
155 blk_put_request(req); in hp_sw_tur()
201 static void start_stop_endio(struct request *req, int error) in start_stop_endio() argument
203 struct hp_sw_dh_data *h = req->end_io_data; in start_stop_endio()
206 if (error || host_byte(req->errors) != DID_OK || in start_stop_endio()
207 msg_byte(req->errors) != COMMAND_COMPLETE) { in start_stop_endio()
210 HP_SW_NAME, req->errors); in start_stop_endio()
215 if (req->sense_len > 0) { in start_stop_endio()
220 blk_put_request(req); in start_stop_endio()
228 req->end_io_data = NULL; in start_stop_endio()
229 __blk_put_request(req->q, req); in start_stop_endio()
246 struct request *req; in hp_sw_start_stop() local
248 req = blk_get_request(h->sdev->request_queue, WRITE, GFP_ATOMIC); in hp_sw_start_stop()
249 if (IS_ERR(req)) in hp_sw_start_stop()
252 blk_rq_set_block_pc(req); in hp_sw_start_stop()
253 req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | in hp_sw_start_stop()
255 req->cmd_len = COMMAND_SIZE(START_STOP); in hp_sw_start_stop()
256 req->cmd[0] = START_STOP; in hp_sw_start_stop()
257 req->cmd[4] = 1; /* Start spin cycle */ in hp_sw_start_stop()
258 req->timeout = HP_SW_TIMEOUT; in hp_sw_start_stop()
259 req->sense = h->sense; in hp_sw_start_stop()
260 memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); in hp_sw_start_stop()
261 req->sense_len = 0; in hp_sw_start_stop()
262 req->end_io_data = h; in hp_sw_start_stop()
264 blk_execute_rq_nowait(req->q, NULL, req, 1, start_stop_endio); in hp_sw_start_stop()
268 static int hp_sw_prep_fn(struct scsi_device *sdev, struct request *req) in hp_sw_prep_fn() argument
275 req->cmd_flags |= REQ_QUIET; in hp_sw_prep_fn()