iPXE
Data Structures | Macros | Functions | Variables
isapnp.h File Reference
#include <stdint.h>
#include <ipxe/isa_ids.h>
#include <ipxe/device.h>
#include <ipxe/tables.h>

Go to the source code of this file.

Data Structures

struct  isapnp_identifier
 An ISAPnP serial identifier. More...
 
struct  isapnp_logdevid
 An ISAPnP logical device ID structure. More...
 
struct  isapnp_device_id
 An ISAPnP device ID list entry. More...
 
struct  isapnp_device
 An ISAPnP device. More...
 
struct  isapnp_driver
 An ISAPnP driver. More...
 

Macros

#define ISAPNP_H
 
#define ISAPNP_ADDRESS   0x279
 
#define ISAPNP_WRITE_DATA   0xa79
 
#define ISAPNP_READ_PORT_MIN   0x203
 
#define ISAPNP_READ_PORT_START
 
#define ISAPNP_READ_PORT_MAX   0x3ff
 
#define ISAPNP_READ_PORT_STEP
 
#define ISAPNP_CSN_MIN   0x01
 
#define ISAPNP_CSN_MAX   0x0f
 
#define ISAPNP_READPORT   0x00
 
#define ISAPNP_SERIALISOLATION   0x01
 
#define ISAPNP_CONFIGCONTROL   0x02
 
#define ISAPNP_WAKE   0x03
 
#define ISAPNP_RESOURCEDATA   0x04
 
#define ISAPNP_STATUS   0x05
 
#define ISAPNP_CARDSELECTNUMBER   0x06
 
#define ISAPNP_LOGICALDEVICENUMBER   0x07
 
#define ISAPNP_ACTIVATE   0x30
 
#define ISAPNP_IORANGECHECK   0x31
 
#define ISAPNP_IOBASE(n)   ( 0x60 + ( (n) * 2 ) )
 
#define ISAPNP_IRQNO(n)   ( 0x70 + ( (n) * 2 ) )
 
#define ISAPNP_IRQTYPE(n)   ( 0x71 + ( (n) * 2 ) )
 
#define ISAPNP_CONFIG_RESET   ( 1 << 0 )
 
#define ISAPNP_CONFIG_WAIT_FOR_KEY   ( 1 << 1 )
 
#define ISAPNP_CONFIG_RESET_CSN   ( 1 << 2 )
 
#define ISAPNP_CONFIG_RESET_DRV
 
#define ISAPNP_LFSR_SEED   0x6a
 
#define ISAPNP_IS_SMALL_TAG(tag)   ( ! ( (tag) & 0x80 ) )
 
#define ISAPNP_SMALL_TAG_NAME(tag)   ( ( (tag) >> 3 ) & 0xf )
 
#define ISAPNP_SMALL_TAG_LEN(tag)   ( ( (tag) & 0x7 ) )
 
#define ISAPNP_TAG_PNPVERNO   0x01
 
#define ISAPNP_TAG_LOGDEVID   0x02
 
#define ISAPNP_TAG_COMPATDEVID   0x03
 
#define ISAPNP_TAG_IRQ   0x04
 
#define ISAPNP_TAG_DMA   0x05
 
#define ISAPNP_TAG_STARTDEP   0x06
 
#define ISAPNP_TAG_ENDDEP   0x07
 
#define ISAPNP_TAG_IOPORT   0x08
 
#define ISAPNP_TAG_FIXEDIO   0x09
 
#define ISAPNP_TAG_RSVDSHORTA   0x0A
 
#define ISAPNP_TAG_RSVDSHORTB   0x0B
 
#define ISAPNP_TAG_RSVDSHORTC   0x0C
 
#define ISAPNP_TAG_RSVDSHORTD   0x0D
 
#define ISAPNP_TAG_VENDORSHORT   0x0E
 
#define ISAPNP_TAG_END   0x0F
 
#define ISAPNP_IS_LARGE_TAG(tag)   ( ( (tag) & 0x80 ) )
 
#define ISAPNP_LARGE_TAG_NAME(tag)   (tag)
 
#define ISAPNP_TAG_MEMRANGE   0x81
 
#define ISAPNP_TAG_ANSISTR   0x82
 
#define ISAPNP_TAG_UNICODESTR   0x83
 
#define ISAPNP_TAG_VENDORLONG   0x84
 
#define ISAPNP_TAG_MEM32RANGE   0x85
 
#define ISAPNP_TAG_FIXEDMEM32RANGE   0x86
 
#define ISAPNP_TAG_RSVDLONG0   0xF0
 
