aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
authorStanislaw Gruszka <stf_xl@wp.pl>2007-08-20 17:21:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:17 -0400
commit603cf6087c5f3ee054bb257195b023848d26d76f (patch)
tree8ced596b1fe5996f63045e2ea2e22222272427de /drivers/usb/atm
parentc8e463796c7ae6d8dda39b0c7eb3d627600ffe2e (diff)
UEAGLE: Devolo and Elsa chipsets support
Support for Devolo and Elsa chipsets. These chipsets have no information about ADSL annex (line type) encoded in USB descriptors. Driver try to get this information from USB VID and PID or it can be explicitly set by the user through module parameter. Thanks to Johann Hanne, whose make most of this patch. Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/ueagle-atm.c114
1 files changed, 88 insertions, 26 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index b5e8cbad223b..2cdabd3421e2 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -149,6 +149,9 @@ struct uea_softc {
149 149
150 int modem_index; 150 int modem_index;
151 unsigned int driver_info; 151 unsigned int driver_info;
152 int annex;
153#define ANNEXA 0
154#define ANNEXB 1
152 155
153 int booting; 156 int booting;
154 int reset; 157 int reset;
@@ -207,10 +210,34 @@ struct uea_softc {
207#define ELSA_PID_PSTFIRM 0x3350 210#define ELSA_PID_PSTFIRM 0x3350
208#define ELSA_PID_PREFIRM 0x3351 211#define ELSA_PID_PREFIRM 0x3351
209 212
213#define ELSA_PID_A_PREFIRM 0x3352
214#define ELSA_PID_A_PSTFIRM 0x3353
215#define ELSA_PID_B_PREFIRM 0x3362
216#define ELSA_PID_B_PSTFIRM 0x3363
217
210/* 218/*
211 * Sagem USB IDs 219 * Devolo IDs : pots if (pid & 0x10)
212 */ 220 */
213#define EAGLE_VID 0x1110 221#define DEVOLO_VID 0x1039
222#define DEVOLO_EAGLE_I_A_PID_PSTFIRM 0x2110
223#define DEVOLO_EAGLE_I_A_PID_PREFIRM 0x2111
224
225#define DEVOLO_EAGLE_I_B_PID_PSTFIRM 0x2100
226#define DEVOLO_EAGLE_I_B_PID_PREFIRM 0x2101
227
228#define DEVOLO_EAGLE_II_A_PID_PSTFIRM 0x2130
229#define DEVOLO_EAGLE_II_A_PID_PREFIRM 0x2131
230
231#define DEVOLO_EAGLE_II_B_PID_PSTFIRM 0x2120
232#define DEVOLO_EAGLE_II_B_PID_PREFIRM 0x2121
233
234/*
235 * Reference design USB IDs
236 */
237#define ANALOG_VID 0x1110
238#define ADI930_PID_PREFIRM 0x9001
239#define ADI930_PID_PSTFIRM 0x9000
240
214#define EAGLE_I_PID_PREFIRM 0x9010 /* Eagle I */ 241#define EAGLE_I_PID_PREFIRM 0x9010 /* Eagle I */
215#define EAGLE_I_PID_PSTFIRM 0x900F /* Eagle I */ 242#define EAGLE_I_PID_PSTFIRM 0x900F /* Eagle I */
216 243
@@ -241,6 +268,9 @@ struct uea_softc {
241 268
242#define PREFIRM 0 269#define PREFIRM 0
243#define PSTFIRM (1<<7) 270#define PSTFIRM (1<<7)
271#define AUTO_ANNEX_A (1<<8)
272#define AUTO_ANNEX_B (1<<9)
273
244enum { 274enum {
245 ADI930 = 0, 275 ADI930 = 0,
246 EAGLE_I, 276 EAGLE_I,
@@ -255,8 +285,8 @@ enum {
255#define UEA_CHIP_VERSION(x) \ 285#define UEA_CHIP_VERSION(x) \
256 ((x)->driver_info & 0xf) 286 ((x)->driver_info & 0xf)
257 287
258#define IS_ISDN(usb_dev) \ 288#define IS_ISDN(x) \
259 (le16_to_cpu((usb_dev)->descriptor.bcdDevice) & 0x80) 289 ((x)->annex & ANNEXB)
260 290
261#define INS_TO_USBDEV(ins) ins->usb_dev 291#define INS_TO_USBDEV(ins) ins->usb_dev
262 292
@@ -511,6 +541,7 @@ static unsigned int debug;
511static int use_iso[NB_MODEM] = {[0 ... (NB_MODEM - 1)] = 1}; 541static int use_iso[NB_MODEM] = {[0 ... (NB_MODEM - 1)] = 1};
512static int sync_wait[NB_MODEM]; 542static int sync_wait[NB_MODEM];
513static char *cmv_file[NB_MODEM]; 543static char *cmv_file[NB_MODEM];
544static int annex[NB_MODEM];
514 545
515module_param(debug, uint, 0644); 546module_param(debug, uint, 0644);
516MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)"); 547MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)");
@@ -521,6 +552,9 @@ MODULE_PARM_DESC(sync_wait, "wait the synchronisation before starting ATM");
521module_param_array(cmv_file, charp, NULL, 0644); 552module_param_array(cmv_file, charp, NULL, 0644);
522MODULE_PARM_DESC(cmv_file, 553MODULE_PARM_DESC(cmv_file,
523 "file name with configuration and management variables"); 554 "file name with configuration and management variables");
555module_param_array(annex, uint, NULL, 0644);
556MODULE_PARM_DESC(annex,
557 "manually set annex a/b (0=auto, 1=annex a, 2=annex b)");
524 558
525#define UPDATE_ATM_STAT(type, val) \ 559#define UPDATE_ATM_STAT(type, val) \
526 do { \ 560 do { \
@@ -810,17 +844,17 @@ static int request_dsp(struct uea_softc *sc)
810 char *dsp_name; 844 char *dsp_name;
811 845
812 if (UEA_CHIP_VERSION(sc) == EAGLE_IV) { 846 if (UEA_CHIP_VERSION(sc) == EAGLE_IV) {
813 if (IS_ISDN(sc->usb_dev)) 847 if (IS_ISDN(sc))
814 dsp_name = FW_DIR "DSP4i.bin"; 848 dsp_name = FW_DIR "DSP4i.bin";
815 else 849 else
816 dsp_name = FW_DIR "DSP4p.bin"; 850 dsp_name = FW_DIR "DSP4p.bin";
817 } else if (UEA_CHIP_VERSION(sc) == ADI930) { 851 } else if (UEA_CHIP_VERSION(sc) == ADI930) {
818 if (IS_ISDN(sc->usb_dev)) 852 if (IS_ISDN(sc))
819 dsp_name = FW_DIR "DSP9i.bin"; 853 dsp_name = FW_DIR "DSP9i.bin";
820 else 854 else
821 dsp_name = FW_DIR "DSP9p.bin"; 855 dsp_name = FW_DIR "DSP9p.bin";
822 } else { 856 } else {
823 if (IS_ISDN(sc->usb_dev)) 857 if (IS_ISDN(sc))
824 dsp_name = FW_DIR "DSPei.bin"; 858 dsp_name = FW_DIR "DSPei.bin";
825 else 859 else
826 dsp_name = FW_DIR "DSPep.bin"; 860 dsp_name = FW_DIR "DSPep.bin";
@@ -1515,7 +1549,7 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver)
1515 else 1549 else
1516 file_arr[3] = 'e'; 1550 file_arr[3] = 'e';
1517 1551
1518 file_arr[4] = IS_ISDN(sc->usb_dev) ? 'i' : 'p'; 1552 file_arr[4] = IS_ISDN(sc) ? 'i' : 'p';
1519 file = file_arr; 1553 file = file_arr;
1520 } else 1554 } else
1521 file = cmv_file[sc->modem_index]; 1555 file = cmv_file[sc->modem_index];
@@ -2459,6 +2493,19 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
2459 sc->modem_index = (modem_index < NB_MODEM) ? modem_index++ : 0; 2493 sc->modem_index = (modem_index < NB_MODEM) ? modem_index++ : 0;
2460 sc->driver_info = id->driver_info; 2494 sc->driver_info = id->driver_info;
2461 2495
2496 /* first try to use module parameter */
2497 if (annex[sc->modem_index] == 1)
2498 sc->annex = ANNEXA;
2499 else if (annex[sc->modem_index] == 2)
2500 sc->annex = ANNEXB;
2501 /* try to autodetect annex */
2502 else if (sc->driver_info & AUTO_ANNEX_A)
2503 sc->annex = ANNEXA;
2504 else if (sc->driver_info & AUTO_ANNEX_B)
2505 sc->annex = ANNEXB;
2506 else
2507 sc->annex = (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80)?ANNEXB:ANNEXA;
2508
2462 /* ADI930 don't support iso */ 2509 /* ADI930 don't support iso */
2463 if (UEA_CHIP_VERSION(id) != ADI930 && use_iso[sc->modem_index]) { 2510 if (UEA_CHIP_VERSION(id) != ADI930 && use_iso[sc->modem_index]) {
2464 int i; 2511 int i;
@@ -2520,10 +2567,11 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
2520 struct usb_device *usb = interface_to_usbdev(intf); 2567 struct usb_device *usb = interface_to_usbdev(intf);
2521 2568
2522 uea_enters(usb); 2569 uea_enters(usb);
2523 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s %s\n", 2570 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n",
2524 le16_to_cpu(usb->descriptor.idVendor), 2571 le16_to_cpu(usb->descriptor.idVendor),
2525 le16_to_cpu(usb->descriptor.idProduct), 2572 le16_to_cpu(usb->descriptor.idProduct),
2526 chip_name[UEA_CHIP_VERSION(id)], IS_ISDN(usb)?"isdn":"pots"); 2573 le16_to_cpu(usb->descriptor.bcdDevice),
2574 chip_name[UEA_CHIP_VERSION(id)]);
2527 2575
2528 usb_reset_device(usb); 2576 usb_reset_device(usb);
2529 2577
@@ -2556,26 +2604,40 @@ static void uea_disconnect(struct usb_interface *intf)
2556 * List of supported VID/PID 2604 * List of supported VID/PID
2557 */ 2605 */
2558static const struct usb_device_id uea_ids[] = { 2606static const struct usb_device_id uea_ids[] = {
2607 {USB_DEVICE(ANALOG_VID, ADI930_PID_PREFIRM), .driver_info = ADI930 | PREFIRM},
2608 {USB_DEVICE(ANALOG_VID, ADI930_PID_PSTFIRM), .driver_info = ADI930 | PSTFIRM},
2609 {USB_DEVICE(ANALOG_VID, EAGLE_I_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
2610 {USB_DEVICE(ANALOG_VID, EAGLE_I_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM},
2611 {USB_DEVICE(ANALOG_VID, EAGLE_II_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
2612 {USB_DEVICE(ANALOG_VID, EAGLE_II_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM},
2613 {USB_DEVICE(ANALOG_VID, EAGLE_IIC_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
2614 {USB_DEVICE(ANALOG_VID, EAGLE_IIC_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM},
2615 {USB_DEVICE(ANALOG_VID, EAGLE_III_PID_PREFIRM), .driver_info = EAGLE_III | PREFIRM},
2616 {USB_DEVICE(ANALOG_VID, EAGLE_III_PID_PSTFIRM), .driver_info = EAGLE_III | PSTFIRM},
2617 {USB_DEVICE(ANALOG_VID, EAGLE_IV_PID_PREFIRM), .driver_info = EAGLE_IV | PREFIRM},
2618 {USB_DEVICE(ANALOG_VID, EAGLE_IV_PID_PSTFIRM), .driver_info = EAGLE_IV | PSTFIRM},
2619 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_I_A_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
2620 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_I_A_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_A},
2621 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_I_B_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
2622 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_I_B_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_B},
2623 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_II_A_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
2624 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_II_A_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM | AUTO_ANNEX_A},
2625 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_II_B_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
2626 {USB_DEVICE(DEVOLO_VID, DEVOLO_EAGLE_II_B_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM | AUTO_ANNEX_B},
2559 {USB_DEVICE(ELSA_VID, ELSA_PID_PREFIRM), .driver_info = ADI930 | PREFIRM}, 2627 {USB_DEVICE(ELSA_VID, ELSA_PID_PREFIRM), .driver_info = ADI930 | PREFIRM},
2560 {USB_DEVICE(ELSA_VID, ELSA_PID_PSTFIRM), .driver_info = ADI930 | PSTFIRM}, 2628 {USB_DEVICE(ELSA_VID, ELSA_PID_PSTFIRM), .driver_info = ADI930 | PSTFIRM},
2561 {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, 2629 {USB_DEVICE(ELSA_VID, ELSA_PID_A_PREFIRM), .driver_info = ADI930 | PREFIRM},
2562 {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, 2630 {USB_DEVICE(ELSA_VID, ELSA_PID_A_PSTFIRM), .driver_info = ADI930 | PSTFIRM | AUTO_ANNEX_A},
2563 {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM}, 2631 {USB_DEVICE(ELSA_VID, ELSA_PID_B_PREFIRM), .driver_info = ADI930 | PREFIRM},
2564 {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM}, 2632 {USB_DEVICE(ELSA_VID, ELSA_PID_B_PSTFIRM), .driver_info = ADI930 | PSTFIRM | AUTO_ANNEX_B},
2565 {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM},
2566 {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM},
2567 {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PREFIRM), .driver_info = EAGLE_III | PREFIRM},
2568 {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PSTFIRM), .driver_info = EAGLE_III | PSTFIRM},
2569 {USB_DEVICE(EAGLE_VID, EAGLE_IV_PID_PREFIRM), .driver_info = EAGLE_IV | PREFIRM},
2570 {USB_DEVICE(EAGLE_VID, EAGLE_IV_PID_PSTFIRM), .driver_info = EAGLE_IV | PSTFIRM},
2571 {USB_DEVICE(USR_VID, MILLER_A_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, 2633 {USB_DEVICE(USR_VID, MILLER_A_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
2572 {USB_DEVICE(USR_VID, MILLER_A_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, 2634 {USB_DEVICE(USR_VID, MILLER_A_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_A},
2573 {USB_DEVICE(USR_VID, MILLER_B_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, 2635 {USB_DEVICE(USR_VID, MILLER_B_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM},
2574 {USB_DEVICE(USR_VID, MILLER_B_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, 2636 {USB_DEVICE(USR_VID, MILLER_B_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_B},
2575 {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM}, 2637 {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM},
2576 {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM}, 2638 {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_A},
2577 {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM}, 2639 {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM},
2578 {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM}, 2640 {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM | AUTO_ANNEX_B},
2579 {} 2641 {}
2580}; 2642};
2581 2643