aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Keil <kkeil@suse.de>2009-01-06 18:00:59 -0500
committerKarsten Keil <kkeil@suse.de>2009-01-09 16:44:22 -0500
commit69e656cc16511719a89d83373c48172d3f39bc5f (patch)
tree82762f18457664d45764e2d2c9e193e73b4e909f
parent7c51d57e9d7fbce89f79c41dc8da383101dbe9c6 (diff)
mISDN: Cleanup hfc multiport driver
Remove references to external zaptel modules and some cosmetic cleanups. Signed-off-by: Karsten Keil <kkeil@suse.de>
-rw-r--r--drivers/isdn/hardware/mISDN/hfc_multi.h4
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c109
2 files changed, 24 insertions, 89 deletions
diff --git a/drivers/isdn/hardware/mISDN/hfc_multi.h b/drivers/isdn/hardware/mISDN/hfc_multi.h
index 7bbf7300593d..6d74951a1797 100644
--- a/drivers/isdn/hardware/mISDN/hfc_multi.h
+++ b/drivers/isdn/hardware/mISDN/hfc_multi.h
@@ -2,10 +2,6 @@
2 * see notice in hfc_multi.c 2 * see notice in hfc_multi.c
3 */ 3 */
4 4
5extern void ztdummy_extern_interrupt(void);
6extern void ztdummy_register_interrupt(void);
7extern int ztdummy_unregister_interrupt(void);
8
9#define DEBUG_HFCMULTI_FIFO 0x00010000 5#define DEBUG_HFCMULTI_FIFO 0x00010000
10#define DEBUG_HFCMULTI_CRC 0x00020000 6#define DEBUG_HFCMULTI_CRC 0x00020000
11#define DEBUG_HFCMULTI_INIT 0x00040000 7#define DEBUG_HFCMULTI_INIT 0x00040000
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index c63e2f49da8a..ff5ec3cbeb77 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.02"; 143#define HFC_MULTI_VERSION "2.03"
144 144
145#include <linux/module.h> 145#include <linux/module.h>
146#include <linux/pci.h> 146#include <linux/pci.h>
@@ -165,10 +165,6 @@ static LIST_HEAD(HFClist);
165static spinlock_t HFClock; /* global hfc list lock */ 165static spinlock_t HFClock; /* global hfc list lock */
166 166
167static void ph_state_change(struct dchannel *); 167static void ph_state_change(struct dchannel *);
168static void (*hfc_interrupt)(void);
169static void (*register_interrupt)(void);
170static int (*unregister_interrupt)(void);
171static int interrupt_registered;
172 168
173static struct hfc_multi *syncmaster; 169static struct hfc_multi *syncmaster;
174static int plxsd_master; /* if we have a master card (yet) */ 170static int plxsd_master; /* if we have a master card (yet) */
@@ -209,6 +205,7 @@ static int HFC_cnt, Port_cnt, PCM_cnt = 99;
209 205
210MODULE_AUTHOR("Andreas Eversberg"); 206MODULE_AUTHOR("Andreas Eversberg");
211MODULE_LICENSE("GPL"); 207MODULE_LICENSE("GPL");
208MODULE_VERSION(HFC_MULTI_VERSION);
212module_param(debug, uint, S_IRUGO | S_IWUSR); 209module_param(debug, uint, S_IRUGO | S_IWUSR);
213module_param(poll, uint, S_IRUGO | S_IWUSR); 210module_param(poll, uint, S_IRUGO | S_IWUSR);
214module_param(timer, uint, S_IRUGO | S_IWUSR); 211module_param(timer, uint, S_IRUGO | S_IWUSR);
@@ -1419,19 +1416,6 @@ controller_fail:
1419 HFC_outb(hc, R_TI_WD, poll_timer); 1416 HFC_outb(hc, R_TI_WD, poll_timer);
1420 hc->hw.r_irqmsk_misc |= V_TI_IRQMSK; 1417 hc->hw.r_irqmsk_misc |= V_TI_IRQMSK;
1421 1418
1422 /*
1423 * set up 125us interrupt, only if function pointer is available
1424 * and module parameter timer is set
1425 */
1426 if (timer && hfc_interrupt && register_interrupt) {
1427 /* only one chip should use this interrupt */
1428 timer = 0;
1429 interrupt_registered = 1;
1430 hc->hw.r_irqmsk_misc |= V_PROC_IRQMSK;
1431 /* deactivate other interrupts in ztdummy */
1432 register_interrupt();
1433 }
1434
1435 /* set E1 state machine IRQ */ 1419 /* set E1 state machine IRQ */
1436 if (hc->type == 1) 1420 if (hc->type == 1)
1437 hc->hw.r_irqmsk_misc |= V_STA_IRQMSK; 1421 hc->hw.r_irqmsk_misc |= V_STA_IRQMSK;
@@ -2583,7 +2567,6 @@ hfcmulti_interrupt(int intno, void *dev_id)
2583 static int iq1 = 0, iq2 = 0, iq3 = 0, iq4 = 0, 2567 static int iq1 = 0, iq2 = 0, iq3 = 0, iq4 = 0,
2584 iq5 = 0, iq6 = 0, iqcnt = 0; 2568 iq5 = 0, iq6 = 0, iqcnt = 0;
2585#endif 2569#endif
2586 static int count;
2587 struct hfc_multi *hc = dev_id; 2570 struct hfc_multi *hc = dev_id;
2588 struct dchannel *dch; 2571 struct dchannel *dch;
2589 u_char r_irq_statech, status, r_irq_misc, r_irq_oview; 2572 u_char r_irq_statech, status, r_irq_misc, r_irq_oview;
@@ -2698,16 +2681,11 @@ hfcmulti_interrupt(int intno, void *dev_id)
2698 /* -> DTMF IRQ */ 2681 /* -> DTMF IRQ */
2699 hfcmulti_dtmf(hc); 2682 hfcmulti_dtmf(hc);
2700 } 2683 }
2701 /* TODO: REPLACE !!!! 125 us Interrupts are not acceptable */
2702 if (r_irq_misc & V_IRQ_PROC) { 2684 if (r_irq_misc & V_IRQ_PROC) {
2703 /* IRQ every 125us */ 2685 static int irq_proc_cnt;
2704 count++; 2686 if (!irq_proc_cnt++)
2705 /* generate 1kHz signal */ 2687 printk(KERN_WARNING "%s: got V_IRQ_PROC -"
2706 if (count == 8) { 2688 " this should not happen\n", __func__);
2707 if (hfc_interrupt)
2708 hfc_interrupt();
2709 count = 0;
2710 }
2711 } 2689 }
2712 2690
2713 } 2691 }
@@ -4945,9 +4923,7 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
4945 switch (m->dip_type) { 4923 switch (m->dip_type) {
4946 case DIP_4S: 4924 case DIP_4S:
4947 /* 4925 /*
4948 * get DIP Setting for beroNet 1S/2S/4S cards 4926 * Get DIP setting for beroNet 1S/2S/4S cards
4949 * check if Port Jumper config matches
4950 * module param 'protocol'
4951 * DIP Setting: (collect GPIO 13/14/15 (R_GPIO_IN1) + 4927 * DIP Setting: (collect GPIO 13/14/15 (R_GPIO_IN1) +
4952 * GPI 19/23 (R_GPI_IN2)) 4928 * GPI 19/23 (R_GPI_IN2))
4953 */ 4929 */
@@ -4966,9 +4942,8 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
4966 break; 4942 break;
4967 case DIP_8S: 4943 case DIP_8S:
4968 /* 4944 /*
4969 * get DIP Setting for beroNet 8S0+ cards 4945 * Get DIP Setting for beroNet 8S0+ cards
4970 * 4946 * Enable PCI auxbridge function
4971 * enable PCI auxbridge function
4972 */ 4947 */
4973 HFC_outb(hc, R_BRG_PCM_CFG, 1 | V_PCM_CLK); 4948 HFC_outb(hc, R_BRG_PCM_CFG, 1 | V_PCM_CLK);
4974 /* prepare access to auxport */ 4949 /* prepare access to auxport */
@@ -5137,8 +5112,7 @@ static struct pci_device_id hfmultipci_ids[] __devinitdata = {
5137 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, 5112 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD,
5138 PCI_DEVICE_ID_CCD_HFC8S, 0, 0, H(14)}, /* old Eval */ 5113 PCI_DEVICE_ID_CCD_HFC8S, 0, 0, H(14)}, /* old Eval */
5139 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, 5114 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD,
5140 PCI_SUBDEVICE_ID_CCD_IOB8STR, 0, 0, H(15)}, 5115 PCI_SUBDEVICE_ID_CCD_IOB8STR, 0, 0, H(15)}, /* IOB8ST Recording */
5141 /* IOB8ST Recording */
5142 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, 5116 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD,
5143 PCI_SUBDEVICE_ID_CCD_IOB8ST, 0, 0, H(16)}, /* IOB8ST */ 5117 PCI_SUBDEVICE_ID_CCD_IOB8ST, 0, 0, H(16)}, /* IOB8ST */
5144 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, 5118 { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD,
@@ -5188,18 +5162,16 @@ hfcmulti_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5188 struct hm_map *m = (struct hm_map *)ent->driver_data; 5162 struct hm_map *m = (struct hm_map *)ent->driver_data;
5189 int ret; 5163 int ret;
5190 5164
5191 if (m == NULL) { 5165 if (m == NULL && ent->vendor == PCI_VENDOR_ID_CCD && (
5192 if (ent->vendor == PCI_VENDOR_ID_CCD) 5166 ent->device == PCI_DEVICE_ID_CCD_HFC4S ||
5193 if (ent->device == PCI_DEVICE_ID_CCD_HFC4S || 5167 ent->device == PCI_DEVICE_ID_CCD_HFC8S ||
5194 ent->device == PCI_DEVICE_ID_CCD_HFC8S || 5168 ent->device == PCI_DEVICE_ID_CCD_HFCE1)) {
5195 ent->device == PCI_DEVICE_ID_CCD_HFCE1) 5169 printk(KERN_ERR
5196 printk(KERN_ERR 5170 "Unknown HFC multiport controller (vendor:%x device:%x "
5197 "unknown HFC multiport controller " 5171 "subvendor:%x subdevice:%x)\n", ent->vendor, ent->device,
5198 "(vendor:%x device:%x subvendor:%x " 5172 ent->subvendor, ent->subdevice);
5199 "subdevice:%x) Please contact the " 5173 printk(KERN_ERR
5200 "driver maintainer for support.\n", 5174 "Please contact the driver maintainer for support.\n");
5201 ent->vendor, ent->device,
5202 ent->subvendor, ent->subdevice);
5203 return -ENODEV; 5175 return -ENODEV;
5204 } 5176 }
5205 ret = hfcmulti_init(pdev, ent); 5177 ret = hfcmulti_init(pdev, ent);
@@ -5222,22 +5194,9 @@ HFCmulti_cleanup(void)
5222{ 5194{
5223 struct hfc_multi *card, *next; 5195 struct hfc_multi *card, *next;
5224 5196
5225 /* unload interrupt function symbol */ 5197 /* get rid of all devices of this driver */
5226 if (hfc_interrupt)
5227 symbol_put(ztdummy_extern_interrupt);
5228 if (register_interrupt)
5229 symbol_put(ztdummy_register_interrupt);
5230 if (unregister_interrupt) {
5231 if (interrupt_registered) {
5232 interrupt_registered = 0;
5233 unregister_interrupt();
5234 }
5235 symbol_put(ztdummy_unregister_interrupt);
5236 }
5237
5238 list_for_each_entry_safe(card, next, &HFClist, list) 5198 list_for_each_entry_safe(card, next, &HFClist, list)
5239 release_card(card); 5199 release_card(card);
5240 /* get rid of all devices of this driver */
5241 pci_unregister_driver(&hfcmultipci_driver); 5200 pci_unregister_driver(&hfcmultipci_driver);
5242} 5201}
5243 5202
@@ -5246,8 +5205,10 @@ HFCmulti_init(void)
5246{ 5205{
5247 int err; 5206 int err;
5248 5207
5208 printk(KERN_INFO "mISDN: HFC-multi driver %s\n", HFC_MULTI_VERSION);
5209
5249#ifdef IRQ_DEBUG 5210#ifdef IRQ_DEBUG
5250 printk(KERN_ERR "%s: IRQ_DEBUG IS ENABLED!\n", __func__); 5211 printk(KERN_DEBUG "%s: IRQ_DEBUG IS ENABLED!\n", __func__);
5251#endif 5212#endif
5252 5213
5253 spin_lock_init(&HFClock); 5214 spin_lock_init(&HFClock);
@@ -5256,22 +5217,11 @@ HFCmulti_init(void)
5256 if (debug & DEBUG_HFCMULTI_INIT) 5217 if (debug & DEBUG_HFCMULTI_INIT)
5257 printk(KERN_DEBUG "%s: init entered\n", __func__); 5218 printk(KERN_DEBUG "%s: init entered\n", __func__);
5258 5219
5259 hfc_interrupt = symbol_get(ztdummy_extern_interrupt);
5260 register_interrupt = symbol_get(ztdummy_register_interrupt);
5261 unregister_interrupt = symbol_get(ztdummy_unregister_interrupt);
5262 printk(KERN_INFO "mISDN: HFC-multi driver %s\n",
5263 hfcmulti_revision);
5264
5265 switch (poll) { 5220 switch (poll) {
5266 case 0: 5221 case 0:
5267 poll_timer = 6; 5222 poll_timer = 6;
5268 poll = 128; 5223 poll = 128;
5269 break; 5224 break;
5270 /*
5271 * wenn dieses break nochmal verschwindet,
5272 * gibt es heisse ohren :-)
5273 * "without the break you will get hot ears ???"
5274 */
5275 case 8: 5225 case 8:
5276 poll_timer = 2; 5226 poll_timer = 2;
5277 break; 5227 break;
@@ -5301,17 +5251,6 @@ HFCmulti_init(void)
5301 err = pci_register_driver(&hfcmultipci_driver); 5251 err = pci_register_driver(&hfcmultipci_driver);
5302 if (err < 0) { 5252 if (err < 0) {
5303 printk(KERN_ERR "error registering pci driver: %x\n", err); 5253 printk(KERN_ERR "error registering pci driver: %x\n", err);
5304 if (hfc_interrupt)
5305 symbol_put(ztdummy_extern_interrupt);
5306 if (register_interrupt)
5307 symbol_put(ztdummy_register_interrupt);
5308 if (unregister_interrupt) {
5309 if (interrupt_registered) {
5310 interrupt_registered = 0;
5311 unregister_interrupt();
5312 }
5313 symbol_put(ztdummy_unregister_interrupt);
5314 }
5315 return err; 5254 return err;
5316 } 5255 }
5317 return 0; 5256 return 0;