#define ISAPNP_TAG_RSVDLONG1   0xF1
 
#define ISAPNP_TAG_RSVDLONG2   0xF2
 
#define ISAPNP_TAG_RSVDLONG3   0xF3
 
#define ISAPNP_TAG_RSVDLONG4   0xF4
 
#define ISAPNP_TAG_RSVDLONG5   0xF5
 
#define ISAPNP_TAG_RSVDLONG6   0xF6
 
#define ISAPNP_TAG_RSVDLONG7   0xF7
 
#define ISAPNP_TAG_RSVDLONG8   0xF8
 
#define ISAPNP_TAG_RSVDLONG9   0xF9
 
#define ISAPNP_TAG_RSVDLONGA   0xFA
 
#define ISAPNP_TAG_RSVDLONGB   0xFB
 
#define ISAPNP_TAG_RSVDLONGC   0xFC
 
#define ISAPNP_TAG_RSVDLONGD   0xFD
 
#define ISAPNP_TAG_RSVDLONGE   0xFE
 
#define ISAPNP_TAG_RSVDLONGF   0xFF
 
#define ISAPNP_TAG_PSEUDO_NEWBOARD   0x100
 
#define ISAPNP_DRIVERS   __table ( struct isapnp_driver, "isapnp_drivers" )
 ISAPnP driver table. More...
 
#define __isapnp_driver   __table_entry ( ISAPNP_DRIVERS, 01 )
 Declare an ISAPnP driver. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
void isapnp_device_activation (struct isapnp_device *isapnp, int activation)
 Activate or deactivate an ISAPnP device. More...
 
static void activate_isapnp_device (struct isapnp_device *isapnp)
 Activate ISAPnP device. More...
 
static void deactivate_isapnp_device (struct isapnp_device *isapnp)
 Deactivate ISAPnP device. More...
 
static void isapnp_set_drvdata (struct isapnp_device *isapnp, void *priv)
 Set ISAPnP driver-private data. More...
 
static void * isapnp_get_drvdata (struct isapnp_device *isapnp)
 Get ISAPnP driver-private data. More...
 

Variables

uint16_t isapnp_read_port
 ISAPnP Read Port address. More...
 

Macro Definition Documentation

◆ ISAPNP_H

#define ISAPNP_H

Definition at line 44 of file isapnp.h.

◆ ISAPNP_ADDRESS

#define ISAPNP_ADDRESS   0x279

Definition at line 57 of file isapnp.h.

◆ ISAPNP_WRITE_DATA

#define ISAPNP_WRITE_DATA   0xa79

Definition at line 58 of file isapnp.h.

◆ ISAPNP_READ_PORT_MIN

#define ISAPNP_READ_PORT_MIN   0x203

Definition at line 59 of file isapnp.h.

◆ ISAPNP_READ_PORT_START

#define ISAPNP_READ_PORT_START
Value:
0x213 /* ISAPnP spec says 0x203, but
* Linux ISAPnP starts at
* 0x213 with no explanatory
* comment. 0x203 probably
* clashes with something. */

Definition at line 60 of file isapnp.h.

◆ ISAPNP_READ_PORT_MAX

#define ISAPNP_READ_PORT_MAX   0x3ff

Definition at line 65 of file isapnp.h.

◆ ISAPNP_READ_PORT_STEP

#define ISAPNP_READ_PORT_STEP
Value:
0x10 /* Can be any multiple of 4
* according to the spec, but
* since ISA I/O addresses are
* allocated in blocks of 16,
* it makes no sense to use
* any value less than 16.
*/

Definition at line 66 of file isapnp.h.

◆ ISAPNP_CSN_MIN

#define ISAPNP_CSN_MIN   0x01

Definition at line 75 of file isapnp.h.

◆ ISAPNP_CSN_MAX

#define ISAPNP_CSN_MAX   0x0f

Definition at line 76 of file isapnp.h.

◆ ISAPNP_READPORT

#define ISAPNP_READPORT   0x00

Definition at line 79 of file isapnp.h.

◆ ISAPNP_SERIALISOLATION

#define ISAPNP_SERIALISOLATION   0x01

Definition at line 80 of file isapnp.h.

◆ ISAPNP_CONFIGCONTROL

#define ISAPNP_CONFIGCONTROL   0x02

Definition at line 81 of file isapnp.h.

◆ ISAPNP_WAKE

#define ISAPNP_WAKE   0x03

Definition at line 82 of file isapnp.h.

◆ ISAPNP_RESOURCEDATA

#define ISAPNP_RESOURCEDATA   0x04

Definition at line 83 of file isapnp.h.

◆ ISAPNP_STATUS

