Deleted Added
full compact
ppbconf.h (185003) ppbconf.h (187576)
1/*-
2 * Copyright (c) 1997, 1998, 1999 Nicolas Souchu
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997, 1998, 1999 Nicolas Souchu
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/ppbus/ppbconf.h 185003 2008-11-16 17:42:02Z jhb $
26 * $FreeBSD: head/sys/dev/ppbus/ppbconf.h 187576 2009-01-21 23:10:06Z jhb $
27 *
28 */
29#ifndef __PPBCONF_H
30#define __PPBCONF_H
31
32#include <sys/queue.h>
33
34/*

--- 159 unchanged lines hidden (view full) ---

194 struct ppb_xfer
195 get_xfer[PPB_MAX_XFER];
196
197 /* mode dependent put msq. If NULL,
198 * IEEE1284 code is used */
199 struct ppb_xfer
200 put_xfer[PPB_MAX_XFER];
201
27 *
28 */
29#ifndef __PPBCONF_H
30#define __PPBCONF_H
31
32#include <sys/queue.h>
33
34/*

--- 159 unchanged lines hidden (view full) ---

194 struct ppb_xfer
195 get_xfer[PPB_MAX_XFER];
196
197 /* mode dependent put msq. If NULL,
198 * IEEE1284 code is used */
199 struct ppb_xfer
200 put_xfer[PPB_MAX_XFER];
201
202 struct resource *intr_resource;
203 void *intr_cookie;
202 driver_intr_t *intr_hook;
203 void *intr_arg;
204};
205
206/* EPP standards */
207#define EPP_1_9 0x0 /* default */
208#define EPP_1_7 0x1
209
210/* Parallel Port Chipset IVARS */ /* elsewhere XXX */
211#define PPC_IVAR_EPP_PROTO 0
204};
205
206/* EPP standards */
207#define EPP_1_9 0x0 /* default */
208#define EPP_1_7 0x1
209
210/* Parallel Port Chipset IVARS */ /* elsewhere XXX */
211#define PPC_IVAR_EPP_PROTO 0
212#define PPC_IVAR_LOCK 1
213#define PPC_IVAR_INTR_HANDLER 2
212
213/*
214 * Maximum size of the PnP info string
215 */
216#define PPB_PnP_STRING_SIZE 256 /* XXX */
217
218/*
219 * Parallel Port Bus structure.

--- 14 unchanged lines hidden (view full) ---

234 int class_id; /* not a PnP device if class_id < 0 */
235
236 int state; /* current IEEE1284 state */
237 int error; /* last IEEE1284 error */
238
239 int mode; /* IEEE 1284-1994 mode
240 * NIBBLE, PS2, EPP or ECP */
241
214
215/*
216 * Maximum size of the PnP info string
217 */
218#define PPB_PnP_STRING_SIZE 256 /* XXX */
219
220/*
221 * Parallel Port Bus structure.

--- 14 unchanged lines hidden (view full) ---

236 int class_id; /* not a PnP device if class_id < 0 */
237
238 int state; /* current IEEE1284 state */
239 int error; /* last IEEE1284 error */
240
241 int mode; /* IEEE 1284-1994 mode
242 * NIBBLE, PS2, EPP or ECP */
243
242 void *ppb_owner; /* device which owns the bus */
244 device_t ppb_owner; /* device which owns the bus */
245
246 struct mtx *ppc_lock; /* lock of parent device */
247 struct resource *ppc_irq_res;
243};
244
248};
249
250struct callout;
251
252typedef int (*ppc_intr_handler)(void *);
253
245#ifdef _KERNEL
246extern int ppb_attach_device(device_t);
247extern int ppb_request_bus(device_t, device_t, int);
248extern int ppb_release_bus(device_t, device_t);
249
250/* bus related functions */
254#ifdef _KERNEL
255extern int ppb_attach_device(device_t);
256extern int ppb_request_bus(device_t, device_t, int);
257extern int ppb_release_bus(device_t, device_t);
258
259/* bus related functions */
260extern void ppb_lock(device_t);
261extern void ppb_unlock(device_t);
262extern void _ppb_assert_locked(device_t, const char *, int);
263extern void ppb_init_callout(device_t, struct callout *, int);
264extern int ppb_sleep(device_t, void *, int, const char *, int);
251extern int ppb_get_status(device_t, struct ppb_status *);
252extern int ppb_poll_bus(device_t, int, char, char, int);
253extern int ppb_reset_epp_timeout(device_t);
254extern int ppb_ecp_sync(device_t);
255extern int ppb_get_epp_protocol(device_t);
256extern int ppb_set_mode(device_t, int); /* returns old mode */
257extern int ppb_get_mode(device_t); /* returns current mode */
258extern int ppb_write(device_t, char *, int, int);
265extern int ppb_get_status(device_t, struct ppb_status *);
266extern int ppb_poll_bus(device_t, int, char, char, int);
267extern int ppb_reset_epp_timeout(device_t);
268extern int ppb_ecp_sync(device_t);
269extern int ppb_get_epp_protocol(device_t);
270extern int ppb_set_mode(device_t, int); /* returns old mode */
271extern int ppb_get_mode(device_t); /* returns current mode */
272extern int ppb_write(device_t, char *, int, int);
259#endif /* _KERNEL */
260
273
261/*
262 * These are defined as macros for speedup.
263#define ppb_get_base_addr(dev) ((dev)->ppb->ppb_link->base)
264#define ppb_get_epp_protocol(dev) ((dev)->ppb->ppb_link->epp_protocol)
265 */
266
274#ifdef INVARIANTS
275#define ppb_assert_locked(dev) _ppb_assert_locked(dev, __FILE__, __LINE__)
276#else
277#define ppb_assert_locked(dev)
267#endif
278#endif
279#endif /* _KERNEL */
280
281#endif /* !__PPBCONF_H */