1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
5 * Copyright (C) 2004, 2005
6 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
15 * #define this to dump device status and queue info during initialization and
18 #undef EP93XX_MAC_DEBUG
21 * Number of descriptor and status entries in our RX queues.
22 * It must be power of 2 !
24 #define NUMRXDESC PKTBUFSRX
27 * Number of descriptor and status entries in our TX queues.
32 * 944 = (1024 - 64) - 16, Fifo size - Minframesize - 16 (Chip FACT)
34 #define TXSTARTMAX 944
37 * Receive descriptor queue entry
39 struct rx_descriptor {
45 * Receive status queue entry
52 #define RX_STATUS_RWE(rx_status) ((rx_status->word1 >> 30) & 0x01)
53 #define RX_STATUS_RFP(rx_status) ((rx_status->word1 >> 31) & 0x01)
54 #define RX_STATUS_FRAME_LEN(rx_status) (rx_status->word2 & 0xFFFF)
57 * Transmit descriptor queue entry
59 struct tx_descriptor {
64 #define TX_DESC_EOF (1 << 31)
67 * Transmit status queue entry
73 #define TX_STATUS_TXWE(tx_status) (((tx_status)->word1 >> 30) & 0x01)
74 #define TX_STATUS_TXFP(tx_status) (((tx_status)->word1 >> 31) & 0x01)
77 * Transmit descriptor queue
79 struct tx_descriptor_queue {
80 struct tx_descriptor *base;
81 struct tx_descriptor *current;
82 struct tx_descriptor *end;
86 * Transmit status queue
88 struct tx_status_queue {
89 struct tx_status *base;
90 volatile struct tx_status *current;
91 struct tx_status *end;
95 * Receive descriptor queue
97 struct rx_descriptor_queue {
98 struct rx_descriptor *base;
99 struct rx_descriptor *current;
100 struct rx_descriptor *end;
104 * Receive status queue
106 struct rx_status_queue {
107 struct rx_status *base;
108 volatile struct rx_status *current;
109 struct rx_status *end;
113 * EP93xx MAC private data structure
116 struct rx_descriptor_queue rx_dq;
117 struct rx_status_queue rx_sq;
118 void *rx_buffer[NUMRXDESC];
120 struct tx_descriptor_queue tx_dq;
121 struct tx_status_queue tx_sq;
123 struct mac_regs *regs;