#define ISAPNP_STATUS   0x05

Definition at line 84 of file isapnp.h.

◆ ISAPNP_CARDSELECTNUMBER

#define ISAPNP_CARDSELECTNUMBER   0x06

Definition at line 85 of file isapnp.h.

◆ ISAPNP_LOGICALDEVICENUMBER

#define ISAPNP_LOGICALDEVICENUMBER   0x07

Definition at line 86 of file isapnp.h.

◆ ISAPNP_ACTIVATE

#define ISAPNP_ACTIVATE   0x30

Definition at line 87 of file isapnp.h.

◆ ISAPNP_IORANGECHECK

#define ISAPNP_IORANGECHECK   0x31

Definition at line 88 of file isapnp.h.

◆ ISAPNP_IOBASE

#define ISAPNP_IOBASE (   n)    ( 0x60 + ( (n) * 2 ) )

Definition at line 89 of file isapnp.h.

◆ ISAPNP_IRQNO

#define ISAPNP_IRQNO (   n)    ( 0x70 + ( (n) * 2 ) )

Definition at line 90 of file isapnp.h.

◆ ISAPNP_IRQTYPE

#define ISAPNP_IRQTYPE (   n)    ( 0x71 + ( (n) * 2 ) )

Definition at line 91 of file isapnp.h.

◆ ISAPNP_CONFIG_RESET

#define ISAPNP_CONFIG_RESET   ( 1 << 0 )

Definition at line 94 of file isapnp.h.

◆ ISAPNP_CONFIG_WAIT_FOR_KEY

#define ISAPNP_CONFIG_WAIT_FOR_KEY   ( 1 << 1 )

Definition at line 95 of file isapnp.h.

◆ ISAPNP_CONFIG_RESET_CSN

#define ISAPNP_CONFIG_RESET_CSN   ( 1 << 2 )

Definition at line 96 of file isapnp.h.

◆ ISAPNP_CONFIG_RESET_DRV

#define ISAPNP_CONFIG_RESET_DRV
Value:
ISAPNP_CONFIG_WAIT_FOR_KEY | \
ISAPNP_CONFIG_RESET_CSN )
#define ISAPNP_CONFIG_RESET
Definition: isapnp.h:94

Definition at line 97 of file isapnp.h.

◆ ISAPNP_LFSR_SEED

#define ISAPNP_LFSR_SEED   0x6a

Definition at line 102 of file isapnp.h.

◆ ISAPNP_IS_SMALL_TAG

#define ISAPNP_IS_SMALL_TAG (   tag)    ( ! ( (tag) & 0x80 ) )

Definition at line 105 of file isapnp.h.

◆ ISAPNP_SMALL_TAG_NAME

#define ISAPNP_SMALL_TAG_NAME (   tag)    ( ( (tag) >> 3 ) & 0xf )

Definition at line 106 of file isapnp.h.

◆ ISAPNP_SMALL_TAG_LEN

#define ISAPNP_SMALL_TAG_LEN (   tag)    ( ( (tag) & 0x7 ) )

Definition at line 107 of file isapnp.h.

◆ ISAPNP_TAG_PNPVERNO

#define ISAPNP_TAG_PNPVERNO   0x01

Definition at line 108 of file isapnp.h.

◆ ISAPNP_TAG_LOGDEVID

#define ISAPNP_TAG_LOGDEVID   0x02

Definition at line 109 of file isapnp.h.

◆ ISAPNP_TAG_COMPATDEVID

#define ISAPNP_TAG_COMPATDEVID   0x03

Definition at line 110 of file isapnp.h.

◆ ISAPNP_TAG_IRQ

#define ISAPNP_TAG_IRQ   0x04

Definition at line 111 of file isapnp.h.

◆ ISAPNP_TAG_DMA

#define ISAPNP_TAG_DMA   0x05

Definition at line 112 of file isapnp.h.

◆ ISAPNP_TAG_STARTDEP

#define ISAPNP_TAG_STARTDEP   0x06

Definition at line 113 of file isapnp.h.

◆ ISAPNP_TAG_ENDDEP

#define ISAPNP_TAG_ENDDEP   0x07

Definition at line 114 of file isapnp.h.

◆ ISAPNP_TAG_IOPORT

#define ISAPNP_TAG_IOPORT   0x08

Definition at line 115 of file isapnp.h.

◆ ISAPNP_TAG_FIXEDIO

#define ISAPNP_TAG_FIXEDIO   0x09

Definition at line 116 of file isapnp.h.

◆ ISAPNP_TAG_RSVDSHORTA

