Lines Matching +full:packet +full:- +full:processor
1 // SPDX-License-Identifier: GPL-2.0
3 * I/O Processor (IOP) ADB Driver
5 * Based on via-cuda.c by Paul Mackerras.
7 * 1999-07-01 (jmt) - First implementation for new driver architecture.
9 * 1999-07-31 (jmt) - First working version.
67 req->complete = 1; in adb_iop_done()
68 current_req = req->next; in adb_iop_done()
69 if (req->done) in adb_iop_done()
70 (*req->done)(req); in adb_iop_done()
79 * This will be called when a packet has been successfully sent.
103 struct adb_iopmsg *amsg = (struct adb_iopmsg *)msg->message; in adb_iop_listen()
104 u8 addr = (amsg->cmd & ADDR_MASK) >> 4; in adb_iop_listen()
105 u8 op = amsg->cmd & OP_MASK; in adb_iop_listen()
117 switch (amsg->flags & (ADB_IOP_EXPLICIT | in adb_iop_listen()
125 if (req->reply_expected) { in adb_iop_listen()
126 req->reply_len = amsg->count + 1; in adb_iop_listen()
127 memcpy(req->reply, &amsg->cmd, req->reply_len); in adb_iop_listen()
135 amsg->cmd == ADB_READREG(addr, 0)) in adb_iop_listen()
136 adb_input(&amsg->cmd, amsg->count + 1, 1); in adb_iop_listen()
139 msg->reply[0] = autopoll_addr ? ADB_IOP_AUTOPOLL : 0; in adb_iop_listen()
140 msg->reply[1] = 0; in adb_iop_listen()
141 msg->reply[2] = autopoll_addr ? ADB_READREG(autopoll_addr, 0) : 0; in adb_iop_listen()
151 * Start sending an ADB packet, IOP style
153 * There isn't much to do other than hand the packet over to the IOP
162 /* get the packet to send */ in adb_iop_start()
167 /* The IOP takes MacII-style packets, so strip the initial in adb_iop_start()
171 amsg.count = req->nbytes - 2; in adb_iop_start()
174 * &amsg.cmd a pointer to the beginning of a full ADB packet. in adb_iop_start()
176 memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1); in adb_iop_start()
178 req->sent = 1; in adb_iop_start()
191 return -ENODEV; in adb_iop_probe()
211 while (!req->complete) in adb_iop_send_request()
221 if ((req->nbytes < 2) || (req->data[0] != ADB_PACKET)) { in adb_iop_write()
222 req->complete = 1; in adb_iop_write()
223 return -EINVAL; in adb_iop_write()
226 req->next = NULL; in adb_iop_write()
227 req->sent = 0; in adb_iop_write()
228 req->complete = 0; in adb_iop_write()
229 req->reply_len = 0; in adb_iop_write()
234 last_req->next = req; in adb_iop_write()
251 struct adb_iopmsg *amsg = (struct adb_iopmsg *)msg->message; in adb_iop_set_ap_complete()
253 autopoll_devs = get_unaligned_be16(amsg->data); in adb_iop_set_ap_complete()
256 autopoll_addr = autopoll_devs ? (ffs(autopoll_devs) - 1) : 0; in adb_iop_set_ap_complete()