aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r--drivers/isdn/hisax/avm_pci.c12
-rw-r--r--drivers/isdn/hisax/avma1_cs.c4
-rw-r--r--drivers/isdn/hisax/config.c9
-rw-r--r--drivers/isdn/hisax/hfc_2bds0.c18
-rw-r--r--drivers/isdn/hisax/hfc_2bs0.c12
-rw-r--r--drivers/isdn/hisax/hfc_usb.c292
-rw-r--r--drivers/isdn/hisax/hfc_usb.h6
-rw-r--r--drivers/isdn/hisax/hscx.c12
-rw-r--r--drivers/isdn/hisax/icc.c12
-rw-r--r--drivers/isdn/hisax/ipacx.c12
-rw-r--r--drivers/isdn/hisax/isac.c15
-rw-r--r--drivers/isdn/hisax/isar.c6
-rw-r--r--drivers/isdn/hisax/jade.c12
-rw-r--r--drivers/isdn/hisax/netjet.c32
-rw-r--r--drivers/isdn/hisax/st5481_usb.c12
-rw-r--r--drivers/isdn/hisax/w6692.c12
16 files changed, 181 insertions, 297 deletions
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 625799ab0d14..5d8ee7368f7b 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -552,14 +552,10 @@ close_hdlcstate(struct BCState *bcs)
552{ 552{
553 modehdlc(bcs, 0, 0); 553 modehdlc(bcs, 0, 0);
554 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 554 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
555 if (bcs->hw.hdlc.rcvbuf) { 555 kfree(bcs->hw.hdlc.rcvbuf);
556 kfree(bcs->hw.hdlc.rcvbuf); 556 bcs->hw.hdlc.rcvbuf = NULL;
557 bcs->hw.hdlc.rcvbuf = NULL; 557 kfree(bcs->blog);
558 } 558 bcs->blog = NULL;
559 if (bcs->blog) {
560 kfree(bcs->blog);
561 bcs->blog = NULL;
562 }
563 skb_queue_purge(&bcs->rqueue); 559 skb_queue_purge(&bcs->rqueue);
564 skb_queue_purge(&bcs->squeue); 560 skb_queue_purge(&bcs->squeue);
565 if (bcs->tx_skb) { 561 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 0e22991635e7..5f5a5ae740d2 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -236,9 +236,7 @@ static void avma1cs_detach(dev_link_t *link)
236 236
237 /* Unlink device structure, free pieces */ 237 /* Unlink device structure, free pieces */
238 *linkp = link->next; 238 *linkp = link->next;
239 if (link->priv) { 239 kfree(link->priv);
240 kfree(link->priv);
241 }
242 kfree(link); 240 kfree(link);
243 241
244} /* avma1cs_detach */ 242} /* avma1cs_detach */
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index fbaab4352902..8159bcecd0c2 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -787,8 +787,7 @@ static void ll_unload(struct IsdnCardState *cs)
787 ic.command = ISDN_STAT_UNLOAD; 787 ic.command = ISDN_STAT_UNLOAD;
788 ic.driver = cs->myid; 788 ic.driver = cs->myid;
789 cs->iif.statcallb(&ic); 789 cs->iif.statcallb(&ic);
790 if (cs->status_buf) 790 kfree(cs->status_buf);
791 kfree(cs->status_buf);
792 cs->status_read = NULL; 791 cs->status_read = NULL;
793 cs->status_write = NULL; 792 cs->status_write = NULL;
794 cs->status_end = NULL; 793 cs->status_end = NULL;
@@ -807,10 +806,8 @@ static void closecard(int cardnr)
807 806
808 skb_queue_purge(&csta->rq); 807 skb_queue_purge(&csta->rq);
809 skb_queue_purge(&csta->sq); 808 skb_queue_purge(&csta->sq);
810 if (csta->rcvbuf) { 809 kfree(csta->rcvbuf);
811 kfree(csta->rcvbuf); 810 csta->rcvbuf = NULL;
812 csta->rcvbuf = NULL;
813 }
814 if (csta->tx_skb) { 811 if (csta->tx_skb) {
815 dev_kfree_skb(csta->tx_skb); 812 dev_kfree_skb(csta->tx_skb);
816 csta->tx_skb = NULL; 813 csta->tx_skb = NULL;
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index 7cf87793e790..637a261c9312 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -1052,18 +1052,12 @@ init2bds0(struct IsdnCardState *cs)
1052void 1052void
1053release2bds0(struct IsdnCardState *cs) 1053release2bds0(struct IsdnCardState *cs)
1054{ 1054{
1055 if (cs->bcs[0].hw.hfc.send) { 1055 kfree(cs->bcs[0].hw.hfc.send);
1056 kfree(cs->bcs[0].hw.hfc.send); 1056 cs->bcs[0].hw.hfc.send = NULL;
1057 cs->bcs[0].hw.hfc.send = NULL; 1057 kfree(cs->bcs[1].hw.hfc.send);
1058 } 1058 cs->bcs[1].hw.hfc.send = NULL;
1059 if (cs->bcs[1].hw.hfc.send) { 1059 kfree(cs->hw.hfcD.send);
1060 kfree(cs->bcs[1].hw.hfc.send); 1060 cs->hw.hfcD.send = NULL;
1061 cs->bcs[1].hw.hfc.send = NULL;
1062 }
1063 if (cs->hw.hfcD.send) {
1064 kfree(cs->hw.hfcD.send);
1065 cs->hw.hfcD.send = NULL;
1066 }
1067} 1061}
1068 1062
1069void 1063void
diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c
index f978a5af8662..c964539cc43e 100644
--- a/drivers/isdn/hisax/hfc_2bs0.c
+++ b/drivers/isdn/hisax/hfc_2bs0.c
@@ -582,12 +582,8 @@ inithfc(struct IsdnCardState *cs)
582void 582void
583releasehfc(struct IsdnCardState *cs) 583releasehfc(struct IsdnCardState *cs)
584{ 584{
585 if (cs->bcs[0].hw.hfc.send) { 585 kfree(cs->bcs[0].hw.hfc.send);
586 kfree(cs->bcs[0].hw.hfc.send); 586 cs->bcs[0].hw.hfc.send = NULL;
587 cs->bcs[0].hw.hfc.send = NULL; 587 kfree(cs->bcs[1].hw.hfc.send);
588 } 588 cs->bcs[1].hw.hfc.send = NULL;
589 if (cs->bcs[1].hw.hfc.send) {
590 kfree(cs->bcs[1].hw.hfc.send);
591 cs->bcs[1].hw.hfc.send = NULL;
592 }
593} 589}
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index e2c3af49d72b..32bf0d5d0f9a 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * hfc_usb.c 2 * hfc_usb.c
3 * 3 *
4 * $Id: hfc_usb.c,v 4.34 2005/01/26 17:25:53 martinb1 Exp $ 4 * $Id: hfc_usb.c,v 4.36 2005/04/08 09:55:13 martinb1 Exp $
5 * 5 *
6 * modular HiSax ISDN driver for Colognechip HFC-S USB chip 6 * modular HiSax ISDN driver for Colognechip HFC-S USB chip
7 * 7 *
@@ -44,12 +44,8 @@
44#include "hisax_if.h" 44#include "hisax_if.h"
45#include "hfc_usb.h" 45#include "hfc_usb.h"
46 46
47/*
48* Version Information
49* (do not modify the CVS Makros $Revision: 4.34 $ and $Date: 2005/01/26 17:25:53 $ !)
50*/
51static const char *hfcusb_revision = 47static const char *hfcusb_revision =
52 "Revision: 4.34 $ Date: 2005/01/26 17:25:53 $ "; 48 "$Revision: 4.36 $ $Date: 2005/04/08 09:55:13 $ ";
53 49
54/* Hisax debug support 50/* Hisax debug support
55* use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG 51* use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG
@@ -63,81 +59,89 @@ module_param(debug, uint, 0);
63static int hfc_debug; 59static int hfc_debug;
64#endif 60#endif
65 61
62/* private vendor specific data */
63typedef struct {
64 __u8 led_scheme; // led display scheme
65 signed short led_bits[8]; // array of 8 possible LED bitmask settings
66 char *vend_name; // device name
67} hfcsusb_vdata;
66 68
67/****************************************/ 69/****************************************/
68/* data defining the devices to be used */ 70/* data defining the devices to be used */
69/****************************************/ 71/****************************************/
70static struct usb_device_id hfc_usb_idtab[] = { 72static struct usb_device_id hfcusb_idtab[] = {
71 {USB_DEVICE(0x0959, 0x2bd0)}, /* Colognechip USB eval TA */ 73 {
72 {USB_DEVICE(0x0675, 0x1688)}, /* DrayTek miniVigor 128 USB ISDN TA */ 74 .idVendor = 0x0959,
73 {USB_DEVICE(0x07b0, 0x0007)}, /* Billion USB TA 2 */ 75 .idProduct = 0x2bd0,
74 {USB_DEVICE(0x0742, 0x2008)}, /* Stollmann USB TA */ 76 .driver_info = (unsigned long) &((hfcsusb_vdata)
75 {USB_DEVICE(0x0742, 0x2009)}, /* Aceex USB ISDN TA */ 77 {LED_OFF, {4, 0, 2, 1},
76 {USB_DEVICE(0x0742, 0x200A)}, /* OEM USB ISDN TA */ 78 "ISDN USB TA (Cologne Chip HFC-S USB based)"}),
77 {USB_DEVICE(0x08e3, 0x0301)}, /* OliTec ISDN USB */ 79 },
78 {USB_DEVICE(0x07fa, 0x0846)}, /* Bewan ISDN USB TA */ 80 {
79 {USB_DEVICE(0x07fa, 0x0847)}, /* Djinn Numeris USB */ 81 .idVendor = 0x0675,
80 {USB_DEVICE(0x07b0, 0x0006)}, /* Twister ISDN USB TA */ 82 .idProduct = 0x1688,
81 {} /* end with an all-zeroes entry */ 83 .driver_info = (unsigned long) &((hfcsusb_vdata)
84 {LED_SCHEME1, {1, 2, 0, 0},
85 "DrayTek miniVigor 128 USB ISDN TA"}),
86 },
87 {
88 .idVendor = 0x07b0,
89 .idProduct = 0x0007,
90 .driver_info = (unsigned long) &((hfcsusb_vdata)
91 {LED_SCHEME1, {0x80, -64, -32, -16},
92 "Billion tiny USB ISDN TA 128"}),
93 },
94 {
95 .idVendor = 0x0742,
96 .idProduct = 0x2008,
97 .driver_info = (unsigned long) &((hfcsusb_vdata)
98 {LED_SCHEME1, {4, 0, 2, 1},
99 "Stollmann USB TA"}),
100 },
101 {
102 .idVendor = 0x0742,
103 .idProduct = 0x2009,
104 .driver_info = (unsigned long) &((hfcsusb_vdata)
105 {LED_SCHEME1, {4, 0, 2, 1},
106 "Aceex USB ISDN TA"}),
107 },
108 {
109 .idVendor = 0x0742,
110 .idProduct = 0x200A,
111 .driver_info = (unsigned long) &((hfcsusb_vdata)
112 {LED_SCHEME1, {4, 0, 2, 1},
113 "OEM USB ISDN TA"}),
114 },
115 {
116 .idVendor = 0x08e3,
117 .idProduct = 0x0301,
118 .driver_info = (unsigned long) &((hfcsusb_vdata)
119 {LED_SCHEME1, {2, 0, 1, 4},
120 "Olitec USB RNIS"}),
121 },
122 {
123 .idVendor = 0x07fa,
124 .idProduct = 0x0846,
125 .driver_info = (unsigned long) &((hfcsusb_vdata)
126 {LED_SCHEME1, {0x80, -64, -32, -16},
127 "Bewan Modem RNIS USB"}),
128 },
129 {
130 .idVendor = 0x07fa,
131 .idProduct = 0x0847,
132 .driver_info = (unsigned long) &((hfcsusb_vdata)
133 {LED_SCHEME1, {0x80, -64, -32, -16},
134 "Djinn Numeris USB"}),
135 },
136 {
137 .idVendor = 0x07b0,
138 .idProduct = 0x0006,
139 .driver_info = (unsigned long) &((hfcsusb_vdata)
140 {LED_SCHEME1, {0x80, -64, -32, -16},
141 "Twister ISDN TA"}),
142 },
82}; 143};
83 144
84/* driver internal device specific data:
85* VendorID, ProductID, Devicename, LED_SCHEME,
86* LED's BitMask in HFCUSB_P_DATA Register : LED_USB, LED_S0, LED_B1, LED_B2
87*/
88static vendor_data vdata[] = {
89 /* CologneChip Eval TA */
90 {0x0959, 0x2bd0, "ISDN USB TA (Cologne Chip HFC-S USB based)",
91 LED_OFF, {4, 0, 2, 1}
92 }
93 ,
94 /* DrayTek miniVigor 128 USB ISDN TA */
95 {0x0675, 0x1688, "DrayTek miniVigor 128 USB ISDN TA",
96 LED_SCHEME1, {1, 2, 0, 0}
97 }
98 ,
99 /* Billion TA */
100 {0x07b0, 0x0007, "Billion tiny USB ISDN TA 128",
101 LED_SCHEME1, {0x80, -64, -32, -16}
102 }
103 ,
104 /* Stollmann TA */
105 {0x0742, 0x2008, "Stollmann USB TA",
106 LED_SCHEME1, {4, 0, 2, 1}
107 }
108 ,
109 /* Aceex USB ISDN TA */
110 {0x0742, 0x2009, "Aceex USB ISDN TA",
111 LED_SCHEME1, {4, 0, 2, 1}
112 }
113 ,
114 /* OEM USB ISDN TA */
115 {0x0742, 0x200A, "OEM USB ISDN TA",
116 LED_SCHEME1, {4, 0, 2, 1}
117 }
118 ,
119 /* Olitec TA */
120 {0x08e3, 0x0301, "Olitec USB RNIS",
121 LED_SCHEME1, {2, 0, 1, 4}
122 }
123 ,
124 /* Bewan TA */
125 {0x07fa, 0x0846, "Bewan Modem RNIS USB",
126 LED_SCHEME1, {0x80, -64, -32, -16}
127 }
128 ,
129 /* Bewan TA */
130 {0x07fa, 0x0847, "Djinn Numeris USB",
131 LED_SCHEME1, {0x80, -64, -32, -16}
132 }
133 ,
134 /* Twister ISDN TA */
135 {0x07b0, 0x0006, "Twister ISDN TA",
136 LED_SCHEME1, {0x80, -64, -32, -16}
137 }
138 ,
139 {0, 0, 0} /* EOL element */
140};
141 145
142/***************************************************************/ 146/***************************************************************/
143/* structure defining input+output fifos (interrupt/bulk mode) */ 147/* structure defining input+output fifos (interrupt/bulk mode) */
@@ -211,8 +215,6 @@ typedef struct hfcusb_data {
211 volatile __u8 l1_state; /* actual l1 state */ 215 volatile __u8 l1_state; /* actual l1 state */
212 struct timer_list t3_timer; /* timer 3 for activation/deactivation */ 216 struct timer_list t3_timer; /* timer 3 for activation/deactivation */
213 struct timer_list t4_timer; /* timer 4 for activation/deactivation */ 217 struct timer_list t4_timer; /* timer 4 for activation/deactivation */
214 struct timer_list led_timer; /* timer flashing leds */
215
216} hfcusb_data; 218} hfcusb_data;
217 219
218 220
@@ -227,7 +229,7 @@ symbolic(struct hfcusb_symbolic_list list[], const int num)
227 for (i = 0; list[i].name != NULL; i++) 229 for (i = 0; list[i].name != NULL; i++)
228 if (list[i].num == num) 230 if (list[i].num == num)
229 return (list[i].name); 231 return (list[i].name);
230 return "<unkown>"; 232 return "<unkown ERROR>";
231} 233}
232 234
233 235
@@ -335,93 +337,57 @@ set_led_bit(hfcusb_data * hfc, signed short led_bits, int unset)
335 } 337 }
336} 338}
337 339
338/******************************************/
339/* invert B-channel LEDs if data is sent */
340/******************************************/
341static void
342led_timer(hfcusb_data * hfc)
343{
344 static int cnt = 0;
345
346 if (cnt) {
347 if (hfc->led_b_active & 1)
348 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[2],
349 0);
350 if (hfc->led_b_active & 2)
351 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[3],
352 0);
353 } else {
354 if (!(hfc->led_b_active & 1) || hfc->led_new_data & 1)
355 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[2],
356 1);
357 if (!(hfc->led_b_active & 2) || hfc->led_new_data & 2)
358 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[3],
359 1);
360 }
361
362 write_led(hfc, hfc->led_state);
363 hfc->led_new_data = 0;
364
365 cnt = !cnt;
366
367 /* restart 4 hz timer */
368 if (!timer_pending(&hfc->led_timer)) {
369 add_timer(&hfc->led_timer);
370 hfc->led_timer.expires = jiffies + (LED_TIME * HZ) / 1000;
371 }
372}
373
374/**************************/ 340/**************************/
375/* handle LED requests */ 341/* handle LED requests */
376/**************************/ 342/**************************/
377static void 343static void
378handle_led(hfcusb_data * hfc, int event) 344handle_led(hfcusb_data * hfc, int event)
379{ 345{
346 hfcsusb_vdata *driver_info =
347 (hfcsusb_vdata *) hfcusb_idtab[hfc->vend_idx].driver_info;
348
380 /* if no scheme -> no LED action */ 349 /* if no scheme -> no LED action */
381 if (vdata[hfc->vend_idx].led_scheme == LED_OFF) 350 if (driver_info->led_scheme == LED_OFF)
382 return; 351 return;
383 352
384 switch (event) { 353 switch (event) {
385 case LED_POWER_ON: 354 case LED_POWER_ON:
386 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[0], 355 set_led_bit(hfc, driver_info->led_bits[0],
387 0); 356 0);
388 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[1], 357 set_led_bit(hfc, driver_info->led_bits[1],
389 1); 358 1);
390 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[2], 359 set_led_bit(hfc, driver_info->led_bits[2],
391 1); 360 1);
392 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[3], 361 set_led_bit(hfc, driver_info->led_bits[3],
393 1); 362 1);
394 break; 363 break;
395 case LED_POWER_OFF: /* no Power off handling */ 364 case LED_POWER_OFF: /* no Power off handling */
396 break; 365 break;
397 case LED_S0_ON: 366 case LED_S0_ON:
398 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[1], 367 set_led_bit(hfc, driver_info->led_bits[1],
399 0); 368 0);
400 break; 369 break;
401 case LED_S0_OFF: 370 case LED_S0_OFF:
402 set_led_bit(hfc, vdata[hfc->vend_idx].led_bits[1], 371 set_led_bit(hfc, driver_info->led_bits[1],
403 1); 372 1);
404 break; 373 break;
405 case LED_B1_ON: 374 case LED_B1_ON:
406 hfc->led_b_active |= 1; 375 set_led_bit(hfc, driver_info->led_bits[2],
376 0);
407 break; 377 break;
408 case LED_B1_OFF: 378 case LED_B1_OFF:
409 hfc->led_b_active &= ~1; 379 set_led_bit(hfc, driver_info->led_bits[2],
410 break; 380 1);
411 case LED_B1_DATA:
412 hfc->led_new_data |= 1;
413 break; 381 break;
414 case LED_B2_ON: 382 case LED_B2_ON:
415 hfc->led_b_active |= 2; 383 set_led_bit(hfc, driver_info->led_bits[3],
384 0);
416 break; 385 break;
417 case LED_B2_OFF: 386 case LED_B2_OFF:
418 hfc->led_b_active &= ~2; 387 set_led_bit(hfc, driver_info->led_bits[3],
419 break; 388 1);
420 case LED_B2_DATA:
421 hfc->led_new_data |= 2;
422 break; 389 break;
423 } 390 }
424
425 write_led(hfc, hfc->led_state); 391 write_led(hfc, hfc->led_state);
426} 392}
427 393
@@ -725,14 +691,6 @@ tx_iso_complete(struct urb *urb, struct pt_regs *regs)
725 current_len + 1; 691 current_len + 1;
726 692
727 tx_offset += (current_len + 1); 693 tx_offset += (current_len + 1);
728 if (!transp_mode) {
729 if (fifon == HFCUSB_B1_TX)
730 handle_led(hfc,
731 LED_B1_DATA);
732 if (fifon == HFCUSB_B2_TX)
733 handle_led(hfc,
734 LED_B2_DATA);
735 }
736 } else { 694 } else {
737 urb->iso_frame_desc[k].offset = 695 urb->iso_frame_desc[k].offset =
738 tx_offset++; 696 tx_offset++;
@@ -966,14 +924,6 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
966 skb_trim(fifo->skbuff, 0); 924 skb_trim(fifo->skbuff, 0);
967 } 925 }
968 } 926 }
969
970 /* LED flashing only in HDLC mode */
971 if (!transp_mode) {
972 if (fifon == HFCUSB_B1_RX)
973 handle_led(hfc, LED_B1_DATA);
974 if (fifon == HFCUSB_B2_RX)
975 handle_led(hfc, LED_B2_DATA);
976 }
977} 927}
978 928
979/***********************************************/ 929/***********************************************/
@@ -1339,17 +1289,6 @@ usb_init(hfcusb_data * hfc)
1339 hfc->t4_timer.data = (long) hfc; 1289 hfc->t4_timer.data = (long) hfc;
1340 hfc->t4_timer.function = (void *) l1_timer_expire_t4; 1290 hfc->t4_timer.function = (void *) l1_timer_expire_t4;
1341 1291
1342 /* init the led timer */
1343 init_timer(&hfc->led_timer);
1344 hfc->led_timer.data = (long) hfc;
1345 hfc->led_timer.function = (void *) led_timer;
1346
1347 /* trigger 4 hz led timer */
1348 if (!timer_pending(&hfc->led_timer)) {
1349 hfc->led_timer.expires = jiffies + (LED_TIME * HZ) / 1000;
1350 add_timer(&hfc->led_timer);
1351 }
1352
1353 /* init the background machinery for control requests */ 1292 /* init the background machinery for control requests */
1354 hfc->ctrl_read.bRequestType = 0xc0; 1293 hfc->ctrl_read.bRequestType = 0xc0;
1355 hfc->ctrl_read.bRequest = 1; 1294 hfc->ctrl_read.bRequest = 1;
@@ -1440,13 +1379,18 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1440 attr, cfg_found, cidx, ep_addr; 1379 attr, cfg_found, cidx, ep_addr;
1441 int cmptbl[16], small_match, iso_packet_size, packet_size, 1380 int cmptbl[16], small_match, iso_packet_size, packet_size,
1442 alt_used = 0; 1381 alt_used = 0;
1382 hfcsusb_vdata *driver_info;
1443 1383
1444 vend_idx = 0xffff; 1384 vend_idx = 0xffff;
1445 for (i = 0; vdata[i].vendor; i++) { 1385 for (i = 0; hfcusb_idtab[i].idVendor; i++) {
1446 if (dev->descriptor.idVendor == vdata[i].vendor 1386 if (dev->descriptor.idVendor == hfcusb_idtab[i].idVendor
1447 && dev->descriptor.idProduct == vdata[i].prod_id) 1387 && dev->descriptor.idProduct ==
1388 hfcusb_idtab[i].idProduct) {
1448 vend_idx = i; 1389 vend_idx = i;
1390 continue;
1391 }
1449 } 1392 }
1393
1450#ifdef CONFIG_HISAX_DEBUG 1394#ifdef CONFIG_HISAX_DEBUG
1451 DBG(USB_DBG, 1395 DBG(USB_DBG,
1452 "HFC-USB: probing interface(%d) actalt(%d) minor(%d)\n", ifnum, 1396 "HFC-USB: probing interface(%d) actalt(%d) minor(%d)\n", ifnum,
@@ -1457,10 +1401,6 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1457 ifnum, iface->desc.bAlternateSetting, intf->minor); 1401 ifnum, iface->desc.bAlternateSetting, intf->minor);
1458 1402
1459 if (vend_idx != 0xffff) { 1403 if (vend_idx != 0xffff) {
1460#ifdef CONFIG_HISAX_DEBUG
1461 DBG(USB_DBG, "HFC-S USB: found vendor idx:%d name:%s",
1462 vend_idx, vdata[vend_idx].vend_name);
1463#endif
1464 /* if vendor and product ID is OK, start probing alternate settings */ 1404 /* if vendor and product ID is OK, start probing alternate settings */
1465 alt_idx = 0; 1405 alt_idx = 0;
1466 small_match = 0xffff; 1406 small_match = 0xffff;
@@ -1687,9 +1627,11 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1687 usb_sndctrlpipe(context->dev, 0); 1627 usb_sndctrlpipe(context->dev, 0);
1688 context->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); 1628 context->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
1689 1629
1690 printk(KERN_INFO 1630 driver_info =
1691 "HFC-S USB: detected \"%s\"\n", 1631 (hfcsusb_vdata *) hfcusb_idtab[vend_idx].
1692 vdata[vend_idx].vend_name); 1632 driver_info;
1633 printk(KERN_INFO "HFC-S USB: detected \"%s\"\n",
1634 driver_info->vend_name);
1693#ifdef CONFIG_HISAX_DEBUG 1635#ifdef CONFIG_HISAX_DEBUG
1694 DBG(USB_DBG, 1636 DBG(USB_DBG,
1695 "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d)\n", 1637 "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d)\n",
@@ -1740,8 +1682,6 @@ hfc_usb_disconnect(struct usb_interface
1740 del_timer(&context->t3_timer); 1682 del_timer(&context->t3_timer);
1741 if (timer_pending(&context->t4_timer)) 1683 if (timer_pending(&context->t4_timer))
1742 del_timer(&context->t4_timer); 1684 del_timer(&context->t4_timer);
1743 if (timer_pending(&context->led_timer))
1744 del_timer(&context->led_timer);
1745 /* tell all fifos to terminate */ 1685 /* tell all fifos to terminate */
1746 for (i = 0; i < HFCUSB_NUM_FIFOS; i++) { 1686 for (i = 0; i < HFCUSB_NUM_FIFOS; i++) {
1747 if (context->fifos[i].usb_transfer_mode == USB_ISOC) { 1687 if (context->fifos[i].usb_transfer_mode == USB_ISOC) {
@@ -1785,9 +1725,11 @@ hfc_usb_disconnect(struct usb_interface
1785/* our driver information structure */ 1725/* our driver information structure */
1786/************************************/ 1726/************************************/
1787static struct usb_driver hfc_drv = { 1727static struct usb_driver hfc_drv = {
1788 .owner = THIS_MODULE,.name = 1728 .owner = THIS_MODULE,
1789 "hfc_usb",.id_table = hfc_usb_idtab,.probe = 1729 .name = "hfc_usb",
1790 hfc_usb_probe,.disconnect = hfc_usb_disconnect, 1730 .id_table = hfcusb_idtab,
1731 .probe = hfc_usb_probe,
1732 .disconnect = hfc_usb_disconnect,
1791}; 1733};
1792static void __exit 1734static void __exit
1793hfc_usb_exit(void) 1735hfc_usb_exit(void)
@@ -1825,4 +1767,4 @@ module_exit(hfc_usb_exit);
1825MODULE_AUTHOR(DRIVER_AUTHOR); 1767MODULE_AUTHOR(DRIVER_AUTHOR);
1826MODULE_DESCRIPTION(DRIVER_DESC); 1768MODULE_DESCRIPTION(DRIVER_DESC);
1827MODULE_LICENSE("GPL"); 1769MODULE_LICENSE("GPL");
1828MODULE_DEVICE_TABLE(usb, hfc_usb_idtab); 1770MODULE_DEVICE_TABLE(usb, hfcusb_idtab);
diff --git a/drivers/isdn/hisax/hfc_usb.h b/drivers/isdn/hisax/hfc_usb.h
index 280dd29b30d6..ec52c1a7c22a 100644
--- a/drivers/isdn/hisax/hfc_usb.h
+++ b/drivers/isdn/hisax/hfc_usb.h
@@ -1,7 +1,7 @@
1/* 1/*
2* hfc_usb.h 2* hfc_usb.h
3* 3*
4* $Id: hfc_usb.h,v 4.1 2005/01/26 17:25:53 martinb1 Exp $ 4* $Id: hfc_usb.h,v 4.2 2005/04/07 15:27:17 martinb1 Exp $
5*/ 5*/
6 6
7#ifndef __HFC_USB_H__ 7#ifndef __HFC_USB_H__
@@ -91,7 +91,7 @@
91/**********/ 91/**********/
92/* macros */ 92/* macros */
93/**********/ 93/**********/
94#define write_usb(a,b,c)usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT) 94#define write_usb(a,b,c)usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT)
95#define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT) 95#define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
96 96
97 97
@@ -186,6 +186,7 @@ static int validconf[][19] = {
186 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} // EOL element 186 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} // EOL element
187}; 187};
188 188
189#ifdef CONFIG_HISAX_DEBUG
189// string description of chosen config 190// string description of chosen config
190static char *conf_str[] = { 191static char *conf_str[] = {
191 "4 Interrupt IN + 3 Isochron OUT", 192 "4 Interrupt IN + 3 Isochron OUT",
@@ -193,6 +194,7 @@ static char *conf_str[] = {
193 "4 Isochron IN + 3 Isochron OUT", 194 "4 Isochron IN + 3 Isochron OUT",
194 "3 Isochron IN + 3 Isochron OUT" 195 "3 Isochron IN + 3 Isochron OUT"
195}; 196};
197#endif
196 198
197 199
198typedef struct { 200typedef struct {
diff --git a/drivers/isdn/hisax/hscx.c b/drivers/isdn/hisax/hscx.c
index 66dbaee77bfb..c8f9951f7914 100644
--- a/drivers/isdn/hisax/hscx.c
+++ b/drivers/isdn/hisax/hscx.c
@@ -156,14 +156,10 @@ close_hscxstate(struct BCState *bcs)
156{ 156{
157 modehscx(bcs, 0, bcs->channel); 157 modehscx(bcs, 0, bcs->channel);
158 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 158 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
159 if (bcs->hw.hscx.rcvbuf) { 159 kfree(bcs->hw.hscx.rcvbuf);
160 kfree(bcs->hw.hscx.rcvbuf); 160 bcs->hw.hscx.rcvbuf = NULL;
161 bcs->hw.hscx.rcvbuf = NULL; 161 kfree(bcs->blog);
162 } 162 bcs->blog = NULL;
163 if (bcs->blog) {
164 kfree(bcs->blog);
165 bcs->blog = NULL;
166 }
167 skb_queue_purge(&bcs->rqueue); 163 skb_queue_purge(&bcs->rqueue);
168 skb_queue_purge(&bcs->squeue); 164 skb_queue_purge(&bcs->squeue);
169 if (bcs->tx_skb) { 165 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index b4ca5859b177..c615752b96aa 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -571,14 +571,10 @@ setstack_icc(struct PStack *st, struct IsdnCardState *cs)
571 571
572static void 572static void
573DC_Close_icc(struct IsdnCardState *cs) { 573DC_Close_icc(struct IsdnCardState *cs) {
574 if (cs->dc.icc.mon_rx) { 574 kfree(cs->dc.icc.mon_rx);
575 kfree(cs->dc.icc.mon_rx); 575 cs->dc.icc.mon_rx = NULL;
576 cs->dc.icc.mon_rx = NULL; 576 kfree(cs->dc.icc.mon_tx);
577 } 577 cs->dc.icc.mon_tx = NULL;
578 if (cs->dc.icc.mon_tx) {
579 kfree(cs->dc.icc.mon_tx);
580 cs->dc.icc.mon_tx = NULL;
581 }
582} 578}
583 579
584static void 580static void
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index efba2f448017..2e9afae1254a 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -762,14 +762,10 @@ bch_close_state(struct BCState *bcs)
762{ 762{
763 bch_mode(bcs, 0, bcs->channel); 763 bch_mode(bcs, 0, bcs->channel);
764 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 764 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
765 if (bcs->hw.hscx.rcvbuf) { 765 kfree(bcs->hw.hscx.rcvbuf);
766 kfree(bcs->hw.hscx.rcvbuf); 766 bcs->hw.hscx.rcvbuf = NULL;
767 bcs->hw.hscx.rcvbuf = NULL; 767 kfree(bcs->blog);
768 } 768 bcs->blog = NULL;
769 if (bcs->blog) {
770 kfree(bcs->blog);
771 bcs->blog = NULL;
772 }
773 skb_queue_purge(&bcs->rqueue); 769 skb_queue_purge(&bcs->rqueue);
774 skb_queue_purge(&bcs->squeue); 770 skb_queue_purge(&bcs->squeue);
775 if (bcs->tx_skb) { 771 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index 85e063a08d23..565b7892c267 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -570,15 +570,12 @@ setstack_isac(struct PStack *st, struct IsdnCardState *cs)
570} 570}
571 571
572static void 572static void
573DC_Close_isac(struct IsdnCardState *cs) { 573DC_Close_isac(struct IsdnCardState *cs)
574 if (cs->dc.isac.mon_rx) { 574{
575 kfree(cs->dc.isac.mon_rx); 575 kfree(cs->dc.isac.mon_rx);
576 cs->dc.isac.mon_rx = NULL; 576 cs->dc.isac.mon_rx = NULL;
577 } 577 kfree(cs->dc.isac.mon_tx);
578 if (cs->dc.isac.mon_tx) { 578 cs->dc.isac.mon_tx = NULL;
579 kfree(cs->dc.isac.mon_tx);
580 cs->dc.isac.mon_tx = NULL;
581 }
582} 579}
583 580
584static void 581static void
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index 642a87c51295..674af673ff96 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -1688,10 +1688,8 @@ close_isarstate(struct BCState *bcs)
1688{ 1688{
1689 modeisar(bcs, 0, bcs->channel); 1689 modeisar(bcs, 0, bcs->channel);
1690 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 1690 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
1691 if (bcs->hw.isar.rcvbuf) { 1691 kfree(bcs->hw.isar.rcvbuf);
1692 kfree(bcs->hw.isar.rcvbuf); 1692 bcs->hw.isar.rcvbuf = NULL;
1693 bcs->hw.isar.rcvbuf = NULL;
1694 }
1695 skb_queue_purge(&bcs->rqueue); 1693 skb_queue_purge(&bcs->rqueue);
1696 skb_queue_purge(&bcs->squeue); 1694 skb_queue_purge(&bcs->squeue);
1697 if (bcs->tx_skb) { 1695 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c
index 363ae3179bbd..2659fecc2674 100644
--- a/drivers/isdn/hisax/jade.c
+++ b/drivers/isdn/hisax/jade.c
@@ -195,14 +195,10 @@ close_jadestate(struct BCState *bcs)
195{ 195{
196 modejade(bcs, 0, bcs->channel); 196 modejade(bcs, 0, bcs->channel);
197 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 197 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
198 if (bcs->hw.hscx.rcvbuf) { 198 kfree(bcs->hw.hscx.rcvbuf);
199 kfree(bcs->hw.hscx.rcvbuf); 199 bcs->hw.hscx.rcvbuf = NULL;
200 bcs->hw.hscx.rcvbuf = NULL; 200 kfree(bcs->blog);
201 } 201 bcs->blog = NULL;
202 if (bcs->blog) {
203 kfree(bcs->blog);
204 bcs->blog = NULL;
205 }
206 skb_queue_purge(&bcs->rqueue); 202 skb_queue_purge(&bcs->rqueue);
207 skb_queue_purge(&bcs->squeue); 203 skb_queue_purge(&bcs->squeue);
208 if (bcs->tx_skb) { 204 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
index 94da03c30c51..47a47ef0968b 100644
--- a/drivers/isdn/hisax/netjet.c
+++ b/drivers/isdn/hisax/netjet.c
@@ -855,14 +855,10 @@ close_tigerstate(struct BCState *bcs)
855{ 855{
856 mode_tiger(bcs, 0, bcs->channel); 856 mode_tiger(bcs, 0, bcs->channel);
857 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 857 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
858 if (bcs->hw.tiger.rcvbuf) { 858 kfree(bcs->hw.tiger.rcvbuf);
859 kfree(bcs->hw.tiger.rcvbuf); 859 bcs->hw.tiger.rcvbuf = NULL;
860 bcs->hw.tiger.rcvbuf = NULL; 860 kfree(bcs->hw.tiger.sendbuf);
861 } 861 bcs->hw.tiger.sendbuf = NULL;
862 if (bcs->hw.tiger.sendbuf) {
863 kfree(bcs->hw.tiger.sendbuf);
864 bcs->hw.tiger.sendbuf = NULL;
865 }
866 skb_queue_purge(&bcs->rqueue); 862 skb_queue_purge(&bcs->rqueue);
867 skb_queue_purge(&bcs->squeue); 863 skb_queue_purge(&bcs->squeue);
868 if (bcs->tx_skb) { 864 if (bcs->tx_skb) {
@@ -967,20 +963,12 @@ inittiger(struct IsdnCardState *cs)
967static void 963static void
968releasetiger(struct IsdnCardState *cs) 964releasetiger(struct IsdnCardState *cs)
969{ 965{
970 if (cs->bcs[0].hw.tiger.send) { 966 kfree(cs->bcs[0].hw.tiger.send);
971 kfree(cs->bcs[0].hw.tiger.send); 967 cs->bcs[0].hw.tiger.send = NULL;
972 cs->bcs[0].hw.tiger.send = NULL; 968 cs->bcs[1].hw.tiger.send = NULL;
973 } 969 kfree(cs->bcs[0].hw.tiger.rec);
974 if (cs->bcs[1].hw.tiger.send) { 970 cs->bcs[0].hw.tiger.rec = NULL;
975 cs->bcs[1].hw.tiger.send = NULL; 971 cs->bcs[1].hw.tiger.rec = NULL;
976 }
977 if (cs->bcs[0].hw.tiger.rec) {
978 kfree(cs->bcs[0].hw.tiger.rec);
979 cs->bcs[0].hw.tiger.rec = NULL;
980 }
981 if (cs->bcs[1].hw.tiger.rec) {
982 cs->bcs[1].hw.tiger.rec = NULL;
983 }
984} 972}
985 973
986void 974void
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
index 89fbeb58485d..b096b64b0253 100644
--- a/drivers/isdn/hisax/st5481_usb.c
+++ b/drivers/isdn/hisax/st5481_usb.c
@@ -335,14 +335,12 @@ void st5481_release_usb(struct st5481_adapter *adapter)
335 335
336 // Stop and free Control and Interrupt URBs 336 // Stop and free Control and Interrupt URBs
337 usb_kill_urb(ctrl->urb); 337 usb_kill_urb(ctrl->urb);
338 if (ctrl->urb->transfer_buffer) 338 kfree(ctrl->urb->transfer_buffer);
339 kfree(ctrl->urb->transfer_buffer);
340 usb_free_urb(ctrl->urb); 339 usb_free_urb(ctrl->urb);
341 ctrl->urb = NULL; 340 ctrl->urb = NULL;
342 341
343 usb_kill_urb(intr->urb); 342 usb_kill_urb(intr->urb);
344 if (intr->urb->transfer_buffer) 343 kfree(intr->urb->transfer_buffer);
345 kfree(intr->urb->transfer_buffer);
346 usb_free_urb(intr->urb); 344 usb_free_urb(intr->urb);
347 ctrl->urb = NULL; 345 ctrl->urb = NULL;
348} 346}
@@ -457,8 +455,7 @@ st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev,
457 err: 455 err:
458 for (j = 0; j < 2; j++) { 456 for (j = 0; j < 2; j++) {
459 if (urb[j]) { 457 if (urb[j]) {
460 if (urb[j]->transfer_buffer) 458 kfree(urb[j]->transfer_buffer);
461 kfree(urb[j]->transfer_buffer);
462 urb[j]->transfer_buffer = NULL; 459 urb[j]->transfer_buffer = NULL;
463 usb_free_urb(urb[j]); 460 usb_free_urb(urb[j]);
464 urb[j] = NULL; 461 urb[j] = NULL;
@@ -473,8 +470,7 @@ void st5481_release_isocpipes(struct urb* urb[2])
473 470
474 for (j = 0; j < 2; j++) { 471 for (j = 0; j < 2; j++) {
475 usb_kill_urb(urb[j]); 472 usb_kill_urb(urb[j]);
476 if (urb[j]->transfer_buffer) 473 kfree(urb[j]->transfer_buffer);
477 kfree(urb[j]->transfer_buffer);
478 usb_free_urb(urb[j]); 474 usb_free_urb(urb[j]);
479 urb[j] = NULL; 475 urb[j] = NULL;
480 } 476 }
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index 7baf8e488471..0352ee5f706c 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -819,14 +819,10 @@ close_w6692state(struct BCState *bcs)
819{ 819{
820 W6692Bmode(bcs, 0, bcs->channel); 820 W6692Bmode(bcs, 0, bcs->channel);
821 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 821 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
822 if (bcs->hw.w6692.rcvbuf) { 822 kfree(bcs->hw.w6692.rcvbuf);
823 kfree(bcs->hw.w6692.rcvbuf); 823 bcs->hw.w6692.rcvbuf = NULL;
824 bcs->hw.w6692.rcvbuf = NULL; 824 kfree(bcs->blog);
825 } 825 bcs->blog = NULL;
826 if (bcs->blog) {
827 kfree(bcs->blog);
828 bcs->blog = NULL;
829 }
830 skb_queue_purge(&bcs->rqueue); 826 skb_queue_purge(&bcs->rqueue);
831 skb_queue_purge(&bcs->squeue); 827 skb_queue_purge(&bcs->squeue);
832 if (bcs->tx_skb) { 828 if (bcs->tx_skb) {