NetBSD-Bugs archive

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

Re: kern/48715: Please support more USB modems



The following reply was made to PR kern/48715; it has been noted by GNATS.

From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/48715: Please support more USB modems
Date: Thu, 09 Jul 2015 22:02:50 +0900 (JST)

 Hi,
 
 My previous patch is incorrect.
 It has side effect to cdce(4).
 
 This should have no side effect.
 
 Index: umodem.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/umodem.c,v
 retrieving revision 1.67
 diff -u -r1.67 umodem.c
 --- umodem.c	5 Jul 2015 15:51:55 -0000	1.67
 +++ umodem.c	9 Jul 2015 13:00:36 -0000
 @@ -81,6 +81,12 @@
  	NULL,
  };
  
 +static const struct usb_devno umodem_devs[] = {
 +	/* Conexant USB Modem */
 +	{ USB_VENDOR_CONEXANT, USB_PRODUCT_CONEXANT_MODEM_1 },
 +};
 +#define	umodem_lookup(v, p) usb_lookup(umodem_devs, v, p)
 +
  int             umodem_match(device_t, cfdata_t, void *);
  void            umodem_attach(device_t, device_t, void *);
  int             umodem_detach(device_t, int);
 @@ -97,13 +103,17 @@
  	struct usbif_attach_arg *uaa = aux;
  	usb_interface_descriptor_t *id;
  	int cm, acm;
 +	id = usbd_get_interface_descriptor(uaa->iface);
 +
 +	if (umodem_lookup(uaa->vendor, uaa->product) &&
 +	    id->bInterfaceNumber == 1)
 +		return (UMATCH_VENDOR_PRODUCT);
  
  	if (uaa->class != UICLASS_CDC ||
  	    uaa->subclass != UISUBCLASS_ABSTRACT_CONTROL_MODEL ||
  	    !(uaa->proto == UIPROTO_CDC_NOCLASS || uaa->proto == UIPROTO_CDC_AT))
  		return (UMATCH_NONE);
  
 -	id = usbd_get_interface_descriptor(uaa->iface);
  	if (umodem_get_caps(uaa->device, &cm, &acm, id) == -1)
  		return (UMATCH_NONE);
  
 
 --
 Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 


Home | Main Index | Thread Index | Old Index