Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 1 | #define PRISM2_PCCARD |
| 2 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 3 | #include <linux/module.h> |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 4 | #include <linux/if.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 5 | #include <linux/slab.h> |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 6 | #include <linux/wait.h> |
| 7 | #include <linux/timer.h> |
| 8 | #include <linux/skbuff.h> |
| 9 | #include <linux/netdevice.h> |
| 10 | #include <linux/workqueue.h> |
| 11 | #include <linux/wireless.h> |
| 12 | #include <net/iw_handler.h> |
| 13 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 14 | #include <pcmcia/cistpl.h> |
| 15 | #include <pcmcia/cisreg.h> |
| 16 | #include <pcmcia/ds.h> |
| 17 | |
| 18 | #include <asm/io.h> |
| 19 | |
| 20 | #include "hostap_wlan.h" |
| 21 | |
| 22 | |
Dominik Brodowski | ac8b422 | 2010-07-21 22:38:13 +0200 | [diff] [blame] | 23 | static char *dev_info = "hostap_cs"; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 24 | |
| 25 | MODULE_AUTHOR("Jouni Malinen"); |
| 26 | MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " |
| 27 | "cards (PC Card)."); |
| 28 | MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PC Card)"); |
| 29 | MODULE_LICENSE("GPL"); |
| 30 | |
| 31 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 32 | static int ignore_cis_vcc; |
| 33 | module_param(ignore_cis_vcc, int, 0444); |
| 34 | MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry"); |
| 35 | |
| 36 | |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 37 | /* struct local_info::hw_priv */ |
| 38 | struct hostap_cs_priv { |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 39 | struct pcmcia_device *link; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 40 | int sandisk_connectplus; |
| 41 | }; |
| 42 | |
| 43 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 44 | #ifdef PRISM2_IO_DEBUG |
| 45 | |
| 46 | static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v) |
| 47 | { |
| 48 | struct hostap_interface *iface; |
| 49 | local_info_t *local; |
| 50 | unsigned long flags; |
| 51 | |
| 52 | iface = netdev_priv(dev); |
| 53 | local = iface->local; |
| 54 | spin_lock_irqsave(&local->lock, flags); |
| 55 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v); |
| 56 | outb(v, dev->base_addr + a); |
| 57 | spin_unlock_irqrestore(&local->lock, flags); |
| 58 | } |
| 59 | |
| 60 | static inline u8 hfa384x_inb_debug(struct net_device *dev, int a) |
| 61 | { |
| 62 | struct hostap_interface *iface; |
| 63 | local_info_t *local; |
| 64 | unsigned long flags; |
| 65 | u8 v; |
| 66 | |
| 67 | iface = netdev_priv(dev); |
| 68 | local = iface->local; |
| 69 | spin_lock_irqsave(&local->lock, flags); |
| 70 | v = inb(dev->base_addr + a); |
| 71 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v); |
| 72 | spin_unlock_irqrestore(&local->lock, flags); |
| 73 | return v; |
| 74 | } |
| 75 | |
| 76 | static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v) |
| 77 | { |
| 78 | struct hostap_interface *iface; |
| 79 | local_info_t *local; |
| 80 | unsigned long flags; |
| 81 | |
| 82 | iface = netdev_priv(dev); |
| 83 | local = iface->local; |
| 84 | spin_lock_irqsave(&local->lock, flags); |
| 85 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v); |
| 86 | outw(v, dev->base_addr + a); |
| 87 | spin_unlock_irqrestore(&local->lock, flags); |
| 88 | } |
| 89 | |
| 90 | static inline u16 hfa384x_inw_debug(struct net_device *dev, int a) |
| 91 | { |
| 92 | struct hostap_interface *iface; |
| 93 | local_info_t *local; |
| 94 | unsigned long flags; |
| 95 | u16 v; |
| 96 | |
| 97 | iface = netdev_priv(dev); |
| 98 | local = iface->local; |
| 99 | spin_lock_irqsave(&local->lock, flags); |
| 100 | v = inw(dev->base_addr + a); |
| 101 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v); |
| 102 | spin_unlock_irqrestore(&local->lock, flags); |
| 103 | return v; |
| 104 | } |
| 105 | |
| 106 | static inline void hfa384x_outsw_debug(struct net_device *dev, int a, |
| 107 | u8 *buf, int wc) |
| 108 | { |
| 109 | struct hostap_interface *iface; |
| 110 | local_info_t *local; |
| 111 | unsigned long flags; |
| 112 | |
| 113 | iface = netdev_priv(dev); |
| 114 | local = iface->local; |
| 115 | spin_lock_irqsave(&local->lock, flags); |
| 116 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTSW, a, wc); |
| 117 | outsw(dev->base_addr + a, buf, wc); |
| 118 | spin_unlock_irqrestore(&local->lock, flags); |
| 119 | } |
| 120 | |
| 121 | static inline void hfa384x_insw_debug(struct net_device *dev, int a, |
| 122 | u8 *buf, int wc) |
| 123 | { |
| 124 | struct hostap_interface *iface; |
| 125 | local_info_t *local; |
| 126 | unsigned long flags; |
| 127 | |
| 128 | iface = netdev_priv(dev); |
| 129 | local = iface->local; |
| 130 | spin_lock_irqsave(&local->lock, flags); |
| 131 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INSW, a, wc); |
| 132 | insw(dev->base_addr + a, buf, wc); |
| 133 | spin_unlock_irqrestore(&local->lock, flags); |
| 134 | } |
| 135 | |
| 136 | #define HFA384X_OUTB(v,a) hfa384x_outb_debug(dev, (a), (v)) |
| 137 | #define HFA384X_INB(a) hfa384x_inb_debug(dev, (a)) |
| 138 | #define HFA384X_OUTW(v,a) hfa384x_outw_debug(dev, (a), (v)) |
| 139 | #define HFA384X_INW(a) hfa384x_inw_debug(dev, (a)) |
| 140 | #define HFA384X_OUTSW(a, buf, wc) hfa384x_outsw_debug(dev, (a), (buf), (wc)) |
| 141 | #define HFA384X_INSW(a, buf, wc) hfa384x_insw_debug(dev, (a), (buf), (wc)) |
| 142 | |
| 143 | #else /* PRISM2_IO_DEBUG */ |
| 144 | |
| 145 | #define HFA384X_OUTB(v,a) outb((v), dev->base_addr + (a)) |
| 146 | #define HFA384X_INB(a) inb(dev->base_addr + (a)) |
| 147 | #define HFA384X_OUTW(v,a) outw((v), dev->base_addr + (a)) |
| 148 | #define HFA384X_INW(a) inw(dev->base_addr + (a)) |
| 149 | #define HFA384X_INSW(a, buf, wc) insw(dev->base_addr + (a), buf, wc) |
| 150 | #define HFA384X_OUTSW(a, buf, wc) outsw(dev->base_addr + (a), buf, wc) |
| 151 | |
| 152 | #endif /* PRISM2_IO_DEBUG */ |
| 153 | |
| 154 | |
| 155 | static int hfa384x_from_bap(struct net_device *dev, u16 bap, void *buf, |
| 156 | int len) |
| 157 | { |
| 158 | u16 d_off; |
| 159 | u16 *pos; |
| 160 | |
| 161 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; |
| 162 | pos = (u16 *) buf; |
| 163 | |
| 164 | if (len / 2) |
| 165 | HFA384X_INSW(d_off, buf, len / 2); |
| 166 | pos += len / 2; |
| 167 | |
| 168 | if (len & 1) |
| 169 | *((char *) pos) = HFA384X_INB(d_off); |
| 170 | |
| 171 | return 0; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | static int hfa384x_to_bap(struct net_device *dev, u16 bap, void *buf, int len) |
| 176 | { |
| 177 | u16 d_off; |
| 178 | u16 *pos; |
| 179 | |
| 180 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; |
| 181 | pos = (u16 *) buf; |
| 182 | |
| 183 | if (len / 2) |
| 184 | HFA384X_OUTSW(d_off, buf, len / 2); |
| 185 | pos += len / 2; |
| 186 | |
| 187 | if (len & 1) |
| 188 | HFA384X_OUTB(*((char *) pos), d_off); |
| 189 | |
| 190 | return 0; |
| 191 | } |
| 192 | |
| 193 | |
| 194 | /* FIX: This might change at some point.. */ |
| 195 | #include "hostap_hw.c" |
| 196 | |
| 197 | |
| 198 | |
Dominik Brodowski | cc3b486 | 2005-11-14 21:23:14 +0100 | [diff] [blame] | 199 | static void prism2_detach(struct pcmcia_device *p_dev); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 200 | static void prism2_release(u_long arg); |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 201 | static int prism2_config(struct pcmcia_device *link); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 202 | |
| 203 | |
| 204 | static int prism2_pccard_card_present(local_info_t *local) |
| 205 | { |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 206 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
Dominik Brodowski | 9940ec3 | 2006-03-05 11:04:33 +0100 | [diff] [blame] | 207 | if (hw_priv != NULL && hw_priv->link != NULL && pcmcia_dev_present(hw_priv->link)) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 208 | return 1; |
| 209 | return 0; |
| 210 | } |
| 211 | |
| 212 | |
| 213 | /* |
| 214 | * SanDisk CompactFlash WLAN Flashcard - Product Manual v1.0 |
| 215 | * Document No. 20-10-00058, January 2004 |
| 216 | * http://www.sandisk.com/pdf/industrial/ProdManualCFWLANv1.0.pdf |
| 217 | */ |
| 218 | #define SANDISK_WLAN_ACTIVATION_OFF 0x40 |
| 219 | #define SANDISK_HCR_OFF 0x42 |
| 220 | |
| 221 | |
| 222 | static void sandisk_set_iobase(local_info_t *local) |
| 223 | { |
| 224 | int res; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 225 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 226 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 227 | res = pcmcia_write_config_byte(hw_priv->link, 0x10, |
Dominik Brodowski | 9a017a9 | 2010-07-24 15:58:54 +0200 | [diff] [blame] | 228 | hw_priv->link->resource[0]->start & 0x00ff); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 229 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 230 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -" |
| 231 | " res=%d\n", res); |
| 232 | } |
| 233 | udelay(10); |
| 234 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 235 | res = pcmcia_write_config_byte(hw_priv->link, 0x12, |
Dominik Brodowski | 9a017a9 | 2010-07-24 15:58:54 +0200 | [diff] [blame] | 236 | (hw_priv->link->resource[0]->start >> 8) & 0x00ff); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 237 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 238 | printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -" |
| 239 | " res=%d\n", res); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | |
| 244 | static void sandisk_write_hcr(local_info_t *local, int hcr) |
| 245 | { |
| 246 | struct net_device *dev = local->dev; |
| 247 | int i; |
| 248 | |
| 249 | HFA384X_OUTB(0x80, SANDISK_WLAN_ACTIVATION_OFF); |
| 250 | udelay(50); |
| 251 | for (i = 0; i < 10; i++) { |
| 252 | HFA384X_OUTB(hcr, SANDISK_HCR_OFF); |
| 253 | } |
| 254 | udelay(55); |
| 255 | HFA384X_OUTB(0x45, SANDISK_WLAN_ACTIVATION_OFF); |
| 256 | } |
| 257 | |
| 258 | |
| 259 | static int sandisk_enable_wireless(struct net_device *dev) |
| 260 | { |
| 261 | int res, ret = 0; |
Yoann Padioleau | 6dbc9c8 | 2007-08-03 19:37:16 +0200 | [diff] [blame] | 262 | struct hostap_interface *iface = netdev_priv(dev); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 263 | local_info_t *local = iface->local; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 264 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 265 | |
Dominik Brodowski | 9a017a9 | 2010-07-24 15:58:54 +0200 | [diff] [blame] | 266 | if (resource_size(hw_priv->link->resource[0]) < 0x42) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 267 | /* Not enough ports to be SanDisk multi-function card */ |
| 268 | ret = -ENODEV; |
| 269 | goto done; |
| 270 | } |
| 271 | |
Dominik Brodowski | efd5058 | 2006-10-25 21:28:53 -0400 | [diff] [blame] | 272 | if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 273 | /* No SanDisk manfid found */ |
| 274 | ret = -ENODEV; |
| 275 | goto done; |
| 276 | } |
| 277 | |
Dominik Brodowski | 7d2e8d0 | 2009-10-18 18:22:32 +0200 | [diff] [blame] | 278 | if (hw_priv->link->socket->functions < 2) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 279 | /* No multi-function links found */ |
| 280 | ret = -ENODEV; |
| 281 | goto done; |
| 282 | } |
| 283 | |
| 284 | printk(KERN_DEBUG "%s: Multi-function SanDisk ConnectPlus detected" |
| 285 | " - using vendor-specific initialization\n", dev->name); |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 286 | hw_priv->sandisk_connectplus = 1; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 287 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 288 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
| 289 | COR_SOFT_RESET); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 290 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 291 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", |
| 292 | dev->name, res); |
| 293 | goto done; |
| 294 | } |
| 295 | mdelay(5); |
| 296 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 297 | /* |
| 298 | * Do not enable interrupts here to avoid some bogus events. Interrupts |
| 299 | * will be enabled during the first cor_sreset call. |
| 300 | */ |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 301 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
| 302 | (COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE | |
| 303 | COR_FUNC_ENA)); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 304 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 305 | printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n", |
| 306 | dev->name, res); |
| 307 | goto done; |
| 308 | } |
| 309 | mdelay(5); |
| 310 | |
| 311 | sandisk_set_iobase(local); |
| 312 | |
| 313 | HFA384X_OUTB(0xc5, SANDISK_WLAN_ACTIVATION_OFF); |
| 314 | udelay(10); |
| 315 | HFA384X_OUTB(0x4b, SANDISK_WLAN_ACTIVATION_OFF); |
| 316 | udelay(10); |
| 317 | |
| 318 | done: |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 319 | return ret; |
| 320 | } |
| 321 | |
| 322 | |
| 323 | static void prism2_pccard_cor_sreset(local_info_t *local) |
| 324 | { |
| 325 | int res; |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 326 | u8 val; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 327 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 328 | |
| 329 | if (!prism2_pccard_card_present(local)) |
| 330 | return; |
| 331 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 332 | res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &val); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 333 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 334 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n", |
| 335 | res); |
| 336 | return; |
| 337 | } |
| 338 | printk(KERN_DEBUG "prism2_pccard_cor_sreset: original COR %02x\n", |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 339 | val); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 340 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 341 | val |= COR_SOFT_RESET; |
| 342 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 343 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 344 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n", |
| 345 | res); |
| 346 | return; |
| 347 | } |
| 348 | |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 349 | mdelay(hw_priv->sandisk_connectplus ? 5 : 2); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 350 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 351 | val &= ~COR_SOFT_RESET; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 352 | if (hw_priv->sandisk_connectplus) |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 353 | val |= COR_IREQ_ENA; |
| 354 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 355 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 356 | printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n", |
| 357 | res); |
| 358 | return; |
| 359 | } |
| 360 | |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 361 | mdelay(hw_priv->sandisk_connectplus ? 5 : 2); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 362 | |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 363 | if (hw_priv->sandisk_connectplus) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 364 | sandisk_set_iobase(local); |
| 365 | } |
| 366 | |
| 367 | |
| 368 | static void prism2_pccard_genesis_reset(local_info_t *local, int hcr) |
| 369 | { |
| 370 | int res; |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 371 | u8 old_cor; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 372 | struct hostap_cs_priv *hw_priv = local->hw_priv; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 373 | |
| 374 | if (!prism2_pccard_card_present(local)) |
| 375 | return; |
| 376 | |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 377 | if (hw_priv->sandisk_connectplus) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 378 | sandisk_write_hcr(local, hcr); |
| 379 | return; |
| 380 | } |
| 381 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 382 | res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &old_cor); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 383 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 384 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 " |
| 385 | "(%d)\n", res); |
| 386 | return; |
| 387 | } |
| 388 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset: original COR %02x\n", |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 389 | old_cor); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 390 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 391 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
| 392 | old_cor | COR_SOFT_RESET); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 393 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 394 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 " |
| 395 | "(%d)\n", res); |
| 396 | return; |
| 397 | } |
| 398 | |
| 399 | mdelay(10); |
| 400 | |
| 401 | /* Setup Genesis mode */ |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 402 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_CCSR, hcr); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 403 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 404 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 " |
| 405 | "(%d)\n", res); |
| 406 | return; |
| 407 | } |
| 408 | mdelay(10); |
| 409 | |
Dominik Brodowski | 1d5cc19 | 2010-07-24 12:23:21 +0200 | [diff] [blame] | 410 | res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, |
| 411 | old_cor & ~COR_SOFT_RESET); |
Dominik Brodowski | 4c89e88 | 2008-08-03 10:07:45 +0200 | [diff] [blame] | 412 | if (res != 0) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 413 | printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 " |
| 414 | "(%d)\n", res); |
| 415 | return; |
| 416 | } |
| 417 | |
| 418 | mdelay(10); |
| 419 | } |
| 420 | |
| 421 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 422 | static struct prism2_helper_functions prism2_pccard_funcs = |
| 423 | { |
| 424 | .card_present = prism2_pccard_card_present, |
| 425 | .cor_sreset = prism2_pccard_cor_sreset, |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 426 | .genesis_reset = prism2_pccard_genesis_reset, |
| 427 | .hw_type = HOSTAP_HW_PCCARD, |
| 428 | }; |
| 429 | |
| 430 | |
| 431 | /* allocate local data and register with CardServices |
| 432 | * initialize dev_link structure, but do not configure the card yet */ |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 433 | static int hostap_cs_probe(struct pcmcia_device *p_dev) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 434 | { |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 435 | int ret; |
| 436 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 437 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 438 | |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 439 | ret = prism2_config(p_dev); |
| 440 | if (ret) { |
Dominik Brodowski | f8cfa61 | 2005-11-14 21:25:51 +0100 | [diff] [blame] | 441 | PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n"); |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 442 | } |
Dominik Brodowski | f8cfa61 | 2005-11-14 21:25:51 +0100 | [diff] [blame] | 443 | |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 444 | return ret; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 448 | static void prism2_detach(struct pcmcia_device *link) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 449 | { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 450 | PDEBUG(DEBUG_FLOW, "prism2_detach\n"); |
| 451 | |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 452 | prism2_release((u_long)link); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 453 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 454 | /* release net devices */ |
| 455 | if (link->priv) { |
Jouni Malinen | c355184 | 2005-10-02 17:19:00 -0700 | [diff] [blame] | 456 | struct hostap_cs_priv *hw_priv; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 457 | struct net_device *dev; |
| 458 | struct hostap_interface *iface; |
| 459 | dev = link->priv; |
| 460 | iface = netdev_priv(dev); |
Jouni Malinen | c355184 | 2005-10-02 17:19:00 -0700 | [diff] [blame] | 461 | hw_priv = iface->local->hw_priv; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 462 | prism2_free_local_data(dev); |
Jouni Malinen | c355184 | 2005-10-02 17:19:00 -0700 | [diff] [blame] | 463 | kfree(hw_priv); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 464 | } |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | |
Dominik Brodowski | 00990e7 | 2010-07-30 13:13:46 +0200 | [diff] [blame] | 468 | static int prism2_config_check(struct pcmcia_device *p_dev, void *priv_data) |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 469 | { |
Dominik Brodowski | 00990e7 | 2010-07-30 13:13:46 +0200 | [diff] [blame] | 470 | if (p_dev->config_index == 0) |
| 471 | return -EINVAL; |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 472 | |
Dominik Brodowski | 90abdc3 | 2010-07-24 17:23:51 +0200 | [diff] [blame] | 473 | return pcmcia_request_io(p_dev); |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 474 | } |
| 475 | |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 476 | static int prism2_config(struct pcmcia_device *link) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 477 | { |
| 478 | struct net_device *dev; |
| 479 | struct hostap_interface *iface; |
| 480 | local_info_t *local; |
| 481 | int ret = 1; |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 482 | struct hostap_cs_priv *hw_priv; |
Tim Gardner | d6a574f | 2010-06-08 11:33:02 -0600 | [diff] [blame] | 483 | unsigned long flags; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 484 | |
| 485 | PDEBUG(DEBUG_FLOW, "prism2_config()\n"); |
| 486 | |
Yan Burman | b0471bb7 | 2006-12-02 13:33:40 +0200 | [diff] [blame] | 487 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 488 | if (hw_priv == NULL) { |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 489 | ret = -ENOMEM; |
| 490 | goto failed; |
| 491 | } |
| 492 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 493 | /* Look for an appropriate configuration table entry in the CIS */ |
Dominik Brodowski | 440eed4 | 2010-07-30 09:51:52 +0200 | [diff] [blame] | 494 | link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | |
Dominik Brodowski | 00990e7 | 2010-07-30 13:13:46 +0200 | [diff] [blame] | 495 | CONF_AUTO_CHECK_VCC | CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; |
Dominik Brodowski | 440eed4 | 2010-07-30 09:51:52 +0200 | [diff] [blame] | 496 | if (ignore_cis_vcc) |
| 497 | link->config_flags &= ~CONF_AUTO_CHECK_VCC; |
Dominik Brodowski | 2caff14 | 2009-10-24 15:53:36 +0200 | [diff] [blame] | 498 | ret = pcmcia_loop_config(link, prism2_config_check, NULL); |
| 499 | if (ret) { |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 500 | if (!ignore_cis_vcc) |
| 501 | printk(KERN_ERR "GetNextTuple(): No matching " |
| 502 | "CIS configuration. Maybe you need the " |
| 503 | "ignore_cis_vcc=1 parameter.\n"); |
Dominik Brodowski | b54bf94 | 2008-08-02 14:28:43 +0200 | [diff] [blame] | 504 | goto failed; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 505 | } |
| 506 | |
| 507 | /* Need to allocate net_device before requesting IRQ handler */ |
Dave Hansen | 0cd545d | 2005-07-30 12:49:58 -0700 | [diff] [blame] | 508 | dev = prism2_init_local_data(&prism2_pccard_funcs, 0, |
Dominik Brodowski | dd2e5a1 | 2009-11-03 10:27:34 +0100 | [diff] [blame] | 509 | &link->dev); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 510 | if (dev == NULL) |
| 511 | goto failed; |
| 512 | link->priv = dev; |
| 513 | |
Jouni Malinen | fbff868 | 2005-08-28 17:53:32 -0700 | [diff] [blame] | 514 | iface = netdev_priv(dev); |
| 515 | local = iface->local; |
| 516 | local->hw_priv = hw_priv; |
| 517 | hw_priv->link = link; |
Jouni Malinen | fbff868 | 2005-08-28 17:53:32 -0700 | [diff] [blame] | 518 | |
Tim Gardner | d6a574f | 2010-06-08 11:33:02 -0600 | [diff] [blame] | 519 | /* |
Stanislaw Gruszka | 4e5518c | 2011-01-10 12:56:05 +0100 | [diff] [blame] | 520 | * We enable IRQ here, but IRQ handler will not proceed |
| 521 | * until dev->base_addr is set below. This protect us from |
| 522 | * receive interrupts when driver is not initialized. |
Tim Gardner | d6a574f | 2010-06-08 11:33:02 -0600 | [diff] [blame] | 523 | */ |
Dominik Brodowski | eb14120 | 2010-03-07 12:21:16 +0100 | [diff] [blame] | 524 | ret = pcmcia_request_irq(link, prism2_interrupt); |
| 525 | if (ret) |
Stanislaw Gruszka | 4e5518c | 2011-01-10 12:56:05 +0100 | [diff] [blame] | 526 | goto failed; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 527 | |
Dominik Brodowski | 1ac71e5 | 2010-07-29 19:27:09 +0200 | [diff] [blame] | 528 | ret = pcmcia_enable_device(link); |
Dominik Brodowski | 2caff14 | 2009-10-24 15:53:36 +0200 | [diff] [blame] | 529 | if (ret) |
Stanislaw Gruszka | 4e5518c | 2011-01-10 12:56:05 +0100 | [diff] [blame] | 530 | goto failed; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 531 | |
Stanislaw Gruszka | 4e5518c | 2011-01-10 12:56:05 +0100 | [diff] [blame] | 532 | spin_lock_irqsave(&local->irq_init_lock, flags); |
Dominik Brodowski | eb14120 | 2010-03-07 12:21:16 +0100 | [diff] [blame] | 533 | dev->irq = link->irq; |
Dominik Brodowski | 9a017a9 | 2010-07-24 15:58:54 +0200 | [diff] [blame] | 534 | dev->base_addr = link->resource[0]->start; |
Tim Gardner | d6a574f | 2010-06-08 11:33:02 -0600 | [diff] [blame] | 535 | spin_unlock_irqrestore(&local->irq_init_lock, flags); |
| 536 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 537 | local->shutdown = 0; |
| 538 | |
| 539 | sandisk_enable_wireless(dev); |
| 540 | |
| 541 | ret = prism2_hw_config(dev, 1); |
Dominik Brodowski | 317b6d6 | 2010-03-20 19:26:51 +0100 | [diff] [blame] | 542 | if (!ret) |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 543 | ret = hostap_hw_ready(dev); |
Dominik Brodowski | 317b6d6 | 2010-03-20 19:26:51 +0100 | [diff] [blame] | 544 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 545 | return ret; |
| 546 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 547 | failed: |
Jouni Malinen | 67e0e47 | 2005-08-14 19:08:41 -0700 | [diff] [blame] | 548 | kfree(hw_priv); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 549 | prism2_release((u_long)link); |
| 550 | return ret; |
| 551 | } |
| 552 | |
| 553 | |
| 554 | static void prism2_release(u_long arg) |
| 555 | { |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 556 | struct pcmcia_device *link = (struct pcmcia_device *)arg; |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 557 | |
| 558 | PDEBUG(DEBUG_FLOW, "prism2_release\n"); |
| 559 | |
| 560 | if (link->priv) { |
| 561 | struct net_device *dev = link->priv; |
| 562 | struct hostap_interface *iface; |
| 563 | |
| 564 | iface = netdev_priv(dev); |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 565 | prism2_hw_shutdown(dev, 0); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 566 | iface->local->shutdown = 1; |
| 567 | } |
| 568 | |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 569 | pcmcia_disable_device(link); |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 570 | PDEBUG(DEBUG_FLOW, "release - done\n"); |
| 571 | } |
| 572 | |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 573 | static int hostap_cs_suspend(struct pcmcia_device *link) |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 574 | { |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 575 | struct net_device *dev = (struct net_device *) link->priv; |
| 576 | int dev_open = 0; |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 577 | struct hostap_interface *iface = NULL; |
| 578 | |
John W. Linville | fcee7a0 | 2008-07-02 11:04:24 -0400 | [diff] [blame] | 579 | if (!dev) |
| 580 | return -ENODEV; |
| 581 | |
| 582 | iface = netdev_priv(dev); |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 583 | |
| 584 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info); |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 585 | if (iface && iface->local) |
| 586 | dev_open = iface->local->num_dev_open > 0; |
| 587 | if (dev_open) { |
| 588 | netif_stop_queue(dev); |
| 589 | netif_device_detach(dev); |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 590 | } |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 591 | prism2_suspend(dev); |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 592 | |
| 593 | return 0; |
| 594 | } |
| 595 | |
Dominik Brodowski | fba395e | 2006-03-31 17:21:06 +0200 | [diff] [blame] | 596 | static int hostap_cs_resume(struct pcmcia_device *link) |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 597 | { |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 598 | struct net_device *dev = (struct net_device *) link->priv; |
| 599 | int dev_open = 0; |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 600 | struct hostap_interface *iface = NULL; |
| 601 | |
John W. Linville | fcee7a0 | 2008-07-02 11:04:24 -0400 | [diff] [blame] | 602 | if (!dev) |
| 603 | return -ENODEV; |
| 604 | |
| 605 | iface = netdev_priv(dev); |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 606 | |
| 607 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info); |
| 608 | |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 609 | if (iface && iface->local) |
| 610 | dev_open = iface->local->num_dev_open > 0; |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 611 | |
Dominik Brodowski | e2d4096 | 2006-03-02 00:09:29 +0100 | [diff] [blame] | 612 | prism2_hw_shutdown(dev, 1); |
| 613 | prism2_hw_config(dev, dev_open ? 0 : 1); |
| 614 | if (dev_open) { |
| 615 | netif_device_attach(dev); |
| 616 | netif_start_queue(dev); |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 617 | } |
| 618 | |
| 619 | return 0; |
| 620 | } |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 621 | |
Joe Perches | 25f8f54 | 2011-05-03 19:29:01 -0700 | [diff] [blame] | 622 | static const struct pcmcia_device_id hostap_cs_ids[] = { |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 623 | PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100), |
| 624 | PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300), |
| 625 | PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), |
| 626 | PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), |
| 627 | PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), |
Stefan Lippers-Hollmann | 46232d2 | 2007-10-05 23:42:51 +0200 | [diff] [blame] | 628 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x3301), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 629 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), |
Richard Purdie | 1e4adbd | 2005-08-04 00:16:27 +0100 | [diff] [blame] | 630 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 631 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), |
| 632 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), |
| 633 | PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), |
| 634 | PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), |
| 635 | PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), |
| 636 | PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001), |
| 637 | PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), |
Komuro | fd99ddd07 | 2006-04-17 21:41:21 +0900 | [diff] [blame] | 638 | /* PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), conflict with pcnet_cs */ |
Pavel Roskin | 449fecc | 2008-05-16 17:52:57 -0400 | [diff] [blame] | 639 | PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 640 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), |
| 641 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), |
| 642 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), |
Christian Steineck | 884d3a2 | 2006-09-08 23:51:34 +0200 | [diff] [blame] | 643 | PCMCIA_DEVICE_MANF_CARD(0x0126, 0x0002), |
Marcin Juszkiewicz | 25ac6c2 | 2007-03-30 15:34:14 +0200 | [diff] [blame] | 644 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0xd601, 0x0005, "ADLINK 345 CF", |
| 645 | 0x2d858104), |
Pavel Roskin | 40e3cad | 2006-02-28 01:18:31 -0500 | [diff] [blame] | 646 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL", |
| 647 | 0x74c5e40d), |
| 648 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil", |
| 649 | 0x4b801a17), |
Pavel Roskin | 0a1013c | 2011-07-26 18:52:41 -0400 | [diff] [blame] | 650 | PCMCIA_DEVICE_MANF_CARD_PROD_ID3(0x0156, 0x0002, "Version 01.02", |
| 651 | 0x4b74baa0), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 652 | PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus", |
| 653 | 0x7a954bd9, 0x74be00c6), |
Pavel Roskin | 17f65f8 | 2008-01-09 22:16:58 -0500 | [diff] [blame] | 654 | PCMCIA_DEVICE_PROD_ID123( |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 655 | "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02", |
| 656 | 0xe6ec52ce, 0x08649af2, 0x4b74baa0), |
| 657 | PCMCIA_DEVICE_PROD_ID123( |
Veli-Pekka Peltola | 090891f | 2011-11-24 21:35:28 +0200 | [diff] [blame] | 658 | "Canon", "Wireless LAN CF Card K30225", "Version 01.00", |
| 659 | 0x96ef6fe2, 0x263fcbab, 0xa57adb8c), |
| 660 | PCMCIA_DEVICE_PROD_ID123( |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 661 | "D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02", |
| 662 | 0x71b18589, 0xb6f1b0ab, 0x4b74baa0), |
| 663 | PCMCIA_DEVICE_PROD_ID123( |
| 664 | "Instant Wireless ", " Network PC CARD", "Version 01.02", |
| 665 | 0x11d901af, 0x6e9bd926, 0x4b74baa0), |
| 666 | PCMCIA_DEVICE_PROD_ID123( |
| 667 | "SMC", "SMC2632W", "Version 01.02", |
| 668 | 0xc4f8b18b, 0x474a1f2a, 0x4b74baa0), |
Richard Purdie | 1e4adbd | 2005-08-04 00:16:27 +0100 | [diff] [blame] | 669 | PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", |
Jouni Malinen | 6c5b90d | 2005-08-28 10:51:36 -0700 | [diff] [blame] | 670 | 0x2decece3, 0x82067c18), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 671 | PCMCIA_DEVICE_PROD_ID12("Compaq", "WL200_11Mbps_Wireless_PCI_Card", |
| 672 | 0x54f7c49c, 0x15a75e5b), |
| 673 | PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", |
| 674 | 0x74c5e40d, 0xdb472a18), |
| 675 | PCMCIA_DEVICE_PROD_ID12("Linksys", "Wireless CompactFlash Card", |
| 676 | 0x0733cc81, 0x0c52f395), |
| 677 | PCMCIA_DEVICE_PROD_ID12( |
| 678 | "ZoomAir 11Mbps High", "Rate wireless Networking", |
| 679 | 0x273fe3db, 0x32a1eaee), |
Cédric Le Goater | 0867c88 | 2014-02-18 10:07:52 +0100 | [diff] [blame^] | 680 | PCMCIA_DEVICE_PROD_ID12("NETGEAR MA401 Wireless PC", "Card", |
| 681 | 0xa37434e9, 0x9762e8f1), |
Marcin Juszkiewicz | df8ccb9 | 2006-05-22 10:56:55 +0200 | [diff] [blame] | 682 | PCMCIA_DEVICE_PROD_ID123( |
| 683 | "Pretec", "CompactWLAN Card 802.11b", "2.5", |
| 684 | 0x1cadd3e5, 0xe697636c, 0x7a5bfcf1), |
| 685 | PCMCIA_DEVICE_PROD_ID123( |
| 686 | "U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02", |
| 687 | 0xc7b8df9d, 0x1700d087, 0x4b74baa0), |
Dominik Brodowski | 01918d1 | 2006-07-02 21:21:51 +0200 | [diff] [blame] | 688 | PCMCIA_DEVICE_PROD_ID123( |
| 689 | "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", |
| 690 | "Ver. 1.00", |
| 691 | 0x5cd01705, 0x4271660f, 0x9d08ee12), |
| 692 | PCMCIA_DEVICE_PROD_ID123( |
Marcin Juszkiewicz | 5d635ea | 2008-01-29 09:42:53 +0100 | [diff] [blame] | 693 | "Wireless LAN" , "11Mbps PC Card", "Version 01.02", |
| 694 | 0x4b8870ff, 0x70e946d1, 0x4b74baa0), |
Pavel Roskin | fbc87d6 | 2010-02-11 17:56:06 -0500 | [diff] [blame] | 695 | PCMCIA_DEVICE_PROD_ID3("HFA3863", 0x355cb092), |
| 696 | PCMCIA_DEVICE_PROD_ID3("ISL37100P", 0x630d52b2), |
| 697 | PCMCIA_DEVICE_PROD_ID3("ISL37101P-10", 0xdd97a26b), |
| 698 | PCMCIA_DEVICE_PROD_ID3("ISL37300P", 0xc9049a39), |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 699 | PCMCIA_DEVICE_NULL |
| 700 | }; |
| 701 | MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids); |
| 702 | |
| 703 | |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 704 | static struct pcmcia_driver hostap_driver = { |
Dominik Brodowski | 2e9b981 | 2010-08-08 11:36:26 +0200 | [diff] [blame] | 705 | .name = "hostap_cs", |
Dominik Brodowski | 15b99ac | 2006-03-31 17:26:06 +0200 | [diff] [blame] | 706 | .probe = hostap_cs_probe, |
Dominik Brodowski | cc3b486 | 2005-11-14 21:23:14 +0100 | [diff] [blame] | 707 | .remove = prism2_detach, |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 708 | .owner = THIS_MODULE, |
Henrik Brix Andersen | 093853c | 2005-07-30 12:49:59 -0700 | [diff] [blame] | 709 | .id_table = hostap_cs_ids, |
Dominik Brodowski | 98e4c28 | 2005-11-14 21:21:18 +0100 | [diff] [blame] | 710 | .suspend = hostap_cs_suspend, |
| 711 | .resume = hostap_cs_resume, |
Jouni Malinen | ff1d276 | 2005-05-12 22:54:16 -0400 | [diff] [blame] | 712 | }; |
H Hartley Sweeten | fdd3f29 | 2013-03-06 11:27:43 -0700 | [diff] [blame] | 713 | module_pcmcia_driver(hostap_driver); |