tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: argument of pci_msi[x]_count()
Hi, Christos.
On 2015/08/07 18:53, Christos Zoulas wrote:
> In article <55C349BF.2000403%execsw.org@localhost>,
> Masanobu SAITOH <msaitoh%execsw.org@localhost> wrote:
>> Hi, all.
>>
>> Currently, pci_msi_count() and pci_msix_count() take one
>> pci_attach_args argument.
>> These functions may be used in other than attach function. So, it might be
>> better to use pci_chipset_tag_t and pcitag_t.
>>
>> Is the following diff better than current specification?
>
> Ok, but this makes them different than their alloc counterparts. Should
> we change those too?
Almost all pci related functions don't take pci_attach_args as
an argument. Some functions are required to take it because
some elements(e.g. pa_iot and pa_memt) in the structure are required.
Before introducing MSI/MSI-X API, the following functions take
pci_attach_args as an argument.
pci_find_device()
pci_mapreg_map()
pci_mapreg_submap()
pci_intr_map()
pci_aprint_devinfo()
pci_attach_hook()
Some above functions refers pa_iot and pa_memt in them.
And then, the following functions which take pci_attach_args
as an argument are added:
pci_intx_alloc()
pci_intr_alloc()
pci_msi_count()
pci_msi_alloc()
pci_msi_alloc_exact()
pci_msix_count()
pci_msix_alloc()
pci_msix_alloc_exact()
pci_msix_alloc_map()
pci_intr_map() takes pci_attach_args, so it's consistent.
In reality, it's not required for x86 to take pci_attach_args.
The MSI/MSI-X related "alloc" function might not required
to take pci_attach_args, but I think it's ok to keep current
API for the consistency and possibility of using pci_attach_args
on other archs.
So, is it ok to change pci_msi[x]_count() only?
> christos
>
--
-----------------------------------------------
SAITOH Masanobu (msaitoh%execsw.org@localhost
msaitoh%netbsd.org@localhost)
Home |
Main Index |
Thread Index |
Old Index