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

Go to the source code of this file.

Macros

#define RIO_MAX_CHK_RETRY   3
 
#define DECLARE_RIO_SWITCH_SECTION(section, name, vid, did, init_hook)
 
#define DECLARE_RIO_SWITCH_INIT(vid, did, init_hook)
 
#define RIO_GET_DID(size, x)   (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16))
 
#define RIO_SET_DID(size, x)   (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))
 

Functions

u32 rio_mport_get_feature (struct rio_mport *mport, int local, u16 destid, u8 hopcount, int ftr)
 
u32 rio_mport_get_physefb (struct rio_mport *port, int local, u16 destid, u8 hopcount)
 
u32 rio_mport_get_efb (struct rio_mport *port, int local, u16 destid, u8 hopcount, u32 from)
 
int rio_mport_chk_dev_access (struct rio_mport *mport, u16 destid, u8 hopcount)
 
int rio_create_sysfs_dev_files (struct rio_dev *rdev)
 
int rio_enum_mport (struct rio_mport *mport)
 
int rio_disc_mport (struct rio_mport *mport)
 
int rio_std_route_add_entry (struct rio_mport *mport, u16 destid, u8 hopcount, u16 table, u16 route_destid, u8 route_port)
 
int rio_std_route_get_entry (struct rio_mport *mport, u16 destid, u8 hopcount, u16 table, u16 route_destid, u8 *route_port)
 
int rio_std_route_clr_table (struct rio_mport *mport, u16 destid, u8 hopcount, u16 table)
 
int rio_set_port_lockout (struct rio_dev *rdev, u32 pnum, int lock)
 
struct rio_devrio_get_comptag (u32 comp_tag, struct rio_dev *from)
 

Variables

struct device_attribute rio_dev_attrs []
 
spinlock_t rio_global_list_lock
 
struct rio_switch_ops __start_rio_switch_ops []
 
struct rio_switch_ops __end_rio_switch_ops []
 

Macro Definition Documentation

#define DECLARE_RIO_SWITCH_INIT (   vid,
  did,
  init_hook 
)
Value:
vid, did, init_hook)

DECLARE_RIO_SWITCH_INIT - Registers switch initialization routine : RIO vendor ID : RIO device ID : Callback that performs switch-specific initialization

Manipulating switch route tables and error management in RIO is switch specific. This registers a switch by vendor and device ID with initialization callback for setting up switch operations and (if required) hardware initialization. A &struct rio_switch_ops is initialized with pointer to the init routine and placed into a RIO-specific kernel section.

Definition at line 67 of file rio.h.

#define DECLARE_RIO_SWITCH_SECTION (   section,
  name,
  vid,
  did,
  init_hook 
)
Value:
static const struct rio_switch_ops __rio_switch_##name __used \

Definition at line 51 of file rio.h.

#define RIO_GET_DID (   size,
  x 
)    (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16))

Definition at line 71 of file rio.h.

#define RIO_MAX_CHK_RETRY   3

Definition at line 17 of file rio.h.

#define RIO_SET_DID (   size,
  x 
)    (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))

Definition at line 72 of file rio.h.

Function Documentation

int rio_create_sysfs_dev_files ( struct rio_dev rdev)

rio_create_sysfs_dev_files - create RIO specific sysfs files : device whose entries should be created

Create files when is added to sysfs.

Definition at line 250 of file rio-sysfs.c.

int rio_disc_mport ( struct rio_mport mport)

rio_disc_mport- Start discovery through a master port : Master port to send transactions

Starts the discovery process. If we have an active link, then wait for the signal that enumeration is complete. When enumeration completion is signaled, start recursive peer discovery. Returns %0 if discovery succeeds or %-EBUSY on failure.

Definition at line 1372 of file rio-scan.c.

int rio_enum_mport ( struct rio_mport mport)

rio_enum_mport- Start enumeration through a master port : Master port to send transactions

Starts the enumeration process. If somebody has enumerated our master port device, then give up. If not and we have an active link, then start recursive peer enumeration. Returns %0 if enumeration succeeds or %-EBUSY if enumeration fails.

Definition at line 1269 of file rio-scan.c.

struct rio_dev* rio_get_comptag ( u32  comp_tag,
struct rio_dev from 
)
read

rio_get_comptag - Begin or continue searching for a RIO device by component tag : RIO component tag to match : Previous RIO device found in search, or NULL for new search

