USB driver: some breadcrumbs

USB driver: some breadcrumbs

Post by Philip Bro » Sun, 30 Sep 2001 17:03:00



Some breadcrumbs for people looking to write USB drivers. Hopefully others
can add to the trail.
Solaris 8 doesnt come with any official documentation on
"Heres how to write a USB driver".

On the other hand, it DOES ship with pseudo-documentation.

/usr/include/sys/usb/*
/etc/dacf.conf

so I'm thinking anyone could in theory write a USB leaf device driver
at this point, if they can figure out what needs to be where.
Maybe.

Looks like any USB "client" driver needs to be added to dacf.conf, since
usbms is in there.

But I'm a lightweight when it comes to STREAMS drivers. Anyone who is a
STREAMS guru want to look at the file, and explain what probably happens
after that point?

Hmmm... then again... usbprn is also a dynamically pluggable USB device.
AND it is present in /etc/driver_aliases, as
usbprn "usbif,class7.1.1"

So maybe /etc/dacf.conf is ONLY for "console-related" USB items. (durn).
Whereas there is still an as-yet unknown mechanism for invoking other
USB items.
Looks like something did a
  add_drv -a '"usbif,class7.1.1"'
And that is under /kernel/drv/usbprn, NOT /kernel/strmod
So not a STREAMS driver.

Curiouser and curiouser.

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

The word of the day is mispergitude

 
 
 

USB driver: some breadcrumbs

Post by Daniel Pri » Mon, 01 Oct 2001 07:38:01


<snip>

Quote:>/etc/dacf.conf

>so I'm thinking anyone could in theory write a USB leaf device driver
>at this point, if they can figure out what needs to be where.
>Maybe.

>Looks like any USB "client" driver needs to be added to dacf.conf, since
>usbms is in there.

>But I'm a lightweight when it comes to STREAMS drivers. Anyone who is a
>STREAMS guru want to look at the file, and explain what probably happens
>after that point?

>Hmmm... then again... usbprn is also a dynamically pluggable USB device.
>AND it is present in /etc/driver_aliases, as
>usbprn "usbif,class7.1.1"

>So maybe /etc/dacf.conf is ONLY for "console-related" USB items. (durn).
>Whereas there is still an as-yet unknown mechanism for invoking other
>USB items.
>Looks like something did a
>  add_drv -a '"usbif,class7.1.1"'
>And that is under /kernel/drv/usbprn, NOT /kernel/strmod
>So not a STREAMS driver.

Please don't add things to dacf.conf(4).  You've correctly guessed that
one of its purposes is to help with the configuration of USB STREAMS
devices.  The problem it helps to solve is that on systems with USB, the
console keyboard device may vanish at any time; the kernel employs a
loadable "helper" module (for example consconfig_dacf) to configure (and
reconfigure as needed) the console stream.  /etc/dacf.conf simply
specifies the rules for doing so.

In any case, changes you make to dacf.conf will not be preserved across
upgrade, and its format and contents are subject to change at any time.

        -dp

--

Expressed in this posting are my opinions. They are in no way related to
opinions held by my employer, Sun Microsystems. Statements on Sun products
included here are not gospel and may be fiction rather than truth.

 
 
 

USB driver: some breadcrumbs

Post by Andrew Gabri » Mon, 01 Oct 2001 10:09:07




Quote:>Looks like something did a
>  add_drv -a '"usbif,class7.1.1"'
>And that is under /kernel/drv/usbprn, NOT /kernel/strmod
>So not a STREAMS driver.

STREAMS _modules_ go in /kernel/strmod.
STREAMS _drivers_ (and non-STREAMS drivers) go in /kernel/drv.

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

USB driver: some breadcrumbs

Post by Philip Bro » Wed, 03 Oct 2001 02:39:26



Quote:>....

>STREAMS _modules_ go in /kernel/strmod.
>STREAMS _drivers_ (and non-STREAMS drivers) go in /kernel/drv.

Huh. well, what do I know about streams,anyways :-)

Care to write a synopsis of the difference between a streams driver and a
streams module?

(Is is that a module gets pushed on top of a streams driver, so one is a
 middle layer, one is an endpoint, and that's about it?)

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

The word of the day is mispergitude

 
 
 

USB driver: some breadcrumbs

Post by Casper H.S. Dik - Network Security Engine » Wed, 03 Oct 2001 04:34:52


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>Care to write a synopsis of the difference between a streams driver and a
>streams module?

A STREAMs module acts as a filter/buffer and can be pushed on any odd STREAM.

A STREAMs driver is a device driver that at the far end from the STREAM head
talks to a device (network, serial port) and on the near end pretends to
be a STREAMs module (except that you can't see it as a module or pop it
but it has the same interface(s))

Quote:>(Is is that a module gets pushed on top of a streams driver, so one is a
> middle layer, one is an endpoint, and that's about it?)

Yep.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

USB driver: some breadcrumbs

Post by Philip Bro » Wed, 03 Oct 2001 06:34:18



Quote:>[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
>...
>A STREAMs driver is a device driver that at the far end from the STREAM head
>talks to a device (network, serial port) and on the near end pretends to
>be a STREAMs module....

Thank you, Casper.

Now, wanna give any hints as to how one might get a STREAMS driver loaded,
if it is supposed to be dynamically loaded/unloaded by USBA? :-)

(presumably, all this would involve would be to is point out a particular
 routine in the  PUBLIC /usr/include/sys/usb/usbai.h header file,
 which would by definition not break any confidentiality stuff, since
 it is now by definition "public")

I would think your average USB driver would have to be a module. But usbprn
is not a module, it's in /kernel/drv, so I'm confused.

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

The word of the day is mispergitude