This source file includes following definitions.
- t3_mc5_size
- t3_mc7_size
- t3_mdio_read
- t3_mdio_write
- cphy_init
- uses_xaui
- is_10G
- is_offload
- core_ticks_per_usec
- is_pcie
- t3_wait_op_done
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #ifndef __CHELSIO_COMMON_H
33 #define __CHELSIO_COMMON_H
34
35 #include <linux/kernel.h>
36 #include <linux/types.h>
37 #include <linux/ctype.h>
38 #include <linux/delay.h>
39 #include <linux/netdevice.h>
40 #include <linux/ethtool.h>
41 #include <linux/mdio.h>
42 #include "version.h"
43
44 #define CH_ERR(adap, fmt, ...) dev_err(&adap->pdev->dev, fmt, ##__VA_ARGS__)
45 #define CH_WARN(adap, fmt, ...) dev_warn(&adap->pdev->dev, fmt, ##__VA_ARGS__)
46 #define CH_ALERT(adap, fmt, ...) dev_alert(&adap->pdev->dev, fmt, ##__VA_ARGS__)
47
48
49
50
51
52 #define CH_MSG(adapter, level, category, fmt, ...) do { \
53 if ((adapter)->msg_enable & NETIF_MSG_##category) \
54 dev_printk(KERN_##level, &adapter->pdev->dev, fmt, \
55 ## __VA_ARGS__); \
56 } while (0)
57
58 #ifdef DEBUG
59 # define CH_DBG(adapter, category, fmt, ...) \
60 CH_MSG(adapter, DEBUG, category, fmt, ## __VA_ARGS__)
61 #else
62 # define CH_DBG(adapter, category, fmt, ...)
63 #endif
64
65
66 #define NETIF_MSG_MMIO 0x8000000
67
68 enum {
69 MAX_NPORTS = 2,
70 MAX_FRAME_SIZE = 10240,
71 EEPROMSIZE = 8192,
72 SERNUM_LEN = 16,
73 RSS_TABLE_SIZE = 64,
74 TCB_SIZE = 128,
75 NMTUS = 16,
76 NCCTRL_WIN = 32,
77 PROTO_SRAM_LINES = 128,
78 };
79
80 #define MAX_RX_COALESCING_LEN 12288U
81
82 enum {
83 PAUSE_RX = 1 << 0,
84 PAUSE_TX = 1 << 1,
85 PAUSE_AUTONEG = 1 << 2
86 };
87
88 enum {
89 SUPPORTED_IRQ = 1 << 24
90 };
91
92 enum {
93 STAT_ULP_CH0_PBL_OOB,
94 STAT_ULP_CH1_PBL_OOB,
95 STAT_PCI_CORR_ECC,
96
97 IRQ_NUM_STATS
98 };
99
100 #define TP_VERSION_MAJOR 1
101 #define TP_VERSION_MINOR 1
102 #define TP_VERSION_MICRO 0
103
104 #define S_TP_VERSION_MAJOR 16
105 #define M_TP_VERSION_MAJOR 0xFF
106 #define V_TP_VERSION_MAJOR(x) ((x) << S_TP_VERSION_MAJOR)
107 #define G_TP_VERSION_MAJOR(x) \
108 (((x) >> S_TP_VERSION_MAJOR) & M_TP_VERSION_MAJOR)
109
110 #define S_TP_VERSION_MINOR 8
111 #define M_TP_VERSION_MINOR 0xFF
112 #define V_TP_VERSION_MINOR(x) ((x) << S_TP_VERSION_MINOR)
113 #define G_TP_VERSION_MINOR(x) \
114 (((x) >> S_TP_VERSION_MINOR) & M_TP_VERSION_MINOR)
115
116 #define S_TP_VERSION_MICRO 0
117 #define M_TP_VERSION_MICRO 0xFF
118 #define V_TP_VERSION_MICRO(x) ((x) << S_TP_VERSION_MICRO)
119 #define G_TP_VERSION_MICRO(x) \
120 (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
121
122 enum {
123 SGE_QSETS = 8,
124 SGE_RXQ_PER_SET = 2,
125 SGE_TXQ_PER_SET = 3
126 };
127
128 enum sge_context_type {
129 SGE_CNTXT_RDMA = 0,
130 SGE_CNTXT_ETH = 2,
131 SGE_CNTXT_OFLD = 4,
132 SGE_CNTXT_CTRL = 5
133 };
134
135 enum {
136 AN_PKT_SIZE = 32,
137 IMMED_PKT_SIZE = 48
138 };
139
140 struct sg_ent {
141 __be32 len[2];
142 __be64 addr[2];
143 };
144
145 #ifndef SGE_NUM_GENBITS
146
147 # define SGE_NUM_GENBITS 2
148 #endif
149
150 #define TX_DESC_FLITS 16U
151 #define WR_FLITS (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)
152
153 struct cphy;
154 struct adapter;
155
156 struct mdio_ops {
157 int (*read)(struct net_device *dev, int phy_addr, int mmd_addr,
158 u16 reg_addr);
159 int (*write)(struct net_device *dev, int phy_addr, int mmd_addr,
160 u16 reg_addr, u16 val);
161 unsigned mode_support;
162 };
163
164 struct adapter_info {
165 unsigned char nports0;
166 unsigned char nports1;
167 unsigned char phy_base_addr;
168 unsigned int gpio_out;
169 unsigned char gpio_intr[MAX_NPORTS];
170 unsigned long caps;
171 const struct mdio_ops *mdio_ops;
172 const char *desc;
173 };
174
175 struct mc5_stats {
176 unsigned long parity_err;
177 unsigned long active_rgn_full;
178 unsigned long nfa_srch_err;
179 unsigned long unknown_cmd;
180 unsigned long reqq_parity_err;
181 unsigned long dispq_parity_err;
182 unsigned long del_act_empty;
183 };
184
185 struct mc7_stats {
186 unsigned long corr_err;
187 unsigned long uncorr_err;
188 unsigned long parity_err;
189 unsigned long addr_err;
190 };
191
192 struct mac_stats {
193 u64 tx_octets;
194 u64 tx_octets_bad;
195 u64 tx_frames;
196 u64 tx_mcast_frames;
197 u64 tx_bcast_frames;
198 u64 tx_pause;
199 u64 tx_deferred;
200 u64 tx_late_collisions;
201 u64 tx_total_collisions;
202 u64 tx_excess_collisions;
203 u64 tx_underrun;
204 u64 tx_len_errs;
205 u64 tx_mac_internal_errs;
206 u64 tx_excess_deferral;
207 u64 tx_fcs_errs;
208
209 u64 tx_frames_64;
210 u64 tx_frames_65_127;
211 u64 tx_frames_128_255;
212 u64 tx_frames_256_511;
213 u64 tx_frames_512_1023;
214 u64 tx_frames_1024_1518;
215 u64 tx_frames_1519_max;
216
217 u64 rx_octets;
218 u64 rx_octets_bad;
219 u64 rx_frames;
220 u64 rx_mcast_frames;
221 u64 rx_bcast_frames;
222 u64 rx_pause;
223 u64 rx_fcs_errs;
224 u64 rx_align_errs;
225 u64 rx_symbol_errs;
226 u64 rx_data_errs;
227 u64 rx_sequence_errs;
228 u64 rx_runt;
229 u64 rx_jabber;
230 u64 rx_short;
231 u64 rx_too_long;
232 u64 rx_mac_internal_errs;
233
234 u64 rx_frames_64;
235 u64 rx_frames_65_127;
236 u64 rx_frames_128_255;
237 u64 rx_frames_256_511;
238 u64 rx_frames_512_1023;
239 u64 rx_frames_1024_1518;
240 u64 rx_frames_1519_max;
241
242 u64 rx_cong_drops;
243
244 unsigned long tx_fifo_parity_err;
245 unsigned long rx_fifo_parity_err;
246 unsigned long tx_fifo_urun;
247 unsigned long rx_fifo_ovfl;
248 unsigned long serdes_signal_loss;
249 unsigned long xaui_pcs_ctc_err;
250 unsigned long xaui_pcs_align_change;
251
252 unsigned long num_toggled;
253 unsigned long num_resets;
254
255 unsigned long link_faults;
256 };
257
258 struct tp_mib_stats {
259 u32 ipInReceive_hi;
260 u32 ipInReceive_lo;
261 u32 ipInHdrErrors_hi;
262 u32 ipInHdrErrors_lo;
263 u32 ipInAddrErrors_hi;
264 u32 ipInAddrErrors_lo;
265 u32 ipInUnknownProtos_hi;
266 u32 ipInUnknownProtos_lo;
267 u32 ipInDiscards_hi;
268 u32 ipInDiscards_lo;
269 u32 ipInDelivers_hi;
270 u32 ipInDelivers_lo;
271 u32 ipOutRequests_hi;
272 u32 ipOutRequests_lo;
273 u32 ipOutDiscards_hi;
274 u32 ipOutDiscards_lo;
275 u32 ipOutNoRoutes_hi;
276 u32 ipOutNoRoutes_lo;
277 u32 ipReasmTimeout;
278 u32 ipReasmReqds;
279 u32 ipReasmOKs;
280 u32 ipReasmFails;
281
282 u32 reserved[8];
283
284 u32 tcpActiveOpens;
285 u32 tcpPassiveOpens;
286 u32 tcpAttemptFails;
287 u32 tcpEstabResets;
288 u32 tcpOutRsts;
289 u32 tcpCurrEstab;
290 u32 tcpInSegs_hi;
291 u32 tcpInSegs_lo;
292 u32 tcpOutSegs_hi;
293 u32 tcpOutSegs_lo;
294 u32 tcpRetransSeg_hi;
295 u32 tcpRetransSeg_lo;
296 u32 tcpInErrs_hi;
297 u32 tcpInErrs_lo;
298 u32 tcpRtoMin;
299 u32 tcpRtoMax;
300 };
301
302 struct tp_params {
303 unsigned int nchan;
304 unsigned int pmrx_size;
305 unsigned int pmtx_size;
306 unsigned int cm_size;
307 unsigned int chan_rx_size;
308 unsigned int chan_tx_size;
309 unsigned int rx_pg_size;
310 unsigned int tx_pg_size;
311 unsigned int rx_num_pgs;
312 unsigned int tx_num_pgs;
313 unsigned int ntimer_qs;
314 };
315
316 struct qset_params {
317 unsigned int polling;
318 unsigned int coalesce_usecs;
319 unsigned int rspq_size;
320 unsigned int fl_size;
321 unsigned int jumbo_size;
322 unsigned int txq_size[SGE_TXQ_PER_SET];
323 unsigned int cong_thres;
324 unsigned int vector;
325 };
326
327 struct sge_params {
328 unsigned int max_pkt_size;
329 struct qset_params qset[SGE_QSETS];
330 };
331
332 struct mc5_params {
333 unsigned int mode;
334 unsigned int nservers;
335 unsigned int nfilters;
336 unsigned int nroutes;
337 };
338
339
340 enum {
341 DEFAULT_NSERVERS = 512,
342 DEFAULT_NFILTERS = 128
343 };
344
345
346 enum {
347 MC5_MODE_144_BIT = 1,
348 MC5_MODE_72_BIT = 2
349 };
350
351
352 enum { MC5_MIN_TIDS = 16 };
353
354 struct vpd_params {
355 unsigned int cclk;
356 unsigned int mclk;
357 unsigned int uclk;
358 unsigned int mdc;
359 unsigned int mem_timing;
360 u8 sn[SERNUM_LEN + 1];
361 u8 eth_base[6];
362 u8 port_type[MAX_NPORTS];
363 unsigned short xauicfg[2];
364 };
365
366 struct pci_params {
367 unsigned int vpd_cap_addr;
368 unsigned short speed;
369 unsigned char width;
370 unsigned char variant;
371 };
372
373 enum {
374 PCI_VARIANT_PCI,
375 PCI_VARIANT_PCIX_MODE1_PARITY,
376 PCI_VARIANT_PCIX_MODE1_ECC,
377 PCI_VARIANT_PCIX_266_MODE2,
378 PCI_VARIANT_PCIE
379 };
380
381 struct adapter_params {
382 struct sge_params sge;
383 struct mc5_params mc5;
384 struct tp_params tp;
385 struct vpd_params vpd;
386 struct pci_params pci;
387
388 const struct adapter_info *info;
389
390 unsigned short mtus[NMTUS];
391 unsigned short a_wnd[NCCTRL_WIN];
392 unsigned short b_wnd[NCCTRL_WIN];
393
394 unsigned int nports;
395 unsigned int chan_map;
396 unsigned int stats_update_period;
397 unsigned int linkpoll_period;
398 unsigned int rev;
399 unsigned int offload;
400 };
401
402 enum {
403 T3_REV_A = 0,
404 T3_REV_B = 2,
405 T3_REV_B2 = 3,
406 T3_REV_C = 4,
407 };
408
409 struct trace_params {
410 u32 sip;
411 u32 sip_mask;
412 u32 dip;
413 u32 dip_mask;
414 u16 sport;
415 u16 sport_mask;
416 u16 dport;
417 u16 dport_mask;
418 u32 vlan:12;
419 u32 vlan_mask:12;
420 u32 intf:4;
421 u32 intf_mask:4;
422 u8 proto;
423 u8 proto_mask;
424 };
425
426 struct link_config {
427 unsigned int supported;
428 unsigned int advertising;
429 unsigned short requested_speed;
430 unsigned short speed;
431 unsigned char requested_duplex;
432 unsigned char duplex;
433 unsigned char requested_fc;
434 unsigned char fc;
435 unsigned char autoneg;
436 unsigned int link_ok;
437 };
438
439 #define SPEED_INVALID 0xffff
440 #define DUPLEX_INVALID 0xff
441
442 struct mc5 {
443 struct adapter *adapter;
444 unsigned int tcam_size;
445 unsigned char part_type;
446 unsigned char parity_enabled;
447 unsigned char mode;
448 struct mc5_stats stats;
449 };
450
451 static inline unsigned int t3_mc5_size(const struct mc5 *p)
452 {
453 return p->tcam_size;
454 }
455
456 struct mc7 {
457 struct adapter *adapter;
458 unsigned int size;
459 unsigned int width;
460 unsigned int offset;
461 const char *name;
462 struct mc7_stats stats;
463 };
464
465 static inline unsigned int t3_mc7_size(const struct mc7 *p)
466 {
467 return p->size;
468 }
469
470 struct cmac {
471 struct adapter *adapter;
472 unsigned int offset;
473 unsigned int nucast;
474 unsigned int tx_tcnt;
475 unsigned int tx_xcnt;
476 u64 tx_mcnt;
477 unsigned int rx_xcnt;
478 unsigned int rx_ocnt;
479 u64 rx_mcnt;
480 unsigned int toggle_cnt;
481 unsigned int txen;
482 u64 rx_pause;
483 struct mac_stats stats;
484 };
485
486 enum {
487 MAC_DIRECTION_RX = 1,
488 MAC_DIRECTION_TX = 2,
489 MAC_RXFIFO_SIZE = 32768
490 };
491
492
493 enum {
494 PHY_LOOPBACK_TX = 1,
495 PHY_LOOPBACK_RX = 2
496 };
497
498
499 enum {
500 cphy_cause_link_change = 1,
501 cphy_cause_fifo_error = 2,
502 cphy_cause_module_change = 4,
503 };
504
505
506 enum {
507 phy_modtype_none,
508 phy_modtype_sr,
509 phy_modtype_lr,
510 phy_modtype_lrm,
511 phy_modtype_twinax,
512 phy_modtype_twinax_long,
513 phy_modtype_unknown
514 };
515
516
517 struct cphy_ops {
518 int (*reset)(struct cphy *phy, int wait);
519
520 int (*intr_enable)(struct cphy *phy);
521 int (*intr_disable)(struct cphy *phy);
522 int (*intr_clear)(struct cphy *phy);
523 int (*intr_handler)(struct cphy *phy);
524
525 int (*autoneg_enable)(struct cphy *phy);
526 int (*autoneg_restart)(struct cphy *phy);
527
528 int (*advertise)(struct cphy *phy, unsigned int advertise_map);
529 int (*set_loopback)(struct cphy *phy, int mmd, int dir, int enable);
530 int (*set_speed_duplex)(struct cphy *phy, int speed, int duplex);
531 int (*get_link_status)(struct cphy *phy, int *link_ok, int *speed,
532 int *duplex, int *fc);
533 int (*power_down)(struct cphy *phy, int enable);
534
535 u32 mmds;
536 };
537 enum {
538 EDC_OPT_AEL2005 = 0,
539 EDC_OPT_AEL2005_SIZE = 1084,
540 EDC_TWX_AEL2005 = 1,
541 EDC_TWX_AEL2005_SIZE = 1464,
542 EDC_TWX_AEL2020 = 2,
543 EDC_TWX_AEL2020_SIZE = 1628,
544 EDC_MAX_SIZE = EDC_TWX_AEL2020_SIZE,
545 };
546
547
548 struct cphy {
549 u8 modtype;
550 short priv;
551 unsigned int caps;
552 struct adapter *adapter;
553 const char *desc;
554 unsigned long fifo_errors;
555 const struct cphy_ops *ops;
556 struct mdio_if_info mdio;
557 u16 phy_cache[EDC_MAX_SIZE];
558 };
559
560
561 static inline int t3_mdio_read(struct cphy *phy, int mmd, int reg,
562 unsigned int *valp)
563 {
564 int rc = phy->mdio.mdio_read(phy->mdio.dev, phy->mdio.prtad, mmd, reg);
565 *valp = (rc >= 0) ? rc : -1;
566 return (rc >= 0) ? 0 : rc;
567 }
568
569 static inline int t3_mdio_write(struct cphy *phy, int mmd, int reg,
570 unsigned int val)
571 {
572 return phy->mdio.mdio_write(phy->mdio.dev, phy->mdio.prtad, mmd,
573 reg, val);
574 }
575
576
577 static inline void cphy_init(struct cphy *phy, struct adapter *adapter,
578 int phy_addr, const struct cphy_ops *phy_ops,
579 const struct mdio_ops *mdio_ops,
580 unsigned int caps, const char *desc)
581 {
582 phy->caps = caps;
583 phy->adapter = adapter;
584 phy->desc = desc;
585 phy->ops = phy_ops;
586 if (mdio_ops) {
587 phy->mdio.prtad = phy_addr;
588 phy->mdio.mmds = phy_ops->mmds;
589 phy->mdio.mode_support = mdio_ops->mode_support;
590 phy->mdio.mdio_read = mdio_ops->read;
591 phy->mdio.mdio_write = mdio_ops->write;
592 }
593 }
594
595
596 #define MAC_STATS_ACCUM_SECS 180
597
598 #define XGM_REG(reg_addr, idx) \
599 ((reg_addr) + (idx) * (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR))
600
601 struct addr_val_pair {
602 unsigned int reg_addr;
603 unsigned int val;
604 };
605
606 #include "adapter.h"
607
608 #ifndef PCI_VENDOR_ID_CHELSIO
609 # define PCI_VENDOR_ID_CHELSIO 0x1425
610 #endif
611
612 #define for_each_port(adapter, iter) \
613 for (iter = 0; iter < (adapter)->params.nports; ++iter)
614
615 #define adapter_info(adap) ((adap)->params.info)
616
617 static inline int uses_xaui(const struct adapter *adap)
618 {
619 return adapter_info(adap)->caps & SUPPORTED_AUI;
620 }
621
622 static inline int is_10G(const struct adapter *adap)
623 {
624 return adapter_info(adap)->caps & SUPPORTED_10000baseT_Full;
625 }
626
627 static inline int is_offload(const struct adapter *adap)
628 {
629 return adap->params.offload;
630 }
631
632 static inline unsigned int core_ticks_per_usec(const struct adapter *adap)
633 {
634 return adap->params.vpd.cclk / 1000;
635 }
636
637 static inline unsigned int is_pcie(const struct adapter *adap)
638 {
639 return adap->params.pci.variant == PCI_VARIANT_PCIE;
640 }
641
642 void t3_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask,
643 u32 val);
644 void t3_write_regs(struct adapter *adapter, const struct addr_val_pair *p,
645 int n, unsigned int offset);
646 int t3_wait_op_done_val(struct adapter *adapter, int reg, u32 mask,
647 int polarity, int attempts, int delay, u32 *valp);
648 static inline int t3_wait_op_done(struct adapter *adapter, int reg, u32 mask,
649 int polarity, int attempts, int delay)
650 {
651 return t3_wait_op_done_val(adapter, reg, mask, polarity, attempts,
652 delay, NULL);
653 }
654 int t3_mdio_change_bits(struct cphy *phy, int mmd, int reg, unsigned int clear,
655 unsigned int set);
656 int t3_phy_reset(struct cphy *phy, int mmd, int wait);
657 int t3_phy_advertise(struct cphy *phy, unsigned int advert);
658 int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert);
659 int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex);
660 int t3_phy_lasi_intr_enable(struct cphy *phy);
661 int t3_phy_lasi_intr_disable(struct cphy *phy);
662 int t3_phy_lasi_intr_clear(struct cphy *phy);
663 int t3_phy_lasi_intr_handler(struct cphy *phy);
664
665 void t3_intr_enable(struct adapter *adapter);
666 void t3_intr_disable(struct adapter *adapter);
667 void t3_intr_clear(struct adapter *adapter);
668 void t3_xgm_intr_enable(struct adapter *adapter, int idx);
669 void t3_xgm_intr_disable(struct adapter *adapter, int idx);
670 void t3_port_intr_enable(struct adapter *adapter, int idx);
671 void t3_port_intr_disable(struct adapter *adapter, int idx);
672 int t3_slow_intr_handler(struct adapter *adapter);
673 int t3_phy_intr_handler(struct adapter *adapter);
674
675 void t3_link_changed(struct adapter *adapter, int port_id);
676 void t3_link_fault(struct adapter *adapter, int port_id);
677 int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
678 const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
679 int t3_seeprom_read(struct adapter *adapter, u32 addr, __le32 *data);
680 int t3_seeprom_write(struct adapter *adapter, u32 addr, __le32 data);
681 int t3_seeprom_wp(struct adapter *adapter, int enable);
682 int t3_get_tp_version(struct adapter *adapter, u32 *vers);
683 int t3_check_tpsram_version(struct adapter *adapter);
684 int t3_check_tpsram(struct adapter *adapter, const u8 *tp_ram,
685 unsigned int size);
686 int t3_set_proto_sram(struct adapter *adap, const u8 *data);
687 int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
688 int t3_get_fw_version(struct adapter *adapter, u32 *vers);
689 int t3_check_fw_version(struct adapter *adapter);
690 int t3_init_hw(struct adapter *adapter, u32 fw_params);
691 int t3_reset_adapter(struct adapter *adapter);
692 int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
693 int reset);
694 int t3_replay_prep_adapter(struct adapter *adapter);
695 void t3_led_ready(struct adapter *adapter);
696 void t3_fatal_err(struct adapter *adapter);
697 void t3_set_vlan_accel(struct adapter *adapter, unsigned int ports, int on);
698 void t3_config_rss(struct adapter *adapter, unsigned int rss_config,
699 const u8 * cpus, const u16 *rspq);
700 int t3_cim_ctl_blk_read(struct adapter *adap, unsigned int addr,
701 unsigned int n, unsigned int *valp);
702 int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n,
703 u64 *buf);
704
705 int t3_mac_reset(struct cmac *mac);
706 void t3b_pcs_reset(struct cmac *mac);
707 void t3_mac_disable_exact_filters(struct cmac *mac);
708 void t3_mac_enable_exact_filters(struct cmac *mac);
709 int t3_mac_enable(struct cmac *mac, int which);
710 int t3_mac_disable(struct cmac *mac, int which);
711 int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
712 int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev);
713 int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6]);
714 int t3_mac_set_num_ucast(struct cmac *mac, int n);
715 const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
716 int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc);
717 int t3b2_mac_watchdog_task(struct cmac *mac);
718
719 void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode);
720 int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters,
721 unsigned int nroutes);
722 void t3_mc5_intr_handler(struct mc5 *mc5);
723
724 void t3_tp_set_offload_mode(struct adapter *adap, int enable);
725 void t3_tp_get_mib_stats(struct adapter *adap, struct tp_mib_stats *tps);
726 void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS],
727 unsigned short alpha[NCCTRL_WIN],
728 unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap);
729 void t3_config_trace_filter(struct adapter *adapter,
730 const struct trace_params *tp, int filter_index,
731 int invert, int enable);
732 int t3_config_sched(struct adapter *adap, unsigned int kbps, int sched);
733
734 void t3_sge_prep(struct adapter *adap, struct sge_params *p);
735 void t3_sge_init(struct adapter *adap, struct sge_params *p);
736 int t3_sge_init_ecntxt(struct adapter *adapter, unsigned int id, int gts_enable,
737 enum sge_context_type type, int respq, u64 base_addr,
738 unsigned int size, unsigned int token, int gen,
739 unsigned int cidx);
740 int t3_sge_init_flcntxt(struct adapter *adapter, unsigned int id,
741 int gts_enable, u64 base_addr, unsigned int size,
742 unsigned int esize, unsigned int cong_thres, int gen,
743 unsigned int cidx);
744 int t3_sge_init_rspcntxt(struct adapter *adapter, unsigned int id,
745 int irq_vec_idx, u64 base_addr, unsigned int size,
746 unsigned int fl_thres, int gen, unsigned int cidx);
747 int t3_sge_init_cqcntxt(struct adapter *adapter, unsigned int id, u64 base_addr,
748 unsigned int size, int rspq, int ovfl_mode,
749 unsigned int credits, unsigned int credit_thres);
750 int t3_sge_enable_ecntxt(struct adapter *adapter, unsigned int id, int enable);
751 int t3_sge_disable_fl(struct adapter *adapter, unsigned int id);
752 int t3_sge_disable_rspcntxt(struct adapter *adapter, unsigned int id);
753 int t3_sge_disable_cqcntxt(struct adapter *adapter, unsigned int id);
754 int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
755 unsigned int credits);
756
757 int t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter,
758 int phy_addr, const struct mdio_ops *mdio_ops);
759 int t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter,
760 int phy_addr, const struct mdio_ops *mdio_ops);
761 int t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter,
762 int phy_addr, const struct mdio_ops *mdio_ops);
763 int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter,
764 int phy_addr, const struct mdio_ops *mdio_ops);
765 int t3_ael2020_phy_prep(struct cphy *phy, struct adapter *adapter,
766 int phy_addr, const struct mdio_ops *mdio_ops);
767 int t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr,
768 const struct mdio_ops *mdio_ops);
769 int t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
770 int phy_addr, const struct mdio_ops *mdio_ops);
771 int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter,
772 int phy_addr, const struct mdio_ops *mdio_ops);
773 #endif