aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r--drivers/isdn/hardware/mISDN/hfc_pci.h4
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c37
-rw-r--r--drivers/isdn/hardware/mISDN/hfcpci.c25
3 files changed, 32 insertions, 34 deletions
diff --git a/drivers/isdn/hardware/mISDN/hfc_pci.h b/drivers/isdn/hardware/mISDN/hfc_pci.h
index fd2c9be6d849..5783d22a18fe 100644
--- a/drivers/isdn/hardware/mISDN/hfc_pci.h
+++ b/drivers/isdn/hardware/mISDN/hfc_pci.h
@@ -183,8 +183,8 @@
183#define D_FREG_MASK 0xF 183#define D_FREG_MASK 0xF
184 184
185struct zt { 185struct zt {
186 unsigned short z1; /* Z1 pointer 16 Bit */ 186 __le16 z1; /* Z1 pointer 16 Bit */
187 unsigned short z2; /* Z2 pointer 16 Bit */ 187 __le16 z2; /* Z2 pointer 16 Bit */
188}; 188};
189 189
190struct dfifo { 190struct dfifo {
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 2649ea55a9e8..1eac03f39d00 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -140,7 +140,7 @@
140 * #define HFC_REGISTER_DEBUG 140 * #define HFC_REGISTER_DEBUG
141 */ 141 */
142 142
143static const char *hfcmulti_revision = "2.00"; 143static const char *hfcmulti_revision = "2.02";
144 144
145#include <linux/module.h> 145#include <linux/module.h>
146#include <linux/pci.h> 146#include <linux/pci.h>
@@ -427,12 +427,12 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
427{ 427{
428 outb(A_FIFO_DATA0, (hc->pci_iobase)+4); 428 outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
429 while (len>>2) { 429 while (len>>2) {
430 outl(*(u32 *)data, hc->pci_iobase); 430 outl(cpu_to_le32(*(u32 *)data), hc->pci_iobase);
431 data += 4; 431 data += 4;
432 len -= 4; 432 len -= 4;
433 } 433 }
434 while (len>>1) { 434 while (len>>1) {
435 outw(*(u16 *)data, hc->pci_iobase); 435 outw(cpu_to_le16(*(u16 *)data), hc->pci_iobase);
436 data += 2; 436 data += 2;
437 len -= 2; 437 len -= 2;
438 } 438 }
@@ -447,17 +447,19 @@ void
447write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len) 447write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
448{ 448{
449 while (len>>2) { 449 while (len>>2) {
450 writel(*(u32 *)data, (hc->pci_membase)+A_FIFO_DATA0); 450 writel(cpu_to_le32(*(u32 *)data),
451 hc->pci_membase + A_FIFO_DATA0);
451 data += 4; 452 data += 4;
452 len -= 4; 453 len -= 4;
453 } 454 }
454 while (len>>1) { 455 while (len>>1) {
455 writew(*(u16 *)data, (hc->pci_membase)+A_FIFO_DATA0); 456 writew(cpu_to_le16(*(u16 *)data),
457 hc->pci_membase + A_FIFO_DATA0);
456 data += 2; 458 data += 2;
457 len -= 2; 459 len -= 2;
458 } 460 }
459 while (len) { 461 while (len) {
460 writeb(*data, (hc->pci_membase)+A_FIFO_DATA0); 462 writeb(*data, hc->pci_membase + A_FIFO_DATA0);
461 data++; 463 data++;
462 len--; 464 len--;
463 } 465 }
@@ -468,12 +470,12 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
468{ 470{
469 outb(A_FIFO_DATA0, (hc->pci_iobase)+4); 471 outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
470 while (len>>2) { 472 while (len>>2) {
471 *(u32 *)data = inl(hc->pci_iobase); 473 *(u32 *)data = le32_to_cpu(inl(hc->pci_iobase));
472 data += 4; 474 data += 4;
473 len -= 4; 475 len -= 4;
474 } 476 }
475 while (len>>1) { 477 while (len>>1) {
476 *(u16 *)data = inw(hc->pci_iobase); 478 *(u16 *)data = le16_to_cpu(inw(hc->pci_iobase));
477 data += 2; 479 data += 2;
478 len -= 2; 480 len -= 2;
479 } 481 }
@@ -490,18 +492,18 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
490{ 492{
491 while (len>>2) { 493 while (len>>2) {
492 *(u32 *)data = 494 *(u32 *)data =
493 readl((hc->pci_membase)+A_FIFO_DATA0); 495 le32_to_cpu(readl(hc->pci_membase + A_FIFO_DATA0));
494 data += 4; 496 data += 4;
495 len -= 4; 497 len -= 4;
496 } 498 }
497 while (len>>1) { 499 while (len>>1) {
498 *(u16 *)data = 500 *(u16 *)data =
499 readw((hc->pci_membase)+A_FIFO_DATA0); 501 le16_to_cpu(readw(hc->pci_membase + A_FIFO_DATA0));
500 data += 2; 502 data += 2;
501 len -= 2; 503 len -= 2;
502 } 504 }
503 while (len) { 505 while (len) {
504 *data = readb((hc->pci_membase)+A_FIFO_DATA0); 506 *data = readb(hc->pci_membase + A_FIFO_DATA0);
505 data++; 507 data++;
506 len--; 508 len--;
507 } 509 }
@@ -3971,7 +3973,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
3971 struct bchannel *bch; 3973 struct bchannel *bch;
3972 int ch; 3974 int ch;
3973 3975
3974 if (!test_bit(rq->adr.channel, &dch->dev.channelmap[0])) 3976 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
3975 return -EINVAL; 3977 return -EINVAL;
3976 if (rq->protocol == ISDN_P_NONE) 3978 if (rq->protocol == ISDN_P_NONE)
3977 return -EINVAL; 3979 return -EINVAL;
@@ -4587,7 +4589,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
4587 list_add(&bch->ch.list, &dch->dev.bchannels); 4589 list_add(&bch->ch.list, &dch->dev.bchannels);
4588 hc->chan[ch].bch = bch; 4590 hc->chan[ch].bch = bch;
4589 hc->chan[ch].port = 0; 4591 hc->chan[ch].port = 0;
4590 test_and_set_bit(bch->nr, &dch->dev.channelmap[0]); 4592 set_channelmap(bch->nr, dch->dev.channelmap);
4591 } 4593 }
4592 /* set optical line type */ 4594 /* set optical line type */
4593 if (port[Port_cnt] & 0x001) { 4595 if (port[Port_cnt] & 0x001) {
@@ -4755,7 +4757,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
4755 list_add(&bch->ch.list, &dch->dev.bchannels); 4757 list_add(&bch->ch.list, &dch->dev.bchannels);
4756 hc->chan[i + ch].bch = bch; 4758 hc->chan[i + ch].bch = bch;
4757 hc->chan[i + ch].port = pt; 4759 hc->chan[i + ch].port = pt;
4758 test_and_set_bit(bch->nr, &dch->dev.channelmap[0]); 4760 set_channelmap(bch->nr, dch->dev.channelmap);
4759 } 4761 }
4760 /* set master clock */ 4762 /* set master clock */
4761 if (port[Port_cnt] & 0x001) { 4763 if (port[Port_cnt] & 0x001) {
@@ -5050,12 +5052,12 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
5050 5052
5051static const struct hm_map hfcm_map[] = { 5053static const struct hm_map hfcm_map[] = {
5052/*0*/ {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0}, 5054/*0*/ {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0},
5053/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S}, 5055/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0},
5054/*2*/ {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0}, 5056/*2*/ {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0},
5055/*3*/ {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0}, 5057/*3*/ {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0},
5056/*4*/ {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0}, 5058/*4*/ {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0},
5057/*5*/ {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0}, 5059/*5*/ {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0},
5058/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, 0, 0}, 5060/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0},
5059/*7*/ {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0}, 5061/*7*/ {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0},
5060/*8*/ {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO}, 5062/*8*/ {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO},
5061/*9*/ {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0}, 5063/*9*/ {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0},
@@ -5251,9 +5253,6 @@ HFCmulti_init(void)
5251 if (debug & DEBUG_HFCMULTI_INIT) 5253 if (debug & DEBUG_HFCMULTI_INIT)
5252 printk(KERN_DEBUG "%s: init entered\n", __func__); 5254 printk(KERN_DEBUG "%s: init entered\n", __func__);
5253 5255
5254#ifdef __BIG_ENDIAN
5255#error "not running on big endian machines now"
5256#endif
5257 hfc_interrupt = symbol_get(ztdummy_extern_interrupt); 5256 hfc_interrupt = symbol_get(ztdummy_extern_interrupt);
5258 register_interrupt = symbol_get(ztdummy_register_interrupt); 5257 register_interrupt = symbol_get(ztdummy_register_interrupt);
5259 unregister_interrupt = symbol_get(ztdummy_unregister_interrupt); 5258 unregister_interrupt = symbol_get(ztdummy_unregister_interrupt);
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 3231814e7efa..cd8302af40eb 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
43module_param(debug, uint, 0); 43module_param(debug, uint, 0);
44 44
45static LIST_HEAD(HFClist); 45static LIST_HEAD(HFClist);
46DEFINE_RWLOCK(HFClock); 46static DEFINE_RWLOCK(HFClock);
47 47
48enum { 48enum {
49 HFC_CCD_2BD0, 49 HFC_CCD_2BD0,
@@ -88,7 +88,7 @@ struct hfcPCI_hw {
88 unsigned char bswapped; 88 unsigned char bswapped;
89 unsigned char protocol; 89 unsigned char protocol;
90 int nt_timer; 90 int nt_timer;
91 unsigned char *pci_io; /* start of PCI IO memory */ 91 unsigned char __iomem *pci_io; /* start of PCI IO memory */
92 dma_addr_t dmahandle; 92 dma_addr_t dmahandle;
93 void *fifos; /* FIFO memory */ 93 void *fifos; /* FIFO memory */
94 int last_bfifo_cnt[2]; 94 int last_bfifo_cnt[2];
@@ -153,7 +153,7 @@ release_io_hfcpci(struct hfc_pci *hc)
153 pci_write_config_word(hc->pdev, PCI_COMMAND, 0); 153 pci_write_config_word(hc->pdev, PCI_COMMAND, 0);
154 del_timer(&hc->hw.timer); 154 del_timer(&hc->hw.timer);
155 pci_free_consistent(hc->pdev, 0x8000, hc->hw.fifos, hc->hw.dmahandle); 155 pci_free_consistent(hc->pdev, 0x8000, hc->hw.fifos, hc->hw.dmahandle);
156 iounmap((void *)hc->hw.pci_io); 156 iounmap(hc->hw.pci_io);
157} 157}
158 158
159/* 159/*
@@ -366,8 +366,7 @@ static void hfcpci_clear_fifo_tx(struct hfc_pci *hc, int fifo)
366 bzt->f2 = MAX_B_FRAMES; 366 bzt->f2 = MAX_B_FRAMES;
367 bzt->f1 = bzt->f2; /* init F pointers to remain constant */ 367 bzt->f1 = bzt->f2; /* init F pointers to remain constant */
368 bzt->za[MAX_B_FRAMES].z1 = cpu_to_le16(B_FIFO_SIZE + B_SUB_VAL - 1); 368 bzt->za[MAX_B_FRAMES].z1 = cpu_to_le16(B_FIFO_SIZE + B_SUB_VAL - 1);
369 bzt->za[MAX_B_FRAMES].z2 = cpu_to_le16( 369 bzt->za[MAX_B_FRAMES].z2 = cpu_to_le16(B_FIFO_SIZE + B_SUB_VAL - 2);
370 le16_to_cpu(bzt->za[MAX_B_FRAMES].z1 - 1));
371 if (fifo_state) 370 if (fifo_state)
372 hc->hw.fifo_en |= fifo_state; 371 hc->hw.fifo_en |= fifo_state;
373 Write_hfc(hc, HFCPCI_FIFO_EN, hc->hw.fifo_en); 372 Write_hfc(hc, HFCPCI_FIFO_EN, hc->hw.fifo_en);
@@ -482,7 +481,7 @@ receive_dmsg(struct hfc_pci *hc)
482 df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) | 481 df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) |
483 (MAX_D_FRAMES + 1); /* next buffer */ 482 (MAX_D_FRAMES + 1); /* next buffer */
484 df->za[df->f2 & D_FREG_MASK].z2 = 483 df->za[df->f2 & D_FREG_MASK].z2 =
485 cpu_to_le16((zp->z2 + rcnt) & (D_FIFO_SIZE - 1)); 484 cpu_to_le16((le16_to_cpu(zp->z2) + rcnt) & (D_FIFO_SIZE - 1));
486 } else { 485 } else {
487 dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC); 486 dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC);
488 if (!dch->rx_skb) { 487 if (!dch->rx_skb) {
@@ -523,10 +522,10 @@ receive_dmsg(struct hfc_pci *hc)
523/* 522/*
524 * check for transparent receive data and read max one threshold size if avail 523 * check for transparent receive data and read max one threshold size if avail
525 */ 524 */
526int 525static int
527hfcpci_empty_fifo_trans(struct bchannel *bch, struct bzfifo *bz, u_char *bdata) 526hfcpci_empty_fifo_trans(struct bchannel *bch, struct bzfifo *bz, u_char *bdata)
528{ 527{
529 unsigned short *z1r, *z2r; 528 __le16 *z1r, *z2r;
530 int new_z2, fcnt, maxlen; 529 int new_z2, fcnt, maxlen;
531 u_char *ptr, *ptr1; 530 u_char *ptr, *ptr1;
532 531
@@ -576,7 +575,7 @@ hfcpci_empty_fifo_trans(struct bchannel *bch, struct bzfifo *bz, u_char *bdata)
576/* 575/*
577 * B-channel main receive routine 576 * B-channel main receive routine
578 */ 577 */
579void 578static void
580main_rec_hfcpci(struct bchannel *bch) 579main_rec_hfcpci(struct bchannel *bch)
581{ 580{
582 struct hfc_pci *hc = bch->hw; 581 struct hfc_pci *hc = bch->hw;
@@ -724,7 +723,7 @@ hfcpci_fill_fifo(struct bchannel *bch)
724 struct bzfifo *bz; 723 struct bzfifo *bz;
725 u_char *bdata; 724 u_char *bdata;
726 u_char new_f1, *src, *dst; 725 u_char new_f1, *src, *dst;
727 unsigned short *z1t, *z2t; 726 __le16 *z1t, *z2t;
728 727
729 if ((bch->debug & DEBUG_HW_BCHANNEL) && !(bch->debug & DEBUG_HW_BFIFO)) 728 if ((bch->debug & DEBUG_HW_BCHANNEL) && !(bch->debug & DEBUG_HW_BFIFO))
730 printk(KERN_DEBUG "%s\n", __func__); 729 printk(KERN_DEBUG "%s\n", __func__);
@@ -1679,7 +1678,7 @@ hfcpci_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
1679 * called for card init message 1678 * called for card init message
1680 */ 1679 */
1681 1680
1682void 1681static void
1683inithfcpci(struct hfc_pci *hc) 1682inithfcpci(struct hfc_pci *hc)
1684{ 1683{
1685 printk(KERN_DEBUG "inithfcpci: entered\n"); 1684 printk(KERN_DEBUG "inithfcpci: entered\n");
@@ -1966,7 +1965,7 @@ setup_hw(struct hfc_pci *hc)
1966 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); 1965 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
1967 return 1; 1966 return 1;
1968 } 1967 }
1969 hc->hw.pci_io = (char *)(ulong)hc->pdev->resource[1].start; 1968 hc->hw.pci_io = (char __iomem *)(unsigned long)hc->pdev->resource[1].start;
1970 1969
1971 if (!hc->hw.pci_io) { 1970 if (!hc->hw.pci_io) {
1972 printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); 1971 printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
@@ -2056,7 +2055,7 @@ setup_card(struct hfc_pci *card)
2056 card->dch.dev.nrbchan = 2; 2055 card->dch.dev.nrbchan = 2;
2057 for (i = 0; i < 2; i++) { 2056 for (i = 0; i < 2; i++) {
2058 card->bch[i].nr = i + 1; 2057 card->bch[i].nr = i + 1;
2059 test_and_set_bit(i + 1, &card->dch.dev.channelmap[0]); 2058 set_channelmap(i + 1, card->dch.dev.channelmap);
2060 card->bch[i].debug = debug; 2059 card->bch[i].debug = debug;
2061 mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM); 2060 mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM);
2062 card->bch[i].hw = card; 2061 card->bch[i].hw = card;