2 * This file is part of the Chelsio T4 Ethernet driver for Linux.
4 * Copyright (c) 2003-2010 Chelsio Communications, Inc. All rights reserved.
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38 #include <linux/bitops.h>
39 #include <linux/cache.h>
40 #include <linux/interrupt.h>
41 #include <linux/list.h>
42 #include <linux/netdevice.h>
43 #include <linux/pci.h>
44 #include <linux/spinlock.h>
45 #include <linux/timer.h>
47 #include "cxgb4_uld.h"
50 #define FW_VERSION_MAJOR 1
51 #define FW_VERSION_MINOR 1
52 #define FW_VERSION_MICRO 0
54 #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
57 MAX_NPORTS = 4, /* max # of ports */
58 SERNUM_LEN = 24, /* Serial # length */
59 EC_LEN = 16, /* E/C length */
60 ID_LEN = 16, /* ID length */
70 MEMWIN0_APERTURE = 65536,
71 MEMWIN0_BASE = 0x30000,
72 MEMWIN1_APERTURE = 32768,
73 MEMWIN1_BASE = 0x28000,
74 MEMWIN2_APERTURE = 2048,
75 MEMWIN2_BASE = 0x1b800,
93 PAUSE_AUTONEG = 1 << 2
97 u64 tx_octets; /* total # of octets in good frames */
98 u64 tx_frames; /* all good frames */
99 u64 tx_bcast_frames; /* all broadcast frames */
100 u64 tx_mcast_frames; /* all multicast frames */
101 u64 tx_ucast_frames; /* all unicast frames */
102 u64 tx_error_frames; /* all error frames */
104 u64 tx_frames_64; /* # of Tx frames in a particular range */
105 u64 tx_frames_65_127;
106 u64 tx_frames_128_255;
107 u64 tx_frames_256_511;
108 u64 tx_frames_512_1023;
109 u64 tx_frames_1024_1518;
110 u64 tx_frames_1519_max;
112 u64 tx_drop; /* # of dropped Tx frames */
113 u64 tx_pause; /* # of transmitted pause frames */
114 u64 tx_ppp0; /* # of transmitted PPP prio 0 frames */
115 u64 tx_ppp1; /* # of transmitted PPP prio 1 frames */
116 u64 tx_ppp2; /* # of transmitted PPP prio 2 frames */
117 u64 tx_ppp3; /* # of transmitted PPP prio 3 frames */
118 u64 tx_ppp4; /* # of transmitted PPP prio 4 frames */
119 u64 tx_ppp5; /* # of transmitted PPP prio 5 frames */
120 u64 tx_ppp6; /* # of transmitted PPP prio 6 frames */
121 u64 tx_ppp7; /* # of transmitted PPP prio 7 frames */
123 u64 rx_octets; /* total # of octets in good frames */
124 u64 rx_frames; /* all good frames */
125 u64 rx_bcast_frames; /* all broadcast frames */
126 u64 rx_mcast_frames; /* all multicast frames */
127 u64 rx_ucast_frames; /* all unicast frames */
128 u64 rx_too_long; /* # of frames exceeding MTU */
129 u64 rx_jabber; /* # of jabber frames */
130 u64 rx_fcs_err; /* # of received frames with bad FCS */
131 u64 rx_len_err; /* # of received frames with length error */
132 u64 rx_symbol_err; /* symbol errors */
133 u64 rx_runt; /* # of short frames */
135 u64 rx_frames_64; /* # of Rx frames in a particular range */
136 u64 rx_frames_65_127;
137 u64 rx_frames_128_255;
138 u64 rx_frames_256_511;
139 u64 rx_frames_512_1023;
140 u64 rx_frames_1024_1518;
141 u64 rx_frames_1519_max;
143 u64 rx_pause; /* # of received pause frames */
144 u64 rx_ppp0; /* # of received PPP prio 0 frames */
145 u64 rx_ppp1; /* # of received PPP prio 1 frames */
146 u64 rx_ppp2; /* # of received PPP prio 2 frames */
147 u64 rx_ppp3; /* # of received PPP prio 3 frames */
148 u64 rx_ppp4; /* # of received PPP prio 4 frames */
149 u64 rx_ppp5; /* # of received PPP prio 5 frames */
150 u64 rx_ppp6; /* # of received PPP prio 6 frames */
151 u64 rx_ppp7; /* # of received PPP prio 7 frames */
153 u64 rx_ovflow0; /* drops due to buffer-group 0 overflows */
154 u64 rx_ovflow1; /* drops due to buffer-group 1 overflows */
155 u64 rx_ovflow2; /* drops due to buffer-group 2 overflows */
156 u64 rx_ovflow3; /* drops due to buffer-group 3 overflows */
157 u64 rx_trunc0; /* buffer-group 0 truncated packets */
158 u64 rx_trunc1; /* buffer-group 1 truncated packets */
159 u64 rx_trunc2; /* buffer-group 2 truncated packets */
160 u64 rx_trunc3; /* buffer-group 3 truncated packets */
163 struct lb_port_stats {
176 u64 frames_1024_1518;
191 struct tp_tcp_stats {
198 struct tp_err_stats {
203 u32 ofldChanDrops[4];
205 u32 ofldVlanDrops[4];
212 unsigned int ntxchan; /* # of Tx channels */
213 unsigned int tre; /* log2 of core clocks per TP tick */
219 u8 sn[SERNUM_LEN + 1];
228 struct adapter_params {
230 struct vpd_params vpd;
231 struct pci_params pci;
233 unsigned int sf_size; /* serial flash size in bytes */
234 unsigned int sf_nsec; /* # of flash sectors */
235 unsigned int sf_fw_start; /* start of FW image in flash */
237 unsigned int fw_vers;
238 unsigned int tp_vers;
241 unsigned short mtus[NMTUS];
242 unsigned short a_wnd[NCCTRL_WIN];
243 unsigned short b_wnd[NCCTRL_WIN];
245 unsigned char nports; /* # of ethernet ports */
246 unsigned char portvec;
247 unsigned char rev; /* chip revision */
248 unsigned char offload;
250 unsigned int ofldq_wr_cred;
253 struct trace_params {
254 u32 data[TRACE_LEN / 4];
255 u32 mask[TRACE_LEN / 4];
256 unsigned short snap_len;
257 unsigned short min_len;
258 unsigned char skip_ofst;
259 unsigned char skip_len;
260 unsigned char invert;
265 unsigned short supported; /* link capabilities */
266 unsigned short advertising; /* advertised capabilities */
267 unsigned short requested_speed; /* speed user has requested */
268 unsigned short speed; /* actual link speed */
269 unsigned char requested_fc; /* flow control user has requested */
270 unsigned char fc; /* actual link flow control */
271 unsigned char autoneg; /* autonegotiating? */
272 unsigned char link_ok; /* link up? */
275 #define FW_LEN16(fw_struct) FW_CMD_LEN16(sizeof(fw_struct) / 16)
278 MAX_ETH_QSETS = 32, /* # of Ethernet Tx/Rx queue sets */
279 MAX_OFLD_QSETS = 16, /* # of offload Tx/Rx queue sets */
280 MAX_CTRL_QUEUES = NCHAN, /* # of control Tx queues */
281 MAX_RDMA_QUEUES = NCHAN, /* # of streaming RDMA Rx queues */
285 MAX_EGRQ = 128, /* max # of egress queues, including FLs */
286 MAX_INGQ = 64 /* max # of interrupt-capable ingress queues */
293 struct adapter *adapter;
295 s16 xact_addr_filt; /* index of exact MAC address filter */
296 u16 rss_size; /* size of VI's RSS table slice */
302 u8 lport; /* associated offload logical port */
303 u8 nqsets; /* # of qsets */
304 u8 first_qset; /* index of first qset */
306 struct link_config link_cfg;
313 enum { /* adapter flags */
314 FULL_INIT_DONE = (1 << 0),
315 USING_MSI = (1 << 1),
316 USING_MSIX = (1 << 2),
322 struct sge_fl { /* SGE free-buffer queue state */
323 unsigned int avail; /* # of available Rx buffers */
324 unsigned int pend_cred; /* new buffers since last FL DB ring */
325 unsigned int cidx; /* consumer index */
326 unsigned int pidx; /* producer index */
327 unsigned long alloc_failed; /* # of times buffer allocation failed */
328 unsigned long large_alloc_failed;
329 unsigned long starving;
331 unsigned int cntxt_id; /* SGE context id for the free list */
332 unsigned int size; /* capacity of free list */
333 struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
334 __be64 *desc; /* address of HW Rx descriptor ring */
335 dma_addr_t addr; /* bus address of HW ring start */
338 /* A packet gather list */
340 struct page_frag frags[MAX_SKB_FRAGS];
341 void *va; /* virtual address of first byte */
342 unsigned int nfrags; /* # of fragments */
343 unsigned int tot_len; /* total length of fragments */
346 typedef int (*rspq_handler_t)(struct sge_rspq *q, const __be64 *rsp,
347 const struct pkt_gl *gl);
349 struct sge_rspq { /* state for an SGE response queue */
350 struct napi_struct napi;
351 const __be64 *cur_desc; /* current descriptor in queue */
352 unsigned int cidx; /* consumer index */
353 u8 gen; /* current generation bit */
354 u8 intr_params; /* interrupt holdoff parameters */
355 u8 next_intr_params; /* holdoff params for next interrupt */
356 u8 pktcnt_idx; /* interrupt packet threshold */
357 u8 uld; /* ULD handling this queue */
358 u8 idx; /* queue index within its group */
359 int offset; /* offset into current Rx buffer */
360 u16 cntxt_id; /* SGE context id for the response q */
361 u16 abs_id; /* absolute SGE id for the response q */
362 __be64 *desc; /* address of HW response ring */
363 dma_addr_t phys_addr; /* physical address of the ring */
364 unsigned int iqe_len; /* entry size */
365 unsigned int size; /* capacity of response queue */
366 struct adapter *adap;
367 struct net_device *netdev; /* associated net device */
368 rspq_handler_t handler;
371 struct sge_eth_stats { /* Ethernet queue statistics */
372 unsigned long pkts; /* # of ethernet packets */
373 unsigned long lro_pkts; /* # of LRO super packets */
374 unsigned long lro_merged; /* # of wire packets merged by LRO */
375 unsigned long rx_cso; /* # of Rx checksum offloads */
376 unsigned long vlan_ex; /* # of Rx VLAN extractions */
377 unsigned long rx_drops; /* # of packets dropped due to no mem */
380 struct sge_eth_rxq { /* SW Ethernet Rx queue */
381 struct sge_rspq rspq;
383 struct sge_eth_stats stats;
384 } ____cacheline_aligned_in_smp;
386 struct sge_ofld_stats { /* offload queue statistics */
387 unsigned long pkts; /* # of packets */
388 unsigned long imm; /* # of immediate-data packets */
389 unsigned long an; /* # of asynchronous notifications */
390 unsigned long nomem; /* # of responses deferred due to no mem */
393 struct sge_ofld_rxq { /* SW offload Rx queue */
394 struct sge_rspq rspq;
396 struct sge_ofld_stats stats;
397 } ____cacheline_aligned_in_smp;
406 unsigned int in_use; /* # of in-use Tx descriptors */
407 unsigned int size; /* # of descriptors */
408 unsigned int cidx; /* SW consumer index */
409 unsigned int pidx; /* producer index */
410 unsigned long stops; /* # of times q has been stopped */
411 unsigned long restarts; /* # of queue restarts */
412 unsigned int cntxt_id; /* SGE context id for the Tx q */
413 struct tx_desc *desc; /* address of HW Tx descriptor ring */
414 struct tx_sw_desc *sdesc; /* address of SW Tx descriptor ring */
415 struct sge_qstat *stat; /* queue status entry */
416 dma_addr_t phys_addr; /* physical address of the ring */
419 unsigned short db_pidx;
422 struct sge_eth_txq { /* state for an SGE Ethernet Tx queue */
424 struct netdev_queue *txq; /* associated netdev TX queue */
425 unsigned long tso; /* # of TSO requests */
426 unsigned long tx_cso; /* # of Tx checksum offloads */
427 unsigned long vlan_ins; /* # of Tx VLAN insertions */
428 unsigned long mapping_err; /* # of I/O MMU packet mapping errors */
429 } ____cacheline_aligned_in_smp;
431 struct sge_ofld_txq { /* state for an SGE offload Tx queue */
433 struct adapter *adap;
434 struct sk_buff_head sendq; /* list of backpressured packets */
435 struct tasklet_struct qresume_tsk; /* restarts the queue */
436 u8 full; /* the Tx ring is full */
437 unsigned long mapping_err; /* # of I/O MMU packet mapping errors */
438 } ____cacheline_aligned_in_smp;
440 struct sge_ctrl_txq { /* state for an SGE control Tx queue */
442 struct adapter *adap;
443 struct sk_buff_head sendq; /* list of backpressured packets */
444 struct tasklet_struct qresume_tsk; /* restarts the queue */
445 u8 full; /* the Tx ring is full */
446 } ____cacheline_aligned_in_smp;
449 struct sge_eth_txq ethtxq[MAX_ETH_QSETS];
450 struct sge_ofld_txq ofldtxq[MAX_OFLD_QSETS];
451 struct sge_ctrl_txq ctrlq[MAX_CTRL_QUEUES];
453 struct sge_eth_rxq ethrxq[MAX_ETH_QSETS];
454 struct sge_ofld_rxq ofldrxq[MAX_OFLD_QSETS];
455 struct sge_ofld_rxq rdmarxq[MAX_RDMA_QUEUES];
456 struct sge_rspq fw_evtq ____cacheline_aligned_in_smp;
458 struct sge_rspq intrq ____cacheline_aligned_in_smp;
459 spinlock_t intrq_lock;
461 u16 max_ethqsets; /* # of available Ethernet queue sets */
462 u16 ethqsets; /* # of active Ethernet queue sets */
463 u16 ethtxq_rover; /* Tx queue to clean up next */
464 u16 ofldqsets; /* # of active offload queue sets */
465 u16 rdmaqs; /* # of available RDMA Rx queues */
466 u16 ofld_rxq[MAX_OFLD_QSETS];
468 u16 timer_val[SGE_NTIMERS];
469 u8 counter_val[SGE_NCOUNTERS];
470 unsigned int starve_thres;
472 unsigned int egr_start;
473 unsigned int ingr_start;
474 void *egr_map[MAX_EGRQ]; /* qid->queue egress queue map */
475 struct sge_rspq *ingr_map[MAX_INGQ]; /* qid->queue ingress queue map */
476 DECLARE_BITMAP(starving_fl, MAX_EGRQ);
477 DECLARE_BITMAP(txq_maperr, MAX_EGRQ);
478 struct timer_list rx_timer; /* refills starving FLs */
479 struct timer_list tx_timer; /* checks Tx queues */
482 #define for_each_ethrxq(sge, i) for (i = 0; i < (sge)->ethqsets; i++)
483 #define for_each_ofldrxq(sge, i) for (i = 0; i < (sge)->ofldqsets; i++)
484 #define for_each_rdmarxq(sge, i) for (i = 0; i < (sge)->rdmaqs; i++)
490 struct pci_dev *pdev;
491 struct device *pdev_dev;
498 struct adapter_params params;
499 struct cxgb4_virt_res vres;
506 char desc[IFNAMSIZ + 10];
507 } msix_info[MAX_INGQ + 1];
511 struct net_device *port[MAX_NPORTS];
512 u8 chan_map[NCHAN]; /* channel -> port map */
514 struct l2t_data *l2t;
515 void *uld_handle[CXGB4_ULD_MAX];
516 struct list_head list_node;
518 struct tid_info tids;
519 void **tid_release_head;
520 spinlock_t tid_release_lock;
521 struct work_struct tid_release_task;
522 struct work_struct db_full_task;
523 struct work_struct db_drop_task;
524 bool tid_release_task_busy;
526 struct dentry *debugfs_root;
528 spinlock_t stats_lock;
531 static inline u32 t4_read_reg(struct adapter *adap, u32 reg_addr)
533 return readl(adap->regs + reg_addr);
536 static inline void t4_write_reg(struct adapter *adap, u32 reg_addr, u32 val)
538 writel(val, adap->regs + reg_addr);
542 static inline u64 readq(const volatile void __iomem *addr)
544 return readl(addr) + ((u64)readl(addr + 4) << 32);
547 static inline void writeq(u64 val, volatile void __iomem *addr)
550 writel(val >> 32, addr + 4);
554 static inline u64 t4_read_reg64(struct adapter *adap, u32 reg_addr)
556 return readq(adap->regs + reg_addr);
559 static inline void t4_write_reg64(struct adapter *adap, u32 reg_addr, u64 val)
561 writeq(val, adap->regs + reg_addr);
565 * netdev2pinfo - return the port_info structure associated with a net_device
568 * Return the struct port_info associated with a net_device
570 static inline struct port_info *netdev2pinfo(const struct net_device *dev)
572 return netdev_priv(dev);
576 * adap2pinfo - return the port_info of a port
578 * @idx: the port index
580 * Return the port_info structure for the port of the given index.
582 static inline struct port_info *adap2pinfo(struct adapter *adap, int idx)
584 return netdev_priv(adap->port[idx]);
588 * netdev2adap - return the adapter structure associated with a net_device
591 * Return the struct adapter associated with a net_device
593 static inline struct adapter *netdev2adap(const struct net_device *dev)
595 return netdev2pinfo(dev)->adapter;
598 void t4_os_portmod_changed(const struct adapter *adap, int port_id);
599 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
601 void *t4_alloc_mem(size_t size);
603 void t4_free_sge_resources(struct adapter *adap);
604 irq_handler_t t4_intr_handler(struct adapter *adap);
605 netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev);
606 int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
607 const struct pkt_gl *gl);
608 int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
609 int t4_ofld_send(struct adapter *adap, struct sk_buff *skb);
610 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
611 struct net_device *dev, int intr_idx,
612 struct sge_fl *fl, rspq_handler_t hnd);
613 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
614 struct net_device *dev, struct netdev_queue *netdevq,
616 int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
617 struct net_device *dev, unsigned int iqid,
618 unsigned int cmplqid);
619 int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq,
620 struct net_device *dev, unsigned int iqid);
621 irqreturn_t t4_sge_intr_msix(int irq, void *cookie);
622 void t4_sge_init(struct adapter *adap);
623 void t4_sge_start(struct adapter *adap);
624 void t4_sge_stop(struct adapter *adap);
625 extern int dbfifo_int_thresh;
627 #define for_each_port(adapter, iter) \
628 for (iter = 0; iter < (adapter)->params.nports; ++iter)
630 static inline unsigned int core_ticks_per_usec(const struct adapter *adap)
632 return adap->params.vpd.cclk / 1000;
635 static inline unsigned int us_to_core_ticks(const struct adapter *adap,
638 return (us * adap->params.vpd.cclk) / 1000;
641 void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask,
644 int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
645 void *rpl, bool sleep_ok);
647 static inline int t4_wr_mbox(struct adapter *adap, int mbox, const void *cmd,
650 return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, true);
653 static inline int t4_wr_mbox_ns(struct adapter *adap, int mbox, const void *cmd,
656 return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, false);
659 void t4_intr_enable(struct adapter *adapter);
660 void t4_intr_disable(struct adapter *adapter);
661 int t4_slow_intr_handler(struct adapter *adapter);
663 int t4_wait_dev_ready(struct adapter *adap);
664 int t4_link_start(struct adapter *adap, unsigned int mbox, unsigned int port,
665 struct link_config *lc);
666 int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port);
667 int t4_seeprom_wp(struct adapter *adapter, bool enable);
668 int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
669 int t4_check_fw_version(struct adapter *adapter);
670 int t4_prep_adapter(struct adapter *adapter);
671 int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
672 void t4_fatal_err(struct adapter *adapter);
673 int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid,
674 int start, int n, const u16 *rspq, unsigned int nrspq);
675 int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode,
677 int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *parity);
678 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data,
681 void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
682 void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log);
683 void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
684 struct tp_tcp_stats *v6);
685 void t4_load_mtus(struct adapter *adap, const unsigned short *mtus,
686 const unsigned short *alpha, const unsigned short *beta);
688 void t4_wol_magic_enable(struct adapter *adap, unsigned int port,
690 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map,
691 u64 mask0, u64 mask1, unsigned int crc, bool enable);
693 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
694 enum dev_master master, enum dev_state *state);
695 int t4_fw_bye(struct adapter *adap, unsigned int mbox);
696 int t4_early_init(struct adapter *adap, unsigned int mbox);
697 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
698 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
699 unsigned int vf, unsigned int nparams, const u32 *params,
701 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
702 unsigned int vf, unsigned int nparams, const u32 *params,
704 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf,
705 unsigned int vf, unsigned int txq, unsigned int txq_eth_ctrl,
706 unsigned int rxqi, unsigned int rxq, unsigned int tc,
707 unsigned int vi, unsigned int cmask, unsigned int pmask,
708 unsigned int nexact, unsigned int rcaps, unsigned int wxcaps);
709 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
710 unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac,
711 unsigned int *rss_size);
712 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
713 int mtu, int promisc, int all_multi, int bcast, int vlanex,
715 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox,
716 unsigned int viid, bool free, unsigned int naddr,
717 const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok);
718 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
719 int idx, const u8 *addr, bool persist, bool add_smt);
720 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid,
721 bool ucast, u64 vec, bool sleep_ok);
722 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid,
723 bool rx_en, bool tx_en);
724 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
725 unsigned int nblinks);
726 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
727 unsigned int mmd, unsigned int reg, u16 *valp);
728 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
729 unsigned int mmd, unsigned int reg, u16 val);
730 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
731 unsigned int vf, unsigned int iqtype, unsigned int iqid,
732 unsigned int fl0id, unsigned int fl1id);
733 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
734 unsigned int vf, unsigned int eqid);
735 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
736 unsigned int vf, unsigned int eqid);
737 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
738 unsigned int vf, unsigned int eqid);
739 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
740 void t4_db_full(struct adapter *adapter);
741 void t4_db_dropped(struct adapter *adapter);
742 int t4_mem_win_read_len(struct adapter *adap, u32 addr, __be32 *data, int len);
743 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox,
745 #endif /* __CXGB4_H__ */