linux/debian/patches/bugfix/m68k/2.6.24/130-adbraw.diff

43 lines
1.2 KiB
Diff

To: linus, alan
Cc: lkml
Subject: [PATCH] ADB raw packets
From: Linux/m68k legacy
ADB: add support for raw packets
---
drivers/macintosh/adb.c | 7 ++++---
include/linux/adb.h | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -448,13 +448,14 @@ adb_request(struct adb_request *req, voi
use_sreq = 1;
} else
use_sreq = 0;
- req->nbytes = nbytes+1;
+ i = (flags & ADBREQ_RAW) ? 0 : 1;
+ req->nbytes = nbytes+i;
req->done = done;
req->reply_expected = flags & ADBREQ_REPLY;
req->data[0] = ADB_PACKET;
va_start(list, nbytes);
- for (i = 0; i < nbytes; ++i)
- req->data[i+1] = va_arg(list, int);
+ while (i < req->nbytes)
+ req->data[i++] = va_arg(list, int);
va_end(list);
if (flags & ADBREQ_NOSEND)
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -76,6 +76,7 @@ struct adb_driver {
#define ADBREQ_REPLY 1 /* expect reply */
#define ADBREQ_SYNC 2 /* poll until done */
#define ADBREQ_NOSEND 4 /* build the request, but don't send it */
+#define ADBREQ_RAW 8 /* send raw packet (don't prepend ADB_PACKET) */
/* Messages sent thru the client_list notifier. You should NOT stop
the operation, at least not with this version */