Skip to content

Commit c9a1752

Browse files
Pierre MorelVasily Gorbik
authored andcommitted
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: Pierre Morel <[email protected]> Reviewed-by: Niklas Schnelle <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 6cf17f9 commit c9a1752

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

arch/s390/include/asm/pci.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ struct zpci_dev {
109109
u8 pft; /* pci function type */
110110
u16 domain;
111111
u8 port;
112+
u8 rid_available : 1;
113+
u8 reserved : 7;
114+
unsigned int devfn; /* DEVFN part of the RID*/
112115

113116
struct mutex lock;
114117
u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */

arch/s390/include/asm/pci_clp.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ struct clp_req_query_pci {
9393
struct clp_rsp_query_pci {
9494
struct clp_rsp_hdr hdr;
9595
u16 vfn; /* virtual fn number */
96-
u16 : 6;
96+
u16 : 3;
97+
u16 rid_avail : 1;
98+
u16 : 2;
9799
u16 mio_addr_avail : 1;
98100
u16 util_str_avail : 1; /* utility string available? */
99101
u16 pfgid : 8; /* pci function group id */
@@ -108,7 +110,10 @@ struct clp_rsp_query_pci {
108110
u8 pft; /* pci function type */
109111
u64 sdma; /* start dma as */
110112
u64 edma; /* end dma as */
111-
u32 reserved[11];
113+
#define ZPCI_RID_MASK_DEVFN 0x00ff
114+
u16 rid; /* BUS/DEVFN PCI address */
115+
u16 reserved0;
116+
u32 reserved[10];
112117
u32 uid; /* user defined id */
113118
u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */
114119
u32 reserved2[16];

arch/s390/pci/pci_clp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ static int clp_store_query_pci_fn(struct zpci_dev *zdev,
158158
zdev->port = response->port;
159159
zdev->uid = response->uid;
160160
zdev->fmb_length = sizeof(u32) * response->fmb_len;
161+
zdev->rid_available = response->rid_avail;
162+
if (!s390_pci_no_rid && zdev->rid_available)
163+
zdev->devfn = response->rid & ZPCI_RID_MASK_DEVFN;
161164

162165
memcpy(zdev->pfip, response->pfip, sizeof(zdev->pfip));
163166
if (response->util_str_avail) {

0 commit comments

Comments
 (0)