Skip to contentSkip to conversation

(22/22) ADBREQ_RAW missing declaration

PATCH New Al Viro 1 participant 1 message Aug 25, 2005 Linux for power macintosh

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 (22/22) ADBREQ_RAW missing declaration

pulled from m68k CVS; ADBREQ_RAW is used in arch/m68k/mac/misc.c, but its declaration had not been propagated to Linus' tree yet. Related chunk in drivers/macintosh/adb.c also pulled in; even though the file is shared with ppc, behaviour is changed only for m68k.

----

drivers/macintosh/adb.c +5 -3
diff -urN RC13-rc7-m68k-flags/drivers/macintosh/adb.c RC13-rc7-m68k-adb.patch/drivers/macintosh/adb.c
@@ -476,13 +476,15 @@
 		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)
include/linux/adb.h +1 -0
diff -urN RC13-rc7-m68k-flags/include/linux/adb.h RC13-rc7-m68k-adb.patch/include/linux/adb.h
@@ -76,6 +76,7 @@
 #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 */