Lines Matching refs:device

17 #include <linux/device.h>
38 static struct vio_dev vio_bus_device = { /* fake "parent" device */
64 * vio_cmo_dev_entry - A device that is CMO-enabled and requires entitlement
82 * @excess: pool of excess entitlement not needed for device reserves or spare
83 * @spare: IO memory for device hotplug functionality
134 * @viodev: VIO device requesting IO memory
179 * @viodev: VIO device freeing IO memory
182 * IO memory is freed by the device back to the correct memory pools.
184 * the reserve pool is used to reduce device entitlement, the excess
208 /* Remove allocation from device */
230 * This removes entitlement from the device down to VIO_CMO_MIN_ENT,
274 * possible, come from the excess pool and from unused device entitlement
312 * Need to check how much unused entitlement each device can
407 * Determine how much entitlement is available and reset device
420 * Having provided each device with the minimum entitlement, loop
436 * Give the device up to VIO_CMO_BALANCE_CHUNK
438 * desired level of entitlement for the device.
447 * already allocated to the device it does not come
482 static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size,
505 static void vio_dma_iommu_free_coherent(struct device *dev, size_t size,
515 static dma_addr_t vio_dma_iommu_map_page(struct device *dev, struct page *page,
539 static void vio_dma_iommu_unmap_page(struct device *dev, dma_addr_t dma_handle,
551 static int vio_dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist,
585 static void vio_dma_iommu_unmap_sg(struct device *dev,
619 * vio_cmo_set_dev_desired - Set desired entitlement for a device
621 * @viodev: struct vio_dev for device to alter
642 * Changes will not be made for devices not in the device list.
643 * If it is not in the device list, then no driver is loaded
644 * for the device and it can not receive entitlement.
656 /* Increase/decrease in desired device entitlement */
658 /* Just bump the bus and device values prior to a balance*/
662 /* Decrease bus and device values for desired entitlement */
690 * @viodev - Pointer to struct vio_dev for device
696 * Returns: 0 on success, -EINVAL when device doesn't support CMO, and
697 * -ENOMEM when entitlement is not available for device or
698 * device entry.
704 struct device *dev = &viodev->dev;
713 /* A device requires entitlement if it has a DMA window property */
724 dev_warn(dev, "unknown device family: %d\n", viodev->family);
729 /* Configure entitlement for the device. */
733 dev_err(dev, "%s: device driver does not support CMO\n",
766 /* Updated desired entitlement if device requires it */
776 "entitlement to add device. "
803 * @viodev - Pointer to struct vio_dev for device
805 * Remove the device from the cmo device list. The minimum entitlement
806 * will be reserved for the device as long as it is in the system. The
807 * rest of the entitlement the device had been allocated will be returned
818 dev_err(&viodev->dev, "%s: device had %lu bytes of IO "
825 * Remove the device from the device list being maintained for
837 * to be processed. Otherwise, return the device's entitlement
842 * This device has not yet left the OF tree, it's
849 * Save min allocation for device in reserve as long
869 * Until the device is removed it will keep a
936 /* sysfs device functions and data structures for CMO */
939 static ssize_t cmo_##name##_show(struct device *dev, \
946 static ssize_t cmo_allocs_failed_show(struct device *dev,
953 static ssize_t cmo_allocs_failed_store(struct device *dev,
961 static ssize_t cmo_desired_store(struct device *dev,
980 static ssize_t name_show(struct device *, struct device_attribute *, char *);
981 static ssize_t devspec_show(struct device *, struct device_attribute *, char *);
982 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
1090 * @vdev - Pointer to a struct vio_dev for device
1114 struct device *dev = &vdev->dev;
1208 * vio_match_device: - Tell if a VIO device has a matching
1209 * VIO device id structure.
1210 * @ids: array of VIO device id structures to search in
1211 * @dev: the VIO device structure to match against
1213 * Used by a driver to check whether a VIO device present in the
1231 * Convert from struct device to struct vio_dev and pass to driver.
1235 static int vio_bus_probe(struct device *dev)
1261 /* convert from struct device to struct vio_dev and pass to driver. */
1262 static void vio_bus_remove(struct device *dev)
1266 struct device *devptr;
1269 * Hold a reference to the device after the remove function is called
1270 * to allow for CMO accounting cleanup for the device.
1283 static void vio_bus_shutdown(struct device *dev)
1332 static void vio_dev_release(struct device *dev)
1343 * vio_register_device_node: - Register a new vio device.
1344 * @of_node: The OF node for this device.
1360 * /ibm,platform-facilities node. This decides the device's family.
1394 pr_warn("%s: allocation failure for VIO device.\n", __func__);
1438 /* init generic 'struct device' fields: */
1458 /* register with generic device framework */
1460 printk(KERN_ERR "%s: failed to register device %s\n",
1476 * vio_bus_scan_for_devices - Scan OF and register each child device
1480 * Starting from the root node provide, register the device node for
1494 * Create struct vio_devices for each virtual device in
1495 * the device tree. Drivers will associate with them later.
1549 static ssize_t name_show(struct device *dev,
1556 static ssize_t devspec_show(struct device *dev,
1565 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
1603 static int vio_bus_match(struct device *dev, struct device_driver *drv)
1612 static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env)
1640 * vio_get_attribute: - get attribute for virtual device
1641 * @vdev: The vio device to get property.
1659 struct device *found;
1670 * @vnode: device_node of the virtual device we're looking for
1672 * Takes a reference to the embedded struct device which needs to be dropped
1684 /* construct the kobject name from the device node */