• Home
  • Raw
  • Download

Lines Matching +full:buffer +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0
17 * pci_vc_save_restore_dwords - Save or restore a series of dwords
20 * @buf: buffer to save to or restore from
38 * pci_vc_load_arb_table - load and wait for VC arbitration table
61 * pci_vc_load_port_arb_table - Load and wait for VC port arbitration table
64 * @res: VC resource number, ie. VCn (0-7)
89 * pci_vc_enable - Enable virtual channel
92 * @res: VC res number, ie. VCn (0-7)
94 * A VC is enabled by setting the enable bit in matching resource control
96 * end of the link. To keep this simple we enable from the downstream device.
99 * get the correct resource, disable and enable on both ends.
107 /* Enable VCs from the downstream device */ in pci_vc_enable()
108 if (!dev->has_secondary_link) in pci_vc_enable()
119 /* If there is no opposite end of the link, skip to enable */ in pci_vc_enable()
121 pci_is_root_bus(dev->bus)) in pci_vc_enable()
122 goto enable; in pci_vc_enable()
124 pos2 = pci_find_ext_capability(dev->bus->self, PCI_EXT_CAP_ID_VC); in pci_vc_enable()
126 goto enable; in pci_vc_enable()
128 pci_read_config_dword(dev->bus->self, pos2 + PCI_VC_PORT_CAP1, &cap1); in pci_vc_enable()
137 pci_read_config_dword(dev->bus->self, ctrl_pos2, &ctrl2); in pci_vc_enable()
139 link = dev->bus->self; in pci_vc_enable()
145 goto enable; in pci_vc_enable()
153 /* Enable on both ends */ in pci_vc_enable()
156 enable: in pci_vc_enable()
169 * pci_vc_do_save_buffer - Size, save, or restore VC state
172 * @save_state: buffer for save/restore
174 * @save: if provided a buffer, this indicates what to do with it
178 * guarantee ordering matches in the buffer. When called with NULL
179 * @save_state, return the size of the necessary save buffer. When called
180 * with a non-NULL @save_state, @save determines whether we save to the
181 * buffer or restore from it.
190 u8 *buf = save_state ? (u8 *)save_state->cap.data : NULL; in pci_vc_do_save_buffer()
192 /* Sanity check buffer size for save/restore */ in pci_vc_do_save_buffer()
193 if (buf && save_state->cap.size != in pci_vc_do_save_buffer()
195 pci_err(dev, "VC save buffer size does not match @0x%x\n", pos); in pci_vc_do_save_buffer()
196 return -ENOMEM; in pci_vc_do_save_buffer()
255 * re-load the VC Arbitration Table. in pci_vc_do_save_buffer()
316 * Preserve enable bit, restore the rest. in pci_vc_do_save_buffer()
325 /* Re-enable if needed */ in pci_vc_do_save_buffer()
345 * pci_save_vc_state - Save VC state to pre-allocate save buffer
349 * save it to the pre-allocated save buffer.
365 pci_err(dev, "%s buffer not found in %s\n", in pci_save_vc_state()
367 return -ENOMEM; in pci_save_vc_state()
382 * pci_restore_vc_state - Restore VC state from save buffer
386 * restore it from the previously saved buffer.
406 * pci_allocate_vc_save_buffers - Allocate save buffers for VC caps
410 * 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()