From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 19:57:36 2009 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 21DE5106566C; Sun, 1 Feb 2009 19:57:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D64978FC23; Sun, 1 Feb 2009 19:57:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11Juh7j094289; Sun, 1 Feb 2009 12:56:43 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 12:57:12 -0700 (MST) Message-Id: <20090201.125712.-1002120178.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090201191851.GE32503@citylink.fud.org.nz> References: <20090201190820.GB32503@citylink.fud.org.nz> <200902012014.32190.hselasky@c2i.net> <20090201191851.GE32503@citylink.fud.org.nz> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches 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: Sun, 01 Feb 2009 19:57:36 -0000 In message: <20090201191851.GE32503@citylink.fud.org.nz> Andrew Thompson writes: : > > xxx_set_channel() : > > { : > > ieee80211_channel c = wlan->curchan; : > > : > > hw_reg = array1[c]; : > > write USB register; : > > hw_reg = array2[c]; : > > write USB register; : > > } : > : > And don't forget "volatile" ... : : I dont understand this. c is a pointer to a valid net80211 channel which : will never disappear. "volatile" would be a bug here. There's no reason to use it at all, since wlan->curchan doesn't match what ANSI-C says a volatile is for. In addition, since it is only loaded once, there wouldn't be a need for it even if it did meet the definition. You *CANNOT* rely on 'volatile' fixing locking issues. Warner