diff mbox series

[v12,03/19] PCI: Add PCI_HEADER_TYPE_MULTI_FUNC

Message ID 20230414061622.2930995-4-yoshihiro.shimoda.uh@renesas.com
State New
Headers show
Series PCI: rcar-gen4: Add R-Car Gen4 PCIe support | expand

Commit Message

Yoshihiro Shimoda April 14, 2023, 6:16 a.m. UTC
Add PCI_HEADER_TYPE_MULTI_FUNC macro which is "Multi-Function Device"
of Header Type Register.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 include/uapi/linux/pci_regs.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Yoshihiro Shimoda April 17, 2023, 4:51 a.m. UTC | #1
Hi Bjorn,

> From: Bjorn Helgaas, Sent: Saturday, April 15, 2023 3:58 AM
> 
> On Fri, Apr 14, 2023 at 03:16:06PM +0900, Yoshihiro Shimoda wrote:
> > Add PCI_HEADER_TYPE_MULTI_FUNC macro which is "Multi-Function Device"
> > of Header Type Register.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  include/uapi/linux/pci_regs.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> > index 5d48413ac28f..a302b67d2834 100644
> > --- a/include/uapi/linux/pci_regs.h
> > +++ b/include/uapi/linux/pci_regs.h
> > @@ -80,6 +80,7 @@
> >  #define  PCI_HEADER_TYPE_NORMAL		0
> >  #define  PCI_HEADER_TYPE_BRIDGE		1
> >  #define  PCI_HEADER_TYPE_CARDBUS	2
> > +#define  PCI_HEADER_TYPE_MULTI_FUNC	0x80
> 
> We test this a few places already; if we add this new macro, shouldn't
> we update those places to use it?

Thank you for your comment! We should updated drivers/pci/{probe,quirks}.c
like the following code for example:

	dev->multifunction = !!(hdr_type & 0x80);

I'll update them on v13.

Best regards,
Yoshihiro Shimoda

> >  #define PCI_BIST		0x0f	/* 8 bits */
> >  #define  PCI_BIST_CODE_MASK	0x0f	/* Return result */
> > --
> > 2.25.1
> >
diff mbox series

Patch

diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 5d48413ac28f..a302b67d2834 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -80,6 +80,7 @@ 
 #define  PCI_HEADER_TYPE_NORMAL		0
 #define  PCI_HEADER_TYPE_BRIDGE		1
 #define  PCI_HEADER_TYPE_CARDBUS	2
+#define  PCI_HEADER_TYPE_MULTI_FUNC	0x80
 
 #define PCI_BIST		0x0f	/* 8 bits */
 #define  PCI_BIST_CODE_MASK	0x0f	/* Return result */