Commit ff785e17 authored by Finn Thain's avatar Finn Thain Committed by Michael Ellerman

macintosh/adb-iop: Correct comment text

This patch improves comment style and corrects some misunderstandings
in the text.
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/996f835d2f3d90baaaf9ee954e252d06e8886c6f.1590880623.git.fthain@telegraphics.com.au
parent 8384c82a
...@@ -101,11 +101,10 @@ static void adb_iop_listen(struct iop_msg *msg) ...@@ -101,11 +101,10 @@ static void adb_iop_listen(struct iop_msg *msg)
req = current_req; req = current_req;
/* Handle a timeout. Timeout packets seem to occur even after */ /* Handle a timeout. Timeout packets seem to occur even after
/* we've gotten a valid reply to a TALK, so I'm assuming that */ * we've gotten a valid reply to a TALK, presumably because of
/* a "timeout" is actually more like an "end-of-data" signal. */ * autopolling.
/* We need to send back a timeout packet to the IOP to shut */ */
/* it up, plus complete the current request, if any. */
if (amsg->flags & ADB_IOP_TIMEOUT) { if (amsg->flags & ADB_IOP_TIMEOUT) {
msg->reply[0] = ADB_IOP_TIMEOUT | ADB_IOP_AUTOPOLL; msg->reply[0] = ADB_IOP_TIMEOUT | ADB_IOP_AUTOPOLL;
...@@ -115,9 +114,6 @@ static void adb_iop_listen(struct iop_msg *msg) ...@@ -115,9 +114,6 @@ static void adb_iop_listen(struct iop_msg *msg)
adb_iop_end_req(req, idle); adb_iop_end_req(req, idle);
} }
} else { } else {
/* TODO: is it possible for more than one chunk of data */
/* to arrive before the timeout? If so we need to */
/* use reply_ptr here like the other drivers do. */
if ((adb_iop_state == awaiting_reply) && if ((adb_iop_state == awaiting_reply) &&
(amsg->flags & ADB_IOP_EXPLICIT)) { (amsg->flags & ADB_IOP_EXPLICIT)) {
req->reply_len = amsg->count + 1; req->reply_len = amsg->count + 1;
...@@ -152,23 +148,24 @@ static void adb_iop_start(void) ...@@ -152,23 +148,24 @@ static void adb_iop_start(void)
local_irq_save(flags); local_irq_save(flags);
/* The IOP takes MacII-style packets, so */ /* The IOP takes MacII-style packets, so strip the initial
/* strip the initial ADB_PACKET byte. */ * ADB_PACKET byte.
*/
amsg.flags = ADB_IOP_EXPLICIT; amsg.flags = ADB_IOP_EXPLICIT;
amsg.count = req->nbytes - 2; amsg.count = req->nbytes - 2;
/* amsg.data immediately follows amsg.cmd, effectively making */ /* amsg.data immediately follows amsg.cmd, effectively making
/* amsg.cmd a pointer to the beginning of a full ADB packet. */ * &amsg.cmd a pointer to the beginning of a full ADB packet.
*/
memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1); memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1);
req->sent = 1; req->sent = 1;
adb_iop_state = sending; adb_iop_state = sending;
local_irq_restore(flags); local_irq_restore(flags);
/* Now send it. The IOP manager will call adb_iop_complete */ /* Now send it. The IOP manager will call adb_iop_complete
/* when the packet has been sent. */ * when the message has been sent.
*/
iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg, iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg,
adb_iop_complete); adb_iop_complete);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment