FreeBSD kernel CXGBE device code
t4_vf.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/priv.h>
#include <dev/pci/pcivar.h>
#include "common/common.h"
#include "common/t4_regs.h"
#include "t4_ioctl.h"
#include "t4_mp_ring.h"
Include dependency graph for t4_vf.c:

Go to the source code of this file.

Data Structures

struct  intrs_and_queues
 

Macros

#define FW_PARAM_DEV(param)
 
#define FW_PARAM_PFVF(param)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int t4vf_probe (device_t dev)
 
static int t5vf_probe (device_t dev)
 
static int t6vf_probe (device_t dev)
 
static int get_params__pre_init (struct adapter *sc)
 
static int get_params__post_init (struct adapter *sc)
 
static int set_params__post_init (struct adapter *sc)
 
static int cfg_itype_and_nqueues (struct adapter *sc, struct intrs_and_queues *iaq)
 
static int t4vf_attach (device_t dev)
 
static void get_regs (struct adapter *sc, struct t4_regdump *regs, uint8_t *buf)
 
static void t4_clr_vi_stats (struct adapter *sc)
 
static int t4vf_ioctl (struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, struct thread *td)
 
 DRIVER_MODULE (t4vf, pci, t4vf_driver, t4vf_devclass, 0, 0)
 
 MODULE_VERSION (t4vf, 1)
 
 MODULE_DEPEND (t4vf, t4nex, 1, 1, 1)
 
 DRIVER_MODULE (t5vf, pci, t5vf_driver, t5vf_devclass, 0, 0)
 
 MODULE_VERSION (t5vf, 1)
 
 MODULE_DEPEND (t5vf, t5nex, 1, 1, 1)
 
 DRIVER_MODULE (t6vf, pci, t6vf_driver, t6vf_devclass, 0, 0)
 
 MODULE_VERSION (t6vf, 1)
 
 MODULE_DEPEND (t6vf, t6nex, 1, 1, 1)
 
 DRIVER_MODULE (cxgbev, t4vf, cxgbev_driver, cxgbev_devclass, 0, 0)
 
 MODULE_VERSION (cxgbev, 1)
 
 DRIVER_MODULE (cxlv, t5vf, cxlv_driver, cxlv_devclass, 0, 0)
 
 MODULE_VERSION (cxlv, 1)
 
 DRIVER_MODULE (ccv, t6vf, ccv_driver, ccv_devclass, 0, 0)
 
 MODULE_VERSION (ccv, 1)
 

Variables

struct {
   uint16_t   device
 
   char *   desc
 
t4vf_pciids []
 
struct {
   uint16_t   device
 
   char *   desc
 
t5vf_pciids []
 
struct {
   uint16_t   device
 
   char *   desc
 
t6vf_pciids []
 
static d_ioctl_t t4vf_ioctl
 
static struct cdevsw t4vf_cdevsw
 
static device_method_t t4vf_methods []
 
static driver_t t4vf_driver
 
static device_method_t t5vf_methods []
 
static driver_t t5vf_driver
 
static device_method_t t6vf_methods []
 
static driver_t t6vf_driver
 
static driver_t cxgbev_driver
 
static driver_t cxlv_driver
 
static driver_t ccv_driver
 
static devclass_t t4vf_devclass
 
static devclass_t t5vf_devclass
 
static devclass_t t6vf_devclass
 
static devclass_t cxgbev_devclass
 
static devclass_t cxlv_devclass
 
static devclass_t ccv_devclass
 

Macro Definition Documentation

◆ FW_PARAM_DEV

#define FW_PARAM_DEV (   param)
Value:
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param))
#define V_FW_PARAMS_MNEM(x)
@ FW_PARAMS_MNEM_DEV

Definition at line 188 of file t4_vf.c.

◆ FW_PARAM_PFVF

#define FW_PARAM_PFVF (   param)
Value:
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param))
@ FW_PARAMS_MNEM_PFVF

Definition at line 191 of file t4_vf.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ cfg_itype_and_nqueues()

◆ DRIVER_MODULE() [1/6]

DRIVER_MODULE ( ccv  ,
t6vf  ,
ccv_driver  ,
ccv_devclass  ,
,
 
)

◆ DRIVER_MODULE() [2/6]

DRIVER_MODULE ( cxgbev  ,
t4vf  ,
cxgbev_driver  ,
cxgbev_devclass  ,
,
 
)

◆ DRIVER_MODULE() [3/6]

