mcdvar.h revision 104445
1/*
2 * $FreeBSD: head/sys/dev/mcd/mcdvar.h 104445 2002-10-04 07:14:19Z mdodd $
3 */
4
5struct mcd_mbx {
6	short		unit;
7	short		port;
8	short		retry;
9	short		nblk;
10	int		sz;
11	u_long		skip;
12	struct bio *	bp;
13	int		p_offset;
14	short		count;
15	short		mode;
16};
17
18struct mcd_data {
19	short			type;
20	char *			name;
21	short			config;
22	short			flags;
23	u_char			read_command;
24	short			status;
25	int			blksize;
26	u_long			disksize;
27	int			iobase;
28	struct disklabel	dlabel;
29	int			partflags[MAXPARTITIONS];
30	int			openflags;
31	struct mcd_volinfo	volinfo;
32	struct mcd_qchninfo	toc[MCD_MAXTOCS];
33	short			audio_status;
34	short			curr_mode;
35	struct mcd_read2	lastpb;
36	short			debug;
37	struct bio_queue_head	head;	     /* head of bio queue */
38	struct mcd_mbx		mbx;
39};
40
41struct mcd_softc {
42	device_t		dev;
43	dev_t			mcd_dev_t[3];
44	int			debug;
45
46	struct resource *	port;
47	int			port_rid;
48	int			port_type;
49	bus_space_tag_t		port_bst;
50	bus_space_handle_t	port_bsh;
51
52	struct resource *	irq;
53	int			irq_rid;
54	int			irq_type;
55	void *			irq_ih;
56
57	struct resource *	drq;
58	int			drq_rid;
59	int			drq_type;
60
61	struct mtx		mtx;
62
63	struct callout_handle	ch;
64	int			ch_state;
65	struct mcd_mbx *	ch_mbxsave;
66
67	struct mcd_data		data;
68};
69
70#define	MCD_LOCK(_sc)		splx(&(_sc)->mtx
71#define	MCD_UNLOCK(_sc)		splx(&(_sc)->mtx
72
73#define	MCD_READ(_sc, _reg) \
74	bus_space_read_1(_sc->port_bst, _sc->port_bsh, _reg)
75#define	MCD_WRITE(_sc, _reg, _val) \
76	bus_space_write_1(_sc->port_bst, _sc->port_bsh, _reg, _val)
77
78int	mcd_probe	(struct mcd_softc *);
79int	mcd_attach	(struct mcd_softc *);
80