Module Name: src Committed By: christos Date: Fri Oct 1 20:56:11 UTC 2010
Modified Files: src/sys/dev/usb: umodem_common.c usb_quirks.c usb_quirks.h usbdevs usbdi_util.c Log Message: >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 To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/umodem_common.c cvs rdiff -u -r1.67 -r1.68 src/sys/dev/usb/usb_quirks.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/usb_quirks.h cvs rdiff -u -r1.562 -r1.563 src/sys/dev/usb/usbdevs cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/usbdi_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/umodem_common.c diff -u src/sys/dev/usb/umodem_common.c:1.19 src/sys/dev/usb/umodem_common.c:1.20 --- src/sys/dev/usb/umodem_common.c:1.19 Mon Sep 20 10:18:13 2010 +++ src/sys/dev/usb/umodem_common.c Fri Oct 1 16:56:10 2010 @@ -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); Index: src/sys/dev/usb/usb_quirks.c diff -u src/sys/dev/usb/usb_quirks.c:1.67 src/sys/dev/usb/usb_quirks.c:1.68 --- src/sys/dev/usb/usb_quirks.c:1.67 Sun Jun 27 06:41:26 2010 +++ src/sys/dev/usb/usb_quirks.c Fri Oct 1 16:56:10 2010 @@ -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 } } }; Index: src/sys/dev/usb/usb_quirks.h diff -u src/sys/dev/usb/usb_quirks.h:1.24 src/sys/dev/usb/usb_quirks.h:1.25 --- src/sys/dev/usb/usb_quirks.h:1.24 Sun Jun 27 06:41:26 2010 +++ src/sys/dev/usb/usb_quirks.h Fri Oct 1 16:56:10 2010 @@ -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; Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.562 src/sys/dev/usb/usbdevs:1.563 --- src/sys/dev/usb/usbdevs:1.562 Sat Sep 25 11:29:40 2010 +++ src/sys/dev/usb/usbdevs Fri Oct 1 16:56:10 2010 @@ -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 Index: src/sys/dev/usb/usbdi_util.c diff -u src/sys/dev/usb/usbdi_util.c:1.53 src/sys/dev/usb/usbdi_util.c:1.54 --- src/sys/dev/usb/usbdi_util.c:1.53 Thu Nov 12 03:28:31 2009 +++ src/sys/dev/usb/usbdi_util.c Fri Oct 1 16:56:10 2010 @@ -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 */