DRIVER_MODULE ( cxlv  ,
t5vf  ,
cxlv_driver  ,
cxlv_devclass  ,
,
 
)

◆ DRIVER_MODULE() [4/6]

DRIVER_MODULE ( t4vf  ,
pci  ,
t4vf_driver  ,
t4vf_devclass  ,
,
 
)

◆ DRIVER_MODULE() [5/6]

DRIVER_MODULE ( t5vf  ,
pci  ,
t5vf_driver  ,
t5vf_devclass  ,
,
 
)

◆ DRIVER_MODULE() [6/6]

DRIVER_MODULE ( t6vf  ,
pci  ,
t6vf_driver  ,
t6vf_devclass  ,
,
 
)

◆ get_params__post_init()

◆ get_params__pre_init()

static int get_params__pre_init ( struct adapter sc)
static

◆ get_regs()

static void get_regs ( struct adapter sc,
struct t4_regdump regs,
uint8_t *  buf 
)
static

Definition at line 777 of file t4_vf.c.

References chip_id(), t4_regdump::len, t4_get_regs(), and t4_regdump::version.

Referenced by t4vf_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MODULE_DEPEND() [1/3]

MODULE_DEPEND ( t4vf  ,
t4nex  ,
,
,
 
)

◆ MODULE_DEPEND() [2/3]

MODULE_DEPEND ( t5vf  ,
t5nex  ,
,
,
 
)

◆ MODULE_DEPEND() [3/3]

MODULE_DEPEND ( t6vf  ,
t6nex  ,
,
,
 
)

◆ MODULE_VERSION() [1/6]

MODULE_VERSION ( ccv  ,
 
)

◆ MODULE_VERSION() [2/6]

MODULE_VERSION ( cxgbev  ,
 
)

◆ MODULE_VERSION() [3/6]

MODULE_VERSION ( cxlv  ,
 
)

◆ MODULE_VERSION() [4/6]

MODULE_VERSION ( t4vf  ,
 
)

◆ MODULE_VERSION() [5/6]

MODULE_VERSION ( t5vf  ,
 
)

◆ MODULE_VERSION() [6/6]

MODULE_VERSION ( t6vf  ,
 
)

◆ set_params__post_init()

static int set_params__post_init ( struct adapter sc)
static

Definition at line 298 of file t4_vf.c.

References FW_PARAM_PFVF, adapter::params, adapter_params::port_caps32, and t4vf_set_params().

Referenced by t4vf_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_clr_vi_stats()

static void t4_clr_vi_stats ( struct adapter sc)
static

Definition at line 786 of file t4_vf.c.

References A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H, A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L, t4_write_reg(), and VF_MPS_REG.

Referenced by t4vf_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4vf_attach()

static int t4vf_attach ( device_t  dev)
static

Definition at line 482 of file t4_vf.c.

References A_SGE_VF_GTS, A_SGE_VF_KDOORBELL, vi_info::adapter, port_info::adapter, adapter::cdev, cfg_itype_and_nqueues(), adapter::chan_map, adapter::ctx, cxgbe_media_change(), cxgbe_media_status(), adapter::debug_flags, vi_info::dev, port_info::dev, adapter::dev, sge::eqmap, sge::eqmap_sz, vi_info::first_rxq, vi_info::first_txq, adapter::flags, for_each_port, for_each_vi, FW_OK, get_params__post_init(), get_params__pre_init(), adapter::intr_count, INTR_MSIX, adapter::intr_type, intrs_and_queues::intr_type, sge::iqmap, sge::iqmap_sz, IS_VF, port_info::lockname, adapter::lockname, MAX_NPORTS, adapter::mbox, port_info::media, pci_params::mps, adapter::names, sge::neq, sge::niq, intrs_and_queues::nirq, adapter_params::nports, vi_info::nrxq, sge::nrxq, intrs_and_queues::nrxq, vi_info::ntxq, sge::ntxq, intrs_and_queues::ntxq, port_info::nvi, vf_resources::nvi, adapter::params, adapter_params::pci, adapter::pf, vi_info::pi, port_info::pi_lock, vi_info::pktc_idx, vf_resources::pmask, adapter::port, port_info::port_id, vi_info::qsize_rxq, vi_info::qsize_txq, adapter::reg_lock, vi_info::rsrv_noflowq, sge::rxq, adapter::sc_lock, set_params__post_init(), adapter::sfl_callout, adapter::sfl_lock, adapter::sge, adapter::sge_gts_reg, adapter::sge_kdoorbell_reg, t4_add_adapter(), t4_create_dma_tag(), t4_detach_common(), t4_init_devnames(), t4_map_bar_2(), t4_map_bars_0_and_4(), t4_os_set_hw_addr(), t4_pktc_idx, t4_port_init(), t4_qsize_rxq, t4_qsize_txq, t4_setup_intr_handlers(), t4_sysctls(), t4_tmr_idx, t4vf_cdevsw, t4vf_fw_reset(), t4vf_get_vf_mac(), t4vf_prep_adapter(), vi_info::tmr_idx, port_info::tx_chan, sge::txq, devnames::vf_ifnet_name, VF_SGE_REG, adapter_params::vfres, and port_info::vi.

