On Wed, 21 Jan 2026 17:52:39 +0000
Shameer Kolothum <[email protected]> wrote:

> Add pcie_insert_capability(), a helper to insert a PCIe extended
> capability into an existing extended capability list at a caller
> specified offset.
> 
> Unlike pcie_add_capability(), which always appends a capability to the
> end of the list, this helper preserves the existing list ordering while
> allowing insertion at an arbitrary offset.
> 
> The helper only validates that the insertion does not overwrite an
> existing PCIe extended capability header, since corrupting a header
> would break the extended capability linked list. Validation of overlaps
> with other configuration space registers or capability-specific
> register blocks is left to the caller.
> 
> Reviewed-by: Michael S. Tsirkin <[email protected]>
> Reviewed-by: Eric Auger <[email protected]>
> Tested-by: Eric Auger <[email protected]>
> Tested-by: Zhangfei Gao <[email protected]>
> Signed-off-by: Shameer Kolothum <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>

Reply via email to