ia64/linux-2.6.18-xen.hg

annotate drivers/net/chelsio/gmac.h @ 912:dd42cdb0ab89

[IA64] Build blktap2 driver by default in x86 builds.

add CONFIG_XEN_BLKDEV_TAP2=y to buildconfigs/linux-defconfig_xen_ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 12:09:16 2009 +0900 (2009-06-29)
parents 831230e53067
children
rev   line source
ian@0 1 /*****************************************************************************
ian@0 2 * *
ian@0 3 * File: gmac.h *
ian@0 4 * $Revision: 1.6 $ *
ian@0 5 * $Date: 2005/06/21 18:29:47 $ *
ian@0 6 * Description: *
ian@0 7 * Generic MAC functionality. *
ian@0 8 * part of the Chelsio 10Gb Ethernet Driver. *
ian@0 9 * *
ian@0 10 * This program is free software; you can redistribute it and/or modify *
ian@0 11 * it under the terms of the GNU General Public License, version 2, as *
ian@0 12 * published by the Free Software Foundation. *
ian@0 13 * *
ian@0 14 * You should have received a copy of the GNU General Public License along *
ian@0 15 * with this program; if not, write to the Free Software Foundation, Inc., *
ian@0 16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
ian@0 17 * *
ian@0 18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
ian@0 19 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
ian@0 20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
ian@0 21 * *
ian@0 22 * http://www.chelsio.com *
ian@0 23 * *
ian@0 24 * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
ian@0 25 * All rights reserved. *
ian@0 26 * *
ian@0 27 * Maintainers: maintainers@chelsio.com *
ian@0 28 * *
ian@0 29 * Authors: Dimitrios Michailidis <dm@chelsio.com> *
ian@0 30 * Tina Yang <tainay@chelsio.com> *
ian@0 31 * Felix Marti <felix@chelsio.com> *
ian@0 32 * Scott Bardone <sbardone@chelsio.com> *
ian@0 33 * Kurt Ottaway <kottaway@chelsio.com> *
ian@0 34 * Frank DiMambro <frank@chelsio.com> *
ian@0 35 * *
ian@0 36 * History: *
ian@0 37 * *
ian@0 38 ****************************************************************************/
ian@0 39
ian@0 40 #ifndef _CXGB_GMAC_H_
ian@0 41 #define _CXGB_GMAC_H_
ian@0 42
ian@0 43 #include "common.h"
ian@0 44
ian@0 45 enum { MAC_STATS_UPDATE_FAST, MAC_STATS_UPDATE_FULL };
ian@0 46 enum { MAC_DIRECTION_RX = 1, MAC_DIRECTION_TX = 2 };
ian@0 47
ian@0 48 struct cmac_statistics {
ian@0 49 /* Transmit */
ian@0 50 u64 TxOctetsOK;
ian@0 51 u64 TxOctetsBad;
ian@0 52 u64 TxUnicastFramesOK;
ian@0 53 u64 TxMulticastFramesOK;
ian@0 54 u64 TxBroadcastFramesOK;
ian@0 55 u64 TxPauseFrames;
ian@0 56 u64 TxFramesWithDeferredXmissions;
ian@0 57 u64 TxLateCollisions;
ian@0 58 u64 TxTotalCollisions;
ian@0 59 u64 TxFramesAbortedDueToXSCollisions;
ian@0 60 u64 TxUnderrun;
ian@0 61 u64 TxLengthErrors;
ian@0 62 u64 TxInternalMACXmitError;
ian@0 63 u64 TxFramesWithExcessiveDeferral;
ian@0 64 u64 TxFCSErrors;
ian@0 65
ian@0 66 /* Receive */
ian@0 67 u64 RxOctetsOK;
ian@0 68 u64 RxOctetsBad;
ian@0 69 u64 RxUnicastFramesOK;
ian@0 70 u64 RxMulticastFramesOK;
ian@0 71 u64 RxBroadcastFramesOK;
ian@0 72 u64 RxPauseFrames;
ian@0 73 u64 RxFCSErrors;
ian@0 74 u64 RxAlignErrors;
ian@0 75 u64 RxSymbolErrors;
ian@0 76 u64 RxDataErrors;
ian@0 77 u64 RxSequenceErrors;
ian@0 78 u64 RxRuntErrors;
ian@0 79 u64 RxJabberErrors;
ian@0 80 u64 RxInternalMACRcvError;
ian@0 81 u64 RxInRangeLengthErrors;
ian@0 82 u64 RxOutOfRangeLengthField;
ian@0 83 u64 RxFrameTooLongErrors;
ian@0 84 };
ian@0 85
ian@0 86 struct cmac_ops {
ian@0 87 void (*destroy)(struct cmac *);
ian@0 88 int (*reset)(struct cmac *);
ian@0 89 int (*interrupt_enable)(struct cmac *);
ian@0 90 int (*interrupt_disable)(struct cmac *);
ian@0 91 int (*interrupt_clear)(struct cmac *);
ian@0 92 int (*interrupt_handler)(struct cmac *);
ian@0 93
ian@0 94 int (*enable)(struct cmac *, int);
ian@0 95 int (*disable)(struct cmac *, int);
ian@0 96
ian@0 97 int (*loopback_enable)(struct cmac *);
ian@0 98 int (*loopback_disable)(struct cmac *);
ian@0 99
ian@0 100 int (*set_mtu)(struct cmac *, int mtu);
ian@0 101 int (*set_rx_mode)(struct cmac *, struct t1_rx_mode *rm);
ian@0 102
ian@0 103 int (*set_speed_duplex_fc)(struct cmac *, int speed, int duplex, int fc);
ian@0 104 int (*get_speed_duplex_fc)(struct cmac *, int *speed, int *duplex,
ian@0 105 int *fc);
ian@0 106
ian@0 107 const struct cmac_statistics *(*statistics_update)(struct cmac *, int);
ian@0 108
ian@0 109 int (*macaddress_get)(struct cmac *, u8 mac_addr[6]);
ian@0 110 int (*macaddress_set)(struct cmac *, u8 mac_addr[6]);
ian@0 111 };
ian@0 112
ian@0 113 typedef struct _cmac_instance cmac_instance;
ian@0 114
ian@0 115 struct cmac {
ian@0 116 struct cmac_statistics stats;
ian@0 117 adapter_t *adapter;
ian@0 118 struct cmac_ops *ops;
ian@0 119 cmac_instance *instance;
ian@0 120 };
ian@0 121
ian@0 122 struct gmac {
ian@0 123 unsigned int stats_update_period;
ian@0 124 struct cmac *(*create)(adapter_t *adapter, int index);
ian@0 125 int (*reset)(adapter_t *);
ian@0 126 };
ian@0 127
ian@0 128 extern struct gmac t1_pm3393_ops;
ian@0 129 extern struct gmac t1_chelsio_mac_ops;
ian@0 130 extern struct gmac t1_vsc7321_ops;
ian@0 131 extern struct gmac t1_ixf1010_ops;
ian@0 132 extern struct gmac t1_dummy_mac_ops;
ian@0 133
ian@0 134 #endif /* _CXGB_GMAC_H_ */