Re: 26 ways to set a device driver variable from userland

Kyle Moffett
2005-10-19T18:37:00Z

I'm CCing this to the LKML, because it's useful to the list in
general and you're much more likely to get useful replies as well.

On Oct 19, 2005, at 14:07:44, Rick Niles wrote:
> I really appreciate the prompt and complete feedback. While you're
> at it perhaps you can answer another one for me.

Please don't top-post :-D. Thanks!
http://www.zipworld.com.au/~akpm/linux/patches/stuff/top-posting.txt
http://catb.org/~esr/jargon/html/T/top-post.html

> I'm doing a low-level GPS receiver driver. This is NOT a serial
> port kinda thing. I have to close tracking loops and that sort of
> thing at faster that 1ms. I was planning on outputing the actual
> tracking data (not the parameters I asked about earlier) through a
> read of a device file. However, your point about binary
> structures applied to this as well. Would you say I should not use
> a device file at all? Should the device file output ASCII instead
> of binary (this brings up an eff. argument)
>
> Also, each GPS satellite transmits a standard binary data message
> that I definitely should not mess with in the kernel (IMHO).
> However, the GPS range is computed using the settings of the
> oscillator and some counters off the correlator chip. I planned on
> making each channel a separate
> device file. Would it be OK to mix this GPS data message with the
> corellator tracking information, or should I make two files? Or
> perhaps, depending on your answer to above you might say the
> tracking info should be in sysfs.

Umm, hmm. This really depends on a bunch of stuff I don't really
understand all that well, but I'll try :-D. The simplest way to do
it would be to just stick each distinct value in a sysfs file and let
your GPS software read each one and do what it wants from them. That
would make it really easy to shell-script with GPS coordinates too :-
D. Others on the list may have more informative/useful responses
here, sorry!

Cheers,
Kyle Moffett

--
There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult.
-- C.A.R. Hoare