Skip to contentSkip to conversation

Need persistent node to USB port naming

DISCUSSION Stephen Morgan 4 participants 12 messages May 12, 2005 – May 18, 2005

lore
Share & tools
lore
#0 lore raw

Hello all,

I'm converting a driver for a USB device from Linux 2.4 to 2.6. The device is embedded and the host is an embedded PC. There may be as many as 6 identical devices attached. The only way they are differentiated is by the USB port they're plugged into - the cabling is fixed. So, when the user asks for 'foo_dev0' for instance, he wants the first USB device - 'foo_dev1' should give him the 2nd device, etc.

Under 2.4, I created six nodes, assigning them minors 192 thru 197. In the driver's probe(), I used usb_make_path to create an index to the device. For file ops, I used (MINOR(inode_p->i_rdev) - 192) to get an index from the node.

So far, under 2.6, the best approach I can see is to create a udev .rules file to make the nodes, like so: BUS="usb", PLACE="1-1", NAME="usb/foo_dev0"

Is this the best way to go, or have I overlooked something simpler?

Thanks

Stephen Morgan

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 14 lines · Stephen Morgan

Hello all,

I'm converting a driver for a USB device from Linux 2.4 to 2.6. The device is embedded and the host is an embedded PC. There may be as many as 6 identical devices attached. The only way they are differentiated is by the USB port they're plugged into - the cabling is fixed. So, when the user asks for 'foo_dev0' for instance, he wants the first USB device - 'foo_dev1' should give him the 2nd device, etc.

Under 2.4, I created six nodes, assigning them minors 192 thru 197. In the driver's probe(), I used usb_make_path to create an index to the device. For file ops, I used (MINOR(inode_p->i_rdev) - 192) to get an index from the node.

Quoted 8 lines

So far, under 2.6, the best approach I can see is to create a udev .rules file to make the nodes, like so: BUS="usb", PLACE="1-1", NAME="usb/foo_dev0"

Is this the best way to go, or have I overlooked something simpler?

Thanks

Stephen Morgan

If your driver is aware of which usb port it is plugged into, it could turn this into a sysfs attribute which can be picked up by udev:

BUS="usb", KERNEL="foo", NAME="%k", SYMLINK="%s{USBPORT}"

It may be that the USB port already exists as a sysfs attribute without you having to explicitly code this - I can't check this at the mo.

You can find what sysfs attributes exist for your devices with something like:
udevinfo -a -p /class/usb/(DEVICE)

Hope this helps :0)

-Oli

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Stephen Morgan
Quoted 31 lines · On Fri, 2005-05-03 at 2:50 ocomber wrote:
Quoted 3 lines · Stephen Morgan

Hello all,

I'm converting a driver for a USB device from Linux 2.4 to 2.6.

The device

Quoted 2 lines

is embedded and the host is an embedded PC. There may be as many as 6 identical devices attached. The only way they are

differentiated is by the

Quoted 2 lines

USB port they're plugged into - the cabling is fixed. So, when the user asks for 'foo_dev0' for instance, he wants the first USB device

- 'foo_dev1'

Quoted 3 lines

should give him the 2nd device, etc.

Under 2.4, I created six nodes, assigning them minors 192 thru

197. In the

Quoted 2 lines

driver's probe(), I used usb_make_path to create an index to the device. For file ops, I used (MINOR(inode_p->i_rdev) - 192) to get an

index from the

Quoted 3 lines

node.

So far, under 2.6, the best approach I can see is to create a

udev .rules

Quoted 1 line

file to make the nodes, like so: BUS="usb", PLACE="1-1",

NAME="usb/foo_dev0"

Quoted 6 lines

Is this the best way to go, or have I overlooked something simpler?

Thanks

Stephen Morgan

Quoted 7 lines

If your driver is aware of which usb port it is plugged into, it could turn this into a sysfs attribute which can be picked up by udev:

BUS="usb", KERNEL="foo", NAME="%k", SYMLINK="%s{USBPORT}"

