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