Re: how to use the function copyout()

From: Stefan Sperling (stsp_at_stsp.in-berlin.de)
Date: 07/25/05

  • Next message: Leubner, Achim: "RE: aac_pci.c Patch (support for HP ML110 G2)"
    Date: Mon, 25 Jul 2005 14:53:27 +0200
    To: Felix-KM <Felix-KM@yandex.ru>
    
    

    On Mon, Jul 25, 2005 at 04:35:20PM +0400, Felix-KM wrote:
    > I can't understand how to use the function copyout().
    > It is necessary to write the data from a device driver to the
    > array defined in user program.
    > I do it this way:
    >
    > #define IOCTL_GET_B _IOWR("F", 127, 0x4)

    <snip>

    > Here I get EFAULT.
    >
    > What have I done wrong? How can I do it correctly?

    You may need to add your ioctl to another middle layer.

    For example, to add ioctls to network devices, I first added
    defines to sockio.h only, and it wouldn't work ("device not
    configured"). Then I found out that I had to add my ioctls
    to a rather large switch statement in if.c too.

    hope this helps,

    -- 
    stefan
    http://stsp.in-berlin.de                                 PGP Key: 0xF59D25F0
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Leubner, Achim: "RE: aac_pci.c Patch (support for HP ML110 G2)"

    Relevant Pages

    • RE: How to add/drop SCSI drives from within the driver?
      ... >> realize they take a huge risk, but that is no reason to foul up the ... Aacraid uses a FIB to communicate a wide variety of RAID management ... The remaining ioctls pick up driver or OS internal information as has ... the multitude of array types and their configuration needs ...
      (Linux-Kernel)
    • Re: The guts of /dev/* ?
      ... Read the source code. ... Exactly what is read depends on how the device driver happens to have been ... set by the ioctls for that device. ... ]table is refereed to and the kernel creates a data structure ...
      (comp.os.linux.misc)
    • Re: CE6.0 Exposing Driver Interfaces to an Application
      ... complicated mechanism is to create a simple stream driver and expose your ... for *kernel* ioctls, not device driver ioctls. ... components can call device driver ioctls though. ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Custom IOCTLs
      ... IOCTLs. ... I have set up an IOCTL in my device driver but I don't know which ... commands to call in eVC. ...
      (microsoft.public.windowsce.embedded.vc)