Lines Matching refs:req
66 static void adb_iop_end_req(struct adb_request *req, int state) in adb_iop_end_req() argument
68 req->complete = 1; in adb_iop_end_req()
69 current_req = req->next; in adb_iop_end_req()
70 if (req->done) (*req->done)(req); in adb_iop_end_req()
82 struct adb_request *req; in adb_iop_complete() local
87 req = current_req; in adb_iop_complete()
88 if ((adb_iop_state == sending) && req && req->reply_expected) { in adb_iop_complete()
105 struct adb_request *req; in adb_iop_listen() local
113 req = current_req; in adb_iop_listen()
116 printk("adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X", req, in adb_iop_listen()
133 if (req && (adb_iop_state != idle)) { in adb_iop_listen()
134 adb_iop_end_req(req, idle); in adb_iop_listen()
142 req->reply_len = amsg->count + 1; in adb_iop_listen()
143 memcpy(req->reply, &amsg->cmd, req->reply_len); in adb_iop_listen()
164 struct adb_request *req; in adb_iop_start() local
171 req = current_req; in adb_iop_start()
172 if (!req) return; in adb_iop_start()
177 printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes); in adb_iop_start()
178 for (i = 0 ; i < req->nbytes ; i++) in adb_iop_start()
179 printk(" %02X", (uint) req->data[i]); in adb_iop_start()
187 amsg.count = req->nbytes - 2; in adb_iop_start()
191 memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1); in adb_iop_start()
193 req->sent = 1; in adb_iop_start()
200 iop_send_message(ADB_IOP, ADB_CHAN, req, in adb_iop_start()
217 int adb_iop_send_request(struct adb_request *req, int sync) in adb_iop_send_request() argument
221 err = adb_iop_write(req); in adb_iop_send_request()
225 while (!req->complete) adb_iop_poll(); in adb_iop_send_request()
230 static int adb_iop_write(struct adb_request *req) in adb_iop_write() argument
234 if ((req->nbytes < 2) || (req->data[0] != ADB_PACKET)) { in adb_iop_write()
235 req->complete = 1; in adb_iop_write()
241 req->next = NULL; in adb_iop_write()
242 req->sent = 0; in adb_iop_write()
243 req->complete = 0; in adb_iop_write()
244 req->reply_len = 0; in adb_iop_write()
247 last_req->next = req; in adb_iop_write()
248 last_req = req; in adb_iop_write()
250 current_req = req; in adb_iop_write()
251 last_req = req; in adb_iop_write()
273 struct adb_request req = { in adb_iop_reset_bus() local
279 adb_iop_write(&req); in adb_iop_reset_bus()
280 while (!req.complete) { in adb_iop_reset_bus()