forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/ethernet/8390/8390.h
....@@ -1,8 +1,10 @@
11 /* Generic NS8390 register definitions. */
2
+
23 /* This file is part of Donald Becker's 8390 drivers, and is distributed
3
- under the same license. Auto-loading of 8390.o only in v2.2 - Paul G.
4
- Some of these names and comments originated from the Crynwr
5
- packet drivers, which are distributed under the GPL. */
4
+ * under the same license. Auto-loading of 8390.o only in v2.2 - Paul G.
5
+ * Some of these names and comments originated from the Crynwr
6
+ * packet drivers, which are distributed under the GPL.
7
+ */
68
79 #ifndef _8390_h
810 #define _8390_h
....@@ -16,9 +18,9 @@
1618
1719 /* The 8390 specific per-packet-header format. */
1820 struct e8390_pkt_hdr {
19
- unsigned char status; /* status */
20
- unsigned char next; /* pointer to next packet. */
21
- unsigned short count; /* header + packet length in bytes */
21
+ unsigned char status; /* status */
22
+ unsigned char next; /* pointer to next packet. */
23
+ unsigned short count; /* header + packet length in bytes */
2224 };
2325
2426 #ifdef CONFIG_NET_POLL_CONTROLLER
....@@ -32,7 +34,7 @@
3234 int ei_open(struct net_device *dev);
3335 int ei_close(struct net_device *dev);
3436 irqreturn_t ei_interrupt(int irq, void *dev_id);
35
-void ei_tx_timeout(struct net_device *dev);
37
+void ei_tx_timeout(struct net_device *dev, unsigned int txqueue);
3638 netdev_tx_t ei_start_xmit(struct sk_buff *skb, struct net_device *dev);
3739 void ei_set_multicast_list(struct net_device *dev);
3840 struct net_device_stats *ei_get_stats(struct net_device *dev);
....@@ -50,7 +52,7 @@
5052 int eip_open(struct net_device *dev);
5153 int eip_close(struct net_device *dev);
5254 irqreturn_t eip_interrupt(int irq, void *dev_id);
53
-void eip_tx_timeout(struct net_device *dev);
55
+void eip_tx_timeout(struct net_device *dev, unsigned int txqueue);
5456 netdev_tx_t eip_start_xmit(struct sk_buff *skb, struct net_device *dev);
5557 void eip_set_multicast_list(struct net_device *dev);
5658 struct net_device_stats *eip_get_stats(struct net_device *dev);
....@@ -66,18 +68,24 @@
6668 /* You have one of these per-board */
6769 struct ei_device {
6870 const char *name;
69
- void (*reset_8390)(struct net_device *);
70
- void (*get_8390_hdr)(struct net_device *, struct e8390_pkt_hdr *, int);
71
- void (*block_output)(struct net_device *, int, const unsigned char *, int);
72
- void (*block_input)(struct net_device *, int, struct sk_buff *, int);
71
+ void (*reset_8390)(struct net_device *dev);
72
+ void (*get_8390_hdr)(struct net_device *dev,
73
+ struct e8390_pkt_hdr *hdr, int ring_page);
74
+ void (*block_output)(struct net_device *dev, int count,
75
+ const unsigned char *buf, int start_page);
76
+ void (*block_input)(struct net_device *dev, int count,
77
+ struct sk_buff *skb, int ring_offset);
7378 unsigned long rmem_start;
7479 unsigned long rmem_end;
7580 void __iomem *mem;
7681 unsigned char mcfilter[8];
7782 unsigned open:1;
78
- unsigned word16:1; /* We have the 16-bit (vs 8-bit) version of the card. */
79
- unsigned bigendian:1; /* 16-bit big endian mode. Do NOT */
80
- /* set this on random 8390 clones! */
83
+ unsigned word16:1; /* We have the 16-bit (vs 8-bit)
84
+ * version of the card.
85
+ */
86
+ unsigned bigendian:1; /* 16-bit big endian mode. Do NOT
87
+ * set this on random 8390 clones!
88
+ */
8189 unsigned txing:1; /* Transmit Active */
8290 unsigned irqlock:1; /* 8390's intrs disabled when '1'. */
8391 unsigned dmaing:1; /* Remote DMA Active */
....@@ -115,12 +123,16 @@
115123 #define E8390_RXCONFIG (ei_status.rxcr_base | 0x04)
116124 #define E8390_RXOFF (ei_status.rxcr_base | 0x20)
117125 #else
118
-#define E8390_RXCONFIG 0x4 /* EN0_RXCR: broadcasts, no multicast,errors */
119
-#define E8390_RXOFF 0x20 /* EN0_RXCR: Accept no packets */
126
+/* EN0_RXCR: broadcasts, no multicast,errors */
127
+#define E8390_RXCONFIG 0x4
128
+/* EN0_RXCR: Accept no packets */
129
+#define E8390_RXOFF 0x20
120130 #endif
121131
122
-#define E8390_TXCONFIG 0x00 /* EN0_TXCR: Normal transmit mode */
123
-#define E8390_TXOFF 0x02 /* EN0_TXCR: Transmitter off */
132
+/* EN0_TXCR: Normal transmit mode */
133
+#define E8390_TXCONFIG 0x00
134
+/* EN0_TXCR: Transmitter off */
135
+#define E8390_TXOFF 0x02
124136
125137
126138 /* Register accessed at EN_CMD, the 8390 base addr. */
....@@ -134,17 +146,16 @@
134146 #define E8390_PAGE1 0x40 /* using the two high-order bits */
135147 #define E8390_PAGE2 0x80 /* Page 3 is invalid. */
136148
137
-/*
138
- * Only generate indirect loads given a machine that needs them.
139
- * - removed AMIGA_PCMCIA from this list, handled as ISA io now
140
- * - the _p for generates no delay by default 8390p.c overrides this.
149
+/* Only generate indirect loads given a machine that needs them.
150
+ * - removed AMIGA_PCMCIA from this list, handled as ISA io now
151
+ * - the _p for generates no delay by default 8390p.c overrides this.
141152 */
142153
143154 #ifndef ei_inb
144155 #define ei_inb(_p) inb(_p)
145
-#define ei_outb(_v,_p) outb(_v,_p)
156
+#define ei_outb(_v, _p) outb(_v, _p)
146157 #define ei_inb_p(_p) inb(_p)
147
-#define ei_outb_p(_v,_p) outb(_v,_p)
158
+#define ei_outb_p(_v, _p) outb(_v, _p)
148159 #endif
149160
150161 #ifndef EI_SHIFT
....@@ -153,9 +164,9 @@
153164
154165 #define E8390_CMD EI_SHIFT(0x00) /* The command register (for all pages) */
155166 /* Page 0 register offsets. */
156
-#define EN0_CLDALO EI_SHIFT(0x01) /* Low byte of current local dma addr RD */
167
+#define EN0_CLDALO EI_SHIFT(0x01) /* Low byte of current local dma addr RD */
157168 #define EN0_STARTPG EI_SHIFT(0x01) /* Starting page of ring bfr WR */
158
-#define EN0_CLDAHI EI_SHIFT(0x02) /* High byte of current local dma addr RD */
169
+#define EN0_CLDAHI EI_SHIFT(0x02) /* High byte of current local dma addr RD */
159170 #define EN0_STOPPG EI_SHIFT(0x02) /* Ending page +1 of ring bfr WR */
160171 #define EN0_BOUNDARY EI_SHIFT(0x03) /* Boundary page of ring bfr RD WR */
161172 #define EN0_TSR EI_SHIFT(0x04) /* Transmit status reg RD */