ppbconf.h (187576) | ppbconf.h (188093) |
---|---|
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 187576 2009-01-21 23:10:06Z jhb $ | 26 * $FreeBSD: head/sys/dev/ppbus/ppbconf.h 188093 2009-02-03 19:49:21Z jhb $ |
27 * 28 */ 29#ifndef __PPBCONF_H 30#define __PPBCONF_H 31 | 27 * 28 */ 29#ifndef __PPBCONF_H 30#define __PPBCONF_H 31 |
32#define n(flags) (~(flags) & (flags)) 33 34/* 35 * Parallel Port Chipset control bits. 36 */ 37#define STROBE 0x01 38#define AUTOFEED 0x02 39#define nINIT 0x04 40#define SELECTIN 0x08 41#define IRQENABLE 0x10 42#define PCD 0x20 43 44#define nSTROBE n(STROBE) 45#define nAUTOFEED n(AUTOFEED) 46#define INIT n(nINIT) 47#define nSELECTIN n(SELECTIN) 48#define nPCD n(PCD) 49 50/* 51 * Parallel Port Chipset status bits. 52 */ 53#define TIMEOUT 0x01 54#define nFAULT 0x08 55#define SELECT 0x10 56#define PERROR 0x20 57#define nACK 0x40 58#define nBUSY 0x80 59 60#ifdef _KERNEL |
|
32#include <sys/queue.h> 33 34/* 35 * Parallel Port Bus sleep/wakeup queue. 36 */ 37#define PPBPRI (PZERO+8) 38 39/* --- 14 unchanged lines hidden (view full) --- 54#define PPB_MASK 0x0f 55#define PPB_OPTIONS_MASK 0xf0 56 57#define PPB_IS_EPP(mode) (mode & PPB_EPP) 58#define PPB_IN_EPP_MODE(bus) (PPB_IS_EPP (ppb_get_mode (bus))) 59#define PPB_IN_NIBBLE_MODE(bus) (ppb_get_mode (bus) & PPB_NIBBLE) 60#define PPB_IN_PS2_MODE(bus) (ppb_get_mode (bus) & PPB_PS2) 61 | 61#include <sys/queue.h> 62 63/* 64 * Parallel Port Bus sleep/wakeup queue. 65 */ 66#define PPBPRI (PZERO+8) 67 68/* --- 14 unchanged lines hidden (view full) --- 83#define PPB_MASK 0x0f 84#define PPB_OPTIONS_MASK 0xf0 85 86#define PPB_IS_EPP(mode) (mode & PPB_EPP) 87#define PPB_IN_EPP_MODE(bus) (PPB_IS_EPP (ppb_get_mode (bus))) 88#define PPB_IN_NIBBLE_MODE(bus) (ppb_get_mode (bus) & PPB_NIBBLE) 89#define PPB_IN_PS2_MODE(bus) (ppb_get_mode (bus) & PPB_PS2) 90 |
62#define n(flags) (~(flags) & (flags)) 63 | |
64/* | 91/* |
65 * Parallel Port Chipset control bits. 66 */ 67#define STROBE 0x01 68#define AUTOFEED 0x02 69#define nINIT 0x04 70#define SELECTIN 0x08 71#define IRQENABLE 0x10 72#define PCD 0x20 73 74#define nSTROBE n(STROBE) 75#define nAUTOFEED n(AUTOFEED) 76#define INIT n(nINIT) 77#define nSELECTIN n(SELECTIN) 78#define nPCD n(PCD) 79 80/* 81 * Parallel Port Chipset status bits. 82 */ 83#define TIMEOUT 0x01 84#define nFAULT 0x08 85#define SELECT 0x10 86#define PERROR 0x20 87#define nACK 0x40 88#define nBUSY 0x80 89 90/* | |
91 * Structure to store status information. 92 */ 93struct ppb_status { 94 unsigned char status; 95 96 unsigned int timeout:1; 97 unsigned int error:1; 98 unsigned int select:1; --- 147 unchanged lines hidden (view full) --- 246 struct mtx *ppc_lock; /* lock of parent device */ 247 struct resource *ppc_irq_res; 248}; 249 250struct callout; 251 252typedef int (*ppc_intr_handler)(void *); 253 | 92 * Structure to store status information. 93 */ 94struct ppb_status { 95 unsigned char status; 96 97 unsigned int timeout:1; 98 unsigned int error:1; 99 unsigned int select:1; --- 147 unchanged lines hidden (view full) --- 247 struct mtx *ppc_lock; /* lock of parent device */ 248 struct resource *ppc_irq_res; 249}; 250 251struct callout; 252 253typedef int (*ppc_intr_handler)(void *); 254 |
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); --- 19 unchanged lines hidden --- | 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); --- 19 unchanged lines hidden --- |