From owner-freebsd-current@FreeBSD.ORG Tue Mar 6 19:05:07 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548C3106566C for ; Tue, 6 Mar 2012 19:05:07 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id BD60E8FC12 for ; Tue, 6 Mar 2012 19:05:06 +0000 (UTC) Received: by wibhn6 with SMTP id hn6so3781205wib.13 for ; Tue, 06 Mar 2012 11:05:05 -0800 (PST) Received-SPF: pass (google.com: domain of bschmidt@techwires.net designates 10.216.135.141 as permitted sender) client-ip=10.216.135.141; Authentication-Results: mr.google.com; spf=pass (google.com: domain of bschmidt@techwires.net designates 10.216.135.141 as permitted sender) smtp.mail=bschmidt@techwires.net Received: from mr.google.com ([10.216.135.141]) by 10.216.135.141 with SMTP id u13mr6746784wei.79.1331060705773 (num_hops = 1); Tue, 06 Mar 2012 11:05:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=fA+jnk3dGVPHulyIvYOTwjlb6rdfzRZIoQ4b/vo0itc=; b=RSs86iI1HuBwi+mBq1qtxYlX1QZg8INxjK54SpfzuU6fTeQrCnHiMAHuv6K5JfmFAM 5sEEO7TBYehZr73h4d/1yM9TvD18whiRI+1Ti4E8lzY+q4lplNd9aa9TBJOccEuwGUbw 4VSsmEl00BtPaOfjsCv0tFhhFg9yFzZfFG18VQZYdQkAkSvZpKHFbFa0VIvwWC1Qxt36 7aIUgGR8Wi7mrErol7h+TR+givq1iYluvXHPBbyiuv/aCK1Pmp/hNltUYXn82BljWdMz RVaD/iNEPiwuRGYwr0N8aT3DX5HQGRv1UbqsdUlGsfJ8ElO6YSjAOLWZLbgtgz/NqmXi s8Gw== Received: by 10.216.135.141 with SMTP id u13mr5428843wei.79.1331060705661; Tue, 06 Mar 2012 11:05:05 -0800 (PST) Received: from amy.lab.techwires.net (dslb-088-065-215-057.pools.arcor-ip.net. [88.65.215.57]) by mx.google.com with ESMTPS id df3sm30222699wib.1.2012.03.06.11.05.01 (version=SSLv3 cipher=OTHER); Tue, 06 Mar 2012 11:05:05 -0800 (PST) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Mitsuru IWASAKI Date: Tue, 6 Mar 2012 20:05:15 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <20120306.024212.108736612.iwasaki@jp.FreeBSD.org> <201203052314.22050.bschmidt@freebsd.org> <20120307.023046.27956263.iwasaki@jp.FreeBSD.org> In-Reply-To: <20120307.023046.27956263.iwasaki@jp.FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203062005.15276.bschmidt@freebsd.org> X-Gm-Message-State: ALoCoQkgzVjX6lKb5+IyhY0mW522hoTX+XC6XqCdxoE32Z2Woo3mETFKoMLkMy5tpUbS8joIKiUt Cc: adrian@freebsd.org, freebsd-current@freebsd.org, freebsd-wireless@freebsd.org Subject: Re: patches for if_iwi and wlan for WEP mode X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 19:05:07 -0000 On Tuesday 06 March 2012 18:30:46 Mitsuru IWASAKI wrote: > Thanks Bernhard and Adrian, I think the problem seems to be solved. > > > > My patches set IEEE80211_NODE_ASSOCID bit only if ni->ni_associd > > > is set. Any suggestions on this part are welcome. > > > > Are you sure the net80211 part is correct? It looks to me as if you > > are just masking the real issue. The IEEE80211_NODE_ASSOCID flag is > > ment to be used to verify that an associd has actually been set, not > > doing so will break other things I guess. iwi(4) is a bit tricky in > > that regard, as it sets the associd itself, check iwi_checkforqos(). > > I'd verify that function is actually called and if so if the parameters > > are correct. I fumbled around there once, might have wrong WEP.. > > As you suggested, iwi_checkforqos() has problems, wrong asresp > frame parsing. > > ---- > @@ -1357,8 +1365,8 @@ > frm += 2; > > wme = NULL; > - while (frm < efrm) { > - IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], return); > + while (efrm - frm > 1) { > + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); > switch (*frm) { > case IEEE80211_ELEMID_VENDOR: > if (iswmeoui(frm)) > ---- > > Bacause of the condition `while (frm < efrm)', > IEEE80211_VERIFY_LENGTH() was checking item length beyond the > ieee80211_frame region, and returned from iwi_checkforqos() without > setting flags, capinfo and associd! > I made above changes referring to net80211 code such as > ieee80211_sta.c. > > Today's version of patches at: > http://people.freebsd.org/~iwasaki/iwi/iwi-20120306.diff > > This one don't have changes on net80211 part at all. Looks good to me, please get that into the tree. > > What's the reason behing adding if_qflush()/if_transmit()? > > In RELENG_7, data frame is transmitted by iwi_tx_start() like this. > > ether_output > ether_output_frame > IFQ_HANDOFF/IFQ_HANDOFF_ADJ > if_start > iwi_start > iwi_tx_start > > After 8.0-RELEASE, device specific if_transmit() is called via net80211 layer. > > ether_output > ether_output_frame > if_transmit > IFQ_HANDOFF/IFQ_HANDOFF_ADJ > if_start > ieee80211_start > parent->if_transmit(ie. iwi_transmit()) > > There was not if_transmit method in iwi(4), so I add it. > On if_qflush(), CURRENT kernel complains that `transmit and qflush > must both either be set or both be NULL' from if.c. > I wrote iwi_qflush(), but actually never tested it... Hmm, it still is the case for >= 8 afaik, there is a default if_transmit() which is used for all wireless drivers which seems to work pretty well. That's why I'm wondering, iwi(4) would be the first driver to have it's own if_transmit() function. I'm not aware of any technical reason for adding one, or did I miss something? If not I'd rather not have one added, for sake of consistency. > From: Adrian Chadd > > Would you please open a PR with this particular issue and then attach > > the patch to it? > > I prefer committing changes on iwi(4) by myself, because grimreaper@ > keep giving pressure to me `Your src commit bit is still idle.' for > long time :) > I just want to stop it. ;) -- Bernhard