1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 #ifndef _CXGB_GMAC_H_
40 #define _CXGB_GMAC_H_
41
42 #include "common.h"
43
44 enum {
45 MAC_STATS_UPDATE_FAST,
46 MAC_STATS_UPDATE_FULL
47 };
48
49 enum {
50 MAC_DIRECTION_RX = 1,
51 MAC_DIRECTION_TX = 2
52 };
53
54 struct cmac_statistics {
55
56 u64 TxOctetsOK;
57 u64 TxOctetsBad;
58 u64 TxUnicastFramesOK;
59 u64 TxMulticastFramesOK;
60 u64 TxBroadcastFramesOK;
61 u64 TxPauseFrames;
62 u64 TxFramesWithDeferredXmissions;
63 u64 TxLateCollisions;
64 u64 TxTotalCollisions;
65 u64 TxFramesAbortedDueToXSCollisions;
66 u64 TxUnderrun;
67 u64 TxLengthErrors;
68 u64 TxInternalMACXmitError;
69 u64 TxFramesWithExcessiveDeferral;
70 u64 TxFCSErrors;
71 u64 TxJumboFramesOK;
72 u64 TxJumboOctetsOK;
73
74
75 u64 RxOctetsOK;
76 u64 RxOctetsBad;
77 u64 RxUnicastFramesOK;
78 u64 RxMulticastFramesOK;
79 u64 RxBroadcastFramesOK;
80 u64 RxPauseFrames;
81 u64 RxFCSErrors;
82 u64 RxAlignErrors;
83 u64 RxSymbolErrors;
84 u64 RxDataErrors;
85 u64 RxSequenceErrors;
86 u64 RxRuntErrors;
87 u64 RxJabberErrors;
88 u64 RxInternalMACRcvError;
89 u64 RxInRangeLengthErrors;
90 u64 RxOutOfRangeLengthField;
91 u64 RxFrameTooLongErrors;
92 u64 RxJumboFramesOK;
93 u64 RxJumboOctetsOK;
94 };
95
96 struct cmac_ops {
97 void (*destroy)(struct cmac *);
98 int (*reset)(struct cmac *);
99 int (*interrupt_enable)(struct cmac *);
100 int (*interrupt_disable)(struct cmac *);
101 int (*interrupt_clear)(struct cmac *);
102 int (*interrupt_handler)(struct cmac *);
103
104 int (*enable)(struct cmac *, int);
105 int (*disable)(struct cmac *, int);
106
107 int (*loopback_enable)(struct cmac *);
108 int (*loopback_disable)(struct cmac *);
109
110 int (*set_mtu)(struct cmac *, int mtu);
111 int (*set_rx_mode)(struct cmac *, struct t1_rx_mode *rm);
112
113 int (*set_speed_duplex_fc)(struct cmac *, int speed, int duplex, int fc);
114 int (*get_speed_duplex_fc)(struct cmac *, int *speed, int *duplex,
115 int *fc);
116
117 const struct cmac_statistics *(*statistics_update)(struct cmac *, int);
118
119 int (*macaddress_get)(struct cmac *, u8 mac_addr[6]);
120 int (*macaddress_set)(struct cmac *, u8 mac_addr[6]);
121 };
122
123 typedef struct _cmac_instance cmac_instance;
124
125 struct cmac {
126 struct cmac_statistics stats;
127 adapter_t *adapter;
128 const struct cmac_ops *ops;
129 cmac_instance *instance;
130 };
131
132 struct gmac {
133 unsigned int stats_update_period;
134 struct cmac *(*create)(adapter_t *adapter, int index);
135 int (*reset)(adapter_t *);
136 };
137
138 extern const struct gmac t1_pm3393_ops;
139 extern const struct gmac t1_vsc7326_ops;
140
141 #endif