Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:40075 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758618Ab1D0Lx5 (ORCPT ); Wed, 27 Apr 2011 07:53:57 -0400 Subject: Re: [PATCH 1/2] mac80211: Adding HW flag IEEE80211_HW_CRYPTO_ENABLED From: Johannes Berg To: Yogesh Ashok Powar Cc: "John W. Linville" , linux-wireless , Lennert Buytenhek In-Reply-To: <20110427114010.GA18939@hertz.marvell.com> References: <20110415084005.GC11576@hertz.marvell.com> <1302857554.3572.14.camel@jlt3.sipsolutions.net> <20110415105140.GD11576@hertz.marvell.com> <1302865304.3572.15.camel@jlt3.sipsolutions.net> <20110421121513.GC27527@hertz.marvell.com> <1303389236.3597.8.camel@jlt3.sipsolutions.net> <20110421124624.GA29211@hertz.marvell.com> <1303390788.3597.10.camel@jlt3.sipsolutions.net> <20110427110303.GA18370@hertz.marvell.com> <1303903676.3542.2.camel@jlt3.sipsolutions.net> <20110427114010.GA18939@hertz.marvell.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 27 Apr 2011 13:53:51 +0200 Message-ID: <1303905231.3542.3.camel@jlt3.sipsolutions.net> (sfid-20110427_135400_143898_396113F6) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 2011-04-27 at 17:10 +0530, Yogesh Ashok Powar wrote: > On Wed, Apr 27, 2011 at 04:27:56AM -0700, Johannes Berg wrote: > > On Wed, 2011-04-27 at 16:33 +0530, Yogesh Ashok Powar wrote: > > > On Thu, Apr 21, 2011 at 05:59:48AM -0700, Johannes Berg wrote: > > > > Well, it kinda goes like this: > > > > > > > > key added -> need tailroom code > > > > key put into HW -> no longer need tailroom code > > > > key removed from HW -> need tailroom code again > > > > key deleted -> no longer need tailroom code > > > > > > > Following patch takes care of these four states. Kindly review. > > > > Looks fine, but still I think it might get out of sync when HW restart > > happens? > How about this? > > Thanks > Yogesh > > diff --git a/net/mac80211/key.c b/net/mac80211/key.c > index e180149..ca3c626 100644 > --- a/net/mac80211/key.c > +++ b/net/mac80211/key.c > @@ -503,8 +503,12 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata) > > mutex_lock(&sdata->local->key_mtx); > > - list_for_each_entry(key, &sdata->key_list, list) > + sdata->local->crypto_tx_tailroom_needed_cnt = 0; > + > + list_for_each_entry(key, &sdata->key_list, list) { > + sdata->local->crypto_tx_tailroom_needed_cnt++; > ieee80211_key_enable_hw_accel(key); > + } > > mutex_unlock(&sdata->local->key_mtx); > } Yeah that looks good. johannes