2 * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
4 * Copyright (C) 2004, 2005
5 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
7 * SPDX-License-Identifier: GPL-2.0+
16 * #define this to dump device status and queue info during initialization and
19 #undef EP93XX_MAC_DEBUG
22 * Number of descriptor and status entries in our RX queues.
23 * It must be power of 2 !
25 #define NUMRXDESC PKTBUFSRX
28 * Number of descriptor and status entries in our TX queues.
33 * 944 = (1024 - 64) - 16, Fifo size - Minframesize - 16 (Chip FACT)
35 #define TXSTARTMAX 944
38 * Receive descriptor queue entry
40 struct rx_descriptor {
46 * Receive status queue entry
53 #define RX_STATUS_RWE(rx_status) ((rx_status->word1 >> 30) & 0x01)
54 #define RX_STATUS_RFP(rx_status) ((rx_status->word1 >> 31) & 0x01)
55 #define RX_STATUS_FRAME_LEN(rx_status) (rx_status->word2 & 0xFFFF)
58 * Transmit descriptor queue entry
60 struct tx_descriptor {
65 #define TX_DESC_EOF (1 << 31)
68 * Transmit status queue entry
74 #define TX_STATUS_TXWE(tx_status) (((tx_status)->word1 >> 30) & 0x01)
75 #define TX_STATUS_TXFP(tx_status) (((tx_status)->word1 >> 31) & 0x01)
78 * Transmit descriptor queue
80 struct tx_descriptor_queue {
81 struct tx_descriptor *base;
82 struct tx_descriptor *current;
83 struct tx_descriptor *end;
87 * Transmit status queue
89 struct tx_status_queue {
90 struct tx_status *base;
91 volatile struct tx_status *current;
92 struct tx_status *end;
96 * Receive descriptor queue
98 struct rx_descriptor_queue {
99 struct rx_descriptor *base;
100 struct rx_descriptor *current;
101 struct rx_descriptor *end;
105 * Receive status queue
107 struct rx_status_queue {
108 struct rx_status *base;
109 volatile struct rx_status *current;
110 struct rx_status *end;
114 * EP93xx MAC private data structure
117 struct rx_descriptor_queue rx_dq;
118 struct rx_status_queue rx_sq;
119 void *rx_buffer[NUMRXDESC];
121 struct tx_descriptor_queue tx_dq;
122 struct tx_status_queue tx_sq;
124 struct mac_regs *regs;