Lines Matching defs:device
28 #include <linux/device.h>
125 * If we set up a device for bus mastering, we need to check the latency
136 /* If set, the PCI config space of each device is printed during boot. */
184 * @pdev: the PCI device
237 * pci_dev_str_match_path - test if a path string matches a device
238 * @dev: the PCI device to test
239 * @path: string to match the device against
243 * path of device/function addresses matches a PCI device. The string must
246 * [<domain>:]<bus>:<device>.<func>[/<device>.<func>]*
248 * A path for a device can be obtained using 'lspci -t'. Using a path
250 * device and function address.
252 * Returns 1 if the string matches the device, 0 if it does not and
287 * device which should hold a reference to the bridge,
320 * pci_dev_str_match - test if a string matches a device
321 * @dev: the PCI device to test
322 * @p: string to match the device against
326 * PCI device. The string may be of one of the following formats:
328 * [<domain>:]<bus>:<device>.<func>[/<device>.<func>]*
329 * pci:<vendor>:<device>[:<subvendor>:<subdevice>]
331 * The first format specifies a PCI bus/device/function address which
335 * bus renumbering issues, a path of PCI device/function numbers may be used
336 * to address the specific device. The path for a device can be determined
346 * Returns 1 if the string matches the device, 0 if it does not and
354 unsigned short vendor, device, subsystem_vendor, subsystem_device;
357 /* PCI vendor/device (subvendor/subdevice) IDs are specified */
359 ret = sscanf(p, "%hx:%hx:%hx:%hx%n", &vendor, &device,
362 ret = sscanf(p, "%hx:%hx%n", &vendor, &device, &count);
373 (!device || device == dev->device) &&
460 * @dev: PCI device to query
463 * Tell if a device supports a given PCI capability.
465 * device's PCI configuration space or 0 in case the device does not
492 * @devfn: PCI device to query
499 * device's PCI configuration space or 0 in case the device does not
519 * @dev: PCI device to query
524 * within the device's PCI configuration space or 0 if the device does
571 * @dev: PCI device to query
575 * within the device's PCI configuration space or 0 if the device does
591 * @dev: PCI device to query
651 * pci_find_next_ht_capability - query a device's Hypertransport capabilities
652 * @dev: PCI device to query
670 * pci_find_ht_capability - query a device's Hypertransport capabilities
671 * @dev: PCI device to query
674 * Tell if a device supports a given Hypertransport capability.
675 * Returns an address within the device's PCI configuration space
676 * or 0 in case the device does not support the request capability.
695 * @dev: PCI device structure contains resources to be searched
698 * For given resource region of given device, return the resource region of
737 * pci_find_resource - Return matching PCI device resource
738 * @dev: PCI device to query
762 * @dev: the PCI device to operate on
800 * @dev: the PCI device
858 * @dev: the PCI device
894 * @dev: the PCI device
918 * pci_restore_bars - restore a device's BAR values (e.g. after wake-up)
919 * @dev: PCI device to have its BARs restored
921 * Restore the BAR values for a given device, so as to make it
991 * given PCI device
992 * @dev: PCI device to handle.
993 * @state: PCI power state (D0, D1, D2, D3hot) to put the device into.
997 * -EIO if device does not support PCI PM or its PM capabilities register has a
998 * wrong version, or device doesn't support the requested state.
999 * 0 if device already is in the requested state.
1000 * 0 if device's power state has been successfully changed.
1031 /* Check if this device supports the desired state */
1089 * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning
1097 * restore at least the BARs so that the device will be
1110 * pci_update_current_state - Read power state of given device and cache it
1111 * @dev: PCI device to handle.
1112 * @state: State to cache in case the device doesn't have the PM capability
1117 * reports an incorrect state or the device isn't power manageable by the
1137 * pci_refresh_power_state - Refresh the given device's power state data
1138 * @dev: Target PCI device.
1152 * pci_platform_power_transition - Use platform to change device power state
1153 * @dev: PCI device to handle.
1154 * @state: State to put the device into.
1175 * pci_wakeup - Wake up a PCI device
1202 * After reset, the device should not silently discard config
1209 * Wait for the device to return a non-CRS completion. Read the
1238 * pci_power_up - Put the given device into D0
1239 * @dev: PCI device to power up
1263 * __pci_dev_set_current_state - Set current state of a PCI device
1287 * pci_set_power_state - Set the power state of a PCI device
1288 * @dev: PCI device to handle.
1289 * @state: PCI power state (D0, D1, D2, D3hot) to put the device into.
1291 * Transition a device to a new power state, using the platform firmware and/or
1292 * the device's PCI PM registers.
1296 * -EIO if device does not support PCI PM or its PM capabilities register has a
1297 * wrong version, or device doesn't support the requested state.
1299 * 0 if device already is in the requested state.
1301 * 0 if device's power state has been successfully changed.
1315 * If the device or the parent bridge do not support PCI
1330 * This device is quirked not to be put into D3, so don't put it in
1337 * To put device in D3cold, we put device into D3hot in native
1338 * way, then put device into D3cold with platform ops
1355 * pci_choose_state - Choose the power state of a PCI device
1356 * @dev: PCI device to be suspended
1360 * Returns PCI power state suitable for given device and given system
1540 * pci_save_state - save the PCI configuration space of a device before
1542 * @dev: PCI device that we're dealing with
1656 * pci_restore_state - Restore the saved state of a PCI device
1657 * @dev: PCI device that we're dealing with
1701 * the device saved state.
1702 * @dev: PCI device that we're dealing with
1742 * @dev: PCI device that we're dealing with
1779 * @dev: PCI device that we're dealing with
1832 * pci_reenable_device - Resume abandoned device
1833 * @dev: PCI device to be resumed
1876 * boot or a device removal call. So get the current power state
1878 * (e.g. if the device really is in D0 at enable time).
1904 * pci_enable_device_io - Initialize a device for use with IO space
1905 * @dev: PCI device to be initialized
1907 * Initialize device before it's used by a driver. Ask low-level code
1908 * to enable I/O resources. Wake up the device if it was suspended.
1918 * pci_enable_device_mem - Initialize a device for use with Memory space
1919 * @dev: PCI device to be initialized
1921 * Initialize device before it's used by a driver. Ask low-level code
1922 * to enable Memory resources. Wake up the device if it was suspended.
1932 * pci_enable_device - Initialize device before it's used by a driver.
1933 * @dev: PCI device to be initialized
1935 * Initialize device before it's used by a driver. Ask low-level code
1936 * to enable I/O and memory. Wake up the device if it was suspended.
1939 * Note we don't actually enable the device many times if we call
1949 * Managed PCI resources. This manages device on/off, INTx/MSI/MSI-X
1952 * when a device is enabled using managed PCI device enable interface.
1963 static void pcim_release(struct device *gendev, void *res)
2011 * @pdev: PCI device to be initialized
2036 * pcim_pin_device - Pin managed PCI device
2037 * @pdev: PCI device to pin
2039 * Pin managed PCI device @pdev. Pinned device won't be disabled on
2055 * pcibios_add_device - provide arch specific hooks when adding device dev
2056 * @dev: the PCI device being added
2069 * device dev
2070 * @dev: the PCI device being released
2079 * pcibios_disable_device - disable arch specific PCI resources for device dev
2080 * @dev: the PCI device to disable
2082 * Disables architecture specific PCI resources for the device. This
2113 * pci_disable_enabled_device - Disable device without updating enable_cnt
2114 * @dev: PCI device to disable
2126 * pci_disable_device - Disable PCI device after use
2127 * @dev: PCI device to be disabled
2129 * Signal to the system that the PCI device is not in use by the system
2132 * Note we don't actually disable the device until all callers of
2144 "disabling already-disabled device");
2156 * pcibios_set_pcie_reset_state - set reset state for device dev
2157 * @dev: the PCIe device reset
2160 * Set the PCIe reset state for the device. This is the default
2170 * pci_set_pcie_reset_state - set reset state for device dev
2171 * @dev: the PCIe device reset
2174 * Sets the PCI reset state for the device.
2200 * pci_check_pme_status - Check if given device has generated PME.
2203 * Check the PME status of the device and if set, clear it and clear PME enable
2235 * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set.
2237 * @pme_poll_reset: Whether or not to reset the device's pme_poll flag.
2266 * pci_pme_capable - check the capability of PCI device to generate PME#
2267 * @dev: PCI device to handle.
2268 * @state: PCI state from which device will issue PME#.
2297 * If the device is in D3cold it should not be
2333 * @dev: PCI device to update.
2354 * pci_pme_active - enable or disable PCI device's PME# function
2355 * @dev: PCI device to handle.
2358 * The caller must verify that the device is capable of generating PME# before
2366 * PCI (as opposed to PCIe) PME requires that the device have
2368 * do this, so the PME never gets delivered and the device
2420 * __pci_enable_wake - enable PCI device as wakeup event source
2421 * @dev: PCI device affected
2422 * @state: PCI state from which device will issue wakeup events
2425 * This enables the device as a wakeup event source, or disables it.
2434 * -EINVAL is returned if device is not supposed to wake up the system
2452 /* Don't do the same thing twice in a row for one device. */
2466 * Enable PME signaling if the device can signal PME from
2470 * the device itself ends up in D3cold as a result of that.
2491 * pci_enable_wake - change wakeup settings for a PCI device
2492 * @pci_dev: Target device
2493 * @state: PCI state from which device will issue wakeup events
2496 * If @enable is set, check device_may_wakeup() for the device before calling
2509 * pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold
2510 * @dev: PCI device to prepare
2513 * Many drivers want the device to wake up the system from D3_hot or D3_cold
2518 * This function only returns error code if the device is not allowed to wake
2532 * @dev: PCI device
2533 * @wakeup: Whether or not wakeup functionality will be enabled for the device.
2545 * Call the platform to find the target state for the device.
2569 * If the device is in D3cold even though it's not power-manageable by
2580 * Find the deepest state from which the device can generate
2596 * pci_prepare_to_sleep - prepare PCI device for system-wide transition
2600 * Choose the power state appropriate for the device depending on whether
2602 * (PCI_D3hot is the default) and put the device into that state.
2625 * pci_back_from_sleep - turn PCI device on during system-wide transition
2629 * Disable device's system wake-up capability and put it into D0.
2640 * @dev: PCI device being suspended.
2669 * pci_dev_run_wake - Check if device can generate run-time wake-up events.
2672 * Return true if the device itself is capable of generating wake-up events
2673 * (through the platform or using the native PCIe PME) or if the device supports
2708 * pci_dev_need_resume - Check if it is necessary to resume the device.
2711 * Return 'true' if the device is not runtime-suspended or it has to be
2718 struct device *dev = &pci_dev->dev;
2728 * removal on top of D3hot, so no need to resume the device in that
2737 * pci_dev_adjust_pme - Adjust PME setting for a suspended device.
2740 * If the device is suspended and it is not configured for system wakeup,
2743 * Note that if the device's power state is D3cold and the platform check in
2744 * pci_dev_need_resume() has not triggered, the device's configuration need not
2749 struct device *dev = &pci_dev->dev;
2761 * pci_dev_complete_resume - Finalize resume from system sleep for a device.
2764 * If the device is runtime suspended and wakeup-capable, enable PME for it as
2766 * the device was not configured for system wakeup.
2770 struct device *dev = &pci_dev->dev;
2785 struct device *dev = &pdev->dev;
2786 struct device *parent = dev->parent;
2807 struct device *dev = &pdev->dev;
2808 struct device *parent = dev->parent;
2832 * Downstream device is not accessible after putting a root port
2910 if (/* The device needs to be allowed to go D3cold ... */
2927 * @dev: PCI device which is changed
2930 * device PM configuration was changed or the device is being removed. The
2953 * we only need to check that single device, not any of its siblings.
2955 * If D3 is currently not allowed for the bridge, checking the device
2963 * either by the device being changed/removed or any of its siblings,
2979 * pci_d3cold_enable - Enable D3cold for device
2980 * @dev: PCI device to handle
2982 * This function can be used in drivers to enable D3cold from the device
2996 * pci_d3cold_disable - Disable D3cold for device
2997 * @dev: PCI device to handle
2999 * This function can be used in drivers to disable D3cold from the device
3013 * pci_pm_init - Initialize PM functions of given PCI device
3014 * @dev: PCI device to handle.
3035 /* Check device's ability to generate PME# */
3075 * Make device's PM flags reflect the wake-up capability, but
3288 * @dev: the PCI device
3331 * @dev: the PCI device
3365 * @dev: the PCI device
3419 * pci_acs_enabled - test ACS against required flags for a given device
3420 * @pdev: device to test
3423 * Return true if the device supports the provided flags. Automatically
3427 * device rather than the actual capabilities. For instance, most single
3430 * regardless of whether the device exposes an ACS capability. This makes
3432 * or topology of the device when testing ACS support.
3445 * any device on the bus can receive or snoop DMA.
3454 * handle them as we would a non-PCIe device.
3478 * device. The footnote for section 6.12 indicates the specific
3500 * @start: starting downstream device
3501 * @end: ending upstream device or NULL to search to the root bus
3504 * Walk up a device tree from start to end testing PCI ACS support. If
3529 * @dev: the PCI device
3546 * @pdev: PCI device
3580 * @pdev: PCI device
3599 if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
3608 * @pdev: PCI device
3629 * @pdev: PCI device
3654 * @dev: the PCI device
3728 * pci_swizzle_interrupt_pin - swizzle INTx for device behind bridge
3729 * @dev: the PCI device
3732 * Perform INTx swizzling for a device behind one level of bridge. This is
3768 * @dev: the PCI device
3771 * Perform INTx swizzling for a device. This traverses through all PCI-to-PCI
3789 * @pdev: PCI device whose resources were previously reserved by
3818 * @pdev: PCI device whose resources are to be reserved
3823 * Mark the PCI region associated with PCI device @pdev BAR @bar as
3868 * @pdev: PCI device whose resources are to be reserved
3872 * Mark the PCI region associated with PCI device @pdev BAR @bar as
3888 * @pdev: PCI device whose resources were previously reserved
3926 * @pdev: PCI device whose resources are to be reserved
3947 * @pdev: PCI device whose resources were previously reserved by
3963 * @pdev: PCI device whose resources are to be reserved
3966 * Mark all PCI regions associated with PCI device @pdev as
3983 * @pdev: PCI device whose resources are to be reserved
3986 * Mark all PCI regions associated with PCI device @pdev as being reserved
4117 static void devm_pci_unmap_iospace(struct device *dev, void *ptr)
4126 * @dev: Generic device to remap IO address for
4133 int devm_pci_remap_iospace(struct device *dev, const struct resource *res,
4157 * @dev: Generic device to remap IO address for
4164 void __iomem *devm_pci_remap_cfgspace(struct device *dev,
4187 * @dev: generic device to handle the resource for
4204 void __iomem *devm_pci_remap_cfg_resource(struct device *dev,
4267 * pcibios_set_master - enable PCI bus-mastering for device dev
4268 * @dev: the PCI device to enable
4270 * Enables PCI bus-mastering for the device. This is the default
4294 * pci_set_master - enables bus-mastering for device dev
4295 * @dev: the PCI device to enable
4297 * Enables bus-mastering on the device and calls pcibios_set_master()
4308 * pci_clear_master - disables bus-mastering for device dev
4309 * @dev: the PCI device to disable
4319 * @dev: the PCI device for which MWI is to be enabled
4357 * @dev: the PCI device for which MWI is enabled
4387 * pcim_set_mwi - a device-managed pci_set_mwi()
4388 * @dev: the PCI device for which MWI is enabled
4409 * @dev: the PCI device for which MWI is enabled
4427 * pci_clear_mwi - disables Memory-Write-Invalidate for device dev
4428 * @dev: the PCI device to disable
4430 * Disables PCI Memory-Write-Invalidate transaction on the device
4447 * pci_intx - enables/disables PCI INTx for device dev
4448 * @pdev: the PCI device to operate on
4451 * Enables/disables PCI INTx for device @pdev
4501 * Check interrupt status register to see whether our device
4525 * @dev: the PCI device to operate on
4527 * Check if the device dev has its INTx line asserted, mask it and return
4538 * @dev: the PCI device to operate on
4540 * Check if the device dev has its INTx line asserted, unmask it if not and
4552 * @dev: the PCI device to operate on
4567 * pcie_has_flr - check if a device supports function level resets
4568 * @dev: device to check
4570 * Returns true if the device advertises support for PCIe function level
4587 * @dev: device to reset
4590 * device supports FLR before calling this function, e.g. by using the
4604 * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within
4606 * progress. Wait 100ms before trying to access the device.
4649 * updated 27 July 2006; a device must complete an FLR within
4651 * progress. Wait 100ms before trying to access the device.
4659 * pci_pm_reset - Put device into PCI_D3 and back into PCI_D0.
4661 * @probe: If set, only check if the device can be reset this way.
4665 * PCI_D0. If that's the case and the device is not in a low-power state
4668 * NOTE: This causes the caller to sleep for twice the device power transition
4705 * @pdev: Bridge device
4733 * If the link fails to activate, either the device was physically
4756 * @pdev: Bridge device
4803 * Return 0 on success or -ENOTTY if the first device on the secondary bus
4844 * accessing the device after reset (that is 1000 ms + 100 ms).
4860 * device that did not respond is a broken device. There is
4866 * Therefore we wait for 100 ms and check for the device presence
4918 * @dev: Bridge device
5006 * races with ->remove() by the device lock, which must be held by
5013 * Wake-up device prior to save. PM registers default to D0 after
5021 * Disable the device by clearing the Command register, except for
5023 * BARs, but also prevents the device from being Bus Master, preventing
5024 * DMA from the device including MSI/MSI-X interrupts. For PCI 2.3
5039 * races with ->remove() by the device lock, which must be held by
5047 * __pci_reset_function_locked - reset a PCI device function while holding
5049 * @dev: PCI device to reset
5052 * other functions in the same device. The PCI device must be responsive
5055 * The device function is presumed to be unused and the caller is holding
5056 * the device mutex lock when this function is called.
5058 * Resetting the device will make the contents of PCI configuration space
5060 * device including MSI, bus mastering, BARs, decoding IO and memory spaces,
5063 * Returns 0 if the device function was successfully reset or negative if the
5064 * device doesn't support resetting a single function.
5073 * A reset method returns -ENOTTY if it doesn't support this device
5078 * reset mechanisms might be broken on the device.
5102 * pci_probe_reset_function - check whether the device can be safely reset
5103 * @dev: PCI device to reset
5106 * other functions in the same device. The PCI device must be responsive
5109 * Returns 0 if the device function can be reset or negative if the
5110 * device doesn't support resetting a single function.
5137 * pci_reset_function - quiesce and reset a PCI device function
5138 * @dev: PCI device to reset
5141 * other functions in the same device. The PCI device must be responsive
5144 * This function does not just reset the PCI portion of a device, but
5145 * clears all the state associated with the device. This function differs
5146 * from __pci_reset_function_locked() in that it saves and restores device state
5147 * over the reset and takes the PCI device lock.
5149 * Returns 0 if the device function was successfully reset or negative if the
5150 * device doesn't support resetting a single function.
5172 * pci_reset_function_locked - quiesce and reset a PCI device function
5173 * @dev: PCI device to reset
5176 * other functions in the same device. The PCI device must be responsive
5179 * This function does not just reset the PCI portion of a device, but
5180 * clears all the state associated with the device. This function differs
5181 * from __pci_reset_function_locked() in that it saves and restores device state
5183 * requires the PCI device lock to be held.
5185 * Returns 0 if the device function was successfully reset or negative if the
5186 * device doesn't support resetting a single function.
5206 * pci_try_reset_function - quiesce and reset a PCI device function
5207 * @dev: PCI device to reset
5209 * Same as above, except return -EAGAIN if unable to lock device.
5540 * @bridge: The parent device that connects to the bus to reset
5613 * @pdev: top level PCI device to reset via slot/bus
5626 * @dev: PCI device to query
5649 * @dev: PCI device to query
5672 * @dev: PCI device to query
5719 * @dev: PCI device to query
5735 * @dev: PCI device to query
5782 * @dev: PCI device to query
5798 * @dev: PCI device to query
5826 * device and its bandwidth limitation
5827 * @dev: PCI device to query
5828 * @limiting_dev: storage for device causing the bandwidth limitation
5829 * @speed: storage for speed of limiting device
5830 * @width: storage for width of limiting device
5832 * Walk up the PCI device chain and find the point where the minimum
5863 /* Check if current device limits the total bandwidth */
5883 * pcie_get_speed_cap - query for the PCI device's link speed capability
5884 * @dev: PCI device to query
5886 * Query the PCI device speed capability. Return the maximum link speed
5887 * supported by the device.
5919 * pcie_get_width_cap - query for the PCI device's link width capability
5920 * @dev: PCI device to query
5922 * Query the PCI device width capability. Return the maximum link width
5923 * supported by the device.
5938 * pcie_bandwidth_capable - calculate a PCI device's link bandwidth capability
5939 * @dev: PCI device
5943 * Calculate a PCI device's link bandwidth by querying for its link speed
5960 * __pcie_print_link_status - Report the PCI device's link speed and width
5961 * @dev: PCI device to query
5964 * If the available bandwidth at the device is less than the device is
5965 * capable of, report the device's maximum possible bandwidth and the
5967 * the available bandwidth, even if the device isn't constrained.
5993 * pcie_print_link_status - Report the PCI device's link speed and width
5994 * @dev: PCI device to query
5996 * Report the available bandwidth at the device.
6006 * @dev: the PCI device for which BAR mask is made
6039 * pci_set_vga_state - set VGA decode state on device and parents if requested
6040 * @dev: the PCI device
6110 * pci_add_dma_alias - Add a DMA devfn alias for a device
6111 * @dev: the PCI device for which alias is added
6119 * from their logical bus-devfn. Examples include device quirks where the
6120 * device simply uses the wrong devfn, as well as non-transparent bridges
6123 * IOMMU group creation is performed during device discovery or addition,
6188 * pci_real_dma_dev - Get PCI DMA device for PCI device
6189 * @dev: the PCI device that may have a PCI DMA alias
6192 * devices needing to alias DMA to another PCI device on another PCI bus. If
6193 * the PCI device is on the same bus, it is recommended to use
6224 * @dev: the PCI device to get
6322 * region, but if we realign *every* resource of every device in
6348 * of the device specified by kernel's boot parameter 'pci=resource_alignment='.
6351 * to the device.
6370 /* check if specified PCI is target device to reassign */
6467 static int of_pci_bus_find_domain_nr(struct device *parent)
6516 int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)