It may be that the USB port already exists as a sysfs attribute without you having to explicitly code this - I can't check this at the mo.

It does - it's called PLACE :-) (or, more recently, ID) and it works - I just want to make sure this is the best way to get the nodes I need.

One problem I've run into is trying to create a dummy node that allows me to communicate with the driver thru ioctl's even when no device is plugged in. In 2.4, I just created a node with a minor I knew would never be used, and in the driver, I filtered for that minor.

Do I <need> to use udev? It's obviously working, but can I turn it off and make nodes the way I did in 2.4? If so, how would I turn it off? What kinds of havoc would that wreak in 2.6?

Quoted 8 lines

You can find what sysfs attributes exist for your devices with something like:
udevinfo -a -p /class/usb/(DEVICE)

Hope this helps :0)

-Oli

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Stephen Morgan
Quoted 35 lines · Stephen Morgan
Quoted 34 lines · On Fri, 2005-05-03 at 2:50 ocomber wrote:
Quoted 3 lines · Stephen Morgan

Hello all,

I'm converting a driver for a USB device from Linux 2.4 to 2.6.

The device

Quoted 2 lines

is embedded and the host is an embedded PC. There may be as many as 6 identical devices attached. The only way they are

differentiated is by the

Quoted 2 lines

USB port they're plugged into - the cabling is fixed. So, when the user asks for 'foo_dev0' for instance, he wants the first USB device

- 'foo_dev1'

Quoted 3 lines

should give him the 2nd device, etc.

Under 2.4, I created six nodes, assigning them minors 192 thru

197. In the

Quoted 2 lines

driver's probe(), I used usb_make_path to create an index to the device. For file ops, I used (MINOR(inode_p->i_rdev) - 192) to get an

index from the

Quoted 3 lines

node.

So far, under 2.6, the best approach I can see is to create a

udev .rules

Quoted 1 line

file to make the nodes, like so: BUS="usb", PLACE="1-1",

NAME="usb/foo_dev0"

Quoted 6 lines

Is this the best way to go, or have I overlooked something simpler?

Thanks

Stephen Morgan

If your driver is aware of which usb port it is plugged into, it could turn this into a sysfs attribute which can be picked up by udev:

Quoted 7 lines
Quoted 4 lines

BUS="usb", KERNEL="foo", NAME="%k", SYMLINK="%s{USBPORT}"

It may be that the USB port already exists as a sysfs attribute without you having to explicitly code this - I can't check this at the mo.

It does - it's called PLACE :-) (or, more recently, ID) and it works - I just want to make sure this is the best way to get the nodes I need.

Yes it is. PLACE is just for what you are looking for.

Quoted 6 lines

One problem I've run into is trying to create a dummy node that allows me to communicate with the driver thru ioctl's even when no device is plugged in. In 2.4, I just created a node with a minor I knew would never be used, and in the driver, I filtered for that minor.

Do I <need> to use udev?

Not if you don't want to, no.

Quoted 3 lines

It's obviously working, but can I turn it off and make nodes the way I did in 2.4? If so, how would I turn it off? What kinds of havoc would that wreak in 2.6?

Depends on your distro, and how it is set up. Lots of people use 2.6 without using udev.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Stephen Morgan
Quoted 41 lines · Greg KH
Quoted 7 lines · Stephen Morgan
Quoted 6 lines · On Fri, 2005-05-03 at 2:50 ocomber wrote:
Quoted 3 lines · Stephen Morgan

Hello all,

I'm converting a driver for a USB device from Linux 2.4 to 2.6.

The device

Quoted 1 line

is embedded and the host is an embedded PC. There may be

as many as 6

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

identical devices attached. The only way they are

differentiated is by the

Quoted 1 line

USB port they're plugged into - the cabling is fixed. So,

when the user

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

asks for 'foo_dev0' for instance, he wants the first USB device

- 'foo_dev1'

