pcmcia driver model support [1/5]
PATCH 1/1 pcmcia driver model support [1/5]
Hi,
This patch set is an updated version from the last and is against 2.6.8-rc3. It includes suggestions from Dominik and an independent pcmcia bugfix. I would appreciate any comments.
Thanks,
Adam
[PCMCIA] implement driver model support
This patch adds driver model support to the pcmcia bus driver.
drivers/pcmcia/cs_internal.h +1 -0
@@ -33,6 +33,7 @@ typedef struct client_t { u_short client_magic; struct pcmcia_socket *Socket; + struct device *device; u_char Function; dev_info_t dev_info; u_int Attributes;
drivers/pcmcia/cs.c +17 -0
@@ -1160,6 +1160,22 @@#endif +/*===================================================================== + +Return the driver model device associated with a card.. + +======================================================================*/ + +struct device *pcmcia_lookup_device (client_handle_t handle) +{ +if (CHECK_HANDLE (handle)) +return NULL ; + +return handle->device; +} + +EXPORT_SYMBOL (pcmcia_lookup_device); +/*====================================================================== Get the current socket state bits. We don't support the latched
@@ -2154,6 +2170,7 @@EXPORT_SYMBOL (pcmcia_suspend_card);EXPORT_SYMBOL (pcmcia_validate_cis);EXPORT_SYMBOL (pcmcia_write_memory); +EXPORT_SYMBOL (read_tuple);EXPORT_SYMBOL (dead_socket);EXPORT_SYMBOL (MTDHelperEntry);
drivers/pcmcia/ds.c +202 -1
313 lines not on this page · raw message
include/pcmcia/cs.h +2 -0
@@ -318,6 +318,7 @@/* Special stuff for binding drivers to sockets */ typedef struct bind_req_t {struct pcmcia_socket *Socket; +struct pcmcia_device *device;u_char Function;dev_info_t *dev_info; }bind_req_t ;
@@ -452,6 +453,7 @@int pcmcia_set_event_mask (client_handle_t handle,eventmask_t *mask);int pcmcia_report_error (client_handle_t handle,error_info_t *err);struct pci_bus *pcmcia_lookup_bus (client_handle_t handle); +struct device *pcmcia_lookup_device (client_handle_t handle);/* rsrc_mgr.c */ int pcmcia_adjust_resource_info (client_handle_t handle,adjust_t *adj);
include/pcmcia/ds.h +15 -0
@@ -151,6 +151,21 @@struct device_driver drv; }; +struct pcmcia_device { +struct device dev; +struct pcmcia_bus_socket *socket; +struct list_head device_list; +int function; +int id_mask; +cistpl_vers_1_t vers_1; +cistpl_manfid_t manfid; +}; + +#define to_pcmcia_device (n) container_of(n, struct pcmcia_device, dev) + +#define DEVICE_HAS_VERSION_INFO 0x0001 +#define DEVICE_HAS_MANF_INFO 0x0002 +/* driver registration */ int pcmcia_register_driver (struct pcmcia_driver *driver);void pcmcia_unregister_driver (struct pcmcia_driver *driver);
Quoted 3 lines · Adam Belay
This patch set is an updated version from the last and is against 2.6.8-rc3. It includes suggestions from Dominik and an independent pcmcia bugfix. I would appreciate any comments.
I'm overall _NOT_ happy with the growing number of people trying to "fix" PCMCIA to do what they want it to do.
I've recently had davem screaming and shouting his head off at me while I was at OLS claiming that PCMCIA network drivers _MUST_ be user unloadable at any time, irrespective of the requirements of the PCMCIA layer.
It's _VERY_ easy to fuck up the PCMCIA code - we've fucked it up several times already and the only way to detect these fuckups is to change things _SLOWLY_ and let a full release cycle pass by between changes. Yes, it means that PCMCIA changes take _MONTHS_ but that's reality.
So please slow down.
Signature · 4 lines
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core