Commit Graph

19 Commits

Author SHA1 Message Date
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 71adb76f75 Use CFATTACH_DECL(). 2002-09-30 21:57:46 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
martin e4998611e9 Fix copyright notice. 2002-04-14 12:24:26 +00:00
martin 0cdadad2cd Defer initialization of the ISAC chip until we enable interrupts - it gets
into a strange failure mode if we do it with disabled interrupt. When
(re-)enabling interrupts reset transmitter and receiver and clear any
pending state.
2002-04-13 10:28:36 +00:00
martin f12d3f51e7 Remove some redundant tries to disable interupts. We already avoided enabling
them.
Fix a stupid typo when enabling/disabling interrupts: we clear pending
interrupts when enabling, not disbling isac interrupts.
2002-04-10 23:51:06 +00:00
martin 58502ab93e Combine sc_enabled and sc_dying into one field sc_intr_valid, they are used
for the same purpose (ignoring invalid interrupts).

For cards that are not able to stop all interrupts (or we don't know a way
to do that in software, at least) run the clearirq callback even when
ignoring an interrupt because we are not enabled. Otherwise the card would
stop interrupting.

Reserve a driver specific callout handle and an int value in the generic
isic_softc to allow card drivers to implement fancy blinkenlights.
2002-04-08 12:20:49 +00:00
martin e5c92d53f8 Be a nice citizen, enable interrupts only when we are ready to talk
to the ISDN (i.e. when userland has /dev/isdn open).
2002-03-30 19:13:44 +00:00
martin f5e2c967fc Split BRI attaching into two phases, so lower layer drivers can get their
BRI identifier and L3 driver state early on, then finish initializing and
announce the controller to userland when it's ready.
2002-03-29 20:29:53 +00:00
martin 67cbf4c4a8 Rearange things to avoid panics on detaching cards that failed to
attach.
2002-03-29 11:21:23 +00:00
martin ebd73ccd11 After Jason Thorpe explained to me how it is supposed to work, implement
(de)activate for pcmcia cards.
Implement detach/(de)activate for PCI cards.
Clean up internal state (free call-descriptors) if a controller is
detached while it has open connections.
2002-03-27 07:39:35 +00:00
martin a994533d0a Make pcmcia cards detach properly.
Notify userland of attaching/detaching cards.
This partly fixes PR 15951.
2002-03-25 12:07:33 +00:00
martin 0bc69b6498 Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
2002-03-24 20:35:43 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem ab5d9d2b0c add RCSIDs 2001-11-13 07:24:43 +00:00
martin 5171d409a5 First step to cleanup the hardware driver <-> upper layers interface.
This now provides slightly more functionality than the FreeBSD layer1-newbus
interface. It was meant to be a simple change to one header and a few
c files, but the change rippled all through various stuff.

To prevent a change to the kernel<->userland interface right now the kernel
is now lying about card types to userland (but who cares). This will be fixed
when the userland interface changes, after layer 3 <-> layer 4 has been
fixed.

Functional changes:

Provide a clean interface for hardware drivers to attach to the upper
layers. This will need another small change in the B-channel handling
when a similar change to the layer 3 <-> layer 4 interface happens.

Avoid passing indices into global arrays of pointers around, instead pass
the pointers itself. Don't code hardware driver types by predefined magic
numbers (think LKM). Prepare for detachable drivers (think pcmcia).

While there remove some sets of function pointers always pointing to the
same function (meant to be the configurable set of D channel protocol
handlers). It is unlikely another supported D-channel protocol will fit into
that (maximal layer interface) abstraction. When we get support for another
protocol, we will need to come up with a workable interface. Besides, the
old implementation was, uhm, strange.
2001-03-24 12:40:29 +00:00
martin f0d6660cf4 Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.
Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
2001-02-20 22:24:31 +00:00
martin cc812b4ce2 Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
2001-02-18 10:36:42 +00:00