From: Johannes Berg Date: Thu, 23 Sep 2010 10:33:51 +0200 Subject: [ath9k-devel] ath9k, multiple stations, and AMPDUs In-Reply-To: <4C9ADE7E.5070406@candelatech.com> References: <4C9841BA.4080700@candelatech.com> <4C98848C.70005@openwrt.org> <4C98A022.7020106@candelatech.com> <4C98A2C4.8060108@openwrt.org> <4C98EAA1.7050908@candelatech.com> <4C98F2D8.8020602@openwrt.org> <1285097307.12764.11.camel@jlt3.sipsolutions.net> <4C990859.70709@openwrt.org> <4C99135A.3090103@candelatech.com> <4C99348F.2090504@openwrt.org> <4C99870C.20006@candelatech.com> <4C99BEFC.2060209@openwrt.org> <4C9ADE7E.5070406@candelatech.com> Message-ID: <1285230831.3691.5.camel@jlt3.sipsolutions.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Wed, 2010-09-22 at 21:58 -0700, Ben Greear wrote: > + * @addr2: local address (vif->sdata->dev->dev_addr). Can be NULL for 'any'. > * > * This function must be called under RCU lock and the > * resulting pointer is only valid under RCU lock as well. > @@ -2434,7 +2435,8 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, > * DO NOT USE THIS FUNCTION. > */ > struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, > - const u8 *addr); > + const u8 *addr, > + const u8 *localaddr); That's not going to generate proper documentation. Also, it now probably shouldn't be called "by_hw" any more. > - /* Just return a random station ... first in list ... */ > + /* Just return a random station if localaddr is NULL > + * ... first in list. > + */ Please use the comment style like this: /* * Just return a random station ... */ I know davem personally doesn't like it, but it's the regular style in this code. > for_each_sta_info(hw_to_local(hw), addr, sta, nxt) { > + if (localaddr && > + memcmp(sta->sdata->dev->dev_addr, localaddr, ETH_ALEN) != 0) > + continue; This should use compare_ether_addr() (if it's not aligned on a two-byte boundary something is seriously wrong), and also sta->sdata->vif.addr instead of dev->dev_addr. johannes