diff options
author | Stanislaw Gruszka <stf_xl@wp.pl> | 2007-08-20 17:21:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:17 -0400 |
commit | 503add467d4dd2355fe16ebffa7f6d5e9fcd10a8 (patch) | |
tree | b9219eff27b04eb8cd265f2d779acd069467c97f /drivers | |
parent | 603cf6087c5f3ee054bb257195b023848d26d76f (diff) |
UEAGLE: Allow user to choose input interface alternate setting
Let's user control how much USB bus bandwidth will be reserved by
ueagle-atm device. This make possible to share bus with other devices
when ueagle-atm driver works in isochronous mode.
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 2cdabd3421e2..dee5f798946c 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -538,15 +538,16 @@ static const char *chip_name[] = {"ADI930", "Eagle I", "Eagle II", "Eagle III", | |||
538 | 538 | ||
539 | static int modem_index; | 539 | static int modem_index; |
540 | static unsigned int debug; | 540 | static unsigned int debug; |
541 | static int use_iso[NB_MODEM] = {[0 ... (NB_MODEM - 1)] = 1}; | 541 | static unsigned int altsetting[NB_MODEM] = {[0 ... (NB_MODEM - 1)] = FASTEST_ISO_INTF}; |
542 | static int sync_wait[NB_MODEM]; | 542 | static int sync_wait[NB_MODEM]; |
543 | static char *cmv_file[NB_MODEM]; | 543 | static char *cmv_file[NB_MODEM]; |
544 | static int annex[NB_MODEM]; | 544 | static int annex[NB_MODEM]; |
545 | 545 | ||
546 | module_param(debug, uint, 0644); | 546 | module_param(debug, uint, 0644); |
547 | MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)"); | 547 | MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)"); |
548 | module_param_array(use_iso, bool, NULL, 0644); | 548 | module_param_array(altsetting, uint, NULL, 0644); |
549 | MODULE_PARM_DESC(use_iso, "use isochronous usb pipe for incoming traffic"); | 549 | MODULE_PARM_DESC(altsetting, "alternate setting for incoming traffic: 0=bulk, " |
550 | "1=isoc slowest, ... , 8=isoc fastest (default)"); | ||
550 | module_param_array(sync_wait, bool, NULL, 0644); | 551 | module_param_array(sync_wait, bool, NULL, 0644); |
551 | MODULE_PARM_DESC(sync_wait, "wait the synchronisation before starting ATM"); | 552 | MODULE_PARM_DESC(sync_wait, "wait the synchronisation before starting ATM"); |
552 | module_param_array(cmv_file, charp, NULL, 0644); | 553 | module_param_array(cmv_file, charp, NULL, 0644); |
@@ -1254,7 +1255,7 @@ static void uea_set_bulk_timeout(struct uea_softc *sc, u32 dsrate) | |||
1254 | */ | 1255 | */ |
1255 | 1256 | ||
1256 | if (UEA_CHIP_VERSION(sc) == ADI930 || | 1257 | if (UEA_CHIP_VERSION(sc) == ADI930 || |
1257 | use_iso[sc->modem_index] > 0 || | 1258 | altsetting[sc->modem_index] > 0 || |
1258 | sc->stats.phy.dsrate == dsrate) | 1259 | sc->stats.phy.dsrate == dsrate) |
1259 | return; | 1260 | return; |
1260 | 1261 | ||
@@ -2459,6 +2460,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, | |||
2459 | struct usb_device *usb = interface_to_usbdev(intf); | 2460 | struct usb_device *usb = interface_to_usbdev(intf); |
2460 | struct uea_softc *sc; | 2461 | struct uea_softc *sc; |
2461 | int ret, ifnum = intf->altsetting->desc.bInterfaceNumber; | 2462 | int ret, ifnum = intf->altsetting->desc.bInterfaceNumber; |
2463 | unsigned int alt; | ||
2462 | 2464 | ||
2463 | uea_enters(usb); | 2465 | uea_enters(usb); |
2464 | 2466 | ||
@@ -2506,22 +2508,16 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, | |||
2506 | else | 2508 | else |
2507 | sc->annex = (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80)?ANNEXB:ANNEXA; | 2509 | sc->annex = (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80)?ANNEXB:ANNEXA; |
2508 | 2510 | ||
2511 | alt = altsetting[sc->modem_index]; | ||
2509 | /* ADI930 don't support iso */ | 2512 | /* ADI930 don't support iso */ |
2510 | if (UEA_CHIP_VERSION(id) != ADI930 && use_iso[sc->modem_index]) { | 2513 | if (UEA_CHIP_VERSION(id) != ADI930 && alt > 0) { |
2511 | int i; | 2514 | if (alt <= 8 && usb_set_interface(usb, UEA_DS_IFACE_NO, alt) == 0) { |
2512 | 2515 | uea_dbg(usb, "set alternate %u for 2 interface\n", alt); | |
2513 | /* try set fastest alternate for inbound traffic interface */ | ||
2514 | for (i = FASTEST_ISO_INTF; i > 0; i--) | ||
2515 | if (usb_set_interface(usb, UEA_DS_IFACE_NO, i) == 0) | ||
2516 | break; | ||
2517 | |||
2518 | if (i > 0) { | ||
2519 | uea_dbg(usb, "set alternate %d for 2 interface\n", i); | ||
2520 | uea_info(usb, "using iso mode\n"); | 2516 | uea_info(usb, "using iso mode\n"); |
2521 | usbatm->flags |= UDSL_USE_ISOC | UDSL_IGNORE_EILSEQ; | 2517 | usbatm->flags |= UDSL_USE_ISOC | UDSL_IGNORE_EILSEQ; |
2522 | } else { | 2518 | } else { |
2523 | uea_err(usb, "setting any alternate failed for " | 2519 | uea_err(usb, "setting alternate %u failed for " |
2524 | "2 interface, using bulk mode\n"); | 2520 | "2 interface, using bulk mode\n", alt); |
2525 | } | 2521 | } |
2526 | } | 2522 | } |
2527 | 2523 | ||