Back to index

lshw  02.16
Classes | Defines | Typedefs | Functions File Reference
#include "version.h"
#include "pcmcia-legacy.h"
#include "osutils.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

Go to the source code of this file.


struct  cs_status_t
struct  config_info_t
struct  bind_info_t
struct  cistpl_checksum_t
struct  cistpl_altstr_t
struct  cistpl_device_t
struct  cistpl_device_o_t
struct  cistpl_vers_1_t
struct  cistpl_jedec_t
struct  cistpl_manfid_t
struct  cistpl_funcid_t
struct  cistpl_funce_t
struct  cistpl_serial_t
struct  cistpl_modem_cap_t
struct  cistpl_data_serv_t
struct  cistpl_fax_serv_t
struct  cistpl_voice_serv_t
struct  cistpl_lan_tech_t
struct  cistpl_lan_speed_t
struct  cistpl_lan_media_t
struct  cistpl_lan_node_id_t
struct  cistpl_lan_connector_t
struct  cistpl_ide_interface_t
struct  cistpl_ide_feature_t
struct  cistpl_bar_t
struct  cistpl_config_t
struct  cistpl_power_t
struct  cistpl_timing_t
struct  cistpl_io_t
struct  cistpl_irq_t
struct  cistpl_mem_t
struct  cistpl_cftable_entry_t
struct  cistpl_cftable_entry_cb_t
struct  cistpl_device_geo_t
struct  cistpl_vers_2_t
struct  cistpl_org_t
struct  cistpl_format_t
union  cisparse_t
struct  tuple_t
struct  tuple_parse_t
union  ds_ioctl_arg_t
struct  cistpl_device_geo_t.geo


