From owner-freebsd-wireless@FreeBSD.ORG Tue Jun 7 01:50:19 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1945D106564A; Tue, 7 Jun 2011 01:50:19 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id D459B8FC14; Tue, 7 Jun 2011 01:50:18 +0000 (UTC) Received: by pxi6 with SMTP id 6so2936603pxi.17 for ; Mon, 06 Jun 2011 18:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=FpCNjhzZMJWuwGjpb7DeU1f9ACohrclocSc2lqJiIyI=; b=N+QoE11TT1owk83JYKuOOS7oZkeXFk4tx2eKDmRAfZqGd0KBt2GkHkCqKU9FWOf6Hb a8pi9eCLDo/uOQnhFC+mGmUAj3VoOdiArEg8DwZA4s2xK3PcFdrlYTK/xw6OFodWcVyE lOOERXV5DqmU+WPN1OJbRyrjB/WcY6LTHo00o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=H/iXbjS2kDCaiVkvFHiF039CB/A1ry7M9rNIPhwNGImWW8I1iXtwIHAHp7zs6v+kpE xp5n1uyGjGF9p6mymACXfvNqCBUK94oJEZwlYqKKHjbXgAlNdi8FxVdFM2pBcpTce4dy mvRMn+86Ep9iQE75rI524fbwBdZFuX6QcQ5do= Received: by 10.68.36.69 with SMTP id o5mr27085pbj.74.1307411418317; Mon, 06 Jun 2011 18:50:18 -0700 (PDT) Received: from sidhe.local ([75.111.37.204]) by mx.google.com with ESMTPS id x1sm4090833pbb.34.2011.06.06.18.50.16 (version=SSLv3 cipher=OTHER); Mon, 06 Jun 2011 18:50:17 -0700 (PDT) Message-ID: <4DED83D6.3020805@gmail.com> Date: Mon, 06 Jun 2011 18:50:14 -0700 From: Matt User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110502 Thunderbird/3.1.10 MIME-Version: 1.0 To: Adrian Chadd References: <4DD365A2.3090106@gmail.com> <20110518100203.7bfa63be@gmail.com> <4DEC0234.8030300@gmail.com> <20110606022257.39093142.ray@ddteam.net> <4DED769A.6040405@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-wireless@freebsd.org Subject: Re: Ralink RT3090/RT2860 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2011 01:50:19 -0000 On 06/06/11 18:26, Adrian Chadd wrote: > On 7 June 2011 08:53, Matt wrote: > >> Well, in anycase here is the patch I made for Ral. If no one wants to work >> on trying to port OpenBSD ral, I can try, but I am still learning very much! >> >> http://pastebin.com/GeAGVjtR > That's great work! > >> Please add manually rt2860.c to Makefile @ /usr/src/sys/modules/ral/Makefile >> >> Note about patch, it's still alpha quality in that it has a known bug (do >> not kldunload while interface is running!) and it is largely untested. >> Changes include softc, pci code& all functions put in monolithic file (to >> help compare against OpenBSD ral, mainly). They are in the wrong order for >> now, however. Ultimate plan was to compare side-by-side with OpenBSD ral to >> assist porting. >> >> There is still an "ecosystem" of includes per rt2860 original, didn't get >> around to combining them. > Well, I'm all for throwing this in if Matt's up for helping debug and > look after it in the meantime. > > I gather the long-term goal is to update to the OpenBSD driver but > this seems like a good middle-step, no? > > > Adrian > I didn't touch much in the actual "talks to hardware" part. I did however end up needing to change quite a bit in softc and steal parts of OpenBSD & Alexander's attach. Probably Alexander's copyright line from rt2860.c needs to be copied to if_ral_pci.c due to inclusion of vendor id detection and softc/opns assignment. Is there any value in condensing the includes to match the other devices? I can do this and touch up copyrights (there is some code from rt2860_pci.c that made it into if_ral_pci.c). If anyone with good eyes can look and make sure mutexes and memory are handled as sanely as possible, I'd appreciate it. I will make a new patch with some sanity changes, the LNA gain fix (there should only be one LNA per antenna needed, I think?) & some other hardware specific cases, as well as any fixes anyone notices in the next few days. Glad I can contribute to a very great operating system. I promise to read kernel normal style! Thanks Matt ("In The Hat", for disambiguation :)