aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
commit1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch)
treeee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/bluetooth
parent1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff)
parent127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq pcmcia: do not request windows if you don't need to pcmcia: insert PCMCIA device resources into resource tree pcmcia: export resource information to sysfs pcmcia: use struct resource for PCMCIA devices, part 2 pcmcia: remove memreq_t pcmcia: move local definitions out of include/pcmcia/cs.h pcmcia: do not use io_req_t when calling pcmcia_request_io() pcmcia: do not use io_req_t after call to pcmcia_request_io() pcmcia: use struct resource for PCMCIA devices pcmcia: clean up cs.h pcmcia: use pcmica_{read,write}_config_byte pcmcia: remove cs_types.h pcmcia: remove unused flag, simplify headers pcmcia: remove obsolete CS_EVENT_ definitions pcmcia: split up central event handler pcmcia: simplify event callback pcmcia: remove obsolete ioctl Conflicts in: - drivers/staging/comedi/drivers/* - drivers/staging/wlags49_h2/wl_cs.c due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bluecard_cs.c32
-rw-r--r--drivers/bluetooth/bt3c_cs.c27
-rw-r--r--drivers/bluetooth/btuart_cs.c31
-rw-r--r--drivers/bluetooth/dtl1_cs.c35
4 files changed, 60 insertions, 65 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 6d34f405a2f3..d52e90a5a617 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_types.h>
43#include <pcmcia/cs.h> 42#include <pcmcia/cs.h>
44#include <pcmcia/cistpl.h> 43#include <pcmcia/cistpl.h>
45#include <pcmcia/ciscode.h> 44#include <pcmcia/ciscode.h>
@@ -160,7 +159,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
160static void bluecard_activity_led_timeout(u_long arg) 159static void bluecard_activity_led_timeout(u_long arg)
161{ 160{
162 bluecard_info_t *info = (bluecard_info_t *)arg; 161 bluecard_info_t *info = (bluecard_info_t *)arg;
163 unsigned int iobase = info->p_dev->io.BasePort1; 162 unsigned int iobase = info->p_dev->resource[0]->start;
164 163
165 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 164 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
166 return; 165 return;
@@ -177,7 +176,7 @@ static void bluecard_activity_led_timeout(u_long arg)
177 176
178static void bluecard_enable_activity_led(bluecard_info_t *info) 177static void bluecard_enable_activity_led(bluecard_info_t *info)
179{ 178{
180 unsigned int iobase = info->p_dev->io.BasePort1; 179 unsigned int iobase = info->p_dev->resource[0]->start;
181 180
182 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 181 if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
183 return; 182 return;
@@ -233,7 +232,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
233 } 232 }
234 233
235 do { 234 do {
236 register unsigned int iobase = info->p_dev->io.BasePort1; 235 register unsigned int iobase = info->p_dev->resource[0]->start;
237 register unsigned int offset; 236 register unsigned int offset;
238 register unsigned char command; 237 register unsigned char command;
239 register unsigned long ready_bit; 238 register unsigned long ready_bit;
@@ -380,7 +379,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
380 return; 379 return;
381 } 380 }
382 381
383 iobase = info->p_dev->io.BasePort1; 382 iobase = info->p_dev->resource[0]->start;
384 383
385 if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) 384 if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
386 bluecard_enable_activity_led(info); 385 bluecard_enable_activity_led(info);
@@ -509,7 +508,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
509 if (!test_bit(CARD_READY, &(info->hw_state))) 508 if (!test_bit(CARD_READY, &(info->hw_state)))
510 return IRQ_HANDLED; 509 return IRQ_HANDLED;
511 510
512 iobase = info->p_dev->io.BasePort1; 511 iobase = info->p_dev->resource[0]->start;
513 512
514 spin_lock(&(info->lock)); 513 spin_lock(&(info->lock));
515 514
@@ -623,7 +622,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
623static int bluecard_hci_open(struct hci_dev *hdev) 622static int bluecard_hci_open(struct hci_dev *hdev)
624{ 623{
625 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); 624 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
626 unsigned int iobase = info->p_dev->io.BasePort1; 625 unsigned int iobase = info->p_dev->resource[0]->start;
627 626
628 if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) 627 if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
629 bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); 628 bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
@@ -643,7 +642,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)
643static int bluecard_hci_close(struct hci_dev *hdev) 642static int bluecard_hci_close(struct hci_dev *hdev)
644{ 643{
645 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); 644 bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
646 unsigned int iobase = info->p_dev->io.BasePort1; 645 unsigned int iobase = info->p_dev->resource[0]->start;
647 646
648 if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) 647 if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
649 return 0; 648 return 0;
@@ -710,7 +709,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l
710 709
711static int bluecard_open(bluecard_info_t *info) 710static int bluecard_open(bluecard_info_t *info)
712{ 711{
713 unsigned int iobase = info->p_dev->io.BasePort1; 712 unsigned int iobase = info->p_dev->resource[0]->start;
714 struct hci_dev *hdev; 713 struct hci_dev *hdev;
715 unsigned char id; 714 unsigned char id;
716 715
@@ -829,7 +828,7 @@ static int bluecard_open(bluecard_info_t *info)
829 828
830static int bluecard_close(bluecard_info_t *info) 829static int bluecard_close(bluecard_info_t *info)
831{ 830{
832 unsigned int iobase = info->p_dev->io.BasePort1; 831 unsigned int iobase = info->p_dev->resource[0]->start;
833 struct hci_dev *hdev = info->hdev; 832 struct hci_dev *hdev = info->hdev;
834 833
835 if (!hdev) 834 if (!hdev)
@@ -866,9 +865,6 @@ static int bluecard_probe(struct pcmcia_device *link)
866 info->p_dev = link; 865 info->p_dev = link;
867 link->priv = info; 866 link->priv = info;
868 867
869 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
870 link->io.NumPorts1 = 8;
871
872 link->conf.Attributes = CONF_ENABLE_IRQ; 868 link->conf.Attributes = CONF_ENABLE_IRQ;
873 link->conf.IntType = INT_MEMORY_AND_IO; 869 link->conf.IntType = INT_MEMORY_AND_IO;
874 870
@@ -891,12 +887,14 @@ static int bluecard_config(struct pcmcia_device *link)
891 int i, n; 887 int i, n;
892 888
893 link->conf.ConfigIndex = 0x20; 889 link->conf.ConfigIndex = 0x20;
894 link->io.NumPorts1 = 64; 890
895 link->io.IOAddrLines = 6; 891 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
892 link->resource[0]->end = 64;
893 link->io_lines = 6;
896 894
897 for (n = 0; n < 0x400; n += 0x40) { 895 for (n = 0; n < 0x400; n += 0x40) {
898 link->io.BasePort1 = n ^ 0x300; 896 link->resource[0]->start = n ^ 0x300;
899 i = pcmcia_request_io(link, &link->io); 897 i = pcmcia_request_io(link);
900 if (i == 0) 898 if (i == 0)
901 break; 899 break;
902 } 900 }
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 21e05fdc9121..7ab8f29d5e0d 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_types.h>
49#include <pcmcia/cs.h> 48#include <pcmcia/cs.h>
50#include <pcmcia/cistpl.h> 49#include <pcmcia/cistpl.h>
51#include <pcmcia/ciscode.h> 50#include <pcmcia/ciscode.h>
@@ -189,7 +188,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
189 return; 188 return;
190 189
191 do { 190 do {
192 register unsigned int iobase = info->p_dev->io.BasePort1; 191 register unsigned int iobase = info->p_dev->resource[0]->start;
193 register struct sk_buff *skb; 192 register struct sk_buff *skb;
194 register int len; 193 register int len;
195 194
@@ -227,7 +226,7 @@ static void bt3c_receive(bt3c_info_t *info)
227 return; 226 return;
228 } 227 }
229 228
230 iobase = info->p_dev->io.BasePort1; 229 iobase = info->p_dev->resource[0]->start;
231 230
232 avail = bt3c_read(iobase, 0x7006); 231 avail = bt3c_read(iobase, 0x7006);
233 //printk("bt3c_cs: receiving %d bytes\n", avail); 232 //printk("bt3c_cs: receiving %d bytes\n", avail);
@@ -348,7 +347,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
348 /* our irq handler is shared */ 347 /* our irq handler is shared */
349 return IRQ_NONE; 348 return IRQ_NONE;
350 349
351 iobase = info->p_dev->io.BasePort1; 350 iobase = info->p_dev->resource[0]->start;
352 351
353 spin_lock(&(info->lock)); 352 spin_lock(&(info->lock));
354 353
@@ -481,7 +480,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
481 unsigned int iobase, size, addr, fcs, tmp; 480 unsigned int iobase, size, addr, fcs, tmp;
482 int i, err = 0; 481 int i, err = 0;
483 482
484 iobase = info->p_dev->io.BasePort1; 483 iobase = info->p_dev->resource[0]->start;
485 484
486 /* Reset */ 485 /* Reset */
487 bt3c_io_write(iobase, 0x8040, 0x0404); 486 bt3c_io_write(iobase, 0x8040, 0x0404);
@@ -658,8 +657,8 @@ static int bt3c_probe(struct pcmcia_device *link)
658 info->p_dev = link; 657 info->p_dev = link;
659 link->priv = info; 658 link->priv = info;
660 659
661 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 660 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
662 link->io.NumPorts1 = 8; 661 link->resource[0]->end = 8;
663 662
664 link->conf.Attributes = CONF_ENABLE_IRQ; 663 link->conf.Attributes = CONF_ENABLE_IRQ;
665 link->conf.IntType = INT_MEMORY_AND_IO; 664 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -684,14 +683,14 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
684{ 683{
685 unsigned long try = (unsigned long) priv_data; 684 unsigned long try = (unsigned long) priv_data;
686 685
686 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
687
687 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 688 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
688 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 689 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
689 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 690 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
690 (cf->io.win[0].base != 0)) { 691 (cf->io.win[0].base != 0)) {
691 p_dev->io.BasePort1 = cf->io.win[0].base; 692 p_dev->resource[0]->start = cf->io.win[0].base;
692 p_dev->io.IOAddrLines = (try == 0) ? 16 : 693 if (!pcmcia_request_io(p_dev))
693 cf->io.flags & CISTPL_IO_LINES_MASK;
694 if (!pcmcia_request_io(p_dev, &p_dev->io))
695 return 0; 694 return 0;
696 } 695 }
697 return -ENODEV; 696 return -ENODEV;
@@ -708,9 +707,9 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
708 707
709 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 708 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
710 for (j = 0; j < 5; j++) { 709 for (j = 0; j < 5; j++) {
711 p_dev->io.BasePort1 = base[j]; 710 p_dev->resource[0]->start = base[j];
712 p_dev->io.IOAddrLines = base[j] ? 16 : 3; 711 p_dev->io_lines = base[j] ? 16 : 3;
713 if (!pcmcia_request_io(p_dev, &p_dev->io)) 712 if (!pcmcia_request_io(p_dev))
714 return 0; 713 return 0;
715 } 714 }
716 } 715 }
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 4ed7288f99db..1c4f5e863b03 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_types.h>
45#include <pcmcia/cs.h> 44#include <pcmcia/cs.h>
46#include <pcmcia/cistpl.h> 45#include <pcmcia/cistpl.h>
47#include <pcmcia/ciscode.h> 46#include <pcmcia/ciscode.h>
@@ -143,7 +142,7 @@ static void btuart_write_wakeup(btuart_info_t *info)
143 } 142 }
144 143
145 do { 144 do {
146 register unsigned int iobase = info->p_dev->io.BasePort1; 145 register unsigned int iobase = info->p_dev->resource[0]->start;
147 register struct sk_buff *skb; 146 register struct sk_buff *skb;
148 register int len; 147 register int len;
149 148
@@ -184,7 +183,7 @@ static void btuart_receive(btuart_info_t *info)
184 return; 183 return;
185 } 184 }
186 185
187 iobase = info->p_dev->io.BasePort1; 186 iobase = info->p_dev->resource[0]->start;
188 187
189 do { 188 do {
190 info->hdev->stat.byte_rx++; 189 info->hdev->stat.byte_rx++;
@@ -298,7 +297,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
298 /* our irq handler is shared */ 297 /* our irq handler is shared */
299 return IRQ_NONE; 298 return IRQ_NONE;
300 299
301 iobase = info->p_dev->io.BasePort1; 300 iobase = info->p_dev->resource[0]->start;
302 301
303 spin_lock(&(info->lock)); 302 spin_lock(&(info->lock));
304 303
@@ -355,7 +354,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
355 return; 354 return;
356 } 355 }
357 356
358 iobase = info->p_dev->io.BasePort1; 357 iobase = info->p_dev->resource[0]->start;
359 358
360 spin_lock_irqsave(&(info->lock), flags); 359 spin_lock_irqsave(&(info->lock), flags);
361 360
@@ -479,7 +478,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon
479static int btuart_open(btuart_info_t *info) 478static int btuart_open(btuart_info_t *info)
480{ 479{
481 unsigned long flags; 480 unsigned long flags;
482 unsigned int iobase = info->p_dev->io.BasePort1; 481 unsigned int iobase = info->p_dev->resource[0]->start;
483 struct hci_dev *hdev; 482 struct hci_dev *hdev;
484 483
485 spin_lock_init(&(info->lock)); 484 spin_lock_init(&(info->lock));
@@ -549,7 +548,7 @@ static int btuart_open(btuart_info_t *info)
549static int btuart_close(btuart_info_t *info) 548static int btuart_close(btuart_info_t *info)
550{ 549{
551 unsigned long flags; 550 unsigned long flags;
552 unsigned int iobase = info->p_dev->io.BasePort1; 551 unsigned int iobase = info->p_dev->resource[0]->start;
553 struct hci_dev *hdev = info->hdev; 552 struct hci_dev *hdev = info->hdev;
554 553
555 if (!hdev) 554 if (!hdev)
@@ -587,8 +586,8 @@ static int btuart_probe(struct pcmcia_device *link)
587 info->p_dev = link; 586 info->p_dev = link;
588 link->priv = info; 587 link->priv = info;
589 588
590 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 589 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
591 link->io.NumPorts1 = 8; 590 link->resource[0]->end = 8;
592 591
593 link->conf.Attributes = CONF_ENABLE_IRQ; 592 link->conf.Attributes = CONF_ENABLE_IRQ;
594 link->conf.IntType = INT_MEMORY_AND_IO; 593 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -613,14 +612,14 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
613{ 612{
614 int *try = priv_data; 613 int *try = priv_data;
615 614
615 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
616
616 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 617 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
617 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 618 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
618 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 619 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
619 (cf->io.win[0].base != 0)) { 620 (cf->io.win[0].base != 0)) {
620 p_dev->io.BasePort1 = cf->io.win[0].base; 621 p_dev->resource[0]->start = cf->io.win[0].base;
621 p_dev->io.IOAddrLines = (*try == 0) ? 16 : 622 if (!pcmcia_request_io(p_dev))
622 cf->io.flags & CISTPL_IO_LINES_MASK;
623 if (!pcmcia_request_io(p_dev, &p_dev->io))
624 return 0; 623 return 0;
625 } 624 }
626 return -ENODEV; 625 return -ENODEV;
@@ -637,9 +636,9 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
637 636
638 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 637 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
639 for (j = 0; j < 5; j++) { 638 for (j = 0; j < 5; j++) {
640 p_dev->io.BasePort1 = base[j]; 639 p_dev->resource[0]->start = base[j];
641 p_dev->io.IOAddrLines = base[j] ? 16 : 3; 640 p_dev->io_lines = base[j] ? 16 : 3;
642 if (!pcmcia_request_io(p_dev, &p_dev->io)) 641 if (!pcmcia_request_io(p_dev))
643 return 0; 642 return 0;
644 } 643 }
645 } 644 }
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index cbe9e44a42e9..db7c8db695fc 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_types.h>
45#include <pcmcia/cs.h> 44#include <pcmcia/cs.h>
46#include <pcmcia/cistpl.h> 45#include <pcmcia/cistpl.h>
47#include <pcmcia/ciscode.h> 46#include <pcmcia/ciscode.h>
@@ -150,7 +149,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
150 } 149 }
151 150
152 do { 151 do {
153 register unsigned int iobase = info->p_dev->io.BasePort1; 152 register unsigned int iobase = info->p_dev->resource[0]->start;
154 register struct sk_buff *skb; 153 register struct sk_buff *skb;
155 register int len; 154 register int len;
156 155
@@ -215,7 +214,7 @@ static void dtl1_receive(dtl1_info_t *info)
215 return; 214 return;
216 } 215 }
217 216
218 iobase = info->p_dev->io.BasePort1; 217 iobase = info->p_dev->resource[0]->start;
219 218
220 do { 219 do {
221 info->hdev->stat.byte_rx++; 220 info->hdev->stat.byte_rx++;
@@ -302,7 +301,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
302 /* our irq handler is shared */ 301 /* our irq handler is shared */
303 return IRQ_NONE; 302 return IRQ_NONE;
304 303
305 iobase = info->p_dev->io.BasePort1; 304 iobase = info->p_dev->resource[0]->start;
306 305
307 spin_lock(&(info->lock)); 306 spin_lock(&(info->lock));
308 307
@@ -462,7 +461,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
462static int dtl1_open(dtl1_info_t *info) 461static int dtl1_open(dtl1_info_t *info)
463{ 462{
464 unsigned long flags; 463 unsigned long flags;
465 unsigned int iobase = info->p_dev->io.BasePort1; 464 unsigned int iobase = info->p_dev->resource[0]->start;
466 struct hci_dev *hdev; 465 struct hci_dev *hdev;
467 466
468 spin_lock_init(&(info->lock)); 467 spin_lock_init(&(info->lock));
@@ -509,7 +508,8 @@ static int dtl1_open(dtl1_info_t *info)
509 outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */ 508 outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */
510 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR); 509 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
511 510
512 info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) & UART_MSR_RI; 511 info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR)
512 & UART_MSR_RI;
513 513
514 /* Turn on interrupts */ 514 /* Turn on interrupts */
515 outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); 515 outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
@@ -534,7 +534,7 @@ static int dtl1_open(dtl1_info_t *info)
534static int dtl1_close(dtl1_info_t *info) 534static int dtl1_close(dtl1_info_t *info)
535{ 535{
536 unsigned long flags; 536 unsigned long flags;
537 unsigned int iobase = info->p_dev->io.BasePort1; 537 unsigned int iobase = info->p_dev->resource[0]->start;
538 struct hci_dev *hdev = info->hdev; 538 struct hci_dev *hdev = info->hdev;
539 539
540 if (!hdev) 540 if (!hdev)
@@ -572,8 +572,8 @@ static int dtl1_probe(struct pcmcia_device *link)
572 info->p_dev = link; 572 info->p_dev = link;
573 link->priv = info; 573 link->priv = info;
574 574
575 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 575 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
576 link->io.NumPorts1 = 8; 576 link->resource[0]->end = 8;
577 577
578 link->conf.Attributes = CONF_ENABLE_IRQ; 578 link->conf.Attributes = CONF_ENABLE_IRQ;
579 link->conf.IntType = INT_MEMORY_AND_IO; 579 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -597,14 +597,13 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev,
597 unsigned int vcc, 597 unsigned int vcc,
598 void *priv_data) 598 void *priv_data)
599{ 599{
600 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 600 if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
601 p_dev->io.BasePort1 = cf->io.win[0].base; 601 return -ENODEV;
602 p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */ 602
603 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 603 p_dev->resource[0]->start = cf->io.win[0].base;
604 if (!pcmcia_request_io(p_dev, &p_dev->io)) 604 p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
605 return 0; 605 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
606 } 606 return pcmcia_request_io(p_dev);
607 return -ENODEV;
608} 607}
609 608
610static int dtl1_config(struct pcmcia_device *link) 609static int dtl1_config(struct pcmcia_device *link)
@@ -613,7 +612,7 @@ static int dtl1_config(struct pcmcia_device *link)
613 int i; 612 int i;
614 613
615 /* Look for a generic full-sized window */ 614 /* Look for a generic full-sized window */
616 link->io.NumPorts1 = 8; 615 link->resource[0]->end = 8;
617 if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0) 616 if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
618 goto failed; 617 goto failed;
619 618