Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
cs_internal.h File Reference
#include <linux/kref.h>

Go to the source code of this file.

Data Structures

struct  config_t
 
struct  cis_cache_entry
 
struct  pccard_resource_ops
 
struct  pcmcia_callback
 

Macros

#define CLIENT_WIN_REQ(i)   (0x1<<(i))
 
#define BIND_FN_ALL   0xff
 
#define CONFIG_LOCKED   0x01
 
#define CONFIG_IRQ_REQ   0x02
 
#define CONFIG_IO_REQ   0x04
 
#define SOCKET_PRESENT   0x0008
 
#define SOCKET_INUSE   0x0010
 
#define SOCKET_SUSPEND   0x0080
 
#define SOCKET_WIN_REQ(i)   (0x0100<<(i))
 
#define SOCKET_CARDBUS   0x8000
 
#define SOCKET_CARDBUS_CONFIG   0x10000
 
#define PCMCIA_UEVENT_EJECT   0x0001
 
#define PCMCIA_UEVENT_INSERT   0x0002
 
#define PCMCIA_UEVENT_SUSPEND   0x0004
 
#define PCMCIA_UEVENT_RESUME   0x0008
 
#define PCMCIA_UEVENT_REQUERY   0x0010
 

Typedefs

typedef struct config_t config_t
 

Functions

int static_init (struct pcmcia_socket *s)
 
struct resourcepcmcia_make_resource (unsigned long start, unsigned long end, int flags, const char *name)
 
int pccard_sysfs_add_socket (struct device *dev)
 
void pccard_sysfs_remove_socket (struct device *dev)
 
int cb_alloc (struct pcmcia_socket *s)
 
void cb_free (struct pcmcia_socket *s)
 
int pccard_register_pcmcia (struct pcmcia_socket *s, struct pcmcia_callback *c)
 
struct pcmcia_socketpcmcia_get_socket_by_nr (unsigned int nr)
 
void pcmcia_parse_uevents (struct pcmcia_socket *socket, unsigned int events)
 
struct pcmcia_socketpcmcia_get_socket (struct pcmcia_socket *skt)
 
void pcmcia_put_socket (struct pcmcia_socket *skt)
 
int pcmcia_release_configuration (struct pcmcia_device *p_dev)
 
int pcmcia_validate_mem (struct pcmcia_socket *s)
 
struct resourcepcmcia_find_mem_region (u_long base, u_long num, u_long align, int low, struct pcmcia_socket *s)
 
void pcmcia_cleanup_irq (struct pcmcia_socket *s)
 
int pcmcia_setup_irq (struct pcmcia_device *p_dev)
 
int pcmcia_read_cis_mem (struct pcmcia_socket *s, int attr, u_int addr, u_int len, void *ptr)
 
int pcmcia_write_cis_mem (struct pcmcia_socket *s, int attr, u_int addr, u_int len, void *ptr)
 
void release_cis_mem (struct pcmcia_socket *s)
 
void destroy_cis_cache (struct pcmcia_socket *s)
 
int pccard_read_tuple (struct pcmcia_socket *s, unsigned int function, cisdata_t code, void *parse)
 
int pcmcia_replace_cis (struct pcmcia_socket *s, const u8 *data, const size_t len)
 
int pccard_validate_cis (struct pcmcia_socket *s, unsigned int *count)
 
int verify_cis_cache (struct pcmcia_socket *s)
 
int pccard_loop_tuple (struct pcmcia_socket *s, unsigned int function, cisdata_t code, cisparse_t *parse, void *priv_data, int(*loop_tuple)(tuple_t *tuple, cisparse_t *parse, void *priv_data))
 
