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

Go to the source code of this file.

Macros

#define RIO_DEVICE(dev, ven)
 

Functions

int __rio_local_read_config_32 (struct rio_mport *port, u32 offset, u32 *data)
 
int __rio_local_write_config_32 (struct rio_mport *port, u32 offset, u32 data)
 
int __rio_local_read_config_16 (struct rio_mport *port, u32 offset, u16 *data)
 
int __rio_local_write_config_16 (struct rio_mport *port, u32 offset, u16 data)
 
int __rio_local_read_config_8 (struct rio_mport *port, u32 offset, u8 *data)
 
int __rio_local_write_config_8 (struct rio_mport *port, u32 offset, u8 data)
 
int rio_mport_read_config_32 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u32 *data)
 
int rio_mport_write_config_32 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u32 data)
 
int rio_mport_read_config_16 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u16 *data)
 
int rio_mport_write_config_16 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u16 data)
 
int rio_mport_read_config_8 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u8 *data)
 
int rio_mport_write_config_8 (struct rio_mport *port, u16 destid, u8 hopcount, u32 offset, u8 data)
 
int rio_mport_send_doorbell (struct rio_mport *mport, u16 destid, u16 data)
 
int rio_request_outb_mbox (struct rio_mport *, void *, int, int, void(*)(struct rio_mport *, void *, int, int))
 
int rio_release_outb_mbox (struct rio_mport *, int)
 
int rio_request_inb_mbox (struct rio_mport *, void *, int, int, void(*)(struct rio_mport *, void *, int, int))
 
int rio_release_inb_mbox (struct rio_mport *, int)
 
int rio_request_inb_dbell (struct rio_mport *, void *, u16, u16, void(*)(struct rio_mport *, void *, u16, u16, u16))
 
int rio_release_inb_dbell (struct rio_mport *, u16, u16)
 
struct resourcerio_request_outb_dbell (struct rio_dev *, u16, u16)
 
int rio_release_outb_dbell (struct rio_dev *, struct resource *)
 
int rio_claim_resource (struct rio_dev *, int)
 
int rio_request_regions (struct rio_dev *, char *)
 
void rio_release_regions (struct rio_dev *)
 
int rio_request_region (struct rio_dev *, int, char *)
 
void rio_release_region (struct rio_dev *, int)
 
int rio_map_inb_region (struct rio_mport *mport, dma_addr_t local, u64 rbase, u32 size, u32 rflags)
 
void rio_unmap_inb_region (struct rio_mport *mport, dma_addr_t lstart)
 
int rio_request_inb_pwrite (struct rio_dev *, int(*)(struct rio_dev *, union rio_pw_msg *, int))
 
int rio_release_inb_pwrite (struct rio_dev *)
 
int rio_inb_pwrite_handler (union rio_pw_msg *pw_msg)
 
int rio_register_driver (struct rio_driver *)
 
void rio_unregister_driver (struct rio_driver *)
 
struct rio_devrio_dev_get (struct rio_dev *)
 
void rio_dev_put (struct rio_dev *)
 
u16 rio_local_get_device_id (struct rio_mport *port)
 
struct rio_devrio_get_device (u16 vid, u16 did, struct rio_dev *from)
 
struct rio_devrio_get_asm (u16 vid, u16 did, u16 asm_vid, u16 asm_did, struct rio_dev *from)
 

Macro Definition Documentation

#define RIO_DEVICE (   dev,
  ven 
)
Value:
.did = (dev), .vid = (ven), \
.asm_did = RIO_ANY_ID, .asm_vid = RIO_ANY_ID

RIO_DEVICE - macro used to describe a specific RIO device : the 16 bit RIO device ID : the 16 bit RIO vendor ID

This macro is used to create a struct rio_device_id that matches a specific device. The assembly vendor and assembly device fields will be set to RIO_ANY_ID.

Definition at line 295 of file rio_drv.h.

Function Documentation

int __rio_local_read_config_16 ( struct rio_mport port,
u32  offset,
u16 data 
)
int __rio_local_read_config_32 ( struct rio_mport port,
u32  offset,
u32 data 
)
int __rio_local_read_config_8 ( struct rio_mport port,
u32  offset,
u8 data 
)
int __rio_local_write_config_16 ( struct rio_mport port,
u32  offset,
u16  data 
)
int __rio_local_write_config_32 ( struct rio_mport port,
u32  offset,
u32  data 
)
int __rio_local_write_config_8 ( struct rio_mport port,
u32  offset,
u8  data 
)
int rio_claim_resource ( struct rio_dev ,
int   
)
struct rio_dev* rio_dev_get ( struct rio_dev rdev)
read

rio_dev_get - Increments the reference count of the RIO device structure

: RIO device being referenced

Each live reference to a device should be refcounted.

Drivers for RIO devices should normally record such references in their probe() methods, when they bind to a device, and release them by calling rio_dev_put(), in their disconnect() methods.

Definition at line 57 of file rio-driver.c.

void rio_dev_put ( struct rio_dev rdev)

rio_dev_put - Release a use of the RIO device structure

: RIO device being disconnected

Must be called when a user of a device is finished with it. When the last user of the device calls this function, the memory of the device is freed.

Definition at line 74 of file rio-driver.c.

struct rio_dev* rio_get_asm ( u16  vid,
u16  did,
u16  asm_vid,
u16  asm_did,
struct rio_dev from 
)
read

rio_get_asm - Begin or continue searching for a RIO device by vid/did/asm_vid/asm_did : RIO vid to match or RIO_ANY_ID to match all vids : RIO did to match or RIO_ANY_ID to match all dids : RIO asm_vid to match or RIO_ANY_ID to match all asm_vids : RIO asm_did to match or RIO_ANY_ID to match all asm_dids : 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 , , , , the reference count to the device is incrememted and 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. The reference count for is always decremented if it is not NULL.

Definition at line 1018 of file rio.c.

struct rio_dev* rio_get_device ( u16  vid,
u16  did,
struct rio_dev from 
)
read

rio_get_device - Begin or continue searching for a RIO device by vid/did : RIO vid to match or RIO_ANY_ID to match all vids : RIO did to match or RIO_ANY_ID to match all dids : 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 and , the reference count to the device is incrememted and 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. The reference count for is always decremented if it is not NULL.

Definition at line 1059 of file rio.c.

int rio_inb_pwrite_handler ( union rio_pw_msg pw_msg)

rio_inb_pwrite_handler - process inbound port-write message : pointer to inbound port-write message

Processes an inbound port-write message. Returns 0 if the request has been satisfied.

Definition at line 766 of file rio.c.

u16 rio_local_get_device_id ( struct rio_mport port)

rio_local_get_device_id - Get the base/extended device id for a port : RIO master port from which to get the deviceid

Reads the base/extended device id from the local device implementing the master port. Returns the 8/16-bit device id.

Definition at line 46 of file rio.c.

int rio_map_inb_region ( struct rio_mport mport,
dma_addr_t  local,
u64  rbase,
u32  size,
u32  rflags 
)

rio_map_inb_region – Map inbound memory region. : Master port. : physical address of memory region to be mapped : RIO base address assigned to this window : Size of the memory region : Flags for mapping.

Return: 0 – Success.

This function will create the mapping from RIO space to local memory.

Definition at line 413 of file rio.c.

int rio_mport_read_config_16 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u16 data 
)
int rio_mport_read_config_32 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u32 data 
)
int rio_mport_read_config_8 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u8 data 
)
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.

int rio_mport_write_config_16 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u16  data 
)
int rio_mport_write_config_32 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u32  data 
)
int rio_mport_write_config_8 ( struct rio_mport port,
u16  destid,
u8  hopcount,
u32  offset,
u8  data 
)
int rio_register_driver ( struct rio_driver rdrv)

rio_register_driver - register a new RIO driver : the RIO driver structure to register

Adds a &struct rio_driver to the list of registered drivers. Returns a negative value on error, otherwise 0. If no error occurred, the driver remains registered even if no device was claimed during registration.

Definition at line 143 of file rio-driver.c.

int rio_release_inb_dbell ( struct rio_mport mport,
u16  start,
u16  end 
)

rio_release_inb_dbell - release inbound doorbell message service : RIO master port from which to release the doorbell resource : Doorbell info range start : Doorbell info range end

Releases ownership of an inbound doorbell resource and removes callback from the doorbell event list. Returns 0 if the request has been satisfied.

Definition at line 279 of file rio.c.

int rio_release_inb_mbox ( struct rio_mport mport,
int  mbox 
)

rio_release_inb_mbox - release inbound mailbox message service : RIO master port from which to release the mailbox resource : Mailbox number to release

Releases ownership of an inbound mailbox resource. Returns 0 if the request has been satisfied.

Definition at line 113 of file rio.c.

int rio_release_inb_pwrite ( struct rio_dev rdev)

rio_release_inb_pwrite - release inbound port-write message service : RIO device which registered for inbound port-write callback

Removes callback from the rio_dev structure. Returns 0 if the request has been satisfied.

Definition at line 386 of file rio.c.

int rio_release_outb_dbell ( struct rio_dev rdev,
struct resource res 
)

rio_release_outb_dbell - release outbound doorbell message range : RIO device from which to release the doorbell resource : Doorbell resource to be freed

Releases ownership of a doorbell message range. Returns 0 if the request has been satisfied.

Definition at line 346 of file rio.c.

int rio_release_outb_mbox ( struct rio_mport mport,
int  mbox 
)

rio_release_outb_mbox - release outbound mailbox message service : RIO master port from which to release the mailbox resource : Mailbox number to release

Releases ownership of an inbound mailbox resource. Returns 0 if the request has been satisfied.

Definition at line 181 of file rio.c.

void rio_release_region ( struct rio_dev ,
int   
)
void rio_release_regions ( struct rio_dev )
int rio_request_inb_dbell ( struct rio_mport ,
void ,
u16  ,
u16  ,
void(*)(struct rio_mport *, void *, u16, u16, u16  
)
int rio_request_inb_mbox ( struct rio_mport ,
void ,
int  ,
int  ,
void(*)(struct rio_mport *, void *, int, int  
)
int rio_request_inb_pwrite ( struct rio_dev ,
int(*)(struct rio_dev *, union rio_pw_msg *, int  
)
struct resource* rio_request_outb_dbell ( struct rio_dev rdev,
u16  start,
u16  end 
)
read

rio_request_outb_dbell - request outbound doorbell message range : RIO device from which to allocate the doorbell resource : Doorbell message range start : Doorbell message range end

Requests ownership of a doorbell message range. Returns a resource if the request has been satisfied or NULL on failure.

Definition at line 319 of file rio.c.

int rio_request_outb_mbox ( struct rio_mport ,
void ,
int  ,
int  ,
void(*)(struct rio_mport *, void *, int, int  
)
int rio_request_region ( struct rio_dev ,
int  ,
char  
)
int rio_request_regions ( struct rio_dev ,
char  
)
void rio_unmap_inb_region ( struct rio_mport mport,
dma_addr_t  lstart 
)

rio_unmap_inb_region – Unmap the inbound memory region : Master port : physical address of memory region to be unmapped

Definition at line 433 of file rio.c.

void rio_unregister_driver ( struct rio_driver rdrv)

rio_unregister_driver - unregister a RIO driver : the RIO driver structure to unregister

Deletes the &struct rio_driver from the list of registered RIO drivers, gives it a chance to clean up by calling its remove() function for each device it was responsible for, and marks those devices as driverless.

Definition at line 162 of file rio-driver.c.