lkml.org 
[lkml]   [2022]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 01/23] PCI: endpoint: Add EP core layer to enable EP controller and EP functions
On Mon, Apr 10, 2017 at 07:25:10PM +0530, Kishon Vijay Abraham I wrote:
> Introduce a new EP core layer in order to support endpoint functions in
> linux kernel. This comprises the EPC library (Endpoint Controller Library)
> and EPF library (Endpoint Function Library). EPC library implements
> functions specific to an endpoint controller and EPF library implements
> functions specific to an endpoint function.

> +void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar)
> +{
> + void *space;
> + struct device *dev = &epf->dev;
> + dma_addr_t phys_addr;
> +
> + if (size < 128)
> + size = 128;
> + size = roundup_pow_of_two(size);
> +
> + space = dma_alloc_coherent(dev, size, &phys_addr, GFP_KERNEL);
> + if (!space) {
> + dev_err(dev, "failed to allocate mem space\n");
> + return NULL;
> + }
> +
> + epf->bar[bar].phys_addr = phys_addr;

> + * struct pci_epf_bar - represents the BAR of EPF device
> + * @phys_addr: physical address that should be mapped to the BAR
> + * @size: the size of the address space present in BAR
> + */
> +struct pci_epf_bar {
> + dma_addr_t phys_addr;

If this "phys_addr" is an address that can appear on the PCI bus, is
"phys_addr" a misnomer? Many drivers use dma, dmabuf, bus_addr, etc.

Bjorn

\
 
 \ /
  Last update: 2022-12-14 00:46    [W:0.156 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site