FreeBSD kernel CXGB device code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/pciio.h>
#include <sys/conf.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/ktr.h>
#include <sys/rman.h>
#include <sys/ioccom.h>
#include <sys/mbuf.h>
#include <sys/linker.h>
#include <sys/firmware.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/queue.h>
#include <sys/taskqueue.h>
#include <sys/proc.h>
#include <net/bpf.h>
#include <net/debugnet.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_arp.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pci_private.h>
#include <cxgb_include.h>
Go to the source code of this file.
Data Structures | |
struct | cxgb_ident |
struct | filter_info |
Macros | |
#define | EEPROM_MAGIC 0x38E2F10C |
#define | PORT_MASK ((1 << MAX_NPORTS) - 1) |
#define | FW_FNAME "cxgb_t3fw" |
#define | TPEEPROM_NAME "cxgb_t3%c_tp_eeprom" |
#define | TPSRAM_NAME "cxgb_t3%c_protocol_sram" |
#define | CXGB_CAP |
#define | CXGB_CAP_ENABLE CXGB_CAP |
#define | T3_REGMAP_SIZE (3 * 1024) |
Enumerations | |
enum | { FILTER_NO_VLAN_PRI = 7 } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | cxgb_setup_interrupts (adapter_t *) |
static void | cxgb_teardown_interrupts (adapter_t *) |
static void | cxgb_init (void *) |
static int | cxgb_init_locked (struct port_info *) |
static int | cxgb_uninit_locked (struct port_info *) |
static int | cxgb_uninit_synchronized (struct port_info *) |
static int | cxgb_ioctl (struct ifnet *, unsigned long, caddr_t) |
static int | cxgb_media_change (struct ifnet *) |
static int | cxgb_ifm_type (int) |
static void | cxgb_build_medialist (struct port_info *) |
static void | cxgb_media_status (struct ifnet *, struct ifmediareq *) |
static uint64_t | cxgb_get_counter (struct ifnet *, ift_counter) |
static int | setup_sge_qsets (adapter_t *) |
static void | cxgb_async_intr (void *) |
static void | cxgb_tick_handler (void *, int) |
static void | cxgb_tick (void *) |
static void | link_check_callout (void *) |
static void | check_link_status (void *, int) |
static void | setup_rss (adapter_t *sc) |
static int | alloc_filters (struct adapter *) |
static int | setup_hw_filters (struct adapter *) |
static int | set_filter (struct adapter *, int, const struct filter_info *) |
static void | mk_set_tcb_field (struct cpl_set_tcb_field *, unsigned int, unsigned int, u64, u64) |
static void | set_tcb_field_ulp (struct cpl_set_tcb_field *, unsigned int, unsigned int, u64, u64) |
static int | cxgb_controller_probe (device_t) |
static int | cxgb_controller_attach (device_t) |
static int | cxgb_controller_detach (device_t) |
static void | cxgb_free (struct adapter *) |
static __inline void | reg_block_dump (struct adapter *ap, uint8_t *buf, unsigned int start, unsigned int end) |
static void | cxgb_get_regs (adapter_t *sc, struct ch_ifconf_regs *regs, uint8_t *buf) |
static int | cxgb_get_regs_len (void) |
static void | touch_bars (device_t dev) |
static void | cxgb_update_mac_settings (struct port_info *p) |
static int | cxgbc_mod_event (module_t, int, void *) |
DRIVER_MODULE (cxgbc, pci, cxgb_controller_driver, cxgb_controller_devclass, cxgbc_mod_event, 0) | |
MODULE_PNP_INFO ("U16:vendor;U16:device", pci, cxgbc, cxgb_identifiers, nitems(cxgb_identifiers) - 1) | |
MODULE_VERSION (cxgbc, 1) | |
MODULE_DEPEND (cxgbc, firmware, 1, 1, 1) | |
static int | cxgb_port_probe (device_t) |
static int | cxgb_port_attach (device_t) |
static int | cxgb_port_detach (device_t) |
DRIVER_MODULE (cxgb, cxgbc, cxgb_port_driver, cxgb_port_devclass, 0, 0) | |
MODULE_VERSION (cxgb, 1) | |
DEBUGNET_DEFINE (cxgb) | |
static | SLIST_HEAD (adapter) |
static int | set_eeprom (struct port_info *pi, const uint8_t *data, int len, int offset) |
static __inline char | t3rev2char (struct adapter *adapter) |
static struct cxgb_ident * | cxgb_get_ident (device_t dev) |
static const struct adapter_info * | cxgb_get_adapter_info (device_t dev) |
static int | upgrade_fw (adapter_t *sc) |
static int | cxgb_makedev (struct port_info *pi) |
void | t3_fatal_err (struct adapter *sc) |
int | t3_os_find_pci_capability (adapter_t *sc, int cap) |
int | t3_os_pci_save_state (struct adapter *sc) |
int | t3_os_pci_restore_state (struct adapter *sc) |
void | t3_os_link_changed (adapter_t *adapter, int port_id, int link_status, int speed, int duplex, int fc, int mac_was_reset) |
void | t3_os_phymod_changed (struct adapter *adap, int port_id) |
void | t3_os_set_hw_addr (adapter_t *adapter, int port_idx, u8 hw_addr[]) |
static int | await_mgmt_replies (struct adapter *adap, unsigned long init_cnt, unsigned long n) |
static int | init_tp_parity (struct adapter *adap) |
static void | send_pktsched_cmd (struct adapter *adap, int sched, int qidx, int lo, int hi, int port) |
static void | bind_qsets (adapter_t *sc) |
static void | update_tpeeprom (struct adapter *adap) |
static int | update_tpsram (struct adapter *adap) |
static int | cxgb_up (struct adapter *sc) |
static void | cxgb_down (struct adapter *sc) |
static int | cxgb_set_lro (struct port_info *p, int enabled) |
void | t3_os_link_intr (struct port_info *pi) |
static void | check_t3b2_mac (struct adapter *sc) |
void | cxgb_refresh_stats (struct port_info *pi) |
static int | in_range (int val, int lo, int hi) |
static int | cxgb_extension_open (struct cdev *dev, int flags, int fmp, struct thread *td) |
static int | cxgb_extension_close (struct cdev *dev, int flags, int fmt, struct thread *td) |
static int | cxgb_extension_ioctl (struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, struct thread *td) |
void | t3_iterate (void(*func)(struct adapter *, void *), void *arg) |
Variables | |
struct cxgb_ident | cxgb_identifiers [] |
static device_method_t | cxgb_controller_methods [] |
static driver_t | cxgb_controller_driver |
static devclass_t | cxgb_controller_devclass |
static device_method_t | cxgb_port_methods [] |
static driver_t | cxgb_port_driver |
static d_ioctl_t | cxgb_extension_ioctl |
static d_open_t | cxgb_extension_open |
static d_close_t | cxgb_extension_close |
static struct cdevsw | cxgb_cdevsw |
static devclass_t | cxgb_port_devclass |
static struct mtx | t3_list_lock |
#define CXGB_CAP |
Definition at line 999 of file cxgb_main.c.
#define CXGB_CAP_ENABLE CXGB_CAP |
Definition at line 1002 of file cxgb_main.c.
#define EEPROM_MAGIC 0x38E2F10C |
Definition at line 306 of file cxgb_main.c.
#define FW_FNAME "cxgb_t3fw" |
Definition at line 385 of file cxgb_main.c.
#define PORT_MASK ((1 << MAX_NPORTS) - 1) |
Definition at line 308 of file cxgb_main.c.
#define T3_REGMAP_SIZE (3 * 1024) |
Definition at line 3206 of file cxgb_main.c.
#define TPEEPROM_NAME "cxgb_t3%c_tp_eeprom" |
Definition at line 386 of file cxgb_main.c.
#define TPSRAM_NAME "cxgb_t3%c_protocol_sram" |
Definition at line 387 of file cxgb_main.c.
anonymous enum |
Enumerator | |
---|---|
FILTER_NO_VLAN_PRI |
Definition at line 304 of file cxgb_main.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 3243 of file cxgb_main.c.
References FILTER_NO_VLAN_PRI, adapter::filters, filter_info::locked, adapter_params::mc5, mc5_params::nfilters, adapter::params, filter_info::pass, filter_info::rss, filter_info::valid, filter_info::vlan, and filter_info::vlan_prio.
Referenced by cxgb_up().
|
static |
Definition at line 1329 of file cxgb_main.c.
References sge_rspq::offload_pkts, sge::qs, sge_qset::rspq, adapter::sge, and t3_os_sleep.
Referenced by init_tp_parity().
|
static |
Definition at line 1475 of file cxgb_main.c.
References adap2pinfo(), port_info::first_qset, port_info::nqsets, send_pktsched_cmd(), and port_info::tx_chan.
Referenced by cxgb_up().
|
static |
Definition at line 2299 of file cxgb_main.c.
References port_info::adapter, cphy::caps, link_check_callout(), port_info::link_check_ch, port_info::link_config, port_info::link_fault, link_config::link_ok, adapter::open_device_map, port_info::phy, port_info::port_id, SUPPORTED_LINK_IRQ, and t3_link_changed().
Referenced by cxgb_port_attach().
|
static |
Definition at line 2326 of file cxgb_main.c.
References CXGB_SHUTDOWN, cxgb_update_mac_settings(), adapter::flags, for_each_port, ifp, port_info::ifp, port_info::link_config, port_info::link_fault, link_config::link_ok, mac, port_info::mac, MAC_DIRECTION_RX, MAC_DIRECTION_TX, mac_stats::num_resets, mac_stats::num_toggled, adapter::open_device_map, port_info::phy, adapter::port, port_info::port_id, PORT_LOCK, PORT_UNLOCK, cmac::stats, t3_link_start(), t3_mac_enable(), t3_port_intr_enable(), and t3b2_mac_watchdog_task().
Referenced by cxgb_tick_handler().
|
static |
Definition at line 2277 of file cxgb_main.c.
References A_PL_INT_ENABLE0, adapter::slow_intr_task, t3_read_reg(), t3_write_reg(), and adapter::tq.
Referenced by cxgb_controller_attach().
|
static |
Definition at line 2106 of file cxgb_main.c.
References cphy::caps, cxgb_ifm_type(), media, port_info::media, cphy::modtype, phy, port_info::phy, PORT_LOCK, PORT_UNLOCK, SUPPORTED_10000baseT_Full, SUPPORTED_1000baseT_Full, SUPPORTED_100baseT_Full, SUPPORTED_10baseT_Full, SUPPORTED_Autoneg, SUPPORTED_FIBRE, and SUPPORTED_TP.
Referenced by cxgb_media_status(), cxgb_port_attach(), and t3_os_phymod_changed().
|
static |
Definition at line 445 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK_INIT, ADAPTER_LOCK_NAME_LEN, adapter::bh, adapter::bt, adapter_info::caps, cxgb_async_intr(), cxgb_free(), cxgb_get_adapter_info(), adapter::cxgb_intr, cxgb_setup_interrupts(), cxgb_tick(), adapter::cxgb_tick_ch, cxgb_tick_handler(), adapter_info::desc, adapter::dev, vpd_params::ec, adapter::elmer_lock, adapter::elmerlockbuf, port_info::first_qset, adapter::flags, FW_UPTODATE, adapter::fw_version, FW_VERSION_MAJOR, FW_VERSION_MICRO, FW_VERSION_MINOR, G_FW_VERSION_MAJOR, G_FW_VERSION_MICRO, G_FW_VERSION_MINOR, is_offload(), adapter::link_width, adapter::lockbuf, MAX_NPORTS, adapter::mdio_lock, adapter::mdiolockbuf, adapter::mmio_len, adapter::msi_count, adapter::msix_regs_res, adapter::msix_regs_rid, MTX_INIT, adapter_params::nports, adapter_info::nports0, port_info::nqsets, adapter::params, adapter::port, port_info::port_id, vpd_params::port_type, adapter::port_types, adapter::portdev, sge::reg_lock, adapter::reglockbuf, adapter::regs_res, adapter::regs_rid, adapter::rxpkt_map, adapter::sge, SGE_QSETS, vpd_params::sn, SUPPORTED_10000baseT_Full, t3_add_attach_sysctls(), t3_check_fw_version(), t3_check_tpsram_version(), t3_get_fw_version(), t3_intr_clear(), t3_intr_msi(), t3_led_ready(), t3_list_lock, t3_prep_adapter(), t3_sge_init_adapter(), t3b_intr(), t3rev2char(), adapter::tick_task, touch_bars(), TP_VERSION_MAJOR, TP_VERSION_MICRO, TP_VERSION_MINOR, TPS_UPTODATE, adapter::tq, port_info::tx_chan, port_info::txpkt_intf, adapter::udbs_res, adapter::udbs_rid, USING_MSI, USING_MSIX, and adapter_params::vpd.
|
static |
Definition at line 699 of file cxgb_main.c.
References cxgb_free(), and adapter::dev.
|
static |
Definition at line 364 of file cxgb_main.c.
References cxgb_get_adapter_info(), adapter_info::desc, adapter_info::nports0, and adapter_info::nports1.
|
static |
Definition at line 1667 of file cxgb_main.c.
References t3_intr_disable(), and t3_sge_stop().
Referenced by cxgb_uninit_synchronized().
|
static |
Definition at line 2535 of file cxgb_main.c.
|
static |
Definition at line 2541 of file cxgb_main.c.
References A_TP_TX_MOD_QUEUE_REQ_MAP, port_info::adapter, ADAPTER_LOCK, ADAPTER_UNLOCK, ch_reg::addr, ch_mem_range::addr, ch_tcam_word::addr, ch_pktsched_params::binding, ch_mem_range::buf, ch_tcam_word::buf, ch_up_la::bufsize, ch_up_ioqs::bufsize, tp_params::chan_rx_size, tp_params::chan_tx_size, ch_hw_sched::channel, CHELSIO_CLEAR_STATS, CHELSIO_DEL_FILTER, CHELSIO_GET_EEPROM, CHELSIO_GET_FILTER, CHELSIO_GET_MEM, CHELSIO_GET_MIIREG, CHELSIO_GET_PM, CHELSIO_GET_QSET_NUM, CHELSIO_GET_QSET_PARAMS, CHELSIO_GET_SGE_CONTEXT, CHELSIO_GET_SGE_DESC, CHELSIO_GET_UP_IOQS, CHELSIO_GET_UP_LA, CHELSIO_GETMTUTAB, CHELSIO_GETREG, CHELSIO_IFCONF_GETREGS, CHELSIO_LOAD_BOOT, CHELSIO_LOAD_FW, CHELSIO_READ_TCAM_WORD, CHELSIO_SET_FILTER, CHELSIO_SET_HW_SCHED, CHELSIO_SET_MIIREG, CHELSIO_SET_PKTSCHED, CHELSIO_SET_PM, CHELSIO_SET_TRACE_FILTER, CHELSIO_SETMTUTAB, CHELSIO_SETREG, ch_hw_sched::class_ipg, adapter::cm, ch_cntxt::cntxt_id, ch_cntxt::cntxt_type, CNTXT_TYPE_CQ, CNTXT_TYPE_EGRESS, CNTXT_TYPE_FL, CNTXT_TYPE_RSP, qset_params::coalesce_usecs, ch_trace::config_rx, ch_trace::config_tx, qset_params::cong_thres, ch_qset_params::cong_thres, core_ticks_per_usec(), cxgb_debug, cxgb_get_regs(), cxgb_get_regs_len(), dack_ticks_to_usec(), ch_desc::data, ch_cntxt::data, ch_ifconf_regs::data, ch_eeprom::data, ch_up_la::data, ch_up_ioqs::data, ch_filter_tuple::dip, filter_info::dip, ch_filter_tuple::dport, filter_info::dport, EEPROM_MAGIC, EEPROMSIZE, ch_filter::filter_id, FILTER_NO_VLAN_PRI, adapter::filters, port_info::first_qset, qset_params::fl_size, ch_qset_params::fl_size, adapter::flags, ch_hw_sched::flow_ipg, FULL_INIT_DONE, FW_UPTODATE, adapter::fw_version, G_FW_VERSION_MAJOR, G_FW_VERSION_MICRO, G_FW_VERSION_MINOR, ch_desc::idx, ch_pktsched_params::idx, ch_up_la::idx, in_range(), ch_qset_params::intr_lat, ch_trace::invert_match, ch_up_ioqs::ioq_rx_enable, ch_up_ioqs::ioq_rx_status, ch_up_ioqs::ioq_tx_enable, ch_up_ioqs::ioq_tx_status, IOQS_BUFSIZE, adapter::irq_res, is_10G(), is_offload(), qset_params::jumbo_size, ch_hw_sched::kbps, LA_BUFSIZE, ch_mem_range::len, ch_ifconf_regs::len, ch_eeprom::len, filter_info::locked, qset_params::lro, ch_qset_params::lro, port_info::mac, ch_filter::mac_addr_idx, ch_filter::mac_hit, filter_info::mac_hit, filter_info::mac_idx, filter_info::mac_vld, ch_eeprom::magic, ch_filter::mask, ch_pktsched_params::max, adapter_params::mc5, adapter::mc5, MDIO_DEV_PCS, MDIO_DEV_VEND2, cphy::mdio_read, cphy::mdio_write, MEM_CM, ch_mem_range::mem_id, MEM_PMRX, MEM_PMTX, ch_pktsched_params::min, adapter::mmio_len, ch_hw_sched::mode, adapter::msix_irq_res, adapter_params::mtus, ch_mtus::mtus, tp_params::nchan, mc5_params::nfilters, NMTUS, ch_mtus::nmtus, nqsets, port_info::nqsets, NTX_SCHED, offload_running(), ch_eeprom::offset, adapter::open_device_map, adapter::params, ch_filter::pass, filter_info::pass, phy, port_info::phy, ch_mii_data::phy_id, filter_info::pkt_type, ch_pm::pm_total, adapter::pmrx, adapter::pmtx, tp_params::pmtx_size, qset_params::polling, ch_qset_params::polling, PORT_LOCK, PORT_UNLOCK, ch_filter::proto, ch_qset_params::qnum, sge::qs, sge_params::qset, ch_filter::qset, filter_info::qset, ch_qset_params::qset_idx, ch_desc::queue_num, sge::reg_lock, ch_mii_data::reg_num, filter_info::report_filter_id, adapter_params::rev, adapter::rrss_map, qset_params::rspq_size, ch_qset_params::rspq_size, ch_filter::rss, filter_info::rss, RSS_TABLE_SIZE, ch_pm::rx_num_pg, tp_params::rx_num_pgs, tp_params::rx_pg_size, ch_pm::rx_pg_sz, S_TX_MOD_TIMER_MODE, ch_pktsched_params::sched, ch_hw_sched::sched, send_pktsched_cmd(), set_filter(), adapter_params::sge, adapter::sge, SGE_QSETS, ch_trace::sip, ch_filter_tuple::sip, filter_info::sip, filter_info::sip_mask, ch_desc::size, ch_filter_tuple::sport, filter_info::sport, cmac::stats, ch_up_la::stopped, t3_config_sched(), t3_config_trace_filter(), t3_get_desc(), t3_get_fw_version(), t3_get_up_ioqs(), t3_get_up_la(), t3_load_boot(), t3_load_fw(), t3_mac_update_stats(), t3_mc7_bd_read(), t3_read_mc5_range(), t3_read_reg(), t3_seeprom_read(), t3_set_pace_tbl(), t3_set_reg_field(), t3_set_sched_ipg(), t3_sge_read_cq(), t3_sge_read_ecntxt(), t3_sge_read_fl(), t3_sge_read_rspq(), t3_write_reg(), adapter_params::tp, ch_trace::trace_rx, ch_trace::trace_tx, ch_pm::tx_num_pg, tp_params::tx_num_pgs, tp_params::tx_pg_size, ch_pm::tx_pg_sz, ch_qset_params::txq_size, qset_params::txq_size, USING_MSIX, ch_reg::val, ch_filter::val, ch_mii_data::val_in, ch_mii_data::val_out, filter_info::valid, ch_qset_params::vector, ch_mem_range::version, ch_filter_tuple::vlan, filter_info::vlan, ch_filter_tuple::vlan_prio, filter_info::vlan_prio, and ch_filter::want_filter_id.
|
static |
Definition at line 2529 of file cxgb_main.c.
|
static |
Definition at line 729 of file cxgb_main.c.
References ADAPTER_LOCK, ADAPTER_LOCK_DEINIT, ADAPTER_UNLOCK, CXGB_SHUTDOWN, cxgb_teardown_interrupts(), adapter::cxgb_tick_ch, adapter::dev, adapter::elmer_lock, adapter::filters, adapter::flags, FULL_INIT_DONE, port_info::ifp, adapter::mdio_lock, adapter::msix_regs_res, adapter::msix_regs_rid, MTX_DESTROY, adapter_params::nports, nqsets, port_info::nqsets, adapter::open_device_map, adapter::params, adapter::port, adapter::portdev, sge::reg_lock, adapter::regs_res, adapter::regs_rid, adapter::sge, adapter::sge_timer_ch, t3_free_sge_resources(), t3_list_lock, t3_sge_free(), adapter::tq, adapter::udbs_res, adapter::udbs_rid, USING_MSI, and USING_MSIX.
Referenced by cxgb_controller_attach(), and cxgb_controller_detach().
|
static |
Definition at line 349 of file cxgb_main.c.
References cxgb_get_ident(), cxgb_ident::index, and t3_get_adapter_info().
Referenced by cxgb_controller_attach(), and cxgb_controller_probe().
|
static |
Definition at line 2212 of file cxgb_main.c.
References port_info::adapter, cxgb_refresh_stats(), first_qset, port_info::first_qset, adapter::flags, FULL_INIT_DONE, ifp, mac, port_info::mac, port_info::nqsets, sge::qs, mac_stats::rx_cong_drops, mac_stats::rx_data_errs, mac_stats::rx_fcs_errs, mac_stats::rx_frames, mac_stats::rx_jabber, mac_stats::rx_mac_internal_errs, mac_stats::rx_mcast_frames, mac_stats::rx_octets, mac_stats::rx_runt, mac_stats::rx_sequence_errs, mac_stats::rx_short, mac_stats::rx_too_long, adapter::sge, cmac::stats, mac_stats::tx_excess_collisions, mac_stats::tx_excess_deferral, mac_stats::tx_fcs_errs, mac_stats::tx_frames, mac_stats::tx_len_errs, mac_stats::tx_mac_internal_errs, mac_stats::tx_mcast_frames, mac_stats::tx_octets, mac_stats::tx_total_collisions, mac_stats::tx_underrun, sge_qset::txq, TXQ_ETH, and sge_txq::txq_mr.
Referenced by cxgb_port_attach().
|
static |
Definition at line 335 of file cxgb_main.c.
References cxgb_identifiers, cxgb_ident::desc, cxgb_ident::device, and cxgb_ident::vendor.
Referenced by cxgb_get_adapter_info().
|
static |
Definition at line 3214 of file cxgb_main.c.
References A_CPL_MAP_TBL_DATA, A_CPL_SWITCH_CNTRL, A_MPS_INT_CAUSE, A_SG_HI_DRB_HI_THRSH, A_SG_RSPQ_CREDIT_RETURN, A_SMB_GLOBAL_TIME_CFG, A_ULPRX_PBL_ULIMIT, A_ULPTX_CONFIG, A_XGM_RX_SPI4_SOP_EOP_CNT, A_XGM_SERDES_STAT3, A_XGM_SERDES_STATUS0, cxgb_get_regs_len(), is_pcie(), adapter::params, reg_block_dump(), adapter_params::rev, ch_ifconf_regs::version, and XGM_REG.
Referenced by cxgb_extension_ioctl().
|
static |
Definition at line 3208 of file cxgb_main.c.
References T3_REGMAP_SIZE.
Referenced by cxgb_extension_ioctl(), and cxgb_get_regs().
|
static |
Definition at line 2079 of file cxgb_main.c.
References phy_modtype_lr, phy_modtype_lrm, phy_modtype_none, phy_modtype_sr, phy_modtype_twinax, phy_modtype_twinax_long, and phy_modtype_unknown.
Referenced by cxgb_build_medialist().
|
static |
Definition at line 1677 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK, ADAPTER_LOCK_ASSERT_NOTOWNED, and cxgb_init_locked().
Referenced by cxgb_port_attach().
|
static |
Definition at line 1688 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK, ADAPTER_LOCK_ASSERT_OWNED, ADAPTER_UNLOCK, cphy::caps, CLR_BUSY, cxgb_tx_watchdog(), cxgb_up(), cxgb_update_mac_settings(), first_qset, port_info::first_qset, adapter::flags, FULL_INIT_DONE, ifp, port_info::ifp, IS_BUSY, IS_DOOMED, link_check_callout(), port_info::link_check_ch, port_info::link_config, adapter::lock, mac, port_info::mac, MAC_DIRECTION_RX, MAC_DIRECTION_TX, cmac::multiport, port_info::nqsets, adapter::open_device_map, port_info::phy, port_info::port_id, PORT_LOCK, PORT_UNLOCK, sge::qs, SET_BUSY, adapter::sge, SUPPORTED_LINK_IRQ, t3_link_start(), t3_mac_enable(), t3_mac_init(), t3_port_intr_enable(), sge_qset::txq, TXQ_ETH, and sge_txq::txq_watchdog.
Referenced by cxgb_init(), and cxgb_ioctl().
|
static |
Definition at line 1883 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK, ADAPTER_LOCK_ASSERT_NOTOWNED, ADAPTER_UNLOCK, cxgb_init_locked(), cxgb_set_lro(), cxgb_uninit_locked(), cxgb_update_mac_settings(), flags, port_info::if_flags, ifp, IS_BUSY, IS_DOOMED, port_info::media, PORT_LOCK, and PORT_UNLOCK.
Referenced by cxgb_port_attach().
|
static |
Definition at line 985 of file cxgb_main.c.
References cxgb_cdevsw, port_info::ifp, and port_info::port_cdev.
Referenced by cxgb_port_attach().
|
static |
Definition at line 2070 of file cxgb_main.c.
Referenced by cxgb_port_attach().
|
static |
Definition at line 2171 of file cxgb_main.c.
References cphy::caps, cxgb_build_medialist(), ifp, port_info::link_config, link_config::link_ok, port_info::media, cphy::modtype, port_info::phy, link_config::speed, SPEED_10, SPEED_100, SPEED_1000, SPEED_10000, SUPPORTED_Autoneg, and SUPPORTED_TP.
Referenced by cxgb_port_attach().
|
static |
Definition at line 1005 of file cxgb_main.c.
References port_info::adapter, check_link_status(), cxgb_build_medialist(), CXGB_CAP, CXGB_CAP_ENABLE, cxgb_get_counter(), cxgb_init(), cxgb_ioctl(), cxgb_makedev(), cxgb_media_change(), cxgb_media_status(), cxgb_qflush(), cxgb_transmit(), adapter::dev, port_info::hw_addr, ifp, port_info::ifp, is_offload(), port_info::link_check_ch, port_info::link_check_task, port_info::lockbuf, port_info::media, adapter_params::nports, adapter::params, port_info::port_id, PORT_LOCK_INIT, PORT_NAME_LEN, and t3_sge_init_port().
|
static |
Definition at line 1090 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK, ADAPTER_UNLOCK, CLR_BUSY, cxgb_uninit_synchronized(), adapter::dev, first_qset, port_info::first_qset, adapter::flags, port_info::ifp, IS_BUSY, adapter::lock, port_info::nqsets, port_info::port_cdev, PORT_LOCK_DEINIT, sge::qs, SET_BUSY, SET_DOOMED, adapter::sge, sge_qset::txq, TXQ_ETH, sge_txq::txq_timer, and sge_txq::txq_watchdog.
|
static |
Definition at line 970 of file cxgb_main.c.
References cphy::desc, port_info::phy, and port_info::port_id.
void cxgb_refresh_stats | ( | struct port_info * | pi | ) |
Definition at line 2378 of file cxgb_main.c.
References port_info::last_refreshed, port_info::mac, PORT_LOCK, PORT_UNLOCK, and t3_mac_update_stats().
Referenced by cxgb_get_counter(), cxgb_tick_handler(), and sysctl_handle_macstat().
|
static |
Definition at line 1869 of file cxgb_main.c.
References port_info::adapter, lro_state::enabled, port_info::first_qset, sge_qset::lro, port_info::nqsets, sge::qs, and adapter::sge.
Referenced by cxgb_ioctl().
|
static |
Definition at line 901 of file cxgb_main.c.
References adapter::cxgb_intr, cxgb_teardown_interrupts(), adapter::dev, adapter::flags, adapter::intr_tag, adapter::irq_res, adapter::irq_rid, adapter::msi_count, adapter::msix_intr_tag, adapter::msix_irq_res, adapter::msix_irq_rid, sge::qs, adapter::sge, t3_intr_msix(), USING_MSI, and USING_MSIX.
Referenced by cxgb_controller_attach().
|
static |
Definition at line 863 of file cxgb_main.c.
References adapter::dev, adapter::intr_tag, adapter::irq_res, adapter::irq_rid, adapter::msix_intr_tag, adapter::msix_irq_res, adapter::msix_irq_rid, and SGE_QSETS.
Referenced by cxgb_free(), and cxgb_setup_interrupts().
|
static |
Definition at line 2366 of file cxgb_main.c.
References CXGB_SHUTDOWN, cxgb_tick(), adapter::cxgb_tick_ch, adapter::flags, adapter::tick_task, and adapter::tq.
Referenced by cxgb_controller_attach(), and cxgb_tick().
|
static |
Definition at line 2395 of file cxgb_main.c.
References A_SG_INT_CAUSE, A_SG_RSPQ_FL_STATUS, A_XGM_INT_CAUSE, check_t3b2_mac(), cxgb_refresh_stats(), CXGB_SHUTDOWN, sge_fl::empty, F_FLEMPTY, F_RSPQSTARVE, F_RXFIFO_OVERFLOW, sge_qset::fl, adapter::flags, FULL_INIT_DONE, mac, port_info::mac, cmac::multiport, adapter_params::nports, cmac::offset, adapter::open_device_map, adapter::params, adapter::port, port_info::port_id, sge::qs, adapter_params::rev, sge_qset::rspq, mac_stats::rx_fifo_ovfl, adapter::sge, SGE_QSETS, sge_rspq::starved, cmac::stats, t3_read_reg(), T3_REV_B2, and t3_write_reg().
Referenced by cxgb_controller_attach().
|
static |
Definition at line 1768 of file cxgb_main.c.
References port_info::adapter, ADAPTER_LOCK, ADAPTER_LOCK_ASSERT_OWNED, ADAPTER_UNLOCK, CLR_BUSY, cxgb_uninit_synchronized(), adapter::flags, IS_BUSY, IS_DOOMED, adapter::lock, and SET_BUSY.
Referenced by cxgb_ioctl().
|
static |
Definition at line 1804 of file cxgb_main.c.
References A_XGM_RXFIFO_CFG, A_XGM_TX_CFG, A_XGM_TXFIFO_CFG, port_info::adapter, ADAPTER_LOCK_ASSERT_NOTOWNED, cxgb_down(), F_TXFIFO_EMPTY, F_TXPAUSEEN, ifp, port_info::ifp, port_info::link_check_ch, port_info::link_check_task, port_info::link_config, link_config::link_ok, M_RXFIFOPAUSEHWM, port_info::mac, MAC_DIRECTION_RX, cmac::offset, adapter::open_device_map, cphy::ops, port_info::phy, port_info::port_id, PORT_LOCK, PORT_UNLOCK, cphy_ops::power_down, adapter::slow_intr_task, t3_mac_disable(), t3_os_link_changed(), t3_port_intr_disable(), t3_set_reg_field(), t3_wait_op_done(), adapter::tick_task, adapter::tq, and V_RXFIFOPAUSEHWM.
Referenced by cxgb_port_detach(), and cxgb_uninit_locked().
|
static |
cxgb_up - enable the adapter @adap: adapter being enabled
Called when the first port is enabled, this function performs the actions necessary to make an adapter operational, such as completing the initialization of HW modules, and enabling interrupts.
Definition at line 1590 of file cxgb_main.c.
References A_TP_INT_CAUSE, A_TP_INT_ENABLE, A_TP_PARA_REG5, A_ULPRX_TDDP_PSZ, ADAPTER_LOCK_ASSERT_NOTOWNED, alloc_filters(), bind_qsets(), F_ARPLUTPERR, F_CMCACHEPERR, F_RXDDPOFFINIT, adapter::flags, FULL_INIT_DONE, FW_UPTODATE, init_tp_parity(), is_offload(), adapter_params::mc5, adapter::mc5, MC5_MIN_TIDS, mc5_params::nfilters, mc5_params::nservers, adapter::open_device_map, adapter::params, QUEUES_BOUND, adapter_params::rev, setup_hw_filters(), setup_rss(), setup_sge_qsets(), t3_add_configured_sysctls(), t3_init_hw(), t3_intr_clear(), t3_intr_enable(), t3_mc5_size(), T3_REV_C, t3_set_reg_field(), t3_sge_reset_adapter(), t3_sge_start(), t3_write_reg(), TP_PARITY_INIT, TPS_UPTODATE, update_tpsram(), upgrade_fw(), and V_HPZ0.
Referenced by cxgb_init_locked().
|
static |
Definition at line 1303 of file cxgb_main.c.
References port_info::adapter, port_info::hw_addr, ifp, port_info::ifp, mac, port_info::mac, PORT_LOCK_ASSERT_OWNED, t3_init_rx_mode(), t3_mac_set_address(), t3_mac_set_mtu(), t3_mac_set_rx_mode(), t3_set_vlan_accel(), and port_info::tx_chan.
Referenced by check_t3b2_mac(), cxgb_init_locked(), cxgb_ioctl(), and t3_os_link_changed().
|
static |
Definition at line 3560 of file cxgb_main.c.
References t3_list_lock.
DEBUGNET_DEFINE | ( | cxgb | ) |
DRIVER_MODULE | ( | cxgb | , |
cxgbc | , | ||
cxgb_port_driver | , | ||
cxgb_port_devclass | , | ||
0 | , | ||
0 | |||
) |
DRIVER_MODULE | ( | cxgbc | , |
pci | , | ||
cxgb_controller_driver | , | ||
cxgb_controller_devclass | , | ||
cxgbc_mod_event | , | ||
0 | |||
) |
|
static |
Definition at line 2523 of file cxgb_main.c.
Referenced by cxgb_extension_ioctl().
|
static |
Definition at line 1343 of file cxgb_main.c.
References await_mgmt_replies(), CPL_L2T_WRITE_REQ, CPL_RTE_WRITE_REQ, CPL_SET_TCB_FIELD, CPL_SMT_WRITE_REQ, FW_WROPCODE_FORWARD, cpl_smt_write_req::iff, cpl_rte_write_req::l2t_idx, cpl_set_tcb_field::mask, MK_OPCODE_TID, sge_rspq::offload_pkts, OPCODE_TID, cpl_l2t_write_req::params, sge::qs, sge_qset::rspq, adapter::sge, t3_mgmt_tx(), t3_tp_set_offload_mode(), V_L2T_W_IDX, and V_WR_OP.
Referenced by cxgb_up().
|
static |
Definition at line 2287 of file cxgb_main.c.
References port_info::adapter, port_info::link_check_task, adapter::open_device_map, port_info::port_id, and adapter::tq.
Referenced by check_link_status(), cxgb_init_locked(), and t3_os_link_intr().
|
inlinestatic |
Definition at line 3345 of file cxgb_main.c.
References CPL_SET_TCB_FIELD, cpl_set_tcb_field::cpu_idx, cpl_set_tcb_field::mask, MK_OPCODE_TID, OPCODE_TID, cpl_set_tcb_field::reply, V_NO_REPLY, cpl_set_tcb_field::val, and cpl_set_tcb_field::word.
Referenced by set_filter(), and set_tcb_field_ulp().
MODULE_DEPEND | ( | cxgbc | , |
firmware | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_PNP_INFO | ( | "U16:vendor;U16:device" | , |
pci | , | ||
cxgbc | , | ||
cxgb_identifiers | , | ||
nitems(cxgb_identifiers) - | 1 | ||
) |
MODULE_VERSION | ( | cxgb | , |
1 | |||
) |
MODULE_VERSION | ( | cxgbc | , |
1 | |||
) |
|
static |
Definition at line 3197 of file cxgb_main.c.
References t3_read_reg().
Referenced by cxgb_get_regs().
|
static |
Definition at line 1453 of file cxgb_main.c.
References mngt_pktsched_wr::binding, FW_MNGTOPCODE_PKTSCHED_SET, FW_WROPCODE_MNGT, mngt_pktsched_wr::idx, mngt_pktsched_wr::max, mngt_pktsched_wr::min, mngt_pktsched_wr::mngt_opcode, mngt_pktsched_wr::sched, t3_mgmt_tx(), and V_WR_OP.
Referenced by bind_qsets(), and cxgb_extension_ioctl().
|
static |
Definition at line 2478 of file cxgb_main.c.
References port_info::adapter, t3_seeprom_read(), t3_seeprom_wp(), and t3_seeprom_write().
Referenced by update_tpeeprom().
|
static |
Definition at line 3282 of file cxgb_main.c.
References ulp_txpkt::cmd_dest, CPL_CONN_POLICY_FILTER, CPL_PASS_OPEN_REQ, filter_info::dip, filter_info::dport, F_NO_OFFLOAD, F_WR_ATOMIC, FILTER_NO_VLAN_PRI, FW_WROPCODE_BYPASS, FW_WROPCODE_FORWARD, ulp_txpkt::len, cpl_pass_open_req::local_ip, cpl_pass_open_req::local_port, filter_info::mac_hit, filter_info::mac_idx, filter_info::mac_vld, adapter_params::mc5, adapter::mc5, MK_OPCODE_TID, mk_set_tcb_field(), mc5_params::nfilters, mc5_params::nroutes, OPCODE_TID, cpl_pass_open_req::opt0h, cpl_pass_open_req::opt0l, cpl_pass_open_req::opt1, adapter::params, filter_info::pass, cpl_pass_open_req::peer_ip, cpl_pass_open_req::peer_netmask, cpl_pass_open_req::peer_port, filter_info::pkt_type, filter_info::qset, filter_info::report_filter_id, adapter::rrss_map, filter_info::rss, set_tcb_field_ulp(), filter_info::sip, filter_info::sip_mask, filter_info::sport, t3_mc5_size(), t3_mgmt_tx(), ULP_TXPKT, V_CONN_POLICY, V_MAC_MATCH, V_MAC_MATCH_VALID, V_OPT1_VLAN, V_PKT_TYPE, V_ULPTX_CMD, V_ULPTX_NFLITS, V_VLAN_PRI, V_VLAN_PRI_VALID, V_WR_OP, filter_info::vlan, and filter_info::vlan_prio.
Referenced by cxgb_extension_ioctl(), and setup_hw_filters().
|
inlinestatic |
Definition at line 3357 of file cxgb_main.c.
References ulp_txpkt::cmd_dest, ulp_txpkt::len, mk_set_tcb_field(), ULP_TXPKT, V_ULPTX_CMD, and V_ULPTX_NFLITS.
Referenced by set_filter().
|
static |
Definition at line 3263 of file cxgb_main.c.
References adapter::filters, filter_info::locked, adapter_params::mc5, mc5_params::nfilters, adapter::params, set_filter(), and t3_enable_filters().
Referenced by cxgb_up().
|
static |
setup_rss - configure Receive Side Steering (per-queue connection demux) @adap: the adapter
Sets up RSS to distribute packets to multiple receive queues. We configure the RSS CPU lookup table to distribute to the number of HW receive queues, and the response queue lookup table to narrow that down to the response queues actually configured for each port. We always configure the RSS mapping for two ports since the mapping table has plenty of entries.
Definition at line 1417 of file cxgb_main.c.
References adap2pinfo(), F_HASHTOEPLITZ, F_OFDMAPEN, F_RQFEEDBACKENABLE, F_RRCPLMAPEN, F_TNL2TUPEN, F_TNL4TUPEN, F_TNLLKPEN, F_TNLMAPEN, F_TNLPRTEN, for_each_port, port_info::nqsets, adapter::rrss_map, RSS_TABLE_SIZE, SGE_QSETS, t3_config_rss(), port_info::tx_chan, and V_RRCPLCPUSIZE.
Referenced by cxgb_up().
|
static |
setup_sge_qsets - configure SGE Tx/Rx/response queues @sc: the controller softc
Determines how many sets of SGE queues to use and initializes them. We support multiple queue sets per port if we have MSI-X, otherwise just one queue set per port.
Definition at line 828 of file cxgb_main.c.
References adapter::dev, adapter::flags, adapter_params::nports, port_info::nqsets, adapter::nqsets, adapter::params, adapter::port, sge_params::qset, adapter_params::rev, adapter_params::sge, SGE_TXQ_PER_SET, t3_free_sge_resources(), t3_sge_alloc(), t3_sge_alloc_qset(), USING_MSI, and USING_MSIX.
Referenced by cxgb_up().
|
static |
Definition at line 224 of file cxgb_main.c.
void t3_fatal_err | ( | struct adapter * | sc | ) |
Definition at line 1134 of file cxgb_main.c.
References A_XGM_RX_CTRL, A_XGM_TX_CTRL, adapter::dev, adapter::flags, FULL_INIT_DONE, t3_cim_ctl_blk_read(), t3_intr_disable(), t3_sge_stop(), t3_write_reg(), and XGM_REG.
Referenced by cim_intr_handler(), cplsw_intr_handler(), mac_intr_handler(), mc7_intr_handler(), mps_intr_handler(), pci_intr_handler(), pcie_intr_handler(), pmrx_intr_handler(), pmtx_intr_handler(), t3_mc5_intr_handler(), t3_sge_err_intr_handler(), tp_intr_handler(), ulprx_intr_handler(), and ulptx_intr_handler().
void t3_iterate | ( | void(*)(struct adapter *, void *) | func, |
void * | arg | ||
) |
Definition at line 3368 of file cxgb_main.c.
References t3_list_lock.
int t3_os_find_pci_capability | ( | adapter_t * | sc, |
int | cap | ||
) |
Definition at line 1153 of file cxgb_main.c.
References adapter::dev.
Referenced by get_pci_mode(), and t3_prep_adapter().
void t3_os_link_changed | ( | adapter_t * | adapter, |
int | port_id, | ||
int | link_status, | ||
int | speed, | ||
int | duplex, | ||
int | fc, | ||
int | mac_was_reset | ||
) |
t3_os_link_changed - handle link status changes @sc: the adapter associated with the link change @port_id: the port index whose link status has changed @link_status: the new status of the link @speed: the new speed setting @duplex: the new duplex setting @fc: the new flow-control setting
This is the OS-dependent handler for link status changes. The OS neutral handler takes care of most of the processing for these events, then calls this handler for any OS-specific processing.
Definition at line 1232 of file cxgb_main.c.
References cxgb_update_mac_settings(), ifp, port_info::ifp, adapter::port, port_id, PORT_LOCK, and PORT_UNLOCK.
Referenced by cxgb_uninit_synchronized(), and t3_link_changed().
void t3_os_link_intr | ( | struct port_info * | pi | ) |
Definition at line 2315 of file cxgb_main.c.
References link_check_callout(), and port_info::link_check_ch.
Referenced by mac_intr_handler(), and phy_intr_handler().
int t3_os_pci_restore_state | ( | struct adapter * | sc | ) |
Definition at line 1206 of file cxgb_main.c.
References adapter::dev.
Referenced by t3_reset_adapter().
int t3_os_pci_save_state | ( | struct adapter * | sc | ) |
Definition at line 1193 of file cxgb_main.c.
References adapter::dev.
Referenced by t3_reset_adapter().
void t3_os_phymod_changed | ( | struct adapter * | adap, |
int | port_id | ||
) |
t3_os_phymod_changed - handle PHY module changes @phy: the PHY reporting the module change @mod_type: new module type
This is the OS-dependent handler for PHY module changes. It is invoked when a PHY module is removed or inserted for any OS-specific processing.
Definition at line 1264 of file cxgb_main.c.
References ARRAY_SIZE, cxgb_build_medialist(), port_info::ifp, port_info::media, cphy::modtype, port_info::phy, phy_modtype_none, adapter::port, and port_id.
Referenced by phy_intr_handler().
Definition at line 1285 of file cxgb_main.c.
References cxgb_debug, hw_addr, port_info::hw_addr, and adapter::port.
Referenced by t3_prep_adapter().
|
static |
Definition at line 315 of file cxgb_main.c.
References adapter::params, adapter_params::rev, T3_REV_A, T3_REV_B, T3_REV_B2, and T3_REV_C.
Referenced by cxgb_controller_attach(), update_tpeeprom(), and update_tpsram().
|
static |
Definition at line 2460 of file cxgb_main.c.
Referenced by cxgb_controller_attach().
|
static |
Definition at line 1491 of file cxgb_main.c.
References adapter::dev, G_TP_VERSION_MAJOR, G_TP_VERSION_MINOR, adapter::port, set_eeprom(), t3_check_tpsram(), t3_seeprom_read(), t3rev2char(), TP_SRAM_LEN, TP_SRAM_OFFSET, TP_VERSION_MAJOR, TP_VERSION_MICRO, TP_VERSION_MINOR, and TPEEPROM_NAME.
Referenced by update_tpsram().
|
static |
Definition at line 1549 of file cxgb_main.c.
References adapter::dev, t3_check_tpsram(), t3_set_proto_sram(), t3rev2char(), TPSRAM_NAME, and update_tpeeprom().
Referenced by cxgb_up().
|
static |
Definition at line 390 of file cxgb_main.c.
References adapter::dev, FW_FNAME, adapter::fw_version, G_FW_VERSION_MAJOR, G_FW_VERSION_MICRO, G_FW_VERSION_MINOR, t3_get_fw_version(), and t3_load_fw().
Referenced by cxgb_up().
|
static |
Definition at line 208 of file cxgb_main.c.
Referenced by cxgb_makedev().
|
static |
Definition at line 175 of file cxgb_main.c.
|
static |
Definition at line 168 of file cxgb_main.c.
|
static |
Definition at line 160 of file cxgb_main.c.
|
static |
Definition at line 206 of file cxgb_main.c.
|
static |
Definition at line 204 of file cxgb_main.c.
|
static |
Definition at line 205 of file cxgb_main.c.
struct cxgb_ident cxgb_identifiers[] |
Referenced by cxgb_get_ident().
|
static |
Definition at line 217 of file cxgb_main.c.
|
static |
Definition at line 198 of file cxgb_main.c.
|
static |
Definition at line 191 of file cxgb_main.c.
|
static |
Definition at line 223 of file cxgb_main.c.
Referenced by cxgb_controller_attach(), cxgb_free(), cxgbc_mod_event(), and t3_iterate().