From owner-freebsd-wireless@freebsd.org Tue Sep 8 23:50:54 2015 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F36C9CD0D2 for ; Tue, 8 Sep 2015 23:50:54 +0000 (UTC) (envelope-from vidwer@gmail.com) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E24201C3D for ; Tue, 8 Sep 2015 23:50:53 +0000 (UTC) (envelope-from vidwer@gmail.com) Received: by qgev79 with SMTP id v79so97118437qge.0 for ; Tue, 08 Sep 2015 16:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=glhOQa2hxobZLsBnuFB1ocCSmcCCgiP1AqT50PjxUWk=; b=bbugAK+LbiRFmnWYdVfp2bZyHHKwPvthGkvBE4qDuTRVIPP60KZJHEZ1VUAGqnL1e5 w9+VnjRe7HChAunhcIg/aIQTxL7QQX0732jZgTGrGHPTIFLw9k49s226tHUUUVJ5VujC pxyebZV5SdADJLppv42uq7YwBooZClFY8+yJezfHmCiiEvMZMFR7WCwKOJbo4BViMu+5 0ToLSiIJ1H+8dtL/xK8NYjKcaeQcqmRbMGm7rQwtCA0gHLQZLSqFMnISbDbotHqAgx2Q 3CIitNwGHtoJizqPWJp03KVen/M0xP7zktOY6fo1PyyVMS6HfBdxkaGpwVtkzkdqIypO 5E5g== MIME-Version: 1.0 X-Received: by 10.140.134.21 with SMTP id 21mr42828805qhg.51.1441756252936; Tue, 08 Sep 2015 16:50:52 -0700 (PDT) Received: by 10.55.214.2 with HTTP; Tue, 8 Sep 2015 16:50:52 -0700 (PDT) In-Reply-To: References: Date: Wed, 9 Sep 2015 01:50:52 +0200 Message-ID: Subject: Re: RFC: remove NDIS code from rsu From: Idwer Vollering To: "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.20 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, 08 Sep 2015 23:50:54 -0000 2015-09-09 1:36 GMT+02:00 Adrian Chadd : > hi, > > nope - we can't assume the IEEE80211_M_* bits at all line up with what > the firmware requires. > You also changed the endian-ness of things - it may now not work on > non-intel platforms. Does it? Other drivers don't use htole*(): # grep htole * | grep -c IEEE80211 0 Then again, this chipset could be odd enough to indeed require byte order conversion. > > Did this /fix/ things for you? No, which wasn't expected either. > > > > -adrian > > > On 8 September 2015 at 16:24, Idwer Vollering wrote: >> The driver is able to bring up a connection on linux and openbsd just fine. >> >> I would start with this, then fix the structs. This could use another >> pair of eyes. >> >> Partial draft (yes, it builds): >> >> Index: sys/dev/usb/wlan/if_rsu.c >> =================================================================== >> --- sys/dev/usb/wlan/if_rsu.c (revision 287538) >> +++ sys/dev/usb/wlan/if_rsu.c (working copy) >> @@ -1066,11 +1066,11 @@ >> if (ic->ic_curmode == IEEE80211_MODE_11B) >> bss->networktype = htole32(NDIS802_11DS); >> else >> - bss->networktype = htole32(NDIS802_11OFDM24); >> + bss->networktype = IEEE80211_MODE_11G; >> bss->config.len = htole32(sizeof(bss->config)); >> bss->config.bintval = htole32(ni->ni_intval); >> bss->config.dsconfig = htole32(ieee80211_chan2ieee(ic, ni->ni_chan)); >> - bss->inframode = htole32(NDIS802_11INFRASTRUCTURE); >> + bss->inframode = IEEE80211_M_STA; >> memcpy(bss->supprates, ni->ni_rates.rs_rates, >> ni->ni_rates.rs_nrates); >> /* Write the fixed fields of the beacon frame. */ >> Index: sys/dev/usb/wlan/if_rsureg.h >> =================================================================== >> --- sys/dev/usb/wlan/if_rsureg.h (revision 287538) >> +++ sys/dev/usb/wlan/if_rsureg.h (working copy) >> @@ -414,19 +414,11 @@ >> uint32_t privacy; >> int32_t rssi; >> uint32_t networktype; >> -#define NDIS802_11FH 0 >> #define NDIS802_11DS 1 >> -#define NDIS802_11OFDM5 2 >> -#define NDIS802_11OFDM24 3 >> -#define NDIS802_11AUTOMODE 4 >> >> struct ndis_802_11_configuration config; >> uint32_t inframode; >> -#define NDIS802_11IBSS 0 >> -#define NDIS802_11INFRASTRUCTURE 1 >> #define NDIS802_11AUTOUNKNOWN 2 >> -#define NDIS802_11MONITOR 3 >> -#define NDIS802_11APMODE 4 >> >> uint8_t supprates[16]; >> uint32_t ieslen; >> _______________________________________________ >> freebsd-wireless@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-wireless >> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org"