13 #include <linux/netdevice.h>
14 #include <linux/types.h>
15 #include <linux/errno.h>
20 static int dc_init_descriptor_list(
struct channel *
sc);
37 if (sc->
h.command & 16)
40 switch (sc->
h.cache_size) {
79 if (dc_init_descriptor_list(sc) != 0)
103 dev_dbg(&sc->
pdev->dev,
"Start Framer Rx Status = %02X\n", val);
109 dev_dbg(&sc->
pdev->dev,
"Start Framer Rx Status = %02X\n", val);
125 #define MAX_INT_WAIT_CNT 12000
143 if (wcnt >= MAX_INT_WAIT_CNT)
144 dev_warn(&sc->
pdev->dev,
"SBE 2T3E3: Interrupt active too long\n");
156 if (!sc->
ether.interrupt_enable_mask)
159 sc->
ether.interrupt_enable_mask =
171 sc->
ether.interrupt_enable_mask);
177 sc->
ether.interrupt_enable_mask = 0;
218 SBE_2T3E3_21143_VAL_RECEIVE_START);
220 for (i = 0; i < 16; i++) {
228 dev_warn(&sc->
pdev->dev,
"SBE 2T3E3: Rx failed to stop\n");
235 SBE_2T3E3_21143_VAL_RECEIVE_START);
258 SBE_2T3E3_21143_VAL_TRANSMISSION_START);
260 for (i = 0; i < 16; i++) {
268 dev_warn(&sc->
pdev->dev,
"SBE 2T3E3: Tx failed to stop\n");
273 SBE_2T3E3_21143_VAL_TRANSMISSION_START);
312 static int dc_init_descriptor_list(
struct channel *
sc)
321 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: no buffer space for RX ring\n");
331 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: no buffer space for RX ring\n");
341 sc->
ether.rx_ring[
i].rdes1 =
345 if (!(m = dev_alloc_skb(
MCLBYTES))) {
346 for (j = 0; j <
i; j++) {
354 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: token_alloc err:"
355 " no buffer space for RX ring\n");
363 &sc->
ether.rx_ring[(i + 1) % SBE_2T3E3_RX_DESC_RING_SIZE]);
365 sc->
ether.rx_ring[SBE_2T3E3_RX_DESC_RING_SIZE - 1].rdes1 |=
367 sc->
ether.rx_ring_current_read = 0;
376 sc->
ether.tx_ring[
i].tdes0 = 0;
380 sc->
ether.tx_ring[
i].tdes2 = 0;
384 &sc->
ether.tx_ring[(i + 1) % SBE_2T3E3_TX_DESC_RING_SIZE]);
386 sc->
ether.tx_ring[SBE_2T3E3_TX_DESC_RING_SIZE - 1].tdes1 |=
391 sc->
ether.tx_ring_current_read = 0;
392 sc->
ether.tx_ring_current_write = 0;