[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cdi-devel] [PATCH] Direct access to PCI configuration space



On Sat, Dec 12, 2009 at 06:47:09PM +0100, max@xxxxxxxxxx wrote:
> From: Max Reitz <max@xxxxxxxxxx>
> 
> + Some drivers need direct access to the PCI configuration space
> 
> Signed-off-by: Max Reitz <max@xxxxxxxxxx>
> ---
>  include/cdi/pci.h |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/include/cdi/pci.h b/include/cdi/pci.h
> index 6b1e6f0..4bf38ea 100644
> --- a/include/cdi/pci.h
> +++ b/include/cdi/pci.h
> @@ -87,6 +87,18 @@ void cdi_pci_alloc_memory(struct cdi_pci_device* device);
>   */
>  void cdi_pci_free_memory(struct cdi_pci_device* device);
>  
> +/**
> + * Signalisiert CDI-Treibern Zugriff auf den PCI-Konfigurationsraum
> + */
> +#define CDI_PCI_DIRECT_ACCESS
> +
> +uint8_t cdi_pci_config_inb(struct cdi_pci_device *device, int offset);
> +uint16_t cdi_pci_config_inw(struct cdi_pci_device *device, int offset);
> +uint32_t cdi_pci_config_inl(struct cdi_pci_device *device, int offset);
> +void cdi_pci_config_outb(struct cdi_pci_device *device, int offset, uint8_t value);
> +void cdi_pci_config_outw(struct cdi_pci_device *device, int offset, uint16_t value);
> +void cdi_pci_config_outl(struct cdi_pci_device *device, int offset, uint32_t value);

Seems Toni isn't going to reply himself, but he complained in IRC that
offset should be an uint8_t instead of an int.

My own complaint is that comments are missing. I said I was accepting
missing comments for mempool because it will be changed anyway, but
this code is going to stay, so it clearly needs appropriate
documentation.