Here is the call graph for this function:

◆ t4vf_ioctl()

◆ t4vf_probe()

static int t4vf_probe ( device_t  dev)
static

Definition at line 141 of file t4_vf.c.

References desc, device, and t4vf_pciids.

◆ t5vf_probe()

static int t5vf_probe ( device_t  dev)
static

Definition at line 157 of file t4_vf.c.

References desc, device, and t5vf_pciids.

◆ t6vf_probe()

static int t6vf_probe ( device_t  dev)
static

Definition at line 173 of file t4_vf.c.

References desc, device, and t6vf_pciids.

Variable Documentation

◆ ccv_devclass

devclass_t ccv_devclass
static

Definition at line 979 of file t4_vf.c.

◆ ccv_driver

driver_t ccv_driver
static
Initial value:
= {
"ccv",
sizeof(struct port_info)
}
device_method_t cxgbe_methods[]
Definition: t4_main.c:134

Definition at line 972 of file t4_vf.c.

◆ cxgbev_devclass

devclass_t cxgbev_devclass
static

Definition at line 979 of file t4_vf.c.

◆ cxgbev_driver

driver_t cxgbev_driver
static
Initial value:
= {
"cxgbev",
sizeof(struct port_info)
}

Definition at line 960 of file t4_vf.c.

◆ cxlv_devclass

devclass_t cxlv_devclass
static

Definition at line 979 of file t4_vf.c.

◆ cxlv_driver

driver_t cxlv_driver
static
Initial value:
= {
"cxlv",
sizeof(struct port_info)
}

Definition at line 966 of file t4_vf.c.

◆ desc

char* desc

Definition at line 71 of file t4_vf.c.

Referenced by t4vf_probe(), t5vf_probe(), and t6vf_probe().

◆ device

uint16_t device

Definition at line 70 of file t4_vf.c.

Referenced by t4vf_probe(), t5vf_probe(), and t6vf_probe().

◆ t4vf_cdevsw

struct cdevsw t4vf_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_ioctl = t4vf_ioctl,
.d_name = "t4vf",
}
static d_ioctl_t t4vf_ioctl
Definition: t4_vf.c:132

Definition at line 134 of file t4_vf.c.

Referenced by t4vf_attach().

◆ t4vf_devclass

devclass_t t4vf_devclass
static

Definition at line 978 of file t4_vf.c.

◆ t4vf_driver

driver_t t4vf_driver
static
Initial value:
= {
"t4vf",
sizeof(struct adapter)
}
static device_method_t t4vf_methods[]
Definition: t4_vf.c:918

Definition at line 926 of file t4_vf.c.

◆ t4vf_ioctl

d_ioctl_t t4vf_ioctl
static

Definition at line 132 of file t4_vf.c.

◆ t4vf_methods

device_method_t t4vf_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, t4vf_probe),
DEVMETHOD(device_attach, t4vf_attach),
DEVMETHOD(device_detach, t4_detach_common),
DEVMETHOD_END
}
int t4_detach_common(device_t)
Definition: t4_main.c:1681
static int t4vf_attach(device_t dev)
Definition: t4_vf.c:482
static int t4vf_probe(device_t dev)
Definition: t4_vf.c:141

Definition at line 918 of file t4_vf.c.

◆ 

struct { ... } t4vf_pciids[]
Initial value:
= {
{0x4800, "Chelsio T440-dbg VF"},
{0x4801, "Chelsio T420-CR VF"},
{0x4802, "Chelsio T422-CR VF"},
{0x4803, "Chelsio T440-CR VF"},
{0x4804, "Chelsio T420-BCH VF"},
{0x4805, "Chelsio T440-BCH VF"},
{0x4806, "Chelsio T440-CH VF"},
{0x4807, "Chelsio T420-SO VF"},
{0x4808, "Chelsio T420-CX VF"},
{0x4809, "Chelsio T420-BT VF"},
{0x480a, "Chelsio T404-BT VF"},
{0x480e, "Chelsio T440-LP-CR VF"},
}

