From owner-freebsd-current@FreeBSD.ORG Thu Jul 3 15:07:03 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A731065691; Thu, 3 Jul 2008 15:07:03 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout5.freenet.de (mout5.freenet.de [IPv6:2001:748:100:40::2:7]) by mx1.freebsd.org (Postfix) with ESMTP id 6E71C8FC25; Thu, 3 Jul 2008 15:07:03 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.25] (helo=15.mx.freenet.de) by mout5.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #19) id 1KEQOj-0003WA-L2; Thu, 03 Jul 2008 17:07:01 +0200 Received: from ma633.m.pppool.de ([89.49.166.51]:57025 helo=peedub.jennejohn.org) by 15.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #12) id 1KEQOj-0003ED-DO; Thu, 03 Jul 2008 17:07:01 +0200 Date: Thu, 3 Jul 2008 17:07:00 +0200 From: Gary Jennejohn To: Luigi Rizzo Message-ID: <20080703170700.3b91b8c6@peedub.jennejohn.org> In-Reply-To: <20080703140719.GA72315@onelab2.iet.unipi.it> References: <20080703140719.GA72315@onelab2.iet.unipi.it> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.10.14; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org, current@freebsd.org Subject: Re: may I commit this small umodem patch ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2008 15:07:04 -0000 On Thu, 3 Jul 2008 16:07:19 +0200 Luigi Rizzo wrote: > There was a discussion back in september about adding > support for basic CDC tty devices in umodem.c. > This lets you talk to a number of usb devices built around > microcontrollers (e.g. Atmel), and puts us on par with > Linux and Windows in terms of supporting these devices. > > Because this simply requires the small patch below to the > probe/attach routine, so if there are no objections I plan to add > this to the system (CURRENT then RELENG_7 and RELENG_6) in the next > few days. > > > Index: umodem.c > > =================================================================== > > RCS file: /home/ncvs/src/sys/dev/usb/umodem.c,v > > retrieving revision 1.57 > > diff -u -r1.57 umodem.c > > --- umodem.c 31 Jan 2005 13:58:10 -0000 1.57 > > +++ umodem.c 20 Aug 2006 17:05:34 -0000 > > @@ -256,6 +260,15 @@ > > id->bInterfaceProtocol == UIPROTO_CDC_AT) > > ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; > > > > +#if 1 > > + if (ret == UMATCH_NONE && > > + id->bInterfaceClass == UICLASS_CDC_DATA && > > + id->bInterfaceSubClass == UISUBCLASS_DATA && > > + id->bInterfaceProtocol == 0x00) > > + ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; > > + return ret; > > +#endif > > + > > if (ret == UMATCH_NONE) > > return (ret); > Is there any reason to keep the #if 1 ... #endif? And why not just directly return UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO rather than assigning it to ret first? --- Gary Jennejohn (gj@freebsd.org)