Lines Matching refs:zdev

97 static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,  in clp_store_query_pci_fngrp()  argument
100 zdev->tlb_refresh = response->refresh; in clp_store_query_pci_fngrp()
101 zdev->dma_mask = response->dasm; in clp_store_query_pci_fngrp()
102 zdev->msi_addr = response->msia; in clp_store_query_pci_fngrp()
103 zdev->max_msi = response->noi; in clp_store_query_pci_fngrp()
104 zdev->fmb_update = response->mui; in clp_store_query_pci_fngrp()
105 zdev->version = response->version; in clp_store_query_pci_fngrp()
109 zdev->max_bus_speed = PCIE_SPEED_5_0GT; in clp_store_query_pci_fngrp()
112 zdev->max_bus_speed = PCI_SPEED_UNKNOWN; in clp_store_query_pci_fngrp()
117 static int clp_query_pci_fngrp(struct zpci_dev *zdev, u8 pfgid) in clp_query_pci_fngrp() argument
134 clp_store_query_pci_fngrp(zdev, &rrb->response); in clp_query_pci_fngrp()
144 static int clp_store_query_pci_fn(struct zpci_dev *zdev, in clp_store_query_pci_fn() argument
150 zdev->bars[i].val = le32_to_cpu(response->bar[i]); in clp_store_query_pci_fn()
151 zdev->bars[i].size = response->bar_size[i]; in clp_store_query_pci_fn()
153 zdev->start_dma = response->sdma; in clp_store_query_pci_fn()
154 zdev->end_dma = response->edma; in clp_store_query_pci_fn()
155 zdev->pchid = response->pchid; in clp_store_query_pci_fn()
156 zdev->pfgid = response->pfgid; in clp_store_query_pci_fn()
157 zdev->pft = response->pft; in clp_store_query_pci_fn()
158 zdev->vfn = response->vfn; in clp_store_query_pci_fn()
159 zdev->port = response->port; in clp_store_query_pci_fn()
160 zdev->uid = response->uid; in clp_store_query_pci_fn()
161 zdev->fmb_length = sizeof(u32) * response->fmb_len; in clp_store_query_pci_fn()
162 zdev->rid_available = response->rid_avail; in clp_store_query_pci_fn()
163 zdev->is_physfn = response->is_physfn; in clp_store_query_pci_fn()
164 if (!s390_pci_no_rid && zdev->rid_available) in clp_store_query_pci_fn()
165 zdev->devfn = response->rid & ZPCI_RID_MASK_DEVFN; in clp_store_query_pci_fn()
167 memcpy(zdev->pfip, response->pfip, sizeof(zdev->pfip)); in clp_store_query_pci_fn()
169 memcpy(zdev->util_str, response->util_str, in clp_store_query_pci_fn()
170 sizeof(zdev->util_str)); in clp_store_query_pci_fn()
171 zdev->util_str_avail = 1; in clp_store_query_pci_fn()
173 zdev->mio_capable = response->mio_addr_avail; in clp_store_query_pci_fn()
178 zdev->bars[i].mio_wb = (void __iomem *) response->mio.addr[i].wb; in clp_store_query_pci_fn()
179 zdev->bars[i].mio_wt = (void __iomem *) response->mio.addr[i].wt; in clp_store_query_pci_fn()
184 static int clp_query_pci_fn(struct zpci_dev *zdev, u32 fh) in clp_query_pci_fn() argument
201 rc = clp_store_query_pci_fn(zdev, &rrb->response); in clp_query_pci_fn()
204 rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid); in clp_query_pci_fn()
217 struct zpci_dev *zdev; in clp_add_pci_device() local
221 zdev = kzalloc(sizeof(*zdev), GFP_KERNEL); in clp_add_pci_device()
222 if (!zdev) in clp_add_pci_device()
225 zdev->fh = fh; in clp_add_pci_device()
226 zdev->fid = fid; in clp_add_pci_device()
229 rc = clp_query_pci_fn(zdev, fh); in clp_add_pci_device()
234 zdev->state = ZPCI_FN_STATE_CONFIGURED; in clp_add_pci_device()
236 zdev->state = ZPCI_FN_STATE_STANDBY; in clp_add_pci_device()
238 rc = zpci_create_device(zdev); in clp_add_pci_device()
245 kfree(zdev); in clp_add_pci_device()
254 static int clp_set_pci_fn(struct zpci_dev *zdev, u8 nr_dma_as, u8 command) in clp_set_pci_fn() argument
258 u32 fid = zdev->fid; in clp_set_pci_fn()
269 rrb->request.fh = zdev->fh; in clp_set_pci_fn()
288 zdev->fh = rrb->response.fh; in clp_set_pci_fn()
332 int clp_enable_fh(struct zpci_dev *zdev, u8 nr_dma_as) in clp_enable_fh() argument
336 rc = clp_set_pci_fn(zdev, nr_dma_as, CLP_SET_ENABLE_PCI_FN); in clp_enable_fh()
337 zpci_dbg(3, "ena fid:%x, fh:%x, rc:%d\n", zdev->fid, zdev->fh, rc); in clp_enable_fh()
341 if (zpci_use_mio(zdev)) { in clp_enable_fh()
342 rc = clp_set_pci_fn(zdev, nr_dma_as, CLP_SET_ENABLE_MIO); in clp_enable_fh()
344 zdev->fid, zdev->fh, rc); in clp_enable_fh()
346 clp_disable_fh(zdev); in clp_enable_fh()
352 int clp_disable_fh(struct zpci_dev *zdev) in clp_disable_fh() argument
356 if (!zdev_enabled(zdev)) in clp_disable_fh()
359 rc = clp_set_pci_fn(zdev, 0, CLP_SET_DISABLE_PCI_FN); in clp_disable_fh()
360 zpci_dbg(3, "dis fid:%x, fh:%x, rc:%d\n", zdev->fid, zdev->fh, rc); in clp_disable_fh()
404 struct zpci_dev *zdev; in __clp_add() local
409 zdev = get_zdev_by_fid(entry->fid); in __clp_add()
410 if (!zdev) in __clp_add()
431 struct zpci_dev *zdev; in __clp_refresh_fh() local
437 zdev = get_zdev_by_fid(fid); in __clp_refresh_fh()
438 if (!zdev) in __clp_refresh_fh()
441 zdev->fh = entry->fh; in __clp_refresh_fh()