driver receives wrong inode from kernal
From: dnewbold (dnewbold_at_generalstandards.com)
Date: 08/23/04
- Next message: Paul Pluzhnikov: "Re: Why is the stack pointer always the same?"
- Previous message: Jeroen N. Witmond: "Address of instruction causing SIGSEGV"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: driver receives wrong inode from kernal"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: driver receives wrong inode from kernal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 23 Aug 2004 09:16:06 -0500
I'm working with 2.4 (haven't moved to 2.6 yet).
I'm working on several device drivers.
The device major numbers are all assigned dynamically.
The /dev device nodes are created automatically (via scripts) when the
driver modules are loaded.
Yesterday, I loaded multiple drivers and everything went well.
Today, after rebooting and removing some devices, I load fewer drivers (via
their scripts).
But wait! The /dev directory now has the same major number being used by two
entirely different devices.
When my user space app calls open() on the device node created yesterday
(the one whose driver
wasn't loaded today) the kernel passes the request to the driver that is now
using that major number.
Ok. I understand that this is how things work. So ...
What is the standard/recommended check that is appropriate for the
driver's open service?
Rubini/Corbet don't address this. While I know I could examine the
device in question to see
if it is one I deal with, I prefer not to do so as this check sometimes
requires reading other than
PCI configuration registers. I would like to ask the kernel for the
string passed to the
register_chrdev() call, but I don't even know if such a service exists.
Thanks for the help.
Please respond to dnewbold@generalstandards.com.
Don Newbold
- Next message: Paul Pluzhnikov: "Re: Why is the stack pointer always the same?"
- Previous message: Jeroen N. Witmond: "Address of instruction causing SIGSEGV"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: driver receives wrong inode from kernal"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: driver receives wrong inode from kernal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|