#define VARLIBPCMCIASTAB   "/var/lib/pcmcia/stab"
#define CS_EVENT_CARD_DETECT   0x000080
#define DEV_NAME_LEN   32
#define BIND_FN_ALL   0xff
#define CISTPL_NULL   0x00
#define CISTPL_DEVICE   0x01
#define CISTPL_LONGLINK_CB   0x02
#define CISTPL_INDIRECT   0x03
#define CISTPL_CONFIG_CB   0x04
#define CISTPL_LONGLINK_MFC   0x06
#define CISTPL_BAR   0x07
#define CISTPL_PWR_MGMNT   0x08
#define CISTPL_EXTDEVICE   0x09
#define CISTPL_CHECKSUM   0x10
#define CISTPL_LONGLINK_A   0x11
#define CISTPL_LONGLINK_C   0x12
#define CISTPL_LINKTARGET   0x13
#define CISTPL_NO_LINK   0x14
#define CISTPL_VERS_1   0x15
#define CISTPL_ALTSTR   0x16
#define CISTPL_DEVICE_A   0x17
#define CISTPL_JEDEC_C   0x18
#define CISTPL_JEDEC_A   0x19
#define CISTPL_CONFIG   0x1a
#define CISTPL_DEVICE_OC   0x1c
#define CISTPL_DEVICE_OA   0x1d
#define CISTPL_DEVICE_GEO   0x1e
#define CISTPL_DEVICE_GEO_A   0x1f
#define CISTPL_MANFID   0x20
#define CISTPL_FUNCID   0x21
#define CISTPL_FUNCE   0x22
#define CISTPL_SWIL   0x23
#define CISTPL_END   0xff
#define CISTPL_VERS_2   0x40
#define CISTPL_FORMAT   0x41
#define CISTPL_GEOMETRY   0x42
#define CISTPL_BYTEORDER   0x43
#define CISTPL_DATE   0x44
#define CISTPL_BATTERY   0x45
#define CISTPL_FORMAT_A   0x47
#define CISTPL_ORG   0x46
#define CISTPL_SPCL   0x90
#define CISTPL_MFC_ATTR   0x00
#define CISTPL_MFC_COMMON   0x01
#define CISTPL_DTYPE_NULL   0x00
#define CISTPL_DTYPE_ROM   0x01
#define CISTPL_DTYPE_OTPROM   0x02
#define CISTPL_DTYPE_EPROM   0x03
#define CISTPL_DTYPE_EEPROM   0x04
#define CISTPL_DTYPE_FLASH   0x05
#define CISTPL_DTYPE_SRAM   0x06
#define CISTPL_DTYPE_DRAM   0x07
#define CISTPL_DTYPE_EXTEND   0x0e
#define CISTPL_DEVICE_MWAIT   0x01
#define CISTPL_DEVICE_3VCC   0x02
#define CISTPL_FUNCID_MULTI   0x00
#define CISTPL_FUNCID_FIXED   0x04
#define CISTPL_FUNCID_VIDEO   0x05
#define CISTPL_FUNCID_AIMS   0x07
#define CISTPL_FUNCID_SCSI   0x08
#define CISTPL_SYSINIT_POST   0x01
#define CISTPL_SYSINIT_ROM   0x02
#define CISTPL_SERIAL_UART_8250   0x00
#define CISTPL_SERIAL_UART_16450   0x01
#define CISTPL_SERIAL_UART_16550   0x02
#define CISTPL_SERIAL_UART_8251   0x03
#define CISTPL_SERIAL_UART_8530   0x04
#define CISTPL_SERIAL_UART_85230   0x05
#define CISTPL_SERIAL_UART_5BIT   0x01
#define CISTPL_SERIAL_UART_6BIT   0x02
#define CISTPL_SERIAL_UART_7BIT   0x04
#define CISTPL_SERIAL_UART_8BIT   0x08
#define CISTPL_SERIAL_MOD_103   0x01
#define CISTPL_SERIAL_MOD_V21   0x02
#define CISTPL_SERIAL_MOD_V23   0x04
#define CISTPL_SERIAL_MOD_V22   0x08
#define CISTPL_SERIAL_MOD_212A   0x10
#define CISTPL_SERIAL_MOD_V22BIS   0x20
#define CISTPL_SERIAL_MOD_V26   0x40
#define CISTPL_SERIAL_MOD_V26BIS   0x80
#define CISTPL_SERIAL_MOD_V27BIS   0x01
#define CISTPL_SERIAL_MOD_V29   0x02
#define CISTPL_SERIAL_MOD_V32   0x04
#define CISTPL_SERIAL_MOD_V32BIS   0x08
#define CISTPL_SERIAL_MOD_V34   0x10
#define CISTPL_SERIAL_ERR_MNP2_4   0x01
#define CISTPL_SERIAL_ERR_V42_LAPM   0x02
#define CISTPL_SERIAL_CMPR_V42BIS   0x01
#define CISTPL_SERIAL_CMPR_MNP5   0x02
#define CISTPL_SERIAL_CMD_AT1   0x01
#define CISTPL_SERIAL_CMD_AT2   0x02
#define CISTPL_SERIAL_CMD_AT3   0x04
#define CISTPL_SERIAL_CMD_V25BIS   0x10
#define CISTPL_SERIAL_CMD_V25A   0x20
#define CISTPL_FUNCE_LAN_TECH   0x01
#define CISTPL_LAN_TECH_FDDI   0x05
#define CISTPL_LAN_TECH_ATM   0x06
#define CISTPL_LAN_MEDIA_UTP   0x01
#define CISTPL_LAN_MEDIA_STP   0x02
#define CISTPL_LAN_MEDIA_900MHZ   0x06
#define CISTPL_LAN_MEDIA_2GHZ   0x07
#define CISTPL_LAN_MEDIA_5GHZ   0x08
#define CISTPL_LAN_MEDIA_PTP_IR   0x0a
#define CISTPL_IDE_SILICON   0x04
#define CISTPL_IDE_UNIQUE   0x08
#define CISTPL_IDE_DUAL   0x10
#define CISTPL_IDE_HAS_SLEEP   0x01
#define CISTPL_IDE_HAS_IDLE   0x04
#define CISTPL_IDE_LOW_POWER   0x08
#define CISTPL_IDE_HAS_INDEX   0x20
#define CISTPL_IDE_IOIS16   0x40
#define CISTPL_BAR_SPACE   0x07
#define CISTPL_BAR_SPACE_IO   0x10
#define CISTPL_BAR_PREFETCH   0x20
#define CISTPL_BAR_1MEG_MAP   0x80
#define CISTPL_POWER_HIGHZ_OK   0x01
#define CISTPL_IO_LINES_MASK   0x1f
#define CISTPL_IO_8BIT   0x20
#define CISTPL_IO_16BIT   0x40
#define CISTPL_IO_RANGE   0x80
#define CISTPL_IO_MAX_WIN   16
#define CISTPL_MEM_MAX_WIN   8
#define CISTPL_CFTABLE_BVDS   0x0002
#define CISTPL_CFTABLE_WP   0x0004
#define CISTPL_CFTABLE_RDYBSY   0x0008
#define CISTPL_CFTABLE_MWAIT   0x0010
#define CISTPL_CFTABLE_AUDIO   0x0800
#define CISTPL_CFTABLE_MASTER   0x000100
#define CISTPL_CFTABLE_PARITY   0x000800
#define CISTPL_CFTABLE_WAIT   0x001000
#define CISTPL_CFTABLE_SERR   0x002000
#define CISTPL_CFTABLE_FAST_BACK   0x004000
#define CISTPL_CFTABLE_PWM_AUDIO   0x020000
#define CISTPL_ORG_FS   0x00
#define CISTPL_ORG_APPSPEC   0x01
#define CISTPL_ORG_XIP   0x02
#define CISTPL_FORMAT_DISK   0x00
#define CISTPL_FORMAT_MEM   0x01
#define CISTPL_EDC_NONE   0x00
#define CISTPL_EDC_CKSUM   0x01
#define CISTPL_EDC_CRC   0x02
#define CISTPL_EDC_PCC   0x03
#define TUPLE_RETURN_COMMON   0x02
#define DS_GET_CARD_SERVICES_INFO   _IOR ('d', 1, servinfo_t)
#define DS_GET_CONFIGURATION_INFO   _IOWR('d', 3, config_info_t)
#define DS_GET_FIRST_TUPLE   _IOWR('d', 4, tuple_t)
#define DS_GET_NEXT_TUPLE   _IOWR('d', 5, tuple_t)
#define DS_GET_TUPLE_DATA   _IOWR('d', 6, tuple_parse_t)
#define DS_PARSE_TUPLE   _IOWR('d', 7, tuple_parse_t)
#define DS_GET_STATUS   _IOWR('d', 9, cs_status_t)
#define DS_BIND_REQUEST   _IOWR('d', 60, bind_info_t)
#define DS_GET_DEVICE_INFO   _IOWR('d', 61, bind_info_t)
#define DS_GET_NEXT_DEVICE   _IOWR('d', 62, bind_info_t)
#define MAX_SOCK   8


