diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
commit | dc50eab76b709d68175a358d6e23a5a3890764d3 (patch) | |
tree | c754d0390db060af0213ff994f0ac310e4cfd6e9 /drivers/staging/vme_user | |
parent | Adding debian version 6.6.15-2. (diff) | |
download | linux-dc50eab76b709d68175a358d6e23a5a3890764d3.tar.xz linux-dc50eab76b709d68175a358d6e23a5a3890764d3.zip |
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/staging/vme_user')
-rw-r--r-- | drivers/staging/vme_user/vme.c | 258 | ||||
-rw-r--r-- | drivers/staging/vme_user/vme.h | 6 | ||||
-rw-r--r-- | drivers/staging/vme_user/vme_fake.c | 77 | ||||
-rw-r--r-- | drivers/staging/vme_user/vme_tsi148.c | 9 | ||||
-rw-r--r-- | drivers/staging/vme_user/vme_tsi148.h | 704 | ||||
-rw-r--r-- | drivers/staging/vme_user/vme_user.c | 26 |
6 files changed, 522 insertions, 558 deletions
diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index d0366dd3f2..9bc2d35405 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -62,7 +62,6 @@ static struct vme_bridge *find_bridge(struct vme_resource *resource) return list_entry(resource->entry, struct vme_lm_resource, list)->parent; default: - printk(KERN_ERR "Unknown resource type\n"); return NULL; } } @@ -81,27 +80,12 @@ static struct vme_bridge *find_bridge(struct vme_resource *resource) void *vme_alloc_consistent(struct vme_resource *resource, size_t size, dma_addr_t *dma) { - struct vme_bridge *bridge; - - if (!resource) { - printk(KERN_ERR "No resource\n"); - return NULL; - } - - bridge = find_bridge(resource); - if (!bridge) { - printk(KERN_ERR "Can't find bridge\n"); - return NULL; - } - - if (!bridge->parent) { - printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); - return NULL; - } + struct vme_bridge *bridge = find_bridge(resource); if (!bridge->alloc_consistent) { - printk(KERN_ERR "alloc_consistent not supported by bridge %s\n", - bridge->name); + dev_err(bridge->parent, + "alloc_consistent not supported by bridge %s\n", + bridge->name); return NULL; } @@ -121,27 +105,12 @@ EXPORT_SYMBOL(vme_alloc_consistent); void vme_free_consistent(struct vme_resource *resource, size_t size, void *vaddr, dma_addr_t dma) { - struct vme_bridge *bridge; - - if (!resource) { - printk(KERN_ERR "No resource\n"); - return; - } - - bridge = find_bridge(resource); - if (!bridge) { - printk(KERN_ERR "Can't find bridge\n"); - return; - } - - if (!bridge->parent) { - printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); - return; - } + struct vme_bridge *bridge = find_bridge(resource); if (!bridge->free_consistent) { - printk(KERN_ERR "free_consistent not supported by bridge %s\n", - bridge->name); + dev_err(bridge->parent, + "free_consistent not supported by bridge %s\n", + bridge->name); return; } @@ -161,6 +130,7 @@ EXPORT_SYMBOL(vme_free_consistent); */ size_t vme_get_size(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); int enabled, retval; unsigned long long base, size; dma_addr_t buf_base; @@ -184,14 +154,14 @@ size_t vme_get_size(struct vme_resource *resource) case VME_DMA: return 0; default: - printk(KERN_ERR "Unknown resource type\n"); + dev_err(bridge->parent, "Unknown resource type\n"); return 0; } } EXPORT_SYMBOL(vme_get_size); -int vme_check_window(u32 aspace, unsigned long long vme_base, - unsigned long long size) +int vme_check_window(struct vme_bridge *bridge, u32 aspace, + unsigned long long vme_base, unsigned long long size) { int retval = 0; @@ -225,7 +195,7 @@ int vme_check_window(u32 aspace, unsigned long long vme_base, /* User Defined */ break; default: - printk(KERN_ERR "Invalid address space\n"); + dev_err(bridge->parent, "Invalid address space\n"); retval = -EINVAL; break; } @@ -282,24 +252,21 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, u32 cycle) { struct vme_bridge *bridge; - struct list_head *slave_pos = NULL; struct vme_slave_resource *allocated_image = NULL; struct vme_slave_resource *slave_image = NULL; struct vme_resource *resource = NULL; bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); goto err_bus; } /* Loop through slave resources */ - list_for_each(slave_pos, &bridge->slave_resources) { - slave_image = list_entry(slave_pos, - struct vme_slave_resource, list); - + list_for_each_entry(slave_image, &bridge->slave_resources, list) { if (!slave_image) { - printk(KERN_ERR "Registered NULL Slave resource\n"); + dev_err(bridge->parent, + "Registered NULL Slave resource\n"); continue; } @@ -366,24 +333,24 @@ int vme_slave_set(struct vme_resource *resource, int enabled, int retval; if (resource->type != VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + dev_err(bridge->parent, "Not a slave resource\n"); return -EINVAL; } image = list_entry(resource->entry, struct vme_slave_resource, list); if (!bridge->slave_set) { - printk(KERN_ERR "Function not supported\n"); - return -ENOSYS; + dev_err(bridge->parent, "Function not supported\n"); + return -EINVAL; } if (!(((image->address_attr & aspace) == aspace) && ((image->cycle_attr & cycle) == cycle))) { - printk(KERN_ERR "Invalid attributes\n"); + dev_err(bridge->parent, "Invalid attributes\n"); return -EINVAL; } - retval = vme_check_window(aspace, vme_base, size); + retval = vme_check_window(bridge, aspace, vme_base, size); if (retval) return retval; @@ -415,14 +382,14 @@ int vme_slave_get(struct vme_resource *resource, int *enabled, struct vme_slave_resource *image; if (resource->type != VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + dev_err(bridge->parent, "Not a slave resource\n"); return -EINVAL; } image = list_entry(resource->entry, struct vme_slave_resource, list); if (!bridge->slave_get) { - printk(KERN_ERR "vme_slave_get not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -439,24 +406,25 @@ EXPORT_SYMBOL(vme_slave_get); */ void vme_slave_free(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_slave_resource *slave_image; if (resource->type != VME_SLAVE) { - printk(KERN_ERR "Not a slave resource\n"); + dev_err(bridge->parent, "Not a slave resource\n"); return; } slave_image = list_entry(resource->entry, struct vme_slave_resource, list); if (!slave_image) { - printk(KERN_ERR "Can't find slave resource\n"); + dev_err(bridge->parent, "Can't find slave resource\n"); return; } /* Unlock image */ mutex_lock(&slave_image->mtx); if (slave_image->locked == 0) - printk(KERN_ERR "Image is already free\n"); + dev_err(bridge->parent, "Image is already free\n"); slave_image->locked = 0; mutex_unlock(&slave_image->mtx); @@ -482,24 +450,21 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, u32 cycle, u32 dwidth) { struct vme_bridge *bridge; - struct list_head *master_pos = NULL; struct vme_master_resource *allocated_image = NULL; struct vme_master_resource *master_image = NULL; struct vme_resource *resource = NULL; bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); goto err_bus; } /* Loop through master resources */ - list_for_each(master_pos, &bridge->master_resources) { - master_image = list_entry(master_pos, - struct vme_master_resource, list); - + list_for_each_entry(master_image, &bridge->master_resources, list) { if (!master_image) { - printk(KERN_WARNING "Registered NULL master resource\n"); + dev_warn(bridge->parent, + "Registered NULL master resource\n"); continue; } @@ -519,7 +484,7 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, /* Check to see if we found a resource */ if (!allocated_image) { - printk(KERN_ERR "Can't find a suitable resource\n"); + dev_err(&vdev->dev, "Can't find a suitable resource\n"); goto err_image; } @@ -569,25 +534,25 @@ int vme_master_set(struct vme_resource *resource, int enabled, int retval; if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } image = list_entry(resource->entry, struct vme_master_resource, list); if (!bridge->master_set) { - printk(KERN_WARNING "vme_master_set not supported\n"); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } if (!(((image->address_attr & aspace) == aspace) && ((image->cycle_attr & cycle) == cycle) && ((image->width_attr & dwidth) == dwidth))) { - printk(KERN_WARNING "Invalid attributes\n"); + dev_warn(bridge->parent, "Invalid attributes\n"); return -EINVAL; } - retval = vme_check_window(aspace, vme_base, size); + retval = vme_check_window(bridge, aspace, vme_base, size); if (retval) return retval; @@ -619,14 +584,14 @@ int vme_master_get(struct vme_resource *resource, int *enabled, struct vme_master_resource *image; if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } image = list_entry(resource->entry, struct vme_master_resource, list); if (!bridge->master_get) { - printk(KERN_WARNING "%s not supported\n", __func__); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -658,12 +623,13 @@ ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count, size_t length; if (!bridge->master_read) { - printk(KERN_WARNING "Reading from resource not supported\n"); + dev_warn(bridge->parent, + "Reading from resource not supported\n"); return -EINVAL; } if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } @@ -672,7 +638,7 @@ ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count, length = vme_get_size(resource); if (offset > length) { - printk(KERN_WARNING "Invalid Offset\n"); + dev_warn(bridge->parent, "Invalid Offset\n"); return -EFAULT; } @@ -706,12 +672,12 @@ ssize_t vme_master_write(struct vme_resource *resource, void *buf, size_t length; if (!bridge->master_write) { - printk(KERN_WARNING "Writing to resource not supported\n"); + dev_warn(bridge->parent, "Writing to resource not supported\n"); return -EINVAL; } if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } @@ -720,7 +686,7 @@ ssize_t vme_master_write(struct vme_resource *resource, void *buf, length = vme_get_size(resource); if (offset > length) { - printk(KERN_WARNING "Invalid Offset\n"); + dev_warn(bridge->parent, "Invalid Offset\n"); return -EFAULT; } @@ -757,12 +723,12 @@ unsigned int vme_master_rmw(struct vme_resource *resource, unsigned int mask, struct vme_master_resource *image; if (!bridge->master_rmw) { - printk(KERN_WARNING "Writing to resource not supported\n"); + dev_warn(bridge->parent, "Writing to resource not supported\n"); return -EINVAL; } if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } @@ -785,12 +751,13 @@ EXPORT_SYMBOL(vme_master_rmw); */ int vme_master_mmap(struct vme_resource *resource, struct vm_area_struct *vma) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_master_resource *image; phys_addr_t phys_addr; unsigned long vma_size; if (resource->type != VME_MASTER) { - pr_err("Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return -EINVAL; } @@ -799,7 +766,7 @@ int vme_master_mmap(struct vme_resource *resource, struct vm_area_struct *vma) vma_size = vma->vm_end - vma->vm_start; if (phys_addr + vma_size > image->bus_resource.end + 1) { - pr_err("Map size cannot exceed the window size\n"); + dev_err(bridge->parent, "Map size cannot exceed the window size\n"); return -EFAULT; } @@ -817,24 +784,25 @@ EXPORT_SYMBOL(vme_master_mmap); */ void vme_master_free(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_master_resource *master_image; if (resource->type != VME_MASTER) { - printk(KERN_ERR "Not a master resource\n"); + dev_err(bridge->parent, "Not a master resource\n"); return; } master_image = list_entry(resource->entry, struct vme_master_resource, list); if (!master_image) { - printk(KERN_ERR "Can't find master resource\n"); + dev_err(bridge->parent, "Can't find master resource\n"); return; } /* Unlock image */ spin_lock(&master_image->lock); if (master_image->locked == 0) - printk(KERN_ERR "Image is already free\n"); + dev_err(bridge->parent, "Image is already free\n"); master_image->locked = 0; spin_unlock(&master_image->lock); @@ -857,26 +825,24 @@ EXPORT_SYMBOL(vme_master_free); struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route) { struct vme_bridge *bridge; - struct list_head *dma_pos = NULL; struct vme_dma_resource *allocated_ctrlr = NULL; struct vme_dma_resource *dma_ctrlr = NULL; struct vme_resource *resource = NULL; /* XXX Not checking resource attributes */ - printk(KERN_ERR "No VME resource Attribute tests done\n"); + dev_err(&vdev->dev, "No VME resource Attribute tests done\n"); bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); goto err_bus; } /* Loop through DMA resources */ - list_for_each(dma_pos, &bridge->dma_resources) { - dma_ctrlr = list_entry(dma_pos, - struct vme_dma_resource, list); + list_for_each_entry(dma_ctrlr, &bridge->dma_resources, list) { if (!dma_ctrlr) { - printk(KERN_ERR "Registered NULL DMA resource\n"); + dev_err(bridge->parent, + "Registered NULL DMA resource\n"); continue; } @@ -928,10 +894,11 @@ EXPORT_SYMBOL(vme_dma_request); */ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_dma_list *dma_list; if (resource->type != VME_DMA) { - printk(KERN_ERR "Not a DMA resource\n"); + dev_err(bridge->parent, "Not a DMA resource\n"); return NULL; } @@ -1109,12 +1076,13 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src, int retval; if (!bridge->dma_list_add) { - printk(KERN_WARNING "Link List DMA generation not supported\n"); + dev_warn(bridge->parent, + "Link List DMA generation not supported\n"); return -EINVAL; } if (!mutex_trylock(&list->mtx)) { - printk(KERN_ERR "Link List already submitted\n"); + dev_err(bridge->parent, "Link List already submitted\n"); return -EINVAL; } @@ -1142,7 +1110,8 @@ int vme_dma_list_exec(struct vme_dma_list *list) int retval; if (!bridge->dma_list_exec) { - printk(KERN_ERR "Link List DMA execution not supported\n"); + dev_err(bridge->parent, + "Link List DMA execution not supported\n"); return -EINVAL; } @@ -1171,12 +1140,13 @@ int vme_dma_list_free(struct vme_dma_list *list) int retval; if (!bridge->dma_list_empty) { - printk(KERN_WARNING "Emptying of Link Lists not supported\n"); + dev_warn(bridge->parent, + "Emptying of Link Lists not supported\n"); return -EINVAL; } if (!mutex_trylock(&list->mtx)) { - printk(KERN_ERR "Link List in use\n"); + dev_err(bridge->parent, "Link List in use\n"); return -EBUSY; } @@ -1186,7 +1156,7 @@ int vme_dma_list_free(struct vme_dma_list *list) */ retval = bridge->dma_list_empty(list); if (retval) { - printk(KERN_ERR "Unable to empty link-list entries\n"); + dev_err(bridge->parent, "Unable to empty link-list entries\n"); mutex_unlock(&list->mtx); return retval; } @@ -1208,22 +1178,24 @@ EXPORT_SYMBOL(vme_dma_list_free); */ int vme_dma_free(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_dma_resource *ctrlr; if (resource->type != VME_DMA) { - printk(KERN_ERR "Not a DMA resource\n"); + dev_err(bridge->parent, "Not a DMA resource\n"); return -EINVAL; } ctrlr = list_entry(resource->entry, struct vme_dma_resource, list); if (!mutex_trylock(&ctrlr->mtx)) { - printk(KERN_ERR "Resource busy, can't free\n"); + dev_err(bridge->parent, "Resource busy, can't free\n"); return -EBUSY; } if (!(list_empty(&ctrlr->pending) && list_empty(&ctrlr->running))) { - printk(KERN_WARNING "Resource still processing transfers\n"); + dev_warn(bridge->parent, + "Resource still processing transfers\n"); mutex_unlock(&ctrlr->mtx); return -EBUSY; } @@ -1241,14 +1213,11 @@ EXPORT_SYMBOL(vme_dma_free); void vme_bus_error_handler(struct vme_bridge *bridge, unsigned long long address, int am) { - struct list_head *handler_pos = NULL; struct vme_error_handler *handler; int handler_triggered = 0; u32 aspace = vme_get_aspace(am); - list_for_each(handler_pos, &bridge->vme_error_handlers) { - handler = list_entry(handler_pos, struct vme_error_handler, - list); + list_for_each_entry(handler, &bridge->vme_error_handlers, list) { if ((aspace == handler->aspace) && (address >= handler->start) && (address < handler->end)) { @@ -1304,8 +1273,9 @@ void vme_irq_handler(struct vme_bridge *bridge, int level, int statid) if (call) call(level, statid, priv_data); else - printk(KERN_WARNING "Spurious VME interrupt, level:%x, vector:%x\n", - level, statid); + dev_warn(bridge->parent, + "Spurious VME interrupt, level:%x, vector:%x\n", level, + statid); } EXPORT_SYMBOL(vme_irq_handler); @@ -1333,17 +1303,18 @@ int vme_irq_request(struct vme_dev *vdev, int level, int statid, bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); return -EINVAL; } if ((level < 1) || (level > 7)) { - printk(KERN_ERR "Invalid interrupt level\n"); + dev_err(bridge->parent, "Invalid interrupt level\n"); return -EINVAL; } if (!bridge->irq_set) { - printk(KERN_ERR "Configuring interrupts not supported\n"); + dev_err(bridge->parent, + "Configuring interrupts not supported\n"); return -EINVAL; } @@ -1351,7 +1322,7 @@ int vme_irq_request(struct vme_dev *vdev, int level, int statid, if (bridge->irq[level - 1].callback[statid].func) { mutex_unlock(&bridge->irq_mtx); - printk(KERN_WARNING "VME Interrupt already taken\n"); + dev_warn(bridge->parent, "VME Interrupt already taken\n"); return -EBUSY; } @@ -1382,17 +1353,18 @@ void vme_irq_free(struct vme_dev *vdev, int level, int statid) bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); return; } if ((level < 1) || (level > 7)) { - printk(KERN_ERR "Invalid interrupt level\n"); + dev_err(bridge->parent, "Invalid interrupt level\n"); return; } if (!bridge->irq_set) { - printk(KERN_ERR "Configuring interrupts not supported\n"); + dev_err(bridge->parent, + "Configuring interrupts not supported\n"); return; } @@ -1429,17 +1401,18 @@ int vme_irq_generate(struct vme_dev *vdev, int level, int statid) bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); return -EINVAL; } if ((level < 1) || (level > 7)) { - printk(KERN_WARNING "Invalid interrupt level\n"); + dev_warn(bridge->parent, "Invalid interrupt level\n"); return -EINVAL; } if (!bridge->irq_generate) { - printk(KERN_WARNING "Interrupt generation not supported\n"); + dev_warn(bridge->parent, + "Interrupt generation not supported\n"); return -EINVAL; } @@ -1460,23 +1433,21 @@ EXPORT_SYMBOL(vme_irq_generate); struct vme_resource *vme_lm_request(struct vme_dev *vdev) { struct vme_bridge *bridge; - struct list_head *lm_pos = NULL; struct vme_lm_resource *allocated_lm = NULL; struct vme_lm_resource *lm = NULL; struct vme_resource *resource = NULL; bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); goto err_bus; } /* Loop through LM resources */ - list_for_each(lm_pos, &bridge->lm_resources) { - lm = list_entry(lm_pos, - struct vme_lm_resource, list); + list_for_each_entry(lm, &bridge->lm_resources, list) { if (!lm) { - printk(KERN_ERR "Registered NULL Location Monitor resource\n"); + dev_err(bridge->parent, + "Registered NULL Location Monitor resource\n"); continue; } @@ -1528,10 +1499,11 @@ EXPORT_SYMBOL(vme_lm_request); */ int vme_lm_count(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return -EINVAL; } @@ -1562,14 +1534,14 @@ int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base, struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return -EINVAL; } lm = list_entry(resource->entry, struct vme_lm_resource, list); if (!bridge->lm_set) { - printk(KERN_ERR "vme_lm_set not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -1598,14 +1570,14 @@ int vme_lm_get(struct vme_resource *resource, unsigned long long *lm_base, struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return -EINVAL; } lm = list_entry(resource->entry, struct vme_lm_resource, list); if (!bridge->lm_get) { - printk(KERN_ERR "vme_lm_get not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -1620,7 +1592,7 @@ EXPORT_SYMBOL(vme_lm_get); * @callback: Pointer to callback function called when triggered. * @data: Generic pointer that will be passed to the callback function. * - * Attach a callback to the specificed offset into the location monitors + * Attach a callback to the specified offset into the location monitors * monitored addresses. A generic pointer is provided to allow data to be * passed to the callback when called. * @@ -1635,14 +1607,14 @@ int vme_lm_attach(struct vme_resource *resource, int monitor, struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return -EINVAL; } lm = list_entry(resource->entry, struct vme_lm_resource, list); if (!bridge->lm_attach) { - printk(KERN_ERR "vme_lm_attach not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -1655,7 +1627,7 @@ EXPORT_SYMBOL(vme_lm_attach); * @resource: Pointer to VME location monitor resource. * @monitor: Offset to which callback should be removed. * - * Remove the callback associated with the specificed offset into the + * Remove the callback associated with the specified offset into the * location monitors monitored addresses. * * Return: Zero on success, -EINVAL when provided with an invalid location @@ -1668,14 +1640,14 @@ int vme_lm_detach(struct vme_resource *resource, int monitor) struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return -EINVAL; } lm = list_entry(resource->entry, struct vme_lm_resource, list); if (!bridge->lm_detach) { - printk(KERN_ERR "vme_lm_detach not supported\n"); + dev_err(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -1697,10 +1669,11 @@ EXPORT_SYMBOL(vme_lm_detach); */ void vme_lm_free(struct vme_resource *resource) { + struct vme_bridge *bridge = find_bridge(resource); struct vme_lm_resource *lm; if (resource->type != VME_LM) { - printk(KERN_ERR "Not a Location Monitor resource\n"); + dev_err(bridge->parent, "Not a Location Monitor resource\n"); return; } @@ -1737,12 +1710,12 @@ int vme_slot_num(struct vme_dev *vdev) bridge = vdev->bridge; if (!bridge) { - printk(KERN_ERR "Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); return -EINVAL; } if (!bridge->slot_get) { - printk(KERN_WARNING "vme_slot_num not supported\n"); + dev_warn(bridge->parent, "%s not supported\n", __func__); return -EINVAL; } @@ -1765,7 +1738,7 @@ int vme_bus_num(struct vme_dev *vdev) bridge = vdev->bridge; if (!bridge) { - pr_err("Can't find VME bus\n"); + dev_err(&vdev->dev, "Can't find VME bus\n"); return -EINVAL; } @@ -1866,8 +1839,9 @@ static int __vme_register_driver_bus(struct vme_driver *drv, if (vdev->dev.platform_data) { list_add_tail(&vdev->drv_list, &drv->devices); list_add_tail(&vdev->bridge_list, &bridge->devices); - } else + } else { device_unregister(&vdev->dev); + } } return 0; diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h index faa9816046..06504dccd5 100644 --- a/drivers/staging/vme_user/vme.h +++ b/drivers/staging/vme_user/vme.h @@ -87,7 +87,7 @@ extern struct bus_type vme_bus_type; #define VME_NUM_STATUSID 256 /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */ -#define VME_MAX_BRIDGES (sizeof(unsigned int)*8) +#define VME_MAX_BRIDGES (sizeof(unsigned int) * 8) #define VME_MAX_SLOTS 32 #define VME_SLOT_CURRENT -1 @@ -133,8 +133,8 @@ void vme_free_consistent(struct vme_resource *, size_t, void *, dma_addr_t); size_t vme_get_size(struct vme_resource *); -int vme_check_window(u32 aspace, unsigned long long vme_base, - unsigned long long size); +int vme_check_window(struct vme_bridge *bridge, u32 aspace, + unsigned long long vme_base, unsigned long long size); struct vme_resource *vme_slave_request(struct vme_dev *, u32, u32); int vme_slave_set(struct vme_resource *, int, unsigned long long, diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c index 7c53a8a7b7..7f84d1c86f 100644 --- a/drivers/staging/vme_user/vme_fake.c +++ b/drivers/staging/vme_user/vme_fake.c @@ -95,7 +95,7 @@ static void fake_VIRQ_tasklet(unsigned long data) struct vme_bridge *fake_bridge; struct fake_driver *bridge; - fake_bridge = (struct vme_bridge *) data; + fake_bridge = (struct vme_bridge *)data; bridge = fake_bridge->driver_priv; vme_irq_handler(fake_bridge, bridge->int_level, bridge->int_statid); @@ -105,7 +105,7 @@ static void fake_VIRQ_tasklet(unsigned long data) * Configure VME interrupt */ static void fake_irq_set(struct vme_bridge *fake_bridge, int level, - int state, int sync) + int state, int sync) { /* Nothing to do */ } @@ -125,7 +125,7 @@ static dma_addr_t fake_ptr_to_pci(void *addr) * interrupt to be acked. */ static int fake_irq_generate(struct vme_bridge *fake_bridge, int level, - int statid) + int statid) { struct fake_driver *bridge; @@ -152,8 +152,8 @@ static int fake_irq_generate(struct vme_bridge *fake_bridge, int level, * Initialize a slave window with the requested attributes. */ static int fake_slave_set(struct vme_slave_resource *image, int enabled, - unsigned long long vme_base, unsigned long long size, - dma_addr_t buf_base, u32 aspace, u32 cycle) + unsigned long long vme_base, unsigned long long size, + dma_addr_t buf_base, u32 aspace, u32 cycle) { unsigned int i, granularity = 0; unsigned long long vme_bound; @@ -221,8 +221,8 @@ static int fake_slave_set(struct vme_slave_resource *image, int enabled, * Get slave window configuration. */ static int fake_slave_get(struct vme_slave_resource *image, int *enabled, - unsigned long long *vme_base, unsigned long long *size, - dma_addr_t *buf_base, u32 *aspace, u32 *cycle) + unsigned long long *vme_base, unsigned long long *size, + dma_addr_t *buf_base, u32 *aspace, u32 *cycle) { unsigned int i; struct fake_driver *bridge; @@ -249,8 +249,8 @@ static int fake_slave_get(struct vme_slave_resource *image, int *enabled, * Set the attributes of an outbound window. */ static int fake_master_set(struct vme_master_resource *image, int enabled, - unsigned long long vme_base, unsigned long long size, - u32 aspace, u32 cycle, u32 dwidth) + unsigned long long vme_base, unsigned long long size, + u32 aspace, u32 cycle, u32 dwidth) { int retval = 0; unsigned int i; @@ -335,8 +335,8 @@ err_window: * Set the attributes of an outbound window. */ static int __fake_master_get(struct vme_master_resource *image, int *enabled, - unsigned long long *vme_base, unsigned long long *size, - u32 *aspace, u32 *cycle, u32 *dwidth) + unsigned long long *vme_base, unsigned long long *size, + u32 *aspace, u32 *cycle, u32 *dwidth) { unsigned int i; struct fake_driver *bridge; @@ -356,15 +356,15 @@ static int __fake_master_get(struct vme_master_resource *image, int *enabled, } static int fake_master_get(struct vme_master_resource *image, int *enabled, - unsigned long long *vme_base, unsigned long long *size, - u32 *aspace, u32 *cycle, u32 *dwidth) + unsigned long long *vme_base, unsigned long long *size, + u32 *aspace, u32 *cycle, u32 *dwidth) { int retval; spin_lock(&image->lock); retval = __fake_master_get(image, enabled, vme_base, size, aspace, - cycle, dwidth); + cycle, dwidth); spin_unlock(&image->lock); @@ -403,8 +403,7 @@ static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, if (((lm_base + (8 * i)) <= addr) && ((lm_base + (8 * i) + 8) > addr)) { if (bridge->lm_callback[i]) - bridge->lm_callback[i]( - bridge->lm_data[i]); + bridge->lm_callback[i](bridge->lm_data[i]); } } } @@ -511,7 +510,7 @@ static noinline_for_stack u32 fake_vmeread32(struct fake_driver *bridge, } static ssize_t fake_master_read(struct vme_master_resource *image, void *buf, - size_t count, loff_t offset) + size_t count, loff_t offset) { int retval; u32 aspace, cycle, dwidth; @@ -585,7 +584,6 @@ static ssize_t fake_master_read(struct vme_master_resource *image, void *buf, aspace, cycle); done += 1; } - } if ((dwidth == VME_D16) || (dwidth == VME_D32)) { @@ -700,7 +698,7 @@ static noinline_for_stack void fake_vmewrite32(struct fake_driver *bridge, } static ssize_t fake_master_write(struct vme_master_resource *image, void *buf, - size_t count, loff_t offset) + size_t count, loff_t offset) { int retval = 0; u32 aspace, cycle, dwidth; @@ -739,7 +737,7 @@ static ssize_t fake_master_write(struct vme_master_resource *image, void *buf, if ((addr + done) & 0x2) { if ((count - done) < 2) { fake_vmewrite8(bridge, (u8 *)(buf + done), - addr + done, aspace, cycle); + addr + done, aspace, cycle); done += 1; goto out; } else { @@ -768,10 +766,9 @@ static ssize_t fake_master_write(struct vme_master_resource *image, void *buf, count32 = (count - done); while (done < count32) { fake_vmewrite8(bridge, (u8 *)(buf + done), addr + done, - aspace, cycle); + aspace, cycle); done += 1; } - } if ((dwidth == VME_D16) || (dwidth == VME_D32)) { @@ -784,7 +781,7 @@ static ssize_t fake_master_write(struct vme_master_resource *image, void *buf, if ((count - done) & 0x1) { fake_vmewrite8(bridge, (u8 *)(buf + done), addr + done, aspace, - cycle); + cycle); done += 1; } @@ -802,8 +799,8 @@ out: * Requires a previously configured master window, returns final value. */ static unsigned int fake_master_rmw(struct vme_master_resource *image, - unsigned int mask, unsigned int compare, unsigned int swap, - loff_t offset) + unsigned int mask, unsigned int compare, + unsigned int swap, loff_t offset) { u32 tmp, base; u32 aspace, cycle; @@ -848,7 +845,7 @@ static unsigned int fake_master_rmw(struct vme_master_resource *image, * callback is attached and disabled when the last callback is removed. */ static int fake_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base, - u32 aspace, u32 cycle) + u32 aspace, u32 cycle) { int i; struct vme_bridge *fake_bridge; @@ -894,7 +891,8 @@ static int fake_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base, * or disabled. */ static int fake_lm_get(struct vme_lm_resource *lm, - unsigned long long *lm_base, u32 *aspace, u32 *cycle) + unsigned long long *lm_base, + u32 *aspace, u32 *cycle) { struct fake_driver *bridge; @@ -917,7 +915,7 @@ static int fake_lm_get(struct vme_lm_resource *lm, * Callback will be passed the monitor triggered. */ static int fake_lm_attach(struct vme_lm_resource *lm, int monitor, - void (*callback)(void *), void *data) + void (*callback)(void *), void *data) { struct vme_bridge *fake_bridge; struct fake_driver *bridge; @@ -995,7 +993,7 @@ static int fake_slot_get(struct vme_bridge *fake_bridge) } static void *fake_alloc_consistent(struct device *parent, size_t size, - dma_addr_t *dma) + dma_addr_t *dma) { void *alloc = kmalloc(size, GFP_KERNEL); @@ -1006,12 +1004,9 @@ static void *fake_alloc_consistent(struct device *parent, size_t size, } static void fake_free_consistent(struct device *parent, size_t size, - void *vaddr, dma_addr_t dma) + void *vaddr, dma_addr_t dma) { kfree(vaddr); -/* - dma_free_coherent(parent, size, vaddr, dma); -*/ } /* @@ -1094,9 +1089,9 @@ static int __init fake_init(void) mutex_init(&fake_device->vme_int); mutex_init(&fake_bridge->irq_mtx); tasklet_init(&fake_device->int_tasklet, fake_VIRQ_tasklet, - (unsigned long) fake_bridge); + (unsigned long)fake_bridge); - strcpy(fake_bridge->name, driver_name); + strscpy(fake_bridge->name, driver_name, sizeof(fake_bridge->name)); /* Add master windows to list */ INIT_LIST_HEAD(&fake_bridge->master_resources); @@ -1118,10 +1113,10 @@ static int __init fake_init(void) VME_PROG | VME_DATA; master_image->width_attr = VME_D16 | VME_D32; memset(&master_image->bus_resource, 0, - sizeof(struct resource)); + sizeof(struct resource)); master_image->kern_base = NULL; list_add_tail(&master_image->list, - &fake_bridge->master_resources); + &fake_bridge->master_resources); } /* Add slave windows to list */ @@ -1144,7 +1139,7 @@ static int __init fake_init(void) VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER | VME_PROG | VME_DATA; list_add_tail(&slave_image->list, - &fake_bridge->slave_resources); + &fake_bridge->slave_resources); } /* Add location monitor to list */ @@ -1179,7 +1174,7 @@ static int __init fake_init(void) fake_bridge->free_consistent = fake_free_consistent; pr_info("Board is%s the VME system controller\n", - (geoid == 1) ? "" : " not"); + (geoid == 1) ? "" : " not"); pr_info("VME geographical address is set to %d\n", geoid); @@ -1220,7 +1215,7 @@ err_master: /* resources are stored in link list */ list_for_each_safe(pos, n, &fake_bridge->master_resources) { master_image = list_entry(pos, struct vme_master_resource, - list); + list); list_del(pos); kfree(master_image); } @@ -1275,7 +1270,7 @@ static void __exit fake_exit(void) /* resources are stored in link list */ list_for_each_safe(pos, tmplist, &fake_bridge->master_resources) { master_image = list_entry(pos, struct vme_master_resource, - list); + list); list_del(pos); kfree(master_image); } diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c index 2f5eafd509..2ec9c29044 100644 --- a/drivers/staging/vme_user/vme_tsi148.c +++ b/drivers/staging/vme_user/vme_tsi148.c @@ -2118,8 +2118,9 @@ static int tsi148_slot_get(struct vme_bridge *tsi148_bridge) if (!geoid) { slot = ioread32be(bridge->base + TSI148_LCSR_VSTAT); slot = slot & TSI148_LCSR_VSTAT_GA_M; - } else + } else { slot = geoid; + } return (int)slot; } @@ -2196,9 +2197,9 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge, dev_info(tsi148_bridge->parent, "CR/CSR Offset: %d\n", cbar); crat = ioread32be(bridge->base + TSI148_LCSR_CRAT); - if (crat & TSI148_LCSR_CRAT_EN) + if (crat & TSI148_LCSR_CRAT_EN) { dev_info(tsi148_bridge->parent, "CR/CSR already enabled\n"); - else { + } else { dev_info(tsi148_bridge->parent, "Enabling CR/CSR space\n"); iowrite32be(crat | TSI148_LCSR_CRAT_EN, bridge->base + TSI148_LCSR_CRAT); @@ -2309,7 +2310,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) mutex_init(&tsi148_device->vme_rmw); tsi148_bridge->parent = &pdev->dev; - strcpy(tsi148_bridge->name, driver_name); + strscpy(tsi148_bridge->name, driver_name, VMENAMSIZ); /* Setup IRQ */ retval = tsi148_irq_init(tsi148_bridge); diff --git a/drivers/staging/vme_user/vme_tsi148.h b/drivers/staging/vme_user/vme_tsi148.h index 63f726e181..4dd224d0b8 100644 --- a/drivers/staging/vme_user/vme_tsi148.h +++ b/drivers/staging/vme_user/vme_tsi148.h @@ -96,13 +96,9 @@ struct tsi148_dma_entry { #define TSI148_PCFS_MISC0 0xC #define TSI148_PCFS_MBARL 0x10 #define TSI148_PCFS_MBARU 0x14 - #define TSI148_PCFS_SUBID 0x28 - #define TSI148_PCFS_CAPP 0x34 - #define TSI148_PCFS_MISC1 0x3C - #define TSI148_PCFS_XCAPP 0x40 #define TSI148_PCFS_XSTAT 0x44 @@ -210,7 +206,7 @@ static const int TSI148_LCSR_OT[8] = { TSI148_LCSR_OT0, TSI148_LCSR_OT1, /* * VMEbus interrupt ack - * offset 200 + * offset 0x200 */ #define TSI148_LCSR_VIACK1 0x204 #define TSI148_LCSR_VIACK2 0x208 @@ -227,7 +223,7 @@ static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1, /* * RMW - * offset 220 + * offset 0x220 */ #define TSI148_LCSR_RMWAU 0x220 #define TSI148_LCSR_RMWAL 0x224 @@ -237,7 +233,7 @@ static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1, /* * VMEbus control - * offset 234 + * offset 0x234 */ #define TSI148_LCSR_VMCTRL 0x234 #define TSI148_LCSR_VCTRL 0x238 @@ -245,38 +241,38 @@ static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1, /* * PCI status - * offset 240 + * offset 0x240 */ #define TSI148_LCSR_PSTAT 0x240 /* * VME filter. - * offset 250 + * offset 0x250 */ #define TSI148_LCSR_VMEFL 0x250 - /* - * VME exception. - * offset 260 +/* + * VME exception. + * offset 0x260 */ #define TSI148_LCSR_VEAU 0x260 #define TSI148_LCSR_VEAL 0x264 #define TSI148_LCSR_VEAT 0x268 - /* - * PCI error - * offset 270 - */ +/* + * PCI error + * offset 0x270 + */ #define TSI148_LCSR_EDPAU 0x270 #define TSI148_LCSR_EDPAL 0x274 #define TSI148_LCSR_EDPXA 0x278 #define TSI148_LCSR_EDPXS 0x27C #define TSI148_LCSR_EDPAT 0x280 - /* - * Inbound Translations - * offset 300 - */ +/* + * Inbound Translations + * offset 0x300 + */ #define TSI148_LCSR_IT0_ITSAU 0x300 #define TSI148_LCSR_IT0_ITSAL 0x304 #define TSI148_LCSR_IT0_ITEAU 0x308 @@ -363,53 +359,53 @@ static const int TSI148_LCSR_IT[8] = { TSI148_LCSR_IT0, TSI148_LCSR_IT1, #define TSI148_LCSR_OFFSET_ITOFL 0x14 #define TSI148_LCSR_OFFSET_ITAT 0x18 - /* - * Inbound Translation GCSR - * offset 400 - */ +/* + * Inbound Translation GCSR + * offset 0x400 + */ #define TSI148_LCSR_GBAU 0x400 #define TSI148_LCSR_GBAL 0x404 #define TSI148_LCSR_GCSRAT 0x408 - /* - * Inbound Translation CRG - * offset 40C - */ +/* + * Inbound Translation CRG + * offset 0x40C + */ #define TSI148_LCSR_CBAU 0x40C #define TSI148_LCSR_CBAL 0x410 #define TSI148_LCSR_CSRAT 0x414 - /* - * Inbound Translation CR/CSR - * CRG - * offset 418 - */ +/* + * Inbound Translation CR/CSR + * CRG + * offset 0x418 + */ #define TSI148_LCSR_CROU 0x418 #define TSI148_LCSR_CROL 0x41C #define TSI148_LCSR_CRAT 0x420 - /* - * Inbound Translation Location Monitor - * offset 424 - */ +/* + * Inbound Translation Location Monitor + * offset 0x424 + */ #define TSI148_LCSR_LMBAU 0x424 #define TSI148_LCSR_LMBAL 0x428 #define TSI148_LCSR_LMAT 0x42C - /* - * VMEbus Interrupt Control. - * offset 430 - */ +/* + * VMEbus Interrupt Control. + * offset 0x430 + */ #define TSI148_LCSR_BCU 0x430 #define TSI148_LCSR_BCL 0x434 #define TSI148_LCSR_BPGTR 0x438 #define TSI148_LCSR_BPCTR 0x43C #define TSI148_LCSR_VICR 0x440 - /* - * Local Bus Interrupt Control. - * offset 448 - */ +/* + * Local Bus Interrupt Control. + * offset 0x448 + */ #define TSI148_LCSR_INTEN 0x448 #define TSI148_LCSR_INTEO 0x44C #define TSI148_LCSR_INTS 0x450 @@ -417,10 +413,10 @@ static const int TSI148_LCSR_IT[8] = { TSI148_LCSR_IT0, TSI148_LCSR_IT1, #define TSI148_LCSR_INTM1 0x458 #define TSI148_LCSR_INTM2 0x45C - /* - * DMA Controllers - * offset 500 - */ +/* + * DMA Controllers + * offset 0x500 + */ #define TSI148_LCSR_DCTL0 0x500 #define TSI148_LCSR_DSTA0 0x504 #define TSI148_LCSR_DCSAU0 0x508 @@ -484,27 +480,27 @@ static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0, #define TSI148_LCSR_OFFSET_DCNT 0x40 #define TSI148_LCSR_OFFSET_DDBS 0x44 - /* - * GCSR Register Group - */ +/* + * GCSR Register Group + */ - /* - * GCSR CRG - * offset 00 600 - DEVI/VENI - * offset 04 604 - CTRL/GA/REVID - * offset 08 608 - Semaphore3/2/1/0 - * offset 0C 60C - Seamphore7/6/5/4 - */ +/* + * GCSR CRG + * offset 0x00 0x600 - DEVI/VENI + * offset 0x04 0x604 - CTRL/GA/REVID + * offset 0x08 0x608 - Semaphore3/2/1/0 + * offset 0x0C 0x60C - Seamphore7/6/5/4 + */ #define TSI148_GCSR_ID 0x600 #define TSI148_GCSR_CSR 0x604 #define TSI148_GCSR_SEMA0 0x608 #define TSI148_GCSR_SEMA1 0x60C - /* - * Mail Box - * GCSR CRG - * offset 10 610 - Mailbox0 - */ +/* + * Mail Box + * GCSR CRG + * offset 0x10 0x610 - Mailbox0 + */ #define TSI148_GCSR_MBOX0 0x610 #define TSI148_GCSR_MBOX1 0x614 #define TSI148_GCSR_MBOX2 0x618 @@ -515,27 +511,27 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, TSI148_GCSR_MBOX2, TSI148_GCSR_MBOX3 }; - /* - * CR/CSR - */ +/* + * CR/CSR + */ - /* - * CR/CSR CRG - * offset 7FFF4 FF4 - CSRBCR - * offset 7FFF8 FF8 - CSRBSR - * offset 7FFFC FFC - CBAR - */ +/* + * CR/CSR CRG + * offset 0x7FFF4 0xFF4 - CSRBCR + * offset 0x7FFF8 0xFF8 - CSRBSR + * offset 0x7FFFC 0xFFC - CBAR + */ #define TSI148_CSRBCR 0xFF4 #define TSI148_CSRBSR 0xFF8 #define TSI148_CBAR 0xFFC - /* - * TSI148 Register Bit Definitions - */ +/* + * TSI148 Register Bit Definitions + */ - /* - * PFCS Register Set - */ +/* + * PFCS Register Set + */ #define TSI148_PCFS_CMMD_SERR BIT(8) /* SERR_L out pin ssys err */ #define TSI148_PCFS_CMMD_PERR BIT(6) /* PERR_L out pin parity */ #define TSI148_PCFS_CMMD_MSTR BIT(2) /* PCI bus master */ @@ -547,7 +543,7 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_PCFS_STAT_RCVMA BIT(13) /* Received Master Abort */ #define TSI148_PCFS_STAT_RCVTA BIT(12) /* Received Target Abort */ #define TSI148_PCFS_STAT_SIGTA BIT(11) /* Signalled Target Abort */ -#define TSI148_PCFS_STAT_SELTIM (3<<9) /* DELSEL Timing */ +#define TSI148_PCFS_STAT_SELTIM (3 << 9) /* DELSEL Timing */ #define TSI148_PCFS_STAT_DPAR BIT(8) /* Data Parity Err Reported */ #define TSI148_PCFS_STAT_FAST BIT(7) /* Fast back-to-back Cap */ #define TSI148_PCFS_STAT_P66M BIT(5) /* 66 MHz Capable */ @@ -556,49 +552,49 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * Revision ID/Class Code Registers (CRG +$008) */ -#define TSI148_PCFS_CLAS_M (0xFF<<24) /* Class ID */ -#define TSI148_PCFS_SUBCLAS_M (0xFF<<16) /* Sub-Class ID */ -#define TSI148_PCFS_PROGIF_M (0xFF<<8) /* Sub-Class ID */ -#define TSI148_PCFS_REVID_M (0xFF<<0) /* Rev ID */ +#define TSI148_PCFS_CLAS_M (0xFF << 24) /* Class ID */ +#define TSI148_PCFS_SUBCLAS_M (0xFF << 16) /* Sub-Class ID */ +#define TSI148_PCFS_PROGIF_M (0xFF << 8) /* Sub-Class ID */ +#define TSI148_PCFS_REVID_M (0xFF << 0) /* Rev ID */ /* * Cache Line Size/ Master Latency Timer/ Header Type Registers (CRG + $00C) */ -#define TSI148_PCFS_HEAD_M (0xFF<<16) /* Master Lat Timer */ -#define TSI148_PCFS_MLAT_M (0xFF<<8) /* Master Lat Timer */ -#define TSI148_PCFS_CLSZ_M (0xFF<<0) /* Cache Line Size */ +#define TSI148_PCFS_HEAD_M (0xFF << 16) /* Master Lat Timer */ +#define TSI148_PCFS_MLAT_M (0xFF << 8) /* Master Lat Timer */ +#define TSI148_PCFS_CLSZ_M (0xFF << 0) /* Cache Line Size */ /* * Memory Base Address Lower Reg (CRG + $010) */ -#define TSI148_PCFS_MBARL_BASEL_M (0xFFFFF<<12) /* Base Addr Lower Mask */ +#define TSI148_PCFS_MBARL_BASEL_M (0xFFFFF << 12) /* Base Addr Lower Mask */ #define TSI148_PCFS_MBARL_PRE BIT(3) /* Prefetch */ -#define TSI148_PCFS_MBARL_MTYPE_M (3<<1) /* Memory Type Mask */ +#define TSI148_PCFS_MBARL_MTYPE_M (3 << 1) /* Memory Type Mask */ #define TSI148_PCFS_MBARL_IOMEM BIT(0) /* I/O Space Indicator */ /* * Message Signaled Interrupt Capabilities Register (CRG + $040) */ #define TSI148_PCFS_MSICAP_64BAC BIT(7) /* 64-bit Address Capable */ -#define TSI148_PCFS_MSICAP_MME_M (7<<4) /* Multiple Msg Enable Mask */ -#define TSI148_PCFS_MSICAP_MMC_M (7<<1) /* Multiple Msg Capable Mask */ +#define TSI148_PCFS_MSICAP_MME_M (7 << 4) /* Multiple Msg Enable Mask */ +#define TSI148_PCFS_MSICAP_MMC_M (7 << 1) /* Multiple Msg Capable Mask */ #define TSI148_PCFS_MSICAP_MSIEN BIT(0) /* Msg signaled INT Enable */ /* * Message Address Lower Register (CRG +$044) */ -#define TSI148_PCFS_MSIAL_M (0x3FFFFFFF<<2) /* Mask */ +#define TSI148_PCFS_MSIAL_M (0x3FFFFFFF << 2) /* Mask */ /* * Message Data Register (CRG + 4C) */ -#define TSI148_PCFS_MSIMD_M (0xFFFF<<0) /* Mask */ +#define TSI148_PCFS_MSIMD_M (0xFFFF << 0) /* Mask */ /* * PCI-X Capabilities Register (CRG + $050) */ -#define TSI148_PCFS_PCIXCAP_MOST_M (7<<4) /* Max outstanding Split Tran */ -#define TSI148_PCFS_PCIXCAP_MMRBC_M (3<<2) /* Max Mem Read byte cnt */ +#define TSI148_PCFS_PCIXCAP_MOST_M (7 << 4) /* Max outstanding Split Tran */ +#define TSI148_PCFS_PCIXCAP_MMRBC_M (3 << 2) /* Max Mem Read byte cnt */ #define TSI148_PCFS_PCIXCAP_ERO BIT(1) /* Enable Relaxed Ordering */ #define TSI148_PCFS_PCIXCAP_DPERE BIT(0) /* Data Parity Recover Enable */ @@ -606,18 +602,17 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, * PCI-X Status Register (CRG +$054) */ #define TSI148_PCFS_PCIXSTAT_RSCEM BIT(29) /* Received Split Comp Error */ -#define TSI148_PCFS_PCIXSTAT_DMCRS_M (7<<26) /* max Cumulative Read Size */ -#define TSI148_PCFS_PCIXSTAT_DMOST_M (7<<23) /* max outstanding Split Trans - */ -#define TSI148_PCFS_PCIXSTAT_DMMRC_M (3<<21) /* max mem read byte count */ +#define TSI148_PCFS_PCIXSTAT_DMCRS_M (7 << 26) /* max Cumulative Read Size */ +#define TSI148_PCFS_PCIXSTAT_DMOST_M (7 << 23) /* max outstanding Split Trans */ +#define TSI148_PCFS_PCIXSTAT_DMMRC_M (3 << 21) /* max mem read byte count */ #define TSI148_PCFS_PCIXSTAT_DC BIT(20) /* Device Complexity */ #define TSI148_PCFS_PCIXSTAT_USC BIT(19) /* Unexpected Split comp */ #define TSI148_PCFS_PCIXSTAT_SCD BIT(18) /* Split completion discard */ #define TSI148_PCFS_PCIXSTAT_133C BIT(17) /* 133MHz capable */ #define TSI148_PCFS_PCIXSTAT_64D BIT(16) /* 64 bit device */ -#define TSI148_PCFS_PCIXSTAT_BN_M (0xFF<<8) /* Bus number */ -#define TSI148_PCFS_PCIXSTAT_DN_M (0x1F<<3) /* Device number */ -#define TSI148_PCFS_PCIXSTAT_FN_M (7<<0) /* Function Number */ +#define TSI148_PCFS_PCIXSTAT_BN_M (0xFF << 8) /* Bus number */ +#define TSI148_PCFS_PCIXSTAT_DN_M (0x1F << 3) /* Device number */ +#define TSI148_PCFS_PCIXSTAT_FN_M (7 << 0) /* Function Number */ /* * LCSR Registers @@ -626,22 +621,22 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * Outbound Translation Starting Address Lower */ -#define TSI148_LCSR_OTSAL_M (0xFFFF<<16) /* Mask */ +#define TSI148_LCSR_OTSAL_M (0xFFFF << 16) /* Mask */ /* * Outbound Translation Ending Address Lower */ -#define TSI148_LCSR_OTEAL_M (0xFFFF<<16) /* Mask */ +#define TSI148_LCSR_OTEAL_M (0xFFFF << 16) /* Mask */ /* * Outbound Translation Offset Lower */ -#define TSI148_LCSR_OTOFFL_M (0xFFFF<<16) /* Mask */ +#define TSI148_LCSR_OTOFFL_M (0xFFFF << 16) /* Mask */ /* * Outbound Translation 2eSST Broadcast Select */ -#define TSI148_LCSR_OTBS_M (0xFFFFF<<0) /* Mask */ +#define TSI148_LCSR_OTBS_M (0xFFFFF << 0) /* Mask */ /* * Outbound Translation Attribute @@ -649,42 +644,42 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_OTAT_EN BIT(31) /* Window Enable */ #define TSI148_LCSR_OTAT_MRPFD BIT(18) /* Prefetch Disable */ -#define TSI148_LCSR_OTAT_PFS_M (3<<16) /* Prefetch Size Mask */ -#define TSI148_LCSR_OTAT_PFS_2 (0<<16) /* 2 Cache Lines P Size */ +#define TSI148_LCSR_OTAT_PFS_M (3 << 16) /* Prefetch Size Mask */ +#define TSI148_LCSR_OTAT_PFS_2 (0 << 16) /* 2 Cache Lines P Size */ #define TSI148_LCSR_OTAT_PFS_4 BIT(16) /* 4 Cache Lines P Size */ -#define TSI148_LCSR_OTAT_PFS_8 (2<<16) /* 8 Cache Lines P Size */ -#define TSI148_LCSR_OTAT_PFS_16 (3<<16) /* 16 Cache Lines P Size */ +#define TSI148_LCSR_OTAT_PFS_8 (2 << 16) /* 8 Cache Lines P Size */ +#define TSI148_LCSR_OTAT_PFS_16 (3 << 16) /* 16 Cache Lines P Size */ -#define TSI148_LCSR_OTAT_2eSSTM_M (7<<11) /* 2eSST Xfer Rate Mask */ -#define TSI148_LCSR_OTAT_2eSSTM_160 (0<<11) /* 160MB/s 2eSST Xfer Rate */ +#define TSI148_LCSR_OTAT_2eSSTM_M (7 << 11) /* 2eSST Xfer Rate Mask */ +#define TSI148_LCSR_OTAT_2eSSTM_160 (0 << 11) /* 160MB/s 2eSST Xfer Rate */ #define TSI148_LCSR_OTAT_2eSSTM_267 BIT(11) /* 267MB/s 2eSST Xfer Rate */ -#define TSI148_LCSR_OTAT_2eSSTM_320 (2<<11) /* 320MB/s 2eSST Xfer Rate */ +#define TSI148_LCSR_OTAT_2eSSTM_320 (2 << 11) /* 320MB/s 2eSST Xfer Rate */ -#define TSI148_LCSR_OTAT_TM_M (7<<8) /* Xfer Protocol Mask */ -#define TSI148_LCSR_OTAT_TM_SCT (0<<8) /* SCT Xfer Protocol */ +#define TSI148_LCSR_OTAT_TM_M (7 << 8) /* Xfer Protocol Mask */ +#define TSI148_LCSR_OTAT_TM_SCT (0 << 8) /* SCT Xfer Protocol */ #define TSI148_LCSR_OTAT_TM_BLT BIT(8) /* BLT Xfer Protocol */ -#define TSI148_LCSR_OTAT_TM_MBLT (2<<8) /* MBLT Xfer Protocol */ -#define TSI148_LCSR_OTAT_TM_2eVME (3<<8) /* 2eVME Xfer Protocol */ -#define TSI148_LCSR_OTAT_TM_2eSST (4<<8) /* 2eSST Xfer Protocol */ -#define TSI148_LCSR_OTAT_TM_2eSSTB (5<<8) /* 2eSST Bcast Xfer Protocol */ +#define TSI148_LCSR_OTAT_TM_MBLT (2 << 8) /* MBLT Xfer Protocol */ +#define TSI148_LCSR_OTAT_TM_2eVME (3 << 8) /* 2eVME Xfer Protocol */ +#define TSI148_LCSR_OTAT_TM_2eSST (4 << 8) /* 2eSST Xfer Protocol */ +#define TSI148_LCSR_OTAT_TM_2eSSTB (5 << 8) /* 2eSST Bcast Xfer Protocol */ -#define TSI148_LCSR_OTAT_DBW_M (3<<6) /* Max Data Width */ -#define TSI148_LCSR_OTAT_DBW_16 (0<<6) /* 16-bit Data Width */ +#define TSI148_LCSR_OTAT_DBW_M (3 << 6) /* Max Data Width */ +#define TSI148_LCSR_OTAT_DBW_16 (0 << 6) /* 16-bit Data Width */ #define TSI148_LCSR_OTAT_DBW_32 BIT(6) /* 32-bit Data Width */ #define TSI148_LCSR_OTAT_SUP BIT(5) /* Supervisory Access */ #define TSI148_LCSR_OTAT_PGM BIT(4) /* Program Access */ -#define TSI148_LCSR_OTAT_AMODE_M (0xf<<0) /* Address Mode Mask */ -#define TSI148_LCSR_OTAT_AMODE_A16 (0<<0) /* A16 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_M (0xf << 0) /* Address Mode Mask */ +#define TSI148_LCSR_OTAT_AMODE_A16 (0 << 0) /* A16 Address Space */ #define TSI148_LCSR_OTAT_AMODE_A24 BIT(0) /* A24 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_A32 (2<<0) /* A32 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_A64 (4<<0) /* A32 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_CRCSR (5<<0) /* CR/CSR Address Space */ -#define TSI148_LCSR_OTAT_AMODE_USER1 (8<<0) /* User1 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_USER2 (9<<0) /* User2 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_USER3 (10<<0) /* User3 Address Space */ -#define TSI148_LCSR_OTAT_AMODE_USER4 (11<<0) /* User4 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_A32 (2 << 0) /* A32 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_A64 (4 << 0) /* A32 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_CRCSR (5 << 0) /* CR/CSR Address Space */ +#define TSI148_LCSR_OTAT_AMODE_USER1 (8 << 0) /* User1 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_USER2 (9 << 0) /* User2 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_USER3 (10 << 0) /* User3 Address Space */ +#define TSI148_LCSR_OTAT_AMODE_USER4 (11 << 0) /* User4 Address Space */ /* * VME Master Control Register CRG+$234 @@ -696,46 +691,46 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_VMCTRL_RMWEN BIT(20) /* RMW Enable */ -#define TSI148_LCSR_VMCTRL_ATO_M (7<<16) /* Master Access Time-out Mask +#define TSI148_LCSR_VMCTRL_ATO_M (7 << 16) /* Master Access Time-out Mask */ -#define TSI148_LCSR_VMCTRL_ATO_32 (0<<16) /* 32 us */ +#define TSI148_LCSR_VMCTRL_ATO_32 (0 << 16) /* 32 us */ #define TSI148_LCSR_VMCTRL_ATO_128 BIT(16) /* 128 us */ -#define TSI148_LCSR_VMCTRL_ATO_512 (2<<16) /* 512 us */ -#define TSI148_LCSR_VMCTRL_ATO_2M (3<<16) /* 2 ms */ -#define TSI148_LCSR_VMCTRL_ATO_8M (4<<16) /* 8 ms */ -#define TSI148_LCSR_VMCTRL_ATO_32M (5<<16) /* 32 ms */ -#define TSI148_LCSR_VMCTRL_ATO_128M (6<<16) /* 128 ms */ -#define TSI148_LCSR_VMCTRL_ATO_DIS (7<<16) /* Disabled */ - -#define TSI148_LCSR_VMCTRL_VTOFF_M (7<<12) /* VMEbus Master Time off */ -#define TSI148_LCSR_VMCTRL_VTOFF_0 (0<<12) /* 0us */ +#define TSI148_LCSR_VMCTRL_ATO_512 (2 << 16) /* 512 us */ +#define TSI148_LCSR_VMCTRL_ATO_2M (3 << 16) /* 2 ms */ +#define TSI148_LCSR_VMCTRL_ATO_8M (4 << 16) /* 8 ms */ +#define TSI148_LCSR_VMCTRL_ATO_32M (5 << 16) /* 32 ms */ +#define TSI148_LCSR_VMCTRL_ATO_128M (6 << 16) /* 128 ms */ +#define TSI148_LCSR_VMCTRL_ATO_DIS (7 << 16) /* Disabled */ + +#define TSI148_LCSR_VMCTRL_VTOFF_M (7 << 12) /* VMEbus Master Time off */ +#define TSI148_LCSR_VMCTRL_VTOFF_0 (0 << 12) /* 0us */ #define TSI148_LCSR_VMCTRL_VTOFF_1 BIT(12) /* 1us */ -#define TSI148_LCSR_VMCTRL_VTOFF_2 (2<<12) /* 2us */ -#define TSI148_LCSR_VMCTRL_VTOFF_4 (3<<12) /* 4us */ -#define TSI148_LCSR_VMCTRL_VTOFF_8 (4<<12) /* 8us */ -#define TSI148_LCSR_VMCTRL_VTOFF_16 (5<<12) /* 16us */ -#define TSI148_LCSR_VMCTRL_VTOFF_32 (6<<12) /* 32us */ -#define TSI148_LCSR_VMCTRL_VTOFF_64 (7<<12) /* 64us */ - -#define TSI148_LCSR_VMCTRL_VTON_M (7<<8) /* VMEbus Master Time On */ -#define TSI148_LCSR_VMCTRL_VTON_4 (0<<8) /* 8us */ +#define TSI148_LCSR_VMCTRL_VTOFF_2 (2 << 12) /* 2us */ +#define TSI148_LCSR_VMCTRL_VTOFF_4 (3 << 12) /* 4us */ +#define TSI148_LCSR_VMCTRL_VTOFF_8 (4 << 12) /* 8us */ +#define TSI148_LCSR_VMCTRL_VTOFF_16 (5 << 12) /* 16us */ +#define TSI148_LCSR_VMCTRL_VTOFF_32 (6 << 12) /* 32us */ +#define TSI148_LCSR_VMCTRL_VTOFF_64 (7 << 12) /* 64us */ + +#define TSI148_LCSR_VMCTRL_VTON_M (7 << 8) /* VMEbus Master Time On */ +#define TSI148_LCSR_VMCTRL_VTON_4 (0 << 8) /* 8us */ #define TSI148_LCSR_VMCTRL_VTON_8 BIT(8) /* 8us */ -#define TSI148_LCSR_VMCTRL_VTON_16 (2<<8) /* 16us */ -#define TSI148_LCSR_VMCTRL_VTON_32 (3<<8) /* 32us */ -#define TSI148_LCSR_VMCTRL_VTON_64 (4<<8) /* 64us */ -#define TSI148_LCSR_VMCTRL_VTON_128 (5<<8) /* 128us */ -#define TSI148_LCSR_VMCTRL_VTON_256 (6<<8) /* 256us */ -#define TSI148_LCSR_VMCTRL_VTON_512 (7<<8) /* 512us */ - -#define TSI148_LCSR_VMCTRL_VREL_M (3<<3) /* VMEbus Master Rel Mode Mask +#define TSI148_LCSR_VMCTRL_VTON_16 (2 << 8) /* 16us */ +#define TSI148_LCSR_VMCTRL_VTON_32 (3 << 8) /* 32us */ +#define TSI148_LCSR_VMCTRL_VTON_64 (4 << 8) /* 64us */ +#define TSI148_LCSR_VMCTRL_VTON_128 (5 << 8) /* 128us */ +#define TSI148_LCSR_VMCTRL_VTON_256 (6 << 8) /* 256us */ +#define TSI148_LCSR_VMCTRL_VTON_512 (7 << 8) /* 512us */ + +#define TSI148_LCSR_VMCTRL_VREL_M (3 << 3) /* VMEbus Master Rel Mode Mask */ -#define TSI148_LCSR_VMCTRL_VREL_T_D (0<<3) /* Time on or Done */ +#define TSI148_LCSR_VMCTRL_VREL_T_D (0 << 3) /* Time on or Done */ #define TSI148_LCSR_VMCTRL_VREL_T_R_D BIT(3) /* Time on and REQ or Done */ -#define TSI148_LCSR_VMCTRL_VREL_T_B_D (2<<3) /* Time on and BCLR or Done */ -#define TSI148_LCSR_VMCTRL_VREL_T_D_R (3<<3) /* Time on or Done and REQ */ +#define TSI148_LCSR_VMCTRL_VREL_T_B_D (2 << 3) /* Time on and BCLR or Done */ +#define TSI148_LCSR_VMCTRL_VREL_T_D_R (3 << 3) /* Time on or Done and REQ */ #define TSI148_LCSR_VMCTRL_VFAIR BIT(2) /* VMEbus Master Fair Mode */ -#define TSI148_LCSR_VMCTRL_VREQL_M (3<<0) /* VMEbus Master Req Level Mask +#define TSI148_LCSR_VMCTRL_VREQL_M (3 << 0) /* VMEbus Master Req Level Mask */ /* @@ -743,20 +738,20 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, */ #define TSI148_LCSR_VCTRL_LRE BIT(31) /* Late Retry Enable */ -#define TSI148_LCSR_VCTRL_DLT_M (0xF<<24) /* Deadlock Timer */ -#define TSI148_LCSR_VCTRL_DLT_OFF (0<<24) /* Deadlock Timer Off */ +#define TSI148_LCSR_VCTRL_DLT_M (0xF << 24) /* Deadlock Timer */ +#define TSI148_LCSR_VCTRL_DLT_OFF (0 << 24) /* Deadlock Timer Off */ #define TSI148_LCSR_VCTRL_DLT_16 BIT(24) /* 16 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_32 (2<<24) /* 32 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_64 (3<<24) /* 64 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_128 (4<<24) /* 128 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_256 (5<<24) /* 256 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_512 (6<<24) /* 512 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_1024 (7<<24) /* 1024 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_2048 (8<<24) /* 2048 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_4096 (9<<24) /* 4096 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_8192 (0xA<<24) /* 8192 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_16384 (0xB<<24) /* 16384 VCLKS */ -#define TSI148_LCSR_VCTRL_DLT_32768 (0xC<<24) /* 32768 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_32 (2 << 24) /* 32 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_64 (3 << 24) /* 64 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_128 (4 << 24) /* 128 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_256 (5 << 24) /* 256 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_512 (6 << 24) /* 512 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_1024 (7 << 24) /* 1024 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_2048 (8 << 24) /* 2048 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_4096 (9 << 24) /* 4096 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_8192 (0xA << 24) /* 8192 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_16384 (0xB << 24) /* 16384 VCLKS */ +#define TSI148_LCSR_VCTRL_DLT_32768 (0xC << 24) /* 32768 VCLKS */ #define TSI148_LCSR_VCTRL_NERBB BIT(20) /* No Early Release of Bus Busy */ @@ -765,21 +760,20 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_VCTRL_LRESET BIT(16) /* Local Reset */ #define TSI148_LCSR_VCTRL_SFAILAI BIT(15) /* SYSFAIL Auto Slot ID */ -#define TSI148_LCSR_VCTRL_BID_M (0x1F<<8) /* Broadcast ID Mask */ +#define TSI148_LCSR_VCTRL_BID_M (0x1F << 8) /* Broadcast ID Mask */ #define TSI148_LCSR_VCTRL_ATOEN BIT(7) /* Arbiter Time-out Enable */ #define TSI148_LCSR_VCTRL_ROBIN BIT(6) /* VMEbus Round Robin */ -#define TSI148_LCSR_VCTRL_GTO_M (7<<0) /* VMEbus Global Time-out Mask - */ -#define TSI148_LCSR_VCTRL_GTO_8 (0<<0) /* 8 us */ +#define TSI148_LCSR_VCTRL_GTO_M (7 << 0) /* VMEbus Global Time-out Mask*/ +#define TSI148_LCSR_VCTRL_GTO_8 (0 << 0) /* 8 us */ #define TSI148_LCSR_VCTRL_GTO_16 BIT(0) /* 16 us */ -#define TSI148_LCSR_VCTRL_GTO_32 (2<<0) /* 32 us */ -#define TSI148_LCSR_VCTRL_GTO_64 (3<<0) /* 64 us */ -#define TSI148_LCSR_VCTRL_GTO_128 (4<<0) /* 128 us */ -#define TSI148_LCSR_VCTRL_GTO_256 (5<<0) /* 256 us */ -#define TSI148_LCSR_VCTRL_GTO_512 (6<<0) /* 512 us */ -#define TSI148_LCSR_VCTRL_GTO_DIS (7<<0) /* Disabled */ +#define TSI148_LCSR_VCTRL_GTO_32 (2 << 0) /* 32 us */ +#define TSI148_LCSR_VCTRL_GTO_64 (3 << 0) /* 64 us */ +#define TSI148_LCSR_VCTRL_GTO_128 (4 << 0) /* 128 us */ +#define TSI148_LCSR_VCTRL_GTO_256 (5 << 0) /* 256 us */ +#define TSI148_LCSR_VCTRL_GTO_512 (6 << 0) /* 512 us */ +#define TSI148_LCSR_VCTRL_GTO_DIS (7 << 0) /* Disabled */ /* * VMEbus Status Register CRG + $23C @@ -792,7 +786,7 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_VSTAT_ACFAILS BIT(9) /* AC fail status */ #define TSI148_LCSR_VSTAT_SCONS BIT(8) /* System Cont Status */ #define TSI148_LCSR_VSTAT_GAP BIT(5) /* Geographic Addr Parity */ -#define TSI148_LCSR_VSTAT_GA_M (0x1F<<0) /* Geographic Addr Mask */ +#define TSI148_LCSR_VSTAT_GA_M (0x1F << 0) /* Geographic Addr Mask */ /* * PCI Configuration Status Register CRG+$240 @@ -819,8 +813,8 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_VEAT_IACK BIT(16) /* IACK_ signal state */ #define TSI148_LCSR_VEAT_DS1 BIT(15) /* DS1_ signal state */ #define TSI148_LCSR_VEAT_DS0 BIT(14) /* DS0_ signal state */ -#define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */ -#define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */ +#define TSI148_LCSR_VEAT_AM_M (0x3F << 8) /* Address Mode Mask */ +#define TSI148_LCSR_VEAT_XAM_M (0xFF << 0) /* Master AMode Mask */ /* * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280 @@ -830,23 +824,23 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * Inbound Translation Starting Address Lower */ -#define TSI148_LCSR_ITSAL6432_M (0xFFFF<<16) /* Mask */ -#define TSI148_LCSR_ITSAL24_M (0x00FFF<<12) /* Mask */ -#define TSI148_LCSR_ITSAL16_M (0x0000FFF<<4) /* Mask */ +#define TSI148_LCSR_ITSAL6432_M (0xFFFF << 16) /* Mask */ +#define TSI148_LCSR_ITSAL24_M (0x00FFF << 12) /* Mask */ +#define TSI148_LCSR_ITSAL16_M (0x0000FFF << 4) /* Mask */ /* * Inbound Translation Ending Address Lower */ -#define TSI148_LCSR_ITEAL6432_M (0xFFFF<<16) /* Mask */ -#define TSI148_LCSR_ITEAL24_M (0x00FFF<<12) /* Mask */ -#define TSI148_LCSR_ITEAL16_M (0x0000FFF<<4) /* Mask */ +#define TSI148_LCSR_ITEAL6432_M (0xFFFF << 16) /* Mask */ +#define TSI148_LCSR_ITEAL24_M (0x00FFF << 12) /* Mask */ +#define TSI148_LCSR_ITEAL16_M (0x0000FFF << 4) /* Mask */ /* * Inbound Translation Offset Lower */ -#define TSI148_LCSR_ITOFFL6432_M (0xFFFF<<16) /* Mask */ -#define TSI148_LCSR_ITOFFL24_M (0xFFFFF<<12) /* Mask */ -#define TSI148_LCSR_ITOFFL16_M (0xFFFFFFF<<4) /* Mask */ +#define TSI148_LCSR_ITOFFL6432_M (0xFFFF << 16) /* Mask */ +#define TSI148_LCSR_ITOFFL24_M (0xFFFFF << 12) /* Mask */ +#define TSI148_LCSR_ITOFFL16_M (0xFFFFFFF << 4) /* Mask */ /* * Inbound Translation Attribute @@ -854,16 +848,16 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_ITAT_EN BIT(31) /* Window Enable */ #define TSI148_LCSR_ITAT_TH BIT(18) /* Prefetch Threshold */ -#define TSI148_LCSR_ITAT_VFS_M (3<<16) /* Virtual FIFO Size Mask */ -#define TSI148_LCSR_ITAT_VFS_64 (0<<16) /* 64 bytes Virtual FIFO Size */ +#define TSI148_LCSR_ITAT_VFS_M (3 << 16) /* Virtual FIFO Size Mask */ +#define TSI148_LCSR_ITAT_VFS_64 (0 << 16) /* 64 bytes Virtual FIFO Size */ #define TSI148_LCSR_ITAT_VFS_128 BIT(16) /* 128 bytes Virtual FIFO Sz */ -#define TSI148_LCSR_ITAT_VFS_256 (2<<16) /* 256 bytes Virtual FIFO Sz */ -#define TSI148_LCSR_ITAT_VFS_512 (3<<16) /* 512 bytes Virtual FIFO Sz */ +#define TSI148_LCSR_ITAT_VFS_256 (2 << 16) /* 256 bytes Virtual FIFO Sz */ +#define TSI148_LCSR_ITAT_VFS_512 (3 << 16) /* 512 bytes Virtual FIFO Sz */ -#define TSI148_LCSR_ITAT_2eSSTM_M (7<<12) /* 2eSST Xfer Rate Mask */ -#define TSI148_LCSR_ITAT_2eSSTM_160 (0<<12) /* 160MB/s 2eSST Xfer Rate */ +#define TSI148_LCSR_ITAT_2eSSTM_M (7 << 12) /* 2eSST Xfer Rate Mask */ +#define TSI148_LCSR_ITAT_2eSSTM_160 (0 << 12) /* 160MB/s 2eSST Xfer Rate */ #define TSI148_LCSR_ITAT_2eSSTM_267 BIT(12) /* 267MB/s 2eSST Xfer Rate */ -#define TSI148_LCSR_ITAT_2eSSTM_320 (2<<12) /* 320MB/s 2eSST Xfer Rate */ +#define TSI148_LCSR_ITAT_2eSSTM_320 (2 << 12) /* 320MB/s 2eSST Xfer Rate */ #define TSI148_LCSR_ITAT_2eSSTB BIT(11) /* 2eSST Bcast Xfer Protocol */ #define TSI148_LCSR_ITAT_2eSST BIT(10) /* 2eSST Xfer Protocol */ @@ -871,11 +865,11 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TSI148_LCSR_ITAT_MBLT BIT(8) /* MBLT Xfer Protocol */ #define TSI148_LCSR_ITAT_BLT BIT(7) /* BLT Xfer Protocol */ -#define TSI148_LCSR_ITAT_AS_M (7<<4) /* Address Space Mask */ -#define TSI148_LCSR_ITAT_AS_A16 (0<<4) /* A16 Address Space */ +#define TSI148_LCSR_ITAT_AS_M (7 << 4) /* Address Space Mask */ +#define TSI148_LCSR_ITAT_AS_A16 (0 << 4) /* A16 Address Space */ #define TSI148_LCSR_ITAT_AS_A24 BIT(4) /* A24 Address Space */ -#define TSI148_LCSR_ITAT_AS_A32 (2<<4) /* A32 Address Space */ -#define TSI148_LCSR_ITAT_AS_A64 (4<<4) /* A64 Address Space */ +#define TSI148_LCSR_ITAT_AS_A32 (2 << 4) /* A32 Address Space */ +#define TSI148_LCSR_ITAT_AS_A64 (4 << 4) /* A64 Address Space */ #define TSI148_LCSR_ITAT_SUPR BIT(3) /* Supervisor Access */ #define TSI148_LCSR_ITAT_NPRIV BIT(2) /* Non-Priv (User) Access */ @@ -885,18 +879,18 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * GCSR Base Address Lower Address CRG +$404 */ -#define TSI148_LCSR_GBAL_M (0x7FFFFFF<<5) /* Mask */ +#define TSI148_LCSR_GBAL_M (0x7FFFFFF << 5) /* Mask */ /* * GCSR Attribute Register CRG + $408 */ #define TSI148_LCSR_GCSRAT_EN BIT(7) /* Enable access to GCSR */ -#define TSI148_LCSR_GCSRAT_AS_M (7<<4) /* Address Space Mask */ -#define TSI148_LCSR_GCSRAT_AS_A16 (0<<4) /* Address Space 16 */ +#define TSI148_LCSR_GCSRAT_AS_M (7 << 4) /* Address Space Mask */ +#define TSI148_LCSR_GCSRAT_AS_A16 (0 << 4) /* Address Space 16 */ #define TSI148_LCSR_GCSRAT_AS_A24 BIT(4) /* Address Space 24 */ -#define TSI148_LCSR_GCSRAT_AS_A32 (2<<4) /* Address Space 32 */ -#define TSI148_LCSR_GCSRAT_AS_A64 (4<<4) /* Address Space 64 */ +#define TSI148_LCSR_GCSRAT_AS_A32 (2 << 4) /* Address Space 32 */ +#define TSI148_LCSR_GCSRAT_AS_A64 (4 << 4) /* Address Space 64 */ #define TSI148_LCSR_GCSRAT_SUPR BIT(3) /* Sup set -GCSR decoder */ #define TSI148_LCSR_GCSRAT_NPRIV BIT(2) /* Non-Privliged set - CGSR */ @@ -906,18 +900,18 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * CRG Base Address Lower Address CRG + $410 */ -#define TSI148_LCSR_CBAL_M (0xFFFFF<<12) +#define TSI148_LCSR_CBAL_M (0xFFFFF << 12) /* * CRG Attribute Register CRG + $414 */ #define TSI148_LCSR_CRGAT_EN BIT(7) /* Enable PRG Access */ -#define TSI148_LCSR_CRGAT_AS_M (7<<4) /* Address Space */ -#define TSI148_LCSR_CRGAT_AS_A16 (0<<4) /* Address Space 16 */ +#define TSI148_LCSR_CRGAT_AS_M (7 << 4) /* Address Space */ +#define TSI148_LCSR_CRGAT_AS_A16 (0 << 4) /* Address Space 16 */ #define TSI148_LCSR_CRGAT_AS_A24 BIT(4) /* Address Space 24 */ -#define TSI148_LCSR_CRGAT_AS_A32 (2<<4) /* Address Space 32 */ -#define TSI148_LCSR_CRGAT_AS_A64 (4<<4) /* Address Space 64 */ +#define TSI148_LCSR_CRGAT_AS_A32 (2 << 4) /* Address Space 32 */ +#define TSI148_LCSR_CRGAT_AS_A64 (4 << 4) /* Address Space 64 */ #define TSI148_LCSR_CRGAT_SUPR BIT(3) /* Supervisor Access */ #define TSI148_LCSR_CRGAT_NPRIV BIT(2) /* Non-Privliged(User) Access */ @@ -927,7 +921,7 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * CR/CSR Offset Lower Register CRG + $41C */ -#define TSI148_LCSR_CROL_M (0x1FFF<<19) /* Mask */ +#define TSI148_LCSR_CROL_M (0x1FFF << 19) /* Mask */ /* * CR/CSR Attribute register CRG + $420 @@ -937,18 +931,18 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * Location Monitor base address lower register CRG + $428 */ -#define TSI148_LCSR_LMBAL_M (0x7FFFFFF<<5) /* Mask */ +#define TSI148_LCSR_LMBAL_M (0x7FFFFFF << 5) /* Mask */ /* * Location Monitor Attribute Register CRG + $42C */ #define TSI148_LCSR_LMAT_EN BIT(7) /* Enable Location Monitor */ -#define TSI148_LCSR_LMAT_AS_M (7<<4) /* Address Space MASK */ -#define TSI148_LCSR_LMAT_AS_A16 (0<<4) /* A16 */ +#define TSI148_LCSR_LMAT_AS_M (7 << 4) /* Address Space MASK */ +#define TSI148_LCSR_LMAT_AS_A16 (0 << 4) /* A16 */ #define TSI148_LCSR_LMAT_AS_A24 BIT(4) /* A24 */ -#define TSI148_LCSR_LMAT_AS_A32 (2<<4) /* A32 */ -#define TSI148_LCSR_LMAT_AS_A64 (4<<4) /* A64 */ +#define TSI148_LCSR_LMAT_AS_A32 (2 << 4) /* A32 */ +#define TSI148_LCSR_LMAT_AS_A64 (4 << 4) /* A64 */ #define TSI148_LCSR_LMAT_SUPR BIT(3) /* Supervisor Access */ #define TSI148_LCSR_LMAT_NPRIV BIT(2) /* Non-Priv (User) Access */ @@ -958,58 +952,58 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, /* * Broadcast Pulse Generator Timer Register CRG + $438 */ -#define TSI148_LCSR_BPGTR_BPGT_M (0xFFFF<<0) /* Mask */ +#define TSI148_LCSR_BPGTR_BPGT_M (0xFFFF << 0) /* Mask */ /* * Broadcast Programmable Clock Timer Register CRG + $43C */ -#define TSI148_LCSR_BPCTR_BPCT_M (0xFFFFFF<<0) /* Mask */ +#define TSI148_LCSR_BPCTR_BPCT_M (0xFFFFFF << 0) /* Mask */ /* * VMEbus Interrupt Control Register CRG + $43C */ -#define TSI148_LCSR_VICR_CNTS_M (3<<22) /* Cntr Source MASK */ +#define TSI148_LCSR_VICR_CNTS_M (3 << 22) /* Cntr Source MASK */ #define TSI148_LCSR_VICR_CNTS_DIS BIT(22) /* Cntr Disable */ -#define TSI148_LCSR_VICR_CNTS_IRQ1 (2<<22) /* IRQ1 to Cntr */ -#define TSI148_LCSR_VICR_CNTS_IRQ2 (3<<22) /* IRQ2 to Cntr */ +#define TSI148_LCSR_VICR_CNTS_IRQ1 (2 << 22) /* IRQ1 to Cntr */ +#define TSI148_LCSR_VICR_CNTS_IRQ2 (3 << 22) /* IRQ2 to Cntr */ -#define TSI148_LCSR_VICR_EDGIS_M (3<<20) /* Edge interrupt MASK */ +#define TSI148_LCSR_VICR_EDGIS_M (3 << 20) /* Edge interrupt MASK */ #define TSI148_LCSR_VICR_EDGIS_DIS BIT(20) /* Edge interrupt Disable */ -#define TSI148_LCSR_VICR_EDGIS_IRQ1 (2<<20) /* IRQ1 to Edge */ -#define TSI148_LCSR_VICR_EDGIS_IRQ2 (3<<20) /* IRQ2 to Edge */ +#define TSI148_LCSR_VICR_EDGIS_IRQ1 (2 << 20) /* IRQ1 to Edge */ +#define TSI148_LCSR_VICR_EDGIS_IRQ2 (3 << 20) /* IRQ2 to Edge */ -#define TSI148_LCSR_VICR_IRQIF_M (3<<18) /* IRQ1* Function MASK */ +#define TSI148_LCSR_VICR_IRQIF_M (3 << 18) /* IRQ1* Function MASK */ #define TSI148_LCSR_VICR_IRQIF_NORM BIT(18) /* Normal */ -#define TSI148_LCSR_VICR_IRQIF_PULSE (2<<18) /* Pulse Generator */ -#define TSI148_LCSR_VICR_IRQIF_PROG (3<<18) /* Programmable Clock */ -#define TSI148_LCSR_VICR_IRQIF_1U (4<<18) /* 1us Clock */ +#define TSI148_LCSR_VICR_IRQIF_PULSE (2 << 18) /* Pulse Generator */ +#define TSI148_LCSR_VICR_IRQIF_PROG (3 << 18) /* Programmable Clock */ +#define TSI148_LCSR_VICR_IRQIF_1U (4 << 18) /* 1us Clock */ -#define TSI148_LCSR_VICR_IRQ2F_M (3<<16) /* IRQ2* Function MASK */ +#define TSI148_LCSR_VICR_IRQ2F_M (3 << 16) /* IRQ2* Function MASK */ #define TSI148_LCSR_VICR_IRQ2F_NORM BIT(16) /* Normal */ -#define TSI148_LCSR_VICR_IRQ2F_PULSE (2<<16) /* Pulse Generator */ -#define TSI148_LCSR_VICR_IRQ2F_PROG (3<<16) /* Programmable Clock */ -#define TSI148_LCSR_VICR_IRQ2F_1U (4<<16) /* 1us Clock */ +#define TSI148_LCSR_VICR_IRQ2F_PULSE (2 << 16) /* Pulse Generator */ +#define TSI148_LCSR_VICR_IRQ2F_PROG (3 << 16) /* Programmable Clock */ +#define TSI148_LCSR_VICR_IRQ2F_1U (4 << 16) /* 1us Clock */ #define TSI148_LCSR_VICR_BIP BIT(15) /* Broadcast Interrupt Pulse */ #define TSI148_LCSR_VICR_IRQC BIT(12) /* VMEbus IRQ Clear */ #define TSI148_LCSR_VICR_IRQS BIT(11) /* VMEbus IRQ Status */ -#define TSI148_LCSR_VICR_IRQL_M (7<<8) /* VMEbus SW IRQ Level Mask */ +#define TSI148_LCSR_VICR_IRQL_M (7 << 8) /* VMEbus SW IRQ Level Mask */ #define TSI148_LCSR_VICR_IRQL_1 BIT(8) /* VMEbus SW IRQ Level 1 */ -#define TSI148_LCSR_VICR_IRQL_2 (2<<8) /* VMEbus SW IRQ Level 2 */ -#define TSI148_LCSR_VICR_IRQL_3 (3<<8) /* VMEbus SW IRQ Level 3 */ -#define TSI148_LCSR_VICR_IRQL_4 (4<<8) /* VMEbus SW IRQ Level 4 */ -#define TSI148_LCSR_VICR_IRQL_5 (5<<8) /* VMEbus SW IRQ Level 5 */ -#define TSI148_LCSR_VICR_IRQL_6 (6<<8) /* VMEbus SW IRQ Level 6 */ -#define TSI148_LCSR_VICR_IRQL_7 (7<<8) /* VMEbus SW IRQ Level 7 */ +#define TSI148_LCSR_VICR_IRQL_2 (2 << 8) /* VMEbus SW IRQ Level 2 */ +#define TSI148_LCSR_VICR_IRQL_3 (3 << 8) /* VMEbus SW IRQ Level 3 */ +#define TSI148_LCSR_VICR_IRQL_4 (4 << 8) /* VMEbus SW IRQ Level 4 */ +#define TSI148_LCSR_VICR_IRQL_5 (5 << 8) /* VMEbus SW IRQ Level 5 */ +#define TSI148_LCSR_VICR_IRQL_6 (6 << 8) /* VMEbus SW IRQ Level 6 */ +#define TSI148_LCSR_VICR_IRQL_7 (7 << 8) /* VMEbus SW IRQ Level 7 */ static const int TSI148_LCSR_VICR_IRQL[8] = { 0, TSI148_LCSR_VICR_IRQL_1, TSI148_LCSR_VICR_IRQL_2, TSI148_LCSR_VICR_IRQL_3, TSI148_LCSR_VICR_IRQL_4, TSI148_LCSR_VICR_IRQL_5, TSI148_LCSR_VICR_IRQL_6, TSI148_LCSR_VICR_IRQL_7 }; -#define TSI148_LCSR_VICR_STID_M (0xFF<<0) /* Status/ID Mask */ +#define TSI148_LCSR_VICR_STID_M (0xFF << 0) /* Status/ID Mask */ /* * Interrupt Enable Register CRG + $440 @@ -1161,33 +1155,33 @@ static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C, /* * Interrupt Map Register 1 CRG + $458 */ -#define TSI148_LCSR_INTM1_DMA1M_M (3<<18) /* DMA 1 */ -#define TSI148_LCSR_INTM1_DMA0M_M (3<<16) /* DMA 0 */ -#define TSI148_LCSR_INTM1_LM3M_M (3<<14) /* Location Monitor 3 */ -#define TSI148_LCSR_INTM1_LM2M_M (3<<12) /* Location Monitor 2 */ -#define TSI148_LCSR_INTM1_LM1M_M (3<<10) /* Location Monitor 1 */ -#define TSI148_LCSR_INTM1_LM0M_M (3<<8) /* Location Monitor 0 */ -#define TSI148_LCSR_INTM1_MB3M_M (3<<6) /* Mail Box 3 */ -#define TSI148_LCSR_INTM1_MB2M_M (3<<4) /* Mail Box 2 */ -#define TSI148_LCSR_INTM1_MB1M_M (3<<2) /* Mail Box 1 */ -#define TSI148_LCSR_INTM1_MB0M_M (3<<0) /* Mail Box 0 */ +#define TSI148_LCSR_INTM1_DMA1M_M (3 << 18) /* DMA 1 */ +#define TSI148_LCSR_INTM1_DMA0M_M (3 << 16) /* DMA 0 */ +#define TSI148_LCSR_INTM1_LM3M_M (3 << 14) /* Location Monitor 3 */ +#define TSI148_LCSR_INTM1_LM2M_M (3 << 12) /* Location Monitor 2 */ +#define TSI148_LCSR_INTM1_LM1M_M (3 << 10) /* Location Monitor 1 */ +#define TSI148_LCSR_INTM1_LM0M_M (3 << 8) /* Location Monitor 0 */ +#define TSI148_LCSR_INTM1_MB3M_M (3 << 6) /* Mail Box 3 */ +#define TSI148_LCSR_INTM1_MB2M_M (3 << 4) /* Mail Box 2 */ +#define TSI148_LCSR_INTM1_MB1M_M (3 << 2) /* Mail Box 1 */ +#define TSI148_LCSR_INTM1_MB0M_M (3 << 0) /* Mail Box 0 */ /* * Interrupt Map Register 2 CRG + $45C */ -#define TSI148_LCSR_INTM2_PERRM_M (3<<26) /* PCI Bus Error */ -#define TSI148_LCSR_INTM2_VERRM_M (3<<24) /* VMEbus Error */ -#define TSI148_LCSR_INTM2_VIEM_M (3<<22) /* VMEbus IRQ Edge */ -#define TSI148_LCSR_INTM2_IACKM_M (3<<20) /* IACK */ -#define TSI148_LCSR_INTM2_SYSFLM_M (3<<18) /* System Fail */ -#define TSI148_LCSR_INTM2_ACFLM_M (3<<16) /* AC Fail */ -#define TSI148_LCSR_INTM2_IRQ7M_M (3<<14) /* IRQ7 */ -#define TSI148_LCSR_INTM2_IRQ6M_M (3<<12) /* IRQ6 */ -#define TSI148_LCSR_INTM2_IRQ5M_M (3<<10) /* IRQ5 */ -#define TSI148_LCSR_INTM2_IRQ4M_M (3<<8) /* IRQ4 */ -#define TSI148_LCSR_INTM2_IRQ3M_M (3<<6) /* IRQ3 */ -#define TSI148_LCSR_INTM2_IRQ2M_M (3<<4) /* IRQ2 */ -#define TSI148_LCSR_INTM2_IRQ1M_M (3<<2) /* IRQ1 */ +#define TSI148_LCSR_INTM2_PERRM_M (3 << 26) /* PCI Bus Error */ +#define TSI148_LCSR_INTM2_VERRM_M (3 << 24) /* VMEbus Error */ +#define TSI148_LCSR_INTM2_VIEM_M (3 << 22) /* VMEbus IRQ Edge */ +#define TSI148_LCSR_INTM2_IACKM_M (3 << 20) /* IACK */ +#define TSI148_LCSR_INTM2_SYSFLM_M (3 << 18) /* System Fail */ +#define TSI148_LCSR_INTM2_ACFLM_M (3 << 16) /* AC Fail */ +#define TSI148_LCSR_INTM2_IRQ7M_M (3 << 14) /* IRQ7 */ +#define TSI148_LCSR_INTM2_IRQ6M_M (3 << 12) /* IRQ6 */ +#define TSI148_LCSR_INTM2_IRQ5M_M (3 << 10) /* IRQ5 */ +#define TSI148_LCSR_INTM2_IRQ4M_M (3 << 8) /* IRQ4 */ +#define TSI148_LCSR_INTM2_IRQ3M_M (3 << 6) /* IRQ3 */ +#define TSI148_LCSR_INTM2_IRQ2M_M (3 << 4) /* IRQ2 */ +#define TSI148_LCSR_INTM2_IRQ1M_M (3 << 2) /* IRQ1 */ /* * DMA Control (0-1) Registers CRG + $500 @@ -1198,45 +1192,45 @@ static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C, #define TSI148_LCSR_DCTL_MOD BIT(23) /* Mode */ -#define TSI148_LCSR_DCTL_VBKS_M (7<<12) /* VMEbus block Size MASK */ -#define TSI148_LCSR_DCTL_VBKS_32 (0<<12) /* VMEbus block Size 32 */ +#define TSI148_LCSR_DCTL_VBKS_M (7 << 12) /* VMEbus block Size MASK */ +#define TSI148_LCSR_DCTL_VBKS_32 (0 << 12) /* VMEbus block Size 32 */ #define TSI148_LCSR_DCTL_VBKS_64 BIT(12) /* VMEbus block Size 64 */ -#define TSI148_LCSR_DCTL_VBKS_128 (2<<12) /* VMEbus block Size 128 */ -#define TSI148_LCSR_DCTL_VBKS_256 (3<<12) /* VMEbus block Size 256 */ -#define TSI148_LCSR_DCTL_VBKS_512 (4<<12) /* VMEbus block Size 512 */ -#define TSI148_LCSR_DCTL_VBKS_1024 (5<<12) /* VMEbus block Size 1024 */ -#define TSI148_LCSR_DCTL_VBKS_2048 (6<<12) /* VMEbus block Size 2048 */ -#define TSI148_LCSR_DCTL_VBKS_4096 (7<<12) /* VMEbus block Size 4096 */ - -#define TSI148_LCSR_DCTL_VBOT_M (7<<8) /* VMEbus back-off MASK */ -#define TSI148_LCSR_DCTL_VBOT_0 (0<<8) /* VMEbus back-off 0us */ +#define TSI148_LCSR_DCTL_VBKS_128 (2 << 12) /* VMEbus block Size 128 */ +#define TSI148_LCSR_DCTL_VBKS_256 (3 << 12) /* VMEbus block Size 256 */ +#define TSI148_LCSR_DCTL_VBKS_512 (4 << 12) /* VMEbus block Size 512 */ +#define TSI148_LCSR_DCTL_VBKS_1024 (5 << 12) /* VMEbus block Size 1024 */ +#define TSI148_LCSR_DCTL_VBKS_2048 (6 << 12) /* VMEbus block Size 2048 */ +#define TSI148_LCSR_DCTL_VBKS_4096 (7 << 12) /* VMEbus block Size 4096 */ + +#define TSI148_LCSR_DCTL_VBOT_M (7 << 8) /* VMEbus back-off MASK */ +#define TSI148_LCSR_DCTL_VBOT_0 (0 << 8) /* VMEbus back-off 0us */ #define TSI148_LCSR_DCTL_VBOT_1 BIT(8) /* VMEbus back-off 1us */ -#define TSI148_LCSR_DCTL_VBOT_2 (2<<8) /* VMEbus back-off 2us */ -#define TSI148_LCSR_DCTL_VBOT_4 (3<<8) /* VMEbus back-off 4us */ -#define TSI148_LCSR_DCTL_VBOT_8 (4<<8) /* VMEbus back-off 8us */ -#define TSI148_LCSR_DCTL_VBOT_16 (5<<8) /* VMEbus back-off 16us */ -#define TSI148_LCSR_DCTL_VBOT_32 (6<<8) /* VMEbus back-off 32us */ -#define TSI148_LCSR_DCTL_VBOT_64 (7<<8) /* VMEbus back-off 64us */ - -#define TSI148_LCSR_DCTL_PBKS_M (7<<4) /* PCI block size MASK */ -#define TSI148_LCSR_DCTL_PBKS_32 (0<<4) /* PCI block size 32 bytes */ +#define TSI148_LCSR_DCTL_VBOT_2 (2 << 8) /* VMEbus back-off 2us */ +#define TSI148_LCSR_DCTL_VBOT_4 (3 << 8) /* VMEbus back-off 4us */ +#define TSI148_LCSR_DCTL_VBOT_8 (4 << 8) /* VMEbus back-off 8us */ +#define TSI148_LCSR_DCTL_VBOT_16 (5 << 8) /* VMEbus back-off 16us */ +#define TSI148_LCSR_DCTL_VBOT_32 (6 << 8) /* VMEbus back-off 32us */ +#define TSI148_LCSR_DCTL_VBOT_64 (7 << 8) /* VMEbus back-off 64us */ + +#define TSI148_LCSR_DCTL_PBKS_M (7 << 4) /* PCI block size MASK */ +#define TSI148_LCSR_DCTL_PBKS_32 (0 << 4) /* PCI block size 32 bytes */ #define TSI148_LCSR_DCTL_PBKS_64 BIT(4) /* PCI block size 64 bytes */ -#define TSI148_LCSR_DCTL_PBKS_128 (2<<4) /* PCI block size 128 bytes */ -#define TSI148_LCSR_DCTL_PBKS_256 (3<<4) /* PCI block size 256 bytes */ -#define TSI148_LCSR_DCTL_PBKS_512 (4<<4) /* PCI block size 512 bytes */ -#define TSI148_LCSR_DCTL_PBKS_1024 (5<<4) /* PCI block size 1024 bytes */ -#define TSI148_LCSR_DCTL_PBKS_2048 (6<<4) /* PCI block size 2048 bytes */ -#define TSI148_LCSR_DCTL_PBKS_4096 (7<<4) /* PCI block size 4096 bytes */ - -#define TSI148_LCSR_DCTL_PBOT_M (7<<0) /* PCI back off MASK */ -#define TSI148_LCSR_DCTL_PBOT_0 (0<<0) /* PCI back off 0us */ +#define TSI148_LCSR_DCTL_PBKS_128 (2 << 4) /* PCI block size 128 bytes */ +#define TSI148_LCSR_DCTL_PBKS_256 (3 << 4) /* PCI block size 256 bytes */ +#define TSI148_LCSR_DCTL_PBKS_512 (4 << 4) /* PCI block size 512 bytes */ +#define TSI148_LCSR_DCTL_PBKS_1024 (5 << 4) /* PCI block size 1024 bytes */ +#define TSI148_LCSR_DCTL_PBKS_2048 (6 << 4) /* PCI block size 2048 bytes */ +#define TSI148_LCSR_DCTL_PBKS_4096 (7 << 4) /* PCI block size 4096 bytes */ + +#define TSI148_LCSR_DCTL_PBOT_M (7 << 0) /* PCI back off MASK */ +#define TSI148_LCSR_DCTL_PBOT_0 (0 << 0) /* PCI back off 0us */ #define TSI148_LCSR_DCTL_PBOT_1 BIT(0) /* PCI back off 1us */ -#define TSI148_LCSR_DCTL_PBOT_2 (2<<0) /* PCI back off 2us */ -#define TSI148_LCSR_DCTL_PBOT_4 (3<<0) /* PCI back off 3us */ -#define TSI148_LCSR_DCTL_PBOT_8 (4<<0) /* PCI back off 4us */ -#define TSI148_LCSR_DCTL_PBOT_16 (5<<0) /* PCI back off 8us */ -#define TSI148_LCSR_DCTL_PBOT_32 (6<<0) /* PCI back off 16us */ -#define TSI148_LCSR_DCTL_PBOT_64 (7<<0) /* PCI back off 32us */ +#define TSI148_LCSR_DCTL_PBOT_2 (2 << 0) /* PCI back off 2us */ +#define TSI148_LCSR_DCTL_PBOT_4 (3 << 0) /* PCI back off 3us */ +#define TSI148_LCSR_DCTL_PBOT_8 (4 << 0) /* PCI back off 4us */ +#define TSI148_LCSR_DCTL_PBOT_16 (5 << 0) /* PCI back off 8us */ +#define TSI148_LCSR_DCTL_PBOT_32 (6 << 0) /* PCI back off 16us */ +#define TSI148_LCSR_DCTL_PBOT_64 (7 << 0) /* PCI back off 32us */ /* * DMA Status Registers (0-1) CRG + $504 @@ -1253,97 +1247,97 @@ static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C, /* * DMA Current Link Address Lower (0-1) */ -#define TSI148_LCSR_DCLAL_M (0x3FFFFFF<<6) /* Mask */ +#define TSI148_LCSR_DCLAL_M (0x3FFFFFF << 6) /* Mask */ /* * DMA Source Attribute (0-1) Reg */ -#define TSI148_LCSR_DSAT_TYP_M (3<<28) /* Source Bus Type */ -#define TSI148_LCSR_DSAT_TYP_PCI (0<<28) /* PCI Bus */ +#define TSI148_LCSR_DSAT_TYP_M (3 << 28) /* Source Bus Type */ +#define TSI148_LCSR_DSAT_TYP_PCI (0 << 28) /* PCI Bus */ #define TSI148_LCSR_DSAT_TYP_VME BIT(28) /* VMEbus */ -#define TSI148_LCSR_DSAT_TYP_PAT (2<<28) /* Data Pattern */ +#define TSI148_LCSR_DSAT_TYP_PAT (2 << 28) /* Data Pattern */ #define TSI148_LCSR_DSAT_PSZ BIT(25) /* Pattern Size */ #define TSI148_LCSR_DSAT_NIN BIT(24) /* No Increment */ -#define TSI148_LCSR_DSAT_2eSSTM_M (3<<11) /* 2eSST Trans Rate Mask */ -#define TSI148_LCSR_DSAT_2eSSTM_160 (0<<11) /* 160 MB/s */ +#define TSI148_LCSR_DSAT_2eSSTM_M (3 << 11) /* 2eSST Trans Rate Mask */ +#define TSI148_LCSR_DSAT_2eSSTM_160 (0 << 11) /* 160 MB/s */ #define TSI148_LCSR_DSAT_2eSSTM_267 BIT(11) /* 267 MB/s */ -#define TSI148_LCSR_DSAT_2eSSTM_320 (2<<11) /* 320 MB/s */ +#define TSI148_LCSR_DSAT_2eSSTM_320 (2 << 11) /* 320 MB/s */ -#define TSI148_LCSR_DSAT_TM_M (7<<8) /* Bus Transfer Protocol Mask */ -#define TSI148_LCSR_DSAT_TM_SCT (0<<8) /* SCT */ +#define TSI148_LCSR_DSAT_TM_M (7 << 8) /* Bus Transfer Protocol Mask */ +#define TSI148_LCSR_DSAT_TM_SCT (0 << 8) /* SCT */ #define TSI148_LCSR_DSAT_TM_BLT BIT(8) /* BLT */ -#define TSI148_LCSR_DSAT_TM_MBLT (2<<8) /* MBLT */ -#define TSI148_LCSR_DSAT_TM_2eVME (3<<8) /* 2eVME */ -#define TSI148_LCSR_DSAT_TM_2eSST (4<<8) /* 2eSST */ -#define TSI148_LCSR_DSAT_TM_2eSSTB (5<<8) /* 2eSST Broadcast */ +#define TSI148_LCSR_DSAT_TM_MBLT (2 << 8) /* MBLT */ +#define TSI148_LCSR_DSAT_TM_2eVME (3 << 8) /* 2eVME */ +#define TSI148_LCSR_DSAT_TM_2eSST (4 << 8) /* 2eSST */ +#define TSI148_LCSR_DSAT_TM_2eSSTB (5 << 8) /* 2eSST Broadcast */ -#define TSI148_LCSR_DSAT_DBW_M (3<<6) /* Max Data Width MASK */ -#define TSI148_LCSR_DSAT_DBW_16 (0<<6) /* 16 Bits */ +#define TSI148_LCSR_DSAT_DBW_M (3 << 6) /* Max Data Width MASK */ +#define TSI148_LCSR_DSAT_DBW_16 (0 << 6) /* 16 Bits */ #define TSI148_LCSR_DSAT_DBW_32 BIT(6) /* 32 Bits */ #define TSI148_LCSR_DSAT_SUP BIT(5) /* Supervisory Mode */ #define TSI148_LCSR_DSAT_PGM BIT(4) /* Program Mode */ -#define TSI148_LCSR_DSAT_AMODE_M (0xf<<0) /* Address Space Mask */ -#define TSI148_LCSR_DSAT_AMODE_A16 (0<<0) /* A16 */ +#define TSI148_LCSR_DSAT_AMODE_M (0xf << 0) /* Address Space Mask */ +#define TSI148_LCSR_DSAT_AMODE_A16 (0 << 0) /* A16 */ #define TSI148_LCSR_DSAT_AMODE_A24 BIT(0) /* A24 */ -#define TSI148_LCSR_DSAT_AMODE_A32 (2<<0) /* A32 */ -#define TSI148_LCSR_DSAT_AMODE_A64 (4<<0) /* A64 */ -#define TSI148_LCSR_DSAT_AMODE_CRCSR (5<<0) /* CR/CSR */ -#define TSI148_LCSR_DSAT_AMODE_USER1 (8<<0) /* User1 */ -#define TSI148_LCSR_DSAT_AMODE_USER2 (9<<0) /* User2 */ -#define TSI148_LCSR_DSAT_AMODE_USER3 (0xa<<0) /* User3 */ -#define TSI148_LCSR_DSAT_AMODE_USER4 (0xb<<0) /* User4 */ +#define TSI148_LCSR_DSAT_AMODE_A32 (2 << 0) /* A32 */ +#define TSI148_LCSR_DSAT_AMODE_A64 (4 << 0) /* A64 */ +#define TSI148_LCSR_DSAT_AMODE_CRCSR (5 << 0) /* CR/CSR */ +#define TSI148_LCSR_DSAT_AMODE_USER1 (8 << 0) /* User1 */ +#define TSI148_LCSR_DSAT_AMODE_USER2 (9 << 0) /* User2 */ +#define TSI148_LCSR_DSAT_AMODE_USER3 (0xa << 0) /* User3 */ +#define TSI148_LCSR_DSAT_AMODE_USER4 (0xb << 0) /* User4 */ /* * DMA Destination Attribute Registers (0-1) */ -#define TSI148_LCSR_DDAT_TYP_PCI (0<<28) /* Destination PCI Bus */ +#define TSI148_LCSR_DDAT_TYP_PCI (0 << 28) /* Destination PCI Bus */ #define TSI148_LCSR_DDAT_TYP_VME BIT(28) /* Destination VMEbus */ -#define TSI148_LCSR_DDAT_2eSSTM_M (3<<11) /* 2eSST Transfer Rate Mask */ -#define TSI148_LCSR_DDAT_2eSSTM_160 (0<<11) /* 160 MB/s */ +#define TSI148_LCSR_DDAT_2eSSTM_M (3 << 11) /* 2eSST Transfer Rate Mask */ +#define TSI148_LCSR_DDAT_2eSSTM_160 (0 << 11) /* 160 MB/s */ #define TSI148_LCSR_DDAT_2eSSTM_267 BIT(11) /* 267 MB/s */ -#define TSI148_LCSR_DDAT_2eSSTM_320 (2<<11) /* 320 MB/s */ +#define TSI148_LCSR_DDAT_2eSSTM_320 (2 << 11) /* 320 MB/s */ -#define TSI148_LCSR_DDAT_TM_M (7<<8) /* Bus Transfer Protocol Mask */ -#define TSI148_LCSR_DDAT_TM_SCT (0<<8) /* SCT */ +#define TSI148_LCSR_DDAT_TM_M (7 << 8) /* Bus Transfer Protocol Mask */ +#define TSI148_LCSR_DDAT_TM_SCT (0 << 8) /* SCT */ #define TSI148_LCSR_DDAT_TM_BLT BIT(8) /* BLT */ -#define TSI148_LCSR_DDAT_TM_MBLT (2<<8) /* MBLT */ -#define TSI148_LCSR_DDAT_TM_2eVME (3<<8) /* 2eVME */ -#define TSI148_LCSR_DDAT_TM_2eSST (4<<8) /* 2eSST */ -#define TSI148_LCSR_DDAT_TM_2eSSTB (5<<8) /* 2eSST Broadcast */ +#define TSI148_LCSR_DDAT_TM_MBLT (2 << 8) /* MBLT */ +#define TSI148_LCSR_DDAT_TM_2eVME (3 << 8) /* 2eVME */ +#define TSI148_LCSR_DDAT_TM_2eSST (4 << 8) /* 2eSST */ +#define TSI148_LCSR_DDAT_TM_2eSSTB (5 << 8) /* 2eSST Broadcast */ -#define TSI148_LCSR_DDAT_DBW_M (3<<6) /* Max Data Width MASK */ -#define TSI148_LCSR_DDAT_DBW_16 (0<<6) /* 16 Bits */ +#define TSI148_LCSR_DDAT_DBW_M (3 << 6) /* Max Data Width MASK */ +#define TSI148_LCSR_DDAT_DBW_16 (0 << 6) /* 16 Bits */ #define TSI148_LCSR_DDAT_DBW_32 BIT(6) /* 32 Bits */ #define TSI148_LCSR_DDAT_SUP BIT(5) /* Supervisory/User Access */ #define TSI148_LCSR_DDAT_PGM BIT(4) /* Program/Data Access */ -#define TSI148_LCSR_DDAT_AMODE_M (0xf<<0) /* Address Space Mask */ -#define TSI148_LCSR_DDAT_AMODE_A16 (0<<0) /* A16 */ +#define TSI148_LCSR_DDAT_AMODE_M (0xf << 0) /* Address Space Mask */ +#define TSI148_LCSR_DDAT_AMODE_A16 (0 << 0) /* A16 */ #define TSI148_LCSR_DDAT_AMODE_A24 BIT(0) /* A24 */ -#define TSI148_LCSR_DDAT_AMODE_A32 (2<<0) /* A32 */ -#define TSI148_LCSR_DDAT_AMODE_A64 (4<<0) /* A64 */ -#define TSI148_LCSR_DDAT_AMODE_CRCSR (5<<0) /* CRC/SR */ -#define TSI148_LCSR_DDAT_AMODE_USER1 (8<<0) /* User1 */ -#define TSI148_LCSR_DDAT_AMODE_USER2 (9<<0) /* User2 */ -#define TSI148_LCSR_DDAT_AMODE_USER3 (0xa<<0) /* User3 */ -#define TSI148_LCSR_DDAT_AMODE_USER4 (0xb<<0) /* User4 */ +#define TSI148_LCSR_DDAT_AMODE_A32 (2 << 0) /* A32 */ +#define TSI148_LCSR_DDAT_AMODE_A64 (4 << 0) /* A64 */ +#define TSI148_LCSR_DDAT_AMODE_CRCSR (5 << 0) /* CRC/SR */ +#define TSI148_LCSR_DDAT_AMODE_USER1 (8 << 0) /* User1 */ +#define TSI148_LCSR_DDAT_AMODE_USER2 (9 << 0) /* User2 */ +#define TSI148_LCSR_DDAT_AMODE_USER3 (0xa << 0) /* User3 */ +#define TSI148_LCSR_DDAT_AMODE_USER4 (0xb << 0) /* User4 */ /* * DMA Next Link Address Lower */ -#define TSI148_LCSR_DNLAL_DNLAL_M (0x3FFFFFF<<6) /* Address Mask */ +#define TSI148_LCSR_DNLAL_DNLAL_M (0x3FFFFFF << 6) /* Address Mask */ #define TSI148_LCSR_DNLAL_LLA BIT(0) /* Last Link Address Indicator */ /* * DMA 2eSST Broadcast Select */ -#define TSI148_LCSR_DBS_M (0x1FFFFF<<0) /* Mask */ +#define TSI148_LCSR_DBS_M (0x1FFFFF << 0) /* Mask */ /* * GCSR Register Group @@ -1368,7 +1362,7 @@ static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C, #define TSI148_GCSR_GCTRL_MBI0S BIT(0) /* Mail box 0 Int Status */ #define TSI148_GCSR_GAP BIT(5) /* Geographic Addr Parity */ -#define TSI148_GCSR_GA_M (0x1F<<0) /* Geographic Address Mask */ +#define TSI148_GCSR_GA_M (0x1F << 0) /* Geographic Address Mask */ /* * CR/CSR Register Group @@ -1395,6 +1389,6 @@ static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C, /* * CR/CSR Base Address Register CRG + FFC */ -#define TSI148_CRCSR_CBAR_M (0x1F<<3) /* Mask */ +#define TSI148_CRCSR_CBAR_M (0x1F << 3) /* Mask */ #endif /* TSI148_H */ diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c index b9367b575d..36183f9237 100644 --- a/drivers/staging/vme_user/vme_user.c +++ b/drivers/staging/vme_user/vme_user.c @@ -37,7 +37,7 @@ #include "vme.h" #include "vme_user.h" -static const char driver_name[] = "vme_user"; +#define DRIVER_NAME "vme_user" static int bus[VME_USER_BUS_MAX]; static unsigned int bus_num; @@ -101,9 +101,11 @@ struct image_desc { static struct image_desc image[VME_DEVS]; static struct cdev *vme_user_cdev; /* Character device */ -static struct class *vme_user_sysfs_class; /* Sysfs class */ static struct vme_dev *vme_user_bridge; /* Pointer to user device */ +static const struct class vme_user_sysfs_class = { + .name = DRIVER_NAME, +}; static const int type[VME_DEVS] = { MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, SLAVE_MINOR, SLAVE_MINOR, @@ -540,8 +542,7 @@ static int vme_user_probe(struct vme_dev *vdev) } /* Assign major and minor numbers for the driver */ - err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS, - driver_name); + err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS, DRIVER_NAME); if (err) { dev_warn(&vdev->dev, "Error getting Major Number %d for driver.\n", VME_MAJOR); @@ -614,10 +615,9 @@ static int vme_user_probe(struct vme_dev *vdev) } /* Create sysfs entries - on udev systems this creates the dev files */ - vme_user_sysfs_class = class_create(driver_name); - if (IS_ERR(vme_user_sysfs_class)) { + err = class_register(&vme_user_sysfs_class); + if (err) { dev_err(&vdev->dev, "Error creating vme_user class.\n"); - err = PTR_ERR(vme_user_sysfs_class); goto err_master; } @@ -641,7 +641,7 @@ static int vme_user_probe(struct vme_dev *vdev) } num = (type[i] == SLAVE_MINOR) ? i - (MASTER_MAX + 1) : i; - image[i].device = device_create(vme_user_sysfs_class, NULL, + image[i].device = device_create(&vme_user_sysfs_class, NULL, MKDEV(VME_MAJOR, i), NULL, name, num); if (IS_ERR(image[i].device)) { @@ -656,9 +656,9 @@ static int vme_user_probe(struct vme_dev *vdev) err_sysfs: while (i > 0) { i--; - device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); + device_destroy(&vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); } - class_destroy(vme_user_sysfs_class); + class_unregister(&vme_user_sysfs_class); /* Ensure counter set correctly to unalloc all master windows */ i = MASTER_MAX + 1; @@ -696,9 +696,9 @@ static void vme_user_remove(struct vme_dev *dev) /* Remove sysfs Entries */ for (i = 0; i < VME_DEVS; i++) { mutex_destroy(&image[i].mutex); - device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); + device_destroy(&vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); } - class_destroy(vme_user_sysfs_class); + class_unregister(&vme_user_sysfs_class); for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) { kfree(image[i].kern_buf); @@ -720,7 +720,7 @@ static void vme_user_remove(struct vme_dev *dev) } static struct vme_driver vme_user_driver = { - .name = driver_name, + .name = DRIVER_NAME, .match = vme_user_match, .probe = vme_user_probe, .remove = vme_user_remove, |