Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Add common macro to check message length.



details:   https://anonhg.NetBSD.org/src/rev/4037d4298102
branches:  trunk
changeset: 517003:4037d4298102
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Nov 04 12:03:03 2001 +0000

description:
Add common macro to check message length.

diffstat:

 sys/dev/scsipi/scsi_message.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r f607cf02075d -r 4037d4298102 sys/dev/scsipi/scsi_message.h
--- a/sys/dev/scsipi/scsi_message.h     Sun Nov 04 10:27:15 2001 +0000
+++ b/sys/dev/scsipi/scsi_message.h     Sun Nov 04 12:03:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsi_message.h,v 1.6 2001/11/03 15:52:03 tsutsui Exp $ */
+/*     $NetBSD: scsi_message.h,v 1.7 2001/11/04 12:03:03 tsutsui Exp $ */
 
 /* Messages (1 byte) */                     /* I/T (M)andatory or (O)ptional */
 #define MSG_CMDCOMPLETE                0x00 /* M/M */
@@ -44,3 +44,9 @@
 #define MSG_EXT_WDTR_BUS_16_BIT        0x01
 #define MSG_EXT_WDTR_BUS_32_BIT        0x02 
 
+#define MSG_ISEXTENDED(m)      ((m) == MSG_EXTENDED)
+
+/* message length */
+#define MSG_IS1BYTE(m) \
+       ((!MSG_ISEXTENDED(m) && (m) < 0x20) || MSG_ISIDENTIFY(m))
+#define MSG_IS2BYTE(m)         (((m) & 0xf0) == 0x20)



Home | Main Index | Thread Index | Old Index