typedef u_short ioaddr_t
typedef u_char cisdata_t
typedef u_int event_t
typedef struct cs_status_t cs_status_t
typedef struct config_info_t config_info_t
typedef char dev_info_t [DEV_NAME_LEN]
typedef struct bind_info_t bind_info_t
typedef struct cistpl_longlink_t cistpl_longlink_t
typedef struct cistpl_checksum_t cistpl_checksum_t
typedef struct
typedef struct cistpl_altstr_t cistpl_altstr_t
typedef struct cistpl_device_t cistpl_device_t
typedef struct cistpl_device_o_t cistpl_device_o_t
typedef struct cistpl_vers_1_t cistpl_vers_1_t
typedef struct cistpl_jedec_t cistpl_jedec_t
typedef struct cistpl_manfid_t cistpl_manfid_t
typedef struct cistpl_funcid_t cistpl_funcid_t
typedef struct cistpl_funce_t cistpl_funce_t
typedef struct cistpl_serial_t cistpl_serial_t
typedef struct cistpl_modem_cap_t cistpl_modem_cap_t
typedef struct cistpl_data_serv_t cistpl_data_serv_t
typedef struct cistpl_fax_serv_t cistpl_fax_serv_t
typedef struct cistpl_voice_serv_t cistpl_voice_serv_t
typedef struct cistpl_lan_tech_t cistpl_lan_tech_t
typedef struct cistpl_lan_speed_t cistpl_lan_speed_t
typedef struct cistpl_lan_media_t cistpl_lan_media_t
typedef struct cistpl_lan_node_id_t cistpl_lan_node_id_t
typedef struct
typedef struct
typedef struct cistpl_ide_feature_t cistpl_ide_feature_t
typedef struct cistpl_bar_t cistpl_bar_t
typedef struct cistpl_config_t cistpl_config_t
typedef struct cistpl_power_t cistpl_power_t
typedef struct cistpl_timing_t cistpl_timing_t
typedef struct cistpl_io_t cistpl_io_t
typedef struct cistpl_irq_t cistpl_irq_t
typedef struct cistpl_mem_t cistpl_mem_t
typedef struct
typedef struct
typedef struct cistpl_device_geo_t cistpl_device_geo_t
typedef struct cistpl_vers_2_t cistpl_vers_2_t
typedef struct cistpl_org_t cistpl_org_t
typedef struct cistpl_format_t cistpl_format_t
typedef union cisparse_t cisparse_t
typedef struct tuple_t tuple_t
typedef struct tuple_parse_t tuple_parse_t
typedef union ds_ioctl_arg_t ds_ioctl_arg_t


 __ID ("@(#) $Id: 2433 2012-01-10 22:01:30Z lyonel $")
static int lookup_dev (const char *name)
static string pcmcia_handle (int socket)
static int get_tuple (int fd, cisdata_t code, ds_ioctl_arg_t &arg)
static bool pcmcia_ident (int socket, int fd, hwNode *parent)
static bool is_cardbus (const hwNode *n)
static hwNodefind_pcmciaparent (int slot, hwNode &root)
bool scan_pcmcialegacy (hwNode &n)

Class Documentation

struct cs_status_t

Definition at line 30 of file

Class Members
event_t CardState
u_char Function
event_t SocketState
struct config_info_t

Definition at line 42 of file

Class Members
u_int AssignedIRQ
u_int Attributes
u_int Attributes1
u_int Attributes2
ioaddr_t BasePort1
ioaddr_t BasePort2
u_int CardValues
u_int ConfigBase
u_char Copy
u_char ExtStatus
u_char Function
u_int IntType
u_int IOAddrLines
u_int IRQAttributes
ioaddr_t NumPorts1
ioaddr_t NumPorts2
u_char Option
u_char Pin
u_int Present
u_char Status
u_int Vcc
u_int Vpp1
u_int Vpp2
struct bind_info_t

Definition at line 69 of file

Class Members
dev_info_t dev_info
u_char function
void * instance
u_short major
u_short minor
char name
void * next
struct cistpl_longlink_t

Definition at line 130 of file

Class Members
u_int addr
struct cistpl_checksum_t

Definition at line 138 of file

Class Members
u_short addr
u_short len
u_char sum
struct cistpl_longlink_mfc_t

Definition at line 152 of file

Class Members
struct cistpl_longlink_mfc_t fn
u_char nfn
struct cistpl_altstr_t

Definition at line 168 of file

Class Members
u_char ns
u_char ofs
char str
struct cistpl_device_t

Definition at line 191 of file

Class Members
struct cistpl_device_t dev
u_char ndev
struct cistpl_device_o_t

Definition at line 210 of file

Collaboration diagram for cistpl_device_o_t:
Class Members
cistpl_device_t device
u_char flags
struct cistpl_vers_1_t

Definition at line 221 of file

Class Members
u_char major
u_char minor
u_char ns
u_char ofs
char str
struct cistpl_jedec_t

Definition at line 233 of file

Class Members
struct cistpl_jedec_t id
u_char nid
struct cistpl_manfid_t

Definition at line 247 of file

Class Members
u_short card
u_short manf
struct cistpl_funcid_t

Definition at line 269 of file

Class Members
u_char func
u_char sysinit
struct cistpl_funce_t

Definition at line 278 of file

Class Members
u_char data
u_char type
struct cistpl_serial_t

Definition at line 326 of file

Class Members
u_char uart_cap_0
u_char uart_cap_1
u_char uart_type
struct cistpl_modem_cap_t

Definition at line 336 of file

Class Members
u_char cmd_buf
u_char flow
u_char rcv_buf_0
u_char rcv_buf_1
u_char rcv_buf_2
u_char xmit_buf_0
u_char xmit_buf_1
u_char xmit_buf_2
struct cistpl_data_serv_t

Definition at line 375 of file

Class Members
u_char ccitt_code
u_char cmd_protocol
u_char compression
u_char encrypt
u_char error_control
u_char escape
u_char max_data_0
u_char max_data_1
u_char misc_features
u_char modulation_0
u_char modulation_1
struct cistpl_fax_serv_t

Definition at line 393 of file

Class Members
u_char ccitt_code
u_char encrypt
u_char features_0
u_char features_1
u_char max_data_0
u_char max_data_1
u_char modulation
struct cistpl_voice_serv_t

Definition at line 407 of file

Class Members
u_char max_data_0
u_char max_data_1
struct cistpl_lan_tech_t

Definition at line 437 of file

Class Members
u_char tech
struct cistpl_lan_speed_t

Definition at line 445 of file

