1*d39a76e7Sxw161283 /* 2*d39a76e7Sxw161283 * CDDL HEADER START 3*d39a76e7Sxw161283 * 4*d39a76e7Sxw161283 * The contents of this file are subject to the terms of the 5*d39a76e7Sxw161283 * Common Development and Distribution License (the "License"). 6*d39a76e7Sxw161283 * You may not use this file except in compliance with the License. 7*d39a76e7Sxw161283 * 8*d39a76e7Sxw161283 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*d39a76e7Sxw161283 * or http://www.opensolaris.org/os/licensing. 10*d39a76e7Sxw161283 * See the License for the specific language governing permissions 11*d39a76e7Sxw161283 * and limitations under the License. 12*d39a76e7Sxw161283 * 13*d39a76e7Sxw161283 * When distributing Covered Code, include this CDDL HEADER in each 14*d39a76e7Sxw161283 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*d39a76e7Sxw161283 * If applicable, add the following below this CDDL HEADER, with the 16*d39a76e7Sxw161283 * fields enclosed by brackets "[]" replaced with your own identifying 17*d39a76e7Sxw161283 * information: Portions Copyright [yyyy] [name of copyright owner] 18*d39a76e7Sxw161283 * 19*d39a76e7Sxw161283 * CDDL HEADER END 20*d39a76e7Sxw161283 */ 21*d39a76e7Sxw161283 22*d39a76e7Sxw161283 /* 23*d39a76e7Sxw161283 * Copyright (C) 2003-2005 Chelsio Communications. All rights reserved. 24*d39a76e7Sxw161283 */ 25*d39a76e7Sxw161283 26*d39a76e7Sxw161283 #pragma ident "%Z%%M% %I% %E% SMI" /* gmac.h */ 27*d39a76e7Sxw161283 28*d39a76e7Sxw161283 #ifndef CHELSIO_GMAC_H 29*d39a76e7Sxw161283 #define CHELSIO_GMAC_H 30*d39a76e7Sxw161283 31*d39a76e7Sxw161283 #include "common.h" 32*d39a76e7Sxw161283 33*d39a76e7Sxw161283 enum { MAC_STATS_UPDATE_FAST, MAC_STATS_UPDATE_FULL }; 34*d39a76e7Sxw161283 enum { MAC_DIRECTION_RX = 1, MAC_DIRECTION_TX = 2 }; 35*d39a76e7Sxw161283 36*d39a76e7Sxw161283 struct cmac_statistics { 37*d39a76e7Sxw161283 /* Transmit */ 38*d39a76e7Sxw161283 u64 TxOctetsOK; 39*d39a76e7Sxw161283 u64 TxOctetsBad; 40*d39a76e7Sxw161283 u64 TxUnicastFramesOK; 41*d39a76e7Sxw161283 u64 TxMulticastFramesOK; 42*d39a76e7Sxw161283 u64 TxBroadcastFramesOK; 43*d39a76e7Sxw161283 u64 TxPauseFrames; 44*d39a76e7Sxw161283 u64 TxFramesWithDeferredXmissions; 45*d39a76e7Sxw161283 u64 TxLateCollisions; 46*d39a76e7Sxw161283 u64 TxTotalCollisions; 47*d39a76e7Sxw161283 u64 TxFramesAbortedDueToXSCollisions; 48*d39a76e7Sxw161283 u64 TxUnderrun; 49*d39a76e7Sxw161283 u64 TxLengthErrors; 50*d39a76e7Sxw161283 u64 TxInternalMACXmitError; 51*d39a76e7Sxw161283 u64 TxFramesWithExcessiveDeferral; 52*d39a76e7Sxw161283 u64 TxFCSErrors; 53*d39a76e7Sxw161283 u64 TxJumboFramesOK; 54*d39a76e7Sxw161283 u64 TxJumboOctetsOK; 55*d39a76e7Sxw161283 56*d39a76e7Sxw161283 /* Receive */ 57*d39a76e7Sxw161283 u64 RxOctetsOK; 58*d39a76e7Sxw161283 u64 RxOctetsBad; 59*d39a76e7Sxw161283 u64 RxUnicastFramesOK; 60*d39a76e7Sxw161283 u64 RxMulticastFramesOK; 61*d39a76e7Sxw161283 u64 RxBroadcastFramesOK; 62*d39a76e7Sxw161283 u64 RxPauseFrames; 63*d39a76e7Sxw161283 u64 RxFCSErrors; 64*d39a76e7Sxw161283 u64 RxAlignErrors; 65*d39a76e7Sxw161283 u64 RxSymbolErrors; 66*d39a76e7Sxw161283 u64 RxDataErrors; 67*d39a76e7Sxw161283 u64 RxSequenceErrors; 68*d39a76e7Sxw161283 u64 RxRuntErrors; 69*d39a76e7Sxw161283 u64 RxJabberErrors; 70*d39a76e7Sxw161283 u64 RxInternalMACRcvError; 71*d39a76e7Sxw161283 u64 RxInRangeLengthErrors; 72*d39a76e7Sxw161283 u64 RxOutOfRangeLengthField; 73*d39a76e7Sxw161283 u64 RxFrameTooLongErrors; 74*d39a76e7Sxw161283 u64 RxJumboFramesOK; 75*d39a76e7Sxw161283 u64 RxJumboOctetsOK; 76*d39a76e7Sxw161283 }; 77*d39a76e7Sxw161283 78*d39a76e7Sxw161283 struct cmac_ops { 79*d39a76e7Sxw161283 void (*destroy)(struct cmac *); 80*d39a76e7Sxw161283 int (*reset)(struct cmac *); 81*d39a76e7Sxw161283 int (*interrupt_enable)(struct cmac *); 82*d39a76e7Sxw161283 int (*interrupt_disable)(struct cmac *); 83*d39a76e7Sxw161283 int (*interrupt_clear)(struct cmac *); 84*d39a76e7Sxw161283 int (*interrupt_handler)(struct cmac *); 85*d39a76e7Sxw161283 86*d39a76e7Sxw161283 int (*enable)(struct cmac *, int); 87*d39a76e7Sxw161283 int (*disable)(struct cmac *, int); 88*d39a76e7Sxw161283 89*d39a76e7Sxw161283 int (*loopback_enable)(struct cmac *); 90*d39a76e7Sxw161283 int (*loopback_disable)(struct cmac *); 91*d39a76e7Sxw161283 92*d39a76e7Sxw161283 int (*set_mtu)(struct cmac *, int mtu); 93*d39a76e7Sxw161283 int (*set_rx_mode)(struct cmac *, struct t1_rx_mode *rm); 94*d39a76e7Sxw161283 95*d39a76e7Sxw161283 int (*set_speed_duplex_fc)(struct cmac *, int speed, int duplex, int fc); 96*d39a76e7Sxw161283 int (*get_speed_duplex_fc)(struct cmac *, int *speed, int *duplex, 97*d39a76e7Sxw161283 int *fc); 98*d39a76e7Sxw161283 99*d39a76e7Sxw161283 const struct cmac_statistics *(*statistics_update)(struct cmac *, int); 100*d39a76e7Sxw161283 101*d39a76e7Sxw161283 int (*macaddress_get)(struct cmac *, u8 mac_addr[6]); 102*d39a76e7Sxw161283 int (*macaddress_set)(struct cmac *, u8 mac_addr[6]); 103*d39a76e7Sxw161283 }; 104*d39a76e7Sxw161283 105*d39a76e7Sxw161283 typedef struct _cmac_instance cmac_instance; 106*d39a76e7Sxw161283 107*d39a76e7Sxw161283 struct cmac { 108*d39a76e7Sxw161283 struct cmac_statistics stats; 109*d39a76e7Sxw161283 adapter_t *adapter; 110*d39a76e7Sxw161283 struct cmac_ops *ops; 111*d39a76e7Sxw161283 cmac_instance *instance; 112*d39a76e7Sxw161283 }; 113*d39a76e7Sxw161283 114*d39a76e7Sxw161283 struct gmac { 115*d39a76e7Sxw161283 unsigned int stats_update_period; 116*d39a76e7Sxw161283 struct cmac *(*create)(adapter_t *adapter, int index); 117*d39a76e7Sxw161283 int (*reset)(adapter_t *); 118*d39a76e7Sxw161283 }; 119*d39a76e7Sxw161283 120*d39a76e7Sxw161283 extern struct gmac t1_pm3393_ops; 121*d39a76e7Sxw161283 extern struct gmac t1_chelsio_mac_ops; 122*d39a76e7Sxw161283 extern struct gmac t1_vsc7321_ops; 123*d39a76e7Sxw161283 extern struct gmac t1_vsc7326_ops; 124*d39a76e7Sxw161283 extern struct gmac t1_ixf1010_ops; 125*d39a76e7Sxw161283 extern struct gmac t1_dummy_mac_ops; 126*d39a76e7Sxw161283 #endif 127