floating-point in driver: what's the *right* way??

From: Dan Miller (dan_at_invalid.net)
Date: 09/16/05

  • Next message: Rich Walker: "Re: floating-point in driver: what's the *right* way??"
    Date: Fri, 16 Sep 2005 12:13:24 -0500
    
    

    We have a device driver which needs to do fairly extensive floating-point
    math on an ongoing basis (doing carrier acquisition/tracking on RF RX
    chips). In our current driver, which runs on kernel 2.2, we just
    modified the math-library source code and linked it to our driver - not
    recommended, I know, but it's been working.

    However, now we want to upgrade to kernel 2.6, and it doesn't even
    support type double in the driver... so I want to re-design our driver so
    it does this work "correctly", at least with respect to math operations.

    What I'd like to do is somehow pass a set of registers up to a user-space
    daemon, have it run a set of computations, then pass modified register
    set back down to the driver. Sort of a "reverse ioctl", where driver
    calls an "ioctl" in the user-space module... of course, no such thing
    exists explicitly, but is there some other way to do this??

    One way that I've thought of, though it's pretty convoluted (and
    certainly doesn't qualify for "kiss principle"), is:
    1 register a separate interface (probably character) in the driver just
    for the math operations
    2 have user-space application call read() on that driver, which will put
    it to sleep.
    3 when the driver wants to run the set of math operations, it stuffs
    relevant data into a buffer and wakes up the daemon.
    4 daemon does the math, then write() modified buffer back to driver
    5 repeat steps 2-4 as much as necessary.

    However, not only is this convoluted as it stands, but we have up to 16
    receiver cards in a chassis, so I'd need to have separate threads in the
    daemon for each card!! (I already run a separate kernel thread for each
    card, to manage this acquisition/tracking requirement).

    Does anyone have any better ideas for solving these math requirements??

    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---


  • Next message: Rich Walker: "Re: floating-point in driver: what's the *right* way??"

    Relevant Pages

    • Re: Laptop shock detection and harddisk protection
      ... There's another issue with the current sysfs interface, ... I had in mind another daemon listening for "unload now" events, ... This driver * provides access and mutual exclusion for the EC ... ALRD -> is used by the driver to read out registers of the accelerometer ...
      (Linux-Kernel)
    • Re: tty line discipline driver advice sought, to do a 1-byte header and 2-byte CRC checksum
      ... You can do both - use a pty/tty pair to front the daemon ... what i was hoping was, like the motorola e680/a780 'mux_cli' driver, ... the way that harald plans to do this is to have a userspace daemon which ... and then hands it _back_ to kernelspace ...
      (Linux-Kernel)
    • Re: Laptop shock detection and harddisk protection
      ... There's another issue with the current sysfs interface, ... I had in mind another daemon listening for "unload now" events, ... This driver * provides access and mutual exclusion for the EC ... ALRD -> is used by the driver to read out registers of the accelerometer ...
      (Linux-Kernel)
    • Re: [opensuse] Attempting (and failing) to use my UPS
      ... As I say, if the driver fails to load, the ... script exits and does not start the daemon, ... instruction on the script to make absolutely sure the daemon does not ... You said that you *could* run the daemon as root. ...
      (SuSE)
    • Re: Problems with USB
      ... Somewhere there abouts is a bug in that if an endpoint is active before the daemon is active, a wild pointer writes all over the kernel when the daemon attempts to hook the driver. ... I assumed that the USBD.sys driver would know first about devices (endpoints) being added or removed. ... It was pointed out to me by another that he has similar problem if his USB printer was powered on at boot time. ...
      (comp.os.os2.bugs)