Re: Kernel module <-> user communication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 23, 2002 at 11:49:40AM -0600, steve_lustbader@hsgmed.com wrote:
> I'm not writing a driver for a standard ethernet card; the card is
> used to communicate with other components in a closed system.  I
> hesitate to even call it a "network driver," but it's closer to that
> than to a char driver since it's interrupt driven.  To send data with
> it, what I'd really like to do is pass it a pointer and a length and
> the device itself will send the data at that location, so I don't even
> need to worry about forming packets.  Can I do this with ioctl, or
> would the char driver be more amenable?  There's no direct reading
> from or writing to the device, just writing to registers on it.
> 
> If I do use ioctl, how do I make socket connect to my driver, rather
> than, say, "eth0"?  Is that what ifname is for (where does this
> variable come from)?  Also, is AF_INET the correct domain for socket,
> or does it not matter since all I'm doing with that socket is calling
> ioctl?

Steve, your emails would be easier to read if you wrapped your lines at
72 characters or so. (I've done so for the sake of replying.)

If you just want to talk with your driver, there is no reason to get
socket(2) involved. Nor address families, or streams, or anything else. :) 
You could simply give your device a major and minor number, and
implement enough of the vfs operations to be able to support your ioctl.

Then, your custom programmed applications can easily just give pointers
and lengths to the ioctl. (Scatter-gather might be nice to build into
your system from the start. :)

Cheers

-- 
http://immunix.org/

Attachment: pgp00151.pgp
Description: PGP signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux