Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Add a new quirk: ASSUME_CM_OVER_DATA.



details:   https://anonhg.NetBSD.org/src/rev/f7e171fedcd9
branches:  trunk
changeset: 498386:f7e171fedcd9
user:      explorer <explorer%NetBSD.org@localhost>
date:      Sun Oct 22 08:20:09 2000 +0000

description:
Add a new quirk:  ASSUME_CM_OVER_DATA.

Set this on the Metricom Ricochet GS USB modem.

This particular modem breaks if the USB command to enable the feature
CM_OVER_DATA.  Since it appears to wake up in that mode already,
just pretend it is already on, and don't try to set it.

Since this commit is happening over my Ricochet modem, I assume it works
now.

diffstat:

 sys/dev/usb/umodem.c     |  27 +++++++++++++++------------
 sys/dev/usb/usb_quirks.c |   6 ++++--
 sys/dev/usb/usb_quirks.h |   3 ++-
 3 files changed, 21 insertions(+), 15 deletions(-)

diffs (101 lines):

diff -r 81bf74262584 -r f7e171fedcd9 sys/dev/usb/umodem.c
--- a/sys/dev/usb/umodem.c      Sun Oct 22 05:05:39 2000 +0000
+++ b/sys/dev/usb/umodem.c      Sun Oct 22 08:20:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umodem.c,v 1.30 2000/09/03 19:15:45 augustss Exp $     */
+/*     $NetBSD: umodem.c,v 1.31 2000/10/22 08:20:09 explorer Exp $     */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -149,7 +149,7 @@
        USB_MATCH_START(umodem, uaa);
        usb_interface_descriptor_t *id;
        int cm, acm;
-       
+
        if (uaa->iface == NULL)
                return (UMATCH_NONE);
 
@@ -159,7 +159,7 @@
            id->bInterfaceSubClass != UISUBCLASS_ABSTRACT_CONTROL_MODEL ||
            id->bInterfaceProtocol != UIPROTO_CDC_AT)
                return (UMATCH_NONE);
-       
+
        umodem_get_caps(uaa->device, &cm, &acm);
        if (!(cm & USB_CDC_CM_DOES_CM) ||
            !(cm & USB_CDC_CM_OVER_DATA) ||
@@ -258,17 +258,20 @@
                goto bad;
        }
 
-       if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) {
-               err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
-                                             UCDC_DATA_MULTIPLEXED);
-               if (err) {
-                       printf("%s: could not set data multiplex mode\n",
-                              USBDEVNAME(sc->sc_dev));
-                       goto bad;
+       if (usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_ASSUME_CM_OVER_DATA) {
+               sc->sc_cm_over_data = 1;
+       } else {
+               if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) {
+                       err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
+                                                     UCDC_DATA_MULTIPLEXED);
+                       if (err) {
+                               printf("%s: could not set data multiplex mode\n",
+                                      USBDEVNAME(sc->sc_dev));
+                               goto bad;
+                       }
+                       sc->sc_cm_over_data = 1;
                }
-               sc->sc_cm_over_data = 1;
        }
-
        sc->sc_dtr = -1;
 
        uca.portno = UCOM_UNK_PORTNO;
diff -r 81bf74262584 -r f7e171fedcd9 sys/dev/usb/usb_quirks.c
--- a/sys/dev/usb/usb_quirks.c  Sun Oct 22 05:05:39 2000 +0000
+++ b/sys/dev/usb/usb_quirks.c  Sun Oct 22 08:20:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.c,v 1.28 2000/08/24 14:11:09 augustss Exp $ */
+/*     $NetBSD: usb_quirks.c,v 1.29 2000/10/22 08:20:10 explorer Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.13 1999/11/17 22:33:47 n_hibma Exp $ */
 
 /*
@@ -57,7 +57,7 @@
        struct usbd_quirks quirks;
 } usb_quirks[] = {
  { USB_VENDOR_KYE, USB_PRODUCT_KYE_NICHE,          0x100, { UQ_NO_SET_PROTO}},
- { USB_VENDOR_INSIDEOUT,USB_PRODUCT_INSIDEOUT_EDGEPORT4, 
+ { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, 
                                                    0x094, { UQ_SWAP_UNICODE}},
  { USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932,        0x100, { UQ_NO_STRINGS }},
  { USB_VENDOR_ADS, USB_PRODUCT_ADS_UBS10BT,        0x002, { UQ_NO_STRINGS }},
@@ -71,6 +71,8 @@
  { USB_VENDOR_ALCOR2, USB_PRODUCT_ALCOR2_KBD_HUB,   0x001, { UQ_SPUR_BUT_UP }},
  { USB_VENDOR_MCT, USB_PRODUCT_MCT_HUB0100,         0x102, { UQ_BUS_POWERED }},
  { USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232,          0x102, { UQ_BUS_POWERED }},
+ { USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS,
+       0x100, { UQ_ASSUME_CM_OVER_DATA }},
  { 0, 0, 0, { 0 } }
 };
 
diff -r 81bf74262584 -r f7e171fedcd9 sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h  Sun Oct 22 05:05:39 2000 +0000
+++ b/sys/dev/usb/usb_quirks.h  Sun Oct 22 08:20:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.h,v 1.13 2000/08/24 14:11:09 augustss Exp $ */
+/*     $NetBSD: usb_quirks.h,v 1.14 2000/10/22 08:20:10 explorer Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $  */
 
 /*
@@ -49,6 +49,7 @@
 #define UQ_BAD_AUDIO   0x0040  /* device claims audio class, but isn't */
 #define UQ_SPUR_BUT_UP 0x0080  /* spurious mouse button up events */
 #define UQ_NO_XU       0x0100  /* audio device has broken extension unit */
+#define UQ_ASSUME_CM_OVER_DATA 0x0200 /* modem device breaks on cm over data */
 };
 
 extern struct usbd_quirks usbd_no_quirk;



Home | Main Index | Thread Index | Old Index