};
/* Perform a standard Gasket callback. */
-static inline int check_and_invoke_callback(
- struct gasket_dev *gasket_dev, int (*cb_function)(struct gasket_dev *))
+static inline int
+check_and_invoke_callback(struct gasket_dev *gasket_dev,
+ int (*cb_function)(struct gasket_dev *))
{
int ret = 0;
}
/* Perform a standard Gasket callback without grabbing gasket_dev->mutex. */
-static inline int gasket_check_and_invoke_callback_nolock(
- struct gasket_dev *gasket_dev, int (*cb_function)(struct gasket_dev *))
+static inline int
+gasket_check_and_invoke_callback_nolock(struct gasket_dev *gasket_dev,
+ int (*cb_function)(struct gasket_dev *))
{
int ret = 0;
*
* Returns the located slot number on success or a negative number on failure.
*/
-static int gasket_find_dev_slot(
- struct gasket_internal_desc *internal_desc, const char *kobj_name)
+static int gasket_find_dev_slot(struct gasket_internal_desc *internal_desc,
+ const char *kobj_name)
{
int i;
*
* Returns 0 if successful, a negative error code otherwise.
*/
-static int gasket_alloc_dev(
- struct gasket_internal_desc *internal_desc, struct device *parent,
- struct gasket_dev **pdev, const char *kobj_name)
+static int gasket_alloc_dev(struct gasket_internal_desc *internal_desc,
+ struct device *parent, struct gasket_dev **pdev,
+ const char *kobj_name)
{
int dev_idx;
const struct gasket_driver_desc *driver_desc =
gasket_dev->dev_idx);
dev_info->devt =
MKDEV(driver_desc->major, driver_desc->minor +
- gasket_dev->dev_idx);
+ gasket_dev->dev_idx);
dev_info->device = device_create(internal_desc->class, parent,
dev_info->devt, gasket_dev, dev_info->name);
*
* Returns 0 on success and a negative value otherwise.
*/
-static int gasket_setup_pci(
- struct pci_dev *pci_dev, struct gasket_dev *gasket_dev)
+static int gasket_setup_pci(struct pci_dev *pci_dev,
+ struct gasket_dev *gasket_dev)
{
int i, mapped_bars, ret;
const struct gasket_driver_desc *driver_desc =
gasket_dev->internal_desc->driver_desc;
- status = gasket_check_and_invoke_callback_nolock(
- gasket_dev, driver_desc->device_status_cb);
+ status = gasket_check_and_invoke_callback_nolock(gasket_dev,
+ driver_desc->device_status_cb);
if (status != GASKET_STATUS_ALIVE) {
dev_dbg(gasket_dev->dev, "Hardware reported status %d.\n",
status);
}
for (i = 0; i < driver_desc->num_page_tables; ++i) {
- status = gasket_page_table_system_status(
- gasket_dev->page_table[i]);
+ status = gasket_page_table_system_status(gasket_dev->page_table[i]);
if (status != GASKET_STATUS_ALIVE) {
dev_dbg(gasket_dev->dev,
"Page table %d reported status %d.\n",
return GASKET_STATUS_ALIVE;
}
-static ssize_t gasket_write_mappable_regions(
- char *buf, const struct gasket_driver_desc *driver_desc, int bar_index)
+static ssize_t
+gasket_write_mappable_regions(char *buf,
+ const struct gasket_driver_desc *driver_desc,
+ int bar_index)
{
int i;
ssize_t written;
return total_written;
}
-static ssize_t gasket_sysfs_data_show(
- struct device *device, struct device_attribute *attr, char *buf)
+static ssize_t gasket_sysfs_data_show(struct device *device,
+ struct device_attribute *attr, char *buf)
{
int i, ret = 0;
ssize_t current_written = 0;
}
break;
case ATTR_DRIVER_VERSION:
- ret = snprintf(
- buf, PAGE_SIZE, "%s\n",
- gasket_dev->internal_desc->driver_desc->driver_version);
+ ret = snprintf(buf, PAGE_SIZE, "%s\n",
+ gasket_dev->internal_desc->driver_desc->driver_version);
break;
case ATTR_FRAMEWORK_VERSION:
- ret = snprintf(
- buf, PAGE_SIZE, "%s\n", GASKET_FRAMEWORK_VERSION);
+ ret = snprintf(buf, PAGE_SIZE, "%s\n",
+ GASKET_FRAMEWORK_VERSION);
break;
case ATTR_DEVICE_TYPE:
- ret = snprintf(
- buf, PAGE_SIZE, "%s\n",
- gasket_dev->internal_desc->driver_desc->name);
+ ret = snprintf(buf, PAGE_SIZE, "%s\n",
+ gasket_dev->internal_desc->driver_desc->name);
break;
case ATTR_HARDWARE_REVISION:
- ret = snprintf(
- buf, PAGE_SIZE, "%d\n", gasket_dev->hardware_revision);
+ ret = snprintf(buf, PAGE_SIZE, "%d\n",
+ gasket_dev->hardware_revision);
break;
case ATTR_PCI_ADDRESS:
ret = snprintf(buf, PAGE_SIZE, "%s\n", gasket_dev->kobj_name);
break;
case ATTR_STATUS:
- ret = snprintf(
- buf, PAGE_SIZE, "%s\n",
- gasket_num_name_lookup(
- gasket_dev->status, gasket_status_name_table));
+ ret = snprintf(buf, PAGE_SIZE, "%s\n",
+ gasket_num_name_lookup(gasket_dev->status,
+ gasket_status_name_table));
break;
case ATTR_IS_DEVICE_OWNED:
- ret = snprintf(
- buf, PAGE_SIZE, "%d\n",
- gasket_dev->dev_info.ownership.is_owned);
+ ret = snprintf(buf, PAGE_SIZE, "%d\n",
+ gasket_dev->dev_info.ownership.is_owned);
break;
case ATTR_DEVICE_OWNER:
- ret = snprintf(
- buf, PAGE_SIZE, "%d\n",
- gasket_dev->dev_info.ownership.owner);
+ ret = snprintf(buf, PAGE_SIZE, "%d\n",
+ gasket_dev->dev_info.ownership.owner);
break;
case ATTR_WRITE_OPEN_COUNT:
- ret = snprintf(
- buf, PAGE_SIZE, "%d\n",
- gasket_dev->dev_info.ownership.write_open_count);
+ ret = snprintf(buf, PAGE_SIZE, "%d\n",
+ gasket_dev->dev_info.ownership.write_open_count);
break;
case ATTR_RESET_COUNT:
ret = snprintf(buf, PAGE_SIZE, "%d\n", gasket_dev->reset_count);
break;
case ATTR_USER_MEM_RANGES:
for (i = 0; i < GASKET_NUM_BARS; ++i) {
- current_written = gasket_write_mappable_regions(
- buf, driver_desc, i);
+ current_written =
+ gasket_write_mappable_regions(buf, driver_desc,
+ i);
buf += current_written;
ret += current_written;
}
};
/* Add a char device and related info. */
-static int gasket_add_cdev(
- struct gasket_cdev_info *dev_info,
- const struct file_operations *file_ops, struct module *owner)
+static int gasket_add_cdev(struct gasket_cdev_info *dev_info,
+ const struct file_operations *file_ops,
+ struct module *owner)
{
int ret;
* Precondition: Called with g_mutex held (to avoid a race on return).
* Returns NULL if no matching device was found.
*/
-static struct gasket_internal_desc *lookup_internal_desc(
- struct pci_dev *pci_dev)
+static struct gasket_internal_desc *
+lookup_internal_desc(struct pci_dev *pci_dev)
{
int i;
* that the provided descriptor/range is of adequate size to hold the range to
* be mapped.
*/
-static bool gasket_mmap_has_permissions(
- struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
- int bar_permissions)
+static bool gasket_mmap_has_permissions(struct gasket_dev *gasket_dev,
+ struct vm_area_struct *vma,
+ int bar_permissions)
{
int requested_permissions;
/* Always allow sysadmin to access. */
* Verifies that the input address is within the region allocated to coherent
* buffer.
*/
-static bool gasket_is_coherent_region(
- const struct gasket_driver_desc *driver_desc, ulong address)
+static bool
+gasket_is_coherent_region(const struct gasket_driver_desc *driver_desc,
+ ulong address)
{
struct gasket_coherent_buffer_desc coh_buff_desc =
driver_desc->coherent_buffer_description;
return false;
}
-static int gasket_get_bar_index(
- const struct gasket_dev *gasket_dev, ulong phys_addr)
+static int gasket_get_bar_index(const struct gasket_dev *gasket_dev,
+ ulong phys_addr)
{
int i;
const struct gasket_driver_desc *driver_desc;
*
* Returns true if there's anything to map, and false otherwise.
*/
-static bool gasket_mm_get_mapping_addrs(
- const struct gasket_mappable_region *region, ulong bar_offset,
- ulong requested_length, struct gasket_mappable_region *mappable_region,
- ulong *virt_offset)
+static bool
+gasket_mm_get_mapping_addrs(const struct gasket_mappable_region *region,
+ ulong bar_offset, ulong requested_length,
+ struct gasket_mappable_region *mappable_region,
+ ulong *virt_offset)
{
ulong range_start = region->start;
ulong range_length = region->length_bytes;
*/
mappable_region->start = bar_offset;
*virt_offset = 0;
- mappable_region->length_bytes = min(
- requested_length, range_end - bar_offset);
+ mappable_region->length_bytes =
+ min(requested_length, range_end - bar_offset);
return true;
}
* The offset is written into bar_offset on success.
* Returns zero on success, anything else on error.
*/
-static int gasket_mm_vma_bar_offset(
- const struct gasket_dev *gasket_dev, const struct vm_area_struct *vma,
- ulong *bar_offset)
+static int gasket_mm_vma_bar_offset(const struct gasket_dev *gasket_dev,
+ const struct vm_area_struct *vma,
+ ulong *bar_offset)
{
ulong raw_offset;
int bar_index;
return 0;
}
-int gasket_mm_unmap_region(
- const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
- const struct gasket_mappable_region *map_region)
+int gasket_mm_unmap_region(const struct gasket_dev *gasket_dev,
+ struct vm_area_struct *vma,
+ const struct gasket_mappable_region *map_region)
{
ulong bar_offset;
ulong virt_offset;
if (ret)
return ret;
- if (!gasket_mm_get_mapping_addrs(
- map_region, bar_offset, vma->vm_end - vma->vm_start,
- &mappable_region, &virt_offset))
+ if (!gasket_mm_get_mapping_addrs(map_region, bar_offset,
+ vma->vm_end - vma->vm_start,
+ &mappable_region, &virt_offset))
return 1;
/*
*
* Next multiple of y: ceil_div(x, y) * y
*/
- zap_vma_ptes(
- vma, vma->vm_start + virt_offset,
- DIV_ROUND_UP(mappable_region.length_bytes, PAGE_SIZE) *
- PAGE_SIZE);
+ zap_vma_ptes(vma, vma->vm_start + virt_offset,
+ DIV_ROUND_UP(mappable_region.length_bytes, PAGE_SIZE) *
+ PAGE_SIZE);
return 0;
}
EXPORT_SYMBOL(gasket_mm_unmap_region);
/* Maps a virtual address + range to a physical offset of a BAR. */
-static enum do_map_region_status do_map_region(
- const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
- struct gasket_mappable_region *mappable_region)
+static enum do_map_region_status
+do_map_region(const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
+ struct gasket_mappable_region *mappable_region)
{
/* Maximum size of a single call to io_remap_pfn_range. */
/* I pulled this number out of thin air. */
virt_base = vma->vm_start + virt_offset;
bar_index =
- gasket_get_bar_index(
- gasket_dev,
- (vma->vm_pgoff << PAGE_SHIFT) +
- driver_desc->legacy_mmap_address_offset);
+ gasket_get_bar_index(gasket_dev,
+ (vma->vm_pgoff << PAGE_SHIFT) +
+ driver_desc->legacy_mmap_address_offset);
phys_base = gasket_dev->bar_data[bar_index].phys_base + phys_offset;
while (mapped_bytes < map_length) {
/*
chunk_size = min(max_chunk_size, map_length - mapped_bytes);
cond_resched();
- ret = io_remap_pfn_range(
- vma, virt_base + mapped_bytes,
- (phys_base + mapped_bytes) >> PAGE_SHIFT,
- chunk_size, vma->vm_page_prot);
+ ret = io_remap_pfn_range(vma, virt_base + mapped_bytes,
+ (phys_base + mapped_bytes) >>
+ PAGE_SHIFT, chunk_size,
+ vma->vm_page_prot);
if (ret) {
dev_err(gasket_dev->dev,
"Error remapping PFN range.\n");
}
/* Map a region of coherent memory. */
-static int gasket_mmap_coherent(
- struct gasket_dev *gasket_dev, struct vm_area_struct *vma)
+static int gasket_mmap_coherent(struct gasket_dev *gasket_dev,
+ struct vm_area_struct *vma)
{
const struct gasket_driver_desc *driver_desc =
gasket_dev->internal_desc->driver_desc;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- ret = remap_pfn_range(
- vma, vma->vm_start,
- (gasket_dev->coherent_buffer.phys_base) >> PAGE_SHIFT,
- requested_length, vma->vm_page_prot);
+ ret = remap_pfn_range(vma, vma->vm_start,
+ (gasket_dev->coherent_buffer.phys_base) >>
+ PAGE_SHIFT, requested_length, vma->vm_page_prot);
if (ret) {
dev_err(gasket_dev->dev, "Error remapping PFN range err=%d.\n",
ret);
/* Record the user virtual to dma_address mapping that was
* created by the kernel.
*/
- gasket_set_user_virt(
- gasket_dev, requested_length,
- gasket_dev->coherent_buffer.phys_base, vma->vm_start);
+ gasket_set_user_virt(gasket_dev, requested_length,
+ gasket_dev->coherent_buffer.phys_base,
+ vma->vm_start);
return 0;
}
raw_offset = (vma->vm_pgoff << PAGE_SHIFT) +
driver_desc->legacy_mmap_address_offset;
vma_size = vma->vm_end - vma->vm_start;
- trace_gasket_mmap_entry(
- gasket_dev->dev_info.name, raw_offset, vma_size);
+ trace_gasket_mmap_entry(gasket_dev->dev_info.name, raw_offset,
+ vma_size);
/*
* Check if the raw offset is within a bar region. If not, check if it
}
if (driver_desc->get_mappable_regions_cb) {
- ret = driver_desc->get_mappable_regions_cb(
- gasket_dev, bar_index, &map_regions, &num_map_regions);
+ ret = driver_desc->get_mappable_regions_cb(gasket_dev,
+ bar_index,
+ &map_regions,
+ &num_map_regions);
if (ret)
return ret;
} else {
/* If the node is not owned, assign it to the current TGID. */
if (!ownership->is_owned) {
- ret = gasket_check_and_invoke_callback_nolock(
- gasket_dev, driver_desc->device_open_cb);
+ ret = gasket_check_and_invoke_callback_nolock(gasket_dev,
+ driver_desc->device_open_cb);
if (ret) {
dev_err(gasket_dev->dev,
"Error in device open cb: %d\n", ret);
driver_desc->device_reset_cb(gasket_dev, 0);
for (i = 0; i < driver_desc->num_page_tables; ++i) {
- gasket_page_table_unmap_all(
- gasket_dev->page_table[i]);
- gasket_page_table_garbage_collect(
- gasket_dev->page_table[i]);
+ gasket_page_table_unmap_all(gasket_dev->page_table[i]);
+ gasket_page_table_garbage_collect(gasket_dev->page_table[i]);
gasket_free_coherent_memory_all(gasket_dev, i);
}
/* Closes device, enters power save. */
- gasket_check_and_invoke_callback_nolock(
- gasket_dev, driver_desc->device_close_cb);
+ gasket_check_and_invoke_callback_nolock(gasket_dev,
+ driver_desc->device_close_cb);
}
}
};
/* Perform final init and marks the device as active. */
-static int gasket_enable_dev(
- struct gasket_internal_desc *internal_desc,
- struct gasket_dev *gasket_dev)
+static int gasket_enable_dev(struct gasket_internal_desc *internal_desc,
+ struct gasket_dev *gasket_dev)
{
int tbl_idx;
int ret;
const struct gasket_driver_desc *driver_desc =
internal_desc->driver_desc;
- ret = gasket_interrupt_init(
- gasket_dev, driver_desc->name,
- driver_desc->interrupt_type, driver_desc->interrupts,
- driver_desc->num_interrupts, driver_desc->interrupt_pack_width,
- driver_desc->interrupt_bar_index,
- driver_desc->wire_interrupt_offsets);
+ ret = gasket_interrupt_init(gasket_dev, driver_desc->name,
+ driver_desc->interrupt_type,
+ driver_desc->interrupts,
+ driver_desc->num_interrupts,
+ driver_desc->interrupt_pack_width,
+ driver_desc->interrupt_bar_index,
+ driver_desc->wire_interrupt_offsets);
if (ret) {
dev_err(gasket_dev->dev,
"Critical failure to allocate interrupts: %d\n", ret);
for (tbl_idx = 0; tbl_idx < driver_desc->num_page_tables; tbl_idx++) {
dev_dbg(gasket_dev->dev, "Initializing page table %d.\n",
tbl_idx);
- ret = gasket_page_table_init(
- &gasket_dev->page_table[tbl_idx],
- &gasket_dev->bar_data[
- driver_desc->page_table_bar_index],
- &driver_desc->page_table_configs[tbl_idx],
- gasket_dev->dev, gasket_dev->pci_dev);
+ ret = gasket_page_table_init(&gasket_dev->page_table[tbl_idx],
+ &gasket_dev->bar_data[driver_desc->page_table_bar_index],
+ &driver_desc->page_table_configs[tbl_idx],
+ gasket_dev->dev,
+ gasket_dev->pci_dev);
if (ret) {
dev_err(gasket_dev->dev,
"Couldn't init page table %d: %d\n",
* hardware_revision_cb returns a positive integer (the rev) if
* successful.)
*/
- ret = check_and_invoke_callback(
- gasket_dev, driver_desc->hardware_revision_cb);
+ ret = check_and_invoke_callback(gasket_dev,
+ driver_desc->hardware_revision_cb);
if (ret < 0) {
dev_err(gasket_dev->dev,
"Error getting hardware revision: %d\n", ret);
if (gasket_dev->status == GASKET_STATUS_DEAD)
dev_err(gasket_dev->dev, "Device reported as unhealthy.\n");
- ret = gasket_add_cdev(
- &gasket_dev->dev_info, &gasket_file_ops, driver_desc->module);
+ ret = gasket_add_cdev(&gasket_dev->dev_info, &gasket_file_ops,
+ driver_desc->module);
if (ret)
return ret;
*
* Returns 0 if successful and a negative value otherwise.
*/
-static int gasket_pci_probe(
- struct pci_dev *pci_dev, const struct pci_device_id *id)
+static int gasket_pci_probe(struct pci_dev *pci_dev,
+ const struct pci_device_id *id)
{
int ret;
const char *kobj_name = dev_name(&pci_dev->dev);
goto fail2;
}
- ret = gasket_sysfs_create_mapping(
- gasket_dev->dev_info.device, gasket_dev);
+ ret = gasket_sysfs_create_mapping(gasket_dev->dev_info.device,
+ gasket_dev);
if (ret)
goto fail3;
"Cannot create sysfs pci link: %d\n", ret);
goto fail3;
}
- ret = gasket_sysfs_create_entries(
- gasket_dev->dev_info.device, gasket_sysfs_generic_attrs);
+ ret = gasket_sysfs_create_entries(gasket_dev->dev_info.device,
+ gasket_sysfs_generic_attrs);
if (ret)
goto fail4;
- ret = check_and_invoke_callback(
- gasket_dev, driver_desc->sysfs_setup_cb);
+ ret = check_and_invoke_callback(gasket_dev,
+ driver_desc->sysfs_setup_cb);
if (ret) {
dev_err(gasket_dev->dev, "Error in sysfs setup cb: %d\n", ret);
goto fail5;
*
* The table must have a NULL name pointer at the end.
*/
-const char *gasket_num_name_lookup(
- uint num, const struct gasket_num_name *table)
+const char *gasket_num_name_lookup(uint num,
+ const struct gasket_num_name *table)
{
uint i = 0;
}
EXPORT_SYMBOL(gasket_reset_nolock);
-gasket_ioctl_permissions_cb_t gasket_get_ioctl_permissions_cb(
- struct gasket_dev *gasket_dev)
+gasket_ioctl_permissions_cb_t
+gasket_get_ioctl_permissions_cb(struct gasket_dev *gasket_dev)
{
return gasket_dev->internal_desc->driver_desc->ioctl_permissions_cb;
}
* Description: Busy waits for a specific combination of bits to be set on a
* Gasket register.
**/
-int gasket_wait_with_reschedule(
- struct gasket_dev *gasket_dev, int bar, u64 offset, u64 mask, u64 val,
- uint max_retries, u64 delay_ms)
+int gasket_wait_with_reschedule(struct gasket_dev *gasket_dev, int bar,
+ u64 offset, u64 mask, u64 val,
+ uint max_retries, u64 delay_ms)
{
uint retries = 0;
u64 tmp;
* depends on KBUILD_MODNAME, and this is a shared file.
*/
pr_debug("Registering PCI driver.\n");
- ret = __pci_register_driver(
- &internal->pci, driver_desc->module, driver_desc->name);
+ ret = __pci_register_driver(&internal->pci, driver_desc->module,
+ driver_desc->name);
if (ret) {
pr_err("cannot register pci driver [ret=%d]\n", ret);
goto fail1;
}
pr_debug("Registering char driver.\n");
- ret = register_chrdev_region(
- MKDEV(driver_desc->major, driver_desc->minor), GASKET_DEV_MAX,
- driver_desc->name);
+ ret = register_chrdev_region(MKDEV(driver_desc->major,
+ driver_desc->minor), GASKET_DEV_MAX,
+ driver_desc->name);
if (ret) {
pr_err("cannot register char driver [ret=%d]\n", ret);
goto fail2;
return;
}
- unregister_chrdev_region(
- MKDEV(driver_desc->major, driver_desc->minor), GASKET_DEV_MAX);
+ unregister_chrdev_region(MKDEV(driver_desc->major, driver_desc->minor),
+ GASKET_DEV_MAX);
pci_unregister_driver(&internal_desc->pci);
};
/* Type of the ioctl handler callback. */
-typedef long (*gasket_ioctl_handler_cb_t)
- (struct file *file, uint cmd, void __user *argp);
+typedef long (*gasket_ioctl_handler_cb_t)(struct file *file, uint cmd,
+ void __user *argp);
/* Type of the ioctl permissions check callback. See below. */
-typedef int (*gasket_ioctl_permissions_cb_t)(
- struct file *filp, uint cmd, void __user *argp);
+typedef int (*gasket_ioctl_permissions_cb_t)(struct file *filp, uint cmd,
+ void __user *argp);
/*
* Device type descriptor.
* descriptor for an open file is closed. This call is intended to
* handle any per-user or per-fd cleanup.
*/
- int (*device_release_cb)(
- struct gasket_dev *gasket_dev, struct file *file);
+ int (*device_release_cb)(struct gasket_dev *gasket_dev,
+ struct file *file);
/*
* device_close_cb: Callback for when a device node is closed for the
* information is then compared to mmap request to determine which
* regions to actually map.
*/
- int (*get_mappable_regions_cb)(
- struct gasket_dev *gasket_dev, int bar_index,
- struct gasket_mappable_region **mappable_regions,
- int *num_mappable_regions);
+ int (*get_mappable_regions_cb)(struct gasket_dev *gasket_dev,
+ int bar_index,
+ struct gasket_mappable_region **mappable_regions,
+ int *num_mappable_regions);
/*
* ioctl_permissions_cb: Check permissions for generic ioctls.
*/
/* Unmaps the specified mappable region from a VMA. */
-int gasket_mm_unmap_region(
- const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
- const struct gasket_mappable_region *map_region);
+int gasket_mm_unmap_region(const struct gasket_dev *gasket_dev,
+ struct vm_area_struct *vma,
+ const struct gasket_mappable_region *map_region);
/*
* Get the ioctl permissions callback.
* @gasket_dev: Gasket device structure.
*/
-gasket_ioctl_permissions_cb_t gasket_get_ioctl_permissions_cb(
- struct gasket_dev *gasket_dev);
+gasket_ioctl_permissions_cb_t
+gasket_get_ioctl_permissions_cb(struct gasket_dev *gasket_dev);
/**
* Lookup a name by number in a num_name table.
* @table: Array of num_name structures, the table for the lookup.
*
*/
-const char *gasket_num_name_lookup(
- uint num, const struct gasket_num_name *table);
+const char *gasket_num_name_lookup(uint num,
+ const struct gasket_num_name *table);
/* Handy inlines */
-static inline ulong gasket_dev_read_64(
- struct gasket_dev *gasket_dev, int bar, ulong location)
+static inline ulong gasket_dev_read_64(struct gasket_dev *gasket_dev, int bar,
+ ulong location)
{
return readq(&gasket_dev->bar_data[bar].virt_base[location]);
}
-static inline void gasket_dev_write_64(
- struct gasket_dev *dev, u64 value, int bar, ulong location)
+static inline void gasket_dev_write_64(struct gasket_dev *dev, u64 value,
+ int bar, ulong location)
{
writeq(value, &dev->bar_data[bar].virt_base[location]);
}
-static inline void gasket_dev_write_32(
- struct gasket_dev *dev, u32 value, int bar, ulong location)
+static inline void gasket_dev_write_32(struct gasket_dev *dev, u32 value,
+ int bar, ulong location)
{
writel(value, &dev->bar_data[bar].virt_base[location]);
}
-static inline u32 gasket_dev_read_32(
- struct gasket_dev *dev, int bar, ulong location)
+static inline u32 gasket_dev_read_32(struct gasket_dev *dev, int bar,
+ ulong location)
{
return readl(&dev->bar_data[bar].virt_base[location]);
}
-static inline void gasket_read_modify_write_64(
- struct gasket_dev *dev, int bar, ulong location, u64 value,
- u64 mask_width, u64 mask_shift)
+static inline void gasket_read_modify_write_64(struct gasket_dev *dev, int bar,
+ ulong location, u64 value,
+ u64 mask_width, u64 mask_shift)
{
u64 mask, tmp;
gasket_dev_write_64(dev, tmp, bar, location);
}
-static inline void gasket_read_modify_write_32(
- struct gasket_dev *dev, int bar, ulong location, u32 value,
- u32 mask_width, u32 mask_shift)
+static inline void gasket_read_modify_write_32(struct gasket_dev *dev, int bar,
+ ulong location, u32 value,
+ u32 mask_width, u32 mask_shift)
{
u32 mask, tmp;
struct device *gasket_get_device(struct gasket_dev *dev);
/* Helper function, Asynchronous waits on a given set of bits. */
-int gasket_wait_with_reschedule(
- struct gasket_dev *gasket_dev, int bar, u64 offset, u64 mask, u64 val,
- uint max_retries, u64 delay_ms);
+int gasket_wait_with_reschedule(struct gasket_dev *gasket_dev, int bar,
+ u64 offset, u64 mask, u64 val,
+ uint max_retries, u64 delay_ms);
#endif /* __GASKET_CORE_H__ */