int pccard_get_first_tuple (struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
 
int pccard_get_next_tuple (struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
 
int pccard_get_tuple_data (struct pcmcia_socket *s, tuple_t *tuple)
 

Variables

struct rw_semaphore pcmcia_socket_list_rwsem
 
struct list_head pcmcia_socket_list
 
struct class pcmcia_socket_class
 
struct bus_type pcmcia_bus_type
 
struct bin_attribute pccard_cis_attr
 

Macro Definition Documentation

#define BIND_FN_ALL   0xff

Definition at line 30 of file cs_internal.h.

#define CLIENT_WIN_REQ (   i)    (0x1<<(i))

Definition at line 27 of file cs_internal.h.

#define CONFIG_IO_REQ   0x04

Definition at line 68 of file cs_internal.h.

#define CONFIG_IRQ_REQ   0x02

Definition at line 67 of file cs_internal.h.

#define CONFIG_LOCKED   0x01

Definition at line 66 of file cs_internal.h.

#define PCMCIA_UEVENT_EJECT   0x0001

Definition at line 125 of file cs_internal.h.

#define PCMCIA_UEVENT_INSERT   0x0002

Definition at line 126 of file cs_internal.h.

#define PCMCIA_UEVENT_REQUERY   0x0010

Definition at line 129 of file cs_internal.h.

#define PCMCIA_UEVENT_RESUME   0x0008

Definition at line 128 of file cs_internal.h.

#define PCMCIA_UEVENT_SUSPEND   0x0004

Definition at line 127 of file cs_internal.h.

#define SOCKET_CARDBUS   0x8000

Definition at line 75 of file cs_internal.h.

#define SOCKET_CARDBUS_CONFIG   0x10000

Definition at line 76 of file cs_internal.h.

#define SOCKET_INUSE   0x0010

Definition at line 72 of file cs_internal.h.

#define SOCKET_PRESENT   0x0008

Definition at line 71 of file cs_internal.h.

#define SOCKET_SUSPEND   0x0080

Definition at line 73 of file cs_internal.h.

#define SOCKET_WIN_REQ (   i)    (0x0100<<(i))

Definition at line 74 of file cs_internal.h.

Typedef Documentation

Function Documentation

int cb_alloc ( struct pcmcia_socket s)

cb_alloc() - add CardBus device : the pcmcia_socket where the CardBus device is located

cb_alloc() allocates the kernel data structures for a Cardbus device and handles the lowest level PCI device setup issues.

Definition at line 67 of file cardbus.c.

void cb_free ( struct pcmcia_socket s)

cb_free() - remove CardBus device : the pcmcia_socket where the CardBus device was located

cb_free() handles the lowest level PCI device cleanup.

Definition at line 106 of file cardbus.c.

void destroy_cis_cache ( struct pcmcia_socket s)

destroy_cis_cache() - destroy the CIS cache : pcmcia_socket for which CIS cache shall be destroyed

This destroys the CIS cache but keeps any fake CIS alive. Must be called with ops_mutex held.

Definition at line 355 of file cistpl.c.

int pccard_get_first_tuple ( struct pcmcia_socket s,
unsigned int  function,
tuple_t tuple 
)

Definition at line 446 of file cistpl.c.

int pccard_get_next_tuple ( struct pcmcia_socket s,
unsigned int  function,
tuple_t tuple 
)

Definition at line 521 of file cistpl.c.

int pccard_get_tuple_data ( struct pcmcia_socket s,
tuple_t tuple 
)

Definition at line 633 of file cistpl.c.

int pccard_loop_tuple ( struct pcmcia_socket s,
unsigned int  function,
cisdata_t  code,
cisparse_t parse,
void priv_data,
int(*)(tuple_t *tuple, cisparse_t *parse, void *priv_data)  loop_tuple 
)
int pccard_read_tuple ( struct pcmcia_socket s,
unsigned int  function,
cisdata_t  code,
void parse 
)
int pccard_register_pcmcia ( struct pcmcia_socket s,
struct pcmcia_callback c 
)

Definition at line 727 of file cs.c.

int pccard_sysfs_add_socket ( struct device dev)

Definition at line 223 of file socket_sysfs.c.

void pccard_sysfs_remove_socket ( struct device dev)

Definition at line 228 of file socket_sysfs.c.

int pccard_validate_cis ( struct pcmcia_socket s,
unsigned int info 
)

pccard_validate_cis() - check whether card has a sensible CIS : the struct pcmcia_socket we are to check : returns the number of tuples in the (valid) CIS, or 0

This tries to determine if a card has a sensible CIS. In , it returns the number of tuples in the CIS, or 0 if the CIS looks bad. The checks include making sure several critical tuples are present and valid; seeing if the total number of tuples is reasonable; and looking for tuples that use reserved codes.

The function returns 0 on success.

Definition at line 1376 of file cistpl.c.

void pcmcia_cleanup_irq ( struct pcmcia_socket s)

Definition at line 820 of file pcmcia_resource.c.

struct resource* pcmcia_find_mem_region ( u_long  base,
u_long  num,
u_long  align,
int  low,
struct pcmcia_socket s 
)
read

Definition at line 49 of file pcmcia_resource.c.

struct pcmcia_socket* pcmcia_get_socket ( struct pcmcia_socket skt)
read

Definition at line 76 of file cs.c.

struct pcmcia_socket* pcmcia_get_socket_by_nr ( unsigned int  nr)
read

Definition at line 235 of file cs.c.

struct resource* pcmcia_make_resource ( unsigned long  start,
unsigned long  end,
int  flags,
const char name 
)
read

Definition at line 33 of file rsrc_mgr.c.

void pcmcia_parse_uevents ( struct pcmcia_socket s,
u_int  events 
)

pcmcia_parse_uevents() - tell pccardd to issue manual commands : the PCMCIA socket we wan't to command : events to pass to pccardd

userspace-issued insert, eject, suspend and resume commands must be handled by pccardd to avoid any sysfs-related deadlocks. Valid events are PCMCIA_UEVENT_EJECT (for eject), PCMCIA_UEVENT__INSERT (for insert), PCMCIA_UEVENT_RESUME (for resume), PCMCIA_UEVENT_SUSPEND (for suspend) and PCMCIA_UEVENT_REQUERY (for re-querying the PCMCIA card).

Definition at line 711 of file cs.c.

void pcmcia_put_socket ( struct pcmcia_socket skt)

Definition at line 86 of file cs.c.

int pcmcia_read_cis_mem ( struct pcmcia_socket s,
int  attr,
u_int  addr,
u_int  len,
void ptr 
)

pcmcia_read_cis_mem() - low-level function to read CIS memory

must be called with ops_mutex held

Definition at line 136 of file cistpl.c.

int pcmcia_release_configuration ( struct pcmcia_device *  p_dev)

pcmcia_release_configuration() - physically disable a PCMCIA device : pcmcia device

pcmcia_release_configuration() is the 1:1 counterpart to pcmcia_enable_device(): If a PCMCIA device is no longer used by any driver, the Vpp voltage is set to 0, IRQs will no longer be generated, and I/O ranges will be disabled. As pcmcia_release_io() and pcmcia_release_window() still need to be called, device drivers are expected to call pcmcia_disable_device() instead.

Definition at line 350 of file pcmcia_resource.c.

int pcmcia_replace_cis ( struct pcmcia_socket s,
const u8 data,
const size_t  len 
)

pcmcia_replace_cis() - use a replacement CIS instead of the card's CIS

For really bad cards, we provide a facility for uploading a replacement CIS.

Definition at line 410 of file cistpl.c.

int pcmcia_setup_irq ( struct pcmcia_device *  p_dev)

pcmcia_setup_irq() - determine IRQ to be used for device - the associated PCMCIA device

locking note: must be called with ops_mutex locked.

Definition at line 835 of file pcmcia_resource.c.

int pcmcia_validate_mem ( struct pcmcia_socket s)

Definition at line 41 of file pcmcia_resource.c.

int pcmcia_write_cis_mem ( struct pcmcia_socket s,
int  attr,
u_int  addr,
u_int  len,
void ptr 
)

pcmcia_write_cis_mem() - low-level function to write CIS memory

Probably only useful for writing one-byte registers. Must be called with ops_mutex held.

Definition at line 214 of file cistpl.c.

void release_cis_mem ( struct pcmcia_socket s)

Definition at line 62 of file cistpl.c.

int static_init ( struct pcmcia_socket s)

Definition at line 23 of file rsrc_mgr.c.

int verify_cis_cache ( struct pcmcia_socket s)

verify_cis_cache() - does the CIS match what is in the CIS cache?

Definition at line 370 of file cistpl.c.

Variable Documentation

struct bin_attribute pccard_cis_attr

Definition at line 1595 of file cistpl.c.

struct bus_type pcmcia_bus_type

Definition at line 1399 of file ds.c.

struct class pcmcia_socket_class

Definition at line 875 of file cs.c.

struct list_head pcmcia_socket_list
struct rw_semaphore pcmcia_socket_list_rwsem