Skip to contentSkip to conversation

prism54 freq to channel incorrect for 5GHz

PATCH In review Margit Schubert-While 3 participants 4 messages Jul 7, 2004 – Jul 9, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prism54 freq to channel incorrect for 5GHz

Jeff scribeth:

Quoted 1 line

any comment on Sam's comment ?

Sam was referring to this from the sourceforge madwifi project :
* Convert MHz frequency to IEEE channel number. */
u_int
ieee80211_mhz2ieee(u_int freq, u_int flags)

{
        if (flags & IEEE80211_CHAN_2GHZ) {      /* 2GHz band */
                if (freq == 2484)
                        return 14;
                if (freq < 2484)
                        return (freq - 2407) / 5;
                else
                        return 15 + ((freq - 2512) / 20);
        } else if (flags & IEEE80211_CHAN_5GHZ) {       /* 5Ghz band */
                return (freq - 5000) / 5;
        } else {                                /* either, guess */
                if (freq == 2484)
                        return 14;
                if (freq < 2484)
                        return (freq - 2407) / 5;
                if (freq < 5000)
                        return 15 + ((freq - 2512) / 20);
                return (freq - 5000) / 5;
        }
}

Mostly, the wirless drivers (airo, orinoco, prism54, etc) have a table for the freq's.
For something generic, I would suggest something like this :
u_int
ieee80211_freq_to_channel(u_int freq)

{
	/* 2.4 GHz channel 14 */
	if ( freq == 2484 )
		return 14;
	/* 2.4 GHz channels 1 - 13 */
	if ( freq >= 2412 && freq <= 2472 )
		return (freq - 2407) / 5;
	/* 2.4 GHz unofficial channels */
	if ( freq > 2484 && freq < 5000 )
		return 15 + ((freq - 2512) / 20);
	/* 5 GHz channels 0 - 200 */
	if ( freq >= 5000 && freq <= 6000 )
		return (freq - 5000) / 5;
	/* Undefined */
	return 0;
}

Note that AFAIK, the 5GHz WLAN channels start at 34 (5.17 GHz) (but I am not sure) and I don't know the top limit (except that it is <= 6GHz). Maybe somebody can shed light on this.
If there is a clear definition, that should be reflected int the code. And something similar for channel_to_freq.
Apparently Japan is doing something in the 10GHz band - will have to look for details.

Margit

#1 lore raw
Quoted 2 lines · [email protected] (Margit Schubert-While) writes:

Note that AFAIK, the 5GHz WLAN channels start at 34 (5.17 GHz) (but I am not sure)

802.11a defines all channels 0..200, i.e. all center frequencies from 5 to 6 GHz. But I don't know any country which allows usage of the 5 GHz band below 5150 MHz, and the lowest channel should be at least 20 MHz from the band edge, so 34 is probably the lowest channel that legally can be used anywhere (and I believe 36 is the lowest allowed in the US?)

Quoted 2 lines

and I don't know the top limit (except that it is <= 6GHz). Maybe somebody can shed light on this.

The highest available frequency (in Europe at least) is 5875 MHz. Which would make 171 the highest available channel (given a 20 MHz minimum distance from the center frequency to the band edge).

Quoted 2 lines

Apparently Japan is doing something in the 10GHz band - will have to look for details.

That would require a new PHY standard.

Bjørn

#2 lore raw
In reply to Margit Schubert-While

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 07 July 2004 09:31, Margit Schubert-While wrote:
[code skipped]

Quoted 7 lines

Note that AFAIK, the 5GHz WLAN channels start at 34 (5.17 GHz) (but I am not sure) and I don't know the top limit (except that it is <= 6GHz). Maybe somebody can shed light on this.
If there is a clear definition, that should be reflected int the code. And something similar for channel_to_freq.
Apparently Japan is doing something in the 10GHz band - will have to look for details.

It is not 10 GHz band. They use the same 5 GHz band, exactly same frequencies, but channel is twice narrower - 10Mhz instead of 20Mhz as usual 802.11.

In 10Mhz channels, they use 1/2 data rates as well. I.e. (6,9,12,18,24,36,48,54) rates replaced by (3,4.5,6,9,12,18,24,27)

For frequencies, there are several documents. I'll try to summarize:

2.4Ghz band (as in code):
in 802.11b standard, 14 channels defined:
freq=channel*5 + 2407, channel=1..13
freq=2484, channel=14

