From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net, Ben Greear <greearb@candelatech.com>
Subject: [PATCH v2 3/6] mac80211-hwsim: support creating radios with specific name.
Date: Mon, 20 Oct 2014 15:49:35 -0700 [thread overview]
Message-ID: <1413845378-27837-3-git-send-email-greearb@candelatech.com> (raw)
In-Reply-To: <1413845378-27837-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Otherwise, it can be very difficult to know which is which
if you are trying to do detailed testing.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
drivers/net/wireless/mac80211_hwsim.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 00c7b3c..ef793d5 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2023,7 +2023,7 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
const struct ieee80211_regdomain *regd,
bool reg_strict, bool p2p_device,
bool use_chanctx, bool destroy_on_close,
- u32 portid)
+ u32 portid, char *hwname)
{
int err;
u8 addr[ETH_ALEN];
@@ -2042,7 +2042,7 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
if (use_chanctx)
ops = &mac80211_hwsim_mchan_ops;
- hw = ieee80211_alloc_hw(sizeof(*data), ops);
+ hw = ieee80211_alloc_hw_nm(sizeof(*data), ops, hwname);
if (!hw) {
printk(KERN_DEBUG "mac80211_hwsim: ieee80211_alloc_hw failed\n");
err = -ENOMEM;
@@ -2516,10 +2516,14 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info)
bool p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE];
bool destroy_on_close = info->attrs[HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE];
bool use_chanctx;
+ char *hwname = NULL;
if (info->attrs[HWSIM_ATTR_CHANNELS])
chans = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]);
+ if (info->attrs[HWSIM_ATTR_RADIO_NAME])
+ hwname = nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]);
+
if (info->attrs[HWSIM_ATTR_USE_CHANCTX])
use_chanctx = true;
else
@@ -2538,7 +2542,8 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info)
return mac80211_hwsim_create_radio(chans, alpha2, regd, reg_strict,
p2p_device, use_chanctx,
- destroy_on_close, info->snd_portid);
+ destroy_on_close, info->snd_portid,
+ hwname);
}
static int hwsim_destroy_radio_nl(struct sk_buff *msg, struct genl_info *info)
@@ -2795,7 +2800,7 @@ static int __init init_mac80211_hwsim(void)
err = mac80211_hwsim_create_radio(channels, reg_alpha2,
regd, reg_strict,
support_p2p_device,
- channels > 1, false, 0);
+ channels > 1, false, 0, NULL);
if (err < 0)
goto out_free_radios;
}
--
1.7.11.7
next prev parent reply other threads:[~2014-10-20 22:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 22:49 [PATCH v2 1/6] cfg80211: support creating wiphy with suggested name greearb
2014-10-20 22:49 ` [PATCH v2 2/6] mac80211: allow creating wiphy devices " greearb
2014-10-21 19:34 ` Johannes Berg
2014-10-20 22:49 ` greearb [this message]
2014-10-21 19:35 ` [PATCH v2 3/6] mac80211-hwsim: support creating radios with specific name Johannes Berg
2014-10-20 22:49 ` [PATCH v2 4/6] cfg80211: support creating wiphy w/out creating wlanX greearb
2014-10-21 19:38 ` Johannes Berg
2014-10-20 22:49 ` [PATCH v2 5/6] mac80211-hwsim: " greearb
2014-10-21 19:39 ` Johannes Berg
2014-10-20 22:49 ` [PATCH v2 6/6] cfg80211: support configuring vdev mac addr on create greearb
2014-10-21 19:42 ` Johannes Berg
2014-10-21 19:31 ` [PATCH v2 1/6] cfg80211: support creating wiphy with suggested name Johannes Berg
2014-10-21 20:10 ` Ben Greear
2014-10-22 16:07 ` Ben Greear
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=1413845378-27837-3-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--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).