Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ldc.c File Reference
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/scatterlist.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/init.h>
#include <linux/bitmap.h>
#include <asm/hypervisor.h>
#include <asm/iommu.h>
#include <asm/page.h>
#include <asm/ldc.h>
#include <asm/mdesc.h>

Go to the source code of this file.

Data Structures

struct  ldc_packet
 
struct  ldc_version
 
struct  ldc_mode_ops
 
struct  ldc_iommu
 
struct  ldc_channel
 
struct  cookie_state
 

Macros

#define DRV_MODULE_NAME   "ldc"
 
#define PFX   DRV_MODULE_NAME ": "
 
#define DRV_MODULE_VERSION   "1.1"
 
#define DRV_MODULE_RELDATE   "July 22, 2008"
 
#define LDC_PACKET_SIZE   64
 
#define LDC_CTRL   0x01
 
#define LDC_DATA   0x02
 
#define LDC_ERR   0x10
 
#define LDC_INFO   0x01
 
#define LDC_ACK   0x02
 
#define LDC_NACK   0x04
 
#define LDC_VERS   0x01 /* Link Version */
 
#define LDC_RTS   0x02 /* Request To Send */
 
#define LDC_RTR   0x03 /* Ready To Receive */
 
#define LDC_RDX   0x04 /* Ready for Data eXchange */
 
#define LDC_CTRL_MSK   0x0f
 
#define LDC_LEN   0x3f
 
#define LDC_FRAG_MASK   0xc0
 
#define LDC_START   0x40
 
#define LDC_STOP   0x80
 
#define LDC_DEFAULT_MTU   (4 * LDC_PACKET_SIZE)
 
#define LDC_DEFAULT_NUM_ENTRIES   (PAGE_SIZE / LDC_PACKET_SIZE)
 
#define LDC_HS_CLOSED   0x00
 
#define LDC_HS_OPEN   0x01
 
#define LDC_HS_GOTVERS   0x02
 
#define LDC_HS_SENTRTR   0x03
 
#define LDC_HS_GOTRTR   0x04
 
#define LDC_HS_COMPLETE   0x10
 
#define LDC_FLAG_ALLOCED_QUEUES   0x01
 
#define LDC_FLAG_REGISTERED_QUEUES   0x02
 
#define LDC_FLAG_REGISTERED_IRQS   0x04
 
#define LDC_FLAG_RESET   0x10
 
#define LDC_IRQ_NAME_MAX   32
 
#define ldcdbg(TYPE, f, a...)
 
#define LDC_IOTABLE_SIZE   (8 * 1024)
 
#define COOKIE_PGSZ_CODE   0xf000000000000000ULL
 
#define COOKIE_PGSZ_CODE_SHIFT   60ULL
 

Functions

struct ldc_channelldc_alloc (unsigned long id, const struct ldc_channel_config *cfgp, void *event_arg)
 
 EXPORT_SYMBOL (ldc_alloc)
 
void ldc_free (struct ldc_channel *lp)
 
 EXPORT_SYMBOL (ldc_free)
 
int ldc_bind (struct ldc_channel *lp, const char *name)
 
 EXPORT_SYMBOL (ldc_bind)
 
int ldc_connect (struct ldc_channel *lp)
 
 EXPORT_SYMBOL (ldc_connect)
 
int ldc_disconnect (struct ldc_channel *lp)
 
 EXPORT_SYMBOL (ldc_disconnect)
 
int ldc_state (struct ldc_channel *lp)
 
 EXPORT_SYMBOL (ldc_state)
 
int ldc_write (struct ldc_channel *lp, const void *buf, unsigned int size)
 
 EXPORT_SYMBOL (ldc_write)
 
int ldc_read (struct ldc_channel *lp, void *buf, unsigned int size)
 
 EXPORT_SYMBOL (ldc_read)
 
int ldc_map_sg (struct ldc_channel *lp, struct scatterlist *sg, int num_sg, struct ldc_trans_cookie *cookies, int ncookies, unsigned int map_perm)
 
 EXPORT_SYMBOL (ldc_map_sg)
 
