From owner-freebsd-usb@FreeBSD.ORG Wed Aug 20 20:14:42 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890731065671; Wed, 20 Aug 2008 20:14:42 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2918FC1C; Wed, 20 Aug 2008 20:14:41 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=Z-K7CIdMrfcA:10 a=6MIg2jpqvhTpo/gR8GzG7Q==:17 a=ZmIiC_jQAAAA:8 a=8KjBBD_sWHmvH5y-Dw0A:9 a=WxFkC44wLPp91otqOY324vnvNeIA:4 a=50e4U0PicR4A:10 Received: from [62.113.133.243] (account mc467741@c2i.net [62.113.133.243] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1051403161; Wed, 20 Aug 2008 22:14:39 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 20 Aug 2008 22:16:18 +0200 User-Agent: KMail/1.9.7 References: <20080819194413.GB16977@elvis.mu.org> <20080820194807.GE33396@rink.nu> In-Reply-To: <20080820194807.GE33396@rink.nu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808202216.21060.hselasky@c2i.net> Cc: usb@freebsd.org Subject: Re: HEADSUP new usb code coming in. X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2008 20:14:42 -0000 Hi, On Wednesday 20 August 2008, Rink Springer wrote: > Hi Alfred, > > On Tue, Aug 19, 2008 at 12:44:13PM -0700, Alfred Perlstein wrote: > > http://mu.org/~bright/usb2/usb4bsd.diff.gz > > Whenever I try this patch, my build dies with: > > cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls > -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign > -fformat-extensions -nostdinc -I. -I../../.. -I../../../contrib/altq > -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > -finline-limit=8000 --param inline-unit-growth=100 --param > large-function-growth=1000 -mno-align-long-strings > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > -mno-sse3 -ffreestanding -fstack-protector -Werror > ../../../dev/usb2/core/usb2_generic.c > cc1: warnings being treated as errors > ../../../dev/usb2/core/usb2_generic.c: In function 'ugen_ioctl': > ../../../dev/usb2/core/usb2_generic.c:1409: warning: 'ep_index' may be > used uninitialized in this function > ../../../dev/usb2/core/usb2_generic.c:1409: note: 'ep_index' was > declared here > *** Error code 1 > > I'm using a small patch to get it to compile: > > - uint8_t ep_index; > + uint8_t ep_index = 0; > > However, I am unsure if this is correct. Your patch is Ok. "ep_index" is not used uninitialized. Try adding the patch in "ugen_fs_get_complete()" instead: 1002 static uint8_t 1003 ugen_fs_get_complete(struct usb2_fifo *f, uint8_t *pindex) 1004 { 1005 struct usb2_mbuf *m; 1006 1007 USB_IF_DEQUEUE(&f->used_q, m); 1008 1009 if (m) { 1010 *pindex = *((uint8_t *)(m->cur_data_ptr)); 1011 1012 USB_IF_ENQUEUE(&f->free_q, m); 1013 1014 return (0); /* success */ 1015 } else { 1016 f->flag_iscomplete = 0; --here-- >> *pindex = 0; /* fix compiler warning */ 1017 } 1018 return (1); /* failure */ 1019 } > > Futhermore, 'device usb2_bluetooth' gives a lot of compile errors. Am I > using the right patch here? usb2_bluetooth depends on Netgraph which needs some extra options in the kernel config. You maybe want to build the module instead. --HPS