Lines Matching refs:req

147 static inline void sclp_trace_req(int prio, char *id, struct sclp_req *req,
150 struct sccb_header *sccb = req->sccb;
161 summary.status = req->status;
163 summary.timeout = (u16)req->queue_timeout;
164 summary.start_count = (u16)req->start_count;
313 struct sclp_req *req;
315 list_for_each_entry(req, &sclp_req_queue, list) {
316 if (!req->queue_expires)
319 (time_before(req->queue_expires, expires_next)))
320 expires_next = req->queue_expires;
331 struct sclp_req *req;
336 list_for_each_entry(req, &sclp_req_queue, list) {
337 if (!req->queue_expires)
339 if (time_before_eq(req->queue_expires, now)) {
340 if (req->status == SCLP_REQ_QUEUED) {
341 req->status = SCLP_REQ_QUEUED_TIMEOUT;
342 list_del(&req->list);
347 req = NULL;
350 return req;
361 struct sclp_req *req;
364 req = __sclp_req_queue_remove_expired_req();
366 if (req) {
368 sclp_trace_req(2, "RQTM", req, true);
371 if (req && req->callback)
372 req->callback(req, req->callback_data);
373 } while (req);
405 __sclp_start_request(struct sclp_req *req)
412 rc = sclp_service_call_trace(req->command, req->sccb);
413 req->start_count++;
417 req->status = SCLP_REQ_RUNNING;
429 req->status = SCLP_REQ_FAILED;
437 struct sclp_req *req;
448 req = list_entry(sclp_req_queue.next, struct sclp_req, list);
449 rc = __sclp_start_request(req);
453 if (req->start_count > 1) {
461 list_del(&req->list);
464 sclp_trace_req(2, "RQAB", req, true);
466 if (req->callback) {
468 req->callback(req, req->callback_data);
475 static int __sclp_can_add_request(struct sclp_req *req)
477 if (req == &sclp_init_req)
488 sclp_add_request(struct sclp_req *req)
494 if (!__sclp_can_add_request(req)) {
500 sclp_trace(2, "RQAD", __pa(req->sccb), _RET_IP_, false);
502 req->status = SCLP_REQ_QUEUED;
503 req->start_count = 0;
504 list_add_tail(&req->list, &sclp_req_queue);
506 if (req->queue_timeout) {
507 req->queue_expires = jiffies + req->queue_timeout * HZ;
509 time_after(sclp_queue_timer.expires, req->queue_expires))
510 mod_timer(&sclp_queue_timer, req->queue_expires);
512 req->queue_expires = 0;
515 req->list.prev == &sclp_req_queue) {
516 rc = __sclp_start_request(req);
518 list_del(&req->list);
573 sclp_read_cb(struct sclp_req *req, void *data)
578 sccb = (struct sccb_header *) req->sccb;
579 if (req->status == SCLP_REQ_DONE && (sccb->response_code == 0x20 ||
611 struct sclp_req *req;
614 req = list_entry(l, struct sclp_req, list);
615 if (sccb == __pa(req->sccb))
616 return req;
651 struct sclp_req *req;
668 req = __sclp_find_req(finished_sccb);
669 if (req) {
671 list_del(&req->list);
672 req->status = SCLP_REQ_DONE;
675 sclp_trace_req(2, "RQOK", req, false);
677 if (req->callback) {
679 req->callback(req, req->callback_data);