int ldc_map_single (struct ldc_channel *lp, void *buf, unsigned int len, struct ldc_trans_cookie *cookies, int ncookies, unsigned int map_perm)
 
 EXPORT_SYMBOL (ldc_map_single)
 
void ldc_unmap (struct ldc_channel *lp, struct ldc_trans_cookie *cookies, int ncookies)
 
 EXPORT_SYMBOL (ldc_unmap)
 
int ldc_copy (struct ldc_channel *lp, int copy_dir, void *buf, unsigned int len, unsigned long offset, struct ldc_trans_cookie *cookies, int ncookies)
 
 EXPORT_SYMBOL (ldc_copy)
 
voidldc_alloc_exp_dring (struct ldc_channel *lp, unsigned int len, struct ldc_trans_cookie *cookies, int *ncookies, unsigned int map_perm)
 
 EXPORT_SYMBOL (ldc_alloc_exp_dring)
 
void ldc_free_exp_dring (struct ldc_channel *lp, void *buf, unsigned int len, struct ldc_trans_cookie *cookies, int ncookies)
 
 EXPORT_SYMBOL (ldc_free_exp_dring)
 
 core_initcall (ldc_init)
 

Variables

int ldom_domaining_enabled
 

Macro Definition Documentation

#define COOKIE_PGSZ_CODE   0xf000000000000000ULL

Definition at line 1913 of file ldc.c.

#define COOKIE_PGSZ_CODE_SHIFT   60ULL

Definition at line 1914 of file ldc.c.

#define DRV_MODULE_NAME   "ldc"

Definition at line 25 of file ldc.c.

#define DRV_MODULE_RELDATE   "July 22, 2008"

Definition at line 28 of file ldc.c.

#define DRV_MODULE_VERSION   "1.1"

Definition at line 27 of file ldc.c.

#define LDC_ACK   0x02

Definition at line 46 of file ldc.c.

#define LDC_CTRL   0x01

Definition at line 40 of file ldc.c.

#define LDC_CTRL_MSK   0x0f

Definition at line 54 of file ldc.c.

#define LDC_DATA   0x02

Definition at line 41 of file ldc.c.

#define LDC_DEFAULT_MTU   (4 * LDC_PACKET_SIZE)

Definition at line 84 of file ldc.c.

#define LDC_DEFAULT_NUM_ENTRIES   (PAGE_SIZE / LDC_PACKET_SIZE)

Definition at line 85 of file ldc.c.

#define LDC_ERR   0x10

Definition at line 42 of file ldc.c.

#define LDC_FLAG_ALLOCED_QUEUES   0x01

Definition at line 154 of file ldc.c.

#define LDC_FLAG_REGISTERED_IRQS   0x04

Definition at line 156 of file ldc.c.

#define LDC_FLAG_REGISTERED_QUEUES   0x02

Definition at line 155 of file ldc.c.

#define LDC_FLAG_RESET   0x10

Definition at line 157 of file ldc.c.

#define LDC_FRAG_MASK   0xc0

Definition at line 58 of file ldc.c.

#define LDC_HS_CLOSED   0x00

Definition at line 146 of file ldc.c.

#define LDC_HS_COMPLETE   0x10

Definition at line 151 of file ldc.c.

#define LDC_HS_GOTRTR   0x04

Definition at line 150 of file ldc.c.

#define LDC_HS_GOTVERS   0x02

Definition at line 148 of file ldc.c.

#define LDC_HS_OPEN   0x01

Definition at line 147 of file ldc.c.

#define LDC_HS_SENTRTR   0x03

Definition at line 149 of file ldc.c.

#define LDC_INFO   0x01

Definition at line 45 of file ldc.c.

#define LDC_IOTABLE_SIZE   (8 * 1024)

Definition at line 1003 of file ldc.c.

#define LDC_IRQ_NAME_MAX   32

Definition at line 162 of file ldc.c.

#define LDC_LEN   0x3f

Definition at line 57 of file ldc.c.

#define LDC_NACK   0x04

Definition at line 47 of file ldc.c.

#define LDC_PACKET_SIZE   64

Definition at line 32 of file ldc.c.

#define LDC_RDX   0x04 /* Ready for Data eXchange */

Definition at line 53 of file ldc.c.

