FreeBSD kernel CXGB device code
cxgb_common.h
Go to the documentation of this file.
1/**************************************************************************
2SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3
4Copyright (c) 2007-2009, Chelsio Inc.
5All rights reserved.
6
7Redistribution and use in source and binary forms, with or without
8modification, are permitted provided that the following conditions are met:
9
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12
13 2. Neither the name of the Chelsio Corporation nor the names of its
14 contributors may be used to endorse or promote products derived from
15 this software without specific prior written permission.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27POSSIBILITY OF SUCH DAMAGE.
28
29$FreeBSD$
30
31***************************************************************************/
32#ifndef __CHELSIO_COMMON_H
33#define __CHELSIO_COMMON_H
34
35#include <cxgb_osdep.h>
36
37enum {
38 MAX_FRAME_SIZE = 10240, /* max MAC frame size, includes header + FCS */
39 EEPROMSIZE = 8192, /* Serial EEPROM size */
40 SERNUM_LEN = 16, /* Serial # length */
41 ECNUM_LEN = 16, /* EC # length */
42 RSS_TABLE_SIZE = 64, /* size of RSS lookup and mapping tables */
43 TCB_SIZE = 128, /* TCB size */
44 NMTUS = 16, /* size of MTU table */
45 NCCTRL_WIN = 32, /* # of congestion control windows */
46 NTX_SCHED = 8, /* # of HW Tx scheduling queues */
47 PROTO_SRAM_LINES = 128, /* size of protocol sram */
48 EXACT_ADDR_FILTERS = 8, /* # of HW exact match filters */
49};
50
51#define MAX_RX_COALESCING_LEN 12288U
52
53enum {
54 PAUSE_RX = 1 << 0,
55 PAUSE_TX = 1 << 1,
56 PAUSE_AUTONEG = 1 << 2
57};
58
59enum {
61 /* skip 25 */
64};
65
66enum { /* adapter interrupt-maintained statistics */
70
71 IRQ_NUM_STATS /* keep last */
72};
73
74enum {
78};
79
80#define S_TP_VERSION_MAJOR 16
81#define M_TP_VERSION_MAJOR 0xFF
82#define V_TP_VERSION_MAJOR(x) ((x) << S_TP_VERSION_MAJOR)
83#define G_TP_VERSION_MAJOR(x) \
84 (((x) >> S_TP_VERSION_MAJOR) & M_TP_VERSION_MAJOR)
85
86#define S_TP_VERSION_MINOR 8
87#define M_TP_VERSION_MINOR 0xFF
88#define V_TP_VERSION_MINOR(x) ((x) << S_TP_VERSION_MINOR)
89#define G_TP_VERSION_MINOR(x) \
90 (((x) >> S_TP_VERSION_MINOR) & M_TP_VERSION_MINOR)
91
92#define S_TP_VERSION_MICRO 0
93#define M_TP_VERSION_MICRO 0xFF
94#define V_TP_VERSION_MICRO(x) ((x) << S_TP_VERSION_MICRO)
95#define G_TP_VERSION_MICRO(x) \
96 (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
97
98enum {
103
104enum {
105 LA_CTRL = 0x80,
106 LA_DATA = 0x84,
107 LA_ENTRIES = 512
109
110enum {
111 IOQ_ENTRIES = 7
113
114enum {
115 SGE_QSETS = 8, /* # of SGE Tx/Rx/RspQ sets */
116 SGE_RXQ_PER_SET = 2, /* # of Rx queues per set */
117 SGE_TXQ_PER_SET = 3 /* # of Tx queues per set */
119
120enum sge_context_type { /* SGE egress context types */
126
127enum {
128 AN_PKT_SIZE = 32, /* async notification packet size */
129 IMMED_PKT_SIZE = 48 /* packet size for immediate data */
131
132struct sg_ent { /* SGE scatter/gather entry */
135};
136
137#ifndef SGE_NUM_GENBITS
138/* Must be 1 or 2 */
139# define SGE_NUM_GENBITS 2
140#endif
141
142#define TX_DESC_FLITS 16U
143#define WR_FLITS (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)
144
145#define MAX_PHYINTRS 4
146
147struct cphy;
148
149struct mdio_ops {
150 int (*read)(adapter_t *adapter, int phy_addr, int mmd_addr,
151 int reg_addr, unsigned int *val);
152 int (*write)(adapter_t *adapter, int phy_addr, int mmd_addr,
153 int reg_addr, unsigned int val);
154};
155
157 unsigned char nports0; /* # of ports on channel 0 */
158 unsigned char nports1; /* # of ports on channel 1 */
159 unsigned char phy_base_addr; /* MDIO PHY base address */
160 unsigned int gpio_out; /* GPIO output settings */
161 unsigned char gpio_intr[MAX_PHYINTRS]; /* GPIO PHY IRQ pins */
162 unsigned long caps; /* adapter capabilities */
163 const struct mdio_ops *mdio_ops; /* MDIO operations */
164 const char *desc; /* product description */
165};
166
167struct mc5_stats {
168 unsigned long parity_err;
169 unsigned long active_rgn_full;
170 unsigned long nfa_srch_err;
171 unsigned long unknown_cmd;
172 unsigned long reqq_parity_err;
173 unsigned long dispq_parity_err;
174 unsigned long del_act_empty;
175};
176
177struct mc7_stats {
178 unsigned long corr_err;
179 unsigned long uncorr_err;
180 unsigned long parity_err;
181 unsigned long addr_err;
182};
183
184struct mac_stats {
185 u64 tx_octets; /* total # of octets in good frames */
186 u64 tx_octets_bad; /* total # of octets in error frames */
187 u64 tx_frames; /* all good frames */
188 u64 tx_mcast_frames; /* good multicast frames */
189 u64 tx_bcast_frames; /* good broadcast frames */
190 u64 tx_pause; /* # of transmitted pause frames */
191 u64 tx_deferred; /* frames with deferred transmissions */
192 u64 tx_late_collisions; /* # of late collisions */
193 u64 tx_total_collisions; /* # of total collisions */
194 u64 tx_excess_collisions; /* frame errors from excessive collissions */
195 u64 tx_underrun; /* # of Tx FIFO underruns */
196 u64 tx_len_errs; /* # of Tx length errors */
197 u64 tx_mac_internal_errs; /* # of internal MAC errors on Tx */
198 u64 tx_excess_deferral; /* # of frames with excessive deferral */
199 u64 tx_fcs_errs; /* # of frames with bad FCS */
200
201 u64 tx_frames_64; /* # of Tx frames in a particular range */
208
209 u64 rx_octets; /* total # of octets in good frames */
210 u64 rx_octets_bad; /* total # of octets in error frames */
211 u64 rx_frames; /* all good frames */
212 u64 rx_mcast_frames; /* good multicast frames */
213 u64 rx_bcast_frames; /* good broadcast frames */
214 u64 rx_pause; /* # of received pause frames */
215 u64 rx_fcs_errs; /* # of received frames with bad FCS */
216 u64 rx_align_errs; /* alignment errors */
217 u64 rx_symbol_errs; /* symbol errors */
218 u64 rx_data_errs; /* data errors */
219 u64 rx_sequence_errs; /* sequence errors */
220 u64 rx_runt; /* # of runt frames */
221 u64 rx_jabber; /* # of jabber frames */
222 u64 rx_short; /* # of short frames */
223 u64 rx_too_long; /* # of oversized frames */
224 u64 rx_mac_internal_errs; /* # of internal MAC errors on Rx */
225
226 u64 rx_frames_64; /* # of Rx frames in a particular range */
233
234 u64 rx_cong_drops; /* # of Rx drops due to SGE congestion */
235
236 unsigned long tx_fifo_parity_err;
237 unsigned long rx_fifo_parity_err;
238 unsigned long tx_fifo_urun;
239 unsigned long rx_fifo_ovfl;
240 unsigned long serdes_signal_loss;
241 unsigned long xaui_pcs_ctc_err;
243
244 unsigned long num_toggled; /* # times toggled TxEn due to stuck TX */
245 unsigned long num_resets; /* # times reset due to stuck TX */
246
247 unsigned long link_faults; /* # detected link faults */
248};
249
273
275
292};
293
294struct tp_params {
295 unsigned int nchan; /* # of channels */
296 unsigned int pmrx_size; /* total PMRX capacity */
297 unsigned int pmtx_size; /* total PMTX capacity */
298 unsigned int cm_size; /* total CM capacity */
299 unsigned int chan_rx_size; /* per channel Rx size */
300 unsigned int chan_tx_size; /* per channel Tx size */
301 unsigned int rx_pg_size; /* Rx page size */
302 unsigned int tx_pg_size; /* Tx page size */
303 unsigned int rx_num_pgs; /* # of Rx pages */
304 unsigned int tx_num_pgs; /* # of Tx pages */
305 unsigned int ntimer_qs; /* # of timer queues */
306 unsigned int tre; /* log2 of core clocks per TP tick */
307 unsigned int dack_re; /* DACK timer resolution */
308};
309
310struct qset_params { /* SGE queue set parameters */
311 unsigned int polling; /* polling/interrupt service for rspq */
312 unsigned int lro; /* large receive offload */
313 unsigned int coalesce_usecs; /* irq coalescing timer */
314 unsigned int rspq_size; /* # of entries in response queue */
315 unsigned int fl_size; /* # of entries in regular free list */
316 unsigned int jumbo_size; /* # of entries in jumbo free list */
317 unsigned int jumbo_buf_size; /* buffer size of jumbo entry */
318 unsigned int txq_size[SGE_TXQ_PER_SET]; /* Tx queue sizes */
319 unsigned int cong_thres; /* FL congestion threshold */
320 unsigned int vector; /* Interrupt (line or vector) number */
321};
322
324 unsigned int max_pkt_size; /* max offload pkt size */
326};
327
329 unsigned int mode; /* selects MC5 width */
330 unsigned int nservers; /* size of server region */
331 unsigned int nfilters; /* size of filter region */
332 unsigned int nroutes; /* size of routing region */
333};
334
335/* Default MC5 region sizes */
336enum {
338 DEFAULT_NFILTERS = 128
340
341/* MC5 modes, these must be non-0 */
342enum {
346
347/* MC5 min active region size */
348enum { MC5_MIN_TIDS = 16 };
349
351 unsigned int cclk;
352 unsigned int mclk;
353 unsigned int uclk;
354 unsigned int mdc;
355 unsigned int mem_timing;
360 unsigned short xauicfg[2];
361};
362
367};
368
369enum { MAX_VPD_BYTES = 32000 };
370
372 unsigned int vpd_cap_addr;
373 unsigned int pcie_cap_addr;
374 unsigned short speed;
375 unsigned char width;
376 unsigned char variant;
377};
378
379enum {
386
390 struct tp_params tp;
393
394 const struct adapter_info *info;
395
396 unsigned short mtus[NMTUS];
397 unsigned short a_wnd[NCCTRL_WIN];
398 unsigned short b_wnd[NCCTRL_WIN];
399 unsigned int nports; /* # of ethernet ports */
400 unsigned int chan_map; /* bitmap of in-use Tx channels */
401 unsigned int stats_update_period; /* MAC stats accumulation period */
402 unsigned int linkpoll_period; /* link poll period in 0.1s */
403 unsigned int rev; /* chip revision */
404 unsigned int offload;
405};
406
407enum { /* chip revisions */
412};
413
429};
430
432 unsigned int supported; /* link capabilities */
433 unsigned int advertising; /* advertised capabilities */
434 unsigned short requested_speed; /* speed user has requested */
435 unsigned short speed; /* actual link speed */
436 unsigned char requested_duplex; /* duplex user has requested */
437 unsigned char duplex; /* actual link duplex */
438 unsigned char requested_fc; /* flow control user has requested */
439 unsigned char fc; /* actual link flow control */
440 unsigned char autoneg; /* autonegotiating? */
441 unsigned int link_ok; /* link up? */
442};
443
444#define SPEED_INVALID 0xffff
445#define DUPLEX_INVALID 0xff
446
447struct mc5 {
449 unsigned int tcam_size;
450 unsigned char part_type;
451 unsigned char parity_enabled;
452 unsigned char mode;
454};
455
456static inline unsigned int t3_mc5_size(const struct mc5 *p)
457{
458 return p->tcam_size;
459}
460
461struct mc7 {
462 adapter_t *adapter; /* backpointer to adapter */
463 unsigned int size; /* memory size in bytes */
464 unsigned int width; /* MC7 interface width */
465 unsigned int offset; /* register address offset for MC7 instance */
466 const char *name; /* name of MC7 instance */
467 struct mc7_stats stats; /* MC7 statistics */
468};
469
470static inline unsigned int t3_mc7_size(const struct mc7 *p)
471{
472 return p->size;
473}
474
475struct cmac {
477 unsigned int offset;
478 unsigned char nucast; /* # of address filters for unicast MACs */
479 unsigned char multiport; /* multiple ports connected to this MAC */
480 unsigned char ext_port; /* external MAC port */
481 unsigned char promisc_map; /* which external ports are promiscuous */
482 unsigned int tx_tcnt;
483 unsigned int tx_xcnt;
485 unsigned int rx_xcnt;
486 unsigned int rx_ocnt;
488 unsigned int toggle_cnt;
489 unsigned int txen;
490 unsigned int was_reset;
493};
494
495enum {
498 MAC_RXFIFO_SIZE = 32768
500
501/* IEEE 802.3 specified MDIO devices */
502enum {
509 MDIO_DEV_VEND2 = 31
511
512/* LASI control and status registers */
513enum {
516 LASI_CTRL = 0x9002,
519 LASI_STAT = 0x9005
521
522/* PHY loopback direction */
523enum {
527
528/* PHY interrupt types */
529enum {
534};
535
536/* PHY module types */
537enum {
546
547enum {
552
553/* PHY operations */
554struct cphy_ops {
555 int (*reset)(struct cphy *phy, int wait);
556
557 int (*intr_enable)(struct cphy *phy);
558 int (*intr_disable)(struct cphy *phy);
559 int (*intr_clear)(struct cphy *phy);
560 int (*intr_handler)(struct cphy *phy);
561
562 int (*autoneg_enable)(struct cphy *phy);
563 int (*autoneg_restart)(struct cphy *phy);
564
565 int (*advertise)(struct cphy *phy, unsigned int advertise_map);
566 int (*set_loopback)(struct cphy *phy, int mmd, int dir, int enable);
567 int (*set_speed_duplex)(struct cphy *phy, int speed, int duplex);
568 int (*get_link_status)(struct cphy *phy, int *link_state, int *speed,
569 int *duplex, int *fc);
570 int (*power_down)(struct cphy *phy, int enable);
571};
572
573/* A PHY instance */
574struct cphy {
575 u8 addr; /* PHY address */
576 u8 modtype; /* PHY module type */
578 unsigned int priv; /* scratch pad */
579 unsigned int caps; /* PHY capabilities */
580 adapter_t *adapter; /* associated adapter */
581 pinfo_t *pinfo; /* associated port */
582 const char *desc; /* PHY description */
583 unsigned long fifo_errors; /* FIFO over/under-flows */
584 const struct cphy_ops *ops; /* PHY operations */
585 int (*mdio_read)(adapter_t *adapter, int phy_addr, int mmd_addr,
586 int reg_addr, unsigned int *val);
587 int (*mdio_write)(adapter_t *adapter, int phy_addr, int mmd_addr,
588 int reg_addr, unsigned int val);
589};
590
591/* Convenience MDIO read/write wrappers */
592static inline int mdio_read(struct cphy *phy, int mmd, int reg,
593 unsigned int *valp)
594{
595 return phy->mdio_read(phy->adapter, phy->addr, mmd, reg, valp);
596}
597
598static inline int mdio_write(struct cphy *phy, int mmd, int reg,
599 unsigned int val)
600{
601 return phy->mdio_write(phy->adapter, phy->addr, mmd, reg, val);
602}
603
604/* Convenience initializer */
605static inline void cphy_init(struct cphy *phy, adapter_t *adapter, pinfo_t *pinfo,
606 int phy_addr, struct cphy_ops *phy_ops,
607 const struct mdio_ops *mdio_ops, unsigned int caps,
608 const char *desc)
609{
610 phy->addr = (u8)phy_addr;
611 phy->caps = caps;
613 phy->pinfo = pinfo;
614 phy->desc = desc;
615 phy->ops = phy_ops;
616 if (mdio_ops) {
619 }
620}
621
622/* Accumulate MAC statistics every 180 seconds. For 1G we multiply by 10. */
623#define MAC_STATS_ACCUM_SECS 180
624
625/* The external MAC needs accumulation every 30 seconds */
626#define VSC_STATS_ACCUM_SECS 30
627
628#define XGM_REG(reg_addr, idx) \
629 ((reg_addr) + (idx) * (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR))
630
632 unsigned int reg_addr;
633 unsigned int val;
634};
635
636#include <cxgb_adapter.h>
637
638#ifndef PCI_VENDOR_ID_CHELSIO
639# define PCI_VENDOR_ID_CHELSIO 0x1425
640#endif
641
642#define for_each_port(adapter, iter) \
643 for (iter = 0; iter < (adapter)->params.nports; ++iter)
644
645#define adapter_info(adap) ((adap)->params.info)
646
647static inline int uses_xaui(const adapter_t *adap)
648{
649 return adapter_info(adap)->caps & SUPPORTED_AUI;
650}
651
652static inline int is_10G(const adapter_t *adap)
653{
654 return adapter_info(adap)->caps & SUPPORTED_10000baseT_Full;
655}
656
657static inline int is_offload(const adapter_t *adap)
658{
659 return adap->params.offload;
660}
661
662static inline unsigned int core_ticks_per_usec(const adapter_t *adap)
663{
664 return adap->params.vpd.cclk / 1000;
665}
666
667static inline unsigned int dack_ticks_to_usec(const adapter_t *adap,
668 unsigned int ticks)
669{
670 return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap);
671}
672
673static inline unsigned int is_pcie(const adapter_t *adap)
674{
675 return adap->params.pci.variant == PCI_VARIANT_PCIE;
676}
677
678void t3_set_reg_field(adapter_t *adap, unsigned int addr, u32 mask, u32 val);
679void t3_write_regs(adapter_t *adapter, const struct addr_val_pair *p, int n,
680 unsigned int offset);
681int t3_wait_op_done_val(adapter_t *adapter, int reg, u32 mask, int polarity,
682 int attempts, int delay, u32 *valp);
683
684static inline int t3_wait_op_done(adapter_t *adapter, int reg, u32 mask,
685 int polarity, int attempts, int delay)
686{
687 return t3_wait_op_done_val(adapter, reg, mask, polarity, attempts,
688 delay, NULL);
689}
690
691int t3_mdio_change_bits(struct cphy *phy, int mmd, int reg, unsigned int clear,
692 unsigned int set);
693int t3_phy_reset(struct cphy *phy, int mmd, int wait);
694int t3_phy_advertise(struct cphy *phy, unsigned int advert);
695int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert);
696int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex);
697int t3_phy_lasi_intr_enable(struct cphy *phy);
699int t3_phy_lasi_intr_clear(struct cphy *phy);
701
705void t3_xgm_intr_enable(adapter_t *adapter, int idx);
709void t3_port_intr_clear(adapter_t *adapter, int idx);
711
713int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
714const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
715int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data);
716int t3_seeprom_write(adapter_t *adapter, u32 addr, u32 data);
717int t3_seeprom_wp(adapter_t *adapter, int enable);
719int t3_read_vpd(adapter_t *adapter, struct generic_vpd *vpd);
720int t3_read_flash(adapter_t *adapter, unsigned int addr, unsigned int nwords,
721 u32 *data, int byte_oriented);
724int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
725int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size);
728int t3_load_boot(adapter_t *adapter, u8 *fw_data, unsigned int size);
729int t3_init_hw(adapter_t *adapter, u32 fw_params);
730void mac_prep(struct cmac *mac, adapter_t *adapter, int index);
731void early_hw_init(adapter_t *adapter, const struct adapter_info *ai);
733int t3_prep_adapter(adapter_t *adapter, const struct adapter_info *ai, int reset);
737void t3_set_vlan_accel(adapter_t *adapter, unsigned int ports, int on);
738void t3_enable_filters(adapter_t *adap);
739void t3_disable_filters(adapter_t *adap);
740void t3_tp_set_offload_mode(adapter_t *adap, int enable);
741void t3_config_rss(adapter_t *adapter, unsigned int rss_config, const u8 *cpus,
742 const u16 *rspq);
743int t3_read_rss(adapter_t *adapter, u8 *lkup, u16 *map);
744int t3_set_proto_sram(adapter_t *adap, const u8 *data);
745int t3_mps_set_active_ports(adapter_t *adap, unsigned int port_mask);
746void t3_port_failover(adapter_t *adapter, int port);
747void t3_failover_done(adapter_t *adapter, int port);
749int t3_cim_ctl_blk_read(adapter_t *adap, unsigned int addr, unsigned int n,
750 unsigned int *valp);
751int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n,
752 u64 *buf);
753
754int t3_mac_init(struct cmac *mac);
755void t3b_pcs_reset(struct cmac *mac);
756void t3c_pcs_force_los(struct cmac *mac);
759int t3_mac_enable(struct cmac *mac, int which);
760int t3_mac_disable(struct cmac *mac, int which);
761int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
762int t3_mac_set_rx_mode(struct cmac *mac, struct t3_rx_mode *rm);
763int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6]);
764int t3_mac_set_num_ucast(struct cmac *mac, unsigned char n);
765const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
766int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex,
767 int fc);
768int t3b2_mac_watchdog_task(struct cmac *mac);
769
770void t3_mc5_prep(adapter_t *adapter, struct mc5 *mc5, int mode);
771int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters,
772 unsigned int nroutes);
773void t3_mc5_intr_handler(struct mc5 *mc5);
774int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n,
775 u32 *buf);
776
777int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh);
778void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size);
779void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps);
780void t3_load_mtus(adapter_t *adap, unsigned short mtus[NMTUS],
781 unsigned short alpha[NCCTRL_WIN],
782 unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap);
783void t3_read_hw_mtus(adapter_t *adap, unsigned short mtus[NMTUS]);
785 unsigned short incr[NMTUS][NCCTRL_WIN]);
787 int filter_index, int invert, int enable);
789 int filter_index, int *inverted, int *enabled);
790int t3_config_sched(adapter_t *adap, unsigned int kbps, int sched);
791int t3_set_sched_ipg(adapter_t *adap, int sched, unsigned int ipg);
792void t3_get_tx_sched(adapter_t *adap, unsigned int sched, unsigned int *kbps,
793 unsigned int *ipg);
794void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED]);
795void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals,
796 unsigned int start, unsigned int n);
797
798int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index,
799 u32 *size, void *data);
800int t3_get_up_ioqs(adapter_t *adapter, u32 *size, void *data);
801
802void t3_sge_prep(adapter_t *adap, struct sge_params *p);
803void t3_sge_init(adapter_t *adap, struct sge_params *p);
804int t3_sge_init_ecntxt(adapter_t *adapter, unsigned int id, int gts_enable,
805 enum sge_context_type type, int respq, u64 base_addr,
806 unsigned int size, unsigned int token, int gen,
807 unsigned int cidx);
808int t3_sge_init_flcntxt(adapter_t *adapter, unsigned int id, int gts_enable,
809 u64 base_addr, unsigned int size, unsigned int esize,
810 unsigned int cong_thres, int gen, unsigned int cidx);
811int t3_sge_init_rspcntxt(adapter_t *adapter, unsigned int id, int irq_vec_idx,
812 u64 base_addr, unsigned int size,
813 unsigned int fl_thres, int gen, unsigned int cidx);
814int t3_sge_init_cqcntxt(adapter_t *adapter, unsigned int id, u64 base_addr,
815 unsigned int size, int rspq, int ovfl_mode,
816 unsigned int credits, unsigned int credit_thres);
817int t3_sge_enable_ecntxt(adapter_t *adapter, unsigned int id, int enable);
818int t3_sge_disable_fl(adapter_t *adapter, unsigned int id);
819int t3_sge_disable_rspcntxt(adapter_t *adapter, unsigned int id);
820int t3_sge_disable_cqcntxt(adapter_t *adapter, unsigned int id);
821int t3_sge_read_ecntxt(adapter_t *adapter, unsigned int id, u32 data[4]);
822int t3_sge_read_fl(adapter_t *adapter, unsigned int id, u32 data[4]);
823int t3_sge_read_cq(adapter_t *adapter, unsigned int id, u32 data[4]);
824int t3_sge_read_rspq(adapter_t *adapter, unsigned int id, u32 data[4]);
825int t3_sge_cqcntxt_op(adapter_t *adapter, unsigned int id, unsigned int op,
826 unsigned int credits);
827
828int t3_elmr_blk_write(adapter_t *adap, int start, const u32 *vals, int n);
829int t3_elmr_blk_read(adapter_t *adap, int start, u32 *vals, int n);
830int t3_vsc7323_init(adapter_t *adap, int nports);
831int t3_vsc7323_set_speed_fc(adapter_t *adap, int speed, int fc, int port);
832int t3_vsc7323_set_mtu(adapter_t *adap, unsigned int mtu, int port);
833int t3_vsc7323_set_addr(adapter_t *adap, u8 addr[6], int port);
834int t3_vsc7323_enable(adapter_t *adap, int port, int which);
835int t3_vsc7323_disable(adapter_t *adap, int port, int which);
836const struct mac_stats *t3_vsc7323_update_stats(struct cmac *mac);
837
838int t3_i2c_read8(adapter_t *adapter, int chained, u8 *valp);
839int t3_i2c_write8(adapter_t *adapter, int chained, u8 val);
840
841int t3_mi1_read(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr,
842 unsigned int *valp);
843int t3_mi1_write(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr,
844 unsigned int val);
845
846int t3_mv88e1xxx_phy_prep(pinfo_t *pinfo, int phy_addr,
847 const struct mdio_ops *mdio_ops);
848int t3_vsc8211_phy_prep(pinfo_t *pinfo, int phy_addr,
849 const struct mdio_ops *mdio_ops);
850int t3_vsc8211_fifo_depth(adapter_t *adap, unsigned int mtu, int port);
851int t3_ael1002_phy_prep(pinfo_t *pinfo, int phy_addr,
852 const struct mdio_ops *mdio_ops);
853int t3_ael1006_phy_prep(pinfo_t *pinfo, int phy_addr,
854 const struct mdio_ops *mdio_ops);
855int t3_ael2005_phy_prep(pinfo_t *pinfo, int phy_addr,
856 const struct mdio_ops *mdio_ops);
857int t3_ael2020_phy_prep(pinfo_t *pinfo, int phy_addr,
858 const struct mdio_ops *mdio_ops);
859int t3_qt2045_phy_prep(pinfo_t *pinfo, int phy_addr,
860 const struct mdio_ops *mdio_ops);
861int t3_tn1010_phy_prep(pinfo_t *pinfo, int phy_addr,
862 const struct mdio_ops *mdio_ops);
863int t3_xaui_direct_phy_prep(pinfo_t *pinfo, int phy_addr,
864 const struct mdio_ops *mdio_ops);
865int t3_aq100x_phy_prep(pinfo_t *pinfo, int phy_addr,
866 const struct mdio_ops *mdio_ops);
867#endif /* __CHELSIO_COMMON_H */
uint32_t port_id
Definition: cxgb_adapter.h:11
struct adapter * adapter
Definition: cxgb_adapter.h:0
struct cmac mac
Definition: cxgb_adapter.h:6
struct cphy phy
Definition: cxgb_adapter.h:5
static int mdio_read(struct cphy *phy, int mmd, int reg, unsigned int *valp)
Definition: cxgb_common.h:592
int t3_set_proto_sram(adapter_t *adap, const u8 *data)
Definition: cxgb_t3_hw.c:3578
int t3_get_up_ioqs(adapter_t *adapter, u32 *size, void *data)
Definition: cxgb_t3_hw.c:4766
@ PAUSE_AUTONEG
Definition: cxgb_common.h:56
@ PAUSE_TX
Definition: cxgb_common.h:55
@ PAUSE_RX
Definition: cxgb_common.h:54
void t3_disable_filters(adapter_t *adap)
Definition: cxgb_t3_hw.c:3071
@ IOQ_ENTRIES
Definition: cxgb_common.h:111
void t3_query_trace_filter(adapter_t *adapter, struct trace_params *tp, int filter_index, int *inverted, int *enabled)
Definition: cxgb_t3_hw.c:3649
int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size)
Definition: cxgb_t3_hw.c:1297
void t3_set_reg_field(adapter_t *adap, unsigned int addr, u32 mask, u32 val)
Definition: cxgb_t3_hw.c:103
int t3_mac_set_num_ucast(struct cmac *mac, unsigned char n)
Definition: cxgb_xgmac.c:359
int t3_ael2005_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps)
Definition: cxgb_t3_hw.c:3503
int t3_vsc7323_init(adapter_t *adap, int nports)
Definition: cxgb_vsc7323.c:113
int t3_check_fw_version(adapter_t *adapter)
Definition: cxgb_t3_hw.c:1232
int t3_vsc8211_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
Definition: cxgb_vsc8211.c:430
int t3_sge_disable_fl(adapter_t *adapter, unsigned int id)
Definition: cxgb_t3_hw.c:2744
int t3_mdio_change_bits(struct cphy *phy, int mmd, int reg, unsigned int clear, unsigned int set)
Definition: cxgb_t3_hw.c:372
@ SGE_TXQ_PER_SET
Definition: cxgb_common.h:117
@ SGE_RXQ_PER_SET
Definition: cxgb_common.h:116
@ SGE_QSETS
Definition: cxgb_common.h:115
void t3_read_hw_mtus(adapter_t *adap, unsigned short mtus[NMTUS])
Definition: cxgb_t3_hw.c:3461
int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data)
Definition: cxgb_t3_hw.c:658
int t3_get_fw_version(adapter_t *adapter, u32 *vers)
Definition: cxgb_t3_hw.c:1216
void t3_mac_disable_exact_filters(struct cmac *mac)
Definition: cxgb_xgmac.c:367
int t3_vsc7323_enable(adapter_t *adap, int port, int which)
Definition: cxgb_vsc7323.c:243
int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh)
Definition: cxgb_t3_hw.c:3302
void t3_sge_prep(adapter_t *adap, struct sge_params *p)
Definition: cxgb_sge.c:550
int t3_slow_intr_handler(adapter_t *adapter)
Definition: cxgb_t3_hw.c:2249
void t3_mac_enable_exact_filters(struct cmac *mac)
Definition: cxgb_xgmac.c:378
static int is_10G(const adapter_t *adap)
Definition: cxgb_common.h:652
int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index, u32 *size, void *data)
Definition: cxgb_t3_hw.c:4703
void t3_link_changed(adapter_t *adapter, int port_id)
Definition: cxgb_t3_hw.c:1522
static unsigned int core_ticks_per_usec(const adapter_t *adap)
Definition: cxgb_common.h:662
int t3_qt2045_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
static unsigned int t3_mc7_size(const struct mc7 *p)
Definition: cxgb_common.h:470
int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n, u32 *buf)
Definition: cxgb_mc5.c:392
int t3_sge_read_cq(adapter_t *adapter, unsigned int id, u32 data[4])
Definition: cxgb_t3_hw.c:2905
void t3_write_regs(adapter_t *adapter, const struct addr_val_pair *p, int n, unsigned int offset)
Definition: cxgb_t3_hw.c:84
void t3_failover_done(adapter_t *adapter, int port)
Definition: cxgb_t3_hw.c:4662
int t3_phy_reset(struct cphy *phy, int mmd, int wait)
Definition: cxgb_t3_hw.c:396
int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
Definition: cxgb_xgmac.c:475
int t3_vsc7323_set_mtu(adapter_t *adap, unsigned int mtu, int port)
Definition: cxgb_vsc7323.c:226
@ TP_VERSION_MAJOR
Definition: cxgb_common.h:75
@ TP_VERSION_MICRO
Definition: cxgb_common.h:77
@ TP_VERSION_MINOR
Definition: cxgb_common.h:76
int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc)
Definition: cxgb_xgmac.c:570
@ MAC_DIRECTION_RX
Definition: cxgb_common.h:496
@ MAC_RXFIFO_SIZE
Definition: cxgb_common.h:498
@ MAC_DIRECTION_TX
Definition: cxgb_common.h:497
int t3_sge_init_ecntxt(adapter_t *adapter, unsigned int id, int gts_enable, enum sge_context_type type, int respq, u64 base_addr, unsigned int size, unsigned int token, int gen, unsigned int cidx)
Definition: cxgb_t3_hw.c:2564
int t3_vsc7323_disable(adapter_t *adap, int port, int which)
Definition: cxgb_vsc7323.c:261
int t3_seeprom_write(adapter_t *adapter, u32 addr, u32 data)
Definition: cxgb_t3_hw.c:691
int t3_reset_adapter(adapter_t *adapter)
Definition: cxgb_t3_hw.c:4393
int t3_vsc7323_set_speed_fc(adapter_t *adap, int speed, int fc, int port)
Definition: cxgb_vsc7323.c:195
sge_context_type
Definition: cxgb_common.h:120
@ SGE_CNTXT_OFLD
Definition: cxgb_common.h:123
@ SGE_CNTXT_RDMA
Definition: cxgb_common.h:121
@ SGE_CNTXT_ETH
Definition: cxgb_common.h:122
@ SGE_CNTXT_CTRL
Definition: cxgb_common.h:124
int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6])
Definition: cxgb_xgmac.c:335
int t3_i2c_read8(adapter_t *adapter, int chained, u8 *valp)
Definition: cxgb_t3_hw.c:208
void t3_enable_filters(adapter_t *adap)
Definition: cxgb_t3_hw.c:3057
int t3_i2c_write8(adapter_t *adapter, int chained, u8 val)
Definition: cxgb_t3_hw.c:232
int t3_ael1002_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
Definition: cxgb_ael1002.c:345
void t3_mc5_prep(adapter_t *adapter, struct mc5 *mc5, int mode)
Definition: cxgb_mc5.c:473
int t3_read_vpd(adapter_t *adapter, struct generic_vpd *vpd)
Definition: cxgb_t3_hw.c:840
int t3_mac_enable(struct cmac *mac, int which)
Definition: cxgb_xgmac.c:648
int t3_aq100x_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
Definition: cxgb_aq100x.c:465
void t3_port_intr_disable(adapter_t *adapter, int idx)
Definition: cxgb_t3_hw.c:2459
int t3_ael2020_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
static unsigned int t3_mc5_size(const struct mc5 *p)
Definition: cxgb_common.h:456
int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc)
Definition: cxgb_t3_hw.c:1674
static int uses_xaui(const adapter_t *adap)
Definition: cxgb_common.h:647
int t3_sge_cqcntxt_op(adapter_t *adapter, unsigned int id, unsigned int op, unsigned int credits)
Definition: cxgb_t3_hw.c:2822
int t3_mac_init(struct cmac *mac)
Definition: cxgb_xgmac.c:141
int t3_mi1_read(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int *valp)
Definition: cxgb_t3_hw.c:264
@ PHY_LINK_DOWN
Definition: cxgb_common.h:548
@ PHY_LINK_UP
Definition: cxgb_common.h:549
@ PHY_LINK_PARTIAL
Definition: cxgb_common.h:550
int t3_ael1006_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
Definition: cxgb_ael1002.c:427
void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED])
Definition: cxgb_t3_hw.c:3516
void t3_failover_clear(adapter_t *adapter)
Definition: cxgb_t3_hw.c:4668
void early_hw_init(adapter_t *adapter, const struct adapter_info *ai)
Definition: cxgb_t3_hw.c:4359
void t3_intr_clear(adapter_t *adapter)
Definition: cxgb_t3_hw.c:2384
int t3_sge_init_rspcntxt(adapter_t *adapter, unsigned int id, int irq_vec_idx, u64 base_addr, unsigned int size, unsigned int fl_thres, int gen, unsigned int cidx)
Definition: cxgb_t3_hw.c:2646
@ MC5_MIN_TIDS
Definition: cxgb_common.h:348
int t3_mps_set_active_ports(adapter_t *adap, unsigned int port_mask)
Definition: cxgb_t3_hw.c:3832
int t3_mac_disable(struct cmac *mac, int which)
Definition: cxgb_xgmac.c:700
@ EEPROMSIZE
Definition: cxgb_common.h:39
@ TCB_SIZE
Definition: cxgb_common.h:43
@ NCCTRL_WIN
Definition: cxgb_common.h:45
@ ECNUM_LEN
Definition: cxgb_common.h:41
@ NMTUS
Definition: cxgb_common.h:44
@ EXACT_ADDR_FILTERS
Definition: cxgb_common.h:48
@ SERNUM_LEN
Definition: cxgb_common.h:40
@ RSS_TABLE_SIZE
Definition: cxgb_common.h:42
@ MAX_FRAME_SIZE
Definition: cxgb_common.h:38
@ NTX_SCHED
Definition: cxgb_common.h:46
@ PROTO_SRAM_LINES
Definition: cxgb_common.h:47
int t3_phy_lasi_intr_handler(struct cphy *phy)
Definition: cxgb_t3_hw.c:535
int t3_sge_read_rspq(adapter_t *adapter, unsigned int id, u32 data[4])
Definition: cxgb_t3_hw.c:2937
static int is_offload(const adapter_t *adap)
Definition: cxgb_common.h:657
int t3_sge_read_fl(adapter_t *adapter, unsigned int id, u32 data[4])
Definition: cxgb_t3_hw.c:2921
int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, unsigned int nroutes)
Definition: cxgb_mc5.c:329
@ cphy_cause_fifo_error
Definition: cxgb_common.h:531
@ cphy_cause_module_change
Definition: cxgb_common.h:532
@ cphy_cause_link_change
Definition: cxgb_common.h:530
@ cphy_cause_alarm
Definition: cxgb_common.h:533
@ MC5_MODE_144_BIT
Definition: cxgb_common.h:343
@ MC5_MODE_72_BIT
Definition: cxgb_common.h:344
static unsigned int is_pcie(const adapter_t *adap)
Definition: cxgb_common.h:673
int t3_phy_lasi_intr_clear(struct cphy *phy)
Definition: cxgb_t3_hw.c:528
int t3_init_hw(adapter_t *adapter, u32 fw_params)
Definition: cxgb_t3_hw.c:4147
void t3_get_cong_cntl_tab(adapter_t *adap, unsigned short incr[NMTUS][NCCTRL_WIN])
Definition: cxgb_t3_hw.c:3482
int t3_sge_read_ecntxt(adapter_t *adapter, unsigned int id, u32 data[4])
Definition: cxgb_t3_hw.c:2889
void t3_config_trace_filter(adapter_t *adapter, const struct trace_params *tp, int filter_index, int invert, int enable)
Definition: cxgb_t3_hw.c:3607
const struct mac_stats * t3_vsc7323_update_stats(struct cmac *mac)
Definition: cxgb_vsc7323.c:286
@ TX_ALARM_STAT
Definition: cxgb_common.h:518
@ RX_ALARM_CTRL
Definition: cxgb_common.h:514
@ LASI_STAT
Definition: cxgb_common.h:519
@ RX_ALARM_STAT
Definition: cxgb_common.h:517
@ TX_ALARM_CTRL
Definition: cxgb_common.h:515
@ LASI_CTRL
Definition: cxgb_common.h:516
int t3_prep_adapter(adapter_t *adapter, const struct adapter_info *ai, int reset)
Definition: cxgb_t3_hw.c:4461
int t3_set_sched_ipg(adapter_t *adap, int sched, unsigned int ipg)
Definition: cxgb_t3_hw.c:3736
int t3_phy_advertise(struct cphy *phy, unsigned int advert)
Definition: cxgb_t3_hw.c:425
int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size)
Definition: cxgb_t3_hw.c:1184
#define MAX_PHYINTRS
Definition: cxgb_common.h:145
void t3_port_intr_enable(adapter_t *adapter, int idx)
Definition: cxgb_t3_hw.c:2443
int t3_xaui_direct_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
int t3_get_vpd_len(adapter_t *adapter, struct generic_vpd *vpd)
Definition: cxgb_t3_hw.c:808
void t3_intr_enable(adapter_t *adapter)
Definition: cxgb_t3_hw.c:2320
static int t3_wait_op_done(adapter_t *adapter, int reg, u32 mask, int polarity, int attempts, int delay)
Definition: cxgb_common.h:684
int t3_cim_ctl_blk_read(adapter_t *adap, unsigned int addr, unsigned int n, unsigned int *valp)
Definition: cxgb_t3_hw.c:1420
void t3_xgm_intr_disable(adapter_t *adapter, int idx)
Definition: cxgb_t3_hw.c:2427
#define adapter_info(adap)
Definition: cxgb_common.h:645
void t3_mc5_intr_handler(struct mc5 *mc5)
Definition: cxgb_mc5.c:430
int t3_sge_disable_cqcntxt(adapter_t *adapter, unsigned int id)
Definition: cxgb_t3_hw.c:2792
@ phy_modtype_lrm
Definition: cxgb_common.h:541
@ phy_modtype_none
Definition: cxgb_common.h:538
@ phy_modtype_unknown
Definition: cxgb_common.h:544
@ phy_modtype_twinax
Definition: cxgb_common.h:542
@ phy_modtype_twinax_long
Definition: cxgb_common.h:543
@ phy_modtype_sr
Definition: cxgb_common.h:539
@ phy_modtype_lr
Definition: cxgb_common.h:540
@ T3_REV_B2
Definition: cxgb_common.h:410
@ T3_REV_A
Definition: cxgb_common.h:408
@ T3_REV_C
Definition: cxgb_common.h:411
@ T3_REV_B
Definition: cxgb_common.h:409
@ DEFAULT_NSERVERS
Definition: cxgb_common.h:337
@ DEFAULT_NFILTERS
Definition: cxgb_common.h:338
@ MDIO_DEV_XGXS
Definition: cxgb_common.h:506
@ MDIO_DEV_VEND1
Definition: cxgb_common.h:508
@ MDIO_DEV_ANEG
Definition: cxgb_common.h:507
@ MDIO_DEV_PMA_PMD
Definition: cxgb_common.h:503
@ MDIO_DEV_PCS
Definition: cxgb_common.h:505
@ MDIO_DEV_VEND2
Definition: cxgb_common.h:509
@ MDIO_DEV_WIS
Definition: cxgb_common.h:504
@ STAT_ULP_CH1_PBL_OOB
Definition: cxgb_common.h:68
@ STAT_PCI_CORR_ECC
Definition: cxgb_common.h:69
@ IRQ_NUM_STATS
Definition: cxgb_common.h:71
@ STAT_ULP_CH0_PBL_OOB
Definition: cxgb_common.h:67
void t3_port_failover(adapter_t *adapter, int port)
Definition: cxgb_t3_hw.c:4653
static int mdio_write(struct cphy *phy, int mmd, int reg, unsigned int val)
Definition: cxgb_common.h:598
int t3_vsc8211_fifo_depth(adapter_t *adap, unsigned int mtu, int port)
Definition: cxgb_vsc8211.c:394
void t3c_pcs_force_los(struct cmac *mac)
Definition: cxgb_xgmac.c:108
int t3_phy_lasi_intr_enable(struct cphy *phy)
Definition: cxgb_t3_hw.c:518
void t3_xgm_intr_enable(adapter_t *adapter, int idx)
Definition: cxgb_t3_hw.c:2419
@ IMMED_PKT_SIZE
Definition: cxgb_common.h:129
@ AN_PKT_SIZE
Definition: cxgb_common.h:128
int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert)
Definition: cxgb_t3_hw.c:468
@ FW_VERSION_MICRO
Definition: cxgb_common.h:101
@ FW_VERSION_MINOR
Definition: cxgb_common.h:100
@ FW_VERSION_MAJOR
Definition: cxgb_common.h:99
void t3_get_tx_sched(adapter_t *adap, unsigned int sched, unsigned int *kbps, unsigned int *ipg)
Definition: cxgb_t3_hw.c:3766
int t3_check_tpsram_version(adapter_t *adapter)
Definition: cxgb_t3_hw.c:1145
@ SUPPORTED_LINK_IRQ
Definition: cxgb_common.h:60
@ SUPPORTED_IRQ
Definition: cxgb_common.h:63
@ SUPPORTED_MISC_IRQ
Definition: cxgb_common.h:62
int t3_load_boot(adapter_t *adapter, u8 *fw_data, unsigned int size)
Definition: cxgb_t3_hw.c:1361
@ LA_CTRL
Definition: cxgb_common.h:105
@ LA_ENTRIES
Definition: cxgb_common.h:107
@ LA_DATA
Definition: cxgb_common.h:106
int t3_sge_enable_ecntxt(adapter_t *adapter, unsigned int id, int enable)
Definition: cxgb_t3_hw.c:2720
void t3_config_rss(adapter_t *adapter, unsigned int rss_config, const u8 *cpus, const u16 *rspq)
Definition: cxgb_t3_hw.c:2956
void t3_led_ready(adapter_t *adapter)
Definition: cxgb_t3_hw.c:4647
int t3_elmr_blk_write(adapter_t *adap, int start, const u32 *vals, int n)
Definition: cxgb_vsc7323.c:53
int t3_phy_lasi_intr_disable(struct cphy *phy)
Definition: cxgb_t3_hw.c:523
void t3_fatal_err(adapter_t *adapter)
Definition: cxgb_main.c:1134
void t3_sge_init(adapter_t *adap, struct sge_params *p)
Definition: cxgb_sge.c:430
int t3_vsc7323_set_addr(adapter_t *adap, u8 addr[6], int port)
Definition: cxgb_vsc7323.c:231
void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals, unsigned int start, unsigned int n)
Definition: cxgb_t3_hw.c:3535
const struct mac_stats * t3_mac_update_stats(struct cmac *mac)
Definition: cxgb_xgmac.c:800
void mac_prep(struct cmac *mac, adapter_t *adapter, int index)
Definition: cxgb_t3_hw.c:4319
@ PCI_VARIANT_PCIE
Definition: cxgb_common.h:384
@ PCI_VARIANT_PCIX_MODE1_PARITY
Definition: cxgb_common.h:381
@ PCI_VARIANT_PCIX_266_MODE2
Definition: cxgb_common.h:383
@ PCI_VARIANT_PCI
Definition: cxgb_common.h:380
@ PCI_VARIANT_PCIX_MODE1_ECC
Definition: cxgb_common.h:382
int t3_config_sched(adapter_t *adap, unsigned int kbps, int sched)
Definition: cxgb_t3_hw.c:3692
int t3_wait_op_done_val(adapter_t *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp)
Definition: cxgb_t3_hw.c:55
void t3b_pcs_reset(struct cmac *mac)
Definition: cxgb_xgmac.c:97
int t3_mi1_write(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int val)
Definition: cxgb_t3_hw.c:284
int t3_sge_init_flcntxt(adapter_t *adapter, unsigned int id, int gts_enable, u64 base_addr, unsigned int size, unsigned int esize, unsigned int cong_thres, int gen, unsigned int cidx)
Definition: cxgb_t3_hw.c:2607
int t3_mac_set_rx_mode(struct cmac *mac, struct t3_rx_mode *rm)
Definition: cxgb_xgmac.c:434
int t3_elmr_blk_read(adapter_t *adap, int start, u32 *vals, int n)
Definition: cxgb_vsc7323.c:76
@ PHY_LOOPBACK_TX
Definition: cxgb_common.h:524
@ PHY_LOOPBACK_RX
Definition: cxgb_common.h:525
void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size)
Definition: cxgb_t3_hw.c:3332
int t3_read_rss(adapter_t *adapter, u8 *lkup, u16 *map)
Definition: cxgb_t3_hw.c:2992
int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex)
Definition: cxgb_t3_hw.c:492
int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n, u64 *buf)
Definition: cxgb_t3_hw.c:144
int t3_get_tp_version(adapter_t *adapter, u32 *vers)
Definition: cxgb_t3_hw.c:1124
const struct adapter_info * t3_get_adapter_info(unsigned int board_id)
Definition: cxgb_t3_hw.c:587
int t3_reinit_adapter(adapter_t *adap)
Definition: cxgb_t3_hw.c:4608
int t3_mv88e1xxx_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
static unsigned int dack_ticks_to_usec(const adapter_t *adap, unsigned int ticks)
Definition: cxgb_common.h:667
void t3_load_mtus(adapter_t *adap, unsigned short mtus[NMTUS], unsigned short alpha[NCCTRL_WIN], unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap)
Definition: cxgb_t3_hw.c:3422
int t3_tn1010_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
Definition: cxgb_tn1010.c:214
int t3_sge_init_cqcntxt(adapter_t *adapter, unsigned int id, u64 base_addr, unsigned int size, int rspq, int ovfl_mode, unsigned int credits, unsigned int credit_thres)
Definition: cxgb_t3_hw.c:2689
int t3_read_flash(adapter_t *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented)
Definition: cxgb_t3_hw.c:1037
void t3_set_vlan_accel(adapter_t *adapter, unsigned int ports, int on)
Definition: cxgb_t3_hw.c:1718
int t3b2_mac_watchdog_task(struct cmac *mac)
Definition: cxgb_xgmac.c:723
static void cphy_init(struct cphy *phy, adapter_t *adapter, pinfo_t *pinfo, int phy_addr, struct cphy_ops *phy_ops, const struct mdio_ops *mdio_ops, unsigned int caps, const char *desc)
Definition: cxgb_common.h:605
@ MAX_VPD_BYTES
Definition: cxgb_common.h:369
int t3_sge_disable_rspcntxt(adapter_t *adapter, unsigned int id)
Definition: cxgb_t3_hw.c:2768
void t3_intr_disable(adapter_t *adapter)
Definition: cxgb_t3_hw.c:2371
void t3_tp_set_offload_mode(adapter_t *adap, int enable)
Definition: cxgb_t3_hw.c:3027
int t3_seeprom_wp(adapter_t *adapter, int enable)
Definition: cxgb_t3_hw.c:723
void t3_port_intr_clear(adapter_t *adapter, int idx)
Definition: cxgb_t3_hw.c:2475
uint32_t __be32
Definition: cxgb_osdep.h:210
@ MAX_NPORTS
Definition: cxgb_osdep.h:56
#define SUPPORTED_AUI
Definition: cxgb_osdep.h:232
uint64_t u64
Definition: cxgb_osdep.h:203
uint64_t __be64
Definition: cxgb_osdep.h:211
#define SUPPORTED_10000baseT_Full
Definition: cxgb_osdep.h:236
uint8_t u8
Definition: cxgb_osdep.h:200
uint16_t u16
Definition: cxgb_osdep.h:201
uint32_t u32
Definition: cxgb_osdep.h:202
unsigned char nports0
Definition: cxgb_common.h:157
unsigned char gpio_intr[MAX_PHYINTRS]
Definition: cxgb_common.h:161
unsigned char nports1
Definition: cxgb_common.h:158
unsigned int gpio_out
Definition: cxgb_common.h:160
const char * desc
Definition: cxgb_common.h:164
const struct mdio_ops * mdio_ops
Definition: cxgb_common.h:163
unsigned long caps
Definition: cxgb_common.h:162
unsigned char phy_base_addr
Definition: cxgb_common.h:159
unsigned int stats_update_period
Definition: cxgb_common.h:401
unsigned int rev
Definition: cxgb_common.h:403
unsigned short a_wnd[NCCTRL_WIN]
Definition: cxgb_common.h:397
struct tp_params tp
Definition: cxgb_common.h:390
unsigned int chan_map
Definition: cxgb_common.h:400
unsigned short mtus[NMTUS]
Definition: cxgb_common.h:396
const struct adapter_info * info
Definition: cxgb_common.h:394
unsigned int nports
Definition: cxgb_common.h:399
struct pci_params pci
Definition: cxgb_common.h:392
unsigned int offload
Definition: cxgb_common.h:404
unsigned int linkpoll_period
Definition: cxgb_common.h:402
struct vpd_params vpd
Definition: cxgb_common.h:391
unsigned short b_wnd[NCCTRL_WIN]
Definition: cxgb_common.h:398
struct adapter_params params
Definition: cxgb_adapter.h:362
unsigned int reg_addr
Definition: cxgb_common.h:632
unsigned int val
Definition: cxgb_common.h:633
unsigned char promisc_map
Definition: cxgb_common.h:481
u64 rx_mcnt
Definition: cxgb_common.h:487
unsigned int tx_tcnt
Definition: cxgb_common.h:482
unsigned char ext_port
Definition: cxgb_common.h:480
struct mac_stats stats
Definition: cxgb_common.h:492
unsigned char multiport
Definition: cxgb_common.h:479
unsigned char nucast
Definition: cxgb_common.h:478
unsigned int txen
Definition: cxgb_common.h:489
u64 rx_pause
Definition: cxgb_common.h:491
unsigned int tx_xcnt
Definition: cxgb_common.h:483
u64 tx_mcnt
Definition: cxgb_common.h:484
unsigned int offset
Definition: cxgb_common.h:477
unsigned int toggle_cnt
Definition: cxgb_common.h:488
unsigned int rx_ocnt
Definition: cxgb_common.h:486
unsigned int was_reset
Definition: cxgb_common.h:490
unsigned int rx_xcnt
Definition: cxgb_common.h:485
adapter_t * adapter
Definition: cxgb_common.h:476
int(* set_loopback)(struct cphy *phy, int mmd, int dir, int enable)
Definition: cxgb_common.h:566
int(* power_down)(struct cphy *phy, int enable)
Definition: cxgb_common.h:570
int(* reset)(struct cphy *phy, int wait)
Definition: cxgb_common.h:555
int(* autoneg_restart)(struct cphy *phy)
Definition: cxgb_common.h:563
int(* intr_disable)(struct cphy *phy)
Definition: cxgb_common.h:558
int(* intr_handler)(struct cphy *phy)
Definition: cxgb_common.h:560
int(* intr_enable)(struct cphy *phy)
Definition: cxgb_common.h:557
int(* advertise)(struct cphy *phy, unsigned int advertise_map)
Definition: cxgb_common.h:565
int(* set_speed_duplex)(struct cphy *phy, int speed, int duplex)
Definition: cxgb_common.h:567
int(* autoneg_enable)(struct cphy *phy)
Definition: cxgb_common.h:562
int(* intr_clear)(struct cphy *phy)
Definition: cxgb_common.h:559
int(* get_link_status)(struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc)
Definition: cxgb_common.h:568
int(* mdio_read)(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int *val)
Definition: cxgb_common.h:585
u8 modtype
Definition: cxgb_common.h:576
unsigned int caps
Definition: cxgb_common.h:579
int(* mdio_write)(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int val)
Definition: cxgb_common.h:587
unsigned int priv
Definition: cxgb_common.h:578
u8 addr
Definition: cxgb_common.h:575
pinfo_t * pinfo
Definition: cxgb_common.h:581
const struct cphy_ops * ops
Definition: cxgb_common.h:584
adapter_t * adapter
Definition: cxgb_common.h:580
unsigned long fifo_errors
Definition: cxgb_common.h:583
const char * desc
Definition: cxgb_common.h:582
u8 rst
Definition: cxgb_common.h:577
unsigned long rx_fifo_ovfl
Definition: cxgb_common.h:239
unsigned long num_toggled
Definition: cxgb_common.h:244
u64 rx_pause
Definition: cxgb_common.h:214
u64 rx_frames_64
Definition: cxgb_common.h:226
u64 rx_frames_1519_max
Definition: cxgb_common.h:232
u64 tx_frames_128_255
Definition: cxgb_common.h:203
u64 tx_frames_256_511
Definition: cxgb_common.h:204
u64 rx_frames_512_1023
Definition: cxgb_common.h:230
unsigned long xaui_pcs_align_change
Definition: cxgb_common.h:242
u64 tx_underrun
Definition: cxgb_common.h:195
u64 rx_bcast_frames
Definition: cxgb_common.h:213
u64 tx_frames_1024_1518
Definition: cxgb_common.h:206
u64 rx_cong_drops
Definition: cxgb_common.h:234
unsigned long tx_fifo_parity_err
Definition: cxgb_common.h:236
u64 tx_excess_deferral
Definition: cxgb_common.h:198
u64 rx_frames_256_511
Definition: cxgb_common.h:229
u64 tx_frames_64
Definition: cxgb_common.h:201
u64 rx_octets
Definition: cxgb_common.h:209
unsigned long link_faults
Definition: cxgb_common.h:247
u64 tx_frames_65_127
Definition: cxgb_common.h:202
u64 rx_octets_bad
Definition: cxgb_common.h:210
u64 rx_frames_1024_1518
Definition: cxgb_common.h:231
u64 rx_fcs_errs
Definition: cxgb_common.h:215
u64 tx_octets_bad
Definition: cxgb_common.h:186
u64 tx_bcast_frames
Definition: cxgb_common.h:189
u64 tx_total_collisions
Definition: cxgb_common.h:193
u64 tx_late_collisions
Definition: cxgb_common.h:192
u64 rx_too_long
Definition: cxgb_common.h:223
u64 tx_pause
Definition: cxgb_common.h:190
unsigned long xaui_pcs_ctc_err
Definition: cxgb_common.h:241
unsigned long rx_fifo_parity_err
Definition: cxgb_common.h:237
unsigned long serdes_signal_loss
Definition: cxgb_common.h:240
u64 rx_jabber
Definition: cxgb_common.h:221
u64 rx_mcast_frames
Definition: cxgb_common.h:212
u64 rx_frames
Definition: cxgb_common.h:211
u64 rx_short
Definition: cxgb_common.h:222
u64 rx_frames_128_255
Definition: cxgb_common.h:228
u64 tx_octets
Definition: cxgb_common.h:185
u64 tx_frames
Definition: cxgb_common.h:187
u64 rx_mac_internal_errs
Definition: cxgb_common.h:224
u64 tx_fcs_errs
Definition: cxgb_common.h:199
u64 tx_frames_1519_max
Definition: cxgb_common.h:207
unsigned long num_resets
Definition: cxgb_common.h:245
unsigned long tx_fifo_urun
Definition: cxgb_common.h:238
u64 tx_mac_internal_errs
Definition: cxgb_common.h:197
u64 tx_mcast_frames
Definition: cxgb_common.h:188
u64 tx_len_errs
Definition: cxgb_common.h:196
u64 tx_deferred
Definition: cxgb_common.h:191
u64 tx_excess_collisions
Definition: cxgb_common.h:194
u64 rx_sequence_errs
Definition: cxgb_common.h:219
u64 tx_frames_512_1023
Definition: cxgb_common.h:205
u64 rx_align_errs
Definition: cxgb_common.h:216
u64 rx_symbol_errs
Definition: cxgb_common.h:217
u64 rx_data_errs
Definition: cxgb_common.h:218
u64 rx_frames_65_127
Definition: cxgb_common.h:227
unsigned int nservers
Definition: cxgb_common.h:330
unsigned int nroutes
Definition: cxgb_common.h:332
unsigned int mode
Definition: cxgb_common.h:329
unsigned int nfilters
Definition: cxgb_common.h:331
unsigned long parity_err
Definition: cxgb_common.h:168
unsigned long nfa_srch_err
Definition: cxgb_common.h:170
unsigned long del_act_empty
Definition: cxgb_common.h:174
unsigned long dispq_parity_err
Definition: cxgb_common.h:173
unsigned long unknown_cmd
Definition: cxgb_common.h:171
unsigned long reqq_parity_err
Definition: cxgb_common.h:172
unsigned long active_rgn_full
Definition: cxgb_common.h:169
unsigned char part_type
Definition: cxgb_common.h:450
unsigned int tcam_size
Definition: cxgb_common.h:449
unsigned char parity_enabled
Definition: cxgb_common.h:451
adapter_t * adapter
Definition: cxgb_common.h:448
struct mc5_stats stats
Definition: cxgb_common.h:453
unsigned char mode
Definition: cxgb_common.h:452
unsigned long addr_err
Definition: cxgb_common.h:181
unsigned long corr_err
Definition: cxgb_common.h:178
unsigned long parity_err
Definition: cxgb_common.h:180
unsigned long uncorr_err
Definition: cxgb_common.h:179
unsigned int size
Definition: cxgb_common.h:463
adapter_t * adapter
Definition: cxgb_common.h:462
unsigned int width
Definition: cxgb_common.h:464
const char * name
Definition: cxgb_common.h:466
unsigned int offset
Definition: cxgb_common.h:465
struct mc7_stats stats
Definition: cxgb_common.h:467
int(* write)(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int val)
Definition: cxgb_common.h:152
int(* read)(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr, unsigned int *val)
Definition: cxgb_common.h:150
unsigned int vpd_cap_addr
Definition: cxgb_common.h:372
unsigned int pcie_cap_addr
Definition: cxgb_common.h:373
unsigned short speed
Definition: cxgb_common.h:374
unsigned char width
Definition: cxgb_common.h:375
unsigned char variant
Definition: cxgb_common.h:376
unsigned int polling
Definition: cxgb_common.h:311
unsigned int vector
Definition: cxgb_common.h:320
unsigned int jumbo_size
Definition: cxgb_common.h:316
unsigned int lro
Definition: cxgb_common.h:312
unsigned int coalesce_usecs
Definition: cxgb_common.h:313
unsigned int fl_size
Definition: cxgb_common.h:315
unsigned int rspq_size
Definition: cxgb_common.h:314
unsigned int cong_thres
Definition: cxgb_common.h:319
unsigned int jumbo_buf_size
Definition: cxgb_common.h:317
unsigned int txq_size[SGE_TXQ_PER_SET]
Definition: cxgb_common.h:318
__be64 addr[2]
Definition: cxgb_common.h:134
__be32 len[2]
Definition: cxgb_common.h:133
struct qset_params qset[SGE_QSETS]
Definition: cxgb_common.h:325
unsigned int max_pkt_size
Definition: cxgb_common.h:324
u32 tcpRetransSeg_lo
Definition: cxgb_common.h:287
u32 ipInDiscards_lo
Definition: cxgb_common.h:260
u32 ipInUnknownProtos_lo
Definition: cxgb_common.h:258
u32 ipInDelivers_lo
Definition: cxgb_common.h:262
u32 tcpEstabResets
Definition: cxgb_common.h:279
u32 ipInAddrErrors_lo
Definition: cxgb_common.h:256
u32 tcpPassiveOpens
Definition: cxgb_common.h:277
u32 ipInDiscards_hi
Definition: cxgb_common.h:259
u32 ipInDelivers_hi
Definition: cxgb_common.h:261
u32 reserved[8]
Definition: cxgb_common.h:274
u32 ipOutNoRoutes_lo
Definition: cxgb_common.h:268
u32 ipInHdrErrors_hi
Definition: cxgb_common.h:253
u32 ipOutDiscards_hi
Definition: cxgb_common.h:265
u32 ipOutDiscards_lo
Definition: cxgb_common.h:266
u32 tcpAttemptFails
Definition: cxgb_common.h:278
u32 ipInHdrErrors_lo
Definition: cxgb_common.h:254
u32 tcpActiveOpens
Definition: cxgb_common.h:276
u32 ipOutNoRoutes_hi
Definition: cxgb_common.h:267
u32 ipInReceive_hi
Definition: cxgb_common.h:251
u32 ipInUnknownProtos_hi
Definition: cxgb_common.h:257
u32 ipInReceive_lo
Definition: cxgb_common.h:252
u32 tcpRetransSeg_hi
Definition: cxgb_common.h:286
u32 ipOutRequests_hi
Definition: cxgb_common.h:263
u32 ipReasmTimeout
Definition: cxgb_common.h:269
u32 ipInAddrErrors_hi
Definition: cxgb_common.h:255
u32 ipOutRequests_lo
Definition: cxgb_common.h:264
unsigned int pmtx_size
Definition: cxgb_common.h:297
unsigned int rx_num_pgs
Definition: cxgb_common.h:303
unsigned int rx_pg_size
Definition: cxgb_common.h:301
unsigned int ntimer_qs
Definition: cxgb_common.h:305
unsigned int tx_pg_size
Definition: cxgb_common.h:302
unsigned int nchan
Definition: cxgb_common.h:295
unsigned int chan_tx_size
Definition: cxgb_common.h:300
unsigned int cm_size
Definition: cxgb_common.h:298
unsigned int tx_num_pgs
Definition: cxgb_common.h:304
unsigned int dack_re
Definition: cxgb_common.h:307
unsigned int tre
Definition: cxgb_common.h:306
unsigned int chan_rx_size
Definition: cxgb_common.h:299
unsigned int pmrx_size
Definition: cxgb_common.h:296
u8 sn[SERNUM_LEN+1]
Definition: cxgb_common.h:356
u8 ec[ECNUM_LEN+1]
Definition: cxgb_common.h:357
unsigned int uclk
Definition: cxgb_common.h:353
unsigned int mclk
Definition: cxgb_common.h:352
unsigned short xauicfg[2]
Definition: cxgb_common.h:360
u8 port_type[MAX_NPORTS]
Definition: cxgb_common.h:359
unsigned int mdc
Definition: cxgb_common.h:354
u8 eth_base[6]
Definition: cxgb_common.h:358
unsigned int mem_timing
Definition: cxgb_common.h:355
unsigned int cclk
Definition: cxgb_common.h:351