Those "unofficial" frequencies are not defined. BTW, do anyone know document desctibing them?

5Ghz band (as in code):

freq=channel*5 + 5000, channel=0..200 (from standard)

For valid channels, 802.11a standard says there are 3 bands (all in US):
1: 36,40,44,48
2: 52,56,60,64
3: 149,153,157,161

TGh (regulation in Europe) adds channels
100..140 with interval 4

Tgj (japan) spec adds new rules: 10Mhz channels I mentioned above, and channel formula:
freq=channel*5+dot11ChannelStartingFrequency; where dot11ChannelStartingFrequency may be 4000 or 5000 (as for .11a) For channels 183 and above, it is 4000, for others - 5000

Valid channels for Japan (note some channels may have both 10 and 20 Mhz width, some - only one of them):

20Mhz channels: 184,188,192,196;8,12,16,34,38,42,46 10Mhz channels: 183,184,185,187,188,189;7,8,11

For TGn (high throughput) standard expected to finalize around 2006, wide 40Mhz channels expected, with maybe some additional attributes.

After describing this whole mess, some points to pay attention:

- - channel number is not enough to determine frequency - there are same numbers in 2.4 and 5Ghz bands.
- - to properly init hardware, channel witdh should be provided as well.

Thus, we probable need to use (channel,band,width) triples or (channel,domain) tuples, where (band,width) mapped into domain.

Vladimir
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA7ZXAqxdj7mhC6o0RAje5AJ4rDQLYmUj4QuqZgVRz71eeoq99SgCcCAWm GQSHPKvBkPgLjbO7mONUyNI=
=hyvM
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Margit Schubert-While

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 07 July 2004 09:31, Margit Schubert-While wrote:
[code skipped]

Quoted 7 lines

Note that AFAIK, the 5GHz WLAN channels start at 34 (5.17 GHz) (but I am not sure) and I don't know the top limit (except that it is <= 6GHz). Maybe somebody can shed light on this.
If there is a clear definition, that should be reflected int the code. And something similar for channel_to_freq.
Apparently Japan is doing something in the 10GHz band - will have to look for details.

It is not 10 GHz band. They use the same 5 GHz band, exactly same frequencies, but channel is twice narrower - 10Mhz instead of 20Mhz as usual 802.11.

In 10Mhz channels, they use 1/2 data rates as well. I.e. (6,9,12,18,24,36,48,54) rates replaced by (3,4.5,6,9,12,18,24,27)

For frequencies, there are several documents. I'll try to summarize:

2.4Ghz band (as in code):
in 802.11b standard, 14 channels defined:
freq=channel*5 + 2407, channel=1..13
freq=2484, channel=14

Those "unofficial" frequencies are not defined. BTW, do anyone know document desctibing them?

5Ghz band (as in code):

freq=channel*5 + 5000, channel=0..200 (from standard)

For valid channels, 802.11a standard says there are 3 bands (all in US):
1: 36,40,44,48
2: 52,56,60,64
3: 149,153,157,161

TGh (regulation in Europe) adds channels
100..140 with interval 4

Tgj (japan) spec adds new rules: 10Mhz channels I mentioned above, and channel formula:
freq=channel*5+dot11ChannelStartingFrequency; where dot11ChannelStartingFrequency may be 4000 or 5000 (as for .11a) For channels 183 and above, it is 4000, for others - 5000

Valid channels for Japan (note some channels may have both 10 and 20 Mhz width, some - only one of them):

20Mhz channels: 184,188,192,196;8,12,16,34,38,42,46 10Mhz channels: 183,184,185,187,188,189;7,8,11

For TGn (high throughput) standard expected to finalize around 2006, wide 40Mhz channels expected, with maybe some additional attributes.

After describing this whole mess, some points to pay attention:

- - channel number is not enough to determine frequency - there are same numbers in 2.4 and 5Ghz bands.
- - to properly init hardware, channel witdh should be provided as well.

Thus, we probable need to use (channel,band,width) triples or (channel,domain) tuples, where (band,width) mapped into domain.

Vladimir
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA7kIAqxdj7mhC6o0RAgdvAJ9KaF5ciW+EjJP8ITc6nbVQGYV4NgCfYkS/ KnSqVGQxal52x5cPPePphYM=
=CHNv
-----END PGP SIGNATURE-----