Subject: Changes to firewire code
To: None <tech-kern@netbsd.org, tech-ports@netbsd.org>
From: None <jchacon@genuity.net>
List: tech-ports
Date: 04/29/2001 04:59:12
As some folks are aware I've been working recently on the firewire code
to begin the framework for adding real device support into the code (mainly so
my newly purchased hard drive isn't a large paper weight...).

At this point I've got enough of a baseline I'm about to check things in but
wanted to give anyone who's currently using the code a heads up as to what's
going to change/break/etc.

So far the list of things changing:

1. The bus code runs in it's own kthread now and interrupt processing has been
   changed to do 99% of the work inside the thread. The interrupt handler
   deals with acknowledging the interrupt and waking up the kthread to deal 
   with the DMA. This avoids a lot of race condition/possible deadlocks/etc
   in the older structure that I started tripping over when adding in fwnode
   support.

2. Move everything to splbio and let the underlying devices raise spl as
   appropriate for their specific function (i.e. the if_fw code needs to raise
   splnet when moving packets around).

3. Add basic fwnode support. Enumerate everything on the bus & provide a way
   to read in and print the config rom's. Also re-enumeration works correctly
   (yanking 1 device causes that device to detach and the rest to update their
   bus locations). At this point my drive does enough to login and spit back
   it's control register locations from SBP2.

4. Provide the initial framework for higher level routines via fwnode to
   send/receive/register for packets from the bus. This way fwnode's won't care
   if they're on a OHCI controller or a lynx controller, etc.


I have a long TODO list I'll check in with this, but the main things of note:

1. Rototill the if_fw code out of the fwohci code. This should just use the
   generic read/write/register code the fwnode's use rather than fwohci 
   having to deal with mbuf management.
2. Flesh out all of SBP2 support. (Needed for drives/printers/etc).
3. Get the config rom routines cleaned up and usable as aux arg's to 
   *_match routines. (This will turn sub device matching into a snap).
4. Rework the whole callback structure in fwohci (it's too granular in some
   aspects.)

For anyone with firewire cards/devices I'd love to see config rom dumps from
them after I get this code in (as well as bug reports of course :-). The specs
are extensive on what these can hold for values but real world helps a lot 
too.

Anyways, I'm going to check in this code Sunday night more than likely so
just wanted to give folks a heads up in case there were possible concerns
and/or issues.

James