Lines Matching +full:buffer +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
19 * pci_vc_save_restore_dwords - Save or restore a series of dwords
22 * @buf: buffer to save to or restore from
40 * pci_vc_load_arb_table - load and wait for VC arbitration table
63 * pci_vc_load_port_arb_table - Load and wait for VC port arbitration table
66 * @res: VC resource number, ie. VCn (0-7)
91 * pci_vc_enable - Enable virtual channel
94 * @res: VC res number, ie. VCn (0-7)
96 * A VC is enabled by setting the enable bit in matching resource control
98 * end of the link. To keep this simple we enable from the downstream device.
101 * get the correct resource, disable and enable on both ends.
109 /* Enable VCs from the downstream device */ in pci_vc_enable()
121 /* If there is no opposite end of the link, skip to enable */ in pci_vc_enable()
123 pci_is_root_bus(dev->bus)) in pci_vc_enable()
124 goto enable; in pci_vc_enable()
126 pos2 = pci_find_ext_capability(dev->bus->self, PCI_EXT_CAP_ID_VC); in pci_vc_enable()
128 goto enable; in pci_vc_enable()
130 pci_read_config_dword(dev->bus->self, pos2 + PCI_VC_PORT_CAP1, &cap1); in pci_vc_enable()
139 pci_read_config_dword(dev->bus->self, ctrl_pos2, &ctrl2); in pci_vc_enable()
141 link = dev->bus->self; in pci_vc_enable()
147 goto enable; in pci_vc_enable()
155 /* Enable on both ends */ in pci_vc_enable()
158 enable: in pci_vc_enable()
171 * pci_vc_do_save_buffer - Size, save, or restore VC state
174 * @save_state: buffer for save/restore
175 * @save: if provided a buffer, this indicates what to do with it
179 * guarantee ordering matches in the buffer. When called with NULL
180 * @save_state, return the size of the necessary save buffer. When called
181 * with a non-NULL @save_state, @save determines whether we save to the
182 * buffer or restore from it.
191 u8 *buf = save_state ? (u8 *)save_state->cap.data : NULL; in pci_vc_do_save_buffer()
193 /* Sanity check buffer size for save/restore */ in pci_vc_do_save_buffer()
194 if (buf && save_state->cap.size != in pci_vc_do_save_buffer()
196 pci_err(dev, "VC save buffer size does not match @0x%x\n", pos); in pci_vc_do_save_buffer()
197 return -ENOMEM; in pci_vc_do_save_buffer()
256 * re-load the VC Arbitration Table. in pci_vc_do_save_buffer()
317 * Preserve enable bit, restore the rest. in pci_vc_do_save_buffer()
326 /* Re-enable if needed */ in pci_vc_do_save_buffer()
346 * pci_save_vc_state - Save VC state to pre-allocate save buffer
350 * save it to the pre-allocated save buffer.
366 pci_err(dev, "%s buffer not found in %s\n", in pci_save_vc_state()
368 return -ENOMEM; in pci_save_vc_state()
383 * pci_restore_vc_state - Restore VC state from save buffer
387 * restore it from the previously saved buffer.
407 * pci_allocate_vc_save_buffers - Allocate save buffers for VC caps
411 * it, and allocate a buffer for save/restore.
425 pci_err(dev, "unable to preallocate %s save buffer\n", in pci_allocate_vc_save_buffers()