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