From: Felix Fietkau <nbd@openwrt.org>
To: Sujith Manoharan <sujith@msujith.org>,
John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com
Subject: Re: [PATCH] ath9k: Fix p2p address management
Date: Fri, 19 Sep 2014 10:16:47 +0200 [thread overview]
Message-ID: <541BE66F.9040307@openwrt.org> (raw)
In-Reply-To: <1411111842-24503-1-git-send-email-sujith@msujith.org>
On 2014-09-19 09:30, Sujith Manoharan wrote:
> From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
>
> When multiple channel contexts are enabled, a p2p interface
> that is assigned to a context will have an address that
> is different from the device mac address, which is used
> by wpa_s as the p2p device ID.
>
> Certain frames like provision requests use the device address
> and these get dropped since ath9k_calculate_summary_state()
> iterates over only the active interfaces in a context and the
> device address is not used.
>
> Fix this by adding the device mac address to the bssid mask.
>
> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath9k/ath9k.h | 1 +
> drivers/net/wireless/ath/ath9k/main.c | 36 ++++++++++++++++++++++++++++++++++
> 2 files changed, 37 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 78fc539..32f9db9 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -940,6 +940,34 @@ static void ath9k_vif_iter(struct ath9k_vif_iter_data *iter_data,
> }
> }
>
> +static void ath9k_update_bssid_mask(struct ath_softc *sc,
> + struct ath_chanctx *ctx,
> + struct ath9k_vif_iter_data *iter_data)
> +{
> + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
> + struct ath_vif *avp;
> + int i;
> +
> + if (!ath9k_is_chanctx_enabled())
> + return;
> +
> + list_for_each_entry(avp, &ctx->vifs, list) {
> + if (ctx->nvifs_assigned != 1)
> + continue;
> +
> + if (!avp->vif->p2p || !iter_data->has_hw_macaddr)
> + continue;
> +
> + ether_addr_copy(common->curbssid, avp->bssid);
> +
> + /* perm_addr will be used as the p2p device address. */
> + for (i = 0; i < ETH_ALEN; i++)
> + iter_data->mask[i] &=
> + ~(iter_data->hw_macaddr[i] ^
> + sc->hw->wiphy->perm_addr[i]);
> + }
> +}
Wouldn't it make more sense to put this into ath9k_vif_iter()
- Felix
next prev parent reply other threads:[~2014-09-19 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 7:30 [PATCH] ath9k: Fix p2p address management Sujith Manoharan
2014-09-19 8:16 ` Felix Fietkau [this message]
2014-09-19 11:07 ` Sujith Manoharan
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=541BE66F.9040307@openwrt.org \
--to=nbd@openwrt.org \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sujith@msujith.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).