Lines Matching full:adapter

50  *	@adapter: the adapter performing the operation
63 static int t4_wait_op_done_val(struct adapter *adapter, int reg, u32 mask, in t4_wait_op_done_val() argument
67 u32 val = t4_read_reg(adapter, reg); in t4_wait_op_done_val()
81 static inline int t4_wait_op_done(struct adapter *adapter, int reg, u32 mask, in t4_wait_op_done() argument
84 return t4_wait_op_done_val(adapter, reg, mask, polarity, attempts, in t4_wait_op_done()
90 * @adapter: the adapter to program
98 void t4_set_reg_field(struct adapter *adapter, unsigned int addr, u32 mask, in t4_set_reg_field() argument
101 u32 v = t4_read_reg(adapter, addr) & ~mask; in t4_set_reg_field()
103 t4_write_reg(adapter, addr, v | val); in t4_set_reg_field()
104 (void) t4_read_reg(adapter, addr); /* flush */ in t4_set_reg_field()
109 * @adap: the adapter
119 void t4_read_indirect(struct adapter *adap, unsigned int addr_reg, in t4_read_indirect()
132 * @adap: the adapter
142 void t4_write_indirect(struct adapter *adap, unsigned int addr_reg, in t4_write_indirect()
191 * @adap: the adapter
193 * The adapter firmware can indicate error conditions to the host.
197 void t4_report_fw_error(struct adapter *adap) in t4_report_fw_error()
213 CH_ERR(adap, "firmware reports adapter error: %s (0x%08x)\n", in t4_report_fw_error()
221 static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit, in get_mbox_rpl()
231 static void fw_asrt(struct adapter *adap, struct fw_debug_cmd *asrt) in fw_asrt()
247 t4_port_reg(struct adapter *adap, u8 port, u32 reg) in t4_port_reg()
255 read_tx_state_one(struct adapter *sc, int i, struct port_tx_state *tx_state) in read_tx_state_one()
267 read_tx_state(struct adapter *sc, struct port_tx_state *tx_state) in read_tx_state()
276 check_tx_state(struct adapter *sc, struct port_tx_state *tx_state) in check_tx_state()
301 * @adap: the adapter
326 int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, in t4_wr_mbox_meat_timeout()
508 int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, in t4_wr_mbox_meat()
516 static int t4_edc_err_read(struct adapter *adap, int idx) in t4_edc_err_read()
555 * @adap: the adapter
565 int t4_mc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) in t4_mc_read()
610 * @adap: the adapter
620 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) in t4_edc_read()
675 * @adap: the adapter
688 int t4_mem_read(struct adapter *adap, int mtype, u32 addr, u32 len, in t4_mem_read()
740 u32 t4_read_pcie_cfg4(struct adapter *adap, int reg, int drv_fw_attach) in t4_read_pcie_cfg4()
786 * @adapter: the adapter
790 unsigned int t4_get_regs_len(struct adapter *adapter) in t4_get_regs_len() argument
792 unsigned int chip_version = chip_id(adapter); in t4_get_regs_len()
796 if (adapter->flags & IS_VF) in t4_get_regs_len()
802 if (adapter->flags & IS_VF) in t4_get_regs_len()
807 CH_ERR(adapter, in t4_get_regs_len()
814 * @adap: the adapter
822 void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size) in t4_get_regs()
2649 * adapter chip type. in t4_get_regs()
2740 * We have a per-adapter state variable "VPD Busy" to indicate when we have a
2745 static int t4_seeprom_wait(struct adapter *adapter) in t4_seeprom_wait() argument
2747 unsigned int base = adapter->params.pci.vpd_cap_addr; in t4_seeprom_wait()
2754 if (!adapter->vpd_busy) in t4_seeprom_wait()
2766 t4_os_pci_read_cfg2(adapter, base + PCI_VPD_ADDR, &val); in t4_seeprom_wait()
2772 if ((val & PCI_VPD_ADDR_F) == adapter->vpd_flag) { in t4_seeprom_wait()
2773 adapter->vpd_busy = 0; in t4_seeprom_wait()
2790 * @adapter: adapter to read
2798 int t4_seeprom_read(struct adapter *adapter, u32 addr, u32 *data) in t4_seeprom_read() argument
2800 unsigned int base = adapter->params.pci.vpd_cap_addr; in t4_seeprom_read()
2813 ret = t4_seeprom_wait(adapter); in t4_seeprom_read()
2815 CH_ERR(adapter, "VPD still busy from previous operation\n"); in t4_seeprom_read()
2825 t4_os_pci_write_cfg2(adapter, base + PCI_VPD_ADDR, (u16)addr); in t4_seeprom_read()
2826 adapter->vpd_busy = 1; in t4_seeprom_read()
2827 adapter->vpd_flag = PCI_VPD_ADDR_F; in t4_seeprom_read()
2828 ret = t4_seeprom_wait(adapter); in t4_seeprom_read()
2830 CH_ERR(adapter, "VPD read of address %#x failed\n", addr); in t4_seeprom_read()
2838 t4_os_pci_read_cfg4(adapter, base + PCI_VPD_DATA, data); in t4_seeprom_read()
2845 * @adapter: adapter to write
2853 int t4_seeprom_write(struct adapter *adapter, u32 addr, u32 data) in t4_seeprom_write() argument
2855 unsigned int base = adapter->params.pci.vpd_cap_addr; in t4_seeprom_write()
2870 ret = t4_seeprom_wait(adapter); in t4_seeprom_write()
2872 CH_ERR(adapter, "VPD still busy from previous operation\n"); in t4_seeprom_write()
2882 t4_os_pci_write_cfg4(adapter, base + PCI_VPD_DATA, in t4_seeprom_write()
2884 t4_os_pci_write_cfg2(adapter, base + PCI_VPD_ADDR, in t4_seeprom_write()
2886 adapter->vpd_busy = 1; in t4_seeprom_write()
2887 adapter->vpd_flag = 0; in t4_seeprom_write()
2888 ret = t4_seeprom_wait(adapter); in t4_seeprom_write()
2890 CH_ERR(adapter, "VPD write of address %#x failed\n", addr); in t4_seeprom_write()
2898 t4_os_pci_write_cfg4(adapter, base + PCI_VPD_DATA, 0); in t4_seeprom_write()
2902 t4_seeprom_read(adapter, EEPROM_STAT_ADDR, &stats_reg); in t4_seeprom_write()
2942 * @adapter: the adapter
2947 int t4_seeprom_wp(struct adapter *adapter, int enable) in t4_seeprom_wp() argument
2949 return t4_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0); in t4_seeprom_wp()
2999 * @adapter: adapter to read
3005 static int get_vpd_params(struct adapter *adapter, struct vpd_params *p, in get_vpd_params() argument
3017 ret = t4_seeprom_read(adapter, VPD_BASE, buf); in get_vpd_params()
3031 ret = t4_seeprom_read(adapter, addr + i, buf++); in get_vpd_params()
3039 CH_ERR(adapter, "missing VPD keyword " name "\n"); \ in get_vpd_params()
3049 CH_ERR(adapter, in get_vpd_params()
3105 * @adapter: the adapter
3115 static int sf1_read(struct adapter *adapter, unsigned int byte_cnt, int cont, in sf1_read() argument
3122 if (t4_read_reg(adapter, A_SF_OP) & F_BUSY) in sf1_read()
3124 t4_write_reg(adapter, A_SF_OP, in sf1_read()
3126 ret = t4_wait_op_done(adapter, A_SF_OP, F_BUSY, 0, SF_ATTEMPTS, 5); in sf1_read()
3128 *valp = t4_read_reg(adapter, A_SF_DATA); in sf1_read()
3134 * @adapter: the adapter
3144 static int sf1_write(struct adapter *adapter, unsigned int byte_cnt, int cont, in sf1_write() argument
3149 if (t4_read_reg(adapter, A_SF_OP) & F_BUSY) in sf1_write()
3151 t4_write_reg(adapter, A_SF_DATA, val); in sf1_write()
3152 t4_write_reg(adapter, A_SF_OP, V_SF_LOCK(lock) | in sf1_write()
3154 return t4_wait_op_done(adapter, A_SF_OP, F_BUSY, 0, SF_ATTEMPTS, 5); in sf1_write()
3159 * @adapter: the adapter
3165 static int flash_wait_op(struct adapter *adapter, int attempts, int delay) in flash_wait_op() argument
3171 if ((ret = sf1_write(adapter, 1, 1, 1, SF_RD_STATUS)) != 0 || in flash_wait_op()
3172 (ret = sf1_read(adapter, 1, 0, 1, &status)) != 0) in flash_wait_op()
3185 * @adapter: the adapter
3196 int t4_read_flash(struct adapter *adapter, unsigned int addr, in t4_read_flash() argument
3201 if (addr + nwords * sizeof(u32) > adapter->params.sf_size || (addr & 3)) in t4_read_flash()
3206 if ((ret = sf1_write(adapter, 4, 1, 0, addr)) != 0 || in t4_read_flash()
3207 (ret = sf1_read(adapter, 1, 1, 0, data)) != 0) in t4_read_flash()
3211 ret = sf1_read(adapter, 4, nwords > 1, nwords == 1, data); in t4_read_flash()
3213 t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ in t4_read_flash()
3224 * @adapter: the adapter
3235 int t4_write_flash(struct adapter *adapter, unsigned int addr, in t4_write_flash() argument
3242 if (addr >= adapter->params.sf_size || offset + n > SF_PAGE_SIZE) in t4_write_flash()
3247 if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 || in t4_write_flash()
3248 (ret = sf1_write(adapter, 4, 1, 1, val)) != 0) in t4_write_flash()
3259 ret = sf1_write(adapter, c, c != left, 1, val); in t4_write_flash()
3263 ret = flash_wait_op(adapter, 8, 1); in t4_write_flash()
3267 t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ in t4_write_flash()
3270 ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, in t4_write_flash()
3276 CH_ERR(adapter, in t4_write_flash()
3284 t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ in t4_write_flash()
3290 * @adapter: the adapter
3295 int t4_get_fw_version(struct adapter *adapter, u32 *vers) in t4_get_fw_version() argument
3297 return t4_read_flash(adapter, FLASH_FW_START + in t4_get_fw_version()
3304 * @adapter: the adapter
3309 int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr) in t4_get_fw_hdr() argument
3311 return t4_read_flash(adapter, FLASH_FW_START, in t4_get_fw_hdr()
3317 * @adapter: the adapter
3322 int t4_get_bs_version(struct adapter *adapter, u32 *vers) in t4_get_bs_version() argument
3324 return t4_read_flash(adapter, FLASH_FWBOOTSTRAP_START + in t4_get_bs_version()
3331 * @adapter: the adapter
3336 int t4_get_tp_version(struct adapter *adapter, u32 *vers) in t4_get_tp_version() argument
3338 return t4_read_flash(adapter, FLASH_FW_START + in t4_get_tp_version()
3345 * @adapter: the adapter
3353 int t4_get_exprom_version(struct adapter *adapter, u32 *vers) in t4_get_exprom_version() argument
3363 ret = t4_read_flash(adapter, FLASH_EXP_ROM_START, in t4_get_exprom_version()
3382 * @adapter: the adapter
3388 * adapter specific. Returns 0 on success, an error on failure.
3400 * been issued if the Host Driver will be performing a full adapter
3403 int t4_get_scfg_version(struct adapter *adapter, u32 *vers) in t4_get_scfg_version() argument
3410 ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, in t4_get_scfg_version()
3419 * @adapter: the adapter
3424 * VPD version is adapter specific. Returns 0 on success, an error on
3436 * if the Host Driver will be performing a full adapter initialization.
3438 int t4_get_vpd_version(struct adapter *adapter, u32 *vers) in t4_get_vpd_version() argument
3445 ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, in t4_get_vpd_version()
3454 * @adapter: the adapter
3457 * adapter Adapter Parameters structure. If any of the efforts fails
3461 int t4_get_version_info(struct adapter *adapter) in t4_get_version_info() argument
3472 FIRST_RET(t4_get_fw_version(adapter, &adapter->params.fw_vers)); in t4_get_version_info()
3473 FIRST_RET(t4_get_bs_version(adapter, &adapter->params.bs_vers)); in t4_get_version_info()
3474 FIRST_RET(t4_get_tp_version(adapter, &adapter->params.tp_vers)); in t4_get_version_info()
3475 FIRST_RET(t4_get_exprom_version(adapter, &adapter->params.er_vers)); in t4_get_version_info()
3476 FIRST_RET(t4_get_scfg_version(adapter, &adapter->params.scfg_vers)); in t4_get_version_info()
3477 FIRST_RET(t4_get_vpd_version(adapter, &adapter->params.vpd_vers)); in t4_get_version_info()
3486 * @adapter: the adapter
3492 int t4_flash_erase_sectors(struct adapter *adapter, int start, int end) in t4_flash_erase_sectors() argument
3496 if (end >= adapter->params.sf_nsec) in t4_flash_erase_sectors()
3500 if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 || in t4_flash_erase_sectors()
3501 (ret = sf1_write(adapter, 4, 0, 1, in t4_flash_erase_sectors()
3503 (ret = flash_wait_op(adapter, 14, 500)) != 0) { in t4_flash_erase_sectors()
3504 CH_ERR(adapter, in t4_flash_erase_sectors()
3511 t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ in t4_flash_erase_sectors()
3517 * @adapter: the adapter
3523 int t4_flash_cfg_addr(struct adapter *adapter) in t4_flash_cfg_addr() argument
3529 if (adapter->params.sf_size < FLASH_CFG_START + FLASH_CFG_MAX_SIZE) in t4_flash_cfg_addr()
3536 * Return TRUE if the specified firmware matches the adapter. I.e. T4
3541 static int t4_fw_matches_chip(struct adapter *adap, in t4_fw_matches_chip()
3545 * The expression below will return FALSE for any unsupported adapter in t4_fw_matches_chip()
3554 "FW image (%d) is not suitable for this adapter (%d)\n", in t4_fw_matches_chip()
3561 * @adap: the adapter
3567 int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size) in t4_load_fw()
3658 * @adap: the adapter
3661 int t4_fwcache(struct adapter *adap, enum fw_params_param_dev_fwcache op) in t4_fwcache()
3680 void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp, in t4_cim_read_pif_la()
3714 void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp) in t4_cim_read_ma_la()
3735 void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf) in t4_ulprx_read_la()
3878 int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, in t4_link_l1cfg()
4017 * @adap: the adapter
4023 int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port) in t4_restart_aneg()
4046 bool (*action)(struct adapter *, int, bool);
4072 t4_show_intr_info(struct adapter *adap, const struct intr_info *ii, u32 cause) in t4_show_intr_info()
4105 t4_handle_intr(struct adapter *adap, const struct intr_info *ii, in t4_handle_intr()
4146 static bool pcie_intr_handler(struct adapter *adap, int arg, bool verbose) in pcie_intr_handler()
4281 static bool tp_intr_handler(struct adapter *adap, int arg, bool verbose) in tp_intr_handler()
4304 static bool sge_intr_handler(struct adapter *adap, int arg, bool verbose) in sge_intr_handler()
4466 static bool cim_intr_handler(struct adapter *adap, int arg, bool verbose) in cim_intr_handler()
4605 static bool ulprx_intr_handler(struct adapter *adap, int arg, bool verbose) in ulprx_intr_handler()
4647 static bool ulptx_intr_handler(struct adapter *adap, int arg, bool verbose) in ulptx_intr_handler()
4683 static bool pmtx_dump_dbg_stats(struct adapter *adap, int arg, bool verbose) in pmtx_dump_dbg_stats()
4701 static bool pmtx_intr_handler(struct adapter *adap, int arg, bool verbose) in pmtx_intr_handler()
4740 static bool pmrx_intr_handler(struct adapter *adap, int arg, bool verbose) in pmrx_intr_handler()
4780 static bool cplsw_intr_handler(struct adapter *adap, int arg, bool verbose) in cplsw_intr_handler()
4822 static bool le_intr_handler(struct adapter *adap, int arg, bool verbose) in le_intr_handler()
4878 static bool mps_intr_handler(struct adapter *adap, int arg, bool verbose) in mps_intr_handler()
5021 static bool mem_intr_handler(struct adapter *adap, int idx, bool verbose) in mem_intr_handler()
5094 static bool ma_wrap_status(struct adapter *adap, int arg, bool verbose) in ma_wrap_status()
5111 static bool ma_intr_handler(struct adapter *adap, int arg, bool verbose) in ma_intr_handler()
5158 static bool smb_intr_handler(struct adapter *adap, int arg, bool verbose) in smb_intr_handler()
5182 static bool ncsi_intr_handler(struct adapter *adap, int arg, bool verbose) in ncsi_intr_handler()
5208 static bool mac_intr_handler(struct adapter *adap, int port, bool verbose) in mac_intr_handler()
5267 static bool pl_timeout_status(struct adapter *adap, int arg, bool verbose) in pl_timeout_status()
5277 static bool plpl_intr_handler(struct adapter *adap, int arg, bool verbose) in plpl_intr_handler()
5307 * @adap: the adapter
5314 bool t4_slow_intr_handler(struct adapter *adap, bool verbose) in t4_slow_intr_handler()
5411 * @adapter: the adapter whose interrupts should be enabled
5422 void t4_intr_enable(struct adapter *adap) in t4_intr_enable()
5444 * @adap: the adapter whose interrupts should be disabled
5450 void t4_intr_disable(struct adapter *adap) in t4_intr_disable()
5476 * @adapter: the adapter
5491 int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid, in t4_config_rss_range() argument
5563 ret = t4_wr_mbox(adapter, mbox, &cmd, sizeof(cmd), NULL); in t4_config_rss_range()
5572 * @adapter: the adapter
5579 int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode, in t4_config_glbl_rss() argument
5597 return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); in t4_config_glbl_rss()
5602 * @adapter: the adapter
5612 int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, in t4_config_vi_rss() argument
5629 return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); in t4_config_vi_rss()
5633 static int rd_rss_row(struct adapter *adap, int row, u32 *val) in rd_rss_row()
5642 * @adapter: the adapter
5647 int t4_read_rss(struct adapter *adapter, u16 *map) in t4_read_rss() argument
5651 int rss_nentries = adapter->chip_params->rss_nentries; in t4_read_rss()
5654 ret = rd_rss_row(adapter, i, &val); in t4_read_rss()
5665 * @adap: the adapter
5675 static int t4_tp_fw_ldst_rw(struct adapter *adap, int cmd, u32 *vals, in t4_tp_fw_ldst_rw()
5707 * @adap: the adapter
5719 static void t4_tp_indirect_rw(struct adapter *adap, u32 reg_addr, u32 reg_data, in t4_tp_indirect_rw()
5758 * @adap: the adapter
5766 void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, in t4_tp_pio_read()
5775 * @adap: the adapter
5783 void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs, in t4_tp_pio_write()
5792 * @adap: the adapter
5800 void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, in t4_tp_tm_pio_read()
5809 * @adap: the adapter
5817 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, in t4_tp_mib_read()
5826 * @adap: the adapter
5832 void t4_read_rss_key(struct adapter *adap, u32 *key, bool sleep_ok) in t4_read_rss_key()
5839 * @adap: the adapter
5848 void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx, in t4_write_rss_key()
5878 * @adapter: the adapter
5886 void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, in t4_read_rss_pf_config() argument
5889 t4_tp_pio_read(adapter, valp, 1, A_TP_RSS_PF0_CONFIG + index, sleep_ok); in t4_read_rss_pf_config()
5894 * @adapter: the adapter
5902 void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, in t4_write_rss_pf_config() argument
5905 t4_tp_pio_write(adapter, &val, 1, A_TP_RSS_PF0_CONFIG + index, in t4_write_rss_pf_config()
5911 * @adapter: the adapter
5920 void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, in t4_read_rss_vf_config() argument
5925 if (chip_id(adapter) <= CHELSIO_T5) { in t4_read_rss_vf_config()
5935 vrt = t4_read_reg(adapter, A_TP_RSS_CONFIG_VRT); in t4_read_rss_vf_config()
5938 t4_write_reg(adapter, A_TP_RSS_CONFIG_VRT, vrt); in t4_read_rss_vf_config()
5943 t4_tp_pio_read(adapter, vfl, 1, A_TP_RSS_VFL_CONFIG, sleep_ok); in t4_read_rss_vf_config()
5944 t4_tp_pio_read(adapter, vfh, 1, A_TP_RSS_VFH_CONFIG, sleep_ok); in t4_read_rss_vf_config()
5950 * @adapter: the adapter
5958 void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, in t4_write_rss_vf_config() argument
5963 if (chip_id(adapter) <= CHELSIO_T5) { in t4_write_rss_vf_config()
5974 t4_tp_pio_write(adapter, &vfl, 1, A_TP_RSS_VFL_CONFIG, sleep_ok); in t4_write_rss_vf_config()
5975 t4_tp_pio_write(adapter, &vfh, 1, A_TP_RSS_VFH_CONFIG, sleep_ok); in t4_write_rss_vf_config()
5980 vrt = t4_read_reg(adapter, A_TP_RSS_CONFIG_VRT); in t4_write_rss_vf_config()
5983 t4_write_reg(adapter, A_TP_RSS_CONFIG_VRT, vrt); in t4_write_rss_vf_config()
5988 * @adapter: the adapter
5993 u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok) in t4_read_rss_pf_map() argument
5997 t4_tp_pio_read(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, sleep_ok); in t4_read_rss_pf_map()
6004 * @adapter: the adapter
6009 void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok) in t4_write_rss_pf_map() argument
6011 t4_tp_pio_write(adapter, &pfmap, 1, A_TP_RSS_PF_MAP, sleep_ok); in t4_write_rss_pf_map()
6016 * @adapter: the adapter
6021 u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok) in t4_read_rss_pf_mask() argument
6025 t4_tp_pio_read(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, sleep_ok); in t4_read_rss_pf_mask()
6032 * @adapter: the adapter
6037 void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok) in t4_write_rss_pf_mask() argument
6039 t4_tp_pio_write(adapter, &pfmask, 1, A_TP_RSS_PF_MSK, sleep_ok); in t4_write_rss_pf_mask()
6044 * @adap: the adapter
6052 void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, in t4_tp_get_tcp_stats()
6084 * @adap: the adapter
6090 void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st, in t4_tp_get_err_stats()
6125 * @adap: the adapter
6131 void t4_tp_get_tnl_stats(struct adapter *adap, struct tp_tnl_stats *st, in t4_tp_get_tnl_stats()
6144 * @adap: the adapter
6149 void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st, in t4_tp_get_proxy_stats()
6159 * @adap: the adapter
6165 void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st, in t4_tp_get_cpl_stats()
6177 * @adap: the adapter
6182 void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st, in t4_tp_get_rdma_stats()
6191 * @adap: the adapter
6198 void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, in t4_get_fcoe_stats()
6217 * @adap: the adapter
6223 void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st, in t4_get_usm_stats()
6237 * @adap: the adapter
6243 void t4_tp_get_tid_stats(struct adapter *adap, struct tp_tid_stats *st, in t4_tp_get_tid_stats()
6252 * @adap: the adapter
6258 void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log) in t4_read_mtu_tbl()
6275 * @adap: the adapter
6281 void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]) in t4_read_cong_tbl()
6296 * @adap: the adapter
6303 void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr, in t4_tp_wr_bits_indirect()
6360 * @adap: the adapter
6370 void t4_load_mtus(struct adapter *adap, const unsigned short *mtus, in t4_load_mtus()
6404 * @adap: the adapter
6411 int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals, in t4_set_pace_tbl()
6435 * @adap: the adapter
6441 int t4_set_sched_bps(struct adapter *adap, int sched, unsigned int kbps) in t4_set_sched_bps()
6479 * @adap: the adapter
6485 int t4_set_sched_ipg(struct adapter *adap, int sched, unsigned int ipg) in t4_set_sched_ipg()
6516 static u64 chan_rate(struct adapter *adap, unsigned int bytes256) in chan_rate()
6525 * @adap: the adapter
6532 void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate) in t4_get_chan_txrate()
6555 * @adap: the adapter
6564 int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, in t4_set_trace_filter()
6637 * @adap: the adapter
6644 void t4_get_trace_filter(struct adapter *adap, struct trace_params *tp, int idx, in t4_get_trace_filter()
6680 * @adap: the adapter
6686 void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) in t4_pmtx_get_stats()
6707 * @adap: the adapter
6713 void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) in t4_pmrx_get_stats()
6734 * @adap: the adapter
6741 static unsigned int t4_get_mps_bg_map(struct adapter *adap, int idx) in t4_get_mps_bg_map()
6760 static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx) in t4_get_rx_e_chan_map()
6775 static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx) in t4_get_rx_c_chan()
6785 static unsigned int t4_get_tx_c_chan(struct adapter *adap, int idx) in t4_get_tx_c_chan()
6830 * @adap: The adapter
6835 void t4_get_port_stats_offset(struct adapter *adap, int idx, in t4_get_port_stats_offset()
6851 * @adap: the adapter
6857 void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) in t4_get_port_stats()
6955 * @adap: the adapter
6961 void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p) in t4_get_lb_stats()
7004 * @adap: the adapter
7010 void t4_wol_magic_enable(struct adapter *adap, unsigned int port, in t4_wol_magic_enable()
7038 * @adap: the adapter
7051 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map, in t4_wol_pat_enable()
7129 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, in t4_fwaddrspace_write()
7150 * @adap: the adapter
7159 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, in t4_mdio_rd()
7184 * @adap: the adapter
7193 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, in t4_mdio_wr()
7216 * @adap: the adapter
7219 void t4_sge_decode_idma_state(struct adapter *adapter, int state) in t4_sge_decode_idma_state() argument
7334 unsigned int chip_version = chip_id(adapter); in t4_sge_decode_idma_state()
7337 * adapter chip type. in t4_sge_decode_idma_state()
7356 CH_ERR(adapter, "Unsupported chip version %d\n", chip_version); in t4_sge_decode_idma_state()
7361 CH_WARN(adapter, "idma state %s\n", sge_idma_decode[state]); in t4_sge_decode_idma_state()
7363 CH_WARN(adapter, "idma state %d unknown\n", state); in t4_sge_decode_idma_state()
7366 CH_WARN(adapter, "SGE register %#x value %#x\n", in t4_sge_decode_idma_state()
7367 sge_regs[i], t4_read_reg(adapter, sge_regs[i])); in t4_sge_decode_idma_state()
7372 * @adap: the adapter
7378 int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type) in t4_sge_ctxt_flush()
7400 * @adap: the adapter
7409 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, in t4_fw_hello()
7457 * Master PF Driver to finish setting up the adapter. in t4_fw_hello()
7528 * @adap: the adapter
7533 int t4_fw_bye(struct adapter *adap, unsigned int mbox) in t4_fw_bye()
7544 * @adap: the adapter
7550 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset) in t4_fw_reset()
7562 * @adap: the adapter
7572 * adapter without fear of conflicting with whatever the firmware might
7576 int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) in t4_fw_halt()
7622 * @adap: the adapter
7628 int t4_fw_restart(struct adapter *adap, unsigned int mbox) in t4_fw_restart()
7645 * @adap: the adapter
7651 * Perform all of the steps necessary for upgrading an adapter's
7655 * (though we'll still put the adapter microprocessor into RESET in
7659 * the adapter will have been fully RESET losing all previous setup
7660 * state. On unsuccessful return the adapter may be completely hosed ...
7661 * positive errno indicates that the adapter is ~probably~ intact, a
7664 int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, in t4_fw_upgrade()
7690 * @adap: the adapter
7696 int t4_fw_initialize(struct adapter *adap, unsigned int mbox) in t4_fw_initialize()
7707 * @adap: the adapter
7719 int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_query_params_rw()
7760 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_query_params()
7769 * @adap: the adapter
7781 int t4_set_params_timeout(struct adapter *adap, unsigned int mbox, in t4_set_params_timeout()
7809 * @adap: the adapter
7820 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_set_params()
7830 * @adap: the adapter
7849 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_cfg_pfvf()
7878 * @adap: the adapter
7896 int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, in t4_alloc_vi_func()
7953 * @adap: the adapter
7966 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, in t4_alloc_vi()
7976 * @adap: the adapter
7984 int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_free_vi()
8003 * @adap: the adapter
8015 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_set_rxmode()
8049 * @adap: the adapter
8063 int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid, in t4_alloc_encap_mac_filt()
8098 * @adap: the adapter
8111 int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid, in t4_alloc_raw_mac_filt()
8154 * @adap: the adapter
8174 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, in t4_alloc_mac_filt()
8247 * @adap: the adapter
8256 int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid, in t4_free_encap_mac_filt()
8286 * @adap: the adapter
8299 int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid, in t4_free_raw_mac_filt()
8336 * @adap: the adapter
8347 int t4_free_mac_filt(struct adapter *adap, unsigned int mbox, in t4_free_mac_filt()
8409 * @adap: the adapter
8429 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_change_mac()
8472 * @adap: the adapter
8481 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_set_addr_hash()
8500 * @adap: the adapter
8510 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox, in t4_enable_vi_params()
8528 * @adap: the adapter
8537 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_enable_vi()
8545 * @adap: the adapter
8552 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_identify_port()
8568 * @adap: the adapter
8581 int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_iq_stop()
8601 * @adap: the adapter
8612 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_iq_free()
8632 * @adap: the adapter
8641 int t4_eth_eq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_eth_eq_stop()
8658 * @adap: the adapter
8666 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_eth_eq_free()
8683 * @adap: the adapter
8691 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_ctrl_eq_free()
8708 * @adap: the adapter
8716 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, in t4_ofld_eq_free()
8917 CH_ERR(pi->adapter, "bad port_info action 0x%x\n", action); in handle_port_info()
8959 struct adapter *sc = pi->adapter; in t4_update_port_info()
8982 * @adap: the adapter
8987 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl) in t4_handle_fw_rpl()
9028 * @adapter: the adapter
9034 static void get_pci_mode(struct adapter *adapter, in get_pci_mode() argument
9040 pcie_cap = t4_os_find_pci_capability(adapter, PCI_CAP_ID_EXP); in get_pci_mode()
9042 t4_os_pci_read_cfg2(adapter, pcie_cap + PCI_EXP_LNKSTA, &val); in get_pci_mode()
9053 int t4_get_flash_params(struct adapter *adapter) in t4_get_flash_params() argument
9075 ret = sf1_write(adapter, 1, 1, 0, SF_RD_ID); in t4_get_flash_params()
9077 ret = sf1_read(adapter, 3, 0, 1, &flashid); in t4_get_flash_params()
9078 t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ in t4_get_flash_params()
9087 adapter->params.sf_size = in t4_get_flash_params()
9089 adapter->params.sf_nsec = in t4_get_flash_params()
9090 adapter->params.sf_size / SF_SEC_SIZE; in t4_get_flash_params()
9168 CH_WARN(adapter, "Unknown Flash Part, ID = %#x, assuming 4MB\n", flashid); in t4_get_flash_params()
9175 adapter->params.sf_size = size; in t4_get_flash_params()
9176 adapter->params.sf_nsec = size / SF_SEC_SIZE; in t4_get_flash_params()
9184 if (adapter->params.sf_size < FLASH_MIN_SIZE) in t4_get_flash_params()
9185 CH_WARN(adapter, "WARNING: Flash Part ID %#x, size %#x < %#x\n", in t4_get_flash_params()
9186 flashid, adapter->params.sf_size, FLASH_MIN_SIZE); in t4_get_flash_params()
9191 static void set_pcie_completion_timeout(struct adapter *adapter, in set_pcie_completion_timeout() argument
9197 pcie_cap = t4_os_find_pci_capability(adapter, PCI_CAP_ID_EXP); in set_pcie_completion_timeout()
9199 t4_os_pci_read_cfg2(adapter, pcie_cap + PCI_EXP_DEVCTL2, &val); in set_pcie_completion_timeout()
9202 t4_os_pci_write_cfg2(adapter, pcie_cap + PCI_EXP_DEVCTL2, val); in set_pcie_completion_timeout()
9265 * @adapter: the adapter
9268 * Initialize adapter SW state for the various HW modules, set initial
9269 * values for some adapter tunables, take PHYs out of reset, and
9272 int t4_prep_adapter(struct adapter *adapter, u32 *buf) in t4_prep_adapter() argument
9278 get_pci_mode(adapter, &adapter->params.pci); in t4_prep_adapter()
9280 pl_rev = t4_read_reg(adapter, A_PL_REV); in t4_prep_adapter()
9281 adapter->params.chipid = G_CHIPID(pl_rev); in t4_prep_adapter()
9282 adapter->params.rev = G_REV(pl_rev); in t4_prep_adapter()
9283 if (adapter->params.chipid == 0) { in t4_prep_adapter()
9285 adapter->params.chipid = CHELSIO_T4; in t4_prep_adapter()
9288 if (adapter->params.rev == 1) { in t4_prep_adapter()
9289 CH_ALERT(adapter, "T4 rev 1 chip is not supported.\n"); in t4_prep_adapter()
9294 adapter->chip_params = t4_get_chip_params(chip_id(adapter)); in t4_prep_adapter()
9295 if (adapter->chip_params == NULL) in t4_prep_adapter()
9298 adapter->params.pci.vpd_cap_addr = in t4_prep_adapter()
9299 t4_os_find_pci_capability(adapter, PCI_CAP_ID_VPD); in t4_prep_adapter()
9301 ret = t4_get_flash_params(adapter); in t4_prep_adapter()
9306 t4_os_pci_read_cfg2(adapter, PCI_DEVICE_ID, &device_id); in t4_prep_adapter()
9307 if (device_id >> 12 == chip_id(adapter)) in t4_prep_adapter()
9308 adapter->params.cim_la_size = adapter->chip_params->cim_la_size; in t4_prep_adapter()
9311 adapter->params.fpga = 1; in t4_prep_adapter()
9312 adapter->params.cim_la_size = 2 * adapter->chip_params->cim_la_size; in t4_prep_adapter()
9315 ret = get_vpd_params(adapter, &adapter->params.vpd, device_id, buf); in t4_prep_adapter()
9319 init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd); in t4_prep_adapter()
9324 adapter->params.nports = 1; in t4_prep_adapter()
9325 adapter->params.portvec = 1; in t4_prep_adapter()
9326 adapter->params.vpd.cclk = 50000; in t4_prep_adapter()
9329 set_pcie_completion_timeout(adapter, 0xd); in t4_prep_adapter()
9334 * t4_shutdown_adapter - shut down adapter, host & wire
9335 * @adapter: the adapter
9337 * Perform an emergency shutdown of the adapter and stop it from
9339 * host. This is typically used when the adapter and/or firmware
9345 int t4_shutdown_adapter(struct adapter *adapter) in t4_shutdown_adapter() argument
9348 const bool bt = adapter->bt_map != 0; in t4_shutdown_adapter()
9350 t4_intr_disable(adapter); in t4_shutdown_adapter()
9352 t4_write_reg(adapter, A_DBG_GPIO_EN, 0xffff0000); in t4_shutdown_adapter()
9353 for_each_port(adapter, port) { in t4_shutdown_adapter()
9354 u32 a_port_cfg = is_t4(adapter) ? in t4_shutdown_adapter()
9355 t4_port_reg(adapter, port, A_XGMAC_PORT_CFG) : in t4_shutdown_adapter()
9356 t4_port_reg(adapter, port, A_MAC_PORT_CFG); in t4_shutdown_adapter()
9358 t4_write_reg(adapter, a_port_cfg, in t4_shutdown_adapter()
9359 t4_read_reg(adapter, a_port_cfg) in t4_shutdown_adapter()
9362 u32 hss_cfg0 = is_t4(adapter) ? in t4_shutdown_adapter()
9363 t4_port_reg(adapter, port, A_XGMAC_PORT_HSS_CFG0) : in t4_shutdown_adapter()
9364 t4_port_reg(adapter, port, A_MAC_PORT_HSS_CFG0); in t4_shutdown_adapter()
9365 t4_set_reg_field(adapter, hss_cfg0, F_HSSPDWNPLLB | in t4_shutdown_adapter()
9371 t4_set_reg_field(adapter, A_SGE_CONTROL, F_GLOBALENABLE, 0); in t4_shutdown_adapter()
9378 * @adapter: the adapter
9402 int t4_bar2_sge_qregs(struct adapter *adapter, in t4_bar2_sge_qregs() argument
9416 if (!user && is_t4(adapter)) in t4_bar2_sge_qregs()
9421 page_shift = adapter->params.sge.page_shift; in t4_bar2_sge_qregs()
9427 ? adapter->params.sge.eq_s_qpp in t4_bar2_sge_qregs()
9428 : adapter->params.sge.iq_s_qpp); in t4_bar2_sge_qregs()
9469 * t4_init_devlog_params - initialize adapter->params.devlog
9470 * @adap: the adapter
9473 * Initialize various fields of the adapter's Firmware Device Log
9476 int t4_init_devlog_params(struct adapter *adap, int fw_attach) in t4_init_devlog_params()
9537 * @adapter: the adapter
9539 * Initialize various fields of the adapter's SGE Parameters structure.
9541 int t4_init_sge_params(struct adapter *adapter) in t4_init_sge_params() argument
9544 struct sge_params *sp = &adapter->params.sge; in t4_init_sge_params()
9547 r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD); in t4_init_sge_params()
9553 if (chip_id(adapter) >= CHELSIO_T6) { in t4_init_sge_params()
9554 r = t4_read_reg(adapter, A_SGE_ITP_CONTROL); in t4_init_sge_params()
9562 r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_0_AND_1); in t4_init_sge_params()
9563 sp->timer_val[0] = core_ticks_to_us(adapter, G_TIMERVALUE0(r)) * tscale; in t4_init_sge_params()
9564 sp->timer_val[1] = core_ticks_to_us(adapter, G_TIMERVALUE1(r)) * tscale; in t4_init_sge_params()
9565 r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_2_AND_3); in t4_init_sge_params()
9566 sp->timer_val[2] = core_ticks_to_us(adapter, G_TIMERVALUE2(r)) * tscale; in t4_init_sge_params()
9567 sp->timer_val[3] = core_ticks_to_us(adapter, G_TIMERVALUE3(r)) * tscale; in t4_init_sge_params()
9568 r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_4_AND_5); in t4_init_sge_params()
9569 sp->timer_val[4] = core_ticks_to_us(adapter, G_TIMERVALUE4(r)) * tscale; in t4_init_sge_params()
9570 sp->timer_val[5] = core_ticks_to_us(adapter, G_TIMERVALUE5(r)) * tscale; in t4_init_sge_params()
9572 r = t4_read_reg(adapter, A_SGE_CONM_CTRL); in t4_init_sge_params()
9574 if (is_t4(adapter)) in t4_init_sge_params()
9576 else if (is_t5(adapter)) in t4_init_sge_params()
9582 r = t4_read_reg(adapter, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); in t4_init_sge_params()
9584 (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * adapter->pf; in t4_init_sge_params()
9588 r = t4_read_reg(adapter, A_SGE_INGRESS_QUEUES_PER_PAGE_PF); in t4_init_sge_params()
9590 (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * adapter->pf; in t4_init_sge_params()
9593 r = t4_read_reg(adapter, A_SGE_HOST_PAGE_SIZE); in t4_init_sge_params()
9595 (S_HOSTPAGESIZEPF1 - S_HOSTPAGESIZEPF0) * adapter->pf; in t4_init_sge_params()
9598 r = t4_read_reg(adapter, A_SGE_CONTROL); in t4_init_sge_params()
9602 if (chip_id(adapter) <= CHELSIO_T5) { in t4_init_sge_params()
9609 if (is_t4(adapter)) in t4_init_sge_params()
9612 r = t4_read_reg(adapter, A_SGE_CONTROL2); in t4_init_sge_params()
9619 sp->sge_fl_buffer_size[i] = t4_read_reg(adapter, in t4_init_sge_params()
9648 * Read and cache the adapter's compressed filter mode and ingress config.
9651 read_filter_mode_and_ingress_config(struct adapter *adap) in read_filter_mode_and_ingress_config()
9697 * for this adapter which we need frequently ... in read_filter_mode_and_ingress_config()
9713 * @adap: the adapter
9715 * Initialize various fields of the adapter's TP Parameters structure.
9717 int t4_init_tp_params(struct adapter *adap) in t4_init_tp_params()
9754 * @adap: the adapter
9761 int t4_filter_field_shift(const struct adapter *adap, int filter_sel) in t4_filter_field_shift()
9807 int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id) in t4_port_init()
9856 * @adap: the adapter
9864 void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres) in t4_read_cimq_cfg()
9890 * @adap: the adapter
9899 int t4_read_cim_ibq(struct adapter *adap, unsigned int qid, u32 *data, size_t n) in t4_read_cim_ibq()
9932 * @adap: the adapter
9941 int t4_read_cim_obq(struct adapter *adap, unsigned int qid, u32 *data, size_t n) in t4_read_cim_obq()
9982 * @adap: the adapter
9989 int t4_cim_read(struct adapter *adap, unsigned int addr, unsigned int n, in t4_cim_read()
10009 * @adap: the adapter
10016 int t4_cim_write(struct adapter *adap, unsigned int addr, unsigned int n, in t4_cim_write()
10033 static int t4_cim_write1(struct adapter *adap, unsigned int addr, in t4_cim_write1()
10041 * @adap: the adapter
10048 int t4_cim_ctl_read(struct adapter *adap, unsigned int addr, unsigned int n, in t4_cim_ctl_read()
10056 * @adap: the adapter
10064 int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr) in t4_cim_read_la()
10125 * @adap: the adapter
10133 void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr) in t4_tp_read_la()
10183 * @adapter: the adapter
10184 * @idma: the adapter IDMA Monitor state
10188 void t4_idma_monitor_init(struct adapter *adapter, in t4_idma_monitor_init() argument
10203 idma->idma_1s_thresh = core_ticks_per_usec(adapter) * 1000000; /* 1s */ in t4_idma_monitor_init()
10209 * @adapter: the adapter
10210 * @idma: the adapter IDMA Monitor state
10214 void t4_idma_monitor(struct adapter *adapter, in t4_idma_monitor() argument
10227 t4_write_reg(adapter, A_SGE_DEBUG_INDEX, 13); in t4_idma_monitor()
10228 idma_same_state_cnt[0] = t4_read_reg(adapter, A_SGE_DEBUG_DATA_HIGH); in t4_idma_monitor()
10229 idma_same_state_cnt[1] = t4_read_reg(adapter, A_SGE_DEBUG_DATA_LOW); in t4_idma_monitor()
10242 CH_WARN(adapter, "SGE idma%d, queue %u, " in t4_idma_monitor()
10280 t4_write_reg(adapter, A_SGE_DEBUG_INDEX, 0); in t4_idma_monitor()
10281 debug0 = t4_read_reg(adapter, A_SGE_DEBUG_DATA_LOW); in t4_idma_monitor()
10284 t4_write_reg(adapter, A_SGE_DEBUG_INDEX, 11); in t4_idma_monitor()
10285 debug11 = t4_read_reg(adapter, A_SGE_DEBUG_DATA_LOW); in t4_idma_monitor()
10288 CH_WARN(adapter, "SGE idma%u, queue %u, potentially stuck in " in t4_idma_monitor()
10293 t4_sge_decode_idma_state(adapter, idma->idma_state[i]); in t4_idma_monitor()
10299 * @adapter: The adapter
10305 int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, in t4_set_vf_mac() argument
10336 return t4_wr_mbox(adapter, adapter->mbox, &cmd, sizeof(cmd), &cmd); in t4_set_vf_mac()
10341 * @adap: the adapter
10346 void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]) in t4_read_pace_tbl()
10359 * @adap: the adapter
10366 void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps, in t4_get_tx_sched()
10397 * @adap: the adapter
10403 int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) in t4_load_cfg()
10429 * with the on-adapter Firmware Configuration File. in t4_load_cfg()
10457 * @adap: the adapter
10461 int t5_fw_init_extern_mem(struct adapter *adap) in t5_fw_init_extern_mem()
10630 * @adapter: the adapter
10639 int t4_load_boot(struct adapter *adap, u8 *boot_data, in t4_load_boot()
10671 * with the on-adapter option ROM file in t4_load_boot()
10719 * Retrieve adapter's device ID in t4_load_boot()
10731 * the Device ID of the current adapter. in t4_load_boot()
10762 * @adapter: the adapter
10768 static int t4_flash_bootcfg_addr(struct adapter *adapter) in t4_flash_bootcfg_addr() argument
10774 if (adapter->params.sf_size < FLASH_BOOTCFG_START + FLASH_BOOTCFG_MAX_SIZE) in t4_flash_bootcfg_addr()
10780 int t4_load_bootcfg(struct adapter *adap,const u8 *cfg_data, unsigned int size) in t4_load_bootcfg()
10807 * with the on-adapter OptionROM Configuration File. in t4_load_bootcfg()
10835 * @adap: the adapter
10845 int t4_set_filter_cfg(struct adapter *adap, int mode, int mask, int vnic_mode) in t4_set_filter_cfg()
10932 * @adap: the adapter
10937 void t4_clr_port_stats(struct adapter *adap, int idx) in t4_clr_port_stats()
10964 * t4_i2c_io - read/write I2C data from adapter
10965 * @adap: the adapter
10975 int t4_i2c_io(struct adapter *adap, unsigned int mbox, in t4_i2c_io()
11025 int t4_i2c_rd(struct adapter *adap, unsigned int mbox, in t4_i2c_rd()
11033 int t4_i2c_wr(struct adapter *adap, unsigned int mbox, in t4_i2c_wr()
11043 * @adap: the adapter
11051 int t4_sge_ctxt_rd(struct adapter *adap, unsigned int mbox, unsigned int cid, in t4_sge_ctxt_rd()
11087 * @adap: the adapter
11095 int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype, in t4_sge_ctxt_rd_bd()
11108 int t4_sched_config(struct adapter *adapter, int type, int minmaxen, in t4_sched_config() argument
11123 return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), in t4_sched_config()
11127 int t4_sched_params(struct adapter *adapter, int type, int level, int mode, in t4_sched_params() argument
11154 return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), in t4_sched_params()
11158 int t4_sched_params_ch_rl(struct adapter *adapter, int channel, int ratemode, in t4_sched_params_ch_rl() argument
11176 return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), in t4_sched_params_ch_rl()
11180 int t4_sched_params_cl_wrr(struct adapter *adapter, int channel, int cl, in t4_sched_params_cl_wrr() argument
11201 return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), in t4_sched_params_cl_wrr()
11205 int t4_sched_params_cl_rl_kbps(struct adapter *adapter, int channel, int cl, in t4_sched_params_cl_rl_kbps() argument
11227 return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), in t4_sched_params_cl_rl_kbps()
11233 * @adapter: the adapter
11244 int t4_config_watchdog(struct adapter *adapter, unsigned int mbox, in t4_config_watchdog() argument
11271 return t4_wr_mbox(adapter, mbox, &wdog, sizeof wdog, NULL); in t4_config_watchdog()
11274 int t4_get_devlog_level(struct adapter *adapter, unsigned int *level) in t4_get_devlog_level() argument
11283 ret = t4_wr_mbox(adapter, adapter->mbox, &devlog_cmd, in t4_get_devlog_level()
11292 int t4_set_devlog_level(struct adapter *adapter, unsigned int level) in t4_set_devlog_level() argument
11302 return t4_wr_mbox(adapter, adapter->mbox, &devlog_cmd, in t4_set_devlog_level()
11306 int t4_configure_add_smac(struct adapter *adap) in t4_configure_add_smac()
11337 int t4_configure_ringbb(struct adapter *adap) in t4_configure_ringbb()
11374 * @adapter: the adapter
11380 int t4_set_vlan_acl(struct adapter *adap, unsigned int pf, unsigned int vf, in t4_set_vlan_acl()
11411 * @adap: the adapter
11424 int t4_del_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_del_mac()
11457 * @adap: the adapter
11473 int t4_add_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, in t4_add_mac()