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, write to the Free Software Foundation, Inc., *
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
19 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
22 * http://www.chelsio.com *
24 * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
25 * All rights reserved. *
27 * Maintainers: maintainers@chelsio.com *
29 * Authors: Dimitrios Michailidis <dm@chelsio.com> *
30 * Tina Yang <tainay@chelsio.com> *
31 * Felix Marti <felix@chelsio.com> *
32 * Scott Bardone <sbardone@chelsio.com> *
33 * Kurt Ottaway <kottaway@chelsio.com> *
34 * Frank DiMambro <frank@chelsio.com> *
38 ****************************************************************************/
45 enum { MAC_STATS_UPDATE_FAST
, MAC_STATS_UPDATE_FULL
};
46 enum { MAC_DIRECTION_RX
= 1, MAC_DIRECTION_TX
= 2 };
48 struct cmac_statistics
{
52 u64 TxUnicastFramesOK
;
53 u64 TxMulticastFramesOK
;
54 u64 TxBroadcastFramesOK
;
56 u64 TxFramesWithDeferredXmissions
;
58 u64 TxTotalCollisions
;
59 u64 TxFramesAbortedDueToXSCollisions
;
62 u64 TxInternalMACXmitError
;
63 u64 TxFramesWithExcessiveDeferral
;
69 u64 RxUnicastFramesOK
;
70 u64 RxMulticastFramesOK
;
71 u64 RxBroadcastFramesOK
;
80 u64 RxInternalMACRcvError
;
81 u64 RxInRangeLengthErrors
;
82 u64 RxOutOfRangeLengthField
;
83 u64 RxFrameTooLongErrors
;
87 void (*destroy
)(struct cmac
*);
88 int (*reset
)(struct cmac
*);
89 int (*interrupt_enable
)(struct cmac
*);
90 int (*interrupt_disable
)(struct cmac
*);
91 int (*interrupt_clear
)(struct cmac
*);
92 int (*interrupt_handler
)(struct cmac
*);
94 int (*enable
)(struct cmac
*, int);
95 int (*disable
)(struct cmac
*, int);
97 int (*loopback_enable
)(struct cmac
*);
98 int (*loopback_disable
)(struct cmac
*);
100 int (*set_mtu
)(struct cmac
*, int mtu
);
101 int (*set_rx_mode
)(struct cmac
*, struct t1_rx_mode
*rm
);
103 int (*set_speed_duplex_fc
)(struct cmac
*, int speed
, int duplex
, int fc
);
104 int (*get_speed_duplex_fc
)(struct cmac
*, int *speed
, int *duplex
,
107 const struct cmac_statistics
*(*statistics_update
)(struct cmac
*, int);
109 int (*macaddress_get
)(struct cmac
*, u8 mac_addr
[6]);
110 int (*macaddress_set
)(struct cmac
*, u8 mac_addr
[6]);
113 typedef struct _cmac_instance cmac_instance
;
116 struct cmac_statistics stats
;
118 struct cmac_ops
*ops
;
119 cmac_instance
*instance
;
123 unsigned int stats_update_period
;
124 struct cmac
*(*create
)(adapter_t
*adapter
, int index
);
125 int (*reset
)(adapter_t
*);
128 extern struct gmac t1_pm3393_ops
;
129 extern struct gmac t1_chelsio_mac_ops
;
130 extern struct gmac t1_vsc7321_ops
;
131 extern struct gmac t1_ixf1010_ops
;
132 extern struct gmac t1_dummy_mac_ops
;
134 #endif /* _CXGB_GMAC_H_ */