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