if_epreg.h (117700) | if_epreg.h (121206) |
---|---|
1/* 2 * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 1. Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 2. The name 8 * of the author may not be used to endorse or promote products derived from --- 5 unchanged lines hidden (view full) --- 14 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 16 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 17 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 18 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 19 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 * | 1/* 2 * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 1. Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 2. The name 8 * of the author may not be used to endorse or promote products derived from --- 5 unchanged lines hidden (view full) --- 14 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 16 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 17 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 18 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 19 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 * |
22 * $FreeBSD: head/sys/dev/ep/if_epreg.h 117700 2003-07-17 19:37:56Z markm $ | 22 * $FreeBSD: head/sys/dev/ep/if_epreg.h 121206 2003-10-18 15:22:43Z imp $ |
23 */ 24 25/* 26 * DELAY_MULTIPLE: How much to boost "base" delays, except 27 * for the inter-bit delays in get_eeprom_data. A cyrix Media GX needed this. 28 */ 29#define DELAY_MULTIPLE 10 30#define BIT_DELAY_MULTIPLE 10 --- 24 unchanged lines hidden (view full) --- 55 * 56 * We prefer 0x110 over 0x100 so to not conflict with the Plaque&Pray 57 * ports. 58 */ 59#define EP_ID_PORT 0x110 60#define EP_IOSIZE 16 /* 16 bytes of I/O space used. */ 61 62/* | 23 */ 24 25/* 26 * DELAY_MULTIPLE: How much to boost "base" delays, except 27 * for the inter-bit delays in get_eeprom_data. A cyrix Media GX needed this. 28 */ 29#define DELAY_MULTIPLE 10 30#define BIT_DELAY_MULTIPLE 10 --- 24 unchanged lines hidden (view full) --- 55 * 56 * We prefer 0x110 over 0x100 so to not conflict with the Plaque&Pray 57 * ports. 58 */ 59#define EP_ID_PORT 0x110 60#define EP_IOSIZE 16 /* 16 bytes of I/O space used. */ 61 62/* |
63 * some macros to acces long named fields 64 */ 65#define BASE (sc->ep_io_addr) 66 67/* | |
68 * Commands to read/write EEPROM trough EEPROM command register (Window 0, 69 * Offset 0xa) 70 */ 71#define EEPROM_CMD_RD 0x0080 /* Read: Address required (5 bits) */ 72#define EEPROM_CMD_WR 0x0040 /* Write: Address required (5 bits) */ 73#define EEPROM_CMD_ERASE 0x00c0 /* Erase: Address required (5 bits) */ 74#define EEPROM_CMD_EWEN 0x0030 /* Erase/Write Enable: No data required */ 75 76#define EEPROM_BUSY (1<<15) 77#define EEPROM_TST_MODE (1<<14) 78 79/* 80 * Some short functions, worth to let them be a macro 81 */ | 63 * Commands to read/write EEPROM trough EEPROM command register (Window 0, 64 * Offset 0xa) 65 */ 66#define EEPROM_CMD_RD 0x0080 /* Read: Address required (5 bits) */ 67#define EEPROM_CMD_WR 0x0040 /* Write: Address required (5 bits) */ 68#define EEPROM_CMD_ERASE 0x00c0 /* Erase: Address required (5 bits) */ 69#define EEPROM_CMD_EWEN 0x0030 /* Erase/Write Enable: No data required */ 70 71#define EEPROM_BUSY (1<<15) 72#define EEPROM_TST_MODE (1<<14) 73 74/* 75 * Some short functions, worth to let them be a macro 76 */ |
82#define is_eeprom_busy(b) (inw((b)+EP_W0_EEPROM_COMMAND)&EEPROM_BUSY) 83#define GO_WINDOW(x) outw(BASE+EP_COMMAND, WINDOW_SELECT|(x)) | 77#define is_eeprom_busy(sc) (EP_READ_2(sc, EP_W0_EEPROM_COMMAND)&EEPROM_BUSY) 78#define GO_WINDOW(x) EP_WRITE_2(sc, EP_COMMAND, WINDOW_SELECT|(x)) |
84 85/************************************************************************** 86 * * 87 * These define the EEPROM data structure. They are used in the probe 88 * function to verify the existence of the adapter after having sent 89 * the ID_Sequence. 90 * 91 **************************************************************************/ --- 246 unchanged lines hidden (view full) --- 338#define ACF_CONNECTOR_AUI 1 339#define ACF_CONNECTOR_BNC 3 340 341/* Resource configuration register. 342 * Window 0/Port 08 343 * 344 */ 345 | 79 80/************************************************************************** 81 * * 82 * These define the EEPROM data structure. They are used in the probe 83 * function to verify the existence of the adapter after having sent 84 * the ID_Sequence. 85 * 86 **************************************************************************/ --- 246 unchanged lines hidden (view full) --- 333#define ACF_CONNECTOR_AUI 1 334#define ACF_CONNECTOR_BNC 3 335 336/* Resource configuration register. 337 * Window 0/Port 08 338 * 339 */ 340 |
346#define SET_IRQ(base,irq) outw((base) + EP_W0_RESOURCE_CFG, \ 347 ((inw((base) + EP_W0_RESOURCE_CFG) & 0x0fff) | \ | 341#define SET_IRQ(sc, irq) EP_WRITE_2((sc), EP_W0_RESOURCE_CFG, \ 342 ((EP_READ_2((sc), EP_W0_RESOURCE_CFG) & 0x0fff) | \ |
348 ((u_short)(irq)<<12)) ) /* set IRQ i */ 349 350/* 351 * FIFO Registers. 352 * RX Status. Window 1/Port 08 353 * 354 * 15: Incomplete or FIFO empty. 355 * 14: 1: Error in RX Packet 0: Incomplete or no error. --- 82 unchanged lines hidden --- | 343 ((u_short)(irq)<<12)) ) /* set IRQ i */ 344 345/* 346 * FIFO Registers. 347 * RX Status. Window 1/Port 08 348 * 349 * 15: Incomplete or FIFO empty. 350 * 14: 1: Error in RX Packet 0: Incomplete or no error. --- 82 unchanged lines hidden --- |