1 /*****************************************************************************
5 * $Date: 2005/06/21 18:29:47 $ *
7 * Generic MAC functionality. *
8 * part of the Chelsio 10Gb Ethernet Driver. *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License, version 2, as *
12 * published by the Free Software Foundation. *
14 * You should have received a copy of the GNU General Public License along *
15 * with this program; if not, see <http://www.gnu.org/licenses/>. *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
21 * http://www.chelsio.com *
23 * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
24 * All rights reserved. *
26 * Maintainers: maintainers@chelsio.com *
28 * Authors: Dimitrios Michailidis <dm@chelsio.com> *
29 * Tina Yang <tainay@chelsio.com> *
30 * Felix Marti <felix@chelsio.com> *
31 * Scott Bardone <sbardone@chelsio.com> *
32 * Kurt Ottaway <kottaway@chelsio.com> *
33 * Frank DiMambro <frank@chelsio.com> *
37 ****************************************************************************/
45 MAC_STATS_UPDATE_FAST
,
54 struct cmac_statistics
{
58 u64 TxUnicastFramesOK
;
59 u64 TxMulticastFramesOK
;
60 u64 TxBroadcastFramesOK
;
62 u64 TxFramesWithDeferredXmissions
;
64 u64 TxTotalCollisions
;
65 u64 TxFramesAbortedDueToXSCollisions
;
68 u64 TxInternalMACXmitError
;
69 u64 TxFramesWithExcessiveDeferral
;
77 u64 RxUnicastFramesOK
;
78 u64 RxMulticastFramesOK
;
79 u64 RxBroadcastFramesOK
;
88 u64 RxInternalMACRcvError
;
89 u64 RxInRangeLengthErrors
;
90 u64 RxOutOfRangeLengthField
;
91 u64 RxFrameTooLongErrors
;
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
*);
104 int (*enable
)(struct cmac
*, int);
105 int (*disable
)(struct cmac
*, int);
107 int (*loopback_enable
)(struct cmac
*);
108 int (*loopback_disable
)(struct cmac
*);
110 int (*set_mtu
)(struct cmac
*, int mtu
);
111 int (*set_rx_mode
)(struct cmac
*, struct t1_rx_mode
*rm
);
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
,
117 const struct cmac_statistics
*(*statistics_update
)(struct cmac
*, int);
119 int (*macaddress_get
)(struct cmac
*, u8 mac_addr
[6]);
120 int (*macaddress_set
)(struct cmac
*, u8 mac_addr
[6]);
123 typedef struct _cmac_instance cmac_instance
;
126 struct cmac_statistics stats
;
128 const struct cmac_ops
*ops
;
129 cmac_instance
*instance
;
133 unsigned int stats_update_period
;
134 struct cmac
*(*create
)(adapter_t
*adapter
, int index
);
135 int (*reset
)(adapter_t
*);
138 extern const struct gmac t1_pm3393_ops
;
139 extern const struct gmac t1_vsc7326_ops
;
141 #endif /* _CXGB_GMAC_H_ */