// SPDX-License-Identifier: GPL-2.0 /* * I/O Processor (IOP) ADB Driver * Written and (C) 1999 by Joshua M. Thompson (funaho@jurai.org) * Based on via-cuda.c by Paul Mackerras. * * 1999-07-01 (jmt) - First implementation for new driver architecture. * * 1999-07-31 (jmt) - First working version.
*/
/* * Listen for ADB messages from the IOP. * * This will be called when unsolicited IOP messages are received. * These IOP messages can carry ADB autopoll responses and also occur * after explicit ADB commands.
*/
/* Responses to Talk commands may be unsolicited as they are * produced when the IOP polls devices. They are mostly timeouts.
*/ if (op == TALK && ((1 << addr) & autopoll_devs))
autopoll_addr = addr;
switch (amsg->flags & (ADB_IOP_EXPLICIT |
ADB_IOP_AUTOPOLL |
ADB_IOP_TIMEOUT)) { case ADB_IOP_EXPLICIT: case ADB_IOP_EXPLICIT | ADB_IOP_TIMEOUT: if (adb_iop_state == awaiting_reply) { struct adb_request *req = current_req;
/* * Start sending an ADB packet, IOP style * * There isn't much to do other than hand the packet over to the IOP * after encapsulating it in an adb_iopmsg.
*/
/* get the packet to send */
req = current_req; if (!req) return;
/* The IOP takes MacII-style packets, so strip the initial * ADB_PACKET byte.
*/
amsg.flags = ADB_IOP_EXPLICIT;
amsg.count = req->nbytes - 2;
/* amsg.data immediately follows amsg.cmd, effectively making * &amsg.cmd a pointer to the beginning of a full ADB packet.
*/
memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1);
req->sent = 1;
adb_iop_state = sending;
/* Now send it. The IOP manager will call adb_iop_complete * when the message has been sent.
*/
iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg,
adb_iop_complete);
}
staticint adb_iop_probe(void)
{ if (!iop_ism_present) return -ENODEV; return 0;
}
staticint adb_iop_init(void)
{
pr_info("adb: IOP ISM driver v0.4 for Unified ADB\n");
iop_listen(ADB_IOP, ADB_CHAN, adb_iop_listen, "ADB"); return 0;
}
staticint adb_iop_send_request(struct adb_request *req, int sync)
{ int err;
err = adb_iop_write(req); if (err) return err;
if (sync) { while (!req->complete)
adb_iop_poll();
} return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.