[SOLVED] Tweaking and recompiling the code of a WiFi driver for my needs
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Tweaking and recompiling the code of a WiFi driver for my needs
I want to take an existing, standard WiFi driver for Linux and tweak it. I'll inroduce a whitelist into it. That is, to the consumer a driver will show the networks from a whitelist only ignoring all other ones.
It's a PoC. I want to implement it as simply as possible.
Can this be implemented? And how, in a high level?
---
It must be a driver, not a user-space application, because it's a requirement.
A driver, as I've been suggested, is iwlwifi, which is a part of the kernel
What you suggest is like trying to put a map of one way streets into you car's engine. The WiFi driver just drives the wifi card. There's a whole networking stack that handles routing and IP packets. The job you are describing is a firewall, and you already have one.
These days, firewalls are problematic because spare IPV4 address blocks assigned to one country have been sold and assigned in another. Also, once hackers compromise one apparently innocent box, they can launch attacks from there. But your firewall will let it through. Everyone updated the Solar Winds software a year or two back - which came with a virus attached.
Try seeing if iptables does what you want to do with your wifi driver.
What you suggest is like trying to put a map of one way streets into you car's engine. The WiFi driver just drives the wifi card.
You haven't undertood.
....a wifi driver drives by a) looking for WiFi networks b) finding them c) creating a list of them d) giving a list of them to the consumer - Linux user level. Correct?
I want to create a modified version of a Wifi driver which would post-process some data in the (c) step thus cutting off some of them the networks off a list, right before passing it to the user level.
That is, it'd simply give out a slightly modified list of the networks
You claim that this wouldn't be possible?
Last edited by pintomonde; 10-01-2023 at 06:02 PM.
I don't think so. The wifi driver simply passes network traffic in the form of network packets to the particular wifi card you have. If you swapped your wifi card, you'd need another network driver. Connecting to networks is hardly relevant, as if you could get onto other local networks you'd hardly pay your isp, would you?
There are a host of programs including the kernel involved in deciding what goes into network packets. The wifi driver doesn't decide anything. This is not my strong suit, but I'm sure others will chip in. I imagine running a firewall to exclude social media might be an option but I'm sure it's not a simple task.
There are a host of programs including the kernel involved in deciding what goes into network packets. The wifi driver doesn't decide anything. This is not my strong suit, but I'm sure others will chip in. I imagine running a firewall to exclude social media might be an option but I'm sure it's not a simple task.
The last thing you need is a tweaked wifi driver.
>>I imagine running a firewall to exclude social media
I'm asking him about Wifi networks, twice already, but he's still telling me about social media - websites - and firewall. What a strange developer.
>>The last thing you need is a tweaked wifi driver.
How do you know what I need to?
Last edited by pintomonde; 10-02-2023 at 09:54 AM.
>>I imagine running a firewall to exclude social media
I'm asking him about Wifi networks, twice already, but he's still telling me about social media - websites - and firewall. What a strange developer.
It seems like you're not understanding/liking the answer, despite it being correct. The Wifi driver does one thing: enables the device to talk to things further into the system. This include things like the security pieces (WPA, etc.), along with the rest of the TCP/IP stack. That's it. The list of wifi networks *IS NOT* coming from the wifi driver. And how do you propose to introduce this 'whitelist' into things??? Do you expect people to recompile the network driver each time they travel so they can use a different network?? Or do you plan on using something else...which then takes your driver into user-space, doesn't it???
What's strange is you asking this question; if you're able to modify kernel level drivers, you'd already know these things. If you're unable to do so, why are you doubting what others tell you?? If you can do, please proceed and prove everyone wrong. Feel free to look into any wifi driver module to see how things work, then think about how they do what they do.
Quote:
>>The last thing you need is a tweaked wifi driver.
How do you know what I need to?
Monkeying around with a wifi driver makes things far less secure and stable, which is something that pretty much no one needs.
>The list of wifi networks *IS NOT* coming from the wifi driver.
Where does come from then? What is it that builds it?
Things that aren't in the wifi driver, but further up, as you've been told.
Quote:
>Do you expect people to recompile the network driver each time they travel so they can use a different network??
Re-read my question. You don't and can't know requirements, therefore you're making bizzare guesses. I'm asking about the implementation only. What you're doing though is guessing a reason and whethere it'd be feasiable. Stupidity.
Right, we can't and don't know the requirements, because *YOU HAVE NOT TOLD US WHAT THEY ARE* You keep saying it's a 'requirement', but don't say for what, what purpose, etc. You call people 'strange', tell them they're stupid, yet somehow expect us to give you help. What you're wanting is *NOT* feasible, as you've been told, but again...don't seem to want that answer.
Get any wifi driver you want and look at the source code. Look at the code/github for nmcli and you may find some other things, such as:
Quote:
Originally Posted by NMCLI Docs
The NetworkManager daemon runs as a privileged service (since it must access and control hardware), but provides a D-Bus interface on the system bus to allow for fine-grained control of networking. NetworkManager does not store connections or settings, it is only the mechanism by which those connections are selected and activated.
To store pre-defined network connections, two separate services, the "system settings service" and the "user settings service" store connection information and provide these to NetworkManager, also via D-Bus. Each settings service can determine how and where it persistently stores the connection information; for example, the GNOME applet stores its configuration in GConf, and the system settings service stores it's config in distro-specific formats, or in a distro- agnostic format, depending on user/administrator preference.
Look, all these things are done very well by the gnu utilities and the linux kernel.
This wifi driver thing has got way out of proportion. To block out social media requires analysing the packets, which a wifi driver doesn't do. It can be done by DNS. A good move may be to check opendns.org and see if they have an option to block social media. Even if they don't, there's clever tricks and hacks that your kids will find out about before you.
I ran on the censored version of opendns while my kids were teenagers. But they were not fools. If they wanted porn, all they had to do was go to a torrent site! Fortunately, they didn't want it.
Quote:
Originally Posted by John Perry Barlow
The Internet treats censorship as a malfunction and routes around it
As for your kernel.org link - The kernel knows more about me than I know about it .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.