xref: /OK3568_Linux_fs/kernel/drivers/net/ethernet/chelsio/cxgb/sge.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*****************************************************************************
2*4882a593Smuzhiyun  *                                                                           *
3*4882a593Smuzhiyun  * File: sge.h                                                               *
4*4882a593Smuzhiyun  * $Revision: 1.11 $                                                          *
5*4882a593Smuzhiyun  * $Date: 2005/06/21 22:10:55 $                                              *
6*4882a593Smuzhiyun  * Description:                                                              *
7*4882a593Smuzhiyun  *  part of the Chelsio 10Gb Ethernet Driver.                                *
8*4882a593Smuzhiyun  *                                                                           *
9*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify      *
10*4882a593Smuzhiyun  * it under the terms of the GNU General Public License, version 2, as       *
11*4882a593Smuzhiyun  * published by the Free Software Foundation.                                *
12*4882a593Smuzhiyun  *                                                                           *
13*4882a593Smuzhiyun  * You should have received a copy of the GNU General Public License along   *
14*4882a593Smuzhiyun  * with this program; if not, see <http://www.gnu.org/licenses/>.            *
15*4882a593Smuzhiyun  *                                                                           *
16*4882a593Smuzhiyun  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED    *
17*4882a593Smuzhiyun  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF      *
18*4882a593Smuzhiyun  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.                     *
19*4882a593Smuzhiyun  *                                                                           *
20*4882a593Smuzhiyun  * http://www.chelsio.com                                                    *
21*4882a593Smuzhiyun  *                                                                           *
22*4882a593Smuzhiyun  * Copyright (c) 2003 - 2005 Chelsio Communications, Inc.                    *
23*4882a593Smuzhiyun  * All rights reserved.                                                      *
24*4882a593Smuzhiyun  *                                                                           *
25*4882a593Smuzhiyun  * Maintainers: maintainers@chelsio.com                                      *
26*4882a593Smuzhiyun  *                                                                           *
27*4882a593Smuzhiyun  * Authors: Dimitrios Michailidis   <dm@chelsio.com>                         *
28*4882a593Smuzhiyun  *          Tina Yang               <tainay@chelsio.com>                     *
29*4882a593Smuzhiyun  *          Felix Marti             <felix@chelsio.com>                      *
30*4882a593Smuzhiyun  *          Scott Bardone           <sbardone@chelsio.com>                   *
31*4882a593Smuzhiyun  *          Kurt Ottaway            <kottaway@chelsio.com>                   *
32*4882a593Smuzhiyun  *          Frank DiMambro          <frank@chelsio.com>                      *
33*4882a593Smuzhiyun  *                                                                           *
34*4882a593Smuzhiyun  * History:                                                                  *
35*4882a593Smuzhiyun  *                                                                           *
36*4882a593Smuzhiyun  ****************************************************************************/
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #ifndef _CXGB_SGE_H_
39*4882a593Smuzhiyun #define _CXGB_SGE_H_
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #include <linux/types.h>
42*4882a593Smuzhiyun #include <linux/interrupt.h>
43*4882a593Smuzhiyun #include <asm/byteorder.h>
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun struct sge_intr_counts {
46*4882a593Smuzhiyun 	unsigned int rx_drops;        /* # of packets dropped due to no mem */
47*4882a593Smuzhiyun 	unsigned int pure_rsps;        /* # of non-payload responses */
48*4882a593Smuzhiyun 	unsigned int unhandled_irqs;   /* # of unhandled interrupts */
49*4882a593Smuzhiyun 	unsigned int respQ_empty;      /* # times respQ empty */
50*4882a593Smuzhiyun 	unsigned int respQ_overflow;   /* # respQ overflow (fatal) */
51*4882a593Smuzhiyun 	unsigned int freelistQ_empty;  /* # times freelist empty */
52*4882a593Smuzhiyun 	unsigned int pkt_too_big;      /* packet too large (fatal) */
53*4882a593Smuzhiyun 	unsigned int pkt_mismatch;
54*4882a593Smuzhiyun 	unsigned int cmdQ_full[3];     /* not HW IRQ, host cmdQ[] full */
55*4882a593Smuzhiyun 	unsigned int cmdQ_restarted[3];/* # of times cmdQ X was restarted */
56*4882a593Smuzhiyun };
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun struct sge_port_stats {
59*4882a593Smuzhiyun 	u64 rx_cso_good;     /* # of successful RX csum offloads */
60*4882a593Smuzhiyun 	u64 tx_cso;          /* # of TX checksum offloads */
61*4882a593Smuzhiyun 	u64 tx_tso;          /* # of TSO requests */
62*4882a593Smuzhiyun 	u64 vlan_xtract;     /* # of VLAN tag extractions */
63*4882a593Smuzhiyun 	u64 vlan_insert;     /* # of VLAN tag insertions */
64*4882a593Smuzhiyun 	u64 tx_need_hdrroom; /* # of TX skbs in need of more header room */
65*4882a593Smuzhiyun };
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun struct sk_buff;
68*4882a593Smuzhiyun struct net_device;
69*4882a593Smuzhiyun struct adapter;
70*4882a593Smuzhiyun struct sge_params;
71*4882a593Smuzhiyun struct sge;
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun struct sge *t1_sge_create(struct adapter *, struct sge_params *);
74*4882a593Smuzhiyun int t1_sge_configure(struct sge *, struct sge_params *);
75*4882a593Smuzhiyun int t1_sge_set_coalesce_params(struct sge *, struct sge_params *);
76*4882a593Smuzhiyun void t1_sge_destroy(struct sge *);
77*4882a593Smuzhiyun irqreturn_t t1_interrupt(int irq, void *cookie);
78*4882a593Smuzhiyun int t1_poll(struct napi_struct *, int);
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
81*4882a593Smuzhiyun void t1_vlan_mode(struct adapter *adapter, netdev_features_t features);
82*4882a593Smuzhiyun void t1_sge_start(struct sge *);
83*4882a593Smuzhiyun void t1_sge_stop(struct sge *);
84*4882a593Smuzhiyun int t1_sge_intr_error_handler(struct sge *);
85*4882a593Smuzhiyun void t1_sge_intr_enable(struct sge *);
86*4882a593Smuzhiyun void t1_sge_intr_disable(struct sge *);
87*4882a593Smuzhiyun void t1_sge_intr_clear(struct sge *);
88*4882a593Smuzhiyun const struct sge_intr_counts *t1_sge_get_intr_counts(const struct sge *sge);
89*4882a593Smuzhiyun void t1_sge_get_port_stats(const struct sge *sge, int port, struct sge_port_stats *);
90*4882a593Smuzhiyun unsigned int t1_sched_update_parms(struct sge *, unsigned int, unsigned int,
91*4882a593Smuzhiyun 			   unsigned int);
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun #endif /* _CXGB_SGE_H_ */
94