Merge commit 'v2.6.36-rc1' into kbuild/rc-fixes
[pandora-kernel.git] / Documentation / pcmcia / driver-changes.txt
1 This file details changes in 2.6 which affect PCMCIA card driver authors:
2 * pcmcia_request_io changes (as of 2.6.36)
3    Instead of io_req_t, drivers are now requested to fill out
4    struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
5    ranges. After a call to pcmcia_request_io(), the ports found there
6    are reserved, after calling pcmcia_request_configuration(), they may
7    be used.
8
9 * No dev_info_t, no cs_types.h (as of 2.6.36)
10    dev_info_t and a few other typedefs are removed. No longer use them
11    in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
12    this file is gone.
13
14 * No dev_node_t (as of 2.6.35)
15    There is no more need to fill out a "dev_node_t" structure.
16
17 * New IRQ request rules (as of 2.6.35)
18    Instead of the old pcmcia_request_irq() interface, drivers may now
19    choose between:
20    - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq.
21    - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
22      clean up automatically on calls to pcmcia_disable_device() or
23      device ejection.
24    - drivers still not capable of IRQF_SHARED (or not telling us so) may
25      use the deprecated pcmcia_request_exclusive_irq() for the time
26      being; they might receive a shared IRQ nonetheless.
27
28 * no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
29    Instead of the cs_error() callback or the CS_CHECK() macro, please use
30    Linux-style checking of return values, and -- if necessary -- debug
31    messages using "dev_dbg()" or "pr_debug()".
32
33 * New CIS tuple access (as of 2.6.33)
34    Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
35    pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
36    only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is
37    interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE,
38    a new helper "pcmcia_get_mac_from_cis()" was added.
39
40 * New configuration loop helper (as of 2.6.28)
41    By calling pcmcia_loop_config(), a driver can iterate over all available
42    configuration options. During a driver's probe() phase, one doesn't need
43    to use pcmcia_get_{first,next}_tuple, pcmcia_get_tuple_data and
44    pcmcia_parse_tuple directly in most if not all cases.
45
46 * New release helper (as of 2.6.17)
47    Instead of calling pcmcia_release_{configuration,io,irq,win}, all that's
48    necessary now is calling pcmcia_disable_device. As there is no valid
49    reason left to call pcmcia_release_io and pcmcia_release_irq, the
50    exports for them were removed.
51
52 * Unify detach and REMOVAL event code, as well as attach and INSERTION
53   code (as of 2.6.16)
54        void (*remove)          (struct pcmcia_device *dev);
55        int (*probe)            (struct pcmcia_device *dev);
56
57 * Move suspend, resume and reset out of event handler (as of 2.6.16)
58        int (*suspend)          (struct pcmcia_device *dev);
59        int (*resume)           (struct pcmcia_device *dev);
60   should be initialized in struct pcmcia_driver, and handle
61   (SUSPEND == RESET_PHYSICAL) and (RESUME == CARD_RESET) events
62
63 * event handler initialization in struct pcmcia_driver (as of 2.6.13)
64    The event handler is notified of all events, and must be initialized
65    as the event() callback in the driver's struct pcmcia_driver.
66
67 * pcmcia/version.h should not be used (as of 2.6.13)
68    This file will be removed eventually.
69
70 * in-kernel device<->driver matching (as of 2.6.13)
71    PCMCIA devices and their correct drivers can now be matched in
72    kernelspace. See 'devicetable.txt' for details.
73
74 * Device model integration (as of 2.6.11)
75    A struct pcmcia_device is registered with the device model core,
76    and can be used (e.g. for SET_NETDEV_DEV) by using
77    handle_to_dev(client_handle_t * handle).
78
79 * Convert internal I/O port addresses to unsigned int (as of 2.6.11)
80    ioaddr_t should be replaced by unsigned int in PCMCIA card drivers.
81
82 * irq_mask and irq_list parameters (as of 2.6.11)
83    The irq_mask and irq_list parameters should no longer be used in
84    PCMCIA card drivers. Instead, it is the job of the PCMCIA core to
85    determine which IRQ should be used. Therefore, link->irq.IRQInfo2
86    is ignored.
87
88 * client->PendingEvents is gone (as of 2.6.11)
89    client->PendingEvents is no longer available.
90
91 * client->Attributes are gone (as of 2.6.11)
92    client->Attributes is unused, therefore it is removed from all
93    PCMCIA card drivers
94
95 * core functions no longer available (as of 2.6.11)
96    The following functions have been removed from the kernel source
97    because they are unused by all in-kernel drivers, and no external
98    driver was reported to rely on them:
99         pcmcia_get_first_region()
100         pcmcia_get_next_region()
101         pcmcia_modify_window()
102         pcmcia_set_event_mask()
103         pcmcia_get_first_window()
104         pcmcia_get_next_window()
105
106 * device list iteration upon module removal (as of 2.6.10)
107    It is no longer necessary to iterate on the driver's internal
108    client list and call the ->detach() function upon module removal.
109
110 * Resource management. (as of 2.6.8)
111    Although the PCMCIA subsystem will allocate resources for cards,
112    it no longer marks these resources busy. This means that driver
113    authors are now responsible for claiming your resources as per
114    other drivers in Linux. You should use request_region() to mark
115    your IO regions in-use, and request_mem_region() to mark your
116    memory regions in-use. The name argument should be a pointer to
117    your driver name. Eg, for pcnet_cs, name should point to the
118    string "pcnet_cs".
119
120 * CardServices is gone
121   CardServices() in 2.4 is just a big switch statement to call various
122   services.  In 2.6, all of those entry points are exported and called
123   directly (except for pcmcia_report_error(), just use cs_error() instead).
124
125 * struct pcmcia_driver
126   You need to use struct pcmcia_driver and pcmcia_{un,}register_driver
127   instead of {un,}register_pccard_driver