162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*****************************************************************************
362306a36Sopenharmony_ci *                                                                           *
462306a36Sopenharmony_ci * File: sge.h                                                               *
562306a36Sopenharmony_ci * $Revision: 1.11 $                                                          *
662306a36Sopenharmony_ci * $Date: 2005/06/21 22:10:55 $                                              *
762306a36Sopenharmony_ci * Description:                                                              *
862306a36Sopenharmony_ci *  part of the Chelsio 10Gb Ethernet Driver.                                *
962306a36Sopenharmony_ci *                                                                           *
1062306a36Sopenharmony_ci *                                                                           *
1162306a36Sopenharmony_ci * http://www.chelsio.com                                                    *
1262306a36Sopenharmony_ci *                                                                           *
1362306a36Sopenharmony_ci * Copyright (c) 2003 - 2005 Chelsio Communications, Inc.                    *
1462306a36Sopenharmony_ci * All rights reserved.                                                      *
1562306a36Sopenharmony_ci *                                                                           *
1662306a36Sopenharmony_ci * Maintainers: maintainers@chelsio.com                                      *
1762306a36Sopenharmony_ci *                                                                           *
1862306a36Sopenharmony_ci * Authors: Dimitrios Michailidis   <dm@chelsio.com>                         *
1962306a36Sopenharmony_ci *          Tina Yang               <tainay@chelsio.com>                     *
2062306a36Sopenharmony_ci *          Felix Marti             <felix@chelsio.com>                      *
2162306a36Sopenharmony_ci *          Scott Bardone           <sbardone@chelsio.com>                   *
2262306a36Sopenharmony_ci *          Kurt Ottaway            <kottaway@chelsio.com>                   *
2362306a36Sopenharmony_ci *          Frank DiMambro          <frank@chelsio.com>                      *
2462306a36Sopenharmony_ci *                                                                           *
2562306a36Sopenharmony_ci * History:                                                                  *
2662306a36Sopenharmony_ci *                                                                           *
2762306a36Sopenharmony_ci ****************************************************************************/
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#ifndef _CXGB_SGE_H_
3062306a36Sopenharmony_ci#define _CXGB_SGE_H_
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci#include <linux/types.h>
3362306a36Sopenharmony_ci#include <linux/interrupt.h>
3462306a36Sopenharmony_ci#include <asm/byteorder.h>
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_cistruct sge_intr_counts {
3762306a36Sopenharmony_ci	unsigned int rx_drops;        /* # of packets dropped due to no mem */
3862306a36Sopenharmony_ci	unsigned int pure_rsps;        /* # of non-payload responses */
3962306a36Sopenharmony_ci	unsigned int unhandled_irqs;   /* # of unhandled interrupts */
4062306a36Sopenharmony_ci	unsigned int respQ_empty;      /* # times respQ empty */
4162306a36Sopenharmony_ci	unsigned int respQ_overflow;   /* # respQ overflow (fatal) */
4262306a36Sopenharmony_ci	unsigned int freelistQ_empty;  /* # times freelist empty */
4362306a36Sopenharmony_ci	unsigned int pkt_too_big;      /* packet too large (fatal) */
4462306a36Sopenharmony_ci	unsigned int pkt_mismatch;
4562306a36Sopenharmony_ci	unsigned int cmdQ_full[3];     /* not HW IRQ, host cmdQ[] full */
4662306a36Sopenharmony_ci	unsigned int cmdQ_restarted[3];/* # of times cmdQ X was restarted */
4762306a36Sopenharmony_ci};
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cistruct sge_port_stats {
5062306a36Sopenharmony_ci	u64 rx_cso_good;     /* # of successful RX csum offloads */
5162306a36Sopenharmony_ci	u64 tx_cso;          /* # of TX checksum offloads */
5262306a36Sopenharmony_ci	u64 tx_tso;          /* # of TSO requests */
5362306a36Sopenharmony_ci	u64 vlan_xtract;     /* # of VLAN tag extractions */
5462306a36Sopenharmony_ci	u64 vlan_insert;     /* # of VLAN tag insertions */
5562306a36Sopenharmony_ci	u64 tx_need_hdrroom; /* # of TX skbs in need of more header room */
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cistruct sk_buff;
5962306a36Sopenharmony_cistruct net_device;
6062306a36Sopenharmony_cistruct adapter;
6162306a36Sopenharmony_cistruct sge_params;
6262306a36Sopenharmony_cistruct sge;
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_cistruct sge *t1_sge_create(struct adapter *, struct sge_params *);
6562306a36Sopenharmony_ciint t1_sge_configure(struct sge *, struct sge_params *);
6662306a36Sopenharmony_ciint t1_sge_set_coalesce_params(struct sge *, struct sge_params *);
6762306a36Sopenharmony_civoid t1_sge_destroy(struct sge *);
6862306a36Sopenharmony_ciirqreturn_t t1_interrupt_thread(int irq, void *data);
6962306a36Sopenharmony_ciirqreturn_t t1_interrupt(int irq, void *cookie);
7062306a36Sopenharmony_ciint t1_poll(struct napi_struct *, int);
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_cinetdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
7362306a36Sopenharmony_civoid t1_vlan_mode(struct adapter *adapter, netdev_features_t features);
7462306a36Sopenharmony_civoid t1_sge_start(struct sge *);
7562306a36Sopenharmony_civoid t1_sge_stop(struct sge *);
7662306a36Sopenharmony_cibool t1_sge_intr_error_handler(struct sge *sge);
7762306a36Sopenharmony_civoid t1_sge_intr_enable(struct sge *);
7862306a36Sopenharmony_civoid t1_sge_intr_disable(struct sge *);
7962306a36Sopenharmony_civoid t1_sge_intr_clear(struct sge *);
8062306a36Sopenharmony_ciconst struct sge_intr_counts *t1_sge_get_intr_counts(const struct sge *sge);
8162306a36Sopenharmony_civoid t1_sge_get_port_stats(const struct sge *sge, int port, struct sge_port_stats *);
8262306a36Sopenharmony_ciunsigned int t1_sched_update_parms(struct sge *, unsigned int, unsigned int,
8362306a36Sopenharmony_ci			   unsigned int);
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#endif /* _CXGB_SGE_H_ */
86