Class Members
u_int speed
struct cistpl_lan_media_t

Definition at line 465 of file

Class Members
u_char media
struct cistpl_lan_node_id_t

Definition at line 473 of file

Class Members
u_char id
u_char nb
struct cistpl_lan_connector_t

Definition at line 482 of file

Class Members
u_char code
struct cistpl_ide_interface_t

Definition at line 498 of file

Class Members
u_char interface
struct cistpl_ide_feature_t

Definition at line 520 of file

Class Members
u_char feature1
u_char feature2
struct cistpl_bar_t

Definition at line 545 of file

Class Members
u_char attr
u_int size
struct cistpl_config_t

Definition at line 554 of file

Class Members
u_int base
u_char last_idx
u_int rmask
u_char subtuples
struct cistpl_power_t

Definition at line 577 of file

Class Members
u_char flags
u_int param
u_char present
struct cistpl_timing_t

Definition at line 587 of file

Class Members
u_int rdyscale
u_int ready
u_int reserved
u_int rsvscale
u_int wait
u_int waitscale
struct cistpl_io_t

Definition at line 604 of file

Class Members
u_char flags
u_char nwin
struct cistpl_io_t win
struct cistpl_irq_t

Definition at line 619 of file

Class Members
u_int IRQInfo1
u_int IRQInfo2
struct cistpl_mem_t

Definition at line 630 of file

Class Members
u_char flags
u_char nwin
struct cistpl_mem_t win
struct cistpl_cftable_entry_t

Definition at line 655 of file

Collaboration diagram for cistpl_cftable_entry_t:
Class Members
u_short flags
u_char index
u_char interface
cistpl_io_t io
cistpl_irq_t irq
cistpl_mem_t mem
u_char subtuples
cistpl_timing_t timing
cistpl_power_t vcc
cistpl_power_t vpp1
cistpl_power_t vpp2
struct cistpl_cftable_entry_cb_t

Definition at line 681 of file

Collaboration diagram for cistpl_cftable_entry_cb_t:
Class Members
u_int flags
u_char index
u_char io
cistpl_irq_t irq
u_char mem
u_char subtuples
cistpl_power_t vcc
cistpl_power_t vpp1
cistpl_power_t vpp2
struct cistpl_device_geo_t

Definition at line 695 of file

Class Members
struct cistpl_device_geo_t geo
u_char ngeo
struct cistpl_vers_2_t

Definition at line 713 of file

Class Members
u_char comply
u_short dindex
u_char info
u_char nhdr
char str
u_char vendor
u_char vers
u_char vspec8
u_char vspec9
struct cistpl_org_t

Definition at line 727 of file

Class Members
u_char data_org
char desc
struct cistpl_format_t

Definition at line 740 of file

Class Members
u_char edc
u_int length
u_int offset
u_char type
union cisparse_t

Definition at line 759 of file

Collaboration diagram for cisparse_t:
Class Members
cistpl_altstr_t altstr
cistpl_bar_t bar
cistpl_cftable_entry_t cftable_entry
cistpl_cftable_entry_cb_t cftable_entry_cb
cistpl_checksum_t checksum
cistpl_config_t config
cistpl_device_t device
cistpl_device_geo_t device_geo
cistpl_format_t format
cistpl_funce_t funce
cistpl_funcid_t funcid
cistpl_jedec_t jedec
cistpl_longlink_t longlink
cistpl_longlink_mfc_t longlink_mfc
cistpl_manfid_t manfid
cistpl_org_t org
cistpl_vers_2_t vers_2
cistpl_vers_1_t version_1
struct tuple_t

Definition at line 784 of file

Class Members
u_int Attributes
u_int CISOffset
cisdata_t DesiredTuple
u_int Flags
u_int LinkOffset
cisdata_t TupleCode
cisdata_t * TupleData
cisdata_t TupleDataLen
cisdata_t TupleDataMax
cisdata_t TupleLink
cisdata_t TupleOffset
struct tuple_parse_t

Definition at line 802 of file

Collaboration diagram for tuple_parse_t:
Class Members
cisdata_t data
cisparse_t parse
tuple_t tuple
union ds_ioctl_arg_t

Definition at line 812 of file

Collaboration diagram for ds_ioctl_arg_t:
Class Members
bind_info_t bind_info
config_info_t config
tuple_t tuple
tuple_parse_t tuple_parse
struct cistpl_longlink_mfc_t.fn

Definition at line 155 of file

Class Members
u_int addr
u_char space

Definition at line 194 of file

Class Members
u_int size
u_int speed
u_char type
u_char wp

Definition at line 236 of file

Class Members
u_char info
u_char mfr

Definition at line 608 of file

Class Members
u_int base
u_int len

Definition at line 634 of file

Class Members
u_int card_addr
u_int host_addr
u_int len
struct cistpl_device_geo_t.geo

Definition at line 698 of file

Class Members
u_char buswidth
u_int erase_block
u_int interleave
u_int partition
u_int read_block
u_int write_block

Define Documentation

#define BIND_FN_ALL   0xff

Definition at line 85 of file

#define CISTPL_ALTSTR   0x16

Definition at line 103 of file

#define CISTPL_BAR   0x07

Definition at line 94 of file

#define CISTPL_BAR_1MEG_MAP   0x80

Definition at line 543 of file


Definition at line 542 of file

#define CISTPL_BAR_PREFETCH   0x20

Definition at line 541 of file

#define CISTPL_BAR_SPACE   0x07

Definition at line 539 of file

#define CISTPL_BAR_SPACE_IO   0x10

Definition at line 540 of file

#define CISTPL_BATTERY   0x45

Definition at line 124 of file

#define CISTPL_BYTEORDER   0x43

Definition at line 122 of file

#define CISTPL_CFTABLE_AUDIO   0x0800

Definition at line 651 of file


Definition at line 678 of file

