include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / isdn / hardware / mISDN / hfcmulti.c
index e1dab30..75e71b5 100644 (file)
 #define HFC_MULTI_VERSION      "2.03"
 
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/mISDNhw.h>
@@ -2846,7 +2847,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
        int conf;
 
        if (ch < 0 || ch > 31)
-               return EINVAL;
+               return -EINVAL;
        oslot_tx = hc->chan[ch].slot_tx;
        oslot_rx = hc->chan[ch].slot_rx;
        conf = hc->chan[ch].conf;
@@ -3152,7 +3153,7 @@ static void
 hfcmulti_pcm(struct hfc_multi *hc, int ch, int slot_tx, int bank_tx,
     int slot_rx, int bank_rx)
 {
-       if (slot_rx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {
+       if (slot_tx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {
                /* disable PCM */
                mode_hfcmulti(hc, ch, hc->chan[ch].protocol, -1, 0, -1, 0);
                return;
@@ -3416,22 +3417,8 @@ deactivate_bchannel(struct bchannel *bch)
        u_long                  flags;
 
        spin_lock_irqsave(&hc->lock, flags);
-       if (test_and_clear_bit(FLG_TX_NEXT, &bch->Flags)) {
-               dev_kfree_skb(bch->next_skb);
-               bch->next_skb = NULL;
-       }
-       if (bch->tx_skb) {
-               dev_kfree_skb(bch->tx_skb);
-               bch->tx_skb = NULL;
-       }
-       bch->tx_idx = 0;
-       if (bch->rx_skb) {
-               dev_kfree_skb(bch->rx_skb);
-               bch->rx_skb = NULL;
-       }
+       mISDN_clear_bchannel(bch);
        hc->chan[bch->slot].coeff_count = 0;
-       test_and_clear_bit(FLG_ACTIVE, &bch->Flags);
-       test_and_clear_bit(FLG_TX_BUSY, &bch->Flags);
        hc->chan[bch->slot].rx_off = 0;
        hc->chan[bch->slot].conf = -1;
        mode_hfcmulti(hc, bch->slot, ISDN_P_NONE, -1, 0, -1, 0);
@@ -5279,6 +5266,8 @@ static const struct hm_map hfcm_map[] = {
 /*31*/ {VENDOR_CCD, "XHFC-4S Speech Design", 5, 4, 0, 0, 0, 0,
                HFC_IO_MODE_EMBSD, XHFC_IRQ},
 /*32*/ {VENDOR_JH, "HFC-8S (junghanns)", 8, 8, 1, 0, 0, 0, 0, 0},
+/*33*/ {VENDOR_BN, "HFC-2S Beronet Card PCIe", 4, 2, 1, 3, 0, DIP_4S, 0, 0},
+/*34*/ {VENDOR_BN, "HFC-4S Beronet Card PCIe", 4, 4, 1, 2, 0, DIP_4S, 0, 0},
 };
 
 #undef H
@@ -5314,6 +5303,10 @@ static struct pci_device_id hfmultipci_ids[] __devinitdata = {
                PCI_SUBDEVICE_ID_CCD_OV4S, 0, 0, H(28)}, /* OpenVox 4 */
        { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
                PCI_SUBDEVICE_ID_CCD_OV2S, 0, 0, H(29)}, /* OpenVox 2 */
+       { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
+               0xb761, 0, 0, H(33)}, /* BN2S PCIe */
+       { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
+               0xb762, 0, 0, H(34)}, /* BN4S PCIe */
 
        /* Cards with HFC-8S Chip */
        { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD,
@@ -5384,9 +5377,10 @@ hfcmulti_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
            ent->device == PCI_DEVICE_ID_CCD_HFC8S ||
            ent->device == PCI_DEVICE_ID_CCD_HFCE1)) {
                printk(KERN_ERR
-                   "Unknown HFC multiport controller (vendor:%x device:%x "
-                   "subvendor:%x subdevice:%x)\n", ent->vendor, ent->device,
-                   ent->subvendor, ent->subdevice);
+                   "Unknown HFC multiport controller (vendor:%04x device:%04x "
+                   "subvendor:%04x subdevice:%04x)\n", pdev->vendor,
+                   pdev->device, pdev->subsystem_vendor,
+                   pdev->subsystem_device);
                printk(KERN_ERR
                    "Please contact the driver maintainer for support.\n");
                return -ENODEV;
@@ -5494,7 +5488,7 @@ HFCmulti_init(void)
                if (err) {
                        printk(KERN_ERR "error registering embedded driver: "
                                "%x\n", err);
-                       return -err;
+                       return err;
                }
                HFC_cnt++;
                printk(KERN_INFO "%d devices registered\n", HFC_cnt);