diff options
author | Toomas Soome <tsoome@me.com> | 2018-10-15 22:13:49 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-11-26 11:11:27 -0500 |
commit | 5e1743f0d6a1d79ccc247d50153ad830fa07768b (patch) | |
tree | b3d1fac7244691fbbca058b21a4af814c43ecc53 /usr/src/uts/common/sys/stream.h | |
parent | a239e970c64e3cf36327bef7b63193d0e6a25544 (diff) | |
download | illumos-gate-5e1743f0d6a1d79ccc247d50153ad830fa07768b.tar.gz |
9903 qinfo: add typed members
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/common/sys/stream.h')
-rw-r--r-- | usr/src/uts/common/sys/stream.h | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/usr/src/uts/common/sys/stream.h b/usr/src/uts/common/sys/stream.h index 7a2f3c9305..4e3482dadc 100644 --- a/usr/src/uts/common/sys/stream.h +++ b/usr/src/uts/common/sys/stream.h @@ -125,8 +125,8 @@ typedef struct queue { size_t q_lowat; /* Q9S: Q low water mark */ struct qband *q_bandp; /* QLK: band flow information */ kmutex_t q_lock; /* NOLK: structure lock */ - struct stdata *q_stream; /* NOLK: stream backpointer */ - struct syncq *q_syncq; /* NOLK: associated syncq */ + struct stdata *q_stream; /* NOLK: stream backpointer */ + struct syncq *q_syncq; /* NOLK: associated syncq */ unsigned char q_nband; /* QLK: number of bands */ kcondvar_t q_wait; /* NOLK: read/write sleep CV */ struct queue *q_nfsrv; /* STR: next Q with svc routine */ @@ -142,9 +142,9 @@ typedef struct queue { * Syncq scheduling */ struct msgb *q_sqhead; /* QLK: first syncq message */ - struct msgb *q_sqtail; /* QLK: last syncq message */ + struct msgb *q_sqtail; /* QLK: last syncq message */ struct queue *q_sqnext; /* SQLK: next Q on syncq list */ - struct queue *q_sqprev; /* SQLK: prev Q on syncq list */ + struct queue *q_sqprev; /* SQLK: prev Q on syncq list */ uint_t q_sqflags; /* SQLK: syncq flags */ clock_t q_sqtstamp; /* SQLK: when Q was scheduled for sq */ @@ -168,9 +168,9 @@ typedef struct queue { #define QWANTRMQSYNC 0x00000080 /* Want to remove sync stream Q */ #define QBACK 0x00000100 /* queue has been back-enabled */ /* UNUSED 0x00000200 was QHLIST */ -/* UNUSED 0x00000400 was QUNSAFE */ +/* UNUSED 0x00000400 was QUNSAFE */ #define QPAIR 0x00000800 /* per queue-pair syncq */ -#define QPERQ 0x00001000 /* per queue-instance syncq */ +#define QPERQ 0x00001000 /* per queue-instance syncq */ #define QPERMOD 0x00002000 /* per module syncq */ #define QMTSAFE 0x00004000 /* stream module is MT-safe */ #define QMTOUTPERIM 0x00008000 /* Has outer perimeter */ @@ -184,7 +184,7 @@ typedef struct queue { #define QISDRV 0x00200000 /* the Queue is attached to a driver */ /* UNUSED 0x00400000 was QHOT */ /* UNUSED 0x00800000 was QNEXTHOT */ -/* UNUSED 0x01000000 was _QNEXTLESS */ +/* UNUSED 0x01000000 was _QNEXTLESS */ #define _QINSERTING 0x04000000 /* Private, module is being inserted */ #define _QREMOVING 0x08000000 /* Private, module is being removed */ #define _QASSOCIATED 0x10000000 /* queue is associated with a device */ @@ -248,27 +248,40 @@ typedef enum qfields { */ struct module_info { ushort_t mi_idnum; /* module id number */ - char *mi_idname; /* module name */ + char *mi_idname; /* module name */ ssize_t mi_minpsz; /* min packet size accepted */ ssize_t mi_maxpsz; /* max packet size accepted */ size_t mi_hiwat; /* hi-water mark */ - size_t mi_lowat; /* lo-water mark */ + size_t mi_lowat; /* lo-water mark */ }; /* * queue information structure (with Synchronous STREAMS extensions) */ + +typedef struct msgb mblk_t; +typedef struct struiod struiod_t; +typedef struct infod infod_t; + +typedef int (*qi_putp_t)(queue_t *, mblk_t *); +typedef int (*qi_srvp_t)(queue_t *); +typedef int (*qi_qopen_t)(queue_t *, dev_t *, int, int, cred_t *); +typedef int (*qi_qclose_t)(queue_t *, int, cred_t *); +typedef int (*qi_qadmin_t)(void); +typedef int (*qi_rwp_t)(queue_t *, struiod_t *); +typedef int (*qi_infop_t)(queue_t *, infod_t *); + struct qinit { - int (*qi_putp)(); /* put procedure */ - int (*qi_srvp)(); /* service procedure */ - int (*qi_qopen)(); /* called on startup */ - int (*qi_qclose)(); /* called on finish */ - int (*qi_qadmin)(); /* for future use */ + qi_putp_t qi_putp; /* put procedure */ + qi_srvp_t qi_srvp; /* service procedure */ + qi_qopen_t qi_qopen; /* called on startup */ + qi_qclose_t qi_qclose; /* called on finish */ + qi_qadmin_t qi_qadmin; /* for future use */ struct module_info *qi_minfo; /* module information structure */ struct module_stat *qi_mstat; /* module statistics structure */ - int (*qi_rwp)(); /* r/w procedure */ - int (*qi_infop)(); /* information procedure */ - int qi_struiot; /* stream uio type for struio() */ + qi_rwp_t qi_rwp; /* r/w procedure */ + qi_infop_t qi_infop; /* information procedure */ + int qi_struiot; /* stream uio type for struio() */ }; /* @@ -367,18 +380,18 @@ typedef struct datab { /* * Message block descriptor */ -typedef struct msgb { +struct msgb { struct msgb *b_next; struct msgb *b_prev; struct msgb *b_cont; unsigned char *b_rptr; unsigned char *b_wptr; - struct datab *b_datap; + struct datab *b_datap; unsigned char b_band; unsigned char b_tag; unsigned short b_flag; queue_t *b_queue; /* for sync queues */ -} mblk_t; +}; /* * bcache descriptor @@ -479,7 +492,7 @@ typedef struct bcache { */ #if defined(_LP64) struct iocblk { - int ioc_cmd; /* ioctl command type */ + int ioc_cmd; /* ioctl command type */ cred_t *ioc_cr; /* full credentials */ uint_t ioc_id; /* ioctl id */ uint_t ioc_flag; /* see below */ @@ -489,7 +502,7 @@ struct iocblk { }; #else struct iocblk { - int ioc_cmd; /* ioctl command type */ + int ioc_cmd; /* ioctl command type */ cred_t *ioc_cr; /* full credentials */ uint_t ioc_id; /* ioctl id */ size_t ioc_count; /* count of bytes in data field */ @@ -554,7 +567,7 @@ struct copyresp { uint_t cp_flag; /* datamodel IOC_ flags; see above */ mblk_t *cp_private; /* private state information */ caddr_t cp_rval; /* status of request: 0 -> success */ - /* non-zero -> failure */ + /* non-zero -> failure */ }; #else struct copyresp { @@ -562,7 +575,7 @@ struct copyresp { cred_t *cp_cr; /* full credentials */ uint_t cp_id; /* ioctl id (from ioc_id) */ caddr_t cp_rval; /* status of request: 0 -> success */ - /* non-zero -> failure */ + /* non-zero -> failure */ size_t cp_pad1; uint_t cp_pad2; mblk_t *cp_private; /* private state information */ @@ -637,22 +650,22 @@ struct stroptions { */ #define DEF_IOV_MAX 16 -typedef struct struiod { +struct struiod { mblk_t *d_mp; /* pointer to mblk (chain) */ uio_t d_uio; /* uio info */ iovec_t d_iov[DEF_IOV_MAX]; /* iov referenced by uio */ -} struiod_t; +}; /* * Structure for information procedure calls. */ -typedef struct infod { +struct infod { unsigned char d_cmd; /* info info request command */ unsigned char d_res; /* info info command results */ int d_bytes; /* mblk(s) byte count */ int d_count; /* count of mblk(s) */ uio_t *d_uiop; /* pointer to uio struct */ -} infod_t; +}; /* * Values for d_cmd & d_res. */ @@ -681,7 +694,7 @@ typedef struct cmdblk { * Values for stream flag in open to indicate module open, clone open, * and the return value for failure. */ -#define MODOPEN 0x1 /* open as a module */ +#define MODOPEN 0x1 /* open as a module */ #define CLONEOPEN 0x2 /* clone open; pick own minor dev */ #define OPENFAIL -1 /* returned for open failure */ |