xref: /titanic_51/usr/src/uts/sun4u/starcat/sys/dman.h (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * ****** NOTICE **** This header file is maintained in the SMS gate,
29  * ****** NOTICE **** the ON gate, and the ssc driver gate. Any changes
30  * ****** NOTICE **** to it must also be made to in all gates.
31  */
32 
33 #ifndef	_DMAN_H
34 #define	_DMAN_H
35 
36 #pragma ident	"%Z%%M%	%I%	%E% SMI"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * Ethernet stuff
44  */
45 
46 #define	ETHERHEADER_SIZE (sizeof (struct ether_header))
47 typedef struct ether_header ehdr_t;
48 typedef struct ether_addr eaddr_t;
49 #define	IS_BROADCAST(eap) \
50 		(ether_cmp(eap, &etherbroadcast) == 0)
51 #define	IS_MULTICAST(eap) \
52 		((eap->ether_addr_octet[0] & 01) == 1)
53 #define	IS_UNICAST(eap) \
54 		(!IS_BROADCAST(eap) && !IS_MULTICAST(eap))
55 
56 #define	MAN_IS_DATA(mp)		((DB_TYPE(mp) == M_DATA) ||		\
57 				    ((DB_TYPE(mp) == M_PROTO) &&	\
58 				    (DL_PRIM(mp) == DL_UNITDATA_IND)))
59 
60 #define	MAN_ADDRL (sizeof (uint16_t) + ETHERADDRL)
61 
62 /*
63  * Private	DLPI full dlsap address format - stolen from eri.h
64  */
65 typedef struct  man_dladdr_s {
66 	struct  ether_addr	dl_phys;
67 	uint16_t		dl_sap;
68 } man_dladdr_t;
69 
70 #define	put_ether_type(ptr, value) {\
71 	((uint8_t *)(&((ehdr_t *)ptr)->ether_type))[0] = \
72 	    ((uint16_t)value & 0xff00) >> 8; \
73 	((uint8_t *)(&((ehdr_t *)ptr)->ether_type))[1] = (value & 0xff); }
74 #define	ether_bcopy(a, b) (bcopy((caddr_t)a, (caddr_t)b, 6))
75 
76 #define	MAN_MAX_EXPANDERS		18
77 #define	MAN_MAX_DESTS			38 /* (MAN_NUM_EXPANDERS * 2) + 2 */
78 #define	MAN_DEST_ARRAY_SIZE		(MAN_MAX_DESTS * sizeof (man_dest_t))
79 #define	TRUE		1
80 #define	FALSE		0
81 
82 /*
83  * Caller IDs for man_sendit processing decision on canput failure.
84  */
85 #define	MAN_UPPER	0x1
86 #define	MAN_LOWER	0x2
87 
88 /*
89  * MAN device information structure, one per man instance
90  *
91  * global list pointed to by MAN_XX_head
92  */
93 typedef struct man_s {
94 	struct man_s	*man_next;		/* next in list of devices */
95 	dev_info_t	*man_dip;		/* devinfo for this device */
96 	int		man_meta_ppa;		/* mxx device minor */
97 	major_t		man_meta_major;		/* mxx device major # */
98 	struct man_pg_s	*man_pg;		/* Pathgroups for this inst */
99 	int		man_refcnt;		/* DL_ATTACHes to us */
100 	int		man_suspended;		/* DDI_SUSPEND on device */
101 	kstat_t		*man_ksp;		/* meta interface statistics */
102 	int		man_eaddr_v;		/* ether addr valid */
103 	eaddr_t		man_eaddr;		/* active ether addr */
104 	/*
105 	 * Failover timers, used by man_dest_t.
106 	 */
107 	int32_t		man_init_time;		/* init time in usecs */
108 	int32_t		man_linkcheck_time;	/* linkcheck time in usecs */
109 	int32_t		man_linkstale_time;	/* linkstale time in usecs */
110 	int32_t		man_linkstale_retries;	/* linkstale retries/probes */
111 	int32_t		man_dr_delay;		/* DR retry delay in usecs */
112 	int32_t		man_dr_retries;		/* DR retries on EAGAIN errs */
113 	int32_t		man_kstat_waittime;	/* kstat_wait time in usecs */
114 	int32_t		man_dlpireset_time;	/* dlpireset time in usecs */
115 } man_t;
116 
117 /*
118  * MAN link state definitions
119  */
120 #define	MAN_LINKUNKNOWN		0x0
121 #define	MAN_LINKINIT		0x1
122 #define	MAN_LINKGOOD		0x2
123 #define	MAN_LINKSTALE		0x3
124 #define	MAN_LINKFAIL		0x4
125 
126 /*
127  * MAN timer types and times.
128  */
129 #define	MAN_TIMER_INIT		0x1
130 #define	MAN_TIMER_LINKCHECK	0x2
131 #define	MAN_TIMER_DLPIRESET	0x4
132 #define	MAN_INIT_TIME		1000000		/* 1 sec in usecs */
133 #define	MAN_LINKCHECK_TIME	30000000	/* 30 secs in usecs */
134 #define	MAN_LINKSTALE_TIME	1000000		/* 1 secs in usecs */
135 #define	MAN_LINKSTALE_RETRIES	10		/* send 10 probes */
136 #define	MAN_KSTAT_WAITTIME	300000		/* 0.3 secs in usecs */
137 #define	MAN_DLPIRESET_TIME	5000000		/* 5 secs in usecs */
138 #define	MAN_MAX_DLPIERRORS	10		/* 10 dlpi errors */
139 
140 /*
141  * MAN DR variables
142  */
143 #define	MAN_DR_DELAY		200000		/* 1/5th sec in usecs */
144 #define	MAN_DR_RETRIES		150		/* DR retries on EAGAIN errs */
145 
146 /*
147  * Device info - this must stay 64 bit aligned.
148  */
149 typedef struct md_s {
150 	major_t		mdev_major;	/* Driver major */
151 	uint32_t	mdev_ppa;	/* Driver instance */
152 	uint32_t	mdev_exp_id;	/* Containing expander in domain */
153 	uint32_t	mdev_state;	/* Device state */
154 } man_dev_t;
155 
156 /*
157  * mdev_state definitions
158  */
159 #define	MDEV_UNASSIGNED		0x0	/* Path assigned to a destination */
160 #define	MDEV_ASSIGNED		0x1	/* Path assigned to a destination */
161 #define	MDEV_ACTIVE		0x2	/* Path actively in use for dest */
162 #define	MDEV_FAILED		0x4	/* Failure detected in past. */
163 
164 /*
165  * MAN lower multiplexor data structure
166  */
167 typedef struct man_dest_s {
168 	uint_t		md_state;	/* state of this destination */
169 	struct manstr_s	*md_msp;	/* containing upper STREAM structure */
170 	queue_t		*md_rq;		/* upper read queue */
171 	queue_t		*md_wq;		/* lower write queue  for active path */
172 	man_dev_t	md_device;	/* Device from active path. */
173 	int		md_pg_id;	/* pathgroup for destination */
174 	eaddr_t		md_dst_eaddr;	/* Destinations ether address */
175 	eaddr_t		md_src_eaddr;	/* Our ether address */
176 	int		md_dlpistate;	/* DLPI State of netdev below us */
177 	int		md_muxid;	/* muxid of netdev linked below us */
178 	void *		md_switch_id;	/* ID of switch request */
179 	kmutex_t	md_lock;	/* Lock for md_dmp_* */
180 	mblk_t		*md_dmp_head;	/* deferred mblk list head */
181 	mblk_t		*md_dmp_tail;	/* deferred mblk list tail */
182 	size_t		 md_dmp_count;	/* bytes in deferred mblk list */
183 	ulong_t		md_switches;	/* # of failover switches */
184 	time_t		md_lastswitch;	/* time of last switch */
185 	timeout_id_t	md_bc_id;	/* qbufcall timeout id */
186 	/*
187 	 * Failover variables, only valid for active path.
188 	 */
189 	timeout_id_t	md_lc_timer_id;		/* qtimeout ID */
190 	int		md_linkstate;		/* link state */
191 	ulong_t		md_lastrcvcnt;		/* snapshot of packet count */
192 	ulong_t		md_rcvcnt;		/* current packet count */
193 	ulong_t		md_linkfails;		/* # of AP link failures */
194 	ulong_t		md_linkstales;		/* # of AP link stales */
195 	int32_t		md_linkstale_retries;	/* # of probes to send */
196 	ulong_t		md_icmpv4probes;	/* # of ICMPv4 probes sent */
197 	ulong_t		md_icmpv6probes;	/* # of ICMPv6 probes sent */
198 	int		md_link_updown_msg;	/* Last up/down message */
199 	int		md_dlpierrors;		/* # of DLPI errors */
200 } man_dest_t;
201 
202 /*
203  * md_state values
204  */
205 #define	MAN_DSTATE_NOTPRESENT	0x0	/* Destination doesnt exist */
206 #define	MAN_DSTATE_INITIALIZING	0x1	/* Initialize lower stream for dest */
207 #define	MAN_DSTATE_READY	0x2	/* Destination lower stream exists */
208 #define	MAN_DSTATE_PLUMBING	0x4	/* lower stream being switched */
209 #define	MAN_DSTATE_CLOSING	0x8	/* lower stream closing */
210 #define	MAN_DSTATE_BUSY		(MAN_DSTATE_PLUMBING|MAN_DSTATE_CLOSING)
211 
212 /*
213  * md_link_updwon_msg states.
214  */
215 #define	MAN_LINK_UP_MSG		0x0	/* Last msg emitted was "Link up" */
216 #define	MAN_LINK_DOWN_MSG	0x1	/* Last msg emitted was "Link down" */
217 
218 /*
219  * Upper per-stream instance state information.
220  *
221  * Each instance is dynamically allocated at open() and free'd at close().
222  * Each per-stream instance points to at most one per-device structure
223  * using the ms_manp field.  All instances are threaded together into one
224  * list of active instances ordered on sequence of opens.
225  */
226 typedef struct manstr_s {
227 	struct manstr_s	*ms_next;	/* next in list of streams */
228 	man_t		*ms_manp;	/* MAN device info pointer */
229 	man_dest_t	*ms_destp;	/* Optimization if only one ms_dests */
230 	man_dest_t	*ms_dests;	/* lower streams */
231 	int		ms_flags;	/* State for this MAN upper stream */
232 	queue_t		*ms_rq;		/* MAN upper read queue */
233 	int		ms_minor;	/* minor number of this stream */
234 	t_uscalar_t	ms_sap;		/* SAP bound to (if DL_BOUND) */
235 	int		ms_dlpistate;	/* DLPI State of this MAN instance */
236 	major_t		ms_meta_maj;	/* mxx device major # */
237 	int		ms_meta_ppa;	/* mxx device minor # */
238 	mblk_t		*ms_dl_mp;	/* list of DLPI ATTACH/BIND rqsts */
239 	mblk_t		*ms_dlioc_mp;	/* list of DL_IOC rqsts */
240 	uint_t		ms_dp;		/* # of pending DL_DETACH_REQs */
241 	ulong_t		ms_switches;	/* number of switches so far	*/
242 } manstr_t;
243 
244 /*
245  * ms_flags values.
246  */
247 #define	MAN_SFLAG_FAST		0x1	/* M_DATA fastpath mode */
248 #define	MAN_SFLAG_RAW		0x2	/* M_DATA plain raw mode */
249 #define	MAN_SFLAG_ALLPHYS	0x4	/* promiscuous mode */
250 #define	MAN_SFLAG_ALLMULTI	0x8	/* enable all multicast addresses */
251 #define	MAN_SFLAG_ALLSAP	0x10	/* enable all ether type values */
252 #define	MAN_SFLAG_CKSUM		0x20	/* enable hardware tcp checksumming */
253 #define	MAN_SFLAG_MULTI		0x40	/* enable multicast addresses */
254 #define	MAN_SFLAG_SERLPBK	0x80	/* enable SERDES looopback (DIAG) */
255 #define	MAN_SFLAG_MACLPBK	0x100	/* enable MAC int loopback (DIAG) */
256 
257 #define	MAN_SFLAG_PROMISC	(MAN_SFLAG_ALLPHYS|MAN_SFLAG_ALLMULTI| \
258 					MAN_SFLAG_ALLSAP)
259 #define	MAN_SFLAG_CLOSING	0x200	/* Stream in process of closing */
260 #define	MAN_SFLAG_CLOSE_DONE	0x400	/* Stream in process of closing */
261 #define	MAN_SFLAG_CONTROL	0x800	/* Stream is control stream */
262 
263 /*
264  * Paths in pathgroup lists.
265  */
266 typedef struct mpa_s {
267 	struct mpa_s	*mp_next;	/* Next in linked list */
268 	man_dev_t	mp_device;	/* Device for this path */
269 	kstat_named_t	*mp_last_knp;	/* last named kstats from mp_phys_ksp */
270 	time_t		mp_lru;		/* Last time used */
271 } man_path_t;
272 
273 /*
274  * Pathgroup list, one per destination ID. Each pathgroup connects
275  * to one destination. Hence we put that destination ethernet address
276  * here. It is read from here and stored in man_dest_t.md_dst_eaddr
277  * each time a new path is switched to.
278  */
279 typedef struct man_pg_s {
280 	struct man_pg_s		*mpg_next;
281 	int			mpg_flags;
282 	uint_t			mpg_pg_id;
283 	uint_t			mpg_man_ppa;	/* MAN instance for pathgroup */
284 	eaddr_t			mpg_dst_eaddr;
285 	man_path_t		*mpg_pathp;
286 } man_pg_t;
287 /*
288  *  mpg_pg_flags fields.
289  */
290 #define	MAN_PG_IDLE		0x0
291 #define	MAN_PG_SWITCHING	0x1
292 
293 /*
294  * MAN IOCTL Definitions.
295  */
296 #define	MIOC			('M'<< 16)
297 #define	MAN_SETPATH		(MIOC|0x1)
298 #define	MAN_GETEADDR		(MIOC|0x2)
299 #define	MAN_SET_LINKCHECK_TIME	(MIOC|0x3)
300 #define	MAN_SET_SC_IPADDRS	(MIOC|0x4)
301 #define	MAN_SET_SC_IP6ADDRS	(MIOC|0x8)
302 
303 /*
304  * Pathgroup assignment data structure - this must stay 64 bit aligned.
305  */
306 typedef struct mi_path_t {
307 	uchar_t		mip_cmd;	/* Cmd for this pathgroup */
308 	uchar_t		pad1[3];
309 	uint32_t	mip_man_ppa;	/* Man instance to apply cmd to */
310 	uint32_t	mip_pg_id;	/* pathgroup ID this path is for */
311 	eaddr_t		mip_eaddr;	/* Eaddr for this destination */
312 	uchar_t		pad2[2];
313 	man_dev_t	mip_devs[MAN_MAX_DESTS]; /* Array of devices */
314 	uint32_t	mip_ndevs;	/* #devs at mip_devs */
315 } mi_path_t;
316 
317 #define	MI_PATH_READ		0x0	/* Fill in devs for destID */
318 #define	MI_PATH_ASSIGN		0x1	/* Assign devs for destID */
319 #define	MI_PATH_ACTIVATE	0x2	/* Mark a dev as active for destID */
320 #define	MI_PATH_DEACTIVATE	0x3	/* Deactivate active dev for destID */
321 #define	MI_PATH_UNASSIGN	0x4	/* Unassign assigned dev for destID */
322 #define	MI_PATH_ADD		0x5	/* Just Add devs for destID */
323 
324 /*
325  * Linkcheck time assignment data structure - this must stay 64 bit aligned.
326  */
327 typedef struct mi_time_t {
328 	int32_t		mtp_man_ppa;	/* Man instance to apply cmd to */
329 	int32_t		mtp_time;	/* Time in usecs to */
330 } mi_time_t;
331 
332 /*
333  * SC IP address assignment data structure. See man_pinger().
334  */
335 typedef struct man_sc_ipaddrs_s {
336 	in_addr_t	ip_other_sc_ipaddr;
337 	in_addr_t	ip_my_sc_ipaddr;
338 } man_sc_ipaddrs_t;
339 
340 /*
341  * SC IPv6 address assignment data structure. See man_pinger().
342  */
343 typedef struct man_sc_ip6addrs_s {
344 	in6_addr_t	ip6_other_sc_ipaddr;
345 	in6_addr_t	ip6_my_sc_ipaddr;
346 } man_sc_ip6addrs_t;
347 
348 /*
349  * Array of dests to apply operation to.
350  */
351 typedef struct man_adest_s {
352 	int		a_man_ppa;	/* man instance */
353 	int		a_pg_id;	/* pg_id of dests */
354 	uint32_t	a_exp_id;	/* Used for DR requests */
355 	man_dev_t	a_sf_dev;	/* Switch from device */
356 	man_dev_t	a_st_dev;	/* Switch to device */
357 	man_dest_t	*a_mdp;		/* array of dests for mw_type */
358 	uint_t		a_ndests;	/* size of array */
359 } man_adest_t;
360 
361 /*
362  * work structure for MAN background thread.
363  */
364 typedef struct man_work_s {
365 	struct	man_work_s	*mw_next;	/* next request on q */
366 	queue_t			*mw_q;		/* For qwait-ers */
367 	int			mw_type;	/* work request type */
368 	int			mw_flags;	/* asycn/sync flags */
369 	int			mw_status;	/* Status of work request */
370 	man_adest_t		mw_arg;		/* work argument */
371 	kcondvar_t		mw_cv;		/* sender sleeps here */
372 } man_work_t;
373 
374 /*
375  * Values for mw_flags
376  */
377 #define	MAN_WFLAGS_NOWAITER	0x0
378 #define	MAN_WFLAGS_CVWAITER	0x1
379 #define	MAN_WFLAGS_QWAITER	0x2
380 #define	MAN_WFLAGS_DONE		0x4
381 
382 /*
383  * Values for mw_type.
384  */
385 #define	MAN_WORK_OPEN_CTL	0x0	/* Open the control stream */
386 #define	MAN_WORK_CLOSE_CTL	0x1	/* Open the control stream */
387 #define	MAN_WORK_SWITCH		0x2	/* Dest requests switch to new path */
388 #define	MAN_WORK_PATH_UPDATE	0x3	/* pathgrp info changed, update dests */
389 #define	MAN_WORK_CLOSE		0x4	/* Close destinations */
390 #define	MAN_WORK_CLOSE_STREAM	0x5	/* man_close()-ing upper stream */
391 #define	MAN_WORK_DRATTACH	0x6	/* DR attached new IO board */
392 #define	MAN_WORK_DRDETACH	0x7	/* DR detached an IO board */
393 #define	MAN_WORK_STOP		0x8	/* Stop and exit */
394 #define	MAN_WORK_DRSWITCH	0x9	/* Switch path prior to DRDETACH */
395 #define	MAN_WORK_KSTAT_UPDATE	0xA	/* Take kstat snapshot */
396 
397 #define	MAN_IDNUM	(13138)		/* module ID number */
398 #define	MAN_MINPSZ	(0)		/* min packet size */
399 #define	MAN_MAXPSZ	(INFPSZ)	/* max packet size */
400 #define	MAN_HIWAT	(64 * 1024)	/* hi-water mark */
401 #define	MAN_LOWAT	(1)		/* lo-water mark */
402 #define	MAN_MEDIA	"Ethernet"	/* media type */
403 
404 /*
405  * State definitions for man_config_state
406  */
407 #define	MAN_UNCONFIGURED	0x0		/* Attached but never opened */
408 #define	MAN_CONFIGURING		0x1		/* First open */
409 #define	MAN_CONFIGURED		0x2		/* Done configuring */
410 #define	MAN_FINI		0x3		/* cv_waiting in _fini() */
411 
412 /*
413  * IOSRAM definitions
414  */
415 #define	MANC_VERSION		0x1
416 #define	IOSRAM_KEY_MANC		(('M'<<24)|('A'<<16)|('N'<<8)|'C')
417 #define	IOSRAM_KEY_SCMD		(('S'<<24)|('C'<<16)|('M'<<8)|'D')
418 #define	IOSRAM_KEY_MDSC		(('M'<<24)|('D'<<16)|('S'<<8)|'C')
419 #define	MAN_IOSRAM_TIMEOUT	10000		/* 10 secs in ms */
420 
421 typedef struct manc_s {
422 	uint32_t	manc_magic;		/* MANC_MAGIC */
423 	uint32_t	manc_version;		/* MANC_VERSION */
424 	uint32_t	manc_csum;		/* TBD */
425 	int		manc_ip_type;		/* AF_INET or AF_INET6 */
426 	in_addr_t	manc_dom_ipaddr;	/* Domains IP address */
427 	in_addr_t	manc_dom_ip_netmask;	/* Domains IP netmask */
428 	in_addr_t	manc_sc_ipaddr;		/* SC's IP address */
429 	in6_addr_t	manc_dom_ipv6addr;	/* Domain's IPv6 address */
430 	in6_addr_t	manc_dom_ipv6_netmask;	/* Domain's IPv6 netmask */
431 	in6_addr_t	manc_sc_ipv6addr;	/* SC's IPv6 address */
432 	eaddr_t		manc_dom_eaddr;		/* 48 bit ethernet address */
433 	eaddr_t		manc_sc_eaddr;		/* 48 bit ethernet address */
434 	uint32_t	manc_iob_bitmap;	/* initial ioboard list */
435 	uchar_t		manc_golden_iob;	/* post selected ioboard */
436 } manc_t;
437 
438 
439 typedef struct man_mb_s {
440 	uint32_t		mb_status;
441 	uint32_t		mb_exp_id;
442 } man_mbox_msg_t;
443 
444 typedef struct ml_s {
445 	struct ml_s	*l_next;
446 	int		l_muxid;
447 	queue_t		*l_rq;
448 	queue_t		*l_wq;
449 } man_linkrec_t;
450 
451 typedef struct man_workq_s {
452 	man_work_t	*q_work;
453 	kcondvar_t	q_cv;
454 	bufcall_id_t	*q_id;
455 } man_workq_t;
456 
457 /*
458  * PCI stuff.
459  */
460 
461 /*
462  * Misc defines
463  */
464 #define	MAN_DDI_BUFLEN		128
465 #define	MAN_DEVTYPE_PROP	"device_type"
466 #define	MAN_REG_PROP		"reg"
467 #define	MAN_PORTID_PROP		"portid"
468 #define	MAN_DEVTYPE_PCI		"pci"
469 #define	MAN_PCI_B_CSR_BASE	0x00700000
470 #define	MAN_SCHIZO_MASK		0xF
471 #define	MAN_SCHIZO_0_ID		0xC
472 
473 /* ------------------------------------------------------------------------- */
474 /*
475  * Patchable debug flag.
476  * Set this to nonzero to enable error messages.
477  */
478 
479 /*
480  * The following parameters may be configured by the user. If they are not
481  * configured by the user, the values will be based on the capabilities of
482  * the transceiver.
483  * The value "MAN_NOTUSR" is ORed with the parameter value to indicate values
484  * which are NOT configured by the user.
485  */
486 
487 /* command */
488 
489 #define	MAN_ND_GET	ND_GET
490 #define	MAN_ND_SET	ND_SET
491 #define	MAN_NOTUSR	0x0f000000
492 #define	MAN_MASK_1BIT	0x1
493 #define	MAN_MASK_2BIT	0x3
494 #define	MAN_MASK_8BIT	0xff
495 
496 typedef struct param_s {
497 	uint32_t param_min;
498 	uint32_t param_max;
499 	uint32_t param_val;
500 	char   *param_name;
501 } param_t;
502 
503 #if defined(DEBUG)
504 #define	MAN_DBG(flag, msg)	{ if (man_debug&flag) (void) printf msg; }
505 #define	MAN_DBGCALL(flag, func)	{ if (man_debug&flag) (void) func; }
506 
507 #define	MAN_INIT	0x00000001
508 #define	MAN_OCLOSE	0x00000002
509 #define	MAN_CONFIG	0x00000004
510 #define	MAN_SWITCH	0x00000008
511 #define	MAN_IOSRAM	0x00000010
512 #define	MAN_LINK	0x00000020
513 #define	MAN_PATH	0x00000040
514 #define	MAN_DEST	0x00000080
515 #define	MAN_KSTAT	0x00000100
516 #define	MAN_KSTAT2	0x00000200
517 #define	MAN_DDI		0x000001FF
518 
519 #define	MAN_UWPUT	0x00000400
520 #define	MAN_LWPUT	0x00000800
521 #define	MAN_LRPUT	0x00001000
522 #define	MAN_LRPUT2	0x00002000
523 #define	MAN_PUT		(MAN_UWPUT | MAN_LWPUT | MAN_LRPUT)
524 #define	MAN_UWSRV	0x00004000
525 #define	MAN_LWSRV	0x00008000
526 #define	MAN_LRSRV	0x00010000
527 #define	MAN_DATA	0x00020000
528 #define	MAN_DLPI	0x00040000
529 #define	MAN_SRV		(MAN_UWSRV | MAN_LWSRV | MAN_LRSRV)
530 #define	MAN_STREAMS	(MAN_PUT | MAN_SRV | MAN_OCLOSE)
531 
532 #define	MAN_CALLS	(MAN_DDI | MAN_STREAMS)
533 
534 #define	MAN_STATE	0x00080000
535 #define	MAN_WARN	0x00100000
536 #define	MAN_DEBUG	(MAN_CALLS | MAN_WARN | MAN_STATE)
537 #define	MAN_KMEM	0x00200000
538 #define	MAN_DR		0x00400000
539 #define	MAN_ALL		0xFFFFFFFF
540 
541 #else
542 
543 #define	MAN_DBG(flag, msg)
544 #define	MAN_DBGCALL(flag, func)
545 
546 #endif  /* DEBUG */
547 
548 #ifdef	__cplusplus
549 }
550 #endif
551 
552 #endif /* _DMAN_H */
553