1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*****************************************************************************
6 * $Date: 2005/06/21 18:29:47 $ *
8 * Generic MAC functionality. *
9 * part of the Chelsio 10Gb Ethernet Driver. *
12 * http://www.chelsio.com *
14 * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
15 * All rights reserved. *
17 * Maintainers: maintainers@chelsio.com *
19 * Authors: Dimitrios Michailidis <dm@chelsio.com> *
20 * Tina Yang <tainay@chelsio.com> *
21 * Felix Marti <felix@chelsio.com> *
22 * Scott Bardone <sbardone@chelsio.com> *
23 * Kurt Ottaway <kottaway@chelsio.com> *
24 * Frank DiMambro <frank@chelsio.com> *
28 ****************************************************************************/
36 MAC_STATS_UPDATE_FAST,
45 struct cmac_statistics {
49 u64 TxUnicastFramesOK;
50 u64 TxMulticastFramesOK;
51 u64 TxBroadcastFramesOK;
53 u64 TxFramesWithDeferredXmissions;
55 u64 TxTotalCollisions;
56 u64 TxFramesAbortedDueToXSCollisions;
59 u64 TxInternalMACXmitError;
60 u64 TxFramesWithExcessiveDeferral;
68 u64 RxUnicastFramesOK;
69 u64 RxMulticastFramesOK;
70 u64 RxBroadcastFramesOK;
79 u64 RxInternalMACRcvError;
80 u64 RxInRangeLengthErrors;
81 u64 RxOutOfRangeLengthField;
82 u64 RxFrameTooLongErrors;
88 void (*destroy)(struct cmac *);
89 int (*reset)(struct cmac *);
90 int (*interrupt_enable)(struct cmac *);
91 int (*interrupt_disable)(struct cmac *);
92 int (*interrupt_clear)(struct cmac *);
93 int (*interrupt_handler)(struct cmac *);
95 int (*enable)(struct cmac *, int);
96 int (*disable)(struct cmac *, int);
98 int (*loopback_enable)(struct cmac *);
99 int (*loopback_disable)(struct cmac *);
101 int (*set_mtu)(struct cmac *, int mtu);
102 int (*set_rx_mode)(struct cmac *, struct t1_rx_mode *rm);
104 int (*set_speed_duplex_fc)(struct cmac *, int speed, int duplex, int fc);
105 int (*get_speed_duplex_fc)(struct cmac *, int *speed, int *duplex,
108 const struct cmac_statistics *(*statistics_update)(struct cmac *, int);
110 int (*macaddress_get)(struct cmac *, u8 mac_addr[6]);
111 int (*macaddress_set)(struct cmac *, const u8 mac_addr[6]);
114 typedef struct _cmac_instance cmac_instance;
117 struct cmac_statistics stats;
119 const struct cmac_ops *ops;
120 cmac_instance *instance;
124 unsigned int stats_update_period;
125 struct cmac *(*create)(adapter_t *adapter, int index);
126 int (*reset)(adapter_t *);
129 extern const struct gmac t1_pm3393_ops;
130 extern const struct gmac t1_vsc7326_ops;
132 #endif /* _CXGB_GMAC_H_ */