#define CISTPL_CFTABLE_BVDS   0x0002

Definition at line 647 of file


Definition at line 646 of file


Definition at line 108 of file


Definition at line 92 of file

#define CISTPL_CFTABLE_FAST_BACK   0x004000

Definition at line 677 of file


Definition at line 672 of file

#define CISTPL_CFTABLE_MASTER   0x000100

Definition at line 671 of file

#define CISTPL_CFTABLE_MWAIT   0x0010

Definition at line 650 of file

#define CISTPL_CFTABLE_PARITY   0x000800

Definition at line 674 of file

#define CISTPL_CFTABLE_PWM_AUDIO   0x020000

Definition at line 679 of file


Definition at line 653 of file

#define CISTPL_CFTABLE_RDYBSY   0x0008

Definition at line 649 of file


Definition at line 652 of file

#define CISTPL_CFTABLE_SERR   0x002000

Definition at line 676 of file


Definition at line 673 of file

#define CISTPL_CFTABLE_WAIT   0x001000

Definition at line 675 of file

#define CISTPL_CFTABLE_WP   0x0004

Definition at line 648 of file

#define CISTPL_CHECKSUM   0x10

Definition at line 97 of file

#define CISTPL_CONFIG   0x1a

Definition at line 107 of file

#define CISTPL_CONFIG_CB   0x04

Definition at line 91 of file

#define CISTPL_DATE   0x44

Definition at line 123 of file

#define CISTPL_DEVICE   0x01

Definition at line 88 of file

#define CISTPL_DEVICE_3VCC   0x02

Definition at line 208 of file

#define CISTPL_DEVICE_A   0x17

Definition at line 104 of file

#define CISTPL_DEVICE_GEO   0x1e

Definition at line 111 of file

#define CISTPL_DEVICE_GEO_A   0x1f

Definition at line 112 of file

#define CISTPL_DEVICE_MWAIT   0x01

Definition at line 207 of file

#define CISTPL_DEVICE_OA   0x1d

Definition at line 110 of file

#define CISTPL_DEVICE_OC   0x1c

Definition at line 109 of file

#define CISTPL_DTYPE_DRAM   0x07

Definition at line 185 of file

#define CISTPL_DTYPE_EEPROM   0x04

Definition at line 182 of file

#define CISTPL_DTYPE_EPROM   0x03

Definition at line 181 of file

#define CISTPL_DTYPE_EXTEND   0x0e

Definition at line 187 of file

#define CISTPL_DTYPE_FLASH   0x05

Definition at line 183 of file


Definition at line 186 of file

#define CISTPL_DTYPE_NULL   0x00

Definition at line 178 of file

#define CISTPL_DTYPE_OTPROM   0x02

Definition at line 180 of file

#define CISTPL_DTYPE_ROM   0x01

Definition at line 179 of file

#define CISTPL_DTYPE_SRAM   0x06

Definition at line 184 of file

#define CISTPL_EDC_CKSUM   0x01

Definition at line 755 of file

#define CISTPL_EDC_CRC   0x02

Definition at line 756 of file

#define CISTPL_EDC_NONE   0x00

Definition at line 754 of file

#define CISTPL_EDC_PCC   0x03

Definition at line 757 of file

#define CISTPL_END   0xff

Definition at line 117 of file

#define CISTPL_EXTDEVICE   0x09

Definition at line 96 of file

#define CISTPL_FORMAT   0x41

Definition at line 120 of file

#define CISTPL_FORMAT_A   0x47

Definition at line 125 of file

#define CISTPL_FORMAT_DISK   0x00

Definition at line 751 of file

#define CISTPL_FORMAT_MEM   0x01

Definition at line 752 of file

#define CISTPL_FUNCE   0x22

Definition at line 115 of file


Definition at line 529 of file


Definition at line 530 of file


Definition at line 531 of file


Definition at line 426 of file


Definition at line 424 of file


Definition at line 425 of file


Definition at line 423 of file

#define CISTPL_FUNCE_LAN_TECH   0x01

Definition at line 422 of file


Definition at line 294 of file


Definition at line 298 of file


Definition at line 299 of file


Definition at line 300 of file


Definition at line 293 of file


Definition at line 301 of file


Definition at line 302 of file


Definition at line 303 of file


Definition at line 295 of file


Definition at line 296 of file


Definition at line 297 of file

#define CISTPL_FUNCID   0x21

Definition at line 114 of file

#define CISTPL_FUNCID_AIMS   0x07

Definition at line 263 of file

#define CISTPL_FUNCID_FIXED   0x04

Definition at line 260 of file


Definition at line 257 of file

#define CISTPL_FUNCID_MULTI   0x00

Definition at line 256 of file


Definition at line 262 of file


Definition at line 259 of file

#define CISTPL_FUNCID_SCSI   0x08

Definition at line 264 of file


Definition at line 258 of file

#define CISTPL_FUNCID_VIDEO   0x05

Definition at line 261 of file

#define CISTPL_GEOMETRY   0x42

Definition at line 121 of file

#define CISTPL_IDE_DUAL   0x10

Definition at line 509 of file

#define CISTPL_IDE_HAS_IDLE   0x04

Definition at line 514 of file

#define CISTPL_IDE_HAS_INDEX   0x20

Definition at line 517 of file

#define CISTPL_IDE_HAS_SLEEP   0x01

Definition at line 512 of file


Definition at line 513 of file


Definition at line 496 of file

#define CISTPL_IDE_IOIS16   0x40

Definition at line 518 of file

#define CISTPL_IDE_LOW_POWER   0x08

Definition at line 515 of file


Definition at line 516 of file

#define CISTPL_IDE_SILICON   0x04

Definition at line 507 of file

#define CISTPL_IDE_UNIQUE   0x08

Definition at line 508 of file

