Lines Matching defs:adap
62 #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
794 struct adapter *adap;
881 struct adapter *adap;
891 struct adapter *adap;
956 struct adapter *adap; /* Backpointer to adapter */
1476 static inline int is_offload(const struct adapter *adap)
1478 return adap->params.offload;
1481 static inline int is_hashfilter(const struct adapter *adap)
1483 return adap->params.hash_filter;
1486 static inline int is_pci_uld(const struct adapter *adap)
1488 return adap->params.crypto;
1491 static inline int is_uld(const struct adapter *adap)
1493 return (adap->params.offload || adap->params.crypto);
1496 static inline int is_ethofld(const struct adapter *adap)
1498 return adap->params.ethofld;
1501 static inline u32 t4_read_reg(struct adapter *adap, u32 reg_addr)
1503 return readl(adap->regs + reg_addr);
1506 static inline void t4_write_reg(struct adapter *adap, u32 reg_addr, u32 val)
1508 writel(val, adap->regs + reg_addr);
1524 static inline u64 t4_read_reg64(struct adapter *adap, u32 reg_addr)
1526 return readq(adap->regs + reg_addr);
1529 static inline void t4_write_reg64(struct adapter *adap, u32 reg_addr, u64 val)
1531 writeq(val, adap->regs + reg_addr);
1563 * @adap: the adapter
1568 static inline struct port_info *adap2pinfo(struct adapter *adap, int idx)
1570 return netdev_priv(adap->port[idx]);
1596 static inline unsigned int qtimer_val(const struct adapter *adap,
1601 return idx < SGE_NTIMERS ? adap->sge.timer_val[idx] : 0;
1607 void t4_os_portmod_changed(struct adapter *adap, int port_id);
1608 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
1610 void t4_free_sge_resources(struct adapter *adap);
1611 void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
1612 irq_handler_t t4_intr_handler(struct adapter *adap);
1617 int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
1618 int t4_ofld_send(struct adapter *adap, struct sk_buff *skb);
1619 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
1623 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
1626 int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
1629 int t4_sge_mod_ctrl_txq(struct adapter *adap, unsigned int eqid,
1631 int t4_sge_alloc_uld_txq(struct adapter *adap, struct sge_uld_txq *txq,
1634 int t4_sge_alloc_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq,
1636 void t4_sge_free_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq);
1638 int t4_sge_init(struct adapter *adap);
1639 void t4_sge_start(struct adapter *adap);
1640 void t4_sge_stop(struct adapter *adap);
1641 int t4_sge_eth_txq_egress_update(struct adapter *adap, struct sge_eth_txq *q,
1651 static inline int is_bypass(struct adapter *adap)
1653 return adap->params.bypass;
1681 static inline unsigned int core_ticks_per_usec(const struct adapter *adap)
1683 return adap->params.vpd.cclk / 1000;
1686 static inline unsigned int us_to_core_ticks(const struct adapter *adap,
1689 return (us * adap->params.vpd.cclk) / 1000;
1700 static inline unsigned int dack_ticks_to_usec(const struct adapter *adap,
1703 return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap);
1706 void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask,
1709 int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
1711 int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
1714 static inline int t4_wr_mbox_timeout(struct adapter *adap, int mbox,
1718 return t4_wr_mbox_meat_timeout(adap, mbox, cmd, size, rpl, true,
1722 static inline int t4_wr_mbox(struct adapter *adap, int mbox, const void *cmd,
1725 return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, true);
1728 static inline int t4_wr_mbox_ns(struct adapter *adap, int mbox, const void *cmd,
1731 return t4_wr_mbox_meat(adap, mbox, cmd, size, rpl, false);
1754 static inline void init_rspq(struct adapter *adap, struct sge_rspq *q,
1758 q->adap = adap;
1779 void t4_write_indirect(struct adapter *adap, unsigned int addr_reg,
1782 void t4_read_indirect(struct adapter *adap, unsigned int addr_reg,
1797 int t4_link_l1cfg_core(struct adapter *adap, unsigned int mbox,
1815 int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port);
1817 u32 t4_read_pcie_cfg4(struct adapter *adap, int reg);
1818 u32 t4_get_util_window(struct adapter *adap);
1819 void t4_setup_memwin(struct adapter *adap, u32 memwin_base, u32 window);
1821 int t4_memory_rw_init(struct adapter *adap, int win, int mtype, u32 *mem_off,
1823 void t4_memory_update_win(struct adapter *adap, int win, u32 addr);
1824 void t4_memory_rw_residual(struct adapter *adap, u32 off, u32 addr, u8 *buf,
1828 int t4_memory_rw(struct adapter *adap, int win, int mtype, u32 addr, u32 len,
1830 static inline int t4_memory_write(struct adapter *adap, int mtype, u32 addr,
1833 return t4_memory_rw(adap, 0, mtype, addr, len, buf, 0);
1837 void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size);
1847 int t4_load_phy_fw(struct adapter *adap, int win,
1850 int t4_phy_fw_ver(struct adapter *adap, int *phy_fw_ver);
1851 int t4_fwcache(struct adapter *adap, enum fw_params_param_dev_fwcache op);
1852 int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
1854 int t4_fl_pkt_align(struct adapter *adap);
1856 int t4_check_fw_version(struct adapter *adap);
1866 int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info,
1880 unsigned int qtimer_val(const struct adapter *adap,
1885 int t4_init_tp_params(struct adapter *adap, bool sleep_ok);
1886 int t4_filter_field_shift(const struct adapter *adap, int filter_sel);
1887 int t4_init_rss_mode(struct adapter *adap, int mbox);
1890 int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
1903 void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx,
1914 void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
1915 void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
1916 int t4_read_cim_ibq(struct adapter *adap, unsigned int qid, u32 *data,
1918 int t4_read_cim_obq(struct adapter *adap, unsigned int qid, u32 *data,
1920 int t4_cim_read(struct adapter *adap, unsigned int addr, unsigned int n,
1922 int t4_cim_write(struct adapter *adap, unsigned int addr, unsigned int n,
1924 int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr);
1925 void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp,
1928 void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp);
1929 void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres);
1931 void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
1932 void t4_get_port_stats_offset(struct adapter *adap, int idx,
1935 void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p);
1936 void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log);
1937 void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]);
1938 void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr,
1940 void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr);
1941 void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st,
1943 void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st,
1945 void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st,
1947 void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st,
1949 void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
1951 void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx,
1953 void t4_load_mtus(struct adapter *adap, const unsigned short *mtus,
1956 void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf);
1958 void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate);
1961 void t4_wol_magic_enable(struct adapter *adap, unsigned int port,
1963 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map,
1966 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
1968 int t4_fw_bye(struct adapter *adap, unsigned int mbox);
1969 int t4_early_init(struct adapter *adap, unsigned int mbox);
1970 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
1971 int t4_fixup_host_params(struct adapter *adap, unsigned int page_size,
1973 int t4_fw_initialize(struct adapter *adap, unsigned int mbox);
1974 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
1977 int t4_query_params_ns(struct adapter *adap, unsigned int mbox, unsigned int pf,
1980 int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf,
1983 int t4_set_params_timeout(struct adapter *adap, unsigned int mbox,
1987 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
1990 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf,
1995 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
1998 int t4_free_vi(struct adapter *adap, unsigned int mbox,
2001 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
2004 int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid,
2007 int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid, int idx,
2009 int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
2013 int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid,
2016 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox,
2019 int t4_free_mac_filt(struct adapter *adap, unsigned int mbox,
2022 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
2024 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid,
2026 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
2028 int t4_enable_pi_params(struct adapter *adap, unsigned int mbox,
2031 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid,
2033 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
2035 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
2037 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
2039 int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf,
2042 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
2045 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
2047 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
2049 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
2051 int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type);
2052 int t4_read_sge_dbqtimers(struct adapter *adap, unsigned int ndbqtimers,
2058 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
2065 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox,
2067 void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]);
2068 void t4_get_tx_sched(struct adapter *adap, unsigned int sched,
2070 int t4_sge_ctxt_rd(struct adapter *adap, unsigned int mbox, unsigned int cid,
2072 int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid,
2086 void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
2088 void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
2090 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs,
2093 void t4_uld_mem_free(struct adapter *adap);
2094 int t4_uld_mem_alloc(struct adapter *adap);
2095 void t4_uld_clean_up(struct adapter *adap);
2097 int t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port,
2100 int t4_load_boot(struct adapter *adap, u8 *boot_data,
2102 int t4_load_bootcfg(struct adapter *adap,
2104 void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq, struct sge_fl *fl);
2105 void free_tx_desc(struct adapter *adap, struct sge_txq *q,
2107 void cxgb4_eosw_txq_free_desc(struct adapter *adap, struct sge_eosw_txq *txq,
2113 void free_txq(struct adapter *adap, struct sge_txq *q);
2114 void cxgb4_reclaim_completed_tx(struct adapter *adap,
2126 void cxgb4_ring_tx_db(struct adapter *adap, struct sge_txq *q, int n);
2127 int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf,
2131 int cxgb4_thermal_init(struct adapter *adap);
2132 int cxgb4_thermal_remove(struct adapter *adap);
2133 int cxgb4_set_msix_aff(struct adapter *adap, unsigned short vec,
2141 int cxgb4_alloc_mac_filt(struct adapter *adap, unsigned int viid,
2145 int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid,
2147 int cxgb4_init_mps_ref_entries(struct adapter *adap);
2148 void cxgb4_free_mps_ref_entries(struct adapter *adap);
2149 int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
2153 int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
2155 int cxgb4_free_raw_mac_filt(struct adapter *adap,
2163 int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
2174 int cxgb4_get_msix_idx_from_bmap(struct adapter *adap);
2175 void cxgb4_free_msix_idx_in_bmap(struct adapter *adap, u32 msix_idx);
2176 void cxgb4_enable_rx(struct adapter *adap, struct sge_rspq *q);
2181 int cxgb4_set_ktls_feature(struct adapter *adap, bool enable);