Lines Matching full:adapter

465 #include "adapter.h"
471 #define for_each_port(adapter, iter) \ argument
472 for (iter = 0; iter < (adapter)->params.nports; ++iter)
474 static inline int is_ftid(const struct adapter *sc, u_int tid) in is_ftid()
481 static inline int is_hpftid(const struct adapter *sc, u_int tid) in is_hpftid()
488 static inline int is_etid(const struct adapter *sc, u_int tid) in is_etid()
495 static inline int is_offload(const struct adapter *adap) in is_offload()
500 static inline int is_ethoffload(const struct adapter *adap) in is_ethoffload()
505 static inline int is_hashfilter(const struct adapter *adap) in is_hashfilter()
510 static inline int is_ktls(const struct adapter *adap) in is_ktls()
515 static inline int chip_id(struct adapter *adap) in chip_id()
520 static inline int chip_rev(struct adapter *adap) in chip_rev()
525 static inline int is_t4(struct adapter *adap) in is_t4()
530 static inline int is_t5(struct adapter *adap) in is_t5()
535 static inline int is_t6(struct adapter *adap) in is_t6()
540 static inline int is_fpga(struct adapter *adap) in is_fpga()
545 static inline unsigned int core_ticks_per_usec(const struct adapter *adap) in core_ticks_per_usec()
550 static inline unsigned int us_to_core_ticks(const struct adapter *adap, in us_to_core_ticks()
556 static inline unsigned int core_ticks_to_us(const struct adapter *adapter, in core_ticks_to_us() argument
560 return ((ticks * 1000 + adapter->params.vpd.cclk/2) / in core_ticks_to_us()
561 adapter->params.vpd.cclk); in core_ticks_to_us()
564 static inline unsigned int dack_ticks_to_usec(const struct adapter *adap, in dack_ticks_to_usec()
570 static inline u_int us_to_tcp_ticks(const struct adapter *adap, u_long us) in us_to_tcp_ticks()
576 static inline u_int tcp_ticks_to_us(const struct adapter *adap, u_int ticks) in tcp_ticks_to_us()
582 void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val);
584 int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
586 int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
588 void t4_report_fw_error(struct adapter *adap);
590 static inline int t4_wr_mbox_timeout(struct adapter *adap, int mbox, in t4_wr_mbox_timeout()
598 static inline int t4_wr_mbox(struct adapter *adap, int mbox, const void *cmd, in t4_wr_mbox()
604 static inline int t4_wr_mbox_ns(struct adapter *adap, int mbox, const void *cmd, in t4_wr_mbox_ns()
610 void t4_read_indirect(struct adapter *adap, unsigned int addr_reg,
613 void t4_write_indirect(struct adapter *adap, unsigned int addr_reg,
617 u32 t4_hw_pci_read_cfg4(adapter_t *adapter, int reg);
621 void t4_intr_enable(struct adapter *adapter);
622 void t4_intr_disable(struct adapter *adapter);
623 bool t4_slow_intr_handler(struct adapter *adapter, bool verbose);
626 int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port,
628 int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port);
629 int t4_seeprom_read(struct adapter *adapter, u32 addr, u32 *data);
630 int t4_seeprom_write(struct adapter *adapter, u32 addr, u32 data);
632 int t4_seeprom_wp(struct adapter *adapter, int enable);
633 int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords,
635 int t4_write_flash(struct adapter *adapter, unsigned int addr,
637 int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
638 int t4_fwcache(struct adapter *adap, enum fw_params_param_dev_fwcache op);
639 int t5_fw_init_extern_mem(struct adapter *adap);
640 int t4_load_bootcfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
641 int t4_load_boot(struct adapter *adap, u8 *boot_data,
643 int t4_flash_erase_sectors(struct adapter *adapter, int start, int end);
644 int t4_flash_cfg_addr(struct adapter *adapter);
645 int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
646 int t4_get_fw_version(struct adapter *adapter, u32 *vers);
647 int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr);
648 int t4_get_bs_version(struct adapter *adapter, u32 *vers);
649 int t4_get_tp_version(struct adapter *adapter, u32 *vers);
650 int t4_get_exprom_version(struct adapter *adapter, u32 *vers);
651 int t4_get_scfg_version(struct adapter *adapter, u32 *vers);
652 int t4_get_vpd_version(struct adapter *adapter, u32 *vers);
653 int t4_get_version_info(struct adapter *adapter);
654 int t4_init_hw(struct adapter *adapter, u32 fw_params);
656 int t4_prep_adapter(struct adapter *adapter, u32 *buf);
657 int t4_shutdown_adapter(struct adapter *adapter);
658 int t4_init_devlog_params(struct adapter *adapter, int fw_attach);
659 int t4_init_sge_params(struct adapter *adapter);
660 int t4_init_tp_params(struct adapter *adap);
661 int t4_filter_field_shift(const struct adapter *adap, int filter_sel);
662 int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id);
663 void t4_fatal_err(struct adapter *adapter, bool fw_error);
664 int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp,
666 void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp,
668 int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid,
670 int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode,
672 int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid,
675 int t4_read_rss(struct adapter *adapter, u16 *entries);
676 void t4_read_rss_key(struct adapter *adapter, u32 *key, bool sleep_ok);
677 void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx,
679 void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index,
681 void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index,
683 void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index,
685 void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index,
687 u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok);
688 void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok);
689 u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok);
690 void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok);
691 int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask);
692 void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
693 void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
694 void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres);
695 int t4_read_cim_ibq(struct adapter *adap, unsigned int qid, u32 *data, size_t n);
696 int t4_read_cim_obq(struct adapter *adap, unsigned int qid, u32 *data, size_t n);
697 int t4_cim_read(struct adapter *adap, unsigned int addr, unsigned int n,
699 int t4_cim_write(struct adapter *adap, unsigned int addr, unsigned int n,
701 int t4_cim_ctl_read(struct adapter *adap, unsigned int addr, unsigned int n,
703 int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr);
704 void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp,
706 void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp);
707 int t4_get_flash_params(struct adapter *adapter);
709 u32 t4_read_pcie_cfg4(struct adapter *adap, int reg, int drv_fw_attach);
710 int t4_mc_read(struct adapter *adap, int idx, u32 addr,
712 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *parity);
713 int t4_mem_read(struct adapter *adap, int mtype, u32 addr, u32 size,
715 void t4_idma_monitor_init(struct adapter *adapter,
717 void t4_idma_monitor(struct adapter *adapter,
720 int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf,
723 unsigned int t4_get_regs_len(struct adapter *adapter);
724 void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size);
726 u32 t4_port_reg(struct adapter *adap, u8 port, u32 reg);
728 void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
729 void t4_get_port_stats_offset(struct adapter *adap, int idx,
732 void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p);
733 void t4_clr_port_stats(struct adapter *adap, int idx);
735 void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log);
736 void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]);
737 void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]);
738 void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps,
740 void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr,
742 void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr);
743 void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st,
745 void t4_tp_get_tnl_stats(struct adapter *adap, struct tp_tnl_stats *st,
747 void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st,
749 void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st,
751 void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st,
753 void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st,
755 void t4_tp_get_tid_stats(struct adapter *adap, struct tp_tid_stats *st,
757 void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
759 void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx,
761 void t4_load_mtus(struct adapter *adap, const unsigned short *mtus,
764 void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf);
766 int t4_set_sched_bps(struct adapter *adap, int sched, unsigned int kbps);
767 int t4_set_sched_ipg(struct adapter *adap, int sched, unsigned int ipg);
768 int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals,
770 void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate);
771 int t4_set_filter_cfg(struct adapter *adap, int mode, int mask, int vnic_mode);
774 void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr);
775 int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map,
778 int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
780 int t4_fw_bye(struct adapter *adap, unsigned int mbox);
781 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
782 int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force);
783 int t4_fw_restart(struct adapter *adap, unsigned int mbox);
784 int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
786 int t4_fw_initialize(struct adapter *adap, unsigned int mbox);
787 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
790 int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf,
793 int t4_set_params_timeout(struct adapter *adap, unsigned int mbox,
797 int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
800 int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf,
805 int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox,
810 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
813 int t4_free_vi(struct adapter *adap, unsigned int mbox,
816 int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
819 int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, unsigned int viid,
822 int t4_free_mac_filt(struct adapter *adap, unsigned int mbox,
825 int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
827 int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid,
830 int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid,
833 int t4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
837 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
839 int t4_del_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
841 int t4_add_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
843 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid,
845 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
847 int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid,
849 int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
851 int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
853 int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
855 int t4_i2c_io(struct adapter *adap, unsigned int mbox,
859 int t4_i2c_rd(struct adapter *adap, unsigned int mbox,
863 int t4_i2c_wr(struct adapter *adap, unsigned int mbox,
867 int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf,
870 int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
873 int t4_eth_eq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf,
875 int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
877 int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
879 int t4_ofld_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
881 int t4_sge_ctxt_rd(struct adapter *adap, unsigned int mbox, unsigned int cid,
883 int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype,
885 int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type);
888 int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
889 int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val);
890 int t4_sched_config(struct adapter *adapter, int type, int minmaxen,
892 int t4_sched_params(struct adapter *adapter, int type, int level, int mode,
896 int t4_sched_params_ch_rl(struct adapter *adapter, int channel, int ratemode,
898 int t4_sched_params_cl_wrr(struct adapter *adapter, int channel, int cl,
900 int t4_sched_params_cl_rl_kbps(struct adapter *adapter, int channel, int cl,
903 int t4_config_watchdog(struct adapter *adapter, unsigned int mbox,
906 int t4_get_devlog_level(struct adapter *adapter, unsigned int *level);
907 int t4_set_devlog_level(struct adapter *adapter, unsigned int level);
908 void t4_sge_decode_idma_state(struct adapter *adapter, int state);
910 void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
912 void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs,
914 void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
916 void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs,
918 int t4_configure_ringbb(struct adapter *adap);
919 int t4_configure_add_smac(struct adapter *adap);
920 int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf,
923 static inline int t4vf_query_params(struct adapter *adapter, in t4vf_query_params() argument
927 return t4_query_params(adapter, 0, 0, 0, nparams, params, vals); in t4vf_query_params()
930 static inline int t4vf_set_params(struct adapter *adapter, in t4vf_set_params() argument
934 return t4_set_params(adapter, 0, 0, 0, nparams, params, vals); in t4vf_set_params()
937 static inline int t4vf_wr_mbox(struct adapter *adap, const void *cmd, in t4vf_wr_mbox()
943 int t4vf_wait_dev_ready(struct adapter *adapter);
944 int t4vf_fw_reset(struct adapter *adapter);
945 int t4vf_get_sge_params(struct adapter *adapter);
946 int t4vf_get_rss_glb_config(struct adapter *adapter);
947 int t4vf_get_vfres(struct adapter *adapter);
948 int t4vf_prep_adapter(struct adapter *adapter);
949 int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port,
951 int t4vf_get_vf_vlan(struct adapter *adapter);
952 int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid,
972 mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, in mk_set_tcb_field_ulp()