X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fpcmcia%2Fds.h;h=f047a1fd64f803a887ce40430a7e14a86d0e4627;hb=febb187761b02fce7d61b9c897d0e701f672b5ee;hp=557d8aea1a862c730bdada9add256b5e9937415b;hpb=fba395eee7d3f342ca739c20f5b3ee635d0420a0;p=linux-2.6 diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 557d8aea1a..f047a1fd64 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t { #ifdef __KERNEL__ #include +#include typedef struct dev_node_t { char dev_name[DEV_NAME_LEN]; @@ -103,22 +104,15 @@ typedef struct dev_node_t { struct dev_node_t *next; } dev_node_t; -/* Flags for device state */ -#define DEV_PRESENT 0x01 -#define DEV_CONFIG 0x02 -#define DEV_SUSPEND_NORELEASE 0x04 -#define DEV_CONFIG_PENDING 0x10 -#define DEV_RELEASE_PENDING 0x20 -#define DEV_SUSPEND 0x40 -#define DEV_BUSY 0x80 - -#define DEV_OK(l) \ - ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) - struct pcmcia_socket; struct config_t; +struct pcmcia_dynids { + spinlock_t lock; + struct list_head list; +}; + struct pcmcia_driver { int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); @@ -129,12 +123,14 @@ struct pcmcia_driver { struct module *owner; struct pcmcia_device_id *id_table; struct device_driver drv; + struct pcmcia_dynids dynids; }; /* driver registration */ int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); + struct pcmcia_device { /* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */ @@ -153,23 +149,34 @@ struct pcmcia_device { /* deprecated, will be cleaned up soon */ dev_node_t *dev_node; - u_int state; u_int open; io_req_t io; irq_req_t irq; config_req_t conf; window_handle_t win; - void *priv; - u_int p_state; + /* Is the device suspended, or in the process of + * being removed? */ + u16 suspended:1; + u16 _removed:1; + + /* Flags whether io, irq, win configurations were + * requested, and whether the configuration is "locked" */ + u16 _irq:1; + u16 _io:1; + u16 _win:4; + u16 _locked:1; + + /* Flag whether a "fuzzy" func_id based match is + * allowed. */ + u16 allow_func_id_match:1; /* information about this device */ - u8 has_manf_id:1; - u8 has_card_id:1; - u8 has_func_id:1; + u16 has_manf_id:1; + u16 has_card_id:1; + u16 has_func_id:1; - u8 allow_func_id_match:1; - u8 reserved:4; + u16 reserved:3; u8 func_id; u16 manf_id; @@ -177,12 +184,16 @@ struct pcmcia_device { char * prod_id[4]; + u64 dma_mask; struct device dev; #ifdef CONFIG_PCMCIA_IOCTL /* device driver wanted by cardmgr */ struct pcmcia_driver * cardmgr; #endif + + /* data private to drivers */ + void *priv; }; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)