Re: Basic device driver question
From: Josef Moellers (josef.moellers_at_fujitsu-siemens.com)
Date: 10/04/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Basic device driver question"
- Previous message: Josef Moellers: "Re: how to find out the PID ?"
- In reply to: Mike: "Basic device driver question"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Basic device driver question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 04 Oct 2004 09:33:00 +0200
Mike wrote:
> Hi,
>
> This is probally a stupid question, but I'm going to ask it anyway.
>
> If I develop a device driver, which allowed access to a specific piece of
> hardware, how could I access the function in the device driver? So for
> example, let's say I have a PCI card for which I develop a device driver.
> And let's say the device driver has a function called
> write_to_pci_card(...). And let's also say that I was developing an
> application, which needed to use the write_to_pci_card(...) function. How
> would I call the write_to_pci_card(...) function from my application?
>
> Or is it a case that the device driver would create a file in the /devs
> directory, which I would then access from the application? To access the
> /devs file would I need to use fread() and fwrite()?
>
> Can anyone shed any light on this?
There are several ways an application could access this function:
1. The function is the "official" write() function of the driver, then
your driver should regeister this function as such.
2. The function is not the "official" write() function, then you could
use an ioctl with a parameter structure as an argument to transfer data
back and forth.
3. You could use /proc to access the function.
-- Josef Möllers (Pinguinpfleger bei FSC) If failure had no penalty success would not be a prize -- T. Pratchett
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Basic device driver question"
- Previous message: Josef Moellers: "Re: how to find out the PID ?"
- In reply to: Mike: "Basic device driver question"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Basic device driver question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|