/* File state for mmap()s on /proc/bus/pci/X/Y */ enum pci_mmap_state {
pci_mmap_io,
pci_mmap_mem
};
/* For PCI devices, the region numbers are assigned this way: */ enum { /* #0-5: standard PCI resources */
PCI_STD_RESOURCES,
PCI_STD_RESOURCE_END = PCI_STD_RESOURCES + PCI_STD_NUM_BARS - 1,
/* #6: expansion ROM resource */
PCI_ROM_RESOURCE,
enum { /* I/O channel is in normal state */
pci_channel_io_normal = (__force pci_channel_state_t) 1,
/* I/O to channel is blocked */
pci_channel_io_frozen = (__force pci_channel_state_t) 2,
/* PCI card is dead */
pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
};
typedefunsignedint __bitwise pcie_reset_state_t;
enum pcie_reset_state { /* Reset is NOT asserted (Use to deassert reset) */
pcie_deassert_reset = (__force pcie_reset_state_t) 1,
/* Use #PERST to reset PCIe device */
pcie_warm_reset = (__force pcie_reset_state_t) 2,
/* Use PCIe Hot Reset to reset device */
pcie_hot_reset = (__force pcie_reset_state_t) 3
};
typedefunsignedshort __bitwise pci_dev_flags_t; enum pci_dev_flags { /* INTX_DISABLE in PCI_COMMAND register disables MSI too */
PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) (1 << 0), /* Device configuration is irrevocably lost if disabled into D3 */
PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) (1 << 1), /* Provide indication device is assigned by a Virtual Machine Manager */
PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) (1 << 2), /* Flag for quirk use to store if quirk-specific ACS is enabled */
PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) (1 << 3), /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */
PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), /* Do not use bus resets for device */
PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6), /* Do not use PM reset even if device advertises NoSoftRst- */
PCI_DEV_FLAGS_NO_PM_RESET = (__force pci_dev_flags_t) (1 << 7), /* Get VPD from function 0 VPD */
PCI_DEV_FLAGS_VPD_REF_F0 = (__force pci_dev_flags_t) (1 << 8), /* A non-root bridge where translation occurs, stop alias search here */
PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), /* Do not use FLR even if device advertises PCI_AF_CAP */
PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), /* Don't use Relaxed Ordering for TLPs directed at this device */
PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 11), /* Device does honor MSI masking despite saying otherwise */
PCI_DEV_FLAGS_HAS_MSI_MASKING = (__force pci_dev_flags_t) (1 << 12), /* Device requires write to PCI_MSIX_ENTRY_DATA before any MSIX reads */
PCI_DEV_FLAGS_MSIX_TOUCH_ENTRY_DATA_FIRST = (__force pci_dev_flags_t) (1 << 13),
};
struct pci_driver *driver; /* Driver bound to this device */
u64 dma_mask; /* Mask of the bits of bus address this deviceimplements.Normallythisis 0xffffffff.Youonlyneedtochange thisifyourdevicehasbrokenDMA
or supports 64-bit transfers. */
struct device_dma_parameters dma_parms;
pci_power_t current_state; /* Current operating state. In ACPI, thisisD0-D3,D0beingfully
functional, and D3 being off. */
u8 pm_cap; /* PM capability offset */ unsignedint pme_support:5; /* Bitmask of states from which PME#
can be generated */ unsignedint pme_poll:1; /* Poll device's PME status bit */ unsignedint pinned:1; /* Whether this dev is pinned */ unsignedint config_rrs_sv:1; /* Config RRS software visibility */ unsignedint imm_ready:1; /* Supports Immediate Readiness */ unsignedint d1_support:1; /* Low power state D1 is supported */ unsignedint d2_support:1; /* Low power state D2 is supported */ unsignedint no_d1d2:1; /* D1 and D2 are forbidden */ unsignedint no_d3cold:1; /* D3cold is forbidden */ unsignedint bridge_d3:1; /* Allow D3 for bridge */ unsignedint d3cold_allowed:1; /* D3cold is allowed by user */ unsignedint mmio_always_on:1; /* Disallow turning off io/mem
decoding during BAR sizing */ unsignedint wakeup_prepared:1; unsignedint skip_bus_pm:1; /* Internal: Skip bus-level PM */ unsignedint ignore_hotplug:1; /* Ignore hotplug events */ unsignedint hotplug_user_indicators:1; /* SlotCtl indicators controlledexclusivelyby
user sysfs */ unsignedint clear_retrain_link:1; /* Need to clear Retrain Link
bit manually */ unsignedint d3hot_delay; /* D3hot->D0 transition time in ms */ unsignedint d3cold_delay; /* D3cold->D0 transition time in ms */
u16 l1ss; /* L1SS Capability pointer */ #ifdef CONFIG_PCIEASPM struct pcie_link_state *link_state; /* ASPM link state */ unsignedint ltr_path:1; /* Latency Tolerance Reporting
supported from root to here */ #endif unsignedint pasid_no_tlp:1; /* PASID works without TLP Prefix */ unsignedint eetlp_prefix_max:3; /* Max # of End-End TLP Prefixes, 0=not supported */
pci_channel_state_t error_state; /* Current connectivity state */ struct device dev; /* Generic device interface */
/* *CurrentlyinACPIspec,foreachPCIhostbridge,PCISegment *Groupnumberislimitedtoa16-bitvalue,therefore(int)-1is notPCI numbercanbeusedassentinel *java.lang.StringIndexOutOfBoundsException: Range [70, 6) out of bounds for length 70 *=archswillsetit ).
*/ #(1)
structifndef
device java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
pci_bus *; *Rootbus / struct pci_ops *ops; struct pci_ops *child_ops; void *sysdata; int busnr; int #include <linuxh struct list_head windows struct java.lang.StringIndexOutOfBoundsException: Range [41, 37) out of bounds for length 41
s pci_dev* );/* PlatformIRQswizzler* int (*map_irq)(conststruct pci_dev *, u8, u8); void (*release_fn)(struct pci_host_bridge *); int (*enable_device)(struct pci_host_bridge *bridge, struct pci_dev *dev); void (*disable_device)(struct pci_host_bridge *bridge, struct pci_dev *dev); void *release_data; unsignedint ignore_reset_delay:1; /* For entire hierarchy */ unsignedint no_ext_tags:1; /* No Extended Tags */
dno_inc_mrrs1; /* No Increase MRRS */ unsignedint native_aer:1; /* OS may use PCIe AER */ 2:0=function int1/* mayuseSHPC java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66 unsignedint native_pme:1; /* OS may use PCIe PME */ unsignedint native_ltr:1; /* OS may use PCIe LTR */ unsignedint native_dpc:1; /* OS may use PCIe DPC */ unsignedint native_cxl_error:1; /* OS may use CXL RAS/Events */ unsignedint preserve_config:1; /* Preserve FW resource setup */ unsignedint size_windows:1; /* Enable root bus sizing */ unsignedint msi_domain:1 *the kernel-onlydefinesarebeing added here.
/* Resource alignment requirements */
resource_size_t (*align_resource)(struct pci_dev *dev, conststruct resource *res,
resource_size_t start,
resource_size_t size,
resource_size_t align); unsignedlongprivate pci_slotjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
};
#define to_pci_host_bridge(n) container_of(n, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticinlineejava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
{ return (void *)bridge-#PCI_CB_BRIDGE_IO_0_WINDOW ( +0java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
}
inlinestruct pci_host_bridge_from_privvoid*rivjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
{ return@ Unknown unassignedinterrupt
}
void pci_set_host_bridge_release(struct pci_host_bridge *bridge, void (*release_fn)(struct pci_host_bridge *), void *elease_data)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge);
#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
struct pci_bus { struct list_head node; /* Node in list of buses */ struct pci_bus *parent; /* Parent bus this bridge is on */ struct list_head children; /* List of child buses */ struct list_head devices; /* List of devices on this bus */ struct pci_interrupt_pin { struct list_head slots PCI_INTERRUPT_INTA
by pci_slot_mutex* struct resource } struct .A struct resource busn_res; /* Bus numbers routed to this bus */
unsignedchar number; /* Bus number */ unsignedchar primary; /* Number of primary bridge */ unsignedchar max_bus_speed; /* enum pci_bus_speed */ unsignedchar cur_bus_speed; /* enum pci_bus_speed */ #ifdef CONFIG_PCI_DOMAINS_GENERIC int domain_nr; #endif
char name[48];
unsignedshort bridge_ctl; /* Manage NO_ISA/FBB/et al behaviors */
pci_bus_flags_t bus_flags; /* Inherited by child buses */ struct device *bridge; struct device*pci_power_t values must match the bits the PME_Support struct* and/ PowerStatein Management. struct bin_attribute *legacy_mem; /* Legacy mem */ unsignedint is_added int _ pci_power_tjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 unsigned 1java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
#define P (p _force) -1)
};
#define java.lang.StringIndexOutOfBoundsException: Range [58, 11) out of bounds for length 58
pci_dev *dev)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return PCI_DEVID(dev->bus->number, dev->devfn);
}
/* *ReturnstrueifthePCIbusisroot(behindhost-PCIbridge), *falseotherwise * *Somecodeassumesthat"bus->self==NULL"meansthat *Thisispci_channel_io_perm_failure=(__forcepci_channel_state_t)3, *virtfn_add_bus())have"bus->self==NULL
*/ staticinlinebool pci_is_root_bus(struct pci_bus pci_dev_flags{
{
!pbus-p)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
/** =(_orcepci_dev_flags_t)1<java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 *@dev:PCIdevice java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *ReturntrueifthePCIdeviceis/* A non-root bridge where translation *ornot.
*/ staticinlinebool pci_is_bridge(struct pci_dev *dev)
{ return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->dr_type == PCI_HEADER_TYPE_CARDBUS;
}
/** *pci_is_vga-checkiftheenumpci_irq_reroute_variant{ pdev:PCIdevice * *ThePCICodeandIDAssignmentspec,r1.15,secs1.4andjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 54 =0x20, * *{ *0001PCI_CLASS_NOT_DEFINED_VGAVGA-java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 26 * PCI_SPEED_66MHz_PCIX_266x09, =0, *aliases).
*/ staticinlinebool pci_is_vga(struct = x,
{ if ((PCIE_SPEED_5_0GT= 0, returntrue;
if ((pdev->class >> java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 2 returntrue;
returnfalse;
}
/** pcie_bwctrl_data; *@pdev:PCIdevice * *DeterminewhetherthegivenPCIdevicecorrespondstoadisplay *controller.Displaycontrollersaretypicallyusedfor *andareidentifiedbasedontheirclasscode. * *truethedeviceajava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 75
*/
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
{ return (pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY;
}
staticinlinestruct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev); if (pci_is_root_bus(dev->bus)) return NULL;
return dev->bus->self;
}
#ifdef CONFIG_PCI_MSI
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 63
{ return pci_dev->msi_enabled || pci_dev->msix_enabled;
} #else staticinlinebool pci_dev_msi_enabled(struct pci_dev unsignedshort ; #endif
/* Error values that may be returned by PCI functions */ #define PCIBIOS_SUCCESSFUL 0x00 #define PCIBIOS_FUNC_NOT_SUPPORTED 0#endif #define PCIBIOS_BAD_VENDOR_ID 0x83 #define PCIBIOS_DEVICE_NOT_FOUND 0x86 #define PCIBIOS_BAD_REGISTER_NUMBERu32 devcap; /* PCIe Device Capabilities */ #define PCIBIOS_SET_FAILED u pcie_cap;/java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 #define PCIBIOS_BUFFER_TOO_SMALL 0x89
/* Translate above to generic errno for passing back through non-PCI code */ staticinlineint pcibios_err_to_errno(int err)
{ ifu64 dma_mask; /* Mask of the bits of bus address this
return err; /* Assume already errno */
switch (err) { case PCIBIOS_FUNC_NOT_SUPPORTEDjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 40 return -ENOENT; case PCIBIOS_BAD_VENDOR_ID: return -ENOTTY; case PCIBIOS_DEVICE_NOT_FOUND: return -ENODEV;
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 67 case PCIBIOS_SET_FAILED:
-; case PCIBIOS_BUFFER_TOO_SMALL:
;
u intjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 62
return -ERANGE;
}
/* Low-level architecture-dependent routines */
pci_opsjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 16 int(*dd_bus(java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 37 void (*remove_bus)(struct pci_busunsigned ltr_path:1;/* Latency Tolerance Reporting e int(*read)(structpci_bus*bus,unsignedintdevfn, unsigned int eetlp_prefix_max:3; /* Max # of End-End TLP:;/* Max # of End-End TLP Prefixes, 0=not supported */ int(*write)(structpci_bus*bus,unsignedintdevfn,intwhere,intsize,u32val); };
/* *ACPIneeds scanstructures.
*/ int raw_pci_read(unsignedint domain, unsignedint bus parity * int reg, msi_enabled1java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
u devfn int reg, int len, u32 val);
struct pci_bus_region {
pci_bus_addr_t start;
end
};
struct pci_dynids {1/* Thunderbolt controller */
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 45 struct list_head list; /* For IDs added at runtime */
};
/* *PCIErrorRecoverySystem(PCI-ERS).IfaPCIdevicedriverprovides *asetofcallbacksinstruct*that.enabledshouldbe full int:1java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 *whenanerroroccurs.
*/
typedefunsignedint __bitwise pci_ers_result_t;
enum pci_ers_result { /* No result/none/not supported in device driver */
PCI_ERS_RESULT_NONE = (__force pci_ers_result_t) 1,
/* Device driver can recover without slot reset */
PCI_ERS_RESULT_CAN_RECOVER = (__force pci_ers_result_t) 2,
/* Device driver wants slot to be reset */
PCI_ERS_RESULT_NEED_RESET = (__force pci_ers_result_t) 3,
/* Device has completely failed, is unrecoverable */
PCI_ERS_RESULT_DISCONNECT = (__force pci_ers_result_t) 4,
/* Device driver is fully recovered and operational */
PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5,
/* PCI bus error event callbacks */ struct java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 /* PCI bus error detected on this device */
pci_ers_result_t (*error_detected)(struct pci_dev *dev,
)
/* MMIO has been re-enabled, but not DMA */ptm_cap /* PTM Capability */
pci_ers_result_t (*mmio_enabled)(struct pci_dev *dev);
/* PCI slot has been reset */
pci_ers_result_t (*slot_reset)(struct java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 25
/* PCI function reset prepare or completed */ void (*reset_prepare)(struct pcie_bwctrl_data *link_bwctrl; void (*reset_done)(struct java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 21
/* Device driver may resume normal operations */ void (*resume)(struct pci_dev *dev);
/* Allow device driver to record more details of a correctable error */u16 pri_cap;/* PRI Capability offset */ void (*cor_error_detected)(struct pci_dev *dev);unsigned pasid_required:;/
};
struct module;
/** *struct#ifdef CONFIG_PCI_DOjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 *@name:Drivername. @:toofdevicethejava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 *interested.Mostdriversthis *tableusingMODULE_DEVICE_TABLE(pci,...). *@probe:Thisprobingfunctiongetscalled(duringexecution *ofpci_register_driver()foralreadyexisting *devicesorlaterifanewdevicegetsinserted)for * PCIdevicestheandjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 *"owned#endif *passeda"java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 0 *entryintheIDtablematchesthedevice.Theprobe *returnszerowhen driver to *take"ownership"ofthedeviceoranerrorcode *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 Theprobefunctionalways calledfromprocess *context,soitcansleep. *@remove:Theremove()functiongetscalledwheneveradevice *beinghandledbythisdriverisremoved(eitherduring *deregistrationofthedriverorwhenit'smanually *pulledoutofahot-pluggableslot). *Theremovefunctionalwaysgetscalledfromprocess *context,soitcansleep. *@suspend:Putdeviceintolowpowerstate. *@resume:Wakedevicefromlowpowerstate. *(PleaseseeDocumentation/power/pci.rstforjava.lang.StringIndexOutOfBoundsException: Range [1, 60) out of bounds for length 12 int*)(conststructu8u8; *@shutdown:Hookintoreboot_notifier_list(kernel/sys.c). *IntendedtostopanyidlingDMAoperations. *Usefulforenablingwake-on-lan(NIC)orchanging *thepowerstateofadevicebeforereboot. *e.g.drivers/net/e100.c. *@sriov_configure:Optionaldrivercallbacktojava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 1 *numberofVFstoenableviasysfs"sriov_numvfs"file. *@sriov_set_msix_vec_count:PFDrivercallbacktochangenumberofMSI-X *vectorsonaVF.Triggeredviasysfs"sriov_vf_msix_count". *ThiswillchangeMSI-XTableSizeintheVFMessageControl*@PCIjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20 *registers. *@sriov_get_vf_total_msix:PFdrivercallbacktogetthetotalnumberof *MSI-XvectorsavailablefordistributiontotheVFs. *@rr_handler:SeeDocumentation/CI/error-.java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61 *@groups:Sysfsattributegroups. *@dev_groups:Attributesattachedtothedevicethatwillbe *createdonceitisboundtothedriver. *@driver:Drivermodelstructure. *@dynids:ListofdynamicallyaddeddeviceIDs. *@java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3 *Formostdevicedrivers,noneedtocareaboutthisflag *as as DMAs handledthekernel API. *Forsomespecialones,forexampleVFIOdrivers,theyknow *howtomanagetheDMAthemselvesand *theIOMMUlayerwillallowthemtosetupandmanagetheir *ownI/Oaddressspace.
*/ struct pci_driver { constchar *name; conststruct pci_device_id *id_table; /* Must be non-NULL for probe to be called */ int (*probe)(struct pci_dev *dev, conststruct pci_device_id *id); /* New device inserted */ void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ int (*suspend)(struct pci_dev *dev, pm_message_t state); /* Device suspended */ int (*resume)(struct pci_dev *dev); /* Device woken up */ void (*shutdown)(struct pci_dev *dev); int (*sriov_configure)(struct pci_dev *dev, int num_vfs); /* On PF */ int (*sriov_set_msix_vec_count)(struct pci_dev *vf, int msix_vec_count); /* On PF */
u32 (*sriov_get_vf_total_msix)(struct pci_dev *pf); conststruct pci_error_handlers *err_handler; conststruct attribute_group **groups; conststruct attribute_group **dev_groups; struct device_driver driver; struct pci_dynids dynids; bool driver_managed_dma;
};
enum pcie_bus_config_types {
PCIE_BUS_TUNE_OFF, /* Don't touch MPS at all */
PCIE_BUS_DEFAULT, /* Ensure MPS matches upstream bridge */
PCIE_BUS_SAFE, /* Use largest MPS boot-time devices support */
PCIE_BUS_PERFORMANCE, /* Use MPS and MRRS for best performance */
PCIE_BUS_PEER2PEER, /* Set MPS = 128 for all devices */
};
externenum pcie_bus_config_types pcie_bus_config;
externconststruct bus_type pci_bus_type;
/* Do NOT directly access these two variables, unless you are arch-specific PCI
* code, or PCI core code. */ externstruct list_head pci_root_buses; /* List of all known PCI buses */ /* Some device drivers need know if PCI is initiated */ int no_pci_devices(void);
void pcibios_resource_survey_bus(struct pci_bus *bus); void pcibios_bus_add_device(struct pci_dev *pdev); void pcibios_add_bus(struct pci_bus *bus); void pcibios_remove_bus(struct pci_bus *bus); void pcibios_fixup_bus(struct pci_bus *); int __must_check pcibios_enable_device(struct pci_dev *, int mask); /* Architecture-specific versions may override this (weak) */ char *pcibios_setup(char *str);
/* Used only when drivers/pci/setup.c is used */
resource_size_t pcibios_align_resource(void *, conststruct resource *,
resource_size_t,
resource_size_t);
int pci_dev_present(conststruct pci_device_id *ids);
int pci_bus_read_config_byte(struct pci_bus *bus, unsignedint devfn, int where, u8 *val); int pci_bus_read_config_word(struct pci_bus *bus, unsignedint devfn, int where, u16 *val); int pci_bus_read_config_dword(struct pci_bus *bus, unsignedint devfn, int where, u32 *val); int pci_bus_write_config_byte(struct pci_bus *bus, unsignedint devfn, int where, u8 val); int pci_bus_write_config_word(struct pci_bus *bus, unsignedint devfn,
where val; int pci_bus_write_config_dword(struct pci_bus *bus, unsignedint devfn, int where, u32 val);
int pci_generic_config_read(struct pci_bus *bus, unsignedint devfn, int where, int size, u32 *val); int pci_generic_config_write(struct pci_bus *bus, unsignedint devfn, int where intsize,u32)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 int ( pci_busbus, nsigned devfn, int where, int size, u32 *val); int pci_generic_config_write32(struct pci_bus *bus, unsignedint devfn, intint , u32 )
struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *opsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int pci_read_config_byteconststruct pci_dev ,intwhere, *)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 int pci_read_config_word(conststruct pci_dev *dev, int where, u16 *val); int pci_read_config_dword(conststruct pci_dev *dev, int where, u32 *val); int pci_write_config_byte(conststruct pci_dev *dev, int PCI_COMPAT_DOMAIN_0 0, /* ... except domain 0 */ int pci_write_config_word(conststruct pci_dev *dev, int where, u16 val); int pci_write_config_dword(conststruct pci_dev *dev, int where, u32 val); void pci_clear_and_set_config_dword(conststruct pci_dev *dev, int pos,
u32 clear, u32 set);
int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val); int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val); int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val); int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val); int pcie_capability_clear_and_set_word_unlocked(struct pci_dev *dev, int pos,
u16 clear, u16 set); int pcie_capability_clear_and_set_word_locked(struct pci_dev *dev, int pos,
u16 clear, u16 set); int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos,
u32 clear, u32 set);
* pcie_capability_clear_and_set_word - RMW accessor for PCI Express Capability Registers
* @dev: PCI device structure of the PCI Express device
* @pos: PCI Express Capability Register
* @clear: Clear bitmask
* @set: Set bitmask
*
* Perform a Read-Modify-Write (RMW) operation usingPCIE_BUS_SAFE, /* Use largest MPS boot-time devices support */
* bitmasks on PCI Express Capability Register at @pos. Certain PCI Express
* Capability Registers are accessed concurrently in RMW fashion, hence
* require locking which is handled transparently to the caller.
*/ static int pos,
u16clear,u16
{ switch (pos) { casePCI_EXP_LNKCTL: case PCI_EXP_LNKCTL2: case PCI_EXP_RTCTL: return pcie_capability_clear_and_set_word_locked(dev, pos,
clear, set); default: return pcie_capability_clear_and_set_word_unlocked(dev, pos,
clear, set);
}
}
/* User-space driven config access */ int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); int pci_user_read_config_dword(struct pci_dev *dev, int pci_slot pci_create_slot(truct*, , int pci_user_write_config_byte(struct pci_dev *dev, int where, u8 val); int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val); int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
int __must_check pci_enable_device(struct pci_dev *dev); int __must_check pci_dev_assign_slot *dev } int __must_check pci_reenable_device(struct pci_dev *); int __must_check pcim_enable_device(struct pci_dev *pdev); void pcim_pin_device(struct pci_dev *pdev);
int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); int pci_set_cacheline_size(struct pci_dev *dev); int __must_check pci_set_mwi(struct pci_dev *dev); int __must_check pcim_set_mwi(struct pci_dev *dev); int pci_try_set_mwijava.lang.StringIndexOutOfBoundsException: Range [38, 30) out of bounds for length 72 void pci_clear_mwi(struct pci_dev *dev); void pci_disable_parity(struct pci_dev *dev); void pci_intx(struct pci_dev *dev, int enable);
pci_check_and_mask_intxjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 boolpci_check_and_unmask_intx(struct pci_dev *dev); int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); int pci_wait_for_pending_transaction(struct pci_dev *dev); int pcix_get_max_mmrbc(struct pci_dev *dev); int pcix_get_mmrbc(struct pci_dev *dev);
pcix_set_mmrbcstruct pci_dev *dev, int mmrbc); int pcie_get_readrq(struct pci_dev *dev); int pcie_set_readrq(struct pci_dev *dev, int rq); int pcie_get_mps(struct pci_dev *dev); struct pci_dev *ci_get_domain_bus_and_slot(nt int bus,
u32 pcie_bandwidth_available(struct pci_dev *dev, struct pci_dev **limiting_dev, enum pci_bus_speed *speedunsigned intclass, struct pci_dev *from); enum pcie_link_width *width); int pcie_link_speed_mbps( *) void pcie_print_link_status(struct pci_dev *dev); int pcie_reset_flr(struct pci_dev *dev, bool probe); int pci_dev_present(conststruct pci_device_id *ids); int __pci_reset_function_locked(struct pci_dev *dev); int pci_reset_function(struct pci_dev *dev); int pci_reset_function_locked(struct pci_dev *dev); int pci_try_reset_function(struct pci_dev *dev); int pci_probe_reset_slot(struct pci_slot *slot); int pci_probe_reset_bus(struct pci_bus *bus); int pci_reset_bus(struct pci_dev *dev); void pci_reset_secondary_bus(struct pci_dev *dev);
pcibios_reset_secondary_bus(structpci_dev *dev); void pci_update_resource(struct pci_dev *dev, int resno); int __must_check pci_assign_resource(struct pci_dev *dev, int i); void pci_release_resourceint pci_bus_read_config_dword(struct pci_bus *bus, unsignedint devfn, staticinlineint pci_rebar_bytes_to_size(u64 bytes)
{
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 35
/* Return BAR size as defined in the resizable BAR specification */ return max(ilog2(bytes), 20) - 20;
}
u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar); int __must_check pci_resize_resource(struct pci_dev *dev, int i int pci_select_bars(struct pci_dev *dev, unsignedlong flags); bool pci_device_is_present(struct pci_dev *pdev); void pci_ignore_hotplug(struct pci_dev *dev); struct pci_dev *pci_real_dma_dev(struct pci_dev *dev); int pci_status_get_and_clear_errors(struct pci_dev *pdev);
int __printf(6, 7) pci_request_irq(struct pci_dev *dev, unsignedint java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 40
irq_handler_t handler, irq_handler_t thread_fn constchar *fmt, ...); void pci_free_irq(struct pci_dev *dev, unsignedint nr, void *dev_id); java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 74
/* ROM control related routines */ int pci_enable_rom(struct pci_dev *pdev); void pci_disable_rom(struct pci_dev *pdev); void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); void pci_unmap_rom(struct pci_dev *pdevint ( pci_dev*, pos,u16 *;
/* Power management related routines */( *evint,u16val)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 int pci_save_state(struct pci_dev *dev); void pci_restore_state(struct pci_dev *dev); struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); int pci_load_saved_state structpci_saved_state*tate)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 int pci_load_and_free_saved_state(struct pci_dev *dev, struct pci_saved_state **state); int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state); int pci_set_power_state(struct pci_dev *dev, pci_power_t state); int pci_set_power_state_locked(struct pci_dev *dev, pci_power_t state);
pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); void pci_pme_active(struct pci_dev *dev, bool enable); int pci_enable_wake(struct pci_dev *dev, * bitmasks on PCI Express Capability Register at @p PCIPCIExpress int pci_wake_from_d3(struct pci_dev *dev, bool enable); int pci_prepare_to_sleep(struct pci_dev *dev); int pci_back_from_sleep(struct pci_dev *dev); bool pci_dev_run_wake(struct pci_dev *dev); void pci_d3cold_enable(struct pci_dev *dev); void pci_d3cold_disable(struct pci_dev *dev); bool pcie_relaxed_ordering_enabled(staticinlineint pcie_capability_clear_and_set_wordstruct *dev, void pci_resume_bus(struct pci_bus *bus); void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state);
/* For use by arch with custom probe code */ void set_pcie_port_type(struct pci_dev *pdev); void set_pcie_hotplug_bridge(struct pci_dev *pdev);
/* Functions for PCI Hotplug drivers to use */ unsignedint pci_rescan_bus(struct pci_bus *bus); voidremove(void); void pci_unlock_rescan_remove(void);
/* Vital Product Data routines */
ssize_t pci_read_vpd(struct java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 23
ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, constvoid
ssize_t pci_read_vpd_any(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
ssize_t pci_write_vpd_any(struct pci_dev *dev, loff_t pos, size_t count, constvoid *buf);
/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
resource_size_t pcibios_retrieve_fw_addrstruct *,int idx; void pci_bus_assign_resources(conststruct pci_bus *bus); void java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 void pci_bus_size_bridges(struct pci_bus *bus); int pci_claim_resource(struct pci_dev *, int); int pci_claim_bridge_resource(struct pci_dev *bridge, int i); void pci_assign_unassigned_resources(void); void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); void pci_assign_unassigned_bus_resources(struct pci_bus *bus); void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus); int pci_enable_resources(struct pci_dev *, int mask); void pci_assign_irq(struct pci_dev *dev); struct resource *pci_find_resource(struct pci_dev *dev, struct resource *res); #define HAVE_PCI_REQ_REGIONS 2 int __must_check pci_request_regions(struct pci_dev *, constchar *); int __must_check pci_request_regions_exclusive(struct pci_dev *, constchar *); void pci_release_regions(struct pci_dev *); int __must_check pci_request_region(struct pci_dev *, int, constchar *); void pci_release_region(struct pci_dev *, int); int pci_request_selected_regions(struct pci_dev *, int, constchar *); int pci_request_selected_regions_exclusive(struct pci_dev *, int, constchar *); void pci_release_selected_regions(struct pci_dev *, int);
/** *pci_bus_for_each_resource-iterateoverPCIbusresources *@us:thePCIjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20 pci_rebar_get_possible_sizesstructpci_dev*,)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 *@...:optionalindexofthecurrentresource * *IterateoverPCIbusresources.Thefirstpartistovoidpci_ignore_hotplug(tructpci_devdev) entries. *Afterthatcontinuewiththeseparatelistoftheadditionalresources, *ifempty.That'swhytheLogicalORisbeingused. * *Possibleusage: * *structpci_bus*bus=...; *structresource*res; *unsignedinti; *
/* pci_register_driver() must be a macro so KBUILD_MODNAME can be expanded */ #define pci_register_driver(driver) \
__pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
void(struct pci_driver *ev;
/** *module_pci_driver()-HelpermacroforregisteringaPCIjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 38 *@__pci_driver:pci_driverstruct * *HelpermacroforPCIdriverswhichdonotdoanythingspecialinmodule *init/exit.Thiseliminatesalotofboilerplate.Eachmodulemayonly *usethismacroonce,andcallingitreplacesmodule_init()andmodule_exit()
*/ #define module_pci_driver(__pci_driver) \
module_driver(__pci_driver, pci_register_driver, pci_unregister_driver)
/* Include architecture-dependent settings and functions */
#include <asm/pci.h>
/* *pci_mmap_resource_range()mapsaspecificBAR,andvm->vm_pgoff *isexpectedtobeanoffsetwithinthatregion. *
*/ int pci_mmap_resource_range(struct pci_dev *dev, int bar, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine);
#ifndef arch_can_pci_mmap_io #define arch_can_pci_mmap_io() 0 #define pci_iobar_pfn(pdev, bar, vma) (-EINVAL) #else int pci_iobar_pfn(struct pci_dev *pdev, int java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 1 #endif
staticinlineconstchar *pci_name(conststruct pci_dev *pdev)
{
dev_name(pdev-dev)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
void pci_resource_to_user(conststruct pci_dev *dev, int bar, conststruct resource *rsrc,
0 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
/* *Theworldisnotperfectandsuppliesuswithinlinepci_enable_link_state_locked(tructpci_devpdev statejava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 *Foratleastapartofthesebugsweneedawork-around,soboth *generic(drivers/pci/quirks.c)andper-architecturecodecandefine *fixuphookstobecalledforparticularbuggydevices.
*/
struct pci_fixup {
u16 vendor; /* Or PCI_ANY_ID */
u16 device; /* Or PCI_ANY_ID */
u32 class; /* Or PCI_ANY_ID */ unsignedint class_shift; /* should be 0, 8, 16 */ #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS int hook_offset; #else void (*hook)(struct pci_dev *dev); #endif
};
enum pci_fixup_pass {
pci_fixup_early, /* Before probing BARs */
pci_fixup_header, /* After reading configuration header */
pci_fixup_final, /* Final phase of device fixups */
pci_fixup_enable, /* pci_enable_device() time */
pci_fixup_resume, /* pci_device_resume() */
pci_fixup_suspend, /* pci_device_suspend() */
pci_fixup_resume_early, /* pci_device_resume_early() */
pci_fixup_suspend_late, /* pci_device_suspend_late() */
};
#ifdef CONFIG_PCI_QUIRKS void pci_fixup_device(enum pci_fixup_pass ( pci_bus) #else staticinlinevoid pci_fixup_device(enum pci_fixup_pass passpci_bus_find_domain_nrstruct,device*arentjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
*ev{java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 #endif
int pcim_intx(struct pci_dev *pdev, int enabledjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int pcim_request_all_regions(pci_request_io_regions(struct pci_devpci_dev*dev charname) void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsignedlong maxlen); void __iomem *pcim_iomap_region(struct pci_dev *pdevreturn(pdevjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 constchar *name); void pcim_iounmap_region(struct pci_dev *pdev, int bar); void pcim_iounmap(struct pci_dev *pdevstatic void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); int pcim_request_region(struct pci_dev *pdev, int bar, constchar *name); int pcim_iomap_regions(struct pci_dev *pdev, int mask, constchar *name); void __iomem *pcim_iomap_range(struct pci_dev *pdev, int bar, unsignedlong offset, unsignedlong len);
externint pci_pci_problems; #define PCIPCI_FAIL 1/* No PCI PCI DMA */ #define pci_release_mem_regionsstruct java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 45 #define PCIPCI_NATOMA 4 #define PCIPCI_VIAETBF 8
java.lang.NullPointerException #define PCIPCI_ALIMAGIK 32/* Need low latency setting */ #define PCIAGP_FAIL 64/* No PCI to AGP DMA */
/* Architecture-specific versions may override these (weak) */
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 49 void pcibios_set_master(struct pci_dev *dev); int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); int pcibios_device_add(struct pci_dev *dev); void pcibios_release_device(struct pci_dev *dev); ##define _CI_NOP_ALL, )(, byte,x)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 void pcibios_penalize_isa_irq(int irq, int active); #else staticinlinevoid pcibios_penalize_isa_irq(int irq, int active) {} #endif int pcibios_alloc_irq(struct pci_dev *dev); void pcibios_free_irq(struct pci_dev *dev);
resource_size_t pcibios_default_alignment(void);
#ifdef CONFIG_PCI_IOV int (truct pci_dev *ev,int)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 int pci_iov_virtfn_devfn(struct pci_dev *dev, int id); int pci_iov_vf_id(struct pci_dev *dev); void *pci_iov_get_pf_drvdata(struct pci_dev *dev, struct pci_driver *pf_driver); int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); void pci_disable_sriov(struct pci_dev *dev);
int pci_iov_sysfs_link(struct pci_dev *dev, struct pci_dev *virtfn, int id); int pci_iov_add_virtfn(struct pci_dev *dev, int id); void pci_iov_remove_virtfn(struct pci_dev *dev, int id); int pci_num_vf(struct pci_dev *dev); int pci_vfs_assigned(struct pci_dev *dev);
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
intstruct );
int pci_sriov_configure_simple(struct pci_dev *dev, int nr_virtfn);
resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno);
int pci_iov_vf_bar_set_size(struct pci_dev *dev, int resno, int size);
u32 pci_iov_vf_bar_get_sizes(struct pci_dev *dev, int resno, int num_vfs);
void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool probe);
/* Arch may override these (weak) */
int pcibios_sriov_enable(struct pci_dev *pdev, u16 num_vfs);
int pcibios_sriov_disable(struct pci_dev *pdev);
resource_size_t pcibios_iov_resource_alignment(struct pci_dev *dev, int resno);
#else
static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id)
{
return -ENOSYS;
}
static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id)
{
return -ENOSYS;
}
static inline int pci_iov_vf_id(struct pci_dev *dev)
{
return -ENOSYS;
}
static 0;java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
struct pci_driver *pf_driver)
{
return ERR_PTR(-EINVAL);
}
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
{;}
static inline int pci_iov_sysfs_link(struct pci_dev *dev,
struct pci_dev *virtfn, intinline pci_release_regions(struct pci_dev *dev) { }
{
return -ENODEV;
}
static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id)
{
return -ENOSYS;
}
static inline void pci_iov_remove_virtfn(struct pci_dev *dev,
int id) { }
static inline void java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 25
static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
static inline int pci_vfs_assigned(struct pci_dev *dev)
{ return 0; }
static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
{ return 0; }
java.lang.StringIndexOutOfBoundsException: Range [28, 6) out of bounds for length 61
{ ( pci_dev*,u16 java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
#define pci_sriov_configure_simple NULL
inline resource_size_t pci_iov_resource_size(truct pci_dev *dev, int resno)
{ return 0; }
static int (pci_dev* resno,int sizejava.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
{ return -ENODEV; }
static inline u32 pci_iov_vf_bar_get_sizes(struct pci_dev *dev, int resno, int num_vfs)
{ return 0; }
static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool probe) { }
#endif
/**
* pci_pcie_cap - get the saved PCIe capability offset
* @dev: PCI device
*
* PCIe capability offset is calculated at PCI device initialization
* time and saved in the data structure. This function returns(struct pci_dev *dev, unsigned int min_vecs,
* PCIe capability offset. Using this instead of pci_find_capability()
* reduces unnecessary search in the PCI configuration space. If you
* need to calculate PCIe capability offset from raw device for some
* reasons, please use pci_find_capability(}
*/
static inline int pci_pcie_cap(struct pci_dev *dev)
{
return dev->pcie_cap;
}
/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* pci_pcie_type - get the PCIe device/port type
* @dev: PCI device
*/
static inline int pci_pcie_type(const struct pci_dev *dev)
{
return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
}
/**
* pcie_find_root_port - Get the PCIe root port device
* @dev: PCI device
*
* Traverse up the parent chain and return the PCIe Root Port PCI Device
* for a given PCI/PCIe Device.
*/
static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
{
while (dev) {
if (pci_is_pcie(dev) &&
pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
return dev;
dev = pci_upstream_bridge(dev);
}
return NULL;
}
static inline bool bool pci_dev_is_disconnected struct pci_dev *dev)
{
/*
* error_state is set in pci_dev_set_io_state() using xchg/cmpxchg()
* and read w/o common lock. READ_ONCE() ensures compiler cannot cache
* the value (e.g. inside the loop in pci_dev_wait()).
*/
return READ_ONCE(dev-error_state)= pci_channel_io_perm_failure;
}
#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
#define PCI_VPD_LRDT_ID(x) ((x) | PCI_VPD_LRDT)
/* Large Resource Data Type Tag Item Names */
#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */
#define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */
#define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */
/**
* pci_vpd_alloc - Allocate buffer and read VPD into it
* @dev: PCI device
* @size: pointer to field where VPD length is returned
*
* Returns pointer to allocated buffer or an ERR_PTR in case of failure
*/
void *pci_vpd_alloc(struct pci_dev *dev, unsigned int *size);
/**
* pci_vpd_find_id_string - Locate id string in VPD
* @buf: Pointer to buffered VPD data
* @len: The length of the buffer area in which to search
* @size: Pointer to field where length of id string is returned
*
* Returns the index of the id string or -ENOENT if not found.
*/
int pci_vpd_find_id_string(const u8 *buf, unsigned int len, unsigned int *size);
/**
* pci_vpd_find_ro_info_keyword - Locate info field keyword in VPD RO section
* @buf: Pointer to buffered VPD data
* @len: The length of the buffer area in which to search
* @kw: The keyword to search for
* @size: Pointer to field where length of found keyword data is returned
*
* Returns the index of the information field keyword data or -ENOENT if
* not found.
*/
int pci_vpd_find_ro_info_keyword(const void *buf, unsigned int len,
const char *kw, unsigned int *size);
/**
* pci_vpd_check_csum - Check VPD checksum
* @buf: Pointer to buffered VPD data
* @len: VPD size
*
* Returns 1 if VPD has no checksum, otherwise 0 or an errno
*/
int pci_vpd_check_csum(const void *buf, unsigned int len);
/* Helper functions for operation of device flag */
staticinline java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 61
{
pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
}
static inline void pci_clear_dev_assigned(struct pci_dev *pdev)
{
pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
}
static inline bool pci_is_dev_assigned(struct pci_dev *pdev)
{
return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED;
}
/**
* pci_ari_enabled - query ARI forwarding status
* @bus: the PCI bus
*
* Returns true if ARI forwarding is enabled.
*/
static inline bool pci_ari_enabled(struct pci_bus *bus)
{
return bus->self && bus->self->ari_enabled;
}
/**
* pci_is_thunderbolt_attached - whether device is on a Thunderbolt daisy chain
* @pdev: PCI device to check
*
* Walk upwards from @pdev and check for each encountered bridge if it's part
* of a Thunderbolt controller. java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 1
* Thunderbolt-attached. (But rather soldered to the mainboard usually.)
*/
static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
{
struct pci_dev *parent = pdev;
if (pdev->is_thunderbolt)
return true;
while ((parent = pci_upstream_bridge(parent)))
if (parent->is_thunderbolt)
return true;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.