From 0c094289e6a443b390c3c29e5f52b5dcb2b6d06b Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Sat, 24 Dec 2016 21:25:05 +0100 Subject: [PATCH] 9P2000: give a name to NinepMsgType to ease debug --- sys/include/9P2000.h | 69 ++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/sys/include/9P2000.h b/sys/include/9P2000.h index 610b8b0..7c44df3 100644 --- a/sys/include/9P2000.h +++ b/sys/include/9P2000.h @@ -25,10 +25,44 @@ /* bits that must be zero in open/create mode */ #define NP_OZEROES ~(NP_OREAD|NP_OWRITE|NP_ORDWR|NP_OEXEC|NP_OTRUNC|NP_ORCLOSE) +typedef enum NinepMsgType +{ + Tversion = 100, + Rversion, + Tauth = 102, + Rauth, + Tattach = 104, + Rattach, + Terror = 106, /* illegal */ + Rerror, + Tflush = 108, + Rflush, + Twalk = 110, + Rwalk, + Topen = 112, + Ropen, + Tcreate = 114, + Rcreate, + Tread = 116, + Rread, + Twrite = 118, + Rwrite, + Tclunk = 120, + Rclunk, + Tremove = 122, + Rremove, + Tstat = 124, + Rstat, + Twstat = 126, + Rwstat, + Tmax, +} NinepMsgType; + + typedef struct Fcall { - uint8_t type; + NinepMsgType type : 8; uint32_t fid; uint16_t tag; union { @@ -107,39 +141,6 @@ struct Fcall #define NOFID (uint32_t)~0U /* Dummy fid */ #define IOHDRSZ 24 /* ample room for Twrite/Rread header (iounit) */ -enum -{ - Tversion = 100, - Rversion, - Tauth = 102, - Rauth, - Tattach = 104, - Rattach, - Terror = 106, /* illegal */ - Rerror, - Tflush = 108, - Rflush, - Twalk = 110, - Rwalk, - Topen = 112, - Ropen, - Tcreate = 114, - Rcreate, - Tread = 116, - Rread, - Twrite = 118, - Rwrite, - Tclunk = 120, - Rclunk, - Tremove = 122, - Rremove, - Tstat = 124, - Rstat, - Twstat = 126, - Rwstat, - Tmax, -}; - extern unsigned int convM2S(uint8_t*, uint, Fcall*); extern unsigned int convS2M(Fcall*, uint8_t*, uint); extern unsigned int sizeS2M(Fcall*);