Commit c9a1752b authored by Pierre Morel's avatar Pierre Morel Committed by Vasily Gorbik

s390/pci: define RID and RID available

Firmware provides the bus/devfn part of the PCI addresses of a zPCI
function inside the new field RID of the CLP query PCI function
with a bit to know if this field is available to use.

Let's add these fields to the clp_rsp_query_pci structure,
add corresponding fields to zdev and initialize them.
Signed-off-by: default avatarPierre Morel <pmorel@linux.ibm.com>
Reviewed-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 6cf17f9a
...@@ -109,6 +109,9 @@ struct zpci_dev { ...@@ -109,6 +109,9 @@ struct zpci_dev {
u8 pft; /* pci function type */ u8 pft; /* pci function type */
u16 domain; u16 domain;
u8 port; u8 port;
u8 rid_available : 1;
u8 reserved : 7;
unsigned int devfn; /* DEVFN part of the RID*/
struct mutex lock; struct mutex lock;
u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */ u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */
......
...@@ -93,7 +93,9 @@ struct clp_req_query_pci { ...@@ -93,7 +93,9 @@ struct clp_req_query_pci {
struct clp_rsp_query_pci { struct clp_rsp_query_pci {
struct clp_rsp_hdr hdr; struct clp_rsp_hdr hdr;
u16 vfn; /* virtual fn number */ u16 vfn; /* virtual fn number */
u16 : 6; u16 : 3;
u16 rid_avail : 1;
u16 : 2;
u16 mio_addr_avail : 1; u16 mio_addr_avail : 1;
u16 util_str_avail : 1; /* utility string available? */ u16 util_str_avail : 1; /* utility string available? */
u16 pfgid : 8; /* pci function group id */ u16 pfgid : 8; /* pci function group id */
...@@ -108,7 +110,10 @@ struct clp_rsp_query_pci { ...@@ -108,7 +110,10 @@ struct clp_rsp_query_pci {
u8 pft; /* pci function type */ u8 pft; /* pci function type */
u64 sdma; /* start dma as */ u64 sdma; /* start dma as */
u64 edma; /* end dma as */ u64 edma; /* end dma as */
u32 reserved[11]; #define ZPCI_RID_MASK_DEVFN 0x00ff
u16 rid; /* BUS/DEVFN PCI address */
u16 reserved0;
u32 reserved[10];
u32 uid; /* user defined id */ u32 uid; /* user defined id */
u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */ u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */
u32 reserved2[16]; u32 reserved2[16];
......
...@@ -158,6 +158,9 @@ static int clp_store_query_pci_fn(struct zpci_dev *zdev, ...@@ -158,6 +158,9 @@ static int clp_store_query_pci_fn(struct zpci_dev *zdev,
zdev->port = response->port; zdev->port = response->port;
zdev->uid = response->uid; zdev->uid = response->uid;
zdev->fmb_length = sizeof(u32) * response->fmb_len; zdev->fmb_length = sizeof(u32) * response->fmb_len;
zdev->rid_available = response->rid_avail;
if (!s390_pci_no_rid && zdev->rid_available)
zdev->devfn = response->rid & ZPCI_RID_MASK_DEVFN;
memcpy(zdev->pfip, response->pfip, sizeof(zdev->pfip)); memcpy(zdev->pfip, response->pfip, sizeof(zdev->pfip));
if (response->util_str_avail) { if (response->util_str_avail) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment