Commit 6af04b06 authored by Martyn Welch's avatar Martyn Welch Committed by Greg Kroah-Hartman

Staging: VME: Remove typedefs

The use of typedefs is discouraged, remove them.
Signed-off-by: default avatarMartyn Welch <martyn.welch@ge.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ce3e301c
...@@ -338,7 +338,7 @@ static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level, ...@@ -338,7 +338,7 @@ static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size,
dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle) dma_addr_t pci_base, u32 aspace, u32 cycle)
{ {
unsigned int i, addr = 0, granularity; unsigned int i, addr = 0, granularity;
unsigned int temp_ctl = 0; unsigned int temp_ctl = 0;
...@@ -444,7 +444,7 @@ static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, ...@@ -444,7 +444,7 @@ static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled, static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size,
dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle) dma_addr_t *pci_base, u32 *aspace, u32 *cycle)
{ {
unsigned int i, granularity = 0, ctl = 0; unsigned int i, granularity = 0, ctl = 0;
unsigned long long vme_bound, pci_offset; unsigned long long vme_bound, pci_offset;
...@@ -595,8 +595,8 @@ static void ca91cx42_free_resource(struct vme_master_resource *image) ...@@ -595,8 +595,8 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
static int ca91cx42_master_set(struct vme_master_resource *image, int enabled, static int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size, u32 aspace,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 cycle, u32 dwidth)
{ {
int retval = 0; int retval = 0;
unsigned int i, granularity = 0; unsigned int i, granularity = 0;
...@@ -753,7 +753,7 @@ static int ca91cx42_master_set(struct vme_master_resource *image, int enabled, ...@@ -753,7 +753,7 @@ static int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
static int __ca91cx42_master_get(struct vme_master_resource *image, static int __ca91cx42_master_get(struct vme_master_resource *image,
int *enabled, unsigned long long *vme_base, unsigned long long *size, int *enabled, unsigned long long *vme_base, unsigned long long *size,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth) u32 *aspace, u32 *cycle, u32 *dwidth)
{ {
unsigned int i, ctl; unsigned int i, ctl;
unsigned long long pci_base, pci_bound, vme_offset; unsigned long long pci_base, pci_bound, vme_offset;
...@@ -839,8 +839,8 @@ static int __ca91cx42_master_get(struct vme_master_resource *image, ...@@ -839,8 +839,8 @@ static int __ca91cx42_master_get(struct vme_master_resource *image,
} }
static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled, static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size, u32 *aspace,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth) u32 *cycle, u32 *dwidth)
{ {
int retval; int retval;
...@@ -1292,7 +1292,7 @@ static int ca91cx42_dma_list_empty(struct vme_dma_list *list) ...@@ -1292,7 +1292,7 @@ static int ca91cx42_dma_list_empty(struct vme_dma_list *list)
* callback is attached and disabled when the last callback is removed. * callback is attached and disabled when the last callback is removed.
*/ */
static int ca91cx42_lm_set(struct vme_lm_resource *lm, static int ca91cx42_lm_set(struct vme_lm_resource *lm,
unsigned long long lm_base, vme_address_t aspace, vme_cycle_t cycle) unsigned long long lm_base, u32 aspace, u32 cycle)
{ {
u32 temp_base, lm_ctl = 0; u32 temp_base, lm_ctl = 0;
int i; int i;
...@@ -1360,7 +1360,7 @@ static int ca91cx42_lm_set(struct vme_lm_resource *lm, ...@@ -1360,7 +1360,7 @@ static int ca91cx42_lm_set(struct vme_lm_resource *lm,
* or disabled. * or disabled.
*/ */
static int ca91cx42_lm_get(struct vme_lm_resource *lm, static int ca91cx42_lm_get(struct vme_lm_resource *lm,
unsigned long long *lm_base, vme_address_t *aspace, vme_cycle_t *cycle) unsigned long long *lm_base, u32 *aspace, u32 *cycle)
{ {
u32 lm_ctl, enabled = 0; u32 lm_ctl, enabled = 0;
struct ca91cx42_driver *bridge; struct ca91cx42_driver *bridge;
......
...@@ -483,7 +483,7 @@ static int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, ...@@ -483,7 +483,7 @@ static int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level,
* Find the first error in this address range * Find the first error in this address range
*/ */
static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge, static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge,
vme_address_t aspace, unsigned long long address, size_t count) u32 aspace, unsigned long long address, size_t count)
{ {
struct list_head *err_pos; struct list_head *err_pos;
struct vme_bus_error *vme_err, *valid = NULL; struct vme_bus_error *vme_err, *valid = NULL;
...@@ -517,7 +517,7 @@ static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge, ...@@ -517,7 +517,7 @@ static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge,
* Clear errors in the provided address range. * Clear errors in the provided address range.
*/ */
static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge, static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
vme_address_t aspace, unsigned long long address, size_t count) u32 aspace, unsigned long long address, size_t count)
{ {
struct list_head *err_pos, *temp; struct list_head *err_pos, *temp;
struct vme_bus_error *vme_err; struct vme_bus_error *vme_err;
...@@ -551,7 +551,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge, ...@@ -551,7 +551,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
*/ */
static int tsi148_slave_set(struct vme_slave_resource *image, int enabled, static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size,
dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle) dma_addr_t pci_base, u32 aspace, u32 cycle)
{ {
unsigned int i, addr = 0, granularity = 0; unsigned int i, addr = 0, granularity = 0;
unsigned int temp_ctl = 0; unsigned int temp_ctl = 0;
...@@ -701,7 +701,7 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled, ...@@ -701,7 +701,7 @@ static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
*/ */
static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled, static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size,
dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle) dma_addr_t *pci_base, u32 *aspace, u32 *cycle)
{ {
unsigned int i, granularity = 0, ctl = 0; unsigned int i, granularity = 0, ctl = 0;
unsigned int vme_base_low, vme_base_high; unsigned int vme_base_low, vme_base_high;
...@@ -893,8 +893,8 @@ static void tsi148_free_resource(struct vme_master_resource *image) ...@@ -893,8 +893,8 @@ static void tsi148_free_resource(struct vme_master_resource *image)
* Set the attributes of an outbound window. * Set the attributes of an outbound window.
*/ */
static int tsi148_master_set(struct vme_master_resource *image, int enabled, static int tsi148_master_set(struct vme_master_resource *image, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size, u32 aspace,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 cycle, u32 dwidth)
{ {
int retval = 0; int retval = 0;
unsigned int i; unsigned int i;
...@@ -1129,8 +1129,8 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled, ...@@ -1129,8 +1129,8 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
* XXX Not parsing prefetch information. * XXX Not parsing prefetch information.
*/ */
static int __tsi148_master_get(struct vme_master_resource *image, int *enabled, static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size, u32 *aspace,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth) u32 *cycle, u32 *dwidth)
{ {
unsigned int i, ctl; unsigned int i, ctl;
unsigned int pci_base_low, pci_base_high; unsigned int pci_base_low, pci_base_high;
...@@ -1239,8 +1239,8 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled, ...@@ -1239,8 +1239,8 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
static int tsi148_master_get(struct vme_master_resource *image, int *enabled, static int tsi148_master_get(struct vme_master_resource *image, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size, u32 *aspace,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth) u32 *cycle, u32 *dwidth)
{ {
int retval; int retval;
...@@ -1259,9 +1259,7 @@ static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf, ...@@ -1259,9 +1259,7 @@ static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
{ {
int retval, enabled; int retval, enabled;
unsigned long long vme_base, size; unsigned long long vme_base, size;
vme_address_t aspace; u32 aspace, cycle, dwidth;
vme_cycle_t cycle;
vme_width_t dwidth;
struct vme_bus_error *vme_err = NULL; struct vme_bus_error *vme_err = NULL;
struct vme_bridge *tsi148_bridge; struct vme_bridge *tsi148_bridge;
...@@ -1301,9 +1299,7 @@ static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf, ...@@ -1301,9 +1299,7 @@ static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
{ {
int retval = 0, enabled; int retval = 0, enabled;
unsigned long long vme_base, size; unsigned long long vme_base, size;
vme_address_t aspace; u32 aspace, cycle, dwidth;
vme_cycle_t cycle;
vme_width_t dwidth;
struct vme_bus_error *vme_err = NULL; struct vme_bus_error *vme_err = NULL;
struct vme_bridge *tsi148_bridge; struct vme_bridge *tsi148_bridge;
...@@ -1420,7 +1416,7 @@ static unsigned int tsi148_master_rmw(struct vme_master_resource *image, ...@@ -1420,7 +1416,7 @@ static unsigned int tsi148_master_rmw(struct vme_master_resource *image,
} }
static int tsi148_dma_set_vme_src_attributes(struct device *dev, u32 *attr, static int tsi148_dma_set_vme_src_attributes(struct device *dev, u32 *attr,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 aspace, u32 cycle, u32 dwidth)
{ {
/* Setup 2eSST speeds */ /* Setup 2eSST speeds */
switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
...@@ -1514,7 +1510,7 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, u32 *attr, ...@@ -1514,7 +1510,7 @@ static int tsi148_dma_set_vme_src_attributes(struct device *dev, u32 *attr,
} }
static int tsi148_dma_set_vme_dest_attributes(struct device *dev, u32 *attr, static int tsi148_dma_set_vme_dest_attributes(struct device *dev, u32 *attr,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 aspace, u32 cycle, u32 dwidth)
{ {
/* Setup 2eSST speeds */ /* Setup 2eSST speeds */
switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) { switch (cycle & (VME_2eSST160 | VME_2eSST267 | VME_2eSST320)) {
...@@ -1886,7 +1882,7 @@ static int tsi148_dma_list_empty(struct vme_dma_list *list) ...@@ -1886,7 +1882,7 @@ static int tsi148_dma_list_empty(struct vme_dma_list *list)
* callback is attached and disabled when the last callback is removed. * callback is attached and disabled when the last callback is removed.
*/ */
static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base, static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
vme_address_t aspace, vme_cycle_t cycle) u32 aspace, u32 cycle)
{ {
u32 lm_base_high, lm_base_low, lm_ctl = 0; u32 lm_base_high, lm_base_low, lm_ctl = 0;
int i; int i;
...@@ -1953,7 +1949,7 @@ static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base, ...@@ -1953,7 +1949,7 @@ static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
* or disabled. * or disabled.
*/ */
static int tsi148_lm_get(struct vme_lm_resource *lm, static int tsi148_lm_get(struct vme_lm_resource *lm,
unsigned long long *lm_base, vme_address_t *aspace, vme_cycle_t *cycle) unsigned long long *lm_base, u32 *aspace, u32 *cycle)
{ {
u32 lm_base_high, lm_base_low, lm_ctl, enabled = 0; u32 lm_base_high, lm_base_low, lm_ctl, enabled = 0;
struct tsi148_driver *bridge; struct tsi148_driver *bridge;
......
...@@ -10,9 +10,9 @@ struct vme_master { ...@@ -10,9 +10,9 @@ struct vme_master {
int enable; /* State of Window */ int enable; /* State of Window */
unsigned long long vme_addr; /* Starting Address on the VMEbus */ unsigned long long vme_addr; /* Starting Address on the VMEbus */
unsigned long long size; /* Window Size */ unsigned long long size; /* Window Size */
vme_address_t aspace; /* Address Space */ u32 aspace; /* Address Space */
vme_cycle_t cycle; /* Cycle properties */ u32 cycle; /* Cycle properties */
vme_width_t dwidth; /* Maximum Data Width */ u32 dwidth; /* Maximum Data Width */
#if 0 #if 0
char prefetchEnable; /* Prefetch Read Enable State */ char prefetchEnable; /* Prefetch Read Enable State */
int prefetchSize; /* Prefetch Read Size (Cache Lines) */ int prefetchSize; /* Prefetch Read Size (Cache Lines) */
...@@ -34,8 +34,8 @@ struct vme_slave { ...@@ -34,8 +34,8 @@ struct vme_slave {
int enable; /* State of Window */ int enable; /* State of Window */
unsigned long long vme_addr; /* Starting Address on the VMEbus */ unsigned long long vme_addr; /* Starting Address on the VMEbus */
unsigned long long size; /* Window Size */ unsigned long long size; /* Window Size */
vme_address_t aspace; /* Address Space */ u32 aspace; /* Address Space */
vme_cycle_t cycle; /* Cycle properties */ u32 cycle; /* Cycle properties */
#if 0 #if 0
char wrPostEnable; /* Write Post State */ char wrPostEnable; /* Write Post State */
char rmwLock; /* Lock PCI during RMW Cycles */ char rmwLock; /* Lock PCI during RMW Cycles */
......
...@@ -153,9 +153,7 @@ size_t vme_get_size(struct vme_resource *resource) ...@@ -153,9 +153,7 @@ size_t vme_get_size(struct vme_resource *resource)
int enabled, retval; int enabled, retval;
unsigned long long base, size; unsigned long long base, size;
dma_addr_t buf_base; dma_addr_t buf_base;
vme_address_t aspace; u32 aspace, cycle, dwidth;
vme_cycle_t cycle;
vme_width_t dwidth;
switch (resource->type) { switch (resource->type) {
case VME_MASTER: case VME_MASTER:
...@@ -181,7 +179,7 @@ size_t vme_get_size(struct vme_resource *resource) ...@@ -181,7 +179,7 @@ size_t vme_get_size(struct vme_resource *resource)
} }
EXPORT_SYMBOL(vme_get_size); EXPORT_SYMBOL(vme_get_size);
static int vme_check_window(vme_address_t aspace, unsigned long long vme_base, static int vme_check_window(u32 aspace, unsigned long long vme_base,
unsigned long long size) unsigned long long size)
{ {
int retval = 0; int retval = 0;
...@@ -232,8 +230,8 @@ static int vme_check_window(vme_address_t aspace, unsigned long long vme_base, ...@@ -232,8 +230,8 @@ static int vme_check_window(vme_address_t aspace, unsigned long long vme_base,
* Request a slave image with specific attributes, return some unique * Request a slave image with specific attributes, return some unique
* identifier. * identifier.
*/ */
struct vme_resource *vme_slave_request(struct vme_dev *vdev, struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address,
vme_address_t address, vme_cycle_t cycle) u32 cycle)
{ {
struct vme_bridge *bridge; struct vme_bridge *bridge;
struct list_head *slave_pos = NULL; struct list_head *slave_pos = NULL;
...@@ -298,7 +296,7 @@ EXPORT_SYMBOL(vme_slave_request); ...@@ -298,7 +296,7 @@ EXPORT_SYMBOL(vme_slave_request);
int vme_slave_set(struct vme_resource *resource, int enabled, int vme_slave_set(struct vme_resource *resource, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size,
dma_addr_t buf_base, vme_address_t aspace, vme_cycle_t cycle) dma_addr_t buf_base, u32 aspace, u32 cycle)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_slave_resource *image; struct vme_slave_resource *image;
...@@ -333,7 +331,7 @@ EXPORT_SYMBOL(vme_slave_set); ...@@ -333,7 +331,7 @@ EXPORT_SYMBOL(vme_slave_set);
int vme_slave_get(struct vme_resource *resource, int *enabled, int vme_slave_get(struct vme_resource *resource, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size,
dma_addr_t *buf_base, vme_address_t *aspace, vme_cycle_t *cycle) dma_addr_t *buf_base, u32 *aspace, u32 *cycle)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_slave_resource *image; struct vme_slave_resource *image;
...@@ -388,8 +386,8 @@ EXPORT_SYMBOL(vme_slave_free); ...@@ -388,8 +386,8 @@ EXPORT_SYMBOL(vme_slave_free);
* Request a master image with specific attributes, return some unique * Request a master image with specific attributes, return some unique
* identifier. * identifier.
*/ */
struct vme_resource *vme_master_request(struct vme_dev *vdev, struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address,
vme_address_t address, vme_cycle_t cycle, vme_width_t dwidth) u32 cycle, u32 dwidth)
{ {
struct vme_bridge *bridge; struct vme_bridge *bridge;
struct list_head *master_pos = NULL; struct list_head *master_pos = NULL;
...@@ -456,8 +454,8 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, ...@@ -456,8 +454,8 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev,
EXPORT_SYMBOL(vme_master_request); EXPORT_SYMBOL(vme_master_request);
int vme_master_set(struct vme_resource *resource, int enabled, int vme_master_set(struct vme_resource *resource, int enabled,
unsigned long long vme_base, unsigned long long size, unsigned long long vme_base, unsigned long long size, u32 aspace,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 cycle, u32 dwidth)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_master_resource *image; struct vme_master_resource *image;
...@@ -492,8 +490,8 @@ int vme_master_set(struct vme_resource *resource, int enabled, ...@@ -492,8 +490,8 @@ int vme_master_set(struct vme_resource *resource, int enabled,
EXPORT_SYMBOL(vme_master_set); EXPORT_SYMBOL(vme_master_set);
int vme_master_get(struct vme_resource *resource, int *enabled, int vme_master_get(struct vme_resource *resource, int *enabled,
unsigned long long *vme_base, unsigned long long *size, unsigned long long *vme_base, unsigned long long *size, u32 *aspace,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth) u32 *cycle, u32 *dwidth)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_master_resource *image; struct vme_master_resource *image;
...@@ -646,8 +644,7 @@ EXPORT_SYMBOL(vme_master_free); ...@@ -646,8 +644,7 @@ EXPORT_SYMBOL(vme_master_free);
* Request a DMA controller with specific attributes, return some unique * Request a DMA controller with specific attributes, return some unique
* identifier. * identifier.
*/ */
struct vme_resource *vme_dma_request(struct vme_dev *vdev, struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route)
vme_dma_route_t route)
{ {
struct vme_bridge *bridge; struct vme_bridge *bridge;
struct list_head *dma_pos = NULL; struct list_head *dma_pos = NULL;
...@@ -743,8 +740,7 @@ EXPORT_SYMBOL(vme_new_dma_list); ...@@ -743,8 +740,7 @@ EXPORT_SYMBOL(vme_new_dma_list);
/* /*
* Create "Pattern" type attributes * Create "Pattern" type attributes
*/ */
struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, u32 type)
vme_pattern_t type)
{ {
struct vme_dma_attr *attributes; struct vme_dma_attr *attributes;
struct vme_dma_pattern *pattern_attr; struct vme_dma_pattern *pattern_attr;
...@@ -822,7 +818,7 @@ EXPORT_SYMBOL(vme_dma_pci_attribute); ...@@ -822,7 +818,7 @@ EXPORT_SYMBOL(vme_dma_pci_attribute);
* Create "VME" type attributes * Create "VME" type attributes
*/ */
struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long address, struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long address,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth) u32 aspace, u32 cycle, u32 dwidth)
{ {
struct vme_dma_attr *attributes; struct vme_dma_attr *attributes;
struct vme_dma_vme *vme_attr; struct vme_dma_vme *vme_attr;
...@@ -1173,7 +1169,7 @@ int vme_lm_count(struct vme_resource *resource) ...@@ -1173,7 +1169,7 @@ int vme_lm_count(struct vme_resource *resource)
EXPORT_SYMBOL(vme_lm_count); EXPORT_SYMBOL(vme_lm_count);
int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base, int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base,
vme_address_t aspace, vme_cycle_t cycle) u32 aspace, u32 cycle)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_lm_resource *lm; struct vme_lm_resource *lm;
...@@ -1195,7 +1191,7 @@ int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base, ...@@ -1195,7 +1191,7 @@ int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base,
EXPORT_SYMBOL(vme_lm_set); EXPORT_SYMBOL(vme_lm_set);
int vme_lm_get(struct vme_resource *resource, unsigned long long *lm_base, int vme_lm_get(struct vme_resource *resource, unsigned long long *lm_base,
vme_address_t *aspace, vme_cycle_t *cycle) u32 *aspace, u32 *cycle)
{ {
struct vme_bridge *bridge = find_bridge(resource); struct vme_bridge *bridge = find_bridge(resource);
struct vme_lm_resource *lm; struct vme_lm_resource *lm;
......
...@@ -10,7 +10,6 @@ enum vme_resource_type { ...@@ -10,7 +10,6 @@ enum vme_resource_type {
}; };
/* VME Address Spaces */ /* VME Address Spaces */
typedef u32 vme_address_t;
#define VME_A16 0x1 #define VME_A16 0x1
#define VME_A24 0x2 #define VME_A24 0x2
#define VME_A32 0x4 #define VME_A32 0x4
...@@ -29,7 +28,6 @@ typedef u32 vme_address_t; ...@@ -29,7 +28,6 @@ typedef u32 vme_address_t;
/* VME Cycle Types */ /* VME Cycle Types */
typedef u32 vme_cycle_t;
#define VME_SCT 0x1 #define VME_SCT 0x1
#define VME_BLT 0x2 #define VME_BLT 0x2
#define VME_MBLT 0x4 #define VME_MBLT 0x4
...@@ -47,28 +45,23 @@ typedef u32 vme_cycle_t; ...@@ -47,28 +45,23 @@ typedef u32 vme_cycle_t;
#define VME_DATA 0x8000 #define VME_DATA 0x8000
/* VME Data Widths */ /* VME Data Widths */
typedef u32 vme_width_t;
#define VME_D8 0x1 #define VME_D8 0x1
#define VME_D16 0x2 #define VME_D16 0x2
#define VME_D32 0x4 #define VME_D32 0x4
#define VME_D64 0x8 #define VME_D64 0x8
/* Arbitration Scheduling Modes */ /* Arbitration Scheduling Modes */
typedef u32 vme_arbitration_t;
#define VME_R_ROBIN_MODE 0x1 #define VME_R_ROBIN_MODE 0x1
#define VME_PRIORITY_MODE 0x2 #define VME_PRIORITY_MODE 0x2
typedef u32 vme_dma_t;
#define VME_DMA_PATTERN (1<<0) #define VME_DMA_PATTERN (1<<0)
#define VME_DMA_PCI (1<<1) #define VME_DMA_PCI (1<<1)
#define VME_DMA_VME (1<<2) #define VME_DMA_VME (1<<2)
typedef u32 vme_pattern_t;
#define VME_DMA_PATTERN_BYTE (1<<0) #define VME_DMA_PATTERN_BYTE (1<<0)
#define VME_DMA_PATTERN_WORD (1<<1) #define VME_DMA_PATTERN_WORD (1<<1)
#define VME_DMA_PATTERN_INCREMENT (1<<2) #define VME_DMA_PATTERN_INCREMENT (1<<2)
typedef u32 vme_dma_route_t;
#define VME_DMA_VME_TO_MEM (1<<0) #define VME_DMA_VME_TO_MEM (1<<0)
#define VME_DMA_MEM_TO_VME (1<<1) #define VME_DMA_MEM_TO_VME (1<<1)
#define VME_DMA_VME_TO_VME (1<<2) #define VME_DMA_VME_TO_VME (1<<2)
...@@ -77,7 +70,7 @@ typedef u32 vme_dma_route_t; ...@@ -77,7 +70,7 @@ typedef u32 vme_dma_route_t;
#define VME_DMA_PATTERN_TO_MEM (1<<5) #define VME_DMA_PATTERN_TO_MEM (1<<5)
struct vme_dma_attr { struct vme_dma_attr {
vme_dma_t type; u32 type;
void *private; void *private;
}; };
...@@ -128,32 +121,29 @@ void vme_free_consistent(struct vme_resource *, size_t, void *, ...@@ -128,32 +121,29 @@ void vme_free_consistent(struct vme_resource *, size_t, void *,
size_t vme_get_size(struct vme_resource *); size_t vme_get_size(struct vme_resource *);
struct vme_resource *vme_slave_request(struct vme_dev *, vme_address_t, struct vme_resource *vme_slave_request(struct vme_dev *, u32, u32);
vme_cycle_t);
int vme_slave_set(struct vme_resource *, int, unsigned long long, int vme_slave_set(struct vme_resource *, int, unsigned long long,
unsigned long long, dma_addr_t, vme_address_t, vme_cycle_t); unsigned long long, dma_addr_t, u32, u32);
int vme_slave_get(struct vme_resource *, int *, unsigned long long *, int vme_slave_get(struct vme_resource *, int *, unsigned long long *,
unsigned long long *, dma_addr_t *, vme_address_t *, vme_cycle_t *); unsigned long long *, dma_addr_t *, u32 *, u32 *);
void vme_slave_free(struct vme_resource *); void vme_slave_free(struct vme_resource *);
struct vme_resource *vme_master_request(struct vme_dev *, vme_address_t, struct vme_resource *vme_master_request(struct vme_dev *, u32, u32, u32);
vme_cycle_t, vme_width_t);
int vme_master_set(struct vme_resource *, int, unsigned long long, int vme_master_set(struct vme_resource *, int, unsigned long long,
unsigned long long, vme_address_t, vme_cycle_t, vme_width_t); unsigned long long, u32, u32, u32);
int vme_master_get(struct vme_resource *, int *, unsigned long long *, int vme_master_get(struct vme_resource *, int *, unsigned long long *,
unsigned long long *, vme_address_t *, vme_cycle_t *, vme_width_t *); unsigned long long *, u32 *, u32 *, u32 *);
ssize_t vme_master_read(struct vme_resource *, void *, size_t, loff_t); ssize_t vme_master_read(struct vme_resource *, void *, size_t, loff_t);
ssize_t vme_master_write(struct vme_resource *, void *, size_t, loff_t); ssize_t vme_master_write(struct vme_resource *, void *, size_t, loff_t);
unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int, unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int,
unsigned int, loff_t); unsigned int, loff_t);
void vme_master_free(struct vme_resource *); void vme_master_free(struct vme_resource *);
struct vme_resource *vme_dma_request(struct vme_dev *, vme_dma_route_t); struct vme_resource *vme_dma_request(struct vme_dev *, u32);
struct vme_dma_list *vme_new_dma_list(struct vme_resource *); struct vme_dma_list *vme_new_dma_list(struct vme_resource *);
struct vme_dma_attr *vme_dma_pattern_attribute(u32, vme_pattern_t); struct vme_dma_attr *vme_dma_pattern_attribute(u32, u32);
struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t); struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t);
struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long, vme_address_t, struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long, u32, u32, u32);
vme_cycle_t, vme_width_t);
void vme_dma_free_attribute(struct vme_dma_attr *); void vme_dma_free_attribute(struct vme_dma_attr *);
int vme_dma_list_add(struct vme_dma_list *, struct vme_dma_attr *, int vme_dma_list_add(struct vme_dma_list *, struct vme_dma_attr *,
struct vme_dma_attr *, size_t); struct vme_dma_attr *, size_t);
...@@ -168,10 +158,8 @@ int vme_irq_generate(struct vme_dev *, int, int); ...@@ -168,10 +158,8 @@ int vme_irq_generate(struct vme_dev *, int, int);
struct vme_resource * vme_lm_request(struct vme_dev *); struct vme_resource * vme_lm_request(struct vme_dev *);
int vme_lm_count(struct vme_resource *); int vme_lm_count(struct vme_resource *);
int vme_lm_set(struct vme_resource *, unsigned long long, vme_address_t, int vme_lm_set(struct vme_resource *, unsigned long long, u32, u32);
vme_cycle_t); int vme_lm_get(struct vme_resource *, unsigned long long *, u32 *, u32 *);
int vme_lm_get(struct vme_resource *, unsigned long long *, vme_address_t *,
vme_cycle_t *);
int vme_lm_attach(struct vme_resource *, int, void (*callback)(int)); int vme_lm_attach(struct vme_resource *, int, void (*callback)(int));
int vme_lm_detach(struct vme_resource *, int); int vme_lm_detach(struct vme_resource *, int);
void vme_lm_free(struct vme_resource *); void vme_lm_free(struct vme_resource *);
......
...@@ -86,26 +86,26 @@ driver allows a resource to be assigned based on the required attributes of the ...@@ -86,26 +86,26 @@ driver allows a resource to be assigned based on the required attributes of the
driver in question: driver in question:
struct vme_resource * vme_master_request(struct vme_dev *dev, struct vme_resource * vme_master_request(struct vme_dev *dev,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t width); u32 aspace, u32 cycle, u32 width);
struct vme_resource * vme_slave_request(struct vme_dev *dev, struct vme_resource * vme_slave_request(struct vme_dev *dev, u32 aspace,
vme_address_t aspace, vme_cycle_t cycle); u32 cycle);
struct vme_resource *vme_dma_request(struct vme_dev *dev, struct vme_resource *vme_dma_request(struct vme_dev *dev, u32 route);
vme_dma_route_t route);
For slave windows these attributes are split into the VME address spaces that
For slave windows these attributes are split into those of type 'vme_address_t' need to be accessed in 'aspace' and VME bus cycle types required in 'cycle'.
and 'vme_cycle_t'. Master windows add a further set of attributes Master windows add a further set of attributes in 'width' specifying the
'vme_cycle_t'. These attributes are defined as bitmasks and as such any required data transfer widths. These attributes are defined as bitmasks and as
combination of the attributes can be requested for a single window, the core such any combination of the attributes can be requested for a single window,
will assign a window that meets the requirements, returning a pointer of type the core will assign a window that meets the requirements, returning a pointer
vme_resource that should be used to identify the allocated resource when it is of type vme_resource that should be used to identify the allocated resource
used. For DMA controllers, the request function requires the potential when it is used. For DMA controllers, the request function requires the
direction of any transfers to be provided in the route attributes. This is potential direction of any transfers to be provided in the route attributes.
typically VME-to-MEM and/or MEM-to-VME, though some hardware can support This is typically VME-to-MEM and/or MEM-to-VME, though some hardware can
VME-to-VME and MEM-to-MEM transfers as well as test pattern generation. If an support VME-to-VME and MEM-to-MEM transfers as well as test pattern generation.
unallocated window fitting the requirements can not be found a NULL pointer If an unallocated window fitting the requirements can not be found a NULL
will be returned. pointer will be returned.
Functions are also provided to free window allocations once they are no longer Functions are also provided to free window allocations once they are no longer
required. These functions should be passed the pointer to the resource provided required. These functions should be passed the pointer to the resource provided
...@@ -133,12 +133,12 @@ Once a master window has been assigned the following functions can be used to ...@@ -133,12 +133,12 @@ Once a master window has been assigned the following functions can be used to
configure it and retrieve the current settings: configure it and retrieve the current settings:
int vme_master_set (struct vme_resource *res, int enabled, int vme_master_set (struct vme_resource *res, int enabled,
unsigned long long base, unsigned long long size, unsigned long long base, unsigned long long size, u32 aspace,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t width); u32 cycle, u32 width);
int vme_master_get (struct vme_resource *res, int *enabled, int vme_master_get (struct vme_resource *res, int *enabled,
unsigned long long *base, unsigned long long *size, unsigned long long *base, unsigned long long *size, u32 *aspace,
vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *width); u32 *cycle, u32 *width);
The address spaces, transfer widths and cycle types are the same as described The address spaces, transfer widths and cycle types are the same as described
under resource management, however some of the options are mutually exclusive. under resource management, however some of the options are mutually exclusive.
...@@ -189,11 +189,11 @@ configure it and retrieve the current settings: ...@@ -189,11 +189,11 @@ configure it and retrieve the current settings:
int vme_slave_set (struct vme_resource *res, int enabled, int vme_slave_set (struct vme_resource *res, int enabled,
unsigned long long base, unsigned long long size, unsigned long long base, unsigned long long size,
dma_addr_t mem, vme_address_t aspace, vme_cycle_t cycle); dma_addr_t mem, u32 aspace, u32 cycle);
int vme_slave_get (struct vme_resource *res, int *enabled, int vme_slave_get (struct vme_resource *res, int *enabled,
unsigned long long *base, unsigned long long *size, unsigned long long *base, unsigned long long *size,
dma_addr_t *mem, vme_address_t *aspace, vme_cycle_t *cycle); dma_addr_t *mem, u32 *aspace, u32 *cycle);
The address spaces, transfer widths and cycle types are the same as described The address spaces, transfer widths and cycle types are the same as described
under resource management, however some of the options are mutually exclusive. under resource management, however some of the options are mutually exclusive.
...@@ -273,8 +273,7 @@ and pattern sources and destinations (where appropriate): ...@@ -273,8 +273,7 @@ and pattern sources and destinations (where appropriate):
Pattern source: Pattern source:
struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, u32 type);
vme_pattern_t type);
PCI source or destination: PCI source or destination:
...@@ -283,7 +282,7 @@ PCI source or destination: ...@@ -283,7 +282,7 @@ PCI source or destination:
VME source or destination: VME source or destination:
struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long base, struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long base,
vme_address_t aspace, vme_cycle_t cycle, vme_width_t width); u32 aspace, u32 cycle, u32 width);
The following function should be used to free an attribute: The following function should be used to free an attribute:
...@@ -366,10 +365,10 @@ Once a bank of location monitors has been allocated, the following functions ...@@ -366,10 +365,10 @@ Once a bank of location monitors has been allocated, the following functions
are provided to configure the location and mode of the location monitor: are provided to configure the location and mode of the location monitor:
int vme_lm_set(struct vme_resource *res, unsigned long long base, int vme_lm_set(struct vme_resource *res, unsigned long long base,
vme_address_t aspace, vme_cycle_t cycle); u32 aspace, u32 cycle);
int vme_lm_get(struct vme_resource *res, unsigned long long *base, int vme_lm_get(struct vme_resource *res, unsigned long long *base,
vme_address_t *aspace, vme_cycle_t *cycle); u32 *aspace, u32 *cycle);
Location Monitor Use Location Monitor Use
......
...@@ -15,9 +15,9 @@ struct vme_master_resource { ...@@ -15,9 +15,9 @@ struct vme_master_resource {
spinlock_t lock; spinlock_t lock;
int locked; int locked;
int number; int number;
vme_address_t address_attr; u32 address_attr;
vme_cycle_t cycle_attr; u32 cycle_attr;
vme_width_t width_attr; u32 width_attr;
struct resource bus_resource; struct resource bus_resource;
void __iomem *kern_base; void __iomem *kern_base;
}; };
...@@ -28,13 +28,13 @@ struct vme_slave_resource { ...@@ -28,13 +28,13 @@ struct vme_slave_resource {
struct mutex mtx; struct mutex mtx;
int locked; int locked;
int number; int number;
vme_address_t address_attr; u32 address_attr;
vme_cycle_t cycle_attr; u32 cycle_attr;
}; };
struct vme_dma_pattern { struct vme_dma_pattern {
u32 pattern; u32 pattern;
vme_pattern_t type; u32 type;
}; };
struct vme_dma_pci { struct vme_dma_pci {
...@@ -43,9 +43,9 @@ struct vme_dma_pci { ...@@ -43,9 +43,9 @@ struct vme_dma_pci {
struct vme_dma_vme { struct vme_dma_vme {
unsigned long long address; unsigned long long address;
vme_address_t aspace; u32 aspace;
vme_cycle_t cycle; u32 cycle;
vme_width_t dwidth; u32 dwidth;
}; };
struct vme_dma_list { struct vme_dma_list {
...@@ -63,7 +63,7 @@ struct vme_dma_resource { ...@@ -63,7 +63,7 @@ struct vme_dma_resource {
int number; int number;
struct list_head pending; struct list_head pending;
struct list_head running; struct list_head running;
vme_dma_route_t route_attr; u32 route_attr;
}; };
struct vme_lm_resource { struct vme_lm_resource {
...@@ -122,17 +122,16 @@ struct vme_bridge { ...@@ -122,17 +122,16 @@ struct vme_bridge {
/* Slave Functions */ /* Slave Functions */
int (*slave_get) (struct vme_slave_resource *, int *, int (*slave_get) (struct vme_slave_resource *, int *,
unsigned long long *, unsigned long long *, dma_addr_t *, unsigned long long *, unsigned long long *, dma_addr_t *,
vme_address_t *, vme_cycle_t *); u32 *, u32 *);
int (*slave_set) (struct vme_slave_resource *, int, unsigned long long, int (*slave_set) (struct vme_slave_resource *, int, unsigned long long,
unsigned long long, dma_addr_t, vme_address_t, vme_cycle_t); unsigned long long, dma_addr_t, u32, u32);
/* Master Functions */ /* Master Functions */
int (*master_get) (struct vme_master_resource *, int *, int (*master_get) (struct vme_master_resource *, int *,
unsigned long long *, unsigned long long *, vme_address_t *, unsigned long long *, unsigned long long *, u32 *, u32 *,
vme_cycle_t *, vme_width_t *); u32 *);
int (*master_set) (struct vme_master_resource *, int, int (*master_set) (struct vme_master_resource *, int,
unsigned long long, unsigned long long, vme_address_t, unsigned long long, unsigned long long, u32, u32, u32);
vme_cycle_t, vme_width_t);
ssize_t (*master_read) (struct vme_master_resource *, void *, size_t, ssize_t (*master_read) (struct vme_master_resource *, void *, size_t,
loff_t); loff_t);
ssize_t (*master_write) (struct vme_master_resource *, void *, size_t, ssize_t (*master_write) (struct vme_master_resource *, void *, size_t,
...@@ -151,10 +150,9 @@ struct vme_bridge { ...@@ -151,10 +150,9 @@ struct vme_bridge {
int (*irq_generate) (struct vme_bridge *, int, int); int (*irq_generate) (struct vme_bridge *, int, int);
/* Location monitor functions */ /* Location monitor functions */
int (*lm_set) (struct vme_lm_resource *, unsigned long long, int (*lm_set) (struct vme_lm_resource *, unsigned long long, u32, u32);
vme_address_t, vme_cycle_t); int (*lm_get) (struct vme_lm_resource *, unsigned long long *, u32 *,
int (*lm_get) (struct vme_lm_resource *, unsigned long long *, u32 *);
vme_address_t *, vme_cycle_t *);
int (*lm_attach) (struct vme_lm_resource *, int, void (*callback)(int)); int (*lm_attach) (struct vme_lm_resource *, int, void (*callback)(int));
int (*lm_detach) (struct vme_lm_resource *, int); int (*lm_detach) (struct vme_lm_resource *, int);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment