Search Linux Wireless

Re: [PATCH RFC] mac80211_hwsim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 10, 2008 at 09:00:44PM +0200, Johannes Berg wrote:

> Should we add it to Documentation/networking/ instead? Don't care much,
> but it might be easier to track version changes that way.

That's fine, too. I'll add a subdirectory there for the readme and
example configuration files.

> > +static const struct ieee80211_rate hwsim_rates[] = {
> > +	{ .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.

That sounds better. net/wireless.h was bit confusing on this part since
it has the "filled by the core" notice only for
IEEE80211_RATE_MANDATORY_* flags, not for IEEE80211_RATE_ERP_G. Looks
like this should be added to the ERP flag, too.

> > +	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?

That was leftover from the previous version that did not check whether
IEEE80211_TX_CTL_NO_ACK was used. I'll remove it.

> 
> > ... 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.

Yes. I'm not yet very familiar with the mesh implementation in mac80211
and did not want to enable things before having had chance to test them.

> > +                   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.

OK, I'll remove it. With the current bands this seems to be fine, but
how would that work with 10 MHz and 5 MHz channels? I haven't verified,
but I would assume they could use same center frequency with 20 MHz
channels..

> > +	ieee80211_iterate_active_interfaces(hw, mac80211_hwsim_beacon_tx, hw);
> 
> Cool, another user of this API :)

I was first assuming that I have to implement some sort of data
structure to store all vifs in the driver code to do this, but this one
came in quite handy..

> > +	data->rx_filter = 0;
> > +	if (*total_flags & FIF_PROMISC_IN_BSS)
> > +		data->rx_filter |= FIF_PROMISC_IN_BSS;

> You don't actually seem to use these flags though. Should be added at
> some point, I think.

Yes, I left it there for future implementation of the actually
filtering logic.

> > +		memcpy(data->channels, hwsim_channels, sizeof(hwsim_channels));

> 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.

Hmm.. Aren't the channel and rate structures being modified by
mac80211/wireless code? Sharing the same global data area for all radios
might not be desired if there will be different "hw" capabilities as far
as supported channels/rates/bands are concerned. In addition, the static
data structures were marked 'const' which would at least be somewhat
confusing if the data ends up changing.

-- 
Jouni Malinen                                            PGP id EFC895FA
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux