Lines Matching refs:rq
138 struct raw3270_request *rq; in raw3270_request_alloc() local
141 rq = kzalloc(sizeof(struct raw3270_request), GFP_KERNEL | GFP_DMA); in raw3270_request_alloc()
142 if (!rq) in raw3270_request_alloc()
147 rq->buffer = kmalloc(size, GFP_KERNEL | GFP_DMA); in raw3270_request_alloc()
148 if (!rq->buffer) { in raw3270_request_alloc()
149 kfree(rq); in raw3270_request_alloc()
153 rq->size = size; in raw3270_request_alloc()
154 INIT_LIST_HEAD(&rq->list); in raw3270_request_alloc()
159 rq->ccw.cda = __pa(rq->buffer); in raw3270_request_alloc()
160 rq->ccw.flags = CCW_FLAG_SLI; in raw3270_request_alloc()
162 return rq; in raw3270_request_alloc()
169 raw3270_request_free (struct raw3270_request *rq) in raw3270_request_free() argument
171 kfree(rq->buffer); in raw3270_request_free()
172 kfree(rq); in raw3270_request_free()
179 raw3270_request_reset(struct raw3270_request *rq) in raw3270_request_reset() argument
181 BUG_ON(!list_empty(&rq->list)); in raw3270_request_reset()
182 rq->ccw.cmd_code = 0; in raw3270_request_reset()
183 rq->ccw.count = 0; in raw3270_request_reset()
184 rq->ccw.cda = __pa(rq->buffer); in raw3270_request_reset()
185 rq->ccw.flags = CCW_FLAG_SLI; in raw3270_request_reset()
186 rq->rescnt = 0; in raw3270_request_reset()
187 rq->rc = 0; in raw3270_request_reset()
194 raw3270_request_set_cmd(struct raw3270_request *rq, u8 cmd) in raw3270_request_set_cmd() argument
196 rq->ccw.cmd_code = cmd; in raw3270_request_set_cmd()
203 raw3270_request_add_data(struct raw3270_request *rq, void *data, size_t size) in raw3270_request_add_data() argument
205 if (size + rq->ccw.count > rq->size) in raw3270_request_add_data()
207 memcpy(rq->buffer + rq->ccw.count, data, size); in raw3270_request_add_data()
208 rq->ccw.count += size; in raw3270_request_add_data()
216 raw3270_request_set_data(struct raw3270_request *rq, void *data, size_t size) in raw3270_request_set_data() argument
218 rq->ccw.cda = __pa(data); in raw3270_request_set_data()
219 rq->ccw.count = size; in raw3270_request_set_data()
226 raw3270_request_set_idal(struct raw3270_request *rq, struct idal_buffer *ib) in raw3270_request_set_idal() argument
228 rq->ccw.cda = __pa(ib->data); in raw3270_request_set_idal()
229 rq->ccw.count = ib->size; in raw3270_request_set_idal()
230 rq->ccw.flags |= CCW_FLAG_IDA; in raw3270_request_set_idal()
239 struct raw3270_request *rq) in __raw3270_start() argument
241 rq->view = view; in __raw3270_start()
246 rq->rc = ccw_device_start(rp->cdev, &rq->ccw, in __raw3270_start()
247 (unsigned long) rq, 0, 0); in __raw3270_start()
248 if (rq->rc) { in __raw3270_start()
250 return rq->rc; in __raw3270_start()
253 list_add_tail(&rq->list, &rp->req_queue); in __raw3270_start()
267 raw3270_start(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start() argument
281 rc = __raw3270_start(rp, view, rq); in raw3270_start()
287 raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_locked() argument
299 rc = __raw3270_start(rp, view, rq); in raw3270_start_locked()
304 raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_irq() argument
309 rq->view = view; in raw3270_start_irq()
311 list_add_tail(&rq->list, &rp->req_queue); in raw3270_start_irq()
323 struct raw3270_request *rq; in raw3270_irq() local
328 rq = (struct raw3270_request *) intparm; in raw3270_irq()
329 view = rq ? rq->view : rp->view; in raw3270_irq()
348 view->fn->intv(view, rq, irb); in raw3270_irq()
355 if (rq && !list_empty(&rq->list)) { in raw3270_irq()
357 list_del_init(&rq->list); in raw3270_irq()
358 if (rq->callback) in raw3270_irq()
359 rq->callback(rq, rq->callback_data); in raw3270_irq()
369 rq = list_entry(rp->req_queue.next,struct raw3270_request,list); in raw3270_irq()
370 rq->rc = ccw_device_start(rp->cdev, &rq->ccw, in raw3270_irq()
371 (unsigned long) rq, 0, 0); in raw3270_irq()
372 if (rq->rc == 0) in raw3270_irq()
375 list_del_init(&rq->list); in raw3270_irq()
376 if (rq->callback) in raw3270_irq()
377 rq->callback(rq, rq->callback_data); in raw3270_irq()
527 raw3270_read_modified_cb(struct raw3270_request *rq, void *data) in raw3270_read_modified_cb() argument
529 struct raw3270 *rp = rq->view->dev; in raw3270_read_modified_cb()
574 raw3270_reset_device_cb(struct raw3270_request *rq, void *data) in raw3270_reset_device_cb() argument
576 struct raw3270 *rp = rq->view->dev; in raw3270_reset_device_cb()
580 if (rq->rc) { in raw3270_reset_device_cb()
644 struct raw3270_request *rq; in __raw3270_disconnect() local
651 rq = list_entry(rp->req_queue.next,struct raw3270_request,list); in __raw3270_disconnect()
652 view = rq->view; in __raw3270_disconnect()
653 rq->rc = -EACCES; in __raw3270_disconnect()
654 list_del_init(&rq->list); in __raw3270_disconnect()
655 if (rq->callback) in __raw3270_disconnect()
656 rq->callback(rq, rq->callback_data); in __raw3270_disconnect()
664 raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq, in raw3270_init_irq() argument
669 if (rq) { in raw3270_init_irq()
672 rq->rc = -EOPNOTSUPP; in raw3270_init_irq()
674 rq->rc = -EIO; in raw3270_init_irq()