Lines Matching refs:pos
27 static void pci_vc_save_restore_dwords(struct pci_dev *dev, int pos, in pci_vc_save_restore_dwords() argument
34 pci_read_config_dword(dev, pos + (i * 4), buf); in pci_vc_save_restore_dwords()
36 pci_write_config_dword(dev, pos + (i * 4), *buf); in pci_vc_save_restore_dwords()
49 static void pci_vc_load_arb_table(struct pci_dev *dev, int pos) in pci_vc_load_arb_table() argument
53 pci_read_config_word(dev, pos + PCI_VC_PORT_CTRL, &ctrl); in pci_vc_load_arb_table()
54 pci_write_config_word(dev, pos + PCI_VC_PORT_CTRL, in pci_vc_load_arb_table()
56 if (pci_wait_for_pending(dev, pos + PCI_VC_PORT_STATUS, in pci_vc_load_arb_table()
73 static void pci_vc_load_port_arb_table(struct pci_dev *dev, int pos, int res) in pci_vc_load_port_arb_table() argument
78 ctrl_pos = pos + PCI_VC_RES_CTRL + (res * PCI_CAP_VC_PER_VC_SIZEOF); in pci_vc_load_port_arb_table()
79 status_pos = pos + PCI_VC_RES_STATUS + (res * PCI_CAP_VC_PER_VC_SIZEOF); in pci_vc_load_port_arb_table()
104 static void pci_vc_enable(struct pci_dev *dev, int pos, int res) in pci_vc_enable() argument
114 ctrl_pos = pos + PCI_VC_RES_CTRL + (res * PCI_CAP_VC_PER_VC_SIZEOF); in pci_vc_enable()
115 status_pos = pos + PCI_VC_RES_STATUS + (res * PCI_CAP_VC_PER_VC_SIZEOF); in pci_vc_enable()
120 pci_read_config_dword(dev, pos, &header); in pci_vc_enable()
186 static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos, in pci_vc_do_save_buffer() argument
197 pci_vc_do_save_buffer(dev, pos, NULL, save)) { in pci_vc_do_save_buffer()
199 "VC save buffer size does not match @0x%x\n", pos); in pci_vc_do_save_buffer()
203 pci_read_config_dword(dev, pos + PCI_VC_PORT_CAP1, &cap1); in pci_vc_do_save_buffer()
219 pci_read_config_word(dev, pos + PCI_VC_PORT_CTRL, in pci_vc_do_save_buffer()
222 pci_write_config_word(dev, pos + PCI_VC_PORT_CTRL, in pci_vc_do_save_buffer()
236 pci_read_config_dword(dev, pos + PCI_VC_PORT_CAP2, &cap2); in pci_vc_do_save_buffer()
254 pos + vcarb_offset, in pci_vc_do_save_buffer()
262 pci_vc_load_arb_table(dev, pos); in pci_vc_do_save_buffer()
281 pci_read_config_dword(dev, pos + PCI_VC_RES_CAP + in pci_vc_do_save_buffer()
301 pos + parb_offset, in pci_vc_do_save_buffer()
311 int ctrl_pos = pos + PCI_VC_RES_CTRL + in pci_vc_do_save_buffer()
328 pci_vc_load_port_arb_table(dev, pos, i); in pci_vc_do_save_buffer()
331 pci_vc_enable(dev, pos, i); in pci_vc_do_save_buffer()
360 int pos, ret; in pci_save_vc_state() local
363 pos = pci_find_ext_capability(dev, vc_caps[i].id); in pci_save_vc_state()
364 if (!pos) in pci_save_vc_state()
374 ret = pci_vc_do_save_buffer(dev, pos, save_state, true); in pci_save_vc_state()
397 int pos; in pci_restore_vc_state() local
400 pos = pci_find_ext_capability(dev, vc_caps[i].id); in pci_restore_vc_state()
402 if (!save_state || !pos) in pci_restore_vc_state()
405 pci_vc_do_save_buffer(dev, pos, save_state, false); in pci_restore_vc_state()
422 int len, pos = pci_find_ext_capability(dev, vc_caps[i].id); in pci_allocate_vc_save_buffers() local
424 if (!pos) in pci_allocate_vc_save_buffers()
427 len = pci_vc_do_save_buffer(dev, pos, NULL, false); in pci_allocate_vc_save_buffers()