Lines Matching defs:device
28 #include <linux/device.h>
77 * limit, but 60 sec ought to be enough for any device to become
150 * If we set up a device for bus mastering, we need to check the latency
161 /* If set, the PCI config space of each device is printed during boot. */
209 * @pdev: the PCI device
266 * pci_dev_str_match_path - test if a path string matches a device
267 * @dev: the PCI device to test
268 * @path: string to match the device against
272 * path of device/function addresses matches a PCI device. The string must
275 * [<domain>:]<bus>:<device>.<func>[/<device>.<func>]*
277 * A path for a device can be obtained using 'lspci -t'. Using a path
279 * device and function address.
281 * Returns 1 if the string matches the device, 0 if it does not and
316 * device which should hold a reference to the bridge,
349 * pci_dev_str_match - test if a string matches a device
350 * @dev: the PCI device to test
351 * @p: string to match the device against
355 * PCI device. The string may be of one of the following formats:
357 * [<domain>:]<bus>:<device>.<func>[/<device>.<func>]*
358 * pci:<vendor>:<device>[:<subvendor>:<subdevice>]
360 * The first format specifies a PCI bus/device/function address which
364 * bus renumbering issues, a path of PCI device/function numbers may be used
365 * to address the specific device. The path for a device can be determined
375 * Returns 1 if the string matches the device, 0 if it does not and
383 unsigned short vendor, device, subsystem_vendor, subsystem_device;
386 /* PCI vendor/device (subvendor/subdevice) IDs are specified */
388 ret = sscanf(p, "%hx:%hx:%hx:%hx%n", &vendor, &device,
391 ret = sscanf(p, "%hx:%hx%n", &vendor, &device, &count);
402 (!device || device == dev->device) &&
489 * @dev: PCI device to query
492 * Tell if a device supports a given PCI capability.
494 * device's PCI configuration space or 0 in case the device does not
521 * @devfn: PCI device to query
528 * device's PCI configuration space or 0 in case the device does not
547 * @dev: PCI device to query
552 * within the device's PCI configuration space or 0 if the device does
599 * @dev: PCI device to query
603 * within the device's PCI configuration space or 0 if the device does
619 * @dev: PCI device to query
680 * pci_find_next_ht_capability - query a device's HyperTransport capabilities
681 * @dev: PCI device to query
699 * pci_find_ht_capability - query a device's HyperTransport capabilities
700 * @dev: PCI device to query
703 * Tell if a device supports a given HyperTransport capability.
704 * Returns an address within the device's PCI configuration space
705 * or 0 in case the device does not support the request capability.
723 * @dev: PCI device to query
756 * @dev: PCI device to query
789 * @dev: PCI device structure contains resources to be searched
792 * For given resource region of given device, return the resource region of
830 * pci_find_resource - Return matching PCI device resource
831 * @dev: PCI device to query
855 * @dev: the PCI device to operate on
893 * @dev: the PCI device
951 * @dev: the PCI device
987 * @dev: the PCI device
1011 * pci_restore_bars - restore a device's BAR values (e.g. after wake-up)
1012 * @dev: PCI device to have its BARs restored
1014 * Restore the BAR values for a given device, so as to make it
1089 * pci_update_current_state - Read power state of given device and cache it
1090 * @dev: PCI device to handle.
1091 * @state: State to cache in case the device doesn't have the PM capability
1096 * reports an incorrect state or the device isn't power manageable by the
1119 * pci_refresh_power_state - Refresh the given device's power state data
1120 * @dev: Target PCI device.
1132 * pci_platform_power_transition - Use platform to change device power state
1133 * @dev: PCI device to handle.
1134 * @state: State to put the device into.
1179 * After reset, the device should not silently discard config
1186 * Wait for the device to return a non-CRS completion. Read the
1227 * pci_power_up - Put the given device into D0
1228 * @dev: PCI device to power up
1231 * restore the device's BARs subsequently (1 is returned in that case).
1235 * put the device in D0 via non-PCI means.
1257 pci_err(dev, "Unable to change power state from %s to D0, device inaccessible\n",
1292 * pci_set_full_power_state - Put a PCI device into D0 and update its state
1293 * @dev: PCI device to power up
1324 * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning
1332 * restore at least the BARs so that the device will be
1345 * __pci_dev_set_current_state - Set current state of a PCI device
1369 * pci_set_low_power_state - Put a PCI device into a low-power state.
1370 * @dev: PCI device to handle.
1371 * @state: PCI power state (D1, D2, D3hot) to put the device into.
1373 * Use the device's PCI_PM_CTRL register to put it into a low-power state.
1377 * -EIO if device does not support PCI PM or its PM capabilities register has a
1378 * wrong version, or device doesn't support the requested state.
1379 * 0 if device already is in the requested state.
1380 * 0 if device's power state has been successfully changed.
1402 /* Check if this device supports the desired state */
1409 pci_err(dev, "Unable to change power state from %s to %s, device inaccessible\n",
1442 * pci_set_power_state - Set the power state of a PCI device
1443 * @dev: PCI device to handle.
1444 * @state: PCI power state (D0, D1, D2, D3hot) to put the device into.
1446 * Transition a device to a new power state, using the platform firmware and/or
1447 * the device's PCI PM registers.
1451 * -EIO if device does not support PCI PM or its PM capabilities register has a
1452 * wrong version, or device doesn't support the requested state.
1454 * 0 if device already is in the requested state.
1456 * 0 if device's power state has been successfully changed.
1470 * If the device or the parent bridge do not support PCI
1485 * This device is quirked not to be put into D3, so don't put it in
1493 * To put the device in D3cold, put it into D3hot in the native
1596 * Check and re-configure the bit here before restoring device.
1688 * pci_save_state - save the PCI configuration space of a device before
1690 * @dev: PCI device that we're dealing with
1805 * pci_restore_state - Restore the saved state of a PCI device
1806 * @dev: PCI device that we're dealing with
1851 * the device saved state.
1852 * @dev: PCI device that we're dealing with
1892 * @dev: PCI device that we're dealing with
1929 * @dev: PCI device that we're dealing with
1982 * pci_reenable_device - Resume abandoned device
1983 * @dev: PCI device to be resumed
2026 * boot or a device removal call. So get the current power state
2028 * (e.g. if the device really is in D0 at enable time).
2054 * pci_enable_device_io - Initialize a device for use with IO space
2055 * @dev: PCI device to be initialized
2057 * Initialize device before it's used by a driver. Ask low-level code
2058 * to enable I/O resources. Wake up the device if it was suspended.
2068 * pci_enable_device_mem - Initialize a device for use with Memory space
2069 * @dev: PCI device to be initialized
2071 * Initialize device before it's used by a driver. Ask low-level code
2072 * to enable Memory resources. Wake up the device if it was suspended.
2082 * pci_enable_device - Initialize device before it's used by a driver.
2083 * @dev: PCI device to be initialized
2085 * Initialize device before it's used by a driver. Ask low-level code
2086 * to enable I/O and memory. Wake up the device if it was suspended.
2089 * Note we don't actually enable the device many times if we call
2099 * Managed PCI resources. This manages device on/off, INTx/MSI/MSI-X
2102 * when a device is enabled using managed PCI device enable interface.
2113 static void pcim_release(struct device *gendev, void *res)
2156 * @pdev: PCI device to be initialized
2181 * pcim_pin_device - Pin managed PCI device
2182 * @pdev: PCI device to pin
2184 * Pin managed PCI device @pdev. Pinned device won't be disabled on
2200 * pcibios_device_add - provide arch specific hooks when adding device dev
2201 * @dev: the PCI device being added
2214 * device dev
2215 * @dev: the PCI device being released
2224 * pcibios_disable_device - disable arch specific PCI resources for device dev
2225 * @dev: the PCI device to disable
2227 * Disables architecture specific PCI resources for the device. This
2258 * pci_disable_enabled_device - Disable device without updating enable_cnt
2259 * @dev: PCI device to disable
2271 * pci_disable_device - Disable PCI device after use
2272 * @dev: PCI device to be disabled
2274 * Signal to the system that the PCI device is not in use by the system
2277 * Note we don't actually disable the device until all callers of
2289 "disabling already-disabled device");
2301 * pcibios_set_pcie_reset_state - set reset state for device dev
2302 * @dev: the PCIe device reset
2305 * Set the PCIe reset state for the device. This is the default
2315 * pci_set_pcie_reset_state - set reset state for device dev
2316 * @dev: the PCIe device reset
2319 * Sets the PCI reset state for the device.
2347 * pci_check_pme_status - Check if given device has generated PME.
2350 * Check the PME status of the device and if set, clear it and clear PME enable
2382 * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set.
2384 * @pme_poll_reset: Whether or not to reset the device's pme_poll flag.
2413 * pci_pme_capable - check the capability of PCI device to generate PME#
2414 * @dev: PCI device to handle.
2415 * @state: PCI state from which device will issue PME#.
2436 struct device *dev = &pdev->dev;
2437 struct device *bdev = bridge ? &bridge->dev : NULL;
2456 * The device itself should be suspended but config
2496 * @dev: PCI device to update.
2517 * pci_pme_active - enable or disable PCI device's PME# function
2518 * @dev: PCI device to handle.
2521 * The caller must verify that the device is capable of generating PME# before
2529 * PCI (as opposed to PCIe) PME requires that the device have
2531 * do this, so the PME never gets delivered and the device
2583 * __pci_enable_wake - enable PCI device as wakeup event source
2584 * @dev: PCI device affected
2585 * @state: PCI state from which device will issue wakeup events
2588 * This enables the device as a wakeup event source, or disables it.
2597 * -EINVAL is returned if device is not supposed to wake up the system
2615 /* Don't do the same thing twice in a row for one device. */
2629 * Enable PME signaling if the device can signal PME from
2633 * the device itself ends up in D3cold as a result of that.
2654 * pci_enable_wake - change wakeup settings for a PCI device
2655 * @pci_dev: Target device
2656 * @state: PCI state from which device will issue wakeup events
2659 * If @enable is set, check device_may_wakeup() for the device before calling
2672 * pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold
2673 * @dev: PCI device to prepare
2676 * Many drivers want the device to wake up the system from D3_hot or D3_cold
2681 * This function only returns error code if the device is not allowed to wake
2695 * @dev: PCI device
2696 * @wakeup: Whether or not wakeup functionality will be enabled for the device.
2706 * Call the platform to find the target state for the device.
2725 * If the device is in D3cold even though it's not power-manageable by
2738 * Find the deepest state from which the device can generate
2754 * pci_prepare_to_sleep - prepare PCI device for system-wide transition
2758 * Choose the power state appropriate for the device depending on whether
2760 * (PCI_D3hot is the default) and put the device into that state.
2783 * pci_back_from_sleep - turn PCI device on during system-wide transition
2787 * Disable device's system wake-up capability and put it into D0.
2803 * @dev: PCI device being suspended.
2828 * pci_dev_run_wake - Check if device can generate run-time wake-up events.
2831 * Return true if the device itself is capable of generating wake-up events
2832 * (through the platform or using the native PCIe PME) or if the device supports
2867 * pci_dev_need_resume - Check if it is necessary to resume the device.
2870 * Return 'true' if the device is not runtime-suspended or it has to be
2877 struct device *dev = &pci_dev->dev;
2887 * removal on top of D3hot, so no need to resume the device in that
2896 * pci_dev_adjust_pme - Adjust PME setting for a suspended device.
2899 * If the device is suspended and it is not configured for system wakeup,
2902 * Note that if the device's power state is D3cold and the platform check in
2903 * pci_dev_need_resume() has not triggered, the device's configuration need not
2908 struct device *dev = &pci_dev->dev;
2920 * pci_dev_complete_resume - Finalize resume from system sleep for a device.
2923 * If the device is runtime suspended and wakeup-capable, enable PME for it as
2925 * the device was not configured for system wakeup.
2929 struct device *dev = &pci_dev->dev;
2943 * pci_choose_state - Choose the power state of a PCI device.
2944 * @dev: Target PCI device.
2960 struct device *dev = &pdev->dev;
2961 struct device *parent = dev->parent;
2982 struct device *dev = &pdev->dev;
2983 struct device *parent = dev->parent;
3007 * Downstream device is not accessible after putting a root port
3085 if (/* The device needs to be allowed to go D3cold ... */
3102 * @dev: PCI device which is changed
3105 * device PM configuration was changed or the device is being removed. The
3128 * we only need to check that single device, not any of its siblings.
3130 * If D3 is currently not allowed for the bridge, checking the device
3138 * either by the device being changed/removed or any of its siblings,
3154 * pci_d3cold_enable - Enable D3cold for device
3155 * @dev: PCI device to handle
3157 * This function can be used in drivers to enable D3cold from the device
3171 * pci_d3cold_disable - Disable D3cold for device
3172 * @dev: PCI device to handle
3174 * This function can be used in drivers to disable D3cold from the device
3188 * pci_pm_init - Initialize PM functions of given PCI device
3189 * @dev: PCI device to handle.
3210 /* Check device's ability to generate PME# */
3250 * Make device's PM flags reflect the wake-up capability, but
3463 * @dev: the PCI device
3506 * @dev: the PCI device
3540 * @dev: the PCI device
3594 * pci_acs_enabled - test ACS against required flags for a given device
3595 * @pdev: device to test
3598 * Return true if the device supports the provided flags. Automatically
3602 * device rather than the actual capabilities. For instance, most single
3605 * regardless of whether the device exposes an ACS capability. This makes
3607 * or topology of the device when testing ACS support.
3620 * any device on the bus can receive or snoop DMA.
3629 * handle them as we would a non-PCIe device.
3653 * device. The footnote for section 6.12 indicates the specific
3675 * @start: starting downstream device
3676 * @end: ending upstream device or NULL to search to the root bus
3679 * Walk up a device tree from start to end testing PCI ACS support. If
3704 * @dev: the PCI device
3721 * @pdev: PCI device
3755 * @pdev: PCI device
3774 if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
3784 * @pdev: PCI device
3805 * @pdev: PCI device
3830 * @dev: the PCI device
3912 * pci_swizzle_interrupt_pin - swizzle INTx for device behind bridge
3913 * @dev: the PCI device
3916 * Perform INTx swizzling for a device behind one level of bridge. This is
3952 * @dev: the PCI device
3955 * Perform INTx swizzling for a device. This traverses through all PCI-to-PCI
3973 * @pdev: PCI device whose resources were previously reserved by
4002 * @pdev: PCI device whose resources are to be reserved
4007 * Mark the PCI region associated with PCI device @pdev BAR @bar as
4052 * @pdev: PCI device whose resources are to be reserved
4056 * Mark the PCI region associated with PCI device @pdev BAR @bar as
4072 * @pdev: PCI device whose resources were previously reserved
4110 * @pdev: PCI device whose resources are to be reserved
4131 * @pdev: PCI device whose resources were previously reserved by
4147 * @pdev: PCI device whose resources are to be reserved
4150 * Mark all PCI regions associated with PCI device @pdev as
4167 * @pdev: PCI device whose resources are to be reserved
4170 * Mark all PCI regions associated with PCI device @pdev as being reserved
4299 static void devm_pci_unmap_iospace(struct device *dev, void *ptr)
4308 * @dev: Generic device to remap IO address for
4315 int devm_pci_remap_iospace(struct device *dev, const struct resource *res,
4339 * @dev: Generic device to remap IO address for
4346 void __iomem *devm_pci_remap_cfgspace(struct device *dev,
4369 * @dev: generic device to handle the resource for
4386 void __iomem *devm_pci_remap_cfg_resource(struct device *dev,
4456 * pcibios_set_master - enable PCI bus-mastering for device dev
4457 * @dev: the PCI device to enable
4459 * Enables PCI bus-mastering for the device. This is the default
4483 * pci_set_master - enables bus-mastering for device dev
4484 * @dev: the PCI device to enable
4486 * Enables bus-mastering on the device and calls pcibios_set_master()
4497 * pci_clear_master - disables bus-mastering for device dev
4498 * @dev: the PCI device to disable
4508 * @dev: the PCI device for which MWI is to be enabled
4546 * @dev: the PCI device for which MWI is enabled
4576 * pcim_set_mwi - a device-managed pci_set_mwi()
4577 * @dev: the PCI device for which MWI is enabled
4598 * @dev: the PCI device for which MWI is enabled
4616 * pci_clear_mwi - disables Memory-Write-Invalidate for device dev
4617 * @dev: the PCI device to disable
4619 * Disables PCI Memory-Write-Invalidate transaction on the device
4636 * pci_disable_parity - disable parity checking for device
4637 * @dev: the PCI device to operate on
4639 * Disable parity checking for device @dev
4653 * pci_intx - enables/disables PCI INTx for device dev
4654 * @pdev: the PCI device to operate on
4657 * Enables/disables PCI INTx for device @pdev
4707 * Check interrupt status register to see whether our device
4731 * @dev: the PCI device to operate on
4733 * Check if the device dev has its INTx line asserted, mask it and return
4744 * @dev: the PCI device to operate on
4746 * Check if the device dev has its INTx line asserted, unmask it if not and
4758 * @dev: the PCI device to operate on
4774 * @dev: device to reset
4790 * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within
4792 * progress. Wait 100ms before trying to access the device.
4802 * @dev: device to reset
4803 * @probe: if true, return 0 if device can be reset this way
4857 * updated 27 July 2006; a device must complete an FLR within
4859 * progress. Wait 100ms before trying to access the device.
4867 * pci_pm_reset - Put device into PCI_D3 and back into PCI_D0.
4869 * @probe: if true, return 0 if the device can be reset this way.
4873 * PCI_D0. If that's the case and the device is not in a low-power state
4876 * NOTE: This causes the caller to sleep for twice the device power transition
4982 * @pdev: Bridge device
5008 * If the link fails to activate, either the device was physically
5032 * @pdev: Bridge device
5078 * Return 0 on success or -ENOTTY if the first device on the secondary bus
5118 * accessing the device after reset (that is 1000 ms + 100 ms).
5134 * device that did not respond is a broken device. Also device can
5138 * Therefore we wait for 100 ms and check for the device presence
5156 * the assumption that the device is not present anymore.
5206 * @dev: Bridge device
5306 * races with ->remove() by the device lock, which must be held by
5313 * Wake-up device prior to save. PM registers default to D0 after
5321 * Disable the device by clearing the Command register, except for
5323 * BARs, but also prevents the device from being Bus Master, preventing
5324 * DMA from the device including MSI/MSI-X interrupts. For PCI 2.3
5339 * races with ->remove() by the device lock, which must be held by
5357 static ssize_t reset_method_show(struct device *dev,
5391 static ssize_t reset_method_store(struct device *dev,
5402 pci_warn(pdev, "All device reset methods disabled by user");
5480 * __pci_reset_function_locked - reset a PCI device function while holding
5482 * @dev: PCI device to reset
5485 * other functions in the same device. The PCI device must be responsive
5488 * The device function is presumed to be unused and the caller is holding
5489 * the device mutex lock when this function is called.
5491 * Resetting the device will make the contents of PCI configuration space
5493 * device including MSI, bus mastering, BARs, decoding IO and memory spaces,
5496 * Returns 0 if the device function was successfully reset or negative if the
5497 * device doesn't support resetting a single function.
5506 * A reset method returns -ENOTTY if it doesn't support this device and
5511 * mechanisms might be broken on the device.
5530 * pci_init_reset_methods - check whether device can be safely reset
5532 * @dev: PCI device to check for reset mechanisms
5535 * other functions in the same device. The PCI device must be in D0-D3hot
5538 * Stores reset mechanisms supported by device in reset_methods byte array
5562 * pci_reset_function - quiesce and reset a PCI device function
5563 * @dev: PCI device to reset
5566 * other functions in the same device. The PCI device must be responsive
5569 * This function does not just reset the PCI portion of a device, but
5570 * clears all the state associated with the device. This function differs
5571 * from __pci_reset_function_locked() in that it saves and restores device state
5572 * over the reset and takes the PCI device lock.
5574 * Returns 0 if the device function was successfully reset or negative if the
5575 * device doesn't support resetting a single function.
5597 * pci_reset_function_locked - quiesce and reset a PCI device function
5598 * @dev: PCI device to reset
5601 * other functions in the same device. The PCI device must be responsive
5604 * This function does not just reset the PCI portion of a device, but
5605 * clears all the state associated with the device. This function differs
5606 * from __pci_reset_function_locked() in that it saves and restores device state
5608 * requires the PCI device lock to be held.
5610 * Returns 0 if the device function was successfully reset or negative if the
5611 * device doesn't support resetting a single function.
5631 * pci_try_reset_function - quiesce and reset a PCI device function
5632 * @dev: PCI device to reset
5634 * Same as above, except return -EAGAIN if unable to lock device.
5958 * @bridge: The parent device that connects to the bus to reset
6031 * @pdev: top level PCI device to reset via slot/bus
6044 * @dev: PCI device to query
6067 * @dev: PCI device to query
6090 * @dev: PCI device to query
6137 * @dev: PCI device to query
6153 * @dev: PCI device to query
6200 * @dev: PCI device to query
6216 * @dev: PCI device to query
6244 * device and its bandwidth limitation
6245 * @dev: PCI device to query
6246 * @limiting_dev: storage for device causing the bandwidth limitation
6247 * @speed: storage for speed of limiting device
6248 * @width: storage for width of limiting device
6250 * Walk up the PCI device chain and find the point where the minimum
6280 /* Check if current device limits the total bandwidth */
6300 * pcie_get_speed_cap - query for the PCI device's link speed capability
6301 * @dev: PCI device to query
6303 * Query the PCI device speed capability. Return the maximum link speed
6304 * supported by the device.
6336 * pcie_get_width_cap - query for the PCI device's link width capability
6337 * @dev: PCI device to query
6339 * Query the PCI device width capability. Return the maximum link width
6340 * supported by the device.
6355 * pcie_bandwidth_capable - calculate a PCI device's link bandwidth capability
6356 * @dev: PCI device
6360 * Calculate a PCI device's link bandwidth by querying for its link speed
6377 * __pcie_print_link_status - Report the PCI device's link speed and width
6378 * @dev: PCI device to query
6381 * If the available bandwidth at the device is less than the device is
6382 * capable of, report the device's maximum possible bandwidth and the
6384 * the available bandwidth, even if the device isn't constrained.
6410 * pcie_print_link_status - Report the PCI device's link speed and width
6411 * @dev: PCI device to query
6413 * Report the available bandwidth at the device.
6423 * @dev: the PCI device for which BAR mask is made
6456 * pci_set_vga_state - set VGA decode state on device and parents if requested
6457 * @dev: the PCI device
6527 * pci_add_dma_alias - Add a DMA devfn alias for a device
6528 * @dev: the PCI device for which alias is added
6536 * from their logical bus-devfn. Examples include device quirks where the
6537 * device simply uses the wrong devfn, as well as non-transparent bridges
6540 * IOMMU group creation is performed during device discovery or addition,
6606 * pci_real_dma_dev - Get PCI DMA device for PCI device
6607 * @dev: the PCI device that may have a PCI DMA alias
6610 * devices needing to alias DMA to another PCI device on another PCI bus. If
6611 * the PCI device is on the same bus, it is recommended to use
6642 * @dev: the PCI device to get
6740 * region, but if we realign *every* resource of every device in
6766 * of the device specified by kernel's boot parameter 'pci=resource_alignment='.
6769 * to the device.
6788 /* check if specified PCI is target device to reassign */
6905 static int of_pci_bus_find_domain_nr(struct device *parent)
6910 /* On the first call scan device tree for static allocations. */
6938 static void of_pci_bus_release_domain_nr(struct pci_bus *bus, struct device *parent)
6950 int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)
6956 void pci_bus_release_domain_nr(struct pci_bus *bus, struct device *parent)