-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update frequency parsing for iw 6.7 compatibility #367
Conversation
Since iw 6.7, which adds 802.11ah support, iw may print fractional frequencies (e.g. 917.4 MHz). The change in the formatting code can also affect frequencies in the 2.4 and 5 GHz bands, so a frequency that used to be shown as "2412 MHz" may now be shown as "2412.0 MHz". This breaks the parsing logic in `can_transmit_to_channel`, `ieee80211_frequency_to_channel` and `is_5ghz_frequency`. The problem in `can_transmit_to_channel` causes an error when creating an AP, due the frequency not being detected as supported ("ERROR: Your adapter can not transmit to channel 1, frequency band 2.4GHz."). Fix this by changing the parsing logic to accept a trailing ".0" (or even ".00", etc.) suffix for the existing 2.4 and 5 GHz bands. See also: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=f2d9f5b52677f5414dc194be94b5916d2b080eab https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=e2224c729840cc33c6ea89ba5e91b69f79c88e85 https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=1bc6ab0abbb6f26f35d826d166d06bc28ae47b6b
Make sure the definition of `ieee80211_frequency_to_channel` matches with the latest changes from iw. Probably not very useful since all changes seem related to 6GHz / 60GHz / 802.11ah support, which as far as I can tell create_ap does not yet support. See also: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=43789196906376cc108ed06b4a3175d767586cd3 https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=b12fc8a84480d25ea791f0dff8cb92d69098c91c https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=f2d9f5b52677f5414dc194be94b5916d2b080eab
@joanbm I am unsure but recently after updating my system I am facing this error
does this pr resolves that? |
@niksingh710 Yes, most likely. You probably have iw 6.7 (check |
yep |
I tried your branch and it seems to work for 2.4 GHz frequency but not for 5GHz... Although I think 5GHz did not work for me in the past as well |
Hmm, unfortunately I don't have a 5GHz device around me right now to test it, but I can't see why it wouldn't work (provided it has in the past, that is). |
Sorry, I was using wrong channels, it did work for 5GHz as well for me. My bad 😅 |
Thanks for your contribution? Is it backward compatible for previous iw versions? |
Yes, the changes in the regular expressions are optional (note the |
Awesome! At the moment i don't have ubuntu machine to test. Thanks for testing and much appreciated. |
quite curious as last release was in nov and this pr fixes a bug introduced after the kernel release when will be the next release as arch does not have any |
FWIW the AUR package has a new pkgrel which already includes this patch (even though it’s not included in an official release yet) - see https://aur.archlinux.org/cgit/aur.git/commit/?h=linux-wifi-hotspot&id=08e15671e46e6182d8df7c631ba119bea40c1a99 |
Thanks, buddy wasn't aware of that. |
Since iw 6.7, which adds 802.11ah support, iw may print fractional frequencies (e.g. 917.4 MHz). The change in the formatting code can also affect frequencies in the 2.4 and 5 GHz bands, so a frequency that used to be shown as "2412 MHz" may now be shown as "2412.0 MHz".
This breaks the parsing logic in
can_transmit_to_channel
,ieee80211_frequency_to_channel
andis_5ghz_frequency
.The problem in
can_transmit_to_channel
causes an error when creating an AP, due the frequency not being detected as supported ("ERROR: Your adapter can not transmit to channel 1, frequency band 2.4GHz.").Fix this by changing the parsing logic to accept a trailing ".0" (or even ".00", etc.) suffix for the existing 2.4 and 5 GHz bands.
See also:
The PR also syncs the definition of
ieee80211_frequency_to_channel
with the latest iw release and fixes a minor mistake in a text message.