From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH RFC] mac80211_hwsim
Date: Tue, 10 Jun 2008 21:00:44 +0200 [thread overview]
Message-ID: <1213124444.3668.48.camel@johannes.berg> (raw)
In-Reply-To: <20080610183722.GA7377@jm.kir.nu>
[-- Attachment #1: Type: text/plain, Size: 3778 bytes --]
> Here's a completely untested (well, it compiles) patch against
> wireless-test. I'll try to do some testing tomorrow, but if someone is
> interested in taking a closer look at a version that is converted to use
> the new data structures for channel/rate configuration, here's a
> preliminary version. All comments are welcome.
>
> As far as functionality is concerned, this is supposed to match with the
> 2.6.25-based version I have in hostap.git, i.e., the only changes are to
> convert the newer version of mac80211 API. Since I'm frequently using
> the latest 2.6.x release kernel instead of wireless-test (and would
> assume I'm not the only one doing that), I'm thinking of maintaining two
> versions of the module. One would be in wireless-test and maintained
> just like any other in-tree driver. The other one is in my hostap.git
> repository and is maintained as an out-of-tree version that is based on
> the latest (or well, relatively close to the latest, i.e., whatever I
> happen to be using ;-) released kernel. Of course, once the in-tree
> version hits a released kernel, out-of-tree version can die.
Sounds good to me.
> PS.
>
> The URL in Kconfig is just a placeholder and I'll add the information in
> README and hostapd/wpa_supplicant example configuration files there
> before this gets submitted properly.
Should we add it to Documentation/networking/ instead? Don't care much,
but it might be easier to track version changes that way.
> +static const struct ieee80211_rate hwsim_rates[] = {
> + { .bitrate = 10 },
> + { .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
> + { .bitrate = 55, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
> + { .bitrate = 110, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
> + { .bitrate = 60, .flags = IEEE80211_RATE_ERP_G },
You don't need to add the ERP flag manually, it'll be added based on the
rate automatically.
> + if (is_multicast_ether_addr(hdr->addr1))
> + ack = 1;
That seems a bit weird to me. mac80211 shouldn't request an ACK for
mcast, but why fake one?
> ... beacon ...
> + if (vif->type != IEEE80211_IF_TYPE_AP)
> + return;
That could support mesh as well, in mesh-beacon-like-AP mode rather than
mesh-beacon-like-IBSS.
> + data->channel->band != data2->channel->band ||
> + data->channel->center_freq != data2->channel->center_freq)
The band check is useless since the frequency is in MHz, it's mostly to
know which band table to look up things in if necessary.
> +static void mac80211_hwsim_beacon(unsigned long arg)
> +{
> + struct ieee80211_hw *hw = (struct ieee80211_hw *) arg;
> + struct mac80211_hwsim_data *data = hw->priv;
> +
> + if (!data->started || !data->radio_enabled)
> + return;
> +
> + ieee80211_iterate_active_interfaces(hw, mac80211_hwsim_beacon_tx, hw);
Cool, another user of this API :)
> + data->rx_filter = 0;
> + if (*total_flags & FIF_PROMISC_IN_BSS)
> + data->rx_filter |= FIF_PROMISC_IN_BSS;
> + if (*total_flags & FIF_ALLMULTI)
> + data->rx_filter |= FIF_ALLMULTI;
> +
> + *total_flags = data->rx_filter;
You don't actually seem to use these flags though. Should be added at
some point, I think.
> + memcpy(data->channels, hwsim_channels, sizeof(hwsim_channels));
> + memcpy(data->rates, hwsim_rates, sizeof(hwsim_rates));
> + data->band.channels = data->channels;
> + data->band.n_channels = ARRAY_SIZE(hwsim_channels);
> + data->band.bitrates = data->rates;
> + data->band.n_bitrates = ARRAY_SIZE(hwsim_rates);
You shouldn't need to memcpy these, just point to the static
allocations.
> + hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &data->band;
You can even allocate the band struct statically.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2008-06-10 19:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 10:50 mac80211_hwsim - simulator of 802.11 radios for mac80211 Jouni Malinen
2008-06-10 11:16 ` Johannes Berg
2008-06-10 12:30 ` John W. Linville
2008-06-10 13:11 ` Johannes Berg
2008-06-10 15:24 ` John W. Linville
2008-06-10 18:37 ` [PATCH RFC] mac80211_hwsim Jouni Malinen
2008-06-10 19:00 ` Johannes Berg [this message]
2008-06-11 6:57 ` Jouni Malinen
2008-06-11 12:07 ` Johannes Berg
2008-06-11 12:54 ` Tomas Winkler
2008-06-10 12:47 ` mac80211_hwsim - simulator of 802.11 radios for mac80211 Jouni Malinen
2008-06-10 13:09 ` Johannes Berg
2008-06-10 13:12 ` Johannes Berg
2008-06-10 15:02 ` Jouni Malinen
2008-06-10 15:11 ` Johannes Berg
2008-06-10 16:31 ` Jouni Malinen
2008-06-10 14:22 ` Dan Williams
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=1213124444.3668.48.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=j@w1.fi \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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).