Would anyone have any hints, kinks or URL's they might be willing to share.
Charles
There are plenty of examples in existing drivers.
See: /usr/src/linux/Documentation/networking/netdevices.txt ,
net_modules.txt ....
Do you use a source viewer like cscope ? or tags in vi ?
It helps to be able to peruse other drivers.
I have a prototype driver based on Mr. Becker's eepro100.c. It does
insmod/rmmod. I can also call ifconfig and iwconfig while it is loaded and
see some of the elements of net_device that I have set in my driver. I can
see how to change the source to add ioctl support to the driver and
communicate easily with the underlying custom chip and I am working on that.
There are some parameters that I need to set and query that are above
and beyond iwconfig/ifconfig. For that, I need to create a custom userspace
program to read/write hardware registers as we flesh out this wireless
design.
Towards that end, I am trying to understand how to communicate with my
prototype driver from userspace and a private IOCTL seems the most
straighforward. I can see some hints of that in ifconfig.c and its cousin
interface.c, but I suspect it will be a while before I can come to a grok.
What I am really looking for is a way to accelerate that effort with another
reference that will let me avoid a week inside the ifconfig sources
answering the all-important questions "why" and "how".
With that said, I leave myself open to a suggestion of where to go.
With highest respects for this group, Charles Krinke
p.s. I did read Rubini's "Linux Device Drivers" second edition and Beck's
"Linux Kernel Internals" before I made the first post yesterday.
"wb" <dead_...@nospam.com> wrote in message
news:3F915DF1...@nospam.com...
If you want to see what ioctls's are being sent down
to the eeproc100, use strace :
strace ifconfig eth0
Basically, ifconfig does a
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 to eth0, then
ioctl(4, 0x8913, 0xbffff730) = 0
You can also comminicate to your driver via a
private /proc/ name too :
register a unique file within /proc
/proc/my_special_device_nic
open("/proc/my_device_nic")
ioctl ( fd, 0xABCD, & my_data_structure) ;
You can avoid the PRIVATE crap altogether.
Sometimes you just have to bite the bullet and kill
a week learning it. "Open Source" doesn't always mean
completely free as management assumes .
//
Again, I thank you for your help, and I'll be back sometime later after
I do some studying.
Charles Krinke http://home.pacbell.net/cfk