Iterates through the list of known RIO devices. If a RIO device is found with a matching , a pointer to its device structure is returned. Otherwise, NULL is returned. A new search is initiated by passing NULL to the argument. Otherwise, if is not NULL, searches continue from next device on the global list.

Definition at line 505 of file rio.c.

int rio_mport_chk_dev_access ( struct rio_mport mport,
u16  destid,
u8  hopcount 
)

rio_mport_chk_dev_access - Validate access to the specified device. : Master port to send transactions : Device destination ID in network : Number of hops into the network

Definition at line 598 of file rio.c.

u32 rio_mport_get_efb ( struct rio_mport port,
int  local,
u16  destid,
u8  hopcount,
u32  from 
)

rio_mport_get_efb - get pointer to next extended features block : Master port to issue transaction : Indicate a local master port or remote device access : Destination ID of the device : Number of switch hops to the device : Offset of current Extended Feature block header (if 0 starts from ExtFeaturePtr)

Definition at line 922 of file rio.c.

u32 rio_mport_get_feature ( struct rio_mport port,
int  local,
u16  destid,
u8  hopcount,
int  ftr 
)

rio_mport_get_feature - query for devices' extended features : Master port to issue transaction : Indicate a local master port or remote device access : Destination ID of the device : Number of switch hops to the device : Extended feature code

Tell if a device supports a given RapidIO capability. Returns the offset of the requested extended feature block within the device's RIO configuration space or 0 in case the device does not support it. Possible values for :

RIO_EFB_PAR_EP_ID LP/LVDS EP Devices

RIO_EFB_PAR_EP_REC_ID LP/LVDS EP Recovery Devices

RIO_EFB_PAR_EP_FREE_ID LP/LVDS EP Free Devices

RIO_EFB_SER_EP_ID LP/Serial EP Devices

RIO_EFB_SER_EP_REC_ID LP/Serial EP Recovery Devices

RIO_EFB_SER_EP_FREE_ID LP/Serial EP Free Devices

Definition at line 972 of file rio.c.

u32 rio_mport_get_physefb ( struct rio_mport port,
int  local,
u16  destid,
u8  hopcount 
)

rio_mport_get_physefb - Helper function that returns register offset for Physical Layer Extended Features Block. : Master port to issue transaction : Indicate a local master port or remote device access : Destination ID of the device : Number of switch hops to the device

Definition at line 453 of file rio.c.

int rio_set_port_lockout ( struct rio_dev rdev,
u32  pnum,
int  lock 
)

rio_set_port_lockout - Sets/clears LOCKOUT bit (RIO EM 1.3) for a switch port. : Pointer to RIO device control structure : Switch port number to set LOCKOUT bit : Operation : set (=1) or clear (=0)

Definition at line 531 of file rio.c.

int rio_std_route_add_entry ( struct rio_mport mport,
u16  destid,
u8  hopcount,
u16  table,
u16  route_destid,
u8  route_port 
)

rio_std_route_add_entry - Add switch route table entry using standard registers defined in RIO specification rev.1.3 : Master port to issue transaction : Destination ID of the device : Number of switch hops to the device : routing table ID (global or port-specific) : destID entry in the RT : destination port for specified destID

Definition at line 1074 of file rio.c.

int rio_std_route_clr_table ( struct rio_mport mport,
u16  destid,
u8  hopcount,
u16  table 
)

rio_std_route_clr_table - Clear swotch route table using standard registers defined in RIO specification rev.1.3. : Master port to issue transaction : Destination ID of the device : Number of switch hops to the device : routing table ID (global or port-specific)

Definition at line 1126 of file rio.c.

int rio_std_route_get_entry ( struct rio_mport mport,
u16  destid,
u8  hopcount,
u16  table,
u16  route_destid,
u8 route_port 
)

rio_std_route_get_entry - Read switch route table entry (port number) associated with specified destID using standard registers defined in RIO specification rev.1.3 : Master port to issue transaction : Destination ID of the device : Number of switch hops to the device : routing table ID (global or port-specific) : destID entry in the RT : returned destination port for specified destID

Definition at line 1101 of file rio.c.

Variable Documentation

struct rio_switch_ops __end_rio_switch_ops[]
struct rio_switch_ops __start_rio_switch_ops[]
struct device_attribute rio_dev_attrs[]

Definition at line 87 of file rio-sysfs.c.

spinlock_t rio_global_list_lock