#define CISTPL_INDIRECT   0x03

Definition at line 90 of file

#define CISTPL_IO_16BIT   0x40

Definition at line 599 of file

#define CISTPL_IO_8BIT   0x20

Definition at line 598 of file

#define CISTPL_IO_LINES_MASK   0x1f

Definition at line 597 of file

#define CISTPL_IO_MAX_WIN   16

Definition at line 602 of file

#define CISTPL_IO_RANGE   0x80

Definition at line 600 of file

#define CISTPL_JEDEC_A   0x19

Definition at line 106 of file

#define CISTPL_JEDEC_C   0x18

Definition at line 105 of file

#define CISTPL_LAN_MEDIA_2GHZ   0x07

Definition at line 460 of file

#define CISTPL_LAN_MEDIA_5GHZ   0x08

Definition at line 461 of file

#define CISTPL_LAN_MEDIA_900MHZ   0x06

Definition at line 459 of file


Definition at line 462 of file


Definition at line 458 of file

#define CISTPL_LAN_MEDIA_PTP_IR   0x0a

Definition at line 463 of file

#define CISTPL_LAN_MEDIA_STP   0x02

Definition at line 455 of file


Definition at line 457 of file


Definition at line 456 of file

#define CISTPL_LAN_MEDIA_UTP   0x01

Definition at line 454 of file


Definition at line 429 of file

#define CISTPL_LAN_TECH_ATM   0x06

Definition at line 434 of file


Definition at line 430 of file

#define CISTPL_LAN_TECH_FDDI   0x05

Definition at line 433 of file


Definition at line 432 of file


Definition at line 431 of file


Definition at line 435 of file

#define CISTPL_LINKTARGET   0x13

Definition at line 100 of file

#define CISTPL_LONGLINK_A   0x11

Definition at line 98 of file

#define CISTPL_LONGLINK_C   0x12

Definition at line 99 of file

#define CISTPL_LONGLINK_CB   0x02

Definition at line 89 of file

#define CISTPL_LONGLINK_MFC   0x06

Definition at line 93 of file

#define CISTPL_MANFID   0x20

Definition at line 113 of file


Definition at line 166 of file


Definition at line 189 of file


Definition at line 148 of file

#define CISTPL_MEM_MAX_WIN   8

Definition at line 628 of file

#define CISTPL_MFC_ATTR   0x00

Definition at line 149 of file

#define CISTPL_MFC_COMMON   0x01

Definition at line 150 of file

#define CISTPL_NO_LINK   0x14

Definition at line 101 of file

#define CISTPL_NULL   0x00

Definition at line 87 of file

#define CISTPL_ORG   0x46

Definition at line 127 of file

#define CISTPL_ORG_APPSPEC   0x01

Definition at line 737 of file

#define CISTPL_ORG_FS   0x00

Definition at line 736 of file

#define CISTPL_ORG_XIP   0x02

Definition at line 738 of file

#define CISTPL_POWER_HIGHZ_OK   0x01

Definition at line 574 of file


Definition at line 575 of file


Definition at line 570 of file


Definition at line 572 of file


Definition at line 571 of file


Definition at line 569 of file


Definition at line 568 of file


Definition at line 567 of file


Definition at line 566 of file

#define CISTPL_PWR_MGMNT   0x08

Definition at line 95 of file

#define CISTPL_SERIAL_CMD_AT1   0x01

Definition at line 367 of file

#define CISTPL_SERIAL_CMD_AT2   0x02

Definition at line 368 of file

#define CISTPL_SERIAL_CMD_AT3   0x04

Definition at line 369 of file


Definition at line 373 of file


Definition at line 370 of file

#define CISTPL_SERIAL_CMD_V25A   0x20

Definition at line 372 of file

#define CISTPL_SERIAL_CMD_V25BIS   0x10

Definition at line 371 of file

#define CISTPL_SERIAL_CMPR_MNP5   0x02

Definition at line 365 of file

#define CISTPL_SERIAL_CMPR_V42BIS   0x01

Definition at line 364 of file

#define CISTPL_SERIAL_ERR_MNP2_4   0x01

Definition at line 361 of file

#define CISTPL_SERIAL_ERR_V42_LAPM   0x02

Definition at line 362 of file

#define CISTPL_SERIAL_MOD_103   0x01

Definition at line 347 of file

#define CISTPL_SERIAL_MOD_212A   0x10

Definition at line 351 of file

#define CISTPL_SERIAL_MOD_V21   0x02

Definition at line 348 of file

#define CISTPL_SERIAL_MOD_V22   0x08

Definition at line 350 of file

#define CISTPL_SERIAL_MOD_V22BIS   0x20

Definition at line 352 of file

#define CISTPL_SERIAL_MOD_V23   0x04

Definition at line 349 of file

#define CISTPL_SERIAL_MOD_V26   0x40

Definition at line 353 of file

#define CISTPL_SERIAL_MOD_V26BIS   0x80

Definition at line 354 of file

#define CISTPL_SERIAL_MOD_V27BIS   0x01

Definition at line 355 of file

#define CISTPL_SERIAL_MOD_V29   0x02

Definition at line 356 of file

#define CISTPL_SERIAL_MOD_V32   0x04

Definition at line 357 of file

#define CISTPL_SERIAL_MOD_V32BIS   0x08

Definition at line 358 of file

#define CISTPL_SERIAL_MOD_V34   0x10

Definition at line 359 of file

#define CISTPL_SERIAL_UART_16450   0x01

Definition at line 307 of file

#define CISTPL_SERIAL_UART_16550   0x02

Definition at line 308 of file


Definition at line 322 of file


Definition at line 324 of file

#define CISTPL_SERIAL_UART_5BIT   0x01

Definition at line 318 of file

#define CISTPL_SERIAL_UART_6BIT   0x02

Definition at line 319 of file

