summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-01-09 15:01:42 +0000
committerjlemon <jlemon@FreeBSD.org>2001-01-09 15:01:42 +0000
commitf18f07f6e88b0063e7dc12dc34559e7332d67f82 (patch)
treedd7c7cab496e3207304369c55c867dd857b188bc /sys/i4b/layer1
parentb14251832e0e7c2824de3033edbfff66e683d5c9 (diff)
downloadFreeBSD-src-f18f07f6e88b0063e7dc12dc34559e7332d67f82.zip
FreeBSD-src-f18f07f6e88b0063e7dc12dc34559e7332d67f82.tar.gz
Move the mutex initialization from avma1pp_bchannel_setup into
avma1pp_attach_avma1pp, since the former may be called multiple times and we only want to initialize the mutex once. Submitted by: Thomas Moestl <tmoestl@gmx.net>
Diffstat (limited to 'sys/i4b/layer1')
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_pci.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
index 6fb3c11..06f8d9d 100644
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
+++ b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
@@ -495,6 +495,7 @@ avma1pp_attach_avma1pp(device_t dev)
void *ih = 0;
bus_space_handle_t bhandle;
bus_space_tag_t btag;
+ l1_bchan_state_t *chan;
s = splimp();
@@ -647,6 +648,14 @@ avma1pp_attach_avma1pp(device_t dev)
/* init the ISAC */
ifpi_isac_init(sc);
+ /* Init the channel mutexes */
+ chan = &sc->sc_chan[HSCX_CH_A];
+ mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
+ mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF);
+ 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);
+
/* init the "HSCX" */
avma1pp_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
@@ -1118,7 +1127,6 @@ avma1pp_bchannel_setup(int unit, int h_chan, int bprot, int activate)
/* receiver part */
chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF);
i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
@@ -1133,7 +1141,6 @@ avma1pp_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_avma1pp_tx", MTX_DEF);
i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
OpenPOWER on IntegriCloud