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: Sat, 25 Jun 2016 12:02:32 +0900 (JST)

 Hi,
 
 I have renewed my patch for latest current.
 Could anyone review this?
 I think that it has no side effect.
 
 Index: umodem.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/umodem.c,v
 retrieving revision 1.68
 diff -u -r1.68 umodem.c
 --- umodem.c	23 Apr 2016 10:15:32 -0000	1.68
 +++ umodem.c	23 Jun 2016 20:24:09 -0000
 @@ -81,6 +81,12 @@
  	.ucom_write = 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 *uiaa = aux;
  	usb_interface_descriptor_t *id;
  	int cm, acm;
 +	id = usbd_get_interface_descriptor(uiaa->uiaa_iface);
 +
 +	if (umodem_lookup(uiaa->uiaa_vendor, uiaa->uiaa_product) &&
 +	    id->bInterfaceNumber == 1)
 +		return (UMATCH_VENDOR_PRODUCT);
  
  	if (uiaa->uiaa_class != UICLASS_CDC ||
  	    uiaa->uiaa_subclass != UISUBCLASS_ABSTRACT_CONTROL_MODEL ||
  	    !(uiaa->uiaa_proto == UIPROTO_CDC_NOCLASS || uiaa->uiaa_proto == UIPROTO_CDC_AT))
  		return UMATCH_NONE;
  
 -	id = usbd_get_interface_descriptor(uiaa->uiaa_iface);
  	if (umodem_get_caps(uiaa->uiaa_device, &cm, &acm, id) == -1)
  		return UMATCH_NONE;
  
 


Home | Main Index | Thread Index | Old Index