Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jul 1997 08:44:35 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hasty@rah.star-gate.com (Amancio Hasty)
Cc:        rhh@ct.picker.com, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   snd driver attach routine
Message-ID:  <199707140644.IAA10143@labinfo.iet.unipi.it>
In-Reply-To: <199707140136.SAA00270@rah.star-gate.com> from "Amancio Hasty" at Jul 13, 97 06:35:45 pm

next in thread | previous in thread | raw e-mail | index | archive | help
[I am Cc'ing this to hackers since there someone might have some
useful suggestion]

Problem: what should be the return type of *attach() routines ?

> 2. "< long attach_awe_obsolete(long mem_start, struct address_info *hw_config);
>     > void attach_awe_obsolete(struct address_info *hw_config);"
> 
>     That is to sort out  long vs. void for attach routines. Personally, 
>     I think the return type should be "long" but lets  see
>     what Luigi had in mind.

I have checked /sys/i386/isa/isa.c -- while the attach routine has
return type "int", it is not tested for failure, which means that it
better not fail :) . Note that there is no consistency at all about this in
the various driver. Many (including sio.c and others that I wrote, e.g.
asc.c) can fail in the attach routine, but this might mean nothing,
just that I copied from a bad example (and in the case of sio.c, the
attach routine is also called from another part of the driver).

The drivers in /sys/pci all return void for the attach routine.

So I'd go for the following:

- make "void" the return type of all soundcard attach routines;
- move all actions which might fail (e.g. allocate memory ?) to the
  probe routine;
- do not invoke the probe routine again during the attach.

Does this sound (er... look ?:) reasonable ?
Should we also fix the existing isa drivers accordingly, if possible ?

	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707140644.IAA10143>