tech-kern archive

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

Re: change MSI/MSI-X APIs



In article <555048FD.6020001%iij.ad.jp@localhost>,
Kengo NAKAHARA  <k-nakahara%iij.ad.jp@localhost> wrote:
>Hi,
>
>I received feedback from some device driver authors. They point out
>establish, disestablish and release APIs should be unified for INTx,
>MSI and MSI-X. So, I would change the APIs as below:
>
> before                  | after (unify to)
>-------------------------+-------------------------
> pci_intr_establish()    | 
> pci_msi_establish()     | pci_intr_establish()
> pci_msix_establish()    |
>-------------------------+-------------------------
> pci_intr_disestablish() | 
> pci_msi_disestablish()  | pci_intr_disestablish()
> pci_msix_disestablish() |
>-------------------------+-------------------------
> pci_intx_release()      | 
> pci_msi_release()       | pci_intr_release()
> pci_msix_release()      |
># In contrast, alloc APIs are not changed.
>
>Here is the above modification diff.
>    http://www.netbsd.org/~knakahara/unify-msi-apis/unify-msi-apis.diff
>
>If there is no objection, I commit it in a few days.
>
>Could you comment this modification?

I like it, but why can't we merge the allocations too?

Can't we have a:

	int pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ih);

for the drivers that have only one interrupt, and:

	int pci_intr_vector_map(struct pci_attach_args *pa,
	    pci_intr_handle_t **ihp, size_t *nih);

for drivers that can handle more than one?

Also can we add the disestablish/free code in the driver? What are the
steps to undo the interrupt allocation/establishment?

christos



Home | Main Index | Thread Index | Old Index