Quoted 3 lines

should give him the 2nd device, etc.

Under 2.4, I created six nodes, assigning them minors 192 thru

197. In the

Quoted 1 line

driver's probe(), I used usb_make_path to create an index

to the device.

Quoted 20 lines
Quoted 20 lines
Quoted 1 line

For file ops, I used (MINOR(inode_p->i_rdev) - 192) to get an

index from the

Quoted 3 lines

node.

So far, under 2.6, the best approach I can see is to create a

udev .rules

Quoted 1 line

file to make the nodes, like so: BUS="usb", PLACE="1-1",

NAME="usb/foo_dev0"

Quoted 6 lines

Is this the best way to go, or have I overlooked something simpler?

Thanks

Stephen Morgan

If your driver is aware of which usb port it is plugged into, it could turn this into a sysfs attribute which can be picked up by udev:

BUS="usb", KERNEL="foo", NAME="%k", SYMLINK="%s{USBPORT}"

Quoted 8 lines
Quoted 1 line
Quoted 1 line

It may be that the USB port already exists as a sysfs

attribute without

Quoted 4 lines
Quoted 1 line

you having to explicitly code this - I can't check this at the mo.

It does - it's called PLACE :-) (or, more recently, ID) and it works - I just want to make sure this is the best way to get the nodes I need.

Yes it is. PLACE is just for what you are looking for.

Thanks, Greg. That's what I needed to hear.

Quoted 8 lines
Quoted 2 lines

One problem I've run into is trying to create a dummy node that

allows me to

Quoted 1 line

communicate with the driver thru ioctl's even when no device is

plugged in.

Quoted 1 line

In 2.4, I just created a node with a minor I knew would never

be used, and

Quoted 1 line

in the driver, I filtered for that minor.

Any thoughts on how to create this dummy device node?

Quoted 9 lines
Quoted 2 lines

Do I <need> to use udev?

Not if you don't want to, no.

Quoted 3 lines

It's obviously working, but can I turn it off and make nodes the way I did in 2.4? If so, how would I turn it off? What kinds of havoc would that wreak in 2.6?

Quoted 7 lines

Depends on your distro, and how it is set up. Lots of people use 2.6 without using udev.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Stephen Morgan
Quoted 8 lines · Stephen Morgan
Quoted 5 lines · Greg KH
Quoted 4 lines · Stephen Morgan

One problem I've run into is trying to create a dummy node that allows me to communicate with the driver thru ioctl's even when no device is plugged in. In 2.4, I just created a node with a minor I knew would never be used, and in the driver, I filtered for that minor.

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

That being said, what do you want to get to and from the driver? Why not just use sysfs files that you put in your driver's directory? That is what they are there for :)

Hope this helps,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Stephen Morgan
Quoted 8 lines · Greg KH
Quoted 2 lines · Stephen Morgan

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

Don't recent versions of udev do this for you? I only have FC3, which uses a very old version of udev, available right now, but I seem to remember the man page on FC4t3 saying something about this.

Signature · 15 lines
====================================
Ian Pilcher                                        [email protected]
====================================



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#7 lore raw
In reply to Stephen Morgan
Quoted 9 lines · Greg KH
Quoted 3 lines · Stephen Morgan
Quoted 2 lines · Greg KH
Quoted 1 line · Stephen Morgan

One problem I've run into is trying to create a dummy node

that allows me to

Quoted 1 line
Quoted 1 line
Quoted 1 line

communicate with the driver thru ioctl's even when no device

is plugged in.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In 2.4, I just created a node with a minor I knew would never

Quoted 8 lines

be used, and

Quoted 3 lines
Quoted 1 line
Quoted 1 line

in the driver, I filtered for that minor.

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

That being said, what do you want to get to and from the driver?

It's mostly useful during development. For instance, I can change the driver's debug print priority on the fly. Eventually, I'll use it to retrieve diagnostic info the driver is collecting.

Quoted 1 line

Why not just use sysfs files that you put in your driver's directory?

That

Quoted 1 line

is what they are there for :)

Okay, I'm not sure what you just said, so I'm gonna go read sysfs.txt.

Quoted 1 line

Hope this helps,

Me too :-)

Thanks,

Stephen

Quoted 3 lines

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Stephen Morgan
Quoted 12 lines · Stephen Morgan
Quoted 12 lines · Greg KH
Quoted 3 lines · Stephen Morgan
Quoted 2 lines · Greg KH
Quoted 1 line · Stephen Morgan

One problem I've run into is trying to create a dummy node

that allows me to

Quoted 1 line
Quoted 1 line
Quoted 1 line

communicate with the driver thru ioctl's even when no device

is plugged in.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In 2.4, I just created a node with a minor I knew would never

be used, and

Quoted 2 lines
Quoted 1 line
Quoted 1 line

in the driver, I filtered for that minor.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

That being said, what do you want to get to and from the driver?

It's mostly useful during development. For instance, I can change the driver's debug print priority on the fly.

That is useful. So useful that if you look at any usb-serial driver, they already do this in the /sys/modules/MODULE_NAME/paramaters/debug file :)

You can get this for free too with the module_param() macro.

Quoted 2 lines

Eventually, I'll use it to retrieve diagnostic info the driver is collecting.

sysfs is for 1 value per file. For diagnostic information, I suggest using debugfs instead, that is what it is there for.

Quoted 4 lines
Quoted 2 lines

Why not just use sysfs files that you put in your driver's directory? That is what they are there for :)

Okay, I'm not sure what you just said, so I'm gonna go read sysfs.txt.

Try the Third Edition of Linux Device Drivers from Oreilly. It's much better than that outdated file. It's also online for free if you don't want to buy it.

Good luck,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#9 lore raw
In reply to Stephen Morgan
Quoted 17 lines · Greg KH
Quoted 16 lines · Stephen Morgan
Quoted 16 lines · Greg KH
Quoted 3 lines · Stephen Morgan
Quoted 2 lines · Greg KH
Quoted 1 line · Stephen Morgan

One problem I've run into is trying to create a dummy node

that allows me to

Quoted 1 line
Quoted 1 line
Quoted 1 line

communicate with the driver thru ioctl's even when no device

is plugged in.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In 2.4, I just created a node with a minor I knew would never

be used, and

Quoted 3 lines
Quoted 1 line
Quoted 1 line

in the driver, I filtered for that minor.

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

That being said, what do you want to get to and from the driver?

It's mostly useful during development. For instance, I can change the driver's debug print priority on the fly.

That is useful. So useful that if you look at any usb-serial driver, they already do this in the /sys/modules/MODULE_NAME/paramaters/debug file :)

I guess I'm missing something here. What should I be looking for (I assume in /drivers/usb/serial/)?

In usb-serial.h, I see your dbg macro, which has a fixed priority of KERN_DEBUG and can be turned on and off with the 'debug' variable.

I'm using ...

#define dbug(level, format, arg...) do { if (debug & level) printk(KERN_NOTICE __FILE__ ": " format "\n" , ## arg); } while (0)

... so each call can use one of several values of "level", and by passing "debug" in through an ioctl(), I have pretty good control over printk traffic, assuming I chose my levels wisely.

Quoted 2 lines

You can get this for free too with the module_param() macro.

But, isn't that only able to set the parameter once, at load time?

Quoted 6 lines
Quoted 3 lines

Eventually, I'll use it to retrieve diagnostic info the driver is collecting.

sysfs is for 1 value per file. For diagnostic information, I suggest using debugfs instead, that is what it is there for.

Can you recommend a good reference on debugfs? The only thing I've found is the man page that calls it "an interactive file system debugger."

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

Why not just use sysfs files that you put in your driver's

directory? That

Quoted 3 lines
Quoted 1 line

is what they are there for :)

