From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 10/29] wl12xx: move tx_security_seq into wlvif
Date: Mon, 10 Oct 2011 22:25:05 +0300 [thread overview]
Message-ID: <1318274705.9690.399.camel@cumari> (raw)
In-Reply-To: <1318234397-21081-11-git-send-email-eliad@wizery.com>
On Mon, 2011-10-10 at 10:12 +0200, Eliad Peller wrote:
> The last security seq num has to be saved across reconfigs.
> Add a new "persistent" struct into wlvif, which won't get
> deleted on wl12xx_init_vif_data()
>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
> @@ -1910,8 +1914,8 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
> {
> struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
>
> - /* make sure wlvif is zeroed */
> - memset(wlvif, 0, sizeof(*wlvif));
> + /* clear everything but the persistent data */
> + memset(wlvif, 0, offsetof(struct wl12xx_vif, persistent));
Nice trick! :)
> diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
> index c7be151..0a5fef5 100644
> --- a/drivers/net/wireless/wl12xx/tx.c
> +++ b/drivers/net/wireless/wl12xx/tx.c
> @@ -755,6 +755,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
> struct wl1271_tx_hw_res_descr *result)
> {
> struct ieee80211_tx_info *info;
> + struct ieee80211_vif *vif;
> + struct wl12xx_vif *wlvif;
> struct sk_buff *skb;
> int id = result->id;
> int rate = -1;
> @@ -774,6 +776,10 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
> return;
> }
>
> + /* info->control is valid as long as we don't update info->status */
> + vif = info->control.vif;
> + wlvif = wl12xx_vif_to_data(vif);
>From a comment in the ieee80211_tx_info struct in mac80211.h:
/* NB: vif can be NULL for injected frames */
Should we check the vif here...
> /* update the TX status info */
> if (result->status == TX_SUCCESS) {
> if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
> @@ -801,14 +807,14 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
> info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP ||
> info->control.hw_key->cipher == WL1271_CIPHER_SUITE_GEM)) {
> u8 fw_lsb = result->tx_security_sequence_number_lsb;
> - u8 cur_lsb = wl->tx_security_last_seq_lsb;
> + u8 cur_lsb = wlvif->tx_security_last_seq_lsb;
...because we're accessing it directly here?
And don't we get TX complete events for dummy packets?
> /*
> * update security sequence number, taking care of potential
> * wrap-around
> */
> - wl->tx_security_seq += (fw_lsb - cur_lsb + 256) % 256;
> - wl->tx_security_last_seq_lsb = fw_lsb;
> + wlvif->tx_security_seq += (fw_lsb - cur_lsb + 256) % 256;
> + wlvif->tx_security_last_seq_lsb = fw_lsb;
We could change this (... + 256) % 256 here for & 0xFF as Ido suggested
for some other code earlier.
--
Cheers,
Luca.
next prev parent reply other threads:[~2011-10-10 19:25 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 8:12 [PATCH 00/29] make the driver ready for multi-vif support Eliad Peller
2011-10-10 8:12 ` [PATCH 01/29] wl12xx: refactor fw init into a new function Eliad Peller
2011-10-10 8:12 ` [PATCH 02/29] wl12xx: move last_tx_hlid into wlvif Eliad Peller
2011-10-10 17:52 ` Luciano Coelho
2011-10-10 19:16 ` Eliad Peller
2011-10-10 8:12 ` [PATCH 03/29] wl12xx: unify STA and AP tx_queue mechanism Eliad Peller
2011-10-10 8:12 ` [PATCH 04/29] wl12xx: move some functions from remove_interface() to stop() Eliad Peller
2011-10-10 8:12 ` [PATCH 05/29] wl12xx: move bitrate_masks into wlvif Eliad Peller
2011-10-10 18:20 ` Luciano Coelho
2011-10-10 19:21 ` Eliad Peller
2011-10-10 19:25 ` Luciano Coelho
2011-10-10 8:12 ` [PATCH 06/29] wl12xx: add vifs list Eliad Peller
2011-10-10 18:28 ` Luciano Coelho
2011-10-10 19:29 ` Eliad Peller
2011-10-10 19:40 ` Luciano Coelho
2011-10-10 20:04 ` Johannes Berg
2011-10-10 20:07 ` Eliad Peller
2011-10-10 8:12 ` [PATCH 07/29] wl12xx: support multiple vifs in the tx path Eliad Peller
2011-10-10 8:12 ` [PATCH 08/29] wl12xx: configure sleep_policy according to active roles Eliad Peller
2011-10-10 18:51 ` Luciano Coelho
2011-10-10 19:32 ` Eliad Peller
2011-10-10 19:54 ` Luciano Coelho
2011-10-10 8:12 ` [PATCH 09/29] wl12xx: make event handling support multirole Eliad Peller
2011-10-10 18:58 ` Luciano Coelho
2011-10-10 19:36 ` Eliad Peller
2011-10-10 19:47 ` Luciano Coelho
2011-10-10 8:12 ` [PATCH 10/29] wl12xx: move tx_security_seq into wlvif Eliad Peller
2011-10-10 19:25 ` Luciano Coelho [this message]
2011-10-10 8:12 ` [PATCH 11/29] wl12xx: rearm rx streaming per vif Eliad Peller
2011-10-10 8:13 ` [PATCH 12/29] wl12xx: make WL1271_FLAG_STA_ASSOCIATED flag per-vif Eliad Peller
2011-10-10 8:13 ` [PATCH 13/29] wl12xx: make WL1271_FLAG_IBSS_JOINED " Eliad Peller
2011-10-10 8:13 ` [PATCH 14/29] wl12xx: make WL1271_FLAG_AP_STARTED " Eliad Peller
2011-10-10 8:13 ` [PATCH 15/29] wl12xx: make WL1271_FLAG_PSM " Eliad Peller
2011-10-10 8:13 ` [PATCH 16/29] wl12xx: make WL1271_FLAG_STA_STATE_SENT " Eliad Peller
2011-10-10 8:13 ` [PATCH 17/29] wl12xx: make WL1271_FLAG_RX_STREAMING_STARTED " Eliad Peller
2011-10-10 8:13 ` [PATCH 18/29] wl12xx: make WL1271_FLAG_IF_INITIALIZED per-vif Eliad Peller
2011-10-10 8:13 ` [PATCH 19/29] wl12xx: make WL1271_FLAG_PSPOLL_FAILURE flag per-vif Eliad Peller
2011-10-10 8:13 ` [PATCH 20/29] wl12xx: make WL1271_FLAG_CS_PROGRESS " Eliad Peller
2011-10-10 8:13 ` [PATCH 21/29] wl12xx: add band field to wlvif Eliad Peller
2011-10-10 20:38 ` Luciano Coelho
2011-10-10 20:47 ` Eliad Peller
2011-10-11 9:48 ` Victor Goldenshtein
2011-10-10 8:13 ` [PATCH 22/29] wl12xx: add channel " Eliad Peller
2011-10-10 8:13 ` [PATCH 23/29] wl12xx: add power_level " Eliad Peller
2011-10-10 8:13 ` [PATCH 24/29] wl12xx: make op_config configure all vifs Eliad Peller
2011-10-10 8:13 ` [PATCH 25/29] wl12xx: replace all remaining wl->vif references Eliad Peller
2011-10-10 8:13 ` [PATCH 26/29] wl12xx: call stop() on recovery Eliad Peller
2011-10-10 8:13 ` [PATCH 27/29] wl12xx: use dynamic rate policies Eliad Peller
2011-10-10 8:13 ` [PATCH 28/29] wl12xx: add elp wakeup/sleep calls to add_interface Eliad Peller
2011-10-10 8:13 ` [PATCH 29/29] wl12xx: use round-robin policy for tx Eliad Peller
2011-10-11 12:52 ` [PATCH 00/29] make the driver ready for multi-vif support Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1318274705.9690.399.camel@cumari \
--to=coelho@ti.com \
--cc=eliad@wizery.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.