]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 00:00:37 +0000 (17:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 00:00:37 +0000 (17:00 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6:
  Add DIP switch readout for HFC-4S IOB4ST
  Fix remaining big endian issue of hfcmulti
  mISDN cleanup user interface
  mISDN fix main ISDN Makefile

drivers/isdn/Makefile
drivers/isdn/hardware/mISDN/hfcmulti.c
drivers/isdn/hardware/mISDN/hfcpci.c
drivers/isdn/mISDN/l1oip_core.c
drivers/isdn/mISDN/socket.c
include/linux/mISDNif.h

index 8380a4568d11dda17aa5c0b92839a8ab334e5dbf..f1f777570e8e662417aa99a59f3004422ade771c 100644 (file)
@@ -5,7 +5,7 @@
 obj-$(CONFIG_ISDN_I4L)                 += i4l/
 obj-$(CONFIG_ISDN_CAPI)                        += capi/
 obj-$(CONFIG_MISDN)                    += mISDN/
-obj-$(CONFIG_ISDN_CAPI)                        += hardware/
+obj-$(CONFIG_ISDN)                     += hardware/
 obj-$(CONFIG_ISDN_DIVERSION)           += divert/
 obj-$(CONFIG_ISDN_DRV_HISAX)           += hisax/
 obj-$(CONFIG_ISDN_DRV_ICN)             += icn/
index 2649ea55a9e8d8df07ab35ec849a0f8055673901..1eac03f39d0005e0e75b75f3925e1924193e794b 100644 (file)
  * #define HFC_REGISTER_DEBUG
  */
 
-static const char *hfcmulti_revision = "2.00";
+static const char *hfcmulti_revision = "2.02";
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -427,12 +427,12 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               outl(*(u32 *)data, hc->pci_iobase);
+               outl(cpu_to_le32(*(u32 *)data), hc->pci_iobase);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               outw(*(u16 *)data, hc->pci_iobase);
+               outw(cpu_to_le16(*(u16 *)data), hc->pci_iobase);
                data += 2;
                len -= 2;
        }
@@ -447,17 +447,19 @@ void
 write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
-               writel(*(u32 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writel(cpu_to_le32(*(u32 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               writew(*(u16 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writew(cpu_to_le16(*(u16 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 2;
                len -= 2;
        }
        while (len) {
-               writeb(*data, (hc->pci_membase)+A_FIFO_DATA0);
+               writeb(*data, hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -468,12 +470,12 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               *(u32 *)data = inl(hc->pci_iobase);
+               *(u32 *)data = le32_to_cpu(inl(hc->pci_iobase));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               *(u16 *)data = inw(hc->pci_iobase);
+               *(u16 *)data = le16_to_cpu(inw(hc->pci_iobase));
                data += 2;
                len -= 2;
        }
@@ -490,18 +492,18 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
                *(u32 *)data =
-                       readl((hc->pci_membase)+A_FIFO_DATA0);
+                       le32_to_cpu(readl(hc->pci_membase + A_FIFO_DATA0));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
                *(u16 *)data =
-                       readw((hc->pci_membase)+A_FIFO_DATA0);
+                       le16_to_cpu(readw(hc->pci_membase + A_FIFO_DATA0));
                data += 2;
                len -= 2;
        }
        while (len) {
-               *data = readb((hc->pci_membase)+A_FIFO_DATA0);
+               *data = readb(hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -3971,7 +3973,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel, &dch->dev.channelmap[0]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -4587,7 +4589,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[ch].bch = bch;
                hc->chan[ch].port = 0;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set optical line type */
        if (port[Port_cnt] & 0x001) {
@@ -4755,7 +4757,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
                hc->chan[i + ch].port = pt;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set master clock */
        if (port[Port_cnt] & 0x001) {
@@ -5050,12 +5052,12 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
 
 static const struct hm_map hfcm_map[] = {
 /*0*/  {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0},
-/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S},
+/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*2*/  {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*3*/  {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*4*/  {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0},
 /*5*/  {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0},
-/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, 0, 0},
+/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*7*/  {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0},
 /*8*/  {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO},
 /*9*/  {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0},
@@ -5251,9 +5253,6 @@ HFCmulti_init(void)
        if (debug & DEBUG_HFCMULTI_INIT)
                printk(KERN_DEBUG "%s: init entered\n", __func__);
 
-#ifdef __BIG_ENDIAN
-#error "not running on big endian machines now"
-#endif
        hfc_interrupt = symbol_get(ztdummy_extern_interrupt);
        register_interrupt = symbol_get(ztdummy_register_interrupt);
        unregister_interrupt = symbol_get(ztdummy_unregister_interrupt);
index 3231814e7efa0ef5fd335fc51420e9e756acc48e..9cf5edbb1a9b119db51d1b60494b3767886184d8 100644 (file)
@@ -2056,7 +2056,7 @@ setup_card(struct hfc_pci *card)
        card->dch.dev.nrbchan = 2;
        for (i = 0; i < 2; i++) {
                card->bch[i].nr = i + 1;
-               test_and_set_bit(i + 1, &card->dch.dev.channelmap[0]);
+               set_channelmap(i + 1, card->dch.dev.channelmap);
                card->bch[i].debug = debug;
                mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM);
                card->bch[i].hw = card;
index 155b99780c4fe93e934dd9f7e0bb3cfbc2fb7117..e42150a577805a7ad5f8d38971d34e4b5b04020d 100644 (file)
@@ -1006,8 +1006,7 @@ open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq)
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel & 0x1f,
-               &dch->dev.channelmap[rq->adr.channel >> 5]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -1412,8 +1411,7 @@ init_card(struct l1oip *hc, int pri, int bundle)
                bch->ch.nr = i + ch;
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
-               test_and_set_bit(bch->nr & 0x1f,
-                       &dch->dev.channelmap[bch->nr >> 5]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        ret = mISDN_register_device(&dch->dev, hc->name);
        if (ret)
index 4ba4cc364c9e96ffb08c9786a55a4d00431cb7ac..e5a20f9542d1bb4456c602f73b4343879d268bac 100644 (file)
@@ -379,7 +379,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
@@ -637,7 +637,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
index 5c948f337817da7bb1386826d84f4e9f52e3d49a..8f2d60da04e757f1e1c5a9bbd26f486916a419da 100644 (file)
@@ -37,7 +37,7 @@
  */
 #define        MISDN_MAJOR_VERSION     1
 #define        MISDN_MINOR_VERSION     0
-#define MISDN_RELEASE          18
+#define MISDN_RELEASE          19
 
 /* primitives for information exchange
  * generell format
@@ -242,7 +242,8 @@ struct mISDNhead {
 #define TEI_SAPI               63
 #define CTRL_SAPI              0
 
-#define MISDN_CHMAP_SIZE       4
+#define MISDN_MAX_CHANNEL      127
+#define MISDN_CHMAP_SIZE       ((MISDN_MAX_CHANNEL + 1) >> 3)
 
 #define SOL_MISDN      0
 
@@ -275,11 +276,32 @@ struct mISDN_devinfo {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   protocol;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        u_int                   nrbchan;
        char                    name[MISDN_MAX_IDLEN];
 };
 
+static inline int
+test_channelmap(u_int nr, u_char *map)
+{
+       if (nr <= MISDN_MAX_CHANNEL)
+               return map[nr >> 3] & (1 << (nr & 7));
+       else
+               return 0;
+}
+
+static inline void
+set_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] |= (1 << (nr & 7));
+}
+
+static inline void
+clear_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] &= ~(1 << (nr & 7));
+}
+
 /* CONTROL_CHANNEL parameters */
 #define MISDN_CTRL_GETOP               0x0000
 #define MISDN_CTRL_LOOP                        0x0001
@@ -405,7 +427,7 @@ struct mISDNdevice {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   nrbchan;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        struct list_head        bchannels;
        struct mISDNchannel     *teimgr;
        struct device           dev;
@@ -430,7 +452,7 @@ struct mISDNstack {
 #endif
 };
 
-/* global alloc/queue dunctions */
+/* global alloc/queue functions */
 
 static inline struct sk_buff *
 mI_alloc_skb(unsigned int len, gfp_t gfp_mask)