diff options
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 12 | ||||
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 64 | ||||
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 62 | ||||
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 27 | ||||
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 7 |
5 files changed, 74 insertions, 98 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index d52e90a5a617..4104b7feae67 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
40 | #include <linux/io.h> | 40 | #include <linux/io.h> |
41 | 41 | ||
42 | #include <pcmcia/cs.h> | ||
43 | #include <pcmcia/cistpl.h> | 42 | #include <pcmcia/cistpl.h> |
44 | #include <pcmcia/ciscode.h> | 43 | #include <pcmcia/ciscode.h> |
45 | #include <pcmcia/ds.h> | 44 | #include <pcmcia/ds.h> |
@@ -865,8 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link) | |||
865 | info->p_dev = link; | 864 | info->p_dev = link; |
866 | link->priv = info; | 865 | link->priv = info; |
867 | 866 | ||
868 | link->conf.Attributes = CONF_ENABLE_IRQ; | 867 | link->config_flags |= CONF_ENABLE_IRQ; |
869 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
870 | 868 | ||
871 | return bluecard_config(link); | 869 | return bluecard_config(link); |
872 | } | 870 | } |
@@ -886,7 +884,7 @@ static int bluecard_config(struct pcmcia_device *link) | |||
886 | bluecard_info_t *info = link->priv; | 884 | bluecard_info_t *info = link->priv; |
887 | int i, n; | 885 | int i, n; |
888 | 886 | ||
889 | link->conf.ConfigIndex = 0x20; | 887 | link->config_index = 0x20; |
890 | 888 | ||
891 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 889 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
892 | link->resource[0]->end = 64; | 890 | link->resource[0]->end = 64; |
@@ -906,7 +904,7 @@ static int bluecard_config(struct pcmcia_device *link) | |||
906 | if (i != 0) | 904 | if (i != 0) |
907 | goto failed; | 905 | goto failed; |
908 | 906 | ||
909 | i = pcmcia_request_configuration(link, &link->conf); | 907 | i = pcmcia_enable_device(link); |
910 | if (i != 0) | 908 | if (i != 0) |
911 | goto failed; | 909 | goto failed; |
912 | 910 | ||
@@ -942,9 +940,7 @@ MODULE_DEVICE_TABLE(pcmcia, bluecard_ids); | |||
942 | 940 | ||
943 | static struct pcmcia_driver bluecard_driver = { | 941 | static struct pcmcia_driver bluecard_driver = { |
944 | .owner = THIS_MODULE, | 942 | .owner = THIS_MODULE, |
945 | .drv = { | 943 | .name = "bluecard_cs", |
946 | .name = "bluecard_cs", | ||
947 | }, | ||
948 | .probe = bluecard_probe, | 944 | .probe = bluecard_probe, |
949 | .remove = bluecard_detach, | 945 | .remove = bluecard_detach, |
950 | .id_table = bluecard_ids, | 946 | .id_table = bluecard_ids, |
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 7ab8f29d5e0d..0c8a65587491 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/device.h> | 45 | #include <linux/device.h> |
46 | #include <linux/firmware.h> | 46 | #include <linux/firmware.h> |
47 | 47 | ||
48 | #include <pcmcia/cs.h> | ||
49 | #include <pcmcia/cistpl.h> | 48 | #include <pcmcia/cistpl.h> |
50 | #include <pcmcia/ciscode.h> | 49 | #include <pcmcia/ciscode.h> |
51 | #include <pcmcia/ds.h> | 50 | #include <pcmcia/ds.h> |
@@ -657,11 +656,8 @@ static int bt3c_probe(struct pcmcia_device *link) | |||
657 | info->p_dev = link; | 656 | info->p_dev = link; |
658 | link->priv = info; | 657 | link->priv = info; |
659 | 658 | ||
660 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 659 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | |
661 | link->resource[0]->end = 8; | 660 | CONF_AUTO_SET_IO; |
662 | |||
663 | link->conf.Attributes = CONF_ENABLE_IRQ; | ||
664 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
665 | 661 | ||
666 | return bt3c_config(link); | 662 | return bt3c_config(link); |
667 | } | 663 | } |
@@ -675,43 +671,41 @@ static void bt3c_detach(struct pcmcia_device *link) | |||
675 | kfree(info); | 671 | kfree(info); |
676 | } | 672 | } |
677 | 673 | ||
678 | static int bt3c_check_config(struct pcmcia_device *p_dev, | 674 | static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data) |
679 | cistpl_cftable_entry_t *cf, | ||
680 | cistpl_cftable_entry_t *dflt, | ||
681 | unsigned int vcc, | ||
682 | void *priv_data) | ||
683 | { | 675 | { |
684 | unsigned long try = (unsigned long) priv_data; | 676 | int *try = priv_data; |
685 | 677 | ||
686 | p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 678 | if (try == 0) |
679 | p_dev->io_lines = 16; | ||
687 | 680 | ||
688 | if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) | 681 | if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0)) |
689 | p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; | 682 | return -EINVAL; |
690 | if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && | 683 | |
691 | (cf->io.win[0].base != 0)) { | 684 | p_dev->resource[0]->end = 8; |
692 | p_dev->resource[0]->start = cf->io.win[0].base; | 685 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
693 | if (!pcmcia_request_io(p_dev)) | 686 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
694 | return 0; | 687 | |
695 | } | 688 | return pcmcia_request_io(p_dev); |
696 | return -ENODEV; | ||
697 | } | 689 | } |
698 | 690 | ||
699 | static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, | 691 | static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, |
700 | cistpl_cftable_entry_t *cf, | ||
701 | cistpl_cftable_entry_t *dflt, | ||
702 | unsigned int vcc, | ||
703 | void *priv_data) | 692 | void *priv_data) |
704 | { | 693 | { |
705 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 694 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
706 | int j; | 695 | int j; |
707 | 696 | ||
708 | if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { | 697 | if (p_dev->io_lines > 3) |
709 | for (j = 0; j < 5; j++) { | 698 | return -ENODEV; |
710 | p_dev->resource[0]->start = base[j]; | 699 | |
711 | p_dev->io_lines = base[j] ? 16 : 3; | 700 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
712 | if (!pcmcia_request_io(p_dev)) | 701 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
713 | return 0; | 702 | p_dev->resource[0]->end = 8; |
714 | } | 703 | |
704 | for (j = 0; j < 5; j++) { | ||
705 | p_dev->resource[0]->start = base[j]; | ||
706 | p_dev->io_lines = base[j] ? 16 : 3; | ||
707 | if (!pcmcia_request_io(p_dev)) | ||
708 | return 0; | ||
715 | } | 709 | } |
716 | return -ENODEV; | 710 | return -ENODEV; |
717 | } | 711 | } |
@@ -742,7 +736,7 @@ found_port: | |||
742 | if (i != 0) | 736 | if (i != 0) |
743 | goto failed; | 737 | goto failed; |
744 | 738 | ||
745 | i = pcmcia_request_configuration(link, &link->conf); | 739 | i = pcmcia_enable_device(link); |
746 | if (i != 0) | 740 | if (i != 0) |
747 | goto failed; | 741 | goto failed; |
748 | 742 | ||
@@ -775,9 +769,7 @@ MODULE_DEVICE_TABLE(pcmcia, bt3c_ids); | |||
775 | 769 | ||
776 | static struct pcmcia_driver bt3c_driver = { | 770 | static struct pcmcia_driver bt3c_driver = { |
777 | .owner = THIS_MODULE, | 771 | .owner = THIS_MODULE, |
778 | .drv = { | 772 | .name = "bt3c_cs", |
779 | .name = "bt3c_cs", | ||
780 | }, | ||
781 | .probe = bt3c_probe, | 773 | .probe = bt3c_probe, |
782 | .remove = bt3c_detach, | 774 | .remove = bt3c_detach, |
783 | .id_table = bt3c_ids, | 775 | .id_table = bt3c_ids, |
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 1c4f5e863b03..f8a0708e2311 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <asm/system.h> | 41 | #include <asm/system.h> |
42 | #include <asm/io.h> | 42 | #include <asm/io.h> |
43 | 43 | ||
44 | #include <pcmcia/cs.h> | ||
45 | #include <pcmcia/cistpl.h> | 44 | #include <pcmcia/cistpl.h> |
46 | #include <pcmcia/ciscode.h> | 45 | #include <pcmcia/ciscode.h> |
47 | #include <pcmcia/ds.h> | 46 | #include <pcmcia/ds.h> |
@@ -586,11 +585,8 @@ static int btuart_probe(struct pcmcia_device *link) | |||
586 | info->p_dev = link; | 585 | info->p_dev = link; |
587 | link->priv = info; | 586 | link->priv = info; |
588 | 587 | ||
589 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 588 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | |
590 | link->resource[0]->end = 8; | 589 | CONF_AUTO_SET_IO; |
591 | |||
592 | link->conf.Attributes = CONF_ENABLE_IRQ; | ||
593 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
594 | 590 | ||
595 | return btuart_config(link); | 591 | return btuart_config(link); |
596 | } | 592 | } |
@@ -604,43 +600,41 @@ static void btuart_detach(struct pcmcia_device *link) | |||
604 | kfree(info); | 600 | kfree(info); |
605 | } | 601 | } |
606 | 602 | ||
607 | static int btuart_check_config(struct pcmcia_device *p_dev, | 603 | static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) |
608 | cistpl_cftable_entry_t *cf, | ||
609 | cistpl_cftable_entry_t *dflt, | ||
610 | unsigned int vcc, | ||
611 | void *priv_data) | ||
612 | { | 604 | { |
613 | int *try = priv_data; | 605 | int *try = priv_data; |
614 | 606 | ||
615 | p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 607 | if (try == 0) |
608 | p_dev->io_lines = 16; | ||
616 | 609 | ||
617 | if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) | 610 | if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0)) |
618 | p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; | 611 | return -EINVAL; |
619 | if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && | 612 | |
620 | (cf->io.win[0].base != 0)) { | 613 | p_dev->resource[0]->end = 8; |
621 | p_dev->resource[0]->start = cf->io.win[0].base; | 614 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
622 | if (!pcmcia_request_io(p_dev)) | 615 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
623 | return 0; | 616 | |
624 | } | 617 | return pcmcia_request_io(p_dev); |
625 | return -ENODEV; | ||
626 | } | 618 | } |
627 | 619 | ||
628 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, | 620 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, |
629 | cistpl_cftable_entry_t *cf, | ||
630 | cistpl_cftable_entry_t *dflt, | ||
631 | unsigned int vcc, | ||
632 | void *priv_data) | 621 | void *priv_data) |
633 | { | 622 | { |
634 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 623 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
635 | int j; | 624 | int j; |
636 | 625 | ||
637 | if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { | 626 | if (p_dev->io_lines > 3) |
638 | for (j = 0; j < 5; j++) { | 627 | return -ENODEV; |
639 | p_dev->resource[0]->start = base[j]; | 628 | |
640 | p_dev->io_lines = base[j] ? 16 : 3; | 629 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
641 | if (!pcmcia_request_io(p_dev)) | 630 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
642 | return 0; | 631 | p_dev->resource[0]->end = 8; |
643 | } | 632 | |
633 | for (j = 0; j < 5; j++) { | ||
634 | p_dev->resource[0]->start = base[j]; | ||
635 | p_dev->io_lines = base[j] ? 16 : 3; | ||
636 | if (!pcmcia_request_io(p_dev)) | ||
637 | return 0; | ||
644 | } | 638 | } |
645 | return -ENODEV; | 639 | return -ENODEV; |
646 | } | 640 | } |
@@ -671,7 +665,7 @@ found_port: | |||
671 | if (i != 0) | 665 | if (i != 0) |
672 | goto failed; | 666 | goto failed; |
673 | 667 | ||
674 | i = pcmcia_request_configuration(link, &link->conf); | 668 | i = pcmcia_enable_device(link); |
675 | if (i != 0) | 669 | if (i != 0) |
676 | goto failed; | 670 | goto failed; |
677 | 671 | ||
@@ -703,9 +697,7 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids); | |||
703 | 697 | ||
704 | static struct pcmcia_driver btuart_driver = { | 698 | static struct pcmcia_driver btuart_driver = { |
705 | .owner = THIS_MODULE, | 699 | .owner = THIS_MODULE, |
706 | .drv = { | 700 | .name = "btuart_cs", |
707 | .name = "btuart_cs", | ||
708 | }, | ||
709 | .probe = btuart_probe, | 701 | .probe = btuart_probe, |
710 | .remove = btuart_detach, | 702 | .remove = btuart_detach, |
711 | .id_table = btuart_ids, | 703 | .id_table = btuart_ids, |
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index db7c8db695fc..26ee0cf88d20 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <asm/system.h> | 41 | #include <asm/system.h> |
42 | #include <asm/io.h> | 42 | #include <asm/io.h> |
43 | 43 | ||
44 | #include <pcmcia/cs.h> | ||
45 | #include <pcmcia/cistpl.h> | 44 | #include <pcmcia/cistpl.h> |
46 | #include <pcmcia/ciscode.h> | 45 | #include <pcmcia/ciscode.h> |
47 | #include <pcmcia/ds.h> | 46 | #include <pcmcia/ds.h> |
@@ -572,11 +571,7 @@ static int dtl1_probe(struct pcmcia_device *link) | |||
572 | info->p_dev = link; | 571 | info->p_dev = link; |
573 | link->priv = info; | 572 | link->priv = info; |
574 | 573 | ||
575 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 574 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; |
576 | link->resource[0]->end = 8; | ||
577 | |||
578 | link->conf.Attributes = CONF_ENABLE_IRQ; | ||
579 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
580 | 575 | ||
581 | return dtl1_config(link); | 576 | return dtl1_config(link); |
582 | } | 577 | } |
@@ -591,18 +586,14 @@ static void dtl1_detach(struct pcmcia_device *link) | |||
591 | kfree(info); | 586 | kfree(info); |
592 | } | 587 | } |
593 | 588 | ||
594 | static int dtl1_confcheck(struct pcmcia_device *p_dev, | 589 | static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) |
595 | cistpl_cftable_entry_t *cf, | ||
596 | cistpl_cftable_entry_t *dflt, | ||
597 | unsigned int vcc, | ||
598 | void *priv_data) | ||
599 | { | 590 | { |
600 | if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8)) | 591 | if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8)) |
601 | return -ENODEV; | 592 | return -ENODEV; |
602 | 593 | ||
603 | p_dev->resource[0]->start = cf->io.win[0].base; | 594 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
604 | p_dev->resource[0]->end = cf->io.win[0].len; /*yo */ | 595 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
605 | p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK; | 596 | |
606 | return pcmcia_request_io(p_dev); | 597 | return pcmcia_request_io(p_dev); |
607 | } | 598 | } |
608 | 599 | ||
@@ -620,7 +611,7 @@ static int dtl1_config(struct pcmcia_device *link) | |||
620 | if (i != 0) | 611 | if (i != 0) |
621 | goto failed; | 612 | goto failed; |
622 | 613 | ||
623 | i = pcmcia_request_configuration(link, &link->conf); | 614 | i = pcmcia_enable_device(link); |
624 | if (i != 0) | 615 | if (i != 0) |
625 | goto failed; | 616 | goto failed; |
626 | 617 | ||
@@ -656,9 +647,7 @@ MODULE_DEVICE_TABLE(pcmcia, dtl1_ids); | |||
656 | 647 | ||
657 | static struct pcmcia_driver dtl1_driver = { | 648 | static struct pcmcia_driver dtl1_driver = { |
658 | .owner = THIS_MODULE, | 649 | .owner = THIS_MODULE, |
659 | .drv = { | 650 | .name = "dtl1_cs", |
660 | .name = "dtl1_cs", | ||
661 | }, | ||
662 | .probe = dtl1_probe, | 651 | .probe = dtl1_probe, |
663 | .remove = dtl1_detach, | 652 | .remove = dtl1_detach, |
664 | .id_table = dtl1_ids, | 653 | .id_table = dtl1_ids, |
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 998833d93c13..17361bad46dd 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -256,9 +256,16 @@ static int hci_uart_tty_open(struct tty_struct *tty) | |||
256 | 256 | ||
257 | BT_DBG("tty %p", tty); | 257 | BT_DBG("tty %p", tty); |
258 | 258 | ||
259 | /* FIXME: This btw is bogus, nothing requires the old ldisc to clear | ||
260 | the pointer */ | ||
259 | if (hu) | 261 | if (hu) |
260 | return -EEXIST; | 262 | return -EEXIST; |
261 | 263 | ||
264 | /* Error if the tty has no write op instead of leaving an exploitable | ||
265 | hole */ | ||
266 | if (tty->ops->write == NULL) | ||
267 | return -EOPNOTSUPP; | ||
268 | |||
262 | if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { | 269 | if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { |
263 | BT_ERR("Can't allocate control structure"); | 270 | BT_ERR("Can't allocate control structure"); |
264 | return -ENFILE; | 271 | return -ENFILE; |