0001 ==============
0002 Driver changes
0003 ==============
0004
0005 This file details changes in 2.6 which affect PCMCIA card driver authors:
0006
0007 * pcmcia_loop_config() and autoconfiguration (as of 2.6.36)
0008 If `struct pcmcia_device *p_dev->config_flags` is set accordingly,
0009 pcmcia_loop_config() now sets up certain configuration values
0010 automatically, though the driver may still override the settings
0011 in the callback function. The following autoconfiguration options
0012 are provided at the moment:
0013
0014 - CONF_AUTO_CHECK_VCC : check for matching Vcc
0015 - CONF_AUTO_SET_VPP : set Vpp
0016 - CONF_AUTO_AUDIO : auto-enable audio line, if required
0017 - CONF_AUTO_SET_IO : set ioport resources (->resource[0,1])
0018 - CONF_AUTO_SET_IOMEM : set first iomem resource (->resource[2])
0019
0020 * pcmcia_request_configuration -> pcmcia_enable_device (as of 2.6.36)
0021 pcmcia_request_configuration() got renamed to pcmcia_enable_device(),
0022 as it mirrors pcmcia_disable_device(). Configuration settings are now
0023 stored in struct pcmcia_device, e.g. in the fields config_flags,
0024 config_index, config_base, vpp.
0025
0026 * pcmcia_request_window changes (as of 2.6.36)
0027 Instead of win_req_t, drivers are now requested to fill out
0028 `struct pcmcia_device *p_dev->resource[2,3,4,5]` for up to four ioport
0029 ranges. After a call to pcmcia_request_window(), the regions found there
0030 are reserved and may be used immediately -- until pcmcia_release_window()
0031 is called.
0032
0033 * pcmcia_request_io changes (as of 2.6.36)
0034 Instead of io_req_t, drivers are now requested to fill out
0035 `struct pcmcia_device *p_dev->resource[0,1]` for up to two ioport
0036 ranges. After a call to pcmcia_request_io(), the ports found there
0037 are reserved, after calling pcmcia_request_configuration(), they may
0038 be used.
0039
0040 * No dev_info_t, no cs_types.h (as of 2.6.36)
0041 dev_info_t and a few other typedefs are removed. No longer use them
0042 in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
0043 this file is gone.
0044
0045 * No dev_node_t (as of 2.6.35)
0046 There is no more need to fill out a "dev_node_t" structure.
0047
0048 * New IRQ request rules (as of 2.6.35)
0049 Instead of the old pcmcia_request_irq() interface, drivers may now
0050 choose between:
0051
0052 - calling request_irq/free_irq directly. Use the IRQ from `*p_dev->irq`.
0053 - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
0054 clean up automatically on calls to pcmcia_disable_device() or
0055 device ejection.
0056
0057 * no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
0058 Instead of the cs_error() callback or the CS_CHECK() macro, please use
0059 Linux-style checking of return values, and -- if necessary -- debug
0060 messages using "dev_dbg()" or "pr_debug()".
0061
0062 * New CIS tuple access (as of 2.6.33)
0063 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
0064 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
0065 only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is
0066 interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE,
0067 a new helper "pcmcia_get_mac_from_cis()" was added.
0068
0069 * New configuration loop helper (as of 2.6.28)
0070 By calling pcmcia_loop_config(), a driver can iterate over all available
0071 configuration options. During a driver's probe() phase, one doesn't need
0072 to use pcmcia_get_{first,next}_tuple, pcmcia_get_tuple_data and
0073 pcmcia_parse_tuple directly in most if not all cases.
0074
0075 * New release helper (as of 2.6.17)
0076 Instead of calling pcmcia_release_{configuration,io,irq,win}, all that's
0077 necessary now is calling pcmcia_disable_device. As there is no valid
0078 reason left to call pcmcia_release_io and pcmcia_release_irq, the
0079 exports for them were removed.
0080
0081 * Unify detach and REMOVAL event code, as well as attach and INSERTION
0082 code (as of 2.6.16)::
0083
0084 void (*remove) (struct pcmcia_device *dev);
0085 int (*probe) (struct pcmcia_device *dev);
0086
0087 * Move suspend, resume and reset out of event handler (as of 2.6.16)::
0088
0089 int (*suspend) (struct pcmcia_device *dev);
0090 int (*resume) (struct pcmcia_device *dev);
0091
0092 should be initialized in struct pcmcia_driver, and handle
0093 (SUSPEND == RESET_PHYSICAL) and (RESUME == CARD_RESET) events
0094
0095 * event handler initialization in struct pcmcia_driver (as of 2.6.13)
0096 The event handler is notified of all events, and must be initialized
0097 as the event() callback in the driver's struct pcmcia_driver.
0098
0099 * pcmcia/version.h should not be used (as of 2.6.13)
0100 This file will be removed eventually.
0101
0102 * in-kernel device<->driver matching (as of 2.6.13)
0103 PCMCIA devices and their correct drivers can now be matched in
0104 kernelspace. See 'devicetable.txt' for details.
0105
0106 * Device model integration (as of 2.6.11)
0107 A struct pcmcia_device is registered with the device model core,
0108 and can be used (e.g. for SET_NETDEV_DEV) by using
0109 handle_to_dev(client_handle_t * handle).
0110
0111 * Convert internal I/O port addresses to unsigned int (as of 2.6.11)
0112 ioaddr_t should be replaced by unsigned int in PCMCIA card drivers.
0113
0114 * irq_mask and irq_list parameters (as of 2.6.11)
0115 The irq_mask and irq_list parameters should no longer be used in
0116 PCMCIA card drivers. Instead, it is the job of the PCMCIA core to
0117 determine which IRQ should be used. Therefore, link->irq.IRQInfo2
0118 is ignored.
0119
0120 * client->PendingEvents is gone (as of 2.6.11)
0121 client->PendingEvents is no longer available.
0122
0123 * client->Attributes are gone (as of 2.6.11)
0124 client->Attributes is unused, therefore it is removed from all
0125 PCMCIA card drivers
0126
0127 * core functions no longer available (as of 2.6.11)
0128 The following functions have been removed from the kernel source
0129 because they are unused by all in-kernel drivers, and no external
0130 driver was reported to rely on them::
0131
0132 pcmcia_get_first_region()
0133 pcmcia_get_next_region()
0134 pcmcia_modify_window()
0135 pcmcia_set_event_mask()
0136 pcmcia_get_first_window()
0137 pcmcia_get_next_window()
0138
0139 * device list iteration upon module removal (as of 2.6.10)
0140 It is no longer necessary to iterate on the driver's internal
0141 client list and call the ->detach() function upon module removal.
0142
0143 * Resource management. (as of 2.6.8)
0144 Although the PCMCIA subsystem will allocate resources for cards,
0145 it no longer marks these resources busy. This means that driver
0146 authors are now responsible for claiming your resources as per
0147 other drivers in Linux. You should use request_region() to mark
0148 your IO regions in-use, and request_mem_region() to mark your
0149 memory regions in-use. The name argument should be a pointer to
0150 your driver name. Eg, for pcnet_cs, name should point to the
0151 string "pcnet_cs".
0152
0153 * CardServices is gone
0154 CardServices() in 2.4 is just a big switch statement to call various
0155 services. In 2.6, all of those entry points are exported and called
0156 directly (except for pcmcia_report_error(), just use cs_error() instead).
0157
0158 * struct pcmcia_driver
0159 You need to use struct pcmcia_driver and pcmcia_{un,}register_driver
0160 instead of {un,}register_pccard_driver