Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb From Anon Ymous:



details:   https://anonhg.NetBSD.org/src/rev/91b37c44fd9e
branches:  trunk
changeset: 757880:91b37c44fd9e
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 01 20:56:10 2010 +0000

description:
>From Anon Ymous:

Add support for the Zoom 3095 USB Fax Modem.  There are some problems
with this modem:

1) The CS descriptors were placed after all other descriptors rather
than in the Control Interface.  This is true in both configurations
and is the issue this patch deals with.

2) Modem audio is not done on the modem.  There is a second
configuration with an extra interface (3 interfaces) which presumably
is for handling audio.  This patch does not support that.

3) The interrupts are raised a bit slowly.  This means that pppd(8)
needs to wait a bit before trying to read from the link (i.e., just
before the get_input() loop in src/dist/pppd/pppd/main.c line 547).
If you don't wait, then DCD will not be detected high before that
first read and get_input() will drop the line.  This is not a problem
if you use the "local" option to pppd(8) and ignore DCD, but that is
less than desirable.

4) You apparently have to toggle "RSDL (DCD) option"[1] when you
initialize the modem or you will never see a second DCD high interrupt
when redialing after a disconnect.  Without this the pppd(8) "persist"
mode will not work.  Presumably, some extra initialization is missing
from the driver for this chipset.

[1] Send the AT commands: AT&C0 followed by AT&C1 - doing it in one
command doesn't work.  The AT commands for this modem are at:
http://www.zoom.com/documentation/dial_up/3095F_ATcommands.pdf

diffstat:

 sys/dev/usb/umodem_common.c |  11 ++++++++---
 sys/dev/usb/usb_quirks.c    |   6 ++++--
 sys/dev/usb/usb_quirks.h    |   3 ++-
 sys/dev/usb/usbdevs         |   3 ++-
 sys/dev/usb/usbdi_util.c    |   7 +++++--
 5 files changed, 21 insertions(+), 9 deletions(-)

diffs (128 lines):

diff -r f4c37a80b6fc -r 91b37c44fd9e sys/dev/usb/umodem_common.c
--- a/sys/dev/usb/umodem_common.c       Fri Oct 01 20:12:20 2010 +0000
+++ b/sys/dev/usb/umodem_common.c       Fri Oct 01 20:56:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umodem_common.c,v 1.19 2010/09/20 14:18:13 christos Exp $      */
+/*     $NetBSD: umodem_common.c,v 1.20 2010/10/01 20:56:10 christos Exp $      */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.19 2010/09/20 14:18:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.20 2010/10/01 20:56:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -370,14 +370,19 @@
        const usb_cdc_cm_descriptor_t *cmd;
        const usb_cdc_acm_descriptor_t *cad;
        const usb_cdc_union_descriptor_t *cud;
+       u_int32_t uq_flags;
 
        *cm = *acm = 0;
+       uq_flags = usbd_get_quirks(dev)->uq_flags;
 
-       if (usbd_get_quirks(dev)->uq_flags & UQ_NO_UNION_NRM) {
+       if (uq_flags & UQ_NO_UNION_NRM) {
                DPRINTF(("umodem_get_caps: NO_UNION_NRM quirk - returning 0\n"));
                return 0;
        }
 
+       if (uq_flags & UQ_LOST_CS_DESC)
+               id = NULL;
+
        cmd = (const usb_cdc_cm_descriptor_t *)usb_find_desc_if(dev,
                                                          UDESC_CS_INTERFACE,
                                                          UDESCSUB_CDC_CM, id);
diff -r f4c37a80b6fc -r 91b37c44fd9e sys/dev/usb/usb_quirks.c
--- a/sys/dev/usb/usb_quirks.c  Fri Oct 01 20:12:20 2010 +0000
+++ b/sys/dev/usb/usb_quirks.c  Fri Oct 01 20:56:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.c,v 1.67 2010/06/27 10:41:26 kardel Exp $   */
+/*     $NetBSD: usb_quirks.c,v 1.68 2010/10/01 20:56:10 christos Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.30 2003/01/02 04:15:55 imp Exp $     */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.67 2010/06/27 10:41:26 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.68 2010/10/01 20:56:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -135,6 +135,8 @@
        ANY, { UQ_ASSUME_CM_OVER_DATA }},
  { USB_VENDOR_HYUNDAI, USB_PRODUCT_HYUNDAI_UM175,
        ANY, { UQ_ASSUME_CM_OVER_DATA }},
+ { USB_VENDOR_ZOOM, USB_PRODUCT_ZOOM_3095,
+       ANY, { UQ_LOST_CS_DESC }},
  { 0, 0, 0, { 0 } }
 };
 
diff -r f4c37a80b6fc -r 91b37c44fd9e sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h  Fri Oct 01 20:12:20 2010 +0000
+++ b/sys/dev/usb/usb_quirks.h  Fri Oct 01 20:56:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.h,v 1.24 2010/06/27 10:41:26 kardel Exp $   */
+/*     $NetBSD: usb_quirks.h,v 1.25 2010/10/01 20:56:10 christos Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $  */
 
 /*
@@ -47,6 +47,7 @@
 #define UQ_BROKEN_BIDIR        0x2000  /* printer has broken bidir mode */
 #define UQ_HID_IGNORE  0x4000  /* device should be ignored by hid class */
 #define UQ_NO_UNION_NRM 0x8000  /* has no normal UNION descriptor */
+#define UQ_LOST_CS_DESC 0x10000 /* look everywhere for the CS descriptors */
 };
 
 extern const struct usbd_quirks usbd_no_quirk;
diff -r f4c37a80b6fc -r 91b37c44fd9e sys/dev/usb/usbdevs
--- a/sys/dev/usb/usbdevs       Fri Oct 01 20:12:20 2010 +0000
+++ b/sys/dev/usb/usbdevs       Fri Oct 01 20:56:10 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.562 2010/09/25 15:29:40 tsutsui Exp $
+$NetBSD: usbdevs,v 1.563 2010/10/01 20:56:10 christos Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2558,6 +2558,7 @@
 
 /* Zoom Telephonics, Inc. products */
 product ZOOM 2986L             0x9700  2986L Fax modem
+product ZOOM 3095              0x3095  3095 USB Fax modem
 
 /* Zydas Technology Corporation products */
 product ZYDAS ZD1211           0x1211  ZD1211 WLAN abg
diff -r f4c37a80b6fc -r 91b37c44fd9e sys/dev/usb/usbdi_util.c
--- a/sys/dev/usb/usbdi_util.c  Fri Oct 01 20:12:20 2010 +0000
+++ b/sys/dev/usb/usbdi_util.c  Fri Oct 01 20:56:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi_util.c,v 1.53 2009/11/12 08:28:31 uebayasi Exp $ */
+/*     $NetBSD: usbdi_util.c,v 1.54 2010/10/01 20:56:10 christos Exp $ */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.53 2009/11/12 08:28:31 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.54 2010/10/01 20:56:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -539,6 +539,9 @@
        usbd_desc_iter_t iter;
        const usb_cdc_descriptor_t *desc;
 
+       if (id == NULL)
+               return usb_find_desc(dev, type, subtype);
+
        usb_desc_iter_init(dev, &iter);
 
        iter.cur = (void *)id;          /* start from the interface desc */



Home | Main Index | Thread Index | Old Index