aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/atmel_cs.c
diff options
context:
space:
mode:
authorsimon@thekelleys.org.uk <simon@thekelleys.org.uk>2005-10-30 10:50:15 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-11 08:12:17 -0500
commitb16a228d05a95b27d77d07a91688382f68ece8a7 (patch)
treea76708ef80110839f6f8cc88da292962548d51f5 /drivers/net/wireless/atmel_cs.c
parent741b2252a5e14d6c60a913c77a6099abe73a854a (diff)
[PATCH] Atmel wireless update
* Merge PCMCIA card table with new Brodowski PCMCIA id table. * Add missing entries to PCMCIA id table. * Other tweaks to conform with Documentation/driver-changes.txt (types, call request_region, etc) * Fix size of requested IO region. * Reduce printk verbosity. * Remove EXPERIMENTAL * tweak to association code - don't force shared key authentication when wep in use. Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/atmel_cs.c')
-rw-r--r--drivers/net/wireless/atmel_cs.c176
1 files changed, 47 insertions, 129 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ff031a3985b3..0c3301ef70cc 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -63,6 +63,7 @@
63 be present but disabled -- but it can then be enabled for specific 63 be present but disabled -- but it can then be enabled for specific
64 modules at load time with a 'pc_debug=#' option to insmod. 64 modules at load time with a 'pc_debug=#' option to insmod.
65*/ 65*/
66
66#ifdef PCMCIA_DEBUG 67#ifdef PCMCIA_DEBUG
67static int pc_debug = PCMCIA_DEBUG; 68static int pc_debug = PCMCIA_DEBUG;
68module_param(pc_debug, int, 0); 69module_param(pc_debug, int, 0);
@@ -288,41 +289,6 @@ static int card_present(void *arg)
288 return 0; 289 return 0;
289} 290}
290 291
291/* list of cards we know about and their firmware requirements.
292 Go either by Manfid or version strings.
293 Cards not in this list will need a firmware parameter to the module
294 in all probability. Note that the SMC 2632 V2 and V3 have the same
295 manfids, so we ignore those and use the version1 strings. */
296
297static struct {
298 int manf, card;
299 char *ver1;
300 AtmelFWType firmware;
301 char *name;
302} card_table[] = {
303 { 0, 0, "WLAN/802.11b PC CARD", ATMEL_FW_TYPE_502D, "Actiontec 802CAT1" },
304 { 0, 0, "ATMEL/AT76C502AR", ATMEL_FW_TYPE_502, "NoName-RFMD" },
305 { 0, 0, "ATMEL/AT76C502AR_D", ATMEL_FW_TYPE_502D, "NoName-revD" },
306 { 0, 0, "ATMEL/AT76C502AR_E", ATMEL_FW_TYPE_502E, "NoName-revE" },
307 { 0, 0, "ATMEL/AT76C504", ATMEL_FW_TYPE_504, "NoName-504" },
308 { 0, 0, "ATMEL/AT76C504A", ATMEL_FW_TYPE_504A_2958, "NoName-504a-2958" },
309 { 0, 0, "ATMEL/AT76C504_R", ATMEL_FW_TYPE_504_2958, "NoName-504-2958" },
310 { MANFID_3COM, 0x0620, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRWE62092B" },
311 { MANFID_3COM, 0x0696, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRSHPW196" },
312 { 0, 0, "SMC/2632W-V2", ATMEL_FW_TYPE_502, "SMC 2632W-V2" },
313 { 0, 0, "SMC/2632W", ATMEL_FW_TYPE_502D, "SMC 2632W-V3" },
314 { 0xd601, 0x0007, NULL, ATMEL_FW_TYPE_502, "Sitecom WLAN-011" },
315 { 0x01bf, 0x3302, NULL, ATMEL_FW_TYPE_502E, "Belkin F5D6020-V2" },
316 { 0, 0, "BT/Voyager 1020 Laptop Adapter", ATMEL_FW_TYPE_502, "BT Voyager 1020" },
317 { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", ATMEL_FW_TYPE_502, "Siemens Gigaset PC Card II" },
318 { 0, 0, "IEEE 802.11b/Wireless LAN Card S", ATMEL_FW_TYPE_504_2958, "Siemens Gigaset PC Card II" },
319 { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", ATMEL_FW_TYPE_502E, "CNet CNWLC-811ARL" },
320 { 0, 0, "Wireless/PC_CARD", ATMEL_FW_TYPE_502D, "Planet WL-3552" },
321 { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", ATMEL_FW_TYPE_502, "OEM 11Mbps WLAN PCMCIA Card" },
322 { 0, 0, "11WAVE/11WP611AL-E", ATMEL_FW_TYPE_502E, "11WAVE WaveBuddy" },
323 { 0, 0, "LG/LW2100N", ATMEL_FW_TYPE_502E, "LG LW2100N 11Mbps WLAN PCMCIA Card" },
324};
325
326static void atmel_config(dev_link_t *link) 292static void atmel_config(dev_link_t *link)
327{ 293{
328 client_handle_t handle; 294 client_handle_t handle;
@@ -331,10 +297,11 @@ static void atmel_config(dev_link_t *link)
331 local_info_t *dev; 297 local_info_t *dev;
332 int last_fn, last_ret; 298 int last_fn, last_ret;
333 u_char buf[64]; 299 u_char buf[64];
334 int card_index = -1, done = 0; 300 struct pcmcia_device_id *did;
335 301
336 handle = link->handle; 302 handle = link->handle;
337 dev = link->priv; 303 dev = link->priv;
304 did = handle_to_dev(handle).driver_data;
338 305
339 DEBUG(0, "atmel_config(0x%p)\n", link); 306 DEBUG(0, "atmel_config(0x%p)\n", link);
340 307
@@ -343,59 +310,6 @@ static void atmel_config(dev_link_t *link)
343 tuple.TupleDataMax = sizeof(buf); 310 tuple.TupleDataMax = sizeof(buf);
344 tuple.TupleOffset = 0; 311 tuple.TupleOffset = 0;
345 312
346 tuple.DesiredTuple = CISTPL_MANFID;
347 if (pcmcia_get_first_tuple(handle, &tuple) == 0) {
348 int i;
349 cistpl_manfid_t *manfid;
350 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
351 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
352 manfid = &(parse.manfid);
353 for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
354 if (!card_table[i].ver1 &&
355 manfid->manf == card_table[i].manf &&
356 manfid->card == card_table[i].card) {
357 card_index = i;
358 done = 1;
359 }
360 }
361 }
362
363 tuple.DesiredTuple = CISTPL_VERS_1;
364 if (!done && (pcmcia_get_first_tuple(handle, &tuple) == 0)) {
365 int i, j, k;
366 cistpl_vers_1_t *ver1;
367 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
368 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
369 ver1 = &(parse.version_1);
370
371 for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
372 for (j = 0; j < ver1->ns; j++) {
373 char *p = card_table[i].ver1;
374 char *q = &ver1->str[ver1->ofs[j]];
375 if (!p)
376 goto mismatch;
377 for (k = 0; k < j; k++) {
378 while ((*p != '\0') && (*p != '/')) p++;
379 if (*p == '\0') {
380 if (*q != '\0')
381 goto mismatch;
382 } else {
383 p++;
384 }
385 }
386 while((*q != '\0') && (*p != '\0') &&
387 (*p != '/') && (*p == *q)) p++, q++;
388 if (((*p != '\0') && *p != '/') || *q != '\0')
389 goto mismatch;
390 }
391 card_index = i;
392 break; /* done */
393
394 mismatch:
395 j = 0; /* dummy stmt to shut up compiler */
396 }
397 }
398
399 /* 313 /*
400 This reads the card's CONFIG tuple to find its configuration 314 This reads the card's CONFIG tuple to find its configuration
401 registers. 315 registers.
@@ -512,12 +426,13 @@ static void atmel_config(dev_link_t *link)
512 ((local_info_t*)link->priv)->eth_dev = 426 ((local_info_t*)link->priv)->eth_dev =
513 init_atmel_card(link->irq.AssignedIRQ, 427 init_atmel_card(link->irq.AssignedIRQ,
514 link->io.BasePort1, 428 link->io.BasePort1,
515 card_index == -1 ? ATMEL_FW_TYPE_NONE : card_table[card_index].firmware, 429 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
516 &handle_to_dev(handle), 430 &handle_to_dev(handle),
517 card_present, 431 card_present,
518 link); 432 link);
519 if (!((local_info_t*)link->priv)->eth_dev) 433 if (!((local_info_t*)link->priv)->eth_dev)
520 goto cs_failed; 434 goto cs_failed;
435
521 436
522 /* 437 /*
523 At this point, the dev_node_t structure(s) need to be 438 At this point, the dev_node_t structure(s) need to be
@@ -526,26 +441,7 @@ static void atmel_config(dev_link_t *link)
526 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); 441 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
527 dev->node.major = dev->node.minor = 0; 442 dev->node.major = dev->node.minor = 0;
528 link->dev = &dev->node; 443 link->dev = &dev->node;
529 444
530 /* Finally, report what we've done */
531 printk(KERN_INFO "%s: %s%sindex 0x%02x: Vcc %d.%d",
532 dev->node.dev_name,
533 card_index == -1 ? "" : card_table[card_index].name,
534 card_index == -1 ? "" : " ",
535 link->conf.ConfigIndex,
536 link->conf.Vcc/10, link->conf.Vcc%10);
537 if (link->conf.Vpp1)
538 printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
539 if (link->conf.Attributes & CONF_ENABLE_IRQ)
540 printk(", irq %d", link->irq.AssignedIRQ);
541 if (link->io.NumPorts1)
542 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
543 link->io.BasePort1+link->io.NumPorts1-1);
544 if (link->io.NumPorts2)
545 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
546 link->io.BasePort2+link->io.NumPorts2-1);
547 printk("\n");
548
549 link->state &= ~DEV_CONFIG_PENDING; 445 link->state &= ~DEV_CONFIG_PENDING;
550 return; 446 return;
551 447
@@ -572,7 +468,7 @@ static void atmel_release(dev_link_t *link)
572 link->dev = NULL; 468 link->dev = NULL;
573 469
574 if (dev) 470 if (dev)
575 stop_atmel_card(dev, 0); 471 stop_atmel_card(dev);
576 ((local_info_t*)link->priv)->eth_dev = NULL; 472 ((local_info_t*)link->priv)->eth_dev = NULL;
577 473
578 /* Don't bother checking to see if these succeed or not */ 474 /* Don't bother checking to see if these succeed or not */
@@ -640,25 +536,47 @@ static int atmel_event(event_t event, int priority,
640} /* atmel_event */ 536} /* atmel_event */
641 537
642/*====================================================================*/ 538/*====================================================================*/
539/* We use the driver_info field to store the correct firmware type for a card. */
540
541#define PCMCIA_DEVICE_MANF_CARD_INFO(manf, card, info) { \
542 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
543 PCMCIA_DEV_ID_MATCH_CARD_ID, \
544 .manf_id = (manf), \
545 .card_id = (card), \
546 .driver_info = (kernel_ulong_t)(info), }
547
548#define PCMCIA_DEVICE_PROD_ID12_INFO(v1, v2, vh1, vh2, info) { \
549 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
550 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
551 .prod_id = { (v1), (v2), NULL, NULL }, \
552 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
553 .driver_info = (kernel_ulong_t)(info), }
554
643static struct pcmcia_device_id atmel_ids[] = { 555static struct pcmcia_device_id atmel_ids[] = {
644 PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0620), 556 PCMCIA_DEVICE_MANF_CARD_INFO(0x0101, 0x0620, ATMEL_FW_TYPE_502_3COM),
645 PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0696), 557 PCMCIA_DEVICE_MANF_CARD_INFO(0x0101, 0x0696, ATMEL_FW_TYPE_502_3COM),
646 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x3302), 558 PCMCIA_DEVICE_MANF_CARD_INFO(0x01bf, 0x3302, ATMEL_FW_TYPE_502E),
647 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0007), 559 PCMCIA_DEVICE_MANF_CARD_INFO(0xd601, 0x0007, ATMEL_FW_TYPE_502),
648 PCMCIA_DEVICE_PROD_ID12("11WAVE", "11WP611AL-E", 0x9eb2da1f, 0xc9a0d3f9), 560 PCMCIA_DEVICE_PROD_ID12_INFO("11WAVE", "11WP611AL-E", 0x9eb2da1f, 0xc9a0d3f9, ATMEL_FW_TYPE_502E),
649 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C502AR", 0xabda4164, 0x41b37e1f), 561 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR", 0xabda4164, 0x41b37e1f, ATMEL_FW_TYPE_502),
650 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C504", 0xabda4164, 0x5040670a), 562 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR_D", 0xabda4164, 0x3675d704, ATMEL_FW_TYPE_502D),
651 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C504A", 0xabda4164, 0xe15ed87f), 563 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR_E", 0xabda4164, 0x4172e792, ATMEL_FW_TYPE_502E),
652 PCMCIA_DEVICE_PROD_ID12("BT", "Voyager 1020 Laptop Adapter", 0xae49b86a, 0x1e957cd5), 564 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504_R", 0xabda4164, 0x917f3d72, ATMEL_FW_TYPE_504_2958),
653 PCMCIA_DEVICE_PROD_ID12("CNet", "CNWLC 11Mbps Wireless PC Card V-5", 0xbc477dde, 0x502fae6b), 565 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504", 0xabda4164, 0x5040670a, ATMEL_FW_TYPE_504),
654 PCMCIA_DEVICE_PROD_ID12("IEEE 802.11b", "Wireless LAN PC Card", 0x5b878724, 0x122f1df6), 566 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504A", 0xabda4164, 0xe15ed87f, ATMEL_FW_TYPE_504A_2958),
655 PCMCIA_DEVICE_PROD_ID12("OEM", "11Mbps Wireless LAN PC Card V-3", 0xfea54c90, 0x1c5b0f68), 567 PCMCIA_DEVICE_PROD_ID12_INFO("BT", "Voyager 1020 Laptop Adapter", 0xae49b86a, 0x1e957cd5, ATMEL_FW_TYPE_502),
656 PCMCIA_DEVICE_PROD_ID12("SMC", "2632W", 0xc4f8b18b, 0x30f38774), 568 PCMCIA_DEVICE_PROD_ID12_INFO("CNet", "CNWLC 11Mbps Wireless PC Card V-5", 0xbc477dde, 0x502fae6b, ATMEL_FW_TYPE_502E),
657 PCMCIA_DEVICE_PROD_ID12("SMC", "2632W-V2", 0xc4f8b18b, 0x172d1377), 569 PCMCIA_DEVICE_PROD_ID12_INFO("IEEE 802.11b", "Wireless LAN PC Card", 0x5b878724, 0x122f1df6, ATMEL_FW_TYPE_502),
658 PCMCIA_DEVICE_PROD_ID12("Wireless", "PC", 0xa407ecdd, 0x556e4d7e), 570 PCMCIA_DEVICE_PROD_ID12_INFO("IEEE 802.11b", "Wireless LAN Card S", 0x5b878724, 0x5fba533a, ATMEL_FW_TYPE_504_2958),
659 PCMCIA_DEVICE_PROD_ID12("WLAN", "802.11b PC CARD", 0x575c516c, 0xb1f6dbc4), 571 PCMCIA_DEVICE_PROD_ID12_INFO("OEM", "11Mbps Wireless LAN PC Card V-3", 0xfea54c90, 0x1c5b0f68, ATMEL_FW_TYPE_502),
572 PCMCIA_DEVICE_PROD_ID12_INFO("SMC", "2632W", 0xc4f8b18b, 0x30f38774, ATMEL_FW_TYPE_502D),
573 PCMCIA_DEVICE_PROD_ID12_INFO("SMC", "2632W-V2", 0xc4f8b18b, 0x172d1377, ATMEL_FW_TYPE_502),
574 PCMCIA_DEVICE_PROD_ID12_INFO("Wireless", "PC_CARD", 0xa407ecdd, 0x119f6314, ATMEL_FW_TYPE_502D),
575 PCMCIA_DEVICE_PROD_ID12_INFO("WLAN", "802.11b PC CARD", 0x575c516c, 0xb1f6dbc4, ATMEL_FW_TYPE_502D),
576 PCMCIA_DEVICE_PROD_ID12_INFO("LG", "LW2100N", 0xb474d43a, 0x6b1fec94, ATMEL_FW_TYPE_502E),
660 PCMCIA_DEVICE_NULL 577 PCMCIA_DEVICE_NULL
661}; 578};
579
662MODULE_DEVICE_TABLE(pcmcia, atmel_ids); 580MODULE_DEVICE_TABLE(pcmcia, atmel_ids);
663 581
664static struct pcmcia_driver atmel_driver = { 582static struct pcmcia_driver atmel_driver = {