154e4ee71SNavdeep Parhar /*- 254e4ee71SNavdeep Parhar * Copyright (c) 2011 Chelsio Communications, Inc. 354e4ee71SNavdeep Parhar * All rights reserved. 454e4ee71SNavdeep Parhar * 554e4ee71SNavdeep Parhar * Redistribution and use in source and binary forms, with or without 654e4ee71SNavdeep Parhar * modification, are permitted provided that the following conditions 754e4ee71SNavdeep Parhar * are met: 854e4ee71SNavdeep Parhar * 1. Redistributions of source code must retain the above copyright 954e4ee71SNavdeep Parhar * notice, this list of conditions and the following disclaimer. 1054e4ee71SNavdeep Parhar * 2. Redistributions in binary form must reproduce the above copyright 1154e4ee71SNavdeep Parhar * notice, this list of conditions and the following disclaimer in the 1254e4ee71SNavdeep Parhar * documentation and/or other materials provided with the distribution. 1354e4ee71SNavdeep Parhar * 1454e4ee71SNavdeep Parhar * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1554e4ee71SNavdeep Parhar * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1654e4ee71SNavdeep Parhar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1754e4ee71SNavdeep Parhar * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1854e4ee71SNavdeep Parhar * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1954e4ee71SNavdeep Parhar * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2054e4ee71SNavdeep Parhar * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2154e4ee71SNavdeep Parhar * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2254e4ee71SNavdeep Parhar * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2354e4ee71SNavdeep Parhar * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2454e4ee71SNavdeep Parhar * SUCH DAMAGE. 2554e4ee71SNavdeep Parhar * 2654e4ee71SNavdeep Parhar * $FreeBSD$ 2754e4ee71SNavdeep Parhar * 2854e4ee71SNavdeep Parhar */ 2954e4ee71SNavdeep Parhar 3054e4ee71SNavdeep Parhar #ifndef __CHELSIO_COMMON_H 3154e4ee71SNavdeep Parhar #define __CHELSIO_COMMON_H 3254e4ee71SNavdeep Parhar 3354e4ee71SNavdeep Parhar #include "t4_hw.h" 3454e4ee71SNavdeep Parhar 3554e4ee71SNavdeep Parhar 3654e4ee71SNavdeep Parhar enum { 3754e4ee71SNavdeep Parhar MAX_NPORTS = 4, /* max # of ports */ 3854e4ee71SNavdeep Parhar SERNUM_LEN = 24, /* Serial # length */ 3954e4ee71SNavdeep Parhar EC_LEN = 16, /* E/C length */ 4054e4ee71SNavdeep Parhar ID_LEN = 16, /* ID length */ 412a5f6b0eSNavdeep Parhar PN_LEN = 16, /* Part Number length */ 422a5f6b0eSNavdeep Parhar MACADDR_LEN = 12, /* MAC Address length */ 4354e4ee71SNavdeep Parhar }; 4454e4ee71SNavdeep Parhar 45*d14b0ac1SNavdeep Parhar enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1 }; 4654e4ee71SNavdeep Parhar 47733b9277SNavdeep Parhar enum { 48733b9277SNavdeep Parhar MEMWIN0_APERTURE = 2048, 49733b9277SNavdeep Parhar MEMWIN0_BASE = 0x1b800, 50733b9277SNavdeep Parhar MEMWIN1_APERTURE = 32768, 51733b9277SNavdeep Parhar MEMWIN1_BASE = 0x28000, 52*d14b0ac1SNavdeep Parhar 53*d14b0ac1SNavdeep Parhar MEMWIN2_APERTURE_T4 = 65536, 54*d14b0ac1SNavdeep Parhar MEMWIN2_BASE_T4 = 0x30000, 55*d14b0ac1SNavdeep Parhar 56*d14b0ac1SNavdeep Parhar MEMWIN2_APERTURE_T5 = 128 * 1024, 57*d14b0ac1SNavdeep Parhar MEMWIN2_BASE_T5 = 0x60000, 58733b9277SNavdeep Parhar }; 59733b9277SNavdeep Parhar 6054e4ee71SNavdeep Parhar enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; 6154e4ee71SNavdeep Parhar 6254e4ee71SNavdeep Parhar enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR }; 6354e4ee71SNavdeep Parhar 6454e4ee71SNavdeep Parhar enum { 6554e4ee71SNavdeep Parhar PAUSE_RX = 1 << 0, 6654e4ee71SNavdeep Parhar PAUSE_TX = 1 << 1, 6754e4ee71SNavdeep Parhar PAUSE_AUTONEG = 1 << 2 6854e4ee71SNavdeep Parhar }; 6954e4ee71SNavdeep Parhar 70*d14b0ac1SNavdeep Parhar #define FW_VERSION_MAJOR_T4 1 71*d14b0ac1SNavdeep Parhar #define FW_VERSION_MINOR_T4 8 72*d14b0ac1SNavdeep Parhar #define FW_VERSION_MICRO_T4 4 73*d14b0ac1SNavdeep Parhar #define FW_VERSION_BUILD_T4 0 7454e4ee71SNavdeep Parhar 75*d14b0ac1SNavdeep Parhar #define FW_VERSION_MAJOR_T5 0 76*d14b0ac1SNavdeep Parhar #define FW_VERSION_MINOR_T5 5 77*d14b0ac1SNavdeep Parhar #define FW_VERSION_MICRO_T5 18 78*d14b0ac1SNavdeep Parhar #define FW_VERSION_BUILD_T5 0 79*d14b0ac1SNavdeep Parhar 80*d14b0ac1SNavdeep Parhar struct memwin { 81*d14b0ac1SNavdeep Parhar uint32_t base; 82*d14b0ac1SNavdeep Parhar uint32_t aperture; 83*d14b0ac1SNavdeep Parhar }; 84d78bd33fSNavdeep Parhar 8554e4ee71SNavdeep Parhar struct port_stats { 8654e4ee71SNavdeep Parhar u64 tx_octets; /* total # of octets in good frames */ 8754e4ee71SNavdeep Parhar u64 tx_frames; /* all good frames */ 8854e4ee71SNavdeep Parhar u64 tx_bcast_frames; /* all broadcast frames */ 8954e4ee71SNavdeep Parhar u64 tx_mcast_frames; /* all multicast frames */ 9054e4ee71SNavdeep Parhar u64 tx_ucast_frames; /* all unicast frames */ 9154e4ee71SNavdeep Parhar u64 tx_error_frames; /* all error frames */ 9254e4ee71SNavdeep Parhar 9354e4ee71SNavdeep Parhar u64 tx_frames_64; /* # of Tx frames in a particular range */ 9454e4ee71SNavdeep Parhar u64 tx_frames_65_127; 9554e4ee71SNavdeep Parhar u64 tx_frames_128_255; 9654e4ee71SNavdeep Parhar u64 tx_frames_256_511; 9754e4ee71SNavdeep Parhar u64 tx_frames_512_1023; 9854e4ee71SNavdeep Parhar u64 tx_frames_1024_1518; 9954e4ee71SNavdeep Parhar u64 tx_frames_1519_max; 10054e4ee71SNavdeep Parhar 10154e4ee71SNavdeep Parhar u64 tx_drop; /* # of dropped Tx frames */ 10254e4ee71SNavdeep Parhar u64 tx_pause; /* # of transmitted pause frames */ 10354e4ee71SNavdeep Parhar u64 tx_ppp0; /* # of transmitted PPP prio 0 frames */ 10454e4ee71SNavdeep Parhar u64 tx_ppp1; /* # of transmitted PPP prio 1 frames */ 10554e4ee71SNavdeep Parhar u64 tx_ppp2; /* # of transmitted PPP prio 2 frames */ 10654e4ee71SNavdeep Parhar u64 tx_ppp3; /* # of transmitted PPP prio 3 frames */ 10754e4ee71SNavdeep Parhar u64 tx_ppp4; /* # of transmitted PPP prio 4 frames */ 10854e4ee71SNavdeep Parhar u64 tx_ppp5; /* # of transmitted PPP prio 5 frames */ 10954e4ee71SNavdeep Parhar u64 tx_ppp6; /* # of transmitted PPP prio 6 frames */ 11054e4ee71SNavdeep Parhar u64 tx_ppp7; /* # of transmitted PPP prio 7 frames */ 11154e4ee71SNavdeep Parhar 11254e4ee71SNavdeep Parhar u64 rx_octets; /* total # of octets in good frames */ 11354e4ee71SNavdeep Parhar u64 rx_frames; /* all good frames */ 11454e4ee71SNavdeep Parhar u64 rx_bcast_frames; /* all broadcast frames */ 11554e4ee71SNavdeep Parhar u64 rx_mcast_frames; /* all multicast frames */ 11654e4ee71SNavdeep Parhar u64 rx_ucast_frames; /* all unicast frames */ 11754e4ee71SNavdeep Parhar u64 rx_too_long; /* # of frames exceeding MTU */ 11854e4ee71SNavdeep Parhar u64 rx_jabber; /* # of jabber frames */ 11954e4ee71SNavdeep Parhar u64 rx_fcs_err; /* # of received frames with bad FCS */ 12054e4ee71SNavdeep Parhar u64 rx_len_err; /* # of received frames with length error */ 12154e4ee71SNavdeep Parhar u64 rx_symbol_err; /* symbol errors */ 12254e4ee71SNavdeep Parhar u64 rx_runt; /* # of short frames */ 12354e4ee71SNavdeep Parhar 12454e4ee71SNavdeep Parhar u64 rx_frames_64; /* # of Rx frames in a particular range */ 12554e4ee71SNavdeep Parhar u64 rx_frames_65_127; 12654e4ee71SNavdeep Parhar u64 rx_frames_128_255; 12754e4ee71SNavdeep Parhar u64 rx_frames_256_511; 12854e4ee71SNavdeep Parhar u64 rx_frames_512_1023; 12954e4ee71SNavdeep Parhar u64 rx_frames_1024_1518; 13054e4ee71SNavdeep Parhar u64 rx_frames_1519_max; 13154e4ee71SNavdeep Parhar 13254e4ee71SNavdeep Parhar u64 rx_pause; /* # of received pause frames */ 13354e4ee71SNavdeep Parhar u64 rx_ppp0; /* # of received PPP prio 0 frames */ 13454e4ee71SNavdeep Parhar u64 rx_ppp1; /* # of received PPP prio 1 frames */ 13554e4ee71SNavdeep Parhar u64 rx_ppp2; /* # of received PPP prio 2 frames */ 13654e4ee71SNavdeep Parhar u64 rx_ppp3; /* # of received PPP prio 3 frames */ 13754e4ee71SNavdeep Parhar u64 rx_ppp4; /* # of received PPP prio 4 frames */ 13854e4ee71SNavdeep Parhar u64 rx_ppp5; /* # of received PPP prio 5 frames */ 13954e4ee71SNavdeep Parhar u64 rx_ppp6; /* # of received PPP prio 6 frames */ 14054e4ee71SNavdeep Parhar u64 rx_ppp7; /* # of received PPP prio 7 frames */ 14154e4ee71SNavdeep Parhar 14254e4ee71SNavdeep Parhar u64 rx_ovflow0; /* drops due to buffer-group 0 overflows */ 14354e4ee71SNavdeep Parhar u64 rx_ovflow1; /* drops due to buffer-group 1 overflows */ 14454e4ee71SNavdeep Parhar u64 rx_ovflow2; /* drops due to buffer-group 2 overflows */ 14554e4ee71SNavdeep Parhar u64 rx_ovflow3; /* drops due to buffer-group 3 overflows */ 14654e4ee71SNavdeep Parhar u64 rx_trunc0; /* buffer-group 0 truncated packets */ 14754e4ee71SNavdeep Parhar u64 rx_trunc1; /* buffer-group 1 truncated packets */ 14854e4ee71SNavdeep Parhar u64 rx_trunc2; /* buffer-group 2 truncated packets */ 14954e4ee71SNavdeep Parhar u64 rx_trunc3; /* buffer-group 3 truncated packets */ 15054e4ee71SNavdeep Parhar }; 15154e4ee71SNavdeep Parhar 15254e4ee71SNavdeep Parhar struct lb_port_stats { 15354e4ee71SNavdeep Parhar u64 octets; 15454e4ee71SNavdeep Parhar u64 frames; 15554e4ee71SNavdeep Parhar u64 bcast_frames; 15654e4ee71SNavdeep Parhar u64 mcast_frames; 15754e4ee71SNavdeep Parhar u64 ucast_frames; 15854e4ee71SNavdeep Parhar u64 error_frames; 15954e4ee71SNavdeep Parhar 16054e4ee71SNavdeep Parhar u64 frames_64; 16154e4ee71SNavdeep Parhar u64 frames_65_127; 16254e4ee71SNavdeep Parhar u64 frames_128_255; 16354e4ee71SNavdeep Parhar u64 frames_256_511; 16454e4ee71SNavdeep Parhar u64 frames_512_1023; 16554e4ee71SNavdeep Parhar u64 frames_1024_1518; 16654e4ee71SNavdeep Parhar u64 frames_1519_max; 16754e4ee71SNavdeep Parhar 16854e4ee71SNavdeep Parhar u64 drop; 16954e4ee71SNavdeep Parhar 17054e4ee71SNavdeep Parhar u64 ovflow0; 17154e4ee71SNavdeep Parhar u64 ovflow1; 17254e4ee71SNavdeep Parhar u64 ovflow2; 17354e4ee71SNavdeep Parhar u64 ovflow3; 17454e4ee71SNavdeep Parhar u64 trunc0; 17554e4ee71SNavdeep Parhar u64 trunc1; 17654e4ee71SNavdeep Parhar u64 trunc2; 17754e4ee71SNavdeep Parhar u64 trunc3; 17854e4ee71SNavdeep Parhar }; 17954e4ee71SNavdeep Parhar 18054e4ee71SNavdeep Parhar struct tp_tcp_stats { 18154e4ee71SNavdeep Parhar u32 tcpOutRsts; 18254e4ee71SNavdeep Parhar u64 tcpInSegs; 18354e4ee71SNavdeep Parhar u64 tcpOutSegs; 18454e4ee71SNavdeep Parhar u64 tcpRetransSegs; 18554e4ee71SNavdeep Parhar }; 18654e4ee71SNavdeep Parhar 18754e4ee71SNavdeep Parhar struct tp_usm_stats { 18854e4ee71SNavdeep Parhar u32 frames; 18954e4ee71SNavdeep Parhar u32 drops; 19054e4ee71SNavdeep Parhar u64 octets; 19154e4ee71SNavdeep Parhar }; 19254e4ee71SNavdeep Parhar 19354e4ee71SNavdeep Parhar struct tp_fcoe_stats { 19454e4ee71SNavdeep Parhar u32 framesDDP; 19554e4ee71SNavdeep Parhar u32 framesDrop; 19654e4ee71SNavdeep Parhar u64 octetsDDP; 19754e4ee71SNavdeep Parhar }; 19854e4ee71SNavdeep Parhar 19954e4ee71SNavdeep Parhar struct tp_err_stats { 20054e4ee71SNavdeep Parhar u32 macInErrs[4]; 20154e4ee71SNavdeep Parhar u32 hdrInErrs[4]; 20254e4ee71SNavdeep Parhar u32 tcpInErrs[4]; 20354e4ee71SNavdeep Parhar u32 tnlCongDrops[4]; 20454e4ee71SNavdeep Parhar u32 ofldChanDrops[4]; 20554e4ee71SNavdeep Parhar u32 tnlTxDrops[4]; 20654e4ee71SNavdeep Parhar u32 ofldVlanDrops[4]; 20754e4ee71SNavdeep Parhar u32 tcp6InErrs[4]; 20854e4ee71SNavdeep Parhar u32 ofldNoNeigh; 20954e4ee71SNavdeep Parhar u32 ofldCongDefer; 21054e4ee71SNavdeep Parhar }; 21154e4ee71SNavdeep Parhar 21254e4ee71SNavdeep Parhar struct tp_proxy_stats { 21354e4ee71SNavdeep Parhar u32 proxy[4]; 21454e4ee71SNavdeep Parhar }; 21554e4ee71SNavdeep Parhar 21654e4ee71SNavdeep Parhar struct tp_cpl_stats { 21754e4ee71SNavdeep Parhar u32 req[4]; 21854e4ee71SNavdeep Parhar u32 rsp[4]; 21954e4ee71SNavdeep Parhar }; 22054e4ee71SNavdeep Parhar 22154e4ee71SNavdeep Parhar struct tp_rdma_stats { 22254e4ee71SNavdeep Parhar u32 rqe_dfr_mod; 22354e4ee71SNavdeep Parhar u32 rqe_dfr_pkt; 22454e4ee71SNavdeep Parhar }; 22554e4ee71SNavdeep Parhar 22654e4ee71SNavdeep Parhar struct tp_params { 22754e4ee71SNavdeep Parhar unsigned int ntxchan; /* # of Tx channels */ 22854e4ee71SNavdeep Parhar unsigned int tre; /* log2 of core clocks per TP tick */ 22954e4ee71SNavdeep Parhar unsigned int dack_re; /* DACK timer resolution */ 23054e4ee71SNavdeep Parhar unsigned int la_mask; /* what events are recorded by TP LA */ 23154e4ee71SNavdeep Parhar unsigned short tx_modq[NCHAN]; /* channel to modulation queue map */ 23254e4ee71SNavdeep Parhar }; 23354e4ee71SNavdeep Parhar 23454e4ee71SNavdeep Parhar struct vpd_params { 23554e4ee71SNavdeep Parhar unsigned int cclk; 23654e4ee71SNavdeep Parhar u8 ec[EC_LEN + 1]; 23754e4ee71SNavdeep Parhar u8 sn[SERNUM_LEN + 1]; 23854e4ee71SNavdeep Parhar u8 id[ID_LEN + 1]; 2392a5f6b0eSNavdeep Parhar u8 pn[PN_LEN + 1]; 2402a5f6b0eSNavdeep Parhar u8 na[MACADDR_LEN + 1]; 24154e4ee71SNavdeep Parhar }; 24254e4ee71SNavdeep Parhar 24354e4ee71SNavdeep Parhar struct pci_params { 24454e4ee71SNavdeep Parhar unsigned int vpd_cap_addr; 245733b9277SNavdeep Parhar unsigned short speed; 246733b9277SNavdeep Parhar unsigned short width; 24754e4ee71SNavdeep Parhar }; 24854e4ee71SNavdeep Parhar 24954e4ee71SNavdeep Parhar /* 25054e4ee71SNavdeep Parhar * Firmware device log. 25154e4ee71SNavdeep Parhar */ 25254e4ee71SNavdeep Parhar struct devlog_params { 25354e4ee71SNavdeep Parhar u32 memtype; /* which memory (EDC0, EDC1, MC) */ 25454e4ee71SNavdeep Parhar u32 start; /* start of log in firmware memory */ 25554e4ee71SNavdeep Parhar u32 size; /* size of log */ 25654e4ee71SNavdeep Parhar }; 25754e4ee71SNavdeep Parhar 25854e4ee71SNavdeep Parhar struct adapter_params { 25954e4ee71SNavdeep Parhar struct tp_params tp; 26054e4ee71SNavdeep Parhar struct vpd_params vpd; 26154e4ee71SNavdeep Parhar struct pci_params pci; 26254e4ee71SNavdeep Parhar struct devlog_params devlog; 26354e4ee71SNavdeep Parhar 26454e4ee71SNavdeep Parhar unsigned int sf_size; /* serial flash size in bytes */ 26554e4ee71SNavdeep Parhar unsigned int sf_nsec; /* # of flash sectors */ 26654e4ee71SNavdeep Parhar 26754e4ee71SNavdeep Parhar unsigned int fw_vers; 26854e4ee71SNavdeep Parhar unsigned int tp_vers; 26954e4ee71SNavdeep Parhar 27054e4ee71SNavdeep Parhar unsigned short mtus[NMTUS]; 27154e4ee71SNavdeep Parhar unsigned short a_wnd[NCCTRL_WIN]; 27254e4ee71SNavdeep Parhar unsigned short b_wnd[NCCTRL_WIN]; 27354e4ee71SNavdeep Parhar 27454e4ee71SNavdeep Parhar unsigned int mc_size; /* MC memory size */ 27554e4ee71SNavdeep Parhar unsigned int nfilters; /* size of filter region */ 27654e4ee71SNavdeep Parhar 27754e4ee71SNavdeep Parhar unsigned int cim_la_size; 27854e4ee71SNavdeep Parhar 279*d14b0ac1SNavdeep Parhar uint8_t nports; /* # of ethernet ports */ 280*d14b0ac1SNavdeep Parhar uint8_t portvec; 281*d14b0ac1SNavdeep Parhar unsigned int chipid:4; /* chip ID. T4 = 4, T5 = 5, ... */ 282*d14b0ac1SNavdeep Parhar unsigned int rev:4; /* chip revision */ 283*d14b0ac1SNavdeep Parhar unsigned int fpga:1; /* this is an FPGA */ 284*d14b0ac1SNavdeep Parhar unsigned int offload:1; /* hw is TOE capable, fw has divvied up card 285*d14b0ac1SNavdeep Parhar resources for TOE operation. */ 286*d14b0ac1SNavdeep Parhar unsigned int bypass:1; /* this is a bypass card */ 28754e4ee71SNavdeep Parhar 28854e4ee71SNavdeep Parhar unsigned int ofldq_wr_cred; 28954e4ee71SNavdeep Parhar }; 29054e4ee71SNavdeep Parhar 291*d14b0ac1SNavdeep Parhar #define CHELSIO_T4 0x4 292*d14b0ac1SNavdeep Parhar #define CHELSIO_T5 0x5 29354e4ee71SNavdeep Parhar 29454e4ee71SNavdeep Parhar struct trace_params { 29554e4ee71SNavdeep Parhar u32 data[TRACE_LEN / 4]; 29654e4ee71SNavdeep Parhar u32 mask[TRACE_LEN / 4]; 29754e4ee71SNavdeep Parhar unsigned short snap_len; 29854e4ee71SNavdeep Parhar unsigned short min_len; 29954e4ee71SNavdeep Parhar unsigned char skip_ofst; 30054e4ee71SNavdeep Parhar unsigned char skip_len; 30154e4ee71SNavdeep Parhar unsigned char invert; 30254e4ee71SNavdeep Parhar unsigned char port; 30354e4ee71SNavdeep Parhar }; 30454e4ee71SNavdeep Parhar 30554e4ee71SNavdeep Parhar struct link_config { 30654e4ee71SNavdeep Parhar unsigned short supported; /* link capabilities */ 30754e4ee71SNavdeep Parhar unsigned short advertising; /* advertised capabilities */ 30854e4ee71SNavdeep Parhar unsigned short requested_speed; /* speed user has requested */ 30954e4ee71SNavdeep Parhar unsigned short speed; /* actual link speed */ 31054e4ee71SNavdeep Parhar unsigned char requested_fc; /* flow control user has requested */ 31154e4ee71SNavdeep Parhar unsigned char fc; /* actual link flow control */ 31254e4ee71SNavdeep Parhar unsigned char autoneg; /* autonegotiating? */ 31354e4ee71SNavdeep Parhar unsigned char link_ok; /* link up? */ 31454e4ee71SNavdeep Parhar }; 31554e4ee71SNavdeep Parhar 31654e4ee71SNavdeep Parhar #include "adapter.h" 31754e4ee71SNavdeep Parhar 31854e4ee71SNavdeep Parhar #ifndef PCI_VENDOR_ID_CHELSIO 31954e4ee71SNavdeep Parhar # define PCI_VENDOR_ID_CHELSIO 0x1425 32054e4ee71SNavdeep Parhar #endif 32154e4ee71SNavdeep Parhar 32254e4ee71SNavdeep Parhar #define for_each_port(adapter, iter) \ 32354e4ee71SNavdeep Parhar for (iter = 0; iter < (adapter)->params.nports; ++iter) 32454e4ee71SNavdeep Parhar 32554e4ee71SNavdeep Parhar static inline int is_offload(const struct adapter *adap) 32654e4ee71SNavdeep Parhar { 32754e4ee71SNavdeep Parhar return adap->params.offload; 32854e4ee71SNavdeep Parhar } 32954e4ee71SNavdeep Parhar 330*d14b0ac1SNavdeep Parhar static inline int chip_id(struct adapter *adap) 331*d14b0ac1SNavdeep Parhar { 332*d14b0ac1SNavdeep Parhar return adap->params.chipid; 333*d14b0ac1SNavdeep Parhar } 334*d14b0ac1SNavdeep Parhar 335*d14b0ac1SNavdeep Parhar static inline int chip_rev(struct adapter *adap) 336*d14b0ac1SNavdeep Parhar { 337*d14b0ac1SNavdeep Parhar return adap->params.rev; 338*d14b0ac1SNavdeep Parhar } 339*d14b0ac1SNavdeep Parhar 340*d14b0ac1SNavdeep Parhar static inline int is_t4(struct adapter *adap) 341*d14b0ac1SNavdeep Parhar { 342*d14b0ac1SNavdeep Parhar return adap->params.chipid == CHELSIO_T4; 343*d14b0ac1SNavdeep Parhar } 344*d14b0ac1SNavdeep Parhar 345*d14b0ac1SNavdeep Parhar static inline int is_t5(struct adapter *adap) 346*d14b0ac1SNavdeep Parhar { 347*d14b0ac1SNavdeep Parhar return adap->params.chipid == CHELSIO_T5; 348*d14b0ac1SNavdeep Parhar } 349*d14b0ac1SNavdeep Parhar 350*d14b0ac1SNavdeep Parhar static inline int is_fpga(struct adapter *adap) 351*d14b0ac1SNavdeep Parhar { 352*d14b0ac1SNavdeep Parhar return adap->params.fpga; 353*d14b0ac1SNavdeep Parhar } 354*d14b0ac1SNavdeep Parhar 35554e4ee71SNavdeep Parhar static inline unsigned int core_ticks_per_usec(const struct adapter *adap) 35654e4ee71SNavdeep Parhar { 35754e4ee71SNavdeep Parhar return adap->params.vpd.cclk / 1000; 35854e4ee71SNavdeep Parhar } 35954e4ee71SNavdeep Parhar 36054e4ee71SNavdeep Parhar static inline unsigned int us_to_core_ticks(const struct adapter *adap, 36154e4ee71SNavdeep Parhar unsigned int us) 36254e4ee71SNavdeep Parhar { 36354e4ee71SNavdeep Parhar return (us * adap->params.vpd.cclk) / 1000; 36454e4ee71SNavdeep Parhar } 36554e4ee71SNavdeep Parhar 36654e4ee71SNavdeep Parhar static inline unsigned int dack_ticks_to_usec(const struct adapter *adap, 36754e4ee71SNavdeep Parhar unsigned int ticks) 36854e4ee71SNavdeep Parhar { 36954e4ee71SNavdeep Parhar return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap); 37054e4ee71SNavdeep Parhar } 37154e4ee71SNavdeep Parhar 37254e4ee71SNavdeep Parhar void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); 37354e4ee71SNavdeep Parhar int t4_wait_op_done_val(struct adapter *adapter, int reg, u32 mask, int polarity, 37454e4ee71SNavdeep Parhar int attempts, int delay, u32 *valp); 37554e4ee71SNavdeep Parhar 37654e4ee71SNavdeep Parhar static inline int t4_wait_op_done(struct adapter *adapter, int reg, u32 mask, 37754e4ee71SNavdeep Parhar int polarity, int attempts, int delay) 37854e4ee71SNavdeep Parhar { 37954e4ee71SNavdeep Parhar return t4_wait_op_done_val(adapter, reg, mask, polarity, attempts, 38054e4ee71SNavdeep Parhar delay, NULL); 38154e4ee71SNavdeep Parhar } 38254e4ee71SNavdeep Parhar 38354e4ee71SNavdeep Parhar int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, 38454e4ee71SNavdeep Parhar void *rpl, bool sleep_ok); 38554e4ee71SNavdeep Parhar 38654e4ee71SNavdeep Parhar static inline int t4_wr_mbox(struct adapter *adap, int mbox, const void *cmd, 38754e4ee71SNavdeep Parhar int size, void *rpl) 38854e4ee71SNavdeep Parhar { 38954e4ee71SNavdeep Parhar return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, true); 39054e4ee71SNavdeep Parhar } 39154e4ee71SNavdeep Parhar 39254e4ee71SNavdeep Parhar static inline int t4_wr_mbox_ns(struct adapter *adap, int mbox, const void *cmd, 39354e4ee71SNavdeep Parhar int size, void *rpl) 39454e4ee71SNavdeep Parhar { 39554e4ee71SNavdeep Parhar return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, false); 39654e4ee71SNavdeep Parhar } 39754e4ee71SNavdeep Parhar 39854e4ee71SNavdeep Parhar void t4_read_indirect(struct adapter *adap, unsigned int addr_reg, 39954e4ee71SNavdeep Parhar unsigned int data_reg, u32 *vals, unsigned int nregs, 40054e4ee71SNavdeep Parhar unsigned int start_idx); 40154e4ee71SNavdeep Parhar void t4_write_indirect(struct adapter *adap, unsigned int addr_reg, 40254e4ee71SNavdeep Parhar unsigned int data_reg, const u32 *vals, 40354e4ee71SNavdeep Parhar unsigned int nregs, unsigned int start_idx); 40454e4ee71SNavdeep Parhar 4052a5f6b0eSNavdeep Parhar u32 t4_hw_pci_read_cfg4(adapter_t *adapter, int reg); 4062a5f6b0eSNavdeep Parhar 40754e4ee71SNavdeep Parhar struct fw_filter_wr; 40854e4ee71SNavdeep Parhar 40954e4ee71SNavdeep Parhar void t4_intr_enable(struct adapter *adapter); 41054e4ee71SNavdeep Parhar void t4_intr_disable(struct adapter *adapter); 41154e4ee71SNavdeep Parhar void t4_intr_clear(struct adapter *adapter); 41254e4ee71SNavdeep Parhar int t4_slow_intr_handler(struct adapter *adapter); 41354e4ee71SNavdeep Parhar 41454e4ee71SNavdeep Parhar int t4_hash_mac_addr(const u8 *addr); 41554e4ee71SNavdeep Parhar int t4_link_start(struct adapter *adap, unsigned int mbox, unsigned int port, 41654e4ee71SNavdeep Parhar struct link_config *lc); 41754e4ee71SNavdeep Parhar int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port); 41854e4ee71SNavdeep Parhar int t4_seeprom_read(struct adapter *adapter, u32 addr, u32 *data); 41954e4ee71SNavdeep Parhar int t4_seeprom_write(struct adapter *adapter, u32 addr, u32 data); 42054e4ee71SNavdeep Parhar int t4_eeprom_ptov(unsigned int phys_addr, unsigned int fn, unsigned int sz); 42154e4ee71SNavdeep Parhar int t4_seeprom_wp(struct adapter *adapter, int enable); 42254e4ee71SNavdeep Parhar int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords, 42354e4ee71SNavdeep Parhar u32 *data, int byte_oriented); 42454e4ee71SNavdeep Parhar int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); 4252a5f6b0eSNavdeep Parhar int t4_load_boot(struct adapter *adap, u8 *boot_data, 426733b9277SNavdeep Parhar unsigned int boot_addr, unsigned int size); 427733b9277SNavdeep Parhar unsigned int t4_flash_cfg_addr(struct adapter *adapter); 42854e4ee71SNavdeep Parhar int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); 42954e4ee71SNavdeep Parhar int t4_get_fw_version(struct adapter *adapter, u32 *vers); 43054e4ee71SNavdeep Parhar int t4_get_tp_version(struct adapter *adapter, u32 *vers); 43154e4ee71SNavdeep Parhar int t4_check_fw_version(struct adapter *adapter); 43254e4ee71SNavdeep Parhar int t4_init_hw(struct adapter *adapter, u32 fw_params); 43354e4ee71SNavdeep Parhar int t4_prep_adapter(struct adapter *adapter); 43454e4ee71SNavdeep Parhar int t4_port_init(struct port_info *p, int mbox, int pf, int vf); 43554e4ee71SNavdeep Parhar int t4_reinit_adapter(struct adapter *adap); 43654e4ee71SNavdeep Parhar void t4_fatal_err(struct adapter *adapter); 43754e4ee71SNavdeep Parhar int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, 43854e4ee71SNavdeep Parhar int filter_index, int enable); 43954e4ee71SNavdeep Parhar void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, 44054e4ee71SNavdeep Parhar int filter_index, int *enabled); 44154e4ee71SNavdeep Parhar int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid, 44254e4ee71SNavdeep Parhar int start, int n, const u16 *rspq, unsigned int nrspq); 44354e4ee71SNavdeep Parhar int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode, 44454e4ee71SNavdeep Parhar unsigned int flags); 44554e4ee71SNavdeep Parhar int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, 44654e4ee71SNavdeep Parhar unsigned int flags, unsigned int defq); 44754e4ee71SNavdeep Parhar int t4_read_rss(struct adapter *adapter, u16 *entries); 44854e4ee71SNavdeep Parhar void t4_read_rss_key(struct adapter *adapter, u32 *key); 44954e4ee71SNavdeep Parhar void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx); 45054e4ee71SNavdeep Parhar void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, u32 *valp); 45154e4ee71SNavdeep Parhar void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, u32 val); 45254e4ee71SNavdeep Parhar void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, 45354e4ee71SNavdeep Parhar u32 *vfl, u32 *vfh); 45454e4ee71SNavdeep Parhar void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, 45554e4ee71SNavdeep Parhar u32 vfl, u32 vfh); 45654e4ee71SNavdeep Parhar u32 t4_read_rss_pf_map(struct adapter *adapter); 45754e4ee71SNavdeep Parhar void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap); 45854e4ee71SNavdeep Parhar u32 t4_read_rss_pf_mask(struct adapter *adapter); 45954e4ee71SNavdeep Parhar void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask); 46054e4ee71SNavdeep Parhar int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); 46154e4ee71SNavdeep Parhar void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); 46254e4ee71SNavdeep Parhar void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); 46354e4ee71SNavdeep Parhar void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres); 46454e4ee71SNavdeep Parhar int t4_read_cim_ibq(struct adapter *adap, unsigned int qid, u32 *data, size_t n); 46554e4ee71SNavdeep Parhar int t4_read_cim_obq(struct adapter *adap, unsigned int qid, u32 *data, size_t n); 46654e4ee71SNavdeep Parhar int t4_cim_read(struct adapter *adap, unsigned int addr, unsigned int n, 46754e4ee71SNavdeep Parhar unsigned int *valp); 46854e4ee71SNavdeep Parhar int t4_cim_write(struct adapter *adap, unsigned int addr, unsigned int n, 46954e4ee71SNavdeep Parhar const unsigned int *valp); 47054e4ee71SNavdeep Parhar int t4_cim_ctl_read(struct adapter *adap, unsigned int addr, unsigned int n, 47154e4ee71SNavdeep Parhar unsigned int *valp); 47254e4ee71SNavdeep Parhar int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr); 47354e4ee71SNavdeep Parhar void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp, 47454e4ee71SNavdeep Parhar unsigned int *pif_req_wrptr, unsigned int *pif_rsp_wrptr); 47554e4ee71SNavdeep Parhar void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp); 476*d14b0ac1SNavdeep Parhar int t4_mc_read(struct adapter *adap, int idx, u32 addr, 477*d14b0ac1SNavdeep Parhar __be32 *data, u64 *parity); 47854e4ee71SNavdeep Parhar int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *parity); 47954e4ee71SNavdeep Parhar int t4_mem_read(struct adapter *adap, int mtype, u32 addr, u32 size, 48054e4ee71SNavdeep Parhar __be32 *data); 48154e4ee71SNavdeep Parhar 48254e4ee71SNavdeep Parhar void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p); 4832a5f6b0eSNavdeep Parhar void t4_get_port_stats_offset(struct adapter *adap, int idx, 4842a5f6b0eSNavdeep Parhar struct port_stats *stats, 4852a5f6b0eSNavdeep Parhar struct port_stats *offset); 48654e4ee71SNavdeep Parhar void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p); 48754e4ee71SNavdeep Parhar void t4_clr_port_stats(struct adapter *adap, int idx); 48854e4ee71SNavdeep Parhar 48954e4ee71SNavdeep Parhar void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log); 49054e4ee71SNavdeep Parhar void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]); 49154e4ee71SNavdeep Parhar void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]); 49254e4ee71SNavdeep Parhar void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps, 49354e4ee71SNavdeep Parhar unsigned int *ipg); 49454e4ee71SNavdeep Parhar void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr, 49554e4ee71SNavdeep Parhar unsigned int mask, unsigned int val); 49654e4ee71SNavdeep Parhar void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr); 49754e4ee71SNavdeep Parhar void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st); 49854e4ee71SNavdeep Parhar void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st); 49954e4ee71SNavdeep Parhar void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st); 50054e4ee71SNavdeep Parhar void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st); 50154e4ee71SNavdeep Parhar void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st); 50254e4ee71SNavdeep Parhar void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, 50354e4ee71SNavdeep Parhar struct tp_tcp_stats *v6); 50454e4ee71SNavdeep Parhar void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, 50554e4ee71SNavdeep Parhar struct tp_fcoe_stats *st); 50654e4ee71SNavdeep Parhar void t4_load_mtus(struct adapter *adap, const unsigned short *mtus, 50754e4ee71SNavdeep Parhar const unsigned short *alpha, const unsigned short *beta); 50854e4ee71SNavdeep Parhar 50954e4ee71SNavdeep Parhar void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf); 51054e4ee71SNavdeep Parhar 51154e4ee71SNavdeep Parhar int t4_set_sched_bps(struct adapter *adap, int sched, unsigned int kbps); 51254e4ee71SNavdeep Parhar int t4_set_sched_ipg(struct adapter *adap, int sched, unsigned int ipg); 51354e4ee71SNavdeep Parhar int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals, 51454e4ee71SNavdeep Parhar unsigned int start, unsigned int n); 51554e4ee71SNavdeep Parhar void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate); 51654e4ee71SNavdeep Parhar int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map); 51754e4ee71SNavdeep Parhar void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid); 51854e4ee71SNavdeep Parhar 51954e4ee71SNavdeep Parhar void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr); 52054e4ee71SNavdeep Parhar int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map, 52154e4ee71SNavdeep Parhar u64 mask0, u64 mask1, unsigned int crc, bool enable); 52254e4ee71SNavdeep Parhar 52354e4ee71SNavdeep Parhar int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, 52454e4ee71SNavdeep Parhar enum dev_master master, enum dev_state *state); 52554e4ee71SNavdeep Parhar int t4_fw_bye(struct adapter *adap, unsigned int mbox); 52654e4ee71SNavdeep Parhar int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); 5272a5f6b0eSNavdeep Parhar int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force); 5282a5f6b0eSNavdeep Parhar int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); 5292a5f6b0eSNavdeep Parhar int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, 5302a5f6b0eSNavdeep Parhar const u8 *fw_data, unsigned int size, int force); 531733b9277SNavdeep Parhar int t4_fw_initialize(struct adapter *adap, unsigned int mbox); 53254e4ee71SNavdeep Parhar int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 53354e4ee71SNavdeep Parhar unsigned int vf, unsigned int nparams, const u32 *params, 53454e4ee71SNavdeep Parhar u32 *val); 53554e4ee71SNavdeep Parhar int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf, 53654e4ee71SNavdeep Parhar unsigned int vf, unsigned int nparams, const u32 *params, 53754e4ee71SNavdeep Parhar const u32 *val); 53854e4ee71SNavdeep Parhar int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, 53954e4ee71SNavdeep Parhar unsigned int vf, unsigned int txq, unsigned int txq_eth_ctrl, 54054e4ee71SNavdeep Parhar unsigned int rxqi, unsigned int rxq, unsigned int tc, 54154e4ee71SNavdeep Parhar unsigned int vi, unsigned int cmask, unsigned int pmask, 54254e4ee71SNavdeep Parhar unsigned int exactf, unsigned int rcaps, unsigned int wxcaps); 5432a5f6b0eSNavdeep Parhar int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, 5442a5f6b0eSNavdeep Parhar unsigned int port, unsigned int pf, unsigned int vf, 5452a5f6b0eSNavdeep Parhar unsigned int nmac, u8 *mac, unsigned int *rss_size, 5462a5f6b0eSNavdeep Parhar unsigned int portfunc, unsigned int idstype); 54754e4ee71SNavdeep Parhar int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, 54854e4ee71SNavdeep Parhar unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, 54954e4ee71SNavdeep Parhar unsigned int *rss_size); 55054e4ee71SNavdeep Parhar int t4_free_vi(struct adapter *adap, unsigned int mbox, 55154e4ee71SNavdeep Parhar unsigned int pf, unsigned int vf, 55254e4ee71SNavdeep Parhar unsigned int viid); 55354e4ee71SNavdeep Parhar int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid, 55454e4ee71SNavdeep Parhar int mtu, int promisc, int all_multi, int bcast, int vlanex, 55554e4ee71SNavdeep Parhar bool sleep_ok); 55654e4ee71SNavdeep Parhar int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, unsigned int viid, 55754e4ee71SNavdeep Parhar bool free, unsigned int naddr, const u8 **addr, u16 *idx, 55854e4ee71SNavdeep Parhar u64 *hash, bool sleep_ok); 55954e4ee71SNavdeep Parhar int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, 56054e4ee71SNavdeep Parhar int idx, const u8 *addr, bool persist, bool add_smt); 56154e4ee71SNavdeep Parhar int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, 56254e4ee71SNavdeep Parhar bool ucast, u64 vec, bool sleep_ok); 56354e4ee71SNavdeep Parhar int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid, 56454e4ee71SNavdeep Parhar bool rx_en, bool tx_en); 56554e4ee71SNavdeep Parhar int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, 56654e4ee71SNavdeep Parhar unsigned int nblinks); 5678d92e1dbSNavdeep Parhar int t4_i2c_rd(struct adapter *adap, unsigned int mbox, unsigned int port_id, 5688d92e1dbSNavdeep Parhar u8 dev_addr, u8 offset, u8 *valp); 56954e4ee71SNavdeep Parhar int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 57054e4ee71SNavdeep Parhar unsigned int mmd, unsigned int reg, unsigned int *valp); 57154e4ee71SNavdeep Parhar int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, 57254e4ee71SNavdeep Parhar unsigned int mmd, unsigned int reg, unsigned int val); 57354e4ee71SNavdeep Parhar int t4_iq_start_stop(struct adapter *adap, unsigned int mbox, bool start, 57454e4ee71SNavdeep Parhar unsigned int pf, unsigned int vf, unsigned int iqid, 57554e4ee71SNavdeep Parhar unsigned int fl0id, unsigned int fl1id); 57654e4ee71SNavdeep Parhar int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 57754e4ee71SNavdeep Parhar unsigned int vf, unsigned int iqtype, unsigned int iqid, 57854e4ee71SNavdeep Parhar unsigned int fl0id, unsigned int fl1id); 57954e4ee71SNavdeep Parhar int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 58054e4ee71SNavdeep Parhar unsigned int vf, unsigned int eqid); 58154e4ee71SNavdeep Parhar int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 58254e4ee71SNavdeep Parhar unsigned int vf, unsigned int eqid); 58354e4ee71SNavdeep Parhar int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, 58454e4ee71SNavdeep Parhar unsigned int vf, unsigned int eqid); 58554e4ee71SNavdeep Parhar int t4_sge_ctxt_rd(struct adapter *adap, unsigned int mbox, unsigned int cid, 58654e4ee71SNavdeep Parhar enum ctxt_type ctype, u32 *data); 58754e4ee71SNavdeep Parhar int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype, 58854e4ee71SNavdeep Parhar u32 *data); 5892a5f6b0eSNavdeep Parhar int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); 59054e4ee71SNavdeep Parhar int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); 5912a5f6b0eSNavdeep Parhar int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); 59254e4ee71SNavdeep Parhar #endif /* __CHELSIO_COMMON_H */ 593