Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ps3-vuart.c File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <asm/ps3.h>
#include <asm/firmware.h>
#include <asm/lv1call.h>
#include "vuart.h"

Go to the source code of this file.

Data Structures

struct  ps3_vuart_port_priv
 
struct  ports_bmp
 
struct  vuart_triggers
 
struct  list_buffer
 
struct  vuart_bus_priv
 

Macros

#define dump_ports_bmp(_b)   _dump_ports_bmp(_b, __func__, __LINE__)
 
#define dump_port_params(_b)   _dump_port_params(_b, __func__, __LINE__)
 

Enumerations

enum  { PORT_COUNT = 3 }
 
enum  vuart_param {
  PARAM_TX_TRIGGER = 0, PARAM_RX_TRIGGER = 1, PARAM_INTERRUPT_MASK = 2, PARAM_RX_BUF_SIZE = 3,
  PARAM_RX_BYTES = 4, PARAM_TX_BUF_SIZE = 5, PARAM_TX_BYTES = 6, PARAM_INTERRUPT_STATUS = 7
}
 
enum  vuart_interrupt_bit { INTERRUPT_BIT_TX = 0, INTERRUPT_BIT_RX = 1, INTERRUPT_BIT_DISCONNECT = 2 }
 
enum  vuart_interrupt_mask { INTERRUPT_MASK_TX = 1, INTERRUPT_MASK_RX = 2, INTERRUPT_MASK_DISCONNECT = 4 }
 

Functions

 MODULE_AUTHOR ("Sony Corporation")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_DESCRIPTION ("PS3 vuart")
 
struct ports_bmp __attribute__ ((aligned(32)))
 
int ps3_vuart_get_triggers (struct ps3_system_bus_device *dev, struct vuart_triggers *trig)
 
int ps3_vuart_set_triggers (struct ps3_system_bus_device *dev, unsigned int tx, unsigned int rx)
 
int ps3_vuart_enable_interrupt_tx (struct ps3_system_bus_device *dev)
 
int ps3_vuart_enable_interrupt_rx (struct ps3_system_bus_device *dev)
 
int ps3_vuart_enable_interrupt_disconnect (struct ps3_system_bus_device *dev)
 
int ps3_vuart_disable_interrupt_tx (struct ps3_system_bus_device *dev)
 
int ps3_vuart_disable_interrupt_rx (struct ps3_system_bus_device *dev)
 
int ps3_vuart_disable_interrupt_disconnect (struct ps3_system_bus_device *dev)
 
void ps3_vuart_clear_rx_bytes (struct ps3_system_bus_device *dev, unsigned int bytes)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_clear_rx_bytes)
 
int ps3_vuart_write (struct ps3_system_bus_device *dev, const void *buf, unsigned int bytes)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_write)
 
int ps3_vuart_read (struct ps3_system_bus_device *dev, void *buf, unsigned int bytes)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_read)
 
int ps3_vuart_read_async (struct ps3_system_bus_device *dev, unsigned int bytes)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_read_async)
 
void ps3_vuart_cancel_async (struct ps3_system_bus_device *dev)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_cancel_async)
 
 core_initcall (ps3_vuart_bus_init)
 
 module_exit (ps3_vuart_bus_exit)
 
int ps3_vuart_port_driver_register (struct ps3_vuart_port_driver *drv)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_port_driver_register)
 
void ps3_vuart_port_driver_unregister (struct ps3_vuart_port_driver *drv)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_port_driver_unregister)
 

Variables

u64 status
 
u64 unused [3]
 
struct vuart_triggers __attribute__
 
struct vuart_bus_priv vuart_bus_priv
 

Macro Definition Documentation

#define dump_port_params (   _b)    _dump_port_params(_b, __func__, __LINE__)

Definition at line 121 of file ps3-vuart.c.

#define dump_ports_bmp (   _b)    _dump_ports_bmp(_b, __func__, __LINE__)

Definition at line 114 of file ps3-vuart.c.

Enumeration Type Documentation

anonymous enum

vuart - An inter-partition data link service. port 0: PS3 AV Settings. port 2: PS3 System Manager.

The vuart provides a bi-directional byte stream data link between logical partitions. Its primary role is as a communications link between the guest OS and the system policy module. The current HV does not support any connections other than those listed.

Enumerator:
PORT_COUNT 

Definition at line 49 of file ps3-vuart.c.

Enumerator:
INTERRUPT_BIT_TX 
INTERRUPT_BIT_RX 
INTERRUPT_BIT_DISCONNECT 

Definition at line 62 of file ps3-vuart.c.

Enumerator:
INTERRUPT_MASK_TX 
INTERRUPT_MASK_RX 
INTERRUPT_MASK_DISCONNECT 

Definition at line 68 of file ps3-vuart.c.