#define ISAPNP_TAG_RSVDSHORTA   0x0A

Definition at line 117 of file isapnp.h.

◆ ISAPNP_TAG_RSVDSHORTB

#define ISAPNP_TAG_RSVDSHORTB   0x0B

Definition at line 118 of file isapnp.h.

◆ ISAPNP_TAG_RSVDSHORTC

#define ISAPNP_TAG_RSVDSHORTC   0x0C

Definition at line 119 of file isapnp.h.

◆ ISAPNP_TAG_RSVDSHORTD

#define ISAPNP_TAG_RSVDSHORTD   0x0D

Definition at line 120 of file isapnp.h.

◆ ISAPNP_TAG_VENDORSHORT

#define ISAPNP_TAG_VENDORSHORT   0x0E

Definition at line 121 of file isapnp.h.

◆ ISAPNP_TAG_END

#define ISAPNP_TAG_END   0x0F

Definition at line 122 of file isapnp.h.

◆ ISAPNP_IS_LARGE_TAG

#define ISAPNP_IS_LARGE_TAG (   tag)    ( ( (tag) & 0x80 ) )

Definition at line 124 of file isapnp.h.

◆ ISAPNP_LARGE_TAG_NAME

#define ISAPNP_LARGE_TAG_NAME (   tag)    (tag)

Definition at line 125 of file isapnp.h.

◆ ISAPNP_TAG_MEMRANGE

#define ISAPNP_TAG_MEMRANGE   0x81

Definition at line 126 of file isapnp.h.

◆ ISAPNP_TAG_ANSISTR

#define ISAPNP_TAG_ANSISTR   0x82

Definition at line 127 of file isapnp.h.

◆ ISAPNP_TAG_UNICODESTR

#define ISAPNP_TAG_UNICODESTR   0x83

Definition at line 128 of file isapnp.h.

◆ ISAPNP_TAG_VENDORLONG

#define ISAPNP_TAG_VENDORLONG   0x84

Definition at line 129 of file isapnp.h.

◆ ISAPNP_TAG_MEM32RANGE

#define ISAPNP_TAG_MEM32RANGE   0x85

Definition at line 130 of file isapnp.h.

◆ ISAPNP_TAG_FIXEDMEM32RANGE

#define ISAPNP_TAG_FIXEDMEM32RANGE   0x86

Definition at line 131 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG0

#define ISAPNP_TAG_RSVDLONG0   0xF0

Definition at line 132 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG1

#define ISAPNP_TAG_RSVDLONG1   0xF1

Definition at line 133 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG2

#define ISAPNP_TAG_RSVDLONG2   0xF2

Definition at line 134 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG3

#define ISAPNP_TAG_RSVDLONG3   0xF3

Definition at line 135 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG4

#define ISAPNP_TAG_RSVDLONG4   0xF4

Definition at line 136 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG5

#define ISAPNP_TAG_RSVDLONG5   0xF5

Definition at line 137 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG6

#define ISAPNP_TAG_RSVDLONG6   0xF6

Definition at line 138 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG7

#define ISAPNP_TAG_RSVDLONG7   0xF7

Definition at line 139 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG8

#define ISAPNP_TAG_RSVDLONG8   0xF8

Definition at line 140 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONG9

#define ISAPNP_TAG_RSVDLONG9   0xF9

Definition at line 141 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGA

#define ISAPNP_TAG_RSVDLONGA   0xFA

Definition at line 142 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGB

#define ISAPNP_TAG_RSVDLONGB   0xFB

Definition at line 143 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGC

#define ISAPNP_TAG_RSVDLONGC   0xFC

Definition at line 144 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGD

#define ISAPNP_TAG_RSVDLONGD   0xFD

Definition at line 145 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGE

#define ISAPNP_TAG_RSVDLONGE   0xFE

Definition at line 146 of file isapnp.h.

◆ ISAPNP_TAG_RSVDLONGF

#define ISAPNP_TAG_RSVDLONGF   0xFF

Definition at line 147 of file isapnp.h.

◆ ISAPNP_TAG_PSEUDO_NEWBOARD

#define ISAPNP_TAG_PSEUDO_NEWBOARD   0x100

Definition at line 148 of file isapnp.h.

◆ ISAPNP_DRIVERS

#define ISAPNP_DRIVERS   __table ( struct isapnp_driver, "isapnp_drivers" )

ISAPnP driver table.

Definition at line 232 of file isapnp.h.

◆ __isapnp_driver

#define __isapnp_driver   __table_entry ( ISAPNP_DRIVERS, 01 )

Declare an ISAPnP driver.