Referenced by t4vf_probe().

◆ t5vf_devclass

devclass_t t5vf_devclass
static

Definition at line 978 of file t4_vf.c.

◆ t5vf_driver

driver_t t5vf_driver
static
Initial value:
= {
"t5vf",
sizeof(struct adapter)
}
static device_method_t t5vf_methods[]
Definition: t4_vf.c:932

Definition at line 940 of file t4_vf.c.

◆ t5vf_methods

device_method_t t5vf_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, t5vf_probe),
DEVMETHOD(device_attach, t4vf_attach),
DEVMETHOD(device_detach, t4_detach_common),
DEVMETHOD_END
}
static int t5vf_probe(device_t dev)
Definition: t4_vf.c:157

Definition at line 932 of file t4_vf.c.

◆ 

struct { ... } t5vf_pciids[]
Initial value:
= {
{0x5800, "Chelsio T580-dbg VF"},
{0x5801, "Chelsio T520-CR VF"},
{0x5802, "Chelsio T522-CR VF"},
{0x5803, "Chelsio T540-CR VF"},
{0x5807, "Chelsio T520-SO VF"},
{0x5809, "Chelsio T520-BT VF"},
{0x580a, "Chelsio T504-BT VF"},
{0x580d, "Chelsio T580-CR VF"},
{0x580e, "Chelsio T540-LP-CR VF"},
{0x5810, "Chelsio T580-LP-CR VF"},
{0x5811, "Chelsio T520-LL-CR VF"},
{0x5812, "Chelsio T560-CR VF"},
{0x5814, "Chelsio T580-LP-SO-CR VF"},
{0x5815, "Chelsio T502-BT VF"},
{0x5818, "Chelsio T540-BT VF"},
{0x5819, "Chelsio T540-LP-BT VF"},
{0x581a, "Chelsio T540-SO-BT VF"},
{0x581b, "Chelsio T540-SO-CR VF"},
}

Referenced by t5vf_probe().

◆ t6vf_devclass

devclass_t t6vf_devclass
static

Definition at line 978 of file t4_vf.c.

◆ t6vf_driver

driver_t t6vf_driver
static
Initial value:
= {
"t6vf",
sizeof(struct adapter)
}
static device_method_t t6vf_methods[]
Definition: t4_vf.c:946

Definition at line 954 of file t4_vf.c.

◆ t6vf_methods

device_method_t t6vf_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, t6vf_probe),
DEVMETHOD(device_attach, t4vf_attach),
DEVMETHOD(device_detach, t4_detach_common),
DEVMETHOD_END
}
static int t6vf_probe(device_t dev)
Definition: t4_vf.c:173

Definition at line 946 of file t4_vf.c.

◆ 

struct { ... } t6vf_pciids[]
Initial value:
= {
{0x6800, "Chelsio T6-DBG-25 VF"},
{0x6801, "Chelsio T6225-CR VF"},
{0x6802, "Chelsio T6225-SO-CR VF"},
{0x6803, "Chelsio T6425-CR VF"},
{0x6804, "Chelsio T6425-SO-CR VF"},
{0x6805, "Chelsio T6225-OCP-SO VF"},
{0x6806, "Chelsio T62100-OCP-SO VF"},
{0x6807, "Chelsio T62100-LP-CR VF"},
{0x6808, "Chelsio T62100-SO-CR VF"},
{0x6809, "Chelsio T6210-BT VF"},
{0x680d, "Chelsio T62100-CR VF"},
{0x6810, "Chelsio T6-DBG-100 VF"},
{0x6811, "Chelsio T6225-LL-CR VF"},
{0x6814, "Chelsio T61100-OCP-SO VF"},
{0x6815, "Chelsio T6201-BT VF"},
{0x6880, "Chelsio T6225 80 VF"},
{0x6881, "Chelsio T62100 81 VF"},
{0x6882, "Chelsio T6225-CR 82 VF"},
{0x6883, "Chelsio T62100-CR 83 VF"},
{0x6884, "Chelsio T64100-CR 84 VF"},
{0x6885, "Chelsio T6240-SO 85 VF"},
{0x6886, "Chelsio T6225-SO-CR 86 VF"},
{0x6887, "Chelsio T6225-CR 87 VF"},
}

Referenced by t6vf_probe().