LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to load a specific device driver (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-load-a-specific-device-driver-694197/)

hasmak 01-01-2009 01:26 AM

How to load a specific device driver
 
I have a Acer Aspire 5520, I installed Mandriva One 2008.1, every thing worked out of the box. my wirless card is Atheros and was using madwifi driver. wireless connection was somewhat buggy so I made a new connection using windows drivers and ndiswrapper. the widows driver works better but it does not support monitor mode for the card. I need a way to activate either driver as needed.
Any help is apreciated

asymptote 01-01-2009 02:22 AM

Could you please explain why you need the card in Monitor mode? I can think of a specific reason why you would want this and if so that type of behaviour is INAPPROPRIATE FOR THIS FORUM!!

hasmak 01-01-2009 08:41 AM

Quote:

Originally Posted by asymptote (Post 3393253)
Could you please explain why you need the card in Monitor mode? I can think of a specific reason why you would want this and if so that type of behaviour is INAPPROPRIATE FOR THIS FORUM!!

There are many legitimate and legal reasons for using monitor mode. Network discovery, signal strength and noise analysis, equipment positioning, network traffic monitoring and analysis, intrusion detection to name a few.
I am teaching myself about wireless networking, I am using my own network for that. I am also teaching myself about how Linux works, In windows I can use the device manager to enable or disable a device, change or update the driver and set many parameters for the device.
In Linux (at least in Mandriva) there is nothing like that, I am sure there is a tool or a way to be able to control the device driver but I could not find it. Certainly the easiest thing for me is to install Mandriva again, that would take half an hour instead of the four days I spent searching the web for an answer, however there is no knowledge in that, and still would not be able to change the driver for another device if I need to.
I have tried to explain my self as best as I can, If you still thing the question is inappropriate then by all means you can report it to the forum moderator and he can kill the thread. If not then I would appreciate any useful information you may have.

PS. Happy New Year

Didier Spaier 01-01-2009 09:22 AM

To load a module, as root:
modprobe <module_name>
To unload it, if it's not already in use :
rmmod <module_name>

A usual, man modprobe and man rmmod will tell you more.

About the options available for a specific module, I can't remember right now of a command to print it.

But you can sometime find useful information in the kernel tree. Here is an example where I look for information about my wireless card driver, whose driver name is ipw2000 (found with lsmod if the module is loaded):

Code:

bash-3.1$ find /usr/src/linux-2.6.27.7/ -type f -name "*ipw2200*"
/usr/src/linux-2.6.27.7/drivers/net/wireless/ipw2200.c
/usr/src/linux-2.6.27.7/drivers/net/wireless/ipw2200.h
/usr/src/linux-2.6.27.7/Documentation/networking/README.ipw2200
/usr/src/linux-2.6.27.7/include/config/ipw2200.h
bash-3.1$

So I know I can find information in README.ipw2200.

Sometime you can find that in the driver file itself (in my case, ipw2200.c), provided it's well documented.

HTH

asymptote 01-01-2009 09:39 AM

Quote:

Originally Posted by hasmak (Post 3393443)
There are many legitimate and legal reasons for using monitor mode.

Oh if you're simply learning for your own enhancement there's nothing wrong with that. Didier is correct on usage of the modprobe tool. Several wireless drivers do this automatically for you like those you can download from linuxwireless.org but if you want to use modprobe then by all means. Happy New Year to you too and thank you for the clarification.

hasmak 01-01-2009 09:44 AM

Quote:

Originally Posted by Didier Spaier (Post 3393467)
To load a module, as root:
modprobe <module_name>
To unload it, if it's not already in use :
rmmod <module_name>

HTH

Thanks Didier
I'll try that tonight.
Do I have to unload the windows driver module first before loading the madwifi module?

Will the changed module stay after reboot or will I have to do that every time I want to switch modules?
Thanks again

hasmak 01-01-2009 09:56 AM

Quote:

Originally Posted by asymptote (Post 3393474)
Oh if you're simply learning for your own enhancement there's nothing wrong with that. Didier is correct on usage of the modprobe tool. Several wireless drivers do this automatically for you like those you can download from linuxwireless.org but if you want to use modprobe then by all means. Happy New Year to you too and thank you for the clarification.

Thanks
To clarify more, I am retired with lots of time on my hands, I have always tinkered with windows and messed it more times than I can remember, but I know my way around windows, can't say the same for Linux :-) Still learning.
Thanks again

Didier Spaier 01-01-2009 10:29 AM

Quote:

Originally Posted by hasmak (Post 3393480)
Do I have to unload the windows driver module first before loading the madwifi module?

Better so I guess, as you could run into problems with two drivers claiming the same device.

Would it occur that the madwifi driver works but the Windows one be automatically loaded at boot time, you may prevent this behavior in blacklisting the Windows module. As I don't have Mandriva I can't tell you exactly how-to do that though.

hasmak 01-01-2009 11:14 AM

Quote:

Originally Posted by Didier Spaier (Post 3393518)
Better so I guess, as you could run into problems with two drivers claiming the same device.

Would it occur that the madwifi driver works but the Windows one be automatically loaded at boot time, you may prevent this behavior in blacklisting the Windows module. As I don't have Mandriva I can't tell you exactly how-to do that though.

Thanks Didier
I thought about blacklisting the module but I don't want to do that since I'll need to load it again.
There must be some thing that tells the OS what module to load at boot (like the windows registry) If I can figure out what it is I can edit it to load the madwifi, better still if there is a tool to change the driver at runtime (wishful thinking :-)

Thanks
H.

Didier Spaier 01-01-2009 12:08 PM

If I am right, blacklisting a module forbids the kernel to load it automatically at boot time, but doesn't prevent you to load it manually using the modprobe command.

And in your distribution there should be a file that you may edit where you list modules that you want to be loaded after booting. This is useful when for some reason a module is not automatically loaded by the kernel at boot time (or when you insert it or plug it in, in case of a removable device).

e.g. for Slackware 12.2 which I use:
- to blacklist a module I edit the file /etc/modprobe.d/blacklist and add a line such as:
Code:

blacklist <module_name>
- make sure a module be loaded after booting I edit the file /etc/rc.d/rc.modules-<kernel_version> and add (or uncomment if it was already there) a line such as:
Code:

/sbin/modprobe <module_name>
May be a Mandriver will tell you how-to do that with Mandriva ?

As a reminder, to check which modules are actually loaded you can type:
Code:

lsmod
You don't have to be root to do that.

hasmak 01-02-2009 10:28 AM

Quote:

Originally Posted by Didier Spaier (Post 3393590)
If I am right, blacklisting a module forbids the kernel to load it automatically at boot time, but doesn't prevent you to load it manually using the modprobe command.
.

I blacklisted ndiswrapper but it still loads at boot ??
there is another complication, it appears that ndiswrapper trashed the madwifi module, it is nowhere to be found :-(
I gues I'll have to install it from scratch

Didier Spaier 01-02-2009 01:07 PM

Quote:

Originally Posted by hasmak (Post 3394665)
I blacklisted ndiswrapper but it still loads at boot ??
there is another complication, it appears that ndiswrapper trashed the madwifi module, it is nowhere to be found :-(

Sorry, I can't help you in that case, because I don't know how init scripts work in Mandriva :(


All times are GMT -5. The time now is 07:07 PM.