From: Ben Greear <greearb@candelatech.com>
To: Arend van Spriel <arend@broadcom.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless: support configuring vdev mac addr on create.
Date: Wed, 01 Oct 2014 09:43:05 -0700 [thread overview]
Message-ID: <542C2F19.4080609@candelatech.com> (raw)
In-Reply-To: <542BBCD6.4030208@broadcom.com>
On 10/01/2014 01:35 AM, Arend van Spriel wrote:
> On 09/30/14 20:43, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> This is useful when creating virtual-stations, and probably
>> APs and other devices as well. Keeps udev from mucking with
>> things it shouldn't, since the default MAC is never seen
>> by udev when specified on the cmd-line during creation.
>>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>> ---
>> include/net/cfg80211.h | 6 +++---
>> include/uapi/linux/nl80211.h | 3 +++
>> net/mac80211/iface.c | 5 ++++-
>> net/mac80211/main.c | 1 +
>> net/wireless/nl80211.c | 2 +-
>> 5 files changed, 12 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>> index e1641e6..de9a67f 100644
>> --- a/include/net/cfg80211.h
>> +++ b/include/net/cfg80211.h
>> @@ -319,9 +319,9 @@ struct ieee80211_supported_band {
>> /**
>> * struct vif_params - describes virtual interface parameters
>> * @use_4addr: use 4-address frames
>> - * @macaddr: address to use for this virtual interface. This will only
>> - * be used for non-netdevice interfaces. If this parameter is set
>> - * to zero address the driver may determine the address as needed.
>> + * @macaddr: address to use for this virtual interface.
>> + * If this parameter is set to zero address the driver may
>> + * determine the address as needed.
>> */
>> struct vif_params {
>> int use_4addr;
>> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
>> index 4b28dc0..fd14703 100644
>> --- a/include/uapi/linux/nl80211.h
>> +++ b/include/uapi/linux/nl80211.h
>> @@ -4042,6 +4042,8 @@ enum nl80211_ap_sme_features {
>> * multiplexing powersave, ie. can turn off all but one chain
>> * and then wake the rest up as required after, for example,
>> * rts/cts handshake.
>> + * @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring
>> + * the vdev's MAC address upon creation.
>> */
>> enum nl80211_feature_flags {
>> NL80211_FEATURE_SK_TX_STATUS = 1<< 0,
>> @@ -4070,6 +4072,7 @@ enum nl80211_feature_flags {
>> NL80211_FEATURE_ACKTO_ESTIMATION = 1<< 23,
>> NL80211_FEATURE_STATIC_SMPS = 1<< 24,
>> NL80211_FEATURE_DYNAMIC_SMPS = 1<< 25,
>> + NL80211_FEATURE_MAC_ON_CREATE = 1<< 26,
>
> Hi Ben,
>
> It is unclear to me why this should be ap_sme feature flag. As your description indicates this is a device feature/capability so it seems more appropriate that
> this would be a wiphy flag.
I think that is just patch getting confused, the actual change is to
this enum: nl80211_feature_flags
>> ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
>> - memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
>> + if (params&& !is_zero_ether_addr(params->macaddr))
>
> I would expect checkpatch will complain on these whitespace errors. Also would be better to use is_valid_ether_addr() to assure it is not a multicast/broadcast
> address.
I do not see that whitespace problem in the patch I posted.
I will change it to is_valid_ether_addr as you suggested.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
prev parent reply other threads:[~2014-10-01 16:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-30 18:43 [PATCH] wireless: support configuring vdev mac addr on create greearb
2014-10-01 8:35 ` Arend van Spriel
2014-10-01 16:43 ` Ben Greear [this message]
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=542C2F19.4080609@candelatech.com \
--to=greearb@candelatech.com \
--cc=arend@broadcom.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;
as well as URLs for NNTP newsgroup(s).