Lines Matching refs:req

93 static int macii_send_request(struct adb_request *req, int sync);
94 static int macii_write(struct adb_request *req);
118 static unsigned char *reply_ptr; /* next byte in reply_buf or req->reply */
119 static bool reading_reply; /* store reply in reply_buf else req->reply */
120 static int data_index; /* index of the next byte to send from req->data */
121 static int reply_len; /* number of bytes received in reply_buf or req->reply */
188 static struct adb_request req;
223 adb_request(&req, NULL, ADBREQ_NOSEND, 1, poll_command);
225 req.sent = 0;
226 req.complete = 0;
227 req.reply_len = 0;
228 req.next = current_req;
231 current_req = &req;
233 current_req = &req;
234 last_req = &req;
239 static int macii_send_request(struct adb_request *req, int sync)
243 err = macii_write(req);
248 while (!req->complete)
255 static int macii_write(struct adb_request *req)
259 if (req->nbytes < 2 || req->data[0] != ADB_PACKET || req->nbytes > 15) {
260 req->complete = 1;
264 req->next = NULL;
265 req->sent = 0;
266 req->complete = 0;
267 req->reply_len = 0;
272 last_req->next = req;
273 last_req = req;
275 current_req = req;
276 last_req = req;
316 struct adb_request req;
319 adb_request(&req, NULL, ADBREQ_NOSEND, 1, ADB_BUSRESET);
320 macii_send_request(&req, 1);
331 struct adb_request *req;
333 req = current_req;
337 * And req->nbytes is the number of bytes of real data plus one.
343 via[SR] = req->data[1];
375 struct adb_request *req;
422 req = current_req;
430 last_cmd = req->data[1];
453 } else if (data_index >= req->nbytes) {
454 req->sent = 1;
456 if (req->reply_expected) {
460 reply_ptr = req->reply;
461 *reply_ptr = req->data[1];
466 } else if ((req->data[1] & OP_MASK) == TALK) {
471 *reply_ptr = req->data[1];
477 req->complete = 1;
478 current_req = req->next;
479 if (req->done)
480 (*req->done)(req);
484 req->complete = 1;
485 current_req = req->next;
486 if (req->done)
487 (*req->done)(req);
491 via[SR] = req->data[data_index++];
520 struct adb_request *req = current_req;
522 req->reply_len = reply_len;
524 req->complete = 1;
525 current_req = req->next;
526 if (req->done)
527 (*req->done)(req);