Definition at line 235 of file isapnp.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ isapnp_device_activation()

void isapnp_device_activation ( struct isapnp_device isapnp,
int  activation 
)

Activate or deactivate an ISAPnP device.

Parameters
isapnpISAPnP device
activationTrue to enable, False to disable the device
Return values
None-
Exceptions
None-

This routine simply activates the device in its current configuration, or deactivates the device. It does not attempt any kind of resource arbitration.

Definition at line 554 of file isapnp.c.

555  {
556  /* Wake the card and select the logical device */
558  isapnp_send_key ();
559  isapnp_wake ( isapnp->csn );
560  isapnp_logicaldevice ( isapnp->logdev );
561 
562  /* Activate/deactivate the logical device */
563  isapnp_activate ( activation );
564  isapnp_delay();
565 
566  /* Return all cards to Wait for Key state */
568 
569  DBG ( "ISAPnP %s device %02x:%02x\n",
570  ( activation ? "activated" : "deactivated" ),
571  isapnp->csn, isapnp->logdev );
572 }
static void isapnp_wake(uint8_t csn)
Place a specified card into the Config state.
Definition: isapnp.c:170
static void isapnp_delay(void)
Definition: isapnp.c:218
static void isapnp_logicaldevice(unsigned int logdev)
Definition: isapnp.c:196
static void isapnp_wait_for_key(void)
Enter the Wait for Key state.
Definition: isapnp.c:145
static void isapnp_send_key(void)
Send the ISAPnP initiation key.
Definition: isapnp.c:251
uint8_t csn
Card Select Number.
Definition: isapnp.h:195
uint8_t logdev
Logical Device ID.
Definition: isapnp.h:197
static void isapnp_activate(unsigned int logdev)
Definition: isapnp.c:200
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498

References isapnp_device::csn, DBG, isapnp_activate(), isapnp_delay(), isapnp_logicaldevice(), isapnp_send_key(), isapnp_wait_for_key(), isapnp_wake(), and isapnp_device::logdev.

Referenced by activate_isapnp_device(), and deactivate_isapnp_device().

◆ activate_isapnp_device()

static void activate_isapnp_device ( struct isapnp_device isapnp)
inlinestatic

Activate ISAPnP device.

Parameters
isapnpISAPnP device

Definition at line 247 of file isapnp.h.

247  {
248  isapnp_device_activation ( isapnp, 1 );
249 }
void isapnp_device_activation(struct isapnp_device *isapnp, int activation)
Activate or deactivate an ISAPnP device.
Definition: isapnp.c:554

References isapnp_device_activation().

Referenced by t515_probe().

◆ deactivate_isapnp_device()

static void deactivate_isapnp_device ( struct isapnp_device isapnp)
inlinestatic

Deactivate ISAPnP device.

Parameters
isapnpISAPnP device

Definition at line 256 of file isapnp.h.

256  {
257  isapnp_device_activation ( isapnp, 0 );
258 }
void isapnp_device_activation(struct isapnp_device *isapnp, int activation)
Activate or deactivate an ISAPnP device.
Definition: isapnp.c:554

References isapnp_device_activation().

Referenced by t515_disable().

◆ isapnp_set_drvdata()

static void isapnp_set_drvdata ( struct isapnp_device isapnp,
void *  priv 
)
inlinestatic

Set ISAPnP driver-private data.

Parameters
isapnpISAPnP device
privPrivate data

Definition at line 266 of file isapnp.h.

267  {
268  isapnp->priv = priv;
269 }
void * priv
Driver-private data.
Definition: isapnp.h:205
static struct tlan_private * priv
Definition: tlan.c:224

References isapnp_device::priv, and priv.

Referenced by legacy_isapnp_set_drvdata().

◆ isapnp_get_drvdata()

static void* isapnp_get_drvdata ( struct isapnp_device isapnp)
inlinestatic

Get ISAPnP driver-private data.

Parameters
isapnpISAPnP device
Return values
privPrivate data

Definition at line 277 of file isapnp.h.

277  {
278  return isapnp->priv;
279 }
void * priv
Driver-private data.
Definition: isapnp.h:205

References isapnp_device::priv.

Referenced by legacy_isapnp_get_drvdata().

Variable Documentation

◆ isapnp_read_port

uint16_t isapnp_read_port

ISAPnP Read Port address.

ROM prefix may be able to set this address, which is why this is non-static.

Definition at line 76 of file isapnp.c.

Referenced by isapnp_isolate(), isapnp_read_data(), isapnp_set_read_port(), isapnp_try_isolate(), isapnpbus_probe(), and pxenv_start_undi().