#ifndef __PPBUS_CONF_H
#define __PPBUS_CONF_H
#include "gpio.h"
#include <sys/device.h>
#include <sys/gpio.h>
#include <sys/mutex.h>
#include <sys/queue.h>
#include <sys/bus.h>
#include <dev/ppbus/ppbus_msq.h>
#include <dev/ppbus/ppbus_device.h>
#if NGPIO > 0
#include <dev/gpio/gpiovar.h>
#define PPBUS_NPINS 17
#endif
typedef u_char (*PARPORT_IO_T)(device_t, int, u_char *, int, u_char);
typedef int (*PARPORT_EXEC_MICROSEQ_T)(device_t,
struct ppbus_microseq **);
typedef void (*PARPORT_RESET_EPP_TIMEOUT_T)(device_t);
typedef int (*PARPORT_SETMODE_T)(device_t, int);
typedef int (*PARPORT_GETMODE_T)(device_t);
typedef void (*PARPORT_ECP_SYNC_T)(device_t);
typedef int (*PARPORT_READ_T)(device_t, char *, int, int, size_t *);
typedef int (*PARPORT_WRITE_T)(device_t, char *, int, int, size_t *);
typedef int (*PARPORT_READ_IVAR_T)(device_t, int, unsigned int *);
typedef int (*PARPORT_WRITE_IVAR_T)(device_t, int, unsigned int *);
typedef int (*PARPORT_DMA_MALLOC_T)(device_t, void **, bus_addr_t *,
bus_size_t);
typedef void (*PARPORT_DMA_FREE_T)(device_t, void **, bus_addr_t *,
bus_size_t);
typedef int (*PARPORT_ADD_HANDLER_T)(device_t, void (*)(void *),
void *);
typedef int (*PARPORT_REMOVE_HANDLER_T)(device_t, void (*)(void *));
struct parport_adapter {
u_int16_t capabilities;
PARPORT_IO_T parport_io;
PARPORT_EXEC_MICROSEQ_T parport_exec_microseq;
PARPORT_RESET_EPP_TIMEOUT_T parport_reset_epp_timeout;
PARPORT_SETMODE_T parport_setmode;
PARPORT_GETMODE_T parport_getmode;
PARPORT_ECP_SYNC_T parport_ecp_sync;
PARPORT_READ_T parport_read;
PARPORT_WRITE_T parport_write;
PARPORT_READ_IVAR_T parport_read_ivar;
PARPORT_WRITE_IVAR_T parport_write_ivar;
PARPORT_DMA_MALLOC_T parport_dma_malloc;
PARPORT_DMA_FREE_T parport_dma_free;
PARPORT_ADD_HANDLER_T parport_add_handler;
PARPORT_REMOVE_HANDLER_T parport_remove_handler;
};
struct ppbus_softc {
device_t sc_dev;
kmutex_t sc_lock;
#define PPBUS_OK 1
#define PPBUS_NOK 0
u_int8_t sc_dev_ok;
u_int16_t sc_capabilities;
int sc_class_id;
u_int32_t sc_1284_state;
u_int32_t sc_1284_error;
u_int32_t sc_use_ieee;
u_int32_t sc_mode;
device_t ppbus_owner;
SLIST_HEAD(childlist, ppbus_device_softc) sc_childlist_head;
PARPORT_IO_T ppbus_io;
PARPORT_EXEC_MICROSEQ_T ppbus_exec_microseq;
PARPORT_RESET_EPP_TIMEOUT_T ppbus_reset_epp_timeout;
PARPORT_SETMODE_T ppbus_setmode;
PARPORT_GETMODE_T ppbus_getmode;
PARPORT_ECP_SYNC_T ppbus_ecp_sync;
PARPORT_READ_T ppbus_read;
PARPORT_WRITE_T ppbus_write;
PARPORT_READ_IVAR_T ppbus_read_ivar;
PARPORT_WRITE_IVAR_T ppbus_write_ivar;
PARPORT_DMA_MALLOC_T ppbus_dma_malloc;
PARPORT_DMA_FREE_T ppbus_dma_free;
PARPORT_ADD_HANDLER_T ppbus_add_handler;
PARPORT_REMOVE_HANDLER_T ppbus_remove_handler;
#if NGPIO > 0
struct gpio_chipset_tag sc_gpio_gc;
gpio_pin_t sc_gpio_pins[PPBUS_NPINS];
#endif
};
#if NGPIO > 0
void gpio_ppbus_attach(struct ppbus_softc *);
#endif
#endif