blob: 33fe9ebec0490140b3ad3d3507dfe386bb50884b [file] [log] [blame]
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -03001==============
2Driver changes
3==============
4
Dominik Brodowski5085cb22005-06-27 16:28:45 -07005This file details changes in 2.6 which affect PCMCIA card driver authors:
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -03006
Dominik Brodowski00990e72010-07-30 13:13:46 +02007* pcmcia_loop_config() and autoconfiguration (as of 2.6.36)
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -03008 If `struct pcmcia_device *p_dev->config_flags` is set accordingly,
Dominik Brodowski00990e72010-07-30 13:13:46 +02009 pcmcia_loop_config() now sets up certain configuration values
10 automatically, though the driver may still override the settings
11 in the callback function. The following autoconfiguration options
12 are provided at the moment:
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030013
14 - CONF_AUTO_CHECK_VCC : check for matching Vcc
15 - CONF_AUTO_SET_VPP : set Vpp
16 - CONF_AUTO_AUDIO : auto-enable audio line, if required
17 - CONF_AUTO_SET_IO : set ioport resources (->resource[0,1])
18 - CONF_AUTO_SET_IOMEM : set first iomem resource (->resource[2])
Dominik Brodowski00990e72010-07-30 13:13:46 +020019
Dominik Brodowski1ac71e52010-07-29 19:27:09 +020020* pcmcia_request_configuration -> pcmcia_enable_device (as of 2.6.36)
21 pcmcia_request_configuration() got renamed to pcmcia_enable_device(),
22 as it mirrors pcmcia_disable_device(). Configuration settings are now
23 stored in struct pcmcia_device, e.g. in the fields config_flags,
24 config_index, config_base, vpp.
25
Dominik Brodowskicdb13802010-07-28 10:59:06 +020026* pcmcia_request_window changes (as of 2.6.36)
27 Instead of win_req_t, drivers are now requested to fill out
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030028 `struct pcmcia_device *p_dev->resource[2,3,4,5]` for up to four ioport
Dominik Brodowskicdb13802010-07-28 10:59:06 +020029 ranges. After a call to pcmcia_request_window(), the regions found there
30 are reserved and may be used immediately -- until pcmcia_release_window()
31 is called.
32
Dominik Brodowski90abdc32010-07-24 17:23:51 +020033* pcmcia_request_io changes (as of 2.6.36)
34 Instead of io_req_t, drivers are now requested to fill out
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030035 `struct pcmcia_device *p_dev->resource[0,1]` for up to two ioport
Dominik Brodowski90abdc32010-07-24 17:23:51 +020036 ranges. After a call to pcmcia_request_io(), the ports found there
37 are reserved, after calling pcmcia_request_configuration(), they may
38 be used.
39
Dominik Brodowskiac8b4222010-07-21 22:38:13 +020040* No dev_info_t, no cs_types.h (as of 2.6.36)
41 dev_info_t and a few other typedefs are removed. No longer use them
42 in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
43 this file is gone.
44
Dominik Brodowskib9300aa2010-03-20 19:43:40 +010045* No dev_node_t (as of 2.6.35)
46 There is no more need to fill out a "dev_node_t" structure.
47
Dominik Brodowskieb141202010-03-07 12:21:16 +010048* New IRQ request rules (as of 2.6.35)
49 Instead of the old pcmcia_request_irq() interface, drivers may now
50 choose between:
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030051
52 - calling request_irq/free_irq directly. Use the IRQ from `*p_dev->irq`.
Dominik Brodowskieb141202010-03-07 12:21:16 +010053 - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
54 clean up automatically on calls to pcmcia_disable_device() or
55 device ejection.
Dominik Brodowski5085cb22005-06-27 16:28:45 -070056
Dominik Brodowski9cb495b2009-10-24 15:57:22 +020057* no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
58 Instead of the cs_error() callback or the CS_CHECK() macro, please use
59 Linux-style checking of return values, and -- if necessary -- debug
60 messages using "dev_dbg()" or "pr_debug()".
61
Dominik Brodowski91284222009-10-18 23:32:33 +020062* New CIS tuple access (as of 2.6.33)
63 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
64 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
65 only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is
66 interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE,
67 a new helper "pcmcia_get_mac_from_cis()" was added.
68
Dominik Brodowskia804b572008-07-29 08:38:30 +020069* New configuration loop helper (as of 2.6.28)
70 By calling pcmcia_loop_config(), a driver can iterate over all available
71 configuration options. During a driver's probe() phase, one doesn't need
72 to use pcmcia_get_{first,next}_tuple, pcmcia_get_tuple_data and
73 pcmcia_parse_tuple directly in most if not all cases.
74
Dominik Brodowski5f2a71f2006-01-15 09:32:39 +010075* New release helper (as of 2.6.17)
76 Instead of calling pcmcia_release_{configuration,io,irq,win}, all that's
77 necessary now is calling pcmcia_disable_device. As there is no valid
Dominik Brodowski50db3fd2006-01-15 10:05:19 +010078 reason left to call pcmcia_release_io and pcmcia_release_irq, the
79 exports for them were removed.
Dominik Brodowski5f2a71f2006-01-15 09:32:39 +010080
Dominik Brodowskif8cfa612005-11-14 21:25:51 +010081* Unify detach and REMOVAL event code, as well as attach and INSERTION
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030082 code (as of 2.6.16)::
83
Dominik Brodowskif8cfa612005-11-14 21:25:51 +010084 void (*remove) (struct pcmcia_device *dev);
85 int (*probe) (struct pcmcia_device *dev);
Dominik Brodowskicc3b4862005-11-14 21:23:14 +010086
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030087* Move suspend, resume and reset out of event handler (as of 2.6.16)::
88
Dominik Brodowski98e4c282005-11-14 21:21:18 +010089 int (*suspend) (struct pcmcia_device *dev);
90 int (*resume) (struct pcmcia_device *dev);
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -030091
Dominik Brodowski98e4c282005-11-14 21:21:18 +010092 should be initialized in struct pcmcia_driver, and handle
93 (SUSPEND == RESET_PHYSICAL) and (RESUME == CARD_RESET) events
94
Dominik Brodowskic6fd7182005-07-12 13:58:15 -070095* event handler initialization in struct pcmcia_driver (as of 2.6.13)
96 The event handler is notified of all events, and must be initialized
97 as the event() callback in the driver's struct pcmcia_driver.
98
99* pcmcia/version.h should not be used (as of 2.6.13)
100 This file will be removed eventually.
101
102* in-kernel device<->driver matching (as of 2.6.13)
Dominik Brodowski5085cb22005-06-27 16:28:45 -0700103 PCMCIA devices and their correct drivers can now be matched in
104 kernelspace. See 'devicetable.txt' for details.
105
106* Device model integration (as of 2.6.11)
107 A struct pcmcia_device is registered with the device model core,
108 and can be used (e.g. for SET_NETDEV_DEV) by using
109 handle_to_dev(client_handle_t * handle).
110
Olof Johansson906da809c2008-02-04 22:27:35 -0800111* Convert internal I/O port addresses to unsigned int (as of 2.6.11)
112 ioaddr_t should be replaced by unsigned int in PCMCIA card drivers.
Dominik Brodowski5085cb22005-06-27 16:28:45 -0700113
114* irq_mask and irq_list parameters (as of 2.6.11)
115 The irq_mask and irq_list parameters should no longer be used in
116 PCMCIA card drivers. Instead, it is the job of the PCMCIA core to
117 determine which IRQ should be used. Therefore, link->irq.IRQInfo2
118 is ignored.
119
120* client->PendingEvents is gone (as of 2.6.11)
121 client->PendingEvents is no longer available.
122
123* client->Attributes are gone (as of 2.6.11)
124 client->Attributes is unused, therefore it is removed from all
125 PCMCIA card drivers
126
127* core functions no longer available (as of 2.6.11)
128 The following functions have been removed from the kernel source
129 because they are unused by all in-kernel drivers, and no external
Mauro Carvalho Chehab3bdab162019-06-12 14:52:53 -0300130 driver was reported to rely on them::
131
Dominik Brodowski5085cb22005-06-27 16:28:45 -0700132 pcmcia_get_first_region()
133 pcmcia_get_next_region()
134 pcmcia_modify_window()
135 pcmcia_set_event_mask()
136 pcmcia_get_first_window()
137 pcmcia_get_next_window()
138
139* device list iteration upon module removal (as of 2.6.10)
140 It is no longer necessary to iterate on the driver's internal
141 client list and call the ->detach() function upon module removal.
142
143* Resource management. (as of 2.6.8)
144 Although the PCMCIA subsystem will allocate resources for cards,
145 it no longer marks these resources busy. This means that driver
146 authors are now responsible for claiming your resources as per
147 other drivers in Linux. You should use request_region() to mark
148 your IO regions in-use, and request_mem_region() to mark your
149 memory regions in-use. The name argument should be a pointer to
150 your driver name. Eg, for pcnet_cs, name should point to the
151 string "pcnet_cs".
Dominik Brodowski661d04c2005-07-28 01:07:26 -0700152
153* CardServices is gone
154 CardServices() in 2.4 is just a big switch statement to call various
155 services. In 2.6, all of those entry points are exported and called
156 directly (except for pcmcia_report_error(), just use cs_error() instead).
157
158* struct pcmcia_driver
159 You need to use struct pcmcia_driver and pcmcia_{un,}register_driver
160 instead of {un,}register_pccard_driver