#define CISTPL_SERIAL_UART_7BIT   0x04

Definition at line 320 of file

#define CISTPL_SERIAL_UART_8250   0x00

Definition at line 306 of file

#define CISTPL_SERIAL_UART_8251   0x03

Definition at line 309 of file

#define CISTPL_SERIAL_UART_85230   0x05

Definition at line 311 of file

#define CISTPL_SERIAL_UART_8530   0x04

Definition at line 310 of file

#define CISTPL_SERIAL_UART_8BIT   0x08

Definition at line 321 of file


Definition at line 317 of file


Definition at line 315 of file


Definition at line 323 of file


Definition at line 316 of file


Definition at line 314 of file

#define CISTPL_SPCL   0x90

Definition at line 128 of file

#define CISTPL_SWIL   0x23

Definition at line 116 of file

#define CISTPL_SYSINIT_POST   0x01

Definition at line 266 of file

#define CISTPL_SYSINIT_ROM   0x02

Definition at line 267 of file

#define CISTPL_VERS_1   0x15

Definition at line 102 of file

Definition at line 219 of file

#define CISTPL_VERS_2   0x40

Definition at line 119 of file

#define CS_EVENT_CARD_DETECT   0x000080

Definition at line 40 of file

#define DEV_NAME_LEN   32

Definition at line 66 of file

#define DS_BIND_REQUEST   _IOWR('d', 60, bind_info_t)

Definition at line 841 of file

#define DS_GET_CARD_SERVICES_INFO   _IOR ('d', 1, servinfo_t)

Definition at line 834 of file

#define DS_GET_CONFIGURATION_INFO   _IOWR('d', 3, config_info_t)

Definition at line 835 of file

#define DS_GET_DEVICE_INFO   _IOWR('d', 61, bind_info_t)

Definition at line 842 of file

#define DS_GET_FIRST_TUPLE   _IOWR('d', 4, tuple_t)

Definition at line 836 of file

#define DS_GET_NEXT_DEVICE   _IOWR('d', 62, bind_info_t)

Definition at line 843 of file

#define DS_GET_NEXT_TUPLE   _IOWR('d', 5, tuple_t)

Definition at line 837 of file

#define DS_GET_STATUS   _IOWR('d', 9, cs_status_t)

Definition at line 840 of file

#define DS_GET_TUPLE_DATA   _IOWR('d', 6, tuple_parse_t)

Definition at line 838 of file

#define DS_PARSE_TUPLE   _IOWR('d', 7, tuple_parse_t)

Definition at line 839 of file

#define MAX_SOCK   8

Definition at line 845 of file

#define TUPLE_RETURN_COMMON   0x02

Definition at line 833 of file

#define VARLIBPCMCIASTAB   "/var/lib/pcmcia/stab"

Definition at line 19 of file

Typedef Documentation

typedef struct bind_info_t bind_info_t
typedef u_char cisdata_t

Definition at line 27 of file

typedef union cisparse_t cisparse_t
typedef struct cistpl_bar_t cistpl_bar_t
typedef struct cistpl_io_t cistpl_io_t
typedef struct cistpl_irq_t cistpl_irq_t
typedef struct cistpl_mem_t cistpl_mem_t
typedef struct cistpl_org_t cistpl_org_t
typedef struct config_info_t config_info_t
typedef struct cs_status_t cs_status_t
typedef char dev_info_t[DEV_NAME_LEN]

Definition at line 67 of file

typedef u_int event_t

Definition at line 28 of file

typedef u_short ioaddr_t

Definition at line 24 of file

typedef struct tuple_parse_t tuple_parse_t
typedef struct tuple_t tuple_t

Function Documentation

__ID ( "@(#) $Id: 2433 2012-01-10 22:01:30Z lyonel $"  )
static hwNode* find_pcmciaparent ( int  slot,
hwNode root 
) [static]

Definition at line 1013 of file

  hwNode *result = NULL;
  unsigned int i;
  int currentslot = 0;

  if (slot < 0)
    return NULL;

  result = root.findChildByHandle(pcmcia_handle(slot));
  if (result)
    return result;

  for (i = 0; i < root.countChildren(); i++)
    if (is_cardbus(root.getChild(i)))
      if (currentslot == slot)
        return (hwNode *) root.getChild(i);

  for (i = 0; i < root.countChildren(); i++)
    result = NULL;
    result =
      find_pcmciaparent(slot - currentslot, *(hwNode *) root.getChild(i));
    if (result)
      return result;

  return NULL;

Here is the call graph for this function:

Here is the caller graph for this function:

static int get_tuple ( int  fd,
cisdata_t  code,
ds_ioctl_arg_t arg 
) [static]

Definition at line 880 of file

  arg.tuple.DesiredTuple = code;
  arg.tuple.Attributes = TUPLE_RETURN_COMMON;
  arg.tuple.TupleOffset = 0;
  if ((ioctl(fd, DS_GET_FIRST_TUPLE, &arg) == 0) &&
    (ioctl(fd, DS_GET_TUPLE_DATA, &arg) == 0) &&
    (ioctl(fd, DS_PARSE_TUPLE, &arg) == 0))
    return 0;
    return -1;

Here is the caller graph for this function:

static bool is_cardbus ( const hwNode n) [static]

Definition at line 1007 of file

  return (n->getClass() == hw::bridge) && n->isCapable("pcmcia");

Here is the call graph for this function:

Here is the caller graph for this function:

static int lookup_dev ( const char *  name) [static]

Definition at line 847 of file

  FILE *f;
  int n;
  char s[32], t[32];

  f = fopen("/proc/devices", "r");
  if (f == NULL)
    return -errno;
  while (fgets(s, 32, f) != NULL)
    if (sscanf(s, "%d %s", &n, t) == 2)
      if (strcmp(name, t) == 0)
  if (strcmp(name, t) == 0)
    return n;
    return -ENODEV;
}                                                 /* lookup_dev */

