Return-path: Received: from s3.sipsolutions.net ([5.9.151.49]:58686 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbbJETM7 (ORCPT ); Mon, 5 Oct 2015 15:12:59 -0400 Message-ID: <1444072372.1962.1.camel@sipsolutions.net> (sfid-20151005_211301_815527_9D5056D9) Subject: Re: [PATCH 1/1] New driver: rtl8xxxu (mac80211) From: Johannes Berg To: Jes Sorensen Cc: Sujith Manoharan , linux-wireless@vger.kernel.org, kvalo@codeaurora.org, Larry.Finger@lwfinger.net Date: Mon, 05 Oct 2015 21:12:52 +0200 In-Reply-To: References: <1440883083-32498-1-git-send-email-Jes.Sorensen@redhat.com> <1440883083-32498-2-git-send-email-Jes.Sorensen@redhat.com> <1441032517.13980.21.camel@sipsolutions.net> <1441120044.2441.9.camel@sipsolutions.net> <1441275474.2565.18.camel@sipsolutions.net> <21994.26976.882903.355191@gargle.gargle.HOWL> <1442508413.2821.11.camel@sipsolutions.net> <1444071403.21467.0.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, 2015-10-05 at 15:04 -0400, Jes Sorensen wrote: > > I have this in the code - that said, I may not be getting a pointer > back ever? > > if (changed & BSS_CHANGED_ERP_PREAMBLE) { > ... > sta = ieee80211_find_sta(vif, bss_conf->bssid); > if (sta) { > sta_priv = (struct rtl8xxxu_sta_priv *)sta > ->drv_priv; > if (bss_conf->use_short_preamble) > sta_priv->short_preamble = true; > else > sta_priv->short_preamble = false; > Ah, ok. You'd of course get a pointer back here - but it's pointless. You might as well store the value in some private vif data, or perhaps just use vif->bss_conf.use_short_preamble in the place that you're now using sta_priv->short_preamble - the point was that a per-station setting of short-preamble doesn't make sense, it needs to be per-vif. johannes