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