FreeBSD kernel amd64 PCI device code
pci_user.c File Reference
#include <sys/cdefs.h>
#include "opt_bus.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/linker.h>
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/mman.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/rwlock.h>
#include <sys/sglist.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
#include <sys/pciio.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include "pcib_if.h"
#include "pci_if.h"
Include dependency graph for pci_user.c:

Go to the source code of this file.

Data Structures

union  pci_conf_union
 

Macros

#define PVE_NEXT_LEN(pve, datalen)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int pci_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
 
static int pci_close (struct cdev *dev, int flag, int devtype, struct thread *td)
 
static int pci_conf_match_native (struct pci_match_conf *matches, int num_matches, struct pci_conf *match_buf)
 
static int pci_conf_match (u_long cmd, struct pci_match_conf *matches, int num_matches, struct pci_conf *match_buf)
 
static int pci_list_vpd (device_t dev, struct pci_list_vpd_io *lvio)
 
static size_t pci_match_conf_size (u_long cmd)
 
static size_t pci_conf_size (u_long cmd)
 
static void pci_conf_io_init (struct pci_conf_io *cio, caddr_t data, u_long cmd)
 
static void pci_conf_io_update_data (const struct pci_conf_io *cio, caddr_t data, u_long cmd)
 
static void pci_conf_for_copyout (const struct pci_conf *pcp, union pci_conf_union *pcup, u_long cmd)
 
static int pci_bar_mmap (device_t pcidev, struct pci_bar_mmap *pbm)
 
static int pci_bar_io (device_t pcidev, struct pci_bar_ioreq *pbi)
 
static int pci_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
 

Variables

static d_open_t pci_open
 
static d_close_t pci_close
 
static d_ioctl_t pci_ioctl
 
struct cdevsw pcicdev
 

Macro Definition Documentation

◆ PVE_NEXT_LEN

#define PVE_NEXT_LEN (   pve,
  datalen 
)
Value:
((struct pci_vpd_element *)((char *)(pve) + \
sizeof(struct pci_vpd_element) + (datalen)))

Definition at line 556 of file pci_user.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ pci_bar_io()

static int pci_bar_io ( device_t  pcidev,
struct pci_bar_ioreq *  pbi 
)
static

Definition at line 928 of file pci_user.c.

References PCI_BAR_MEM, pci_find_bar(), PCIR_BAR, pci_map::pm_size, pci_map::pm_value, type, and width.

Referenced by pci_ioctl().

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

◆ pci_bar_mmap()

static int pci_bar_mmap ( device_t  pcidev,
struct pci_bar_mmap *  pbm 
)
static

Definition at line 851 of file pci_user.c.

References addr, pci_bar_enabled(), PCI_BAR_MEM, pci_find_bar(), PCIM_BAR_MEM_BASE, pci_map::pm_size, and pci_map::pm_value.

Referenced by pci_ioctl().

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

◆ pci_close()

static int pci_close ( struct cdev *  dev,
int  flag,
int  devtype,
struct thread *  td 
)
static

Definition at line 143 of file pci_user.c.

◆ pci_conf_for_copyout()

static void pci_conf_for_copyout ( const struct pci_conf *  pcp,
union pci_conf_union pcup,
u_long  cmd 
)
static

Definition at line 775 of file pci_user.c.

References pci_conf_union::pc.

Referenced by pci_ioctl().

Here is the caller graph for this function:

◆ pci_conf_io_init()

static void pci_conf_io_init ( struct pci_conf_io *  cio,
caddr_t  data,
u_long  cmd 
)
static

Definition at line 695 of file pci_user.c.

References data.

Referenced by pci_ioctl().

Here is the caller graph for this function:

◆ pci_conf_io_update_data()

static void pci_conf_io_update_data ( const struct pci_conf_io *  cio,
caddr_t  data,
u_long  cmd 
)
static

Definition at line 734 of file pci_user.c.

References data.

Referenced by pci_ioctl().

Here is the caller graph for this function:

◆ pci_conf_match()

static int pci_conf_match ( u_long  cmd,
struct pci_match_conf *  matches,
int  num_matches,
struct pci_conf *  match_buf 
)
static

Definition at line 521 of file pci_user.c.

References pci_conf_match_native().

Referenced by pci_ioctl().

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

◆ pci_conf_match_native()

static int pci_conf_match_native ( struct pci_match_conf *  matches,
int  num_matches,
struct pci_conf *  match_buf 
)
static

Definition at line 156 of file pci_user.c.

Referenced by pci_conf_match().

Here is the caller graph for this function:

◆ pci_conf_size()

static size_t pci_conf_size ( u_long  cmd)
static

Definition at line 670 of file pci_user.c.

Referenced by pci_ioctl().

Here is the caller graph for this function:

◆ pci_ioctl()

static int pci_ioctl ( struct cdev *  dev,
u_long  cmd,
caddr_t  data,
int  flag,
struct thread *  td 
)
static

◆ pci_list_vpd()

static int pci_list_vpd ( device_t  dev,
struct pci_list_vpd_io *  lvio 
)
static

◆ pci_match_conf_size()

static size_t pci_match_conf_size ( u_long  cmd)
static

Definition at line 645 of file pci_user.c.

Referenced by pci_ioctl().

Here is the caller graph for this function:

◆ pci_open()

static int pci_open ( struct cdev *  dev,
int  oflags,
int  devtype,
struct thread *  td 
)
static

Definition at line 129 of file pci_user.c.

Variable Documentation

◆ pci_close

d_close_t pci_close
static

Definition at line 116 of file pci_user.c.

◆ pci_ioctl

d_ioctl_t pci_ioctl
static

Definition at line 117 of file pci_user.c.

◆ pci_open

d_open_t pci_open
static

Definition at line 115 of file pci_user.c.

◆ pcicdev

struct cdevsw pcicdev
Initial value:
= {
.d_version = D_VERSION,
.d_flags = 0,
.d_open = pci_open,
.d_close = pci_close,
.d_ioctl = pci_ioctl,
.d_name = "pci",
}
static d_ioctl_t pci_ioctl
Definition: pci_user.c:117
static d_open_t pci_open
Definition: pci_user.c:115
static d_close_t pci_close
Definition: pci_user.c:116

Definition at line 119 of file pci_user.c.

Referenced by pci_modevent().