Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
rio-access.c File Reference
#include <linux/rio.h>
#include <linux/module.h>

Go to the source code of this file.

Macros

#define RIO_8_BAD   0
 
#define RIO_16_BAD   (offset & 1)
 
#define RIO_32_BAD   (offset & 3)
 
#define RIO_LOP_READ(size, type, len)
 
#define RIO_LOP_WRITE(size, type, len)
 
#define RIO_OP_READ(size, type, len)
 
#define RIO_OP_WRITE(size, type, len)
 

Functions

 EXPORT_SYMBOL_GPL (__rio_local_read_config_8)
 
 EXPORT_SYMBOL_GPL (__rio_local_read_config_16)
 
 EXPORT_SYMBOL_GPL (__rio_local_read_config_32)
 
 EXPORT_SYMBOL_GPL (__rio_local_write_config_8)
 
 EXPORT_SYMBOL_GPL (__rio_local_write_config_16)
 
 EXPORT_SYMBOL_GPL (__rio_local_write_config_32)
 
 EXPORT_SYMBOL_GPL (rio_mport_read_config_8)
 
 EXPORT_SYMBOL_GPL (rio_mport_read_config_16)
 
 EXPORT_SYMBOL_GPL (rio_mport_read_config_32)
 
 EXPORT_SYMBOL_GPL (rio_mport_write_config_8)
 
 EXPORT_SYMBOL_GPL (rio_mport_write_config_16)
 
 EXPORT_SYMBOL_GPL (rio_mport_write_config_32)
 
int rio_mport_send_doorbell (struct rio_mport *mport, u16 destid, u16 data)
 
 EXPORT_SYMBOL_GPL (rio_mport_send_doorbell)
 

Macro Definition Documentation

#define RIO_16_BAD   (offset & 1)

Definition at line 30 of file rio-access.c.

#define RIO_32_BAD   (offset & 3)

Definition at line 31 of file rio-access.c.

#define RIO_8_BAD   0

Definition at line 29 of file rio-access.c.

#define RIO_LOP_READ (   size,
  type,
  len 
)
Value:
int __rio_local_read_config_##size \
(struct rio_mport *mport, u32 offset, type *value) \
{ \
int res; \
unsigned long flags; \
u32 data = 0; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->lcread(mport, mport->id, offset, len, &data); \
*value = (type)data; \
spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \
}

RIO_LOP_READ - Generate rio_local_read_config_* functions : Size of configuration space read (8, 16, 32 bits) : C type of value argument : Length of configuration space read (1, 2, 4 bytes)

Generates rio_local_read_config_* functions used to access configuration space registers on the local device.

Definition at line 42 of file rio-access.c.

#define RIO_LOP_WRITE (   size,
  type,
  len 
)
Value:
int __rio_local_write_config_##size \
(struct rio_mport *mport, u32 offset, type value) \
{ \
int res; \
unsigned long flags; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->lcwrite(mport, mport->id, offset, len, value);\
spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \
}

RIO_LOP_WRITE - Generate rio_local_write_config_* functions : Size of configuration space write (8, 16, 32 bits) : C type of value argument : Length of configuration space write (1, 2, 4 bytes)

Generates rio_local_write_config_* functions used to access configuration space registers on the local device.

Definition at line 66 of file rio-access.c.

#define RIO_OP_READ (   size,
  type,
  len 
)
Value:
int rio_mport_read_config_##size \
(struct rio_mport *mport, u16 destid, u8 hopcount, u32 offset, type *value) \
{ \
int res; \
unsigned long flags; \
u32 data = 0; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->cread(mport, mport->id, destid, hopcount, offset, len, &data); \
*value = (type)data; \
spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \
}

RIO_OP_READ - Generate rio_mport_read_config_* functions : Size of configuration space read (8, 16, 32 bits) : C type of value argument : Length of configuration space read (1, 2, 4 bytes)

Generates rio_mport_read_config_* functions used to access configuration space registers on the local device.

Definition at line 102 of file rio-access.c.

#define RIO_OP_WRITE (   size,
  type,
  len 
)
Value:
int rio_mport_write_config_##size \
(struct rio_mport *mport, u16 destid, u8 hopcount, u32 offset, type value) \
{ \
int res; \
unsigned long flags; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->cwrite(mport, mport->id, destid, hopcount, offset, len, value); \
spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \
}

RIO_OP_WRITE - Generate rio_mport_write_config_* functions : Size of configuration space write (8, 16, 32 bits) : C type of value argument : Length of configuration space write (1, 2, 4 bytes)

Generates rio_mport_write_config_* functions used to access configuration space registers on the local device.

Definition at line 126 of file rio-access.c.

Function Documentation

EXPORT_SYMBOL_GPL ( __rio_local_read_config_8  )
EXPORT_SYMBOL_GPL ( __rio_local_read_config_16  )
EXPORT_SYMBOL_GPL ( __rio_local_read_config_32  )
EXPORT_SYMBOL_GPL ( __rio_local_write_config_8  )
EXPORT_SYMBOL_GPL ( __rio_local_write_config_16  )
EXPORT_SYMBOL_GPL ( __rio_local_write_config_32  )
EXPORT_SYMBOL_GPL ( rio_mport_read_config_8  )
EXPORT_SYMBOL_GPL ( rio_mport_read_config_16  )
EXPORT_SYMBOL_GPL ( rio_mport_read_config_32  )
EXPORT_SYMBOL_GPL ( rio_mport_write_config_8  )
EXPORT_SYMBOL_GPL ( rio_mport_write_config_16  )
EXPORT_SYMBOL_GPL ( rio_mport_write_config_32  )
EXPORT_SYMBOL_GPL ( rio_mport_send_doorbell  )
int rio_mport_send_doorbell ( struct rio_mport mport,
u16  destid,
u16  data 
)

rio_mport_send_doorbell - Send a doorbell message

: RIO master port : RIO device destination ID : Doorbell message data

Send a doorbell message to a RIO device. The doorbell message has a 16-bit info field provided by the data argument.

Definition at line 163 of file rio-access.c.