Enumerator:
PARAM_TX_TRIGGER 
PARAM_RX_TRIGGER 
PARAM_INTERRUPT_MASK 
PARAM_RX_BUF_SIZE 
PARAM_RX_BYTES 
PARAM_TX_BUF_SIZE 
PARAM_TX_BYTES 
PARAM_INTERRUPT_STATUS 

Definition at line 51 of file ps3-vuart.c.

Function Documentation

core_initcall ( ps3_vuart_bus_init  )
EXPORT_SYMBOL_GPL ( ps3_vuart_clear_rx_bytes  )
EXPORT_SYMBOL_GPL ( ps3_vuart_write  )
EXPORT_SYMBOL_GPL ( ps3_vuart_read  )
EXPORT_SYMBOL_GPL ( ps3_vuart_read_async  )
EXPORT_SYMBOL_GPL ( ps3_vuart_cancel_async  )
EXPORT_SYMBOL_GPL ( ps3_vuart_port_driver_register  )
EXPORT_SYMBOL_GPL ( ps3_vuart_port_driver_unregister  )
MODULE_AUTHOR ( "Sony Corporation"  )
MODULE_DESCRIPTION ( "PS3 vuart"  )
module_exit ( ps3_vuart_bus_exit  )
MODULE_LICENSE ( "GPL v2 )
void ps3_vuart_cancel_async ( struct ps3_system_bus_device dev)

Definition at line 723 of file ps3-vuart.c.

void ps3_vuart_clear_rx_bytes ( struct ps3_system_bus_device dev,
unsigned int  bytes 
)

ps3_vuart_clear_rx_bytes - Discard bytes received. : The struct ps3_system_bus_device instance. : Max byte count to discard, zero = all pending.

Used to clear pending rx interrupt source. Will not block.

Definition at line 431 of file ps3-vuart.c.

int ps3_vuart_disable_interrupt_disconnect ( struct ps3_system_bus_device dev)

Definition at line 352 of file ps3-vuart.c.

int ps3_vuart_disable_interrupt_rx ( struct ps3_system_bus_device dev)

Definition at line 343 of file ps3-vuart.c.

int ps3_vuart_disable_interrupt_tx ( struct ps3_system_bus_device dev)

Definition at line 334 of file ps3-vuart.c.

int ps3_vuart_enable_interrupt_disconnect ( struct ps3_system_bus_device dev)

Definition at line 325 of file ps3-vuart.c.

int ps3_vuart_enable_interrupt_rx ( struct ps3_system_bus_device dev)

Definition at line 316 of file ps3-vuart.c.

int ps3_vuart_enable_interrupt_tx ( struct ps3_system_bus_device dev)

Definition at line 307 of file ps3-vuart.c.

int ps3_vuart_get_triggers ( struct ps3_system_bus_device dev,
struct vuart_triggers trig 
)

Definition at line 159 of file ps3-vuart.c.

int ps3_vuart_port_driver_register ( struct ps3_vuart_port_driver drv)

ps3_vuart_port_driver_register - Add a vuart port device driver.

Definition at line 1244 of file ps3-vuart.c.

void ps3_vuart_port_driver_unregister ( struct ps3_vuart_port_driver drv)

ps3_vuart_port_driver_unregister - Remove a vuart port device driver.

Definition at line 1266 of file ps3-vuart.c.

int ps3_vuart_read ( struct ps3_system_bus_device dev,
void buf,
unsigned int  bytes 
)

ps3_vuart_read - The entry point for reading data from a port.

Queue data waiting at the port, and if enough bytes to satisfy the request are held in the buffer list those bytes are dequeued and copied to the caller's buffer. Emptied list buffers are retiered. If the request cannot be statified by bytes held in the list buffers -EAGAIN is returned.

Definition at line 615 of file ps3-vuart.c.

int ps3_vuart_read_async ( struct ps3_system_bus_device dev,
unsigned int  bytes 
)

Definition at line 689 of file ps3-vuart.c.

int ps3_vuart_set_triggers ( struct ps3_system_bus_device dev,
unsigned int  tx,
unsigned int  rx 
)

Definition at line 203 of file ps3-vuart.c.

int ps3_vuart_write ( struct ps3_system_bus_device dev,
const void buf,
unsigned int  bytes 
)

ps3_vuart_write - the entry point for writing data to a port : The struct ps3_system_bus_device instance.

If the port is idle on entry as much of the incoming data is written to the port as the port will accept. Otherwise a list buffer is created and any remaning incoming data is copied to that buffer. The buffer is then enqueued for transmision via the transmit interrupt.

Definition at line 491 of file ps3-vuart.c.

Variable Documentation

Definition at line 113 of file ps3-vuart.c.

u64 unused[3]

Definition at line 114 of file ps3-vuart.c.