Okay, I'm not sure what you just said, so I'm gonna go read sysfs.txt.

Try the Third Edition of Linux Device Drivers from Oreilly. It's much better than that outdated file. It's also online for free if you don't want to buy it.

Okay, thanks. I've got that now.

Quoted 5 lines

Good luck,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#10 lore raw
In reply to Stephen Morgan
Quoted 23 lines · Stephen Morgan
Quoted 22 lines · Greg KH
Quoted 20 lines · Stephen Morgan
Quoted 9 lines · Greg KH
Quoted 3 lines · Stephen Morgan
Quoted 2 lines · Greg KH
Quoted 1 line · Stephen Morgan

One problem I've run into is trying to create a dummy node

that allows me to

Quoted 1 line
Quoted 1 line
Quoted 1 line

communicate with the driver thru ioctl's even when no device

is plugged in.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In 2.4, I just created a node with a minor I knew would never

Quoted 8 lines

be used, and

Quoted 3 lines
Quoted 1 line
Quoted 1 line

in the driver, I filtered for that minor.

Any thoughts on how to create this dummy device node?

Um, I can't recommend _ever_ doing this kind of thing.

That being said, what do you want to get to and from the driver?

It's mostly useful during development. For instance, I can change the driver's debug print priority on the fly.

Quoted 6 lines
Quoted 3 lines

That is useful. So useful that if you look at any usb-serial driver, they already do this in the /sys/modules/MODULE_NAME/paramaters/debug file :)

I guess I'm missing something here. What should I be looking for (I assume in /drivers/usb/serial/)?

module_param()

Quoted 8 lines

In usb-serial.h, I see your dbg macro, which has a fixed priority of KERN_DEBUG and can be turned on and off with the 'debug' variable.

I'm using ...

#define dbug(level, format, arg...) do { if (debug & level) printk(KERN_NOTICE __FILE__ ": " format "\n" , ## arg); } while (0)

Quoted 8 lines

... so each call can use one of several values of "level", and by passing "debug" in through an ioctl(), I have pretty good control over printk traffic, assuming I chose my levels wisely.

Quoted 2 lines

You can get this for free too with the module_param() macro.

But, isn't that only able to set the parameter once, at load time?

Nope. Not if you set the last value to a valid file mode. If it is not 0000, then a file will be created in /sys/module/MODULE_NAME/paramaters/ with the name of the module paramater, and the mode specified. This happens if the code is built as a module or not (that way built-in modules get access to this info too.)

If you notice the debug paramater, it is defined as:

	module_param(debug, bool, S_IRUGO | S_IWUSR);

Which lets the value to be read by any user, but set only by root.

You can also override the default functions that are called when the value is written to, in order to do different things when this happens, but that functionality is only rarely needed.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Eventually, I'll use it to retrieve diagnostic info the driver is collecting.

sysfs is for 1 value per file. For diagnostic information, I suggest using debugfs instead, that is what it is there for.

Can you recommend a good reference on debugfs? The only thing I've found is the man page that calls it "an interactive file system debugger."

My post to lkml about how to use it is a good start. I think it got referenced on kerneltrap.org. Yeah, here it is:

	http://kerneltrap.org/node/4394

The "interactive file system debugger" is a userspace program called debugfs, a totally different thing. Also read the debugfs code (in fs/debugfs/*), it contains a lot of built-in documentation.

Hope this helps,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#11 lore raw
In reply to Stephen Morgan
Quoted 3 lines

You can also override the default functions that are called when the value is written to, in order to do different things when this happens, but that functionality is only rarely needed.

I think that's got it, Greg. Thanks very much for your help.

Stephen

/**************************************************/ static int my_command_set(const char *val, struct kernel_param *kp)

{
	// convert val to an int and switch() on it

	return 0;
}

int my_command;

// use my 'set' but use the kernel's default 'get' module_param_call(my_command, my_command_set, param_get_int, &my_command, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(my_command, "My Driver Command"); /**************************************************/

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel