summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2001-01-15 14:54:43 +0000
committerhm <hm@FreeBSD.org>2001-01-15 14:54:43 +0000
commita4ef9041cb78f9b9d0641fd751c19b431496cd8e (patch)
treecc90bbc6f60312809de9f9bd2e361e6365eb7cf2 /sys/i4b/layer1
parent6948230af2a0bf85cd447c1124448c8b3758cee4 (diff)
downloadFreeBSD-src-a4ef9041cb78f9b9d0641fd751c19b431496cd8e.zip
FreeBSD-src-a4ef9041cb78f9b9d0641fd751c19b431496cd8e.tar.gz
Reenable support for FreeBSD 4.x and possibly the other supported BSD's
Diffstat (limited to 'sys/i4b/layer1')
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_pci.c16
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c25
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_drv.c12
-rw-r--r--sys/i4b/layer1/isic/i4b_bchan.c12
-rw-r--r--sys/i4b/layer1/isic/i4b_hscx.c18
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_bchan.c24
6 files changed, 79 insertions, 28 deletions
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
index 06f8d9d..d14deb4 100644
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
+++ b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
@@ -37,7 +37,7 @@
*
* $FreeBSD$
*
- * last edit-date: [Fri Jun 2 13:58:02 2000]
+ * last edit-date: [Fri Jan 12 17:01:26 2001]
*
*---------------------------------------------------------------------------*/
@@ -648,6 +648,7 @@ avma1pp_attach_avma1pp(device_t dev)
/* init the ISAC */
ifpi_isac_init(sc);
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
/* Init the channel mutexes */
chan = &sc->sc_chan[HSCX_CH_A];
mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
@@ -655,6 +656,7 @@ avma1pp_attach_avma1pp(device_t dev)
chan = &sc->sc_chan[HSCX_CH_B];
mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF);
+#endif
/* init the "HSCX" */
avma1pp_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
@@ -872,8 +874,18 @@ avma1pp_hscx_intr(int h_chan, u_int stat, struct l1_softc *sc)
/* move rx'd data to rx queue */
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
(void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-
+#else
+ if(!(IF_QFULL(&chan->rx_queue)))
+ {
+ IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
+ }
+ else
+ {
+ i4b_Bfreembuf(chan->in_mbuf);
+ }
+#endif
/* signal upper layer that data are available */
(*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
index bc69399..d91f5e1 100644
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
+++ b/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
@@ -33,12 +33,9 @@
* i4b_ifpnp_avm.c: AVM Fritz!Card PnP hardware driver
* ---------------------------------------------------
*
- * $Id: i4b_ifpnp_avm.c,v 1.3 2000/05/29 15:41:41 hm Exp $
- * $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_avm.c,v 1.6 2000/04/18 08:32:32 ust Exp $
- *
* $FreeBSD$
*
- * last edit-date: [Mon May 29 15:24:43 2000]
+ * last edit-date: [Fri Jan 12 17:05:28 2001]
*
*---------------------------------------------------------------------------*/
@@ -798,9 +795,18 @@ avm_pnp_hscx_intr(int h_chan, u_int stat, u_int cnt, struct l1_softc *sc)
activity = ACT_RX;
/* move rx'd data to rx queue */
-
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
(void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-
+#else
+ if(!(IF_QFULL(&chan->rx_queue)))
+ {
+ IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
+ }
+ else
+ {
+ i4b_Bfreembuf(chan->in_mbuf);
+ }
+#endif
/* signal upper layer that data are available */
(*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
@@ -1038,7 +1044,10 @@ avm_pnp_bchannel_setup(int unit, int h_chan, int bprot, int activate)
/* receiver part */
chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
+
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avm_pnp_rx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
@@ -1053,8 +1062,10 @@ avm_pnp_bchannel_setup(int unit, int h_chan, int bprot, int activate)
/* transmitter part */
chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avm_pnp_tx", MTX_DEF);
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
+ mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avm_pnp_tx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
chan->txcount = 0; /* reset tx counter */
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c b/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c
index ebf5cb1..722e856 100644
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c
+++ b/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c
@@ -30,9 +30,7 @@
* Everything which has got anything to do with the
* HFC-1/S/SP chips has been put here.
*
- * last edit-date: [Wed Jul 19 09:39:42 2000]
- *
- * $Id: i4b_ihfc_drv.c,v 1.11 2000/09/19 13:50:36 hm Exp $
+ * last edit-date: [Fri Jan 12 17:06:52 2001]
*
* $FreeBSD$
*
@@ -360,8 +358,10 @@ ihfc_init (ihfc_sc_t *sc, u_char chan, int prot, int activate)
RESET_SOFT_CHAN(sc, chan);
S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN;
- mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", MTX_DEF);
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
+ mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", MTX_DEF);
+#endif
if (!activate) continue;
if (S_HFC & HFC_1)
@@ -383,8 +383,10 @@ ihfc_init (ihfc_sc_t *sc, u_char chan, int prot, int activate)
RESET_SOFT_CHAN(sc, chan);
S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN;
- mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", MTX_DEF);
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
+ mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", MTX_DEF);
+#endif
S_PROT = prot;
if (!activate) continue;
diff --git a/sys/i4b/layer1/isic/i4b_bchan.c b/sys/i4b/layer1/isic/i4b_bchan.c
index c937790..86946f1 100644
--- a/sys/i4b/layer1/isic/i4b_bchan.c
+++ b/sys/i4b/layer1/isic/i4b_bchan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,9 @@
* i4b_bchan.c - B channel handling L1 procedures
* ----------------------------------------------
*
- * $Id: i4b_bchan.c,v 1.6 2000/05/29 15:41:41 hm Exp $
- *
* $FreeBSD$
*
- * last edit-date: [Mon May 29 16:42:26 2000]
+ * last edit-date: [Fri Jan 12 16:52:15 2001]
*
*---------------------------------------------------------------------------*/
@@ -92,7 +90,10 @@ isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
/* receiver part */
chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
+
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
mtx_init(&chan->rx_queue.ifq_mtx, "i4b_isic_rx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
@@ -107,7 +108,10 @@ isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
/* transmitter part */
chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
+
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
mtx_init(&chan->tx_queue.ifq_mtx, "i4b_isic_tx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
diff --git a/sys/i4b/layer1/isic/i4b_hscx.c b/sys/i4b/layer1/isic/i4b_hscx.c
index 79e74b8..6383cba 100644
--- a/sys/i4b/layer1/isic/i4b_hscx.c
+++ b/sys/i4b/layer1/isic/i4b_hscx.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,9 @@
* i4b - Siemens HSCX chip (B-channel) handling
* --------------------------------------------
*
- * $Id: i4b_hscx.c,v 1.7 2000/05/29 15:41:41 hm Exp $
- *
* $FreeBSD$
*
- * last edit-date: [Mon May 29 16:44:50 2000]
+ * last edit-date: [Mon Jan 15 15:50:42 2001]
*
*---------------------------------------------------------------------------*/
@@ -270,8 +268,18 @@ isic_hscx_irq(register struct l1_softc *sc, u_char ista, int h_chan, u_char ex_i
if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
activity = ACT_RX;
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
(void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-
+#else
+ if(!(IF_QFULL(&chan->rx_queue)))
+ {
+ IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
+ }
+ else
+ {
+ i4b_Bfreembuf(chan->in_mbuf);
+ }
+#endif
/* signal upper driver that data is available */
(*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c b/sys/i4b/layer1/iwic/i4b_iwic_bchan.c
index 0b8fa26..a636f24 100644
--- a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c
+++ b/sys/i4b/layer1/iwic/i4b_iwic_bchan.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
*
- * Copyright (c) 2000 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 2000, 2001 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,11 +29,9 @@
* i4b_iwic - isdn4bsd Winbond W6692 driver
* ----------------------------------------
*
- * $Id: i4b_iwic_bchan.c,v 1.8 2000/05/29 15:41:42 hm Exp $
- *
* $FreeBSD$
*
- * last edit-date: [Mon May 29 16:48:56 2000]
+ * last edit-date: [Fri Jan 12 16:57:01 2001]
*
*---------------------------------------------------------------------------*/
@@ -239,8 +237,18 @@ iwic_bchan_xirq(struct iwic_softc *sc, int chan_no)
if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
activity = ACT_RX;
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
(void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-
+#else
+ if(!(IF_QFULL(&chan->rx_queue)))
+ {
+ IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
+ }
+ else
+ {
+ i4b_Bfreembuf(chan->in_mbuf);
+ }
+#endif
/* signal upper driver that data is available */
(*chan->iwic_drvr_linktab->bch_rx_data_ready)(chan->iwic_drvr_linktab->unit);
@@ -410,7 +418,10 @@ iwic_bchannel_setup(int unit, int chan_no, int bprot, int activate)
/* receiver part */
chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
+
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
mtx_init(&chan->rx_queue.ifq_mtx, "i4b_iwic_rx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
@@ -425,7 +436,10 @@ iwic_bchannel_setup(int unit, int chan_no, int bprot, int activate)
/* transmitter part */
chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
+
+#if defined (__FreeBSD__) && __FreeBSD__ > 4
mtx_init(&chan->tx_queue.ifq_mtx, "i4b_iwic_tx", MTX_DEF);
+#endif
i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
OpenPOWER on IntegriCloud