aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_cs.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wireless/hostap/hostap_cs.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_cs.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c69
1 files changed, 16 insertions, 53 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index ad8eab4a639b..a36501dbbe02 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -3,6 +3,7 @@
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/if.h> 5#include <linux/if.h>
6#include <linux/slab.h>
6#include <linux/wait.h> 7#include <linux/wait.h>
7#include <linux/timer.h> 8#include <linux/timer.h>
8#include <linux/skbuff.h> 9#include <linux/skbuff.h>
@@ -274,9 +275,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
274 conf_reg_t reg; 275 conf_reg_t reg;
275 struct hostap_interface *iface = netdev_priv(dev); 276 struct hostap_interface *iface = netdev_priv(dev);
276 local_info_t *local = iface->local; 277 local_info_t *local = iface->local;
277 tuple_t tuple;
278 cisparse_t *parse = NULL;
279 u_char buf[64];
280 struct hostap_cs_priv *hw_priv = local->hw_priv; 278 struct hostap_cs_priv *hw_priv = local->hw_priv;
281 279
282 if (hw_priv->link->io.NumPorts1 < 0x42) { 280 if (hw_priv->link->io.NumPorts1 < 0x42) {
@@ -285,28 +283,13 @@ static int sandisk_enable_wireless(struct net_device *dev)
285 goto done; 283 goto done;
286 } 284 }
287 285
288 parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL);
289 if (parse == NULL) {
290 ret = -ENOMEM;
291 goto done;
292 }
293
294 tuple.Attributes = TUPLE_RETURN_COMMON;
295 tuple.TupleData = buf;
296 tuple.TupleDataMax = sizeof(buf);
297 tuple.TupleOffset = 0;
298
299 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) { 286 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) {
300 /* No SanDisk manfid found */ 287 /* No SanDisk manfid found */
301 ret = -ENODEV; 288 ret = -ENODEV;
302 goto done; 289 goto done;
303 } 290 }
304 291
305 tuple.DesiredTuple = CISTPL_LONGLINK_MFC; 292 if (hw_priv->link->socket->functions < 2) {
306 if (pcmcia_get_first_tuple(hw_priv->link, &tuple) ||
307 pcmcia_get_tuple_data(hw_priv->link, &tuple) ||
308 pcmcia_parse_tuple(&tuple, parse) ||
309 parse->longlink_mfc.nfn < 2) {
310 /* No multi-function links found */ 293 /* No multi-function links found */
311 ret = -ENODEV; 294 ret = -ENODEV;
312 goto done; 295 goto done;
@@ -354,7 +337,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
354 udelay(10); 337 udelay(10);
355 338
356done: 339done:
357 kfree(parse);
358 return ret; 340 return ret;
359} 341}
360 342
@@ -529,10 +511,6 @@ static void prism2_detach(struct pcmcia_device *link)
529} 511}
530 512
531 513
532#define CS_CHECK(fn, ret) \
533do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
534
535
536/* run after a CARD_INSERTION event is received to configure the PCMCIA 514/* run after a CARD_INSERTION event is received to configure the PCMCIA
537 * socket and make the device available to the system */ 515 * socket and make the device available to the system */
538 516
@@ -624,7 +602,6 @@ static int prism2_config(struct pcmcia_device *link)
624 struct hostap_interface *iface; 602 struct hostap_interface *iface;
625 local_info_t *local; 603 local_info_t *local;
626 int ret = 1; 604 int ret = 1;
627 int last_fn, last_ret;
628 struct hostap_cs_priv *hw_priv; 605 struct hostap_cs_priv *hw_priv;
629 606
630 PDEBUG(DEBUG_FLOW, "prism2_config()\n"); 607 PDEBUG(DEBUG_FLOW, "prism2_config()\n");
@@ -636,19 +613,18 @@ static int prism2_config(struct pcmcia_device *link)
636 } 613 }
637 614
638 /* Look for an appropriate configuration table entry in the CIS */ 615 /* Look for an appropriate configuration table entry in the CIS */
639 last_ret = pcmcia_loop_config(link, prism2_config_check, NULL); 616 ret = pcmcia_loop_config(link, prism2_config_check, NULL);
640 if (last_ret) { 617 if (ret) {
641 if (!ignore_cis_vcc) 618 if (!ignore_cis_vcc)
642 printk(KERN_ERR "GetNextTuple(): No matching " 619 printk(KERN_ERR "GetNextTuple(): No matching "
643 "CIS configuration. Maybe you need the " 620 "CIS configuration. Maybe you need the "
644 "ignore_cis_vcc=1 parameter.\n"); 621 "ignore_cis_vcc=1 parameter.\n");
645 cs_error(link, RequestIO, last_ret);
646 goto failed; 622 goto failed;
647 } 623 }
648 624
649 /* Need to allocate net_device before requesting IRQ handler */ 625 /* Need to allocate net_device before requesting IRQ handler */
650 dev = prism2_init_local_data(&prism2_pccard_funcs, 0, 626 dev = prism2_init_local_data(&prism2_pccard_funcs, 0,
651 &handle_to_dev(link)); 627 &link->dev);
652 if (dev == NULL) 628 if (dev == NULL)
653 goto failed; 629 goto failed;
654 link->priv = dev; 630 link->priv = dev;
@@ -666,13 +642,11 @@ static int prism2_config(struct pcmcia_device *link)
666 * irq structure is initialized. 642 * irq structure is initialized.
667 */ 643 */
668 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 644 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
669 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | 645 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
670 IRQ_HANDLE_PRESENT;
671 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
672 link->irq.Handler = prism2_interrupt; 646 link->irq.Handler = prism2_interrupt;
673 link->irq.Instance = dev; 647 ret = pcmcia_request_irq(link, &link->irq);
674 CS_CHECK(RequestIRQ, 648 if (ret)
675 pcmcia_request_irq(link, &link->irq)); 649 goto failed;
676 } 650 }
677 651
678 /* 652 /*
@@ -680,8 +654,9 @@ static int prism2_config(struct pcmcia_device *link)
680 * the I/O windows and the interrupt mapping, and putting the 654 * the I/O windows and the interrupt mapping, and putting the
681 * card and host interface into "Memory and IO" mode. 655 * card and host interface into "Memory and IO" mode.
682 */ 656 */
683 CS_CHECK(RequestConfiguration, 657 ret = pcmcia_request_configuration(link, &link->conf);
684 pcmcia_request_configuration(link, &link->conf)); 658 if (ret)
659 goto failed;
685 660
686 dev->irq = link->irq.AssignedIRQ; 661 dev->irq = link->irq.AssignedIRQ;
687 dev->base_addr = link->io.BasePort1; 662 dev->base_addr = link->io.BasePort1;
@@ -714,9 +689,6 @@ static int prism2_config(struct pcmcia_device *link)
714 } 689 }
715 return ret; 690 return ret;
716 691
717 cs_failed:
718 cs_error(link, last_fn, last_ret);
719
720 failed: 692 failed:
721 kfree(hw_priv); 693 kfree(hw_priv);
722 prism2_release((u_long)link); 694 prism2_release((u_long)link);
@@ -823,13 +795,6 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
823 PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus", 795 PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus",
824 0x7a954bd9, 0x74be00c6), 796 0x7a954bd9, 0x74be00c6),
825 PCMCIA_DEVICE_PROD_ID123( 797 PCMCIA_DEVICE_PROD_ID123(
826 "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P",
827 0x4b801a17, 0x6345a0bf, 0xc9049a39),
828 /* D-Link DWL-650 Rev. P1; manfid 0x000b, 0x7110 */
829 PCMCIA_DEVICE_PROD_ID123(
830 "D-Link", "DWL-650 Wireless PC Card RevP", "ISL37101P-10",
831 0x1a424a1c, 0x6ea57632, 0xdd97a26b),
832 PCMCIA_DEVICE_PROD_ID123(
833 "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02", 798 "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02",
834 0xe6ec52ce, 0x08649af2, 0x4b74baa0), 799 0xe6ec52ce, 0x08649af2, 0x4b74baa0),
835 PCMCIA_DEVICE_PROD_ID123( 800 PCMCIA_DEVICE_PROD_ID123(
@@ -863,14 +828,12 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
863 "Ver. 1.00", 828 "Ver. 1.00",
864 0x5cd01705, 0x4271660f, 0x9d08ee12), 829 0x5cd01705, 0x4271660f, 0x9d08ee12),
865 PCMCIA_DEVICE_PROD_ID123( 830 PCMCIA_DEVICE_PROD_ID123(
866 "corega", "WL PCCL-11", "ISL37300P",
867 0xa21501a, 0x59868926, 0xc9049a39),
868 PCMCIA_DEVICE_PROD_ID123(
869 "The Linksys Group, Inc.", "Wireless Network CF Card", "ISL37300P",
870 0xa5f472c2, 0x9c05598d, 0xc9049a39),
871 PCMCIA_DEVICE_PROD_ID123(
872 "Wireless LAN" , "11Mbps PC Card", "Version 01.02", 831 "Wireless LAN" , "11Mbps PC Card", "Version 01.02",
873 0x4b8870ff, 0x70e946d1, 0x4b74baa0), 832 0x4b8870ff, 0x70e946d1, 0x4b74baa0),
833 PCMCIA_DEVICE_PROD_ID3("HFA3863", 0x355cb092),
834 PCMCIA_DEVICE_PROD_ID3("ISL37100P", 0x630d52b2),
835 PCMCIA_DEVICE_PROD_ID3("ISL37101P-10", 0xdd97a26b),
836 PCMCIA_DEVICE_PROD_ID3("ISL37300P", 0xc9049a39),
874 PCMCIA_DEVICE_NULL 837 PCMCIA_DEVICE_NULL
875}; 838};
876MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids); 839MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);