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