wireless: Add channel/frequency conversions to ieee80211.h

Added mappings for FHSS, DSSS and OFDM channels - with macros to point
HR DSSS and ERP to the DSSS mappings. Currently just static inline
functions.

Use the new functions in the older fullmac drivers. This eliminates a
number of const static buffers and removes a couple of range checks that
are now redundant.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Richard Farina <sidhayn@gmail.com>
Acked-by: Jeroen Vreeken <pe1rxq@amsat.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
David Kilroy
2008-12-23 14:03:38 +00:00
committed by John W. Linville
parent eaee7cc2c1
commit 9ee677c227
7 changed files with 155 additions and 68 deletions

View File

@ -919,10 +919,9 @@ static int zd1201_set_freq(struct net_device *dev,
if (freq->e == 0)
channel = freq->m;
else {
if (freq->m >= 2482)
channel = 14;
if (freq->m >= 2407)
channel = (freq->m-2407)/5;
channel = ieee80211_freq_to_dsss_chan(freq->m);
if (channel < 0)
channel = 0;
}
err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel);