From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 1/7] wl12xx: implement change_interface
Date: Mon, 19 Dec 2011 12:59:10 +0200 [thread overview]
Message-ID: <1324292350.2800.280.camel@cumari> (raw)
In-Reply-To: <1324288803-1666-1-git-send-email-eliad@wizery.com>
On Mon, 2011-12-19 at 12:00 +0200, Eliad Peller wrote:
> Implement the change_interface callback by simply removing the
> current vif and adding a new one after updating the vif type.
>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
> v2: update vif->p2p as well
>
> drivers/net/wireless/wl12xx/main.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
> index c305841..82fc318 100644
> --- a/drivers/net/wireless/wl12xx/main.c
> +++ b/drivers/net/wireless/wl12xx/main.c
> @@ -2269,6 +2269,17 @@ out:
> cancel_work_sync(&wl->recovery_work);
> }
>
> +static int wl12xx_op_change_interface(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif,
> + enum nl80211_iftype new_type, bool p2p)
> +{
> + wl1271_op_remove_interface(hw, vif);
> +
> + vif->type = ieee80211_iftype_p2p(new_type, p2p);
> + vif->p2p = p2p;
> + return wl1271_op_add_interface(hw, vif);
> +}
> +
As Arik already commented, this looks a bit weird. Shouldn't the type
and p2p elements be changed in mac80211 itself? What about doing so if
the op_change_interface returns success? Currently, the opposite seems
to happen (ie. mac80211 changes type back to the original vif.type if
the op fails).
Also, it seems that the p2p value will be overwritten in the
ieee80211_setup_sdata() which is called just after this op returns, so
there's no use to do it here.
--
Cheers,
Luca.
next prev parent reply other threads:[~2011-12-19 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 10:00 [PATCH v2 1/7] wl12xx: implement change_interface Eliad Peller
2011-12-19 10:59 ` Luciano Coelho [this message]
2011-12-19 11:17 ` Eliad Peller
2011-12-19 11:37 ` Luciano Coelho
2011-12-19 16:06 ` Johannes Berg
2011-12-19 16:21 ` 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=1324292350.2800.280.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox