LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2013, 12:20 AM   #1
med458
LQ Newbie
 
Registered: Mar 2013
Posts: 2

Rep: Reputation: Disabled
Trying to load/register two similar network modules simultaneously


I am attempting to insmod rt2860sta.ko and rt3562sta.ko, two similar network modules, simultaneously.
rt3562sta code reveals many references to rt2860; thus, it is clear that the rt3562sta.ko module was created from rt2860 source.

I can insmod one just fine. When I try to insmod the other, the terminal returns "insmod: can't insert <module name>: Device or resource busy" and dmesg reports: "Error: Driver 'rt2860' is already registered, aborting..."

Based on dmesg, I believe the problem is that both modules are named "rt2860" in some fashion unknown to me. lsmod shows them to be named rt2860sta and rt3562sta when they are loaded seperately, which is also their file names.

Thus, I suspect the solution lies in editing the rt3562sta code. First I must find the place where the rt3562 module is identified as "rt2860" and merely change that to something else.
Am I on the right track. If yes, how would I go about finding the correct reference to "rt2860"? (when I search for "rt2860" there are many many search results).
Thank you for your help, in advance
 
Old 03-31-2013, 01:16 AM   #2
med458
LQ Newbie
 
Registered: Mar 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
for the benefit of others in the future, I'd like to say that I figured it out and describe the steps I took.
I used notepad++ to open each and every *.c and *.h file included in the module archive.
I then did a case sensitive search for the module name "rt2860", this turned up 3 results, all in the same file.
This code below was the culprit:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
print_name = pci_dev ? pci_name(pci_dev) : "rt2860";
#else
print_name = pci_dev ? pci_dev->slot_name : "rt2860";
#endif // LINUX_VERSION_CODE //

changing the above code to the following solved the problem:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
print_name = pci_dev ? pci_name(pci_dev) : "rt3060";
#else
print_name = pci_dev ? pci_dev->slot_name : "rt3060";
#endif // LINUX_VERSION_CODE //

I confirmed the drivers both load simultaneously, per lsmod. I hope this helps someone in the future.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
questions about register modules onto netfilter linwenyuan Linux - Security 1 03-11-2007 05:38 AM
how-to register ndiswrapper with modules.pcimap esl537 Linux - Wireless Networking 1 09-06-2005 07:09 AM
Network Install With Gigabit E-1000, how do I load the modules at startup SourCreamAndOni Linux - Networking 1 05-26-2004 04:38 AM
How do I register my clarkconnect to make the administrative modules active? sunnyvic Linux - Security 1 08-01-2003 11:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration