Skip to contentSkip to conversation

Problem: one driver and 4 instances with different parameters

DISCUSSION Andrey Kamchatnikov 5 participants 5 messages Sep 19, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

Could someone to make clear next question:

I have one driver, but I need to run 4 instances of it (I run insmod with different parameters) .

But when I try to install the second driver I've got an error, that driver with this name exists.

How can I istall them? I don't want to use 4 different driver's sources.

Thank you,

Andrey

#1 lore raw

I think you need to modify your driver. So that you need to do only single insmod. and handle the 4 instances internally.

Quoted 22 lines · Andrey Kamchatnikov

Hi,

Could someone to make clear next question:

I have one driver, but I need to run 4 instances of it (I run insmod with different parameters) .

But when I try to install the second driver I've got an error, that driver with this name exists.

How can I istall them? I don't want to use 4 different driver's sources.

Thank you,

Andrey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
In reply to Andrey Kamchatnikov
Quoted 5 lines · Andrey Kamchatnikov

I have one driver, but I need to run 4 instances of it (I run insmod with different parameters) .

But when I try to install the second driver I've got an error, that driver with this name exists.

The standard trick to do that is to copy the module binary to four different names (the module name is not encoded in the binary)

But it would be better to just fix the driver to allow this with a single instance with some other run time configuration mechanism and not use module parameters (which
are generally somewhat deprecated anyways)

-Andi

#4 lore raw
In reply to Andrey Kamchatnikov
Quoted 5 lines · Andrey Kamchatnikov

I have one driver, but I need to run 4 instances of it (I run insmod with different parameters) .

But when I try to install the second driver I've got an error, that driver with this name exists.

It might work using modprobe's "--name"-option:

  # modprobe -o foo driver
  # modprobe -o bar driver

Regards,

Andreas

Signature · 5 lines
Operating | AMD Saxony Limited Liability Company & Co. KG,
  System  | Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 Research | Register Court Dresden: HRA 4896, General Partner authorized
  Center  | to represent: AMD Saxony LLC (Wilmington, Delaware, US)
  (OSRC)  | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
#3 lore raw
In reply to Andi Kleen
Quoted 8 lines · On 19 Sep 2007 10:26:54 +0200 Andi Kleen wrote:
Quoted 5 lines · Andrey Kamchatnikov

I have one driver, but I need to run 4 instances of it (I run insmod with different parameters) .

But when I try to install the second driver I've got an error, that driver with this name exists.

Quoted 7 lines

The standard trick to do that is to copy the module binary to four different names (the module name is not encoded in the binary)

But it would be better to just fix the driver to allow this with a single instance with some other run time configuration mechanism and not use module parameters (which
are generally somewhat deprecated anyways)

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Eh? Do you mean for IO,mem,irq type settings? If so, then yes, ok. Otherwise please explain what you mean...

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***