#define LDC_RTR   0x03 /* Ready To Receive */

Definition at line 52 of file ldc.c.

#define LDC_RTS   0x02 /* Request To Send */

Definition at line 51 of file ldc.c.

#define LDC_START   0x40

Definition at line 59 of file ldc.c.

#define LDC_STOP   0x80

Definition at line 60 of file ldc.c.

#define LDC_VERS   0x01 /* Link Version */

Definition at line 50 of file ldc.c.

#define ldcdbg (   TYPE,
  f,
  a... 
)
Value:
do { if (lp->cfg.debug & LDC_DEBUG_##TYPE) \
printk(KERN_INFO PFX "ID[%lu] " f, lp->id, ## a); \
} while (0)

Definition at line 171 of file ldc.c.

#define PFX   DRV_MODULE_NAME ": "

Definition at line 26 of file ldc.c.

Function Documentation

core_initcall ( ldc_init  )
EXPORT_SYMBOL ( ldc_alloc  )
EXPORT_SYMBOL ( ldc_free  )
EXPORT_SYMBOL ( ldc_bind  )
EXPORT_SYMBOL ( ldc_connect  )
EXPORT_SYMBOL ( ldc_disconnect  )
EXPORT_SYMBOL ( ldc_state  )
EXPORT_SYMBOL ( ldc_write  )
EXPORT_SYMBOL ( ldc_read  )
EXPORT_SYMBOL ( ldc_map_sg  )
EXPORT_SYMBOL ( ldc_map_single  )
EXPORT_SYMBOL ( ldc_unmap  )
EXPORT_SYMBOL ( ldc_copy  )
EXPORT_SYMBOL ( ldc_alloc_exp_dring  )
EXPORT_SYMBOL ( ldc_free_exp_dring  )
struct ldc_channel* ldc_alloc ( unsigned long  id,
const struct ldc_channel_config cfgp,
void event_arg 
)
read

Definition at line 1080 of file ldc.c.

void* ldc_alloc_exp_dring ( struct ldc_channel lp,
unsigned int  len,
struct ldc_trans_cookie cookies,
int ncookies,
unsigned int  map_perm 
)

Definition at line 2300 of file ldc.c.

int ldc_bind ( struct ldc_channel lp,
const char name 
)

Definition at line 1241 of file ldc.c.

int ldc_connect ( struct ldc_channel lp)

Definition at line 1327 of file ldc.c.

int ldc_copy ( struct ldc_channel lp,
int  copy_dir,
void buf,
unsigned int  len,
unsigned long  offset,
struct ldc_trans_cookie cookies,
int  ncookies 
)

Definition at line 2210 of file ldc.c.

int ldc_disconnect ( struct ldc_channel lp)

Definition at line 1350 of file ldc.c.

void ldc_free ( struct ldc_channel lp)

Definition at line 1208 of file ldc.c.

void ldc_free_exp_dring ( struct ldc_channel lp,
void buf,
unsigned int  len,
struct ldc_trans_cookie cookies,
int  ncookies 
)

Definition at line 2325 of file ldc.c.

int ldc_map_sg ( struct ldc_channel lp,
struct scatterlist sg,
int  num_sg,
struct ldc_trans_cookie cookies,
int  ncookies,
unsigned int  map_perm 
)

Definition at line 2082 of file ldc.c.

int ldc_map_single ( struct ldc_channel lp,
void buf,
unsigned int  len,
struct ldc_trans_cookie cookies,
int  ncookies,
unsigned int  map_perm 
)

Definition at line 2128 of file ldc.c.

int ldc_read ( struct ldc_channel lp,
void buf,
unsigned int  size 
)

Definition at line 1858 of file ldc.c.

int ldc_state ( struct ldc_channel lp)

Definition at line 1404 of file ldc.c.

void ldc_unmap ( struct ldc_channel lp,
struct ldc_trans_cookie cookies,
int  ncookies 
)

Definition at line 2192 of file ldc.c.

int ldc_write ( struct ldc_channel lp,
const void buf,
unsigned int  size 
)

Definition at line 1834 of file ldc.c.

Variable Documentation

int ldom_domaining_enabled

Definition at line 98 of file ldc.c.