Here is the caller graph for this function:

static string pcmcia_handle ( int  socket) [static]

Definition at line 870 of file

  char buffer[20];

  snprintf(buffer, sizeof(buffer), "PCMCIA:%d", socket);

  return string(buffer);

Here is the caller graph for this function:

static bool pcmcia_ident ( int  socket,
int  fd,
hwNode parent 
) [static]

Definition at line 896 of file

  ds_ioctl_arg_t arg;
  cistpl_vers_1_t *vers = &arg.tuple_parse.parse.version_1;
  cistpl_funcid_t *funcid = &arg.tuple_parse.parse.funcid;
  config_info_t config;
  vector < string > product_info;
  hwNode device("pccard",
  char buffer[20];
  int i;

  if (get_tuple(fd, CISTPL_VERS_1, arg) == 0)
    for (i = 0; i < vers->ns; i++)
    product_info.push_back(string(vers->str + vers->ofs[i]));
    return false;

  if (get_tuple(fd, CISTPL_FUNCID, arg) == 0)
    switch (funcid->func)
      case 0:                                     // multifunction
      case 1:                                     // memory
        device = hwNode("memory", hw::memory);
      case 2:                                     // serial
        device = hwNode("serial", hw::communication);
    case 3:                                       // parallel
      device = hwNode("parallel", hw::communication);
    case 4:                                       // fixed disk
      device = hwNode("storage", hw::storage);
    case 5:                                       // video
      device = hwNode("video", hw::display);
    case 6:                                       // network
      device = hwNode("network", hw::network);
    case 7:                                       // AIMS ?
    case 8:                                       // SCSI
      device = hwNode("scsi", hw::bus);

  if (product_info.size() >= 2)
    if (product_info.size() >= 3)
      if (product_info.size() >= 4)
    device.setVersion(product_info[product_info.size() - 1]);
    if (product_info.size() >= 1)

  snprintf(buffer, sizeof(buffer), "Socket %d", socket);

  for (int fct = 0; fct < 4; fct++)
    memset(&config, 0, sizeof(config));
    config.Function = fct;
    if (ioctl(fd, DS_GET_CONFIGURATION_INFO, &config) == 0)
      if (config.AssignedIRQ != 0)

//memset(&bind, 0, sizeof(bind));
//strcpy(bind.dev_info, "cb_enabler");
//bind.function = 0;
//ioctl(fd, DS_GET_NEXT_DEVICE, &bind);
//printf("%s : %s -> %d\n", bind.dev_info,, errno);


  return true;

Here is the call graph for this function:

Here is the caller graph for this function:

bool scan_pcmcialegacy ( hwNode n)

Definition at line 1050 of file

  int fd[MAX_SOCK];
  int major = lookup_dev("pcmcia");
  unsigned int sockets = 0;
  unsigned int i;
  vector < string > stab;

  if (major < 0)                                  // pcmcia support not loaded, there isn't much
    return false;                                 // we can do

  memset(fd, 0, sizeof(fd));
  for (i = 0; i < MAX_SOCK; i++)
    fd[i] = open_dev((dev_t) ((major << 8) + i));

    if (fd[i] >= 0)
      hwNode *parent = find_pcmciaparent(i, n);
      cs_status_t status;
      if (i >= sockets)
        sockets = i + 1;

// check that slot is populated
      memset(&status, 0, sizeof(status));
      status.Function = 0;

      ioctl(fd[i], DS_GET_STATUS, &status);
      if (status.CardState & CS_EVENT_CARD_DETECT)
        if (parent)
          pcmcia_ident(i, fd[i], parent);
          pcmcia_ident(i, fd[i], &n);

  for (unsigned int j = 0; j < sockets; j++)

  if (loadfile(VARLIBPCMCIASTAB, stab))
    string socketname = "";
    string carddescription = "";

    for (i = 0; i < stab.size(); i++)
      if (stab[i][0] == 'S')
        string::size_type pos = stab[i].find(':');

        socketname = "";
        carddescription = "";

        if (pos != string::npos)
          socketname = stab[i].substr(0, pos);
          carddescription = stab[i].substr(pos + 1);
          carddescription = stab[i];
          socketname = "";
        int cnt = 0;
        int unused = 0;
        int socket = -1, devmajor = 0, devminor = 0;
        char devclass[20], driver[20], logicalname[20];

        memset(devclass, 0, sizeof(devclass));
        memset(driver, 0, sizeof(driver));
        memset(logicalname, 0, sizeof(logicalname));

        cnt = sscanf(stab[i].c_str(),
          "%d %s %s %d %s %d %d",
          &socket, devclass, driver, &unused, logicalname,
          &devmajor, &devminor);

        if ((cnt == 7) || (cnt == 5))             // we found a correct entry
          string devclassstr = string(devclass);
          hwNode *parent = n.findChildByHandle(pcmcia_handle(socket));

          if (socket >= (int) sockets)
            sockets = socket + 1;

          hwNode device = hwNode(devclass, hw::generic);

          if (devclassstr == "serial")
            device = hwNode(devclass, hw::communication);
          else if (devclassstr == "ide")
            device = hwNode(devclass, hw::storage);
          else if (devclassstr == "memory")
            device = hwNode(devclass, hw::memory);
          else if (devclassstr == "network")
            device = hwNode(devclass, hw::network);

          device.setConfig("driver", driver);

          if (!parent)
            parent = find_pcmciaparent(socket, n);

            if (parent)
              hwNode *realparent = parent->getChild(0);
              if (!realparent)
                parent = parent->addChild(hwNode("pccard"));
                parent = realparent;

          if (parent)
            if (parent->getDescription() == "")

  return true;

Here is the call graph for this function:

Here is the caller graph for this function: