Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dvb_ca_en50221.c File Reference
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include "dvb_ca_en50221.h"
#include "dvb_ringbuffer.h"

Go to the source code of this file.

Data Structures

struct  dvb_ca_slot
 
struct  dvb_ca_private
 

Macros

#define dprintk   if (dvb_ca_en50221_debug) printk
 
#define INIT_TIMEOUT_SECS   10
 
#define HOST_LINK_BUF_SIZE   0x200
 
#define RX_BUFFER_SIZE   65535
 
#define MAX_RX_PACKETS_PER_ITERATION   10
 
#define CTRLIF_DATA   0
 
#define CTRLIF_COMMAND   1
 
#define CTRLIF_STATUS   1
 
#define CTRLIF_SIZE_LOW   2
 
#define CTRLIF_SIZE_HIGH   3
 
#define CMDREG_HC   1 /* Host control */
 
#define CMDREG_SW   2 /* Size write */
 
#define CMDREG_SR   4 /* Size read */
 
#define CMDREG_RS   8 /* Reset interface */
 
#define CMDREG_FRIE   0x40 /* Enable FR interrupt */
 
#define CMDREG_DAIE   0x80 /* Enable DA interrupt */
 
#define IRQEN   (CMDREG_DAIE)
 
#define STATUSREG_RE   1 /* read error */
 
#define STATUSREG_WE   2 /* write error */
 
#define STATUSREG_FR   0x40 /* module free */
 
#define STATUSREG_DA   0x80 /* data available */
 
#define STATUSREG_TXERR   (STATUSREG_RE|STATUSREG_WE) /* general transfer error */
 
#define DVB_CA_SLOTSTATE_NONE   0
 
#define DVB_CA_SLOTSTATE_UNINITIALISED   1
 
#define DVB_CA_SLOTSTATE_RUNNING   2
 
#define DVB_CA_SLOTSTATE_INVALID   3
 
#define DVB_CA_SLOTSTATE_WAITREADY   4
 
#define DVB_CA_SLOTSTATE_VALIDATE   5
 
#define DVB_CA_SLOTSTATE_WAITFR   6
 
#define DVB_CA_SLOTSTATE_LINKINIT   7
 

Functions

 module_param_named (cam_debug, dvb_ca_en50221_debug, int, 0644)
 
 MODULE_PARM_DESC (cam_debug,"enable verbose debug messages")
 
 EXPORT_SYMBOL (dvb_ca_en50221_camchange_irq)
 
 EXPORT_SYMBOL (dvb_ca_en50221_camready_irq)
 
void dvb_ca_en50221_camchange_irq (struct dvb_ca_en50221 *pubca, int slot, int change_type)
 
 EXPORT_SYMBOL (dvb_ca_en50221_frda_irq)
 
void dvb_ca_en50221_camready_irq (struct dvb_ca_en50221 *pubca, int slot)
 
void dvb_ca_en50221_frda_irq (struct dvb_ca_en50221 *pubca, int slot)
 
 EXPORT_SYMBOL (dvb_ca_en50221_init)
 
int dvb_ca_en50221_init (struct dvb_adapter *dvb_adapter, struct dvb_ca_en50221 *pubca, int flags, int slot_count)
 
 EXPORT_SYMBOL (dvb_ca_en50221_release)
 
void dvb_ca_en50221_release (struct dvb_ca_en50221 *pubca)
 

Macro Definition Documentation

#define CMDREG_DAIE   0x80 /* Enable DA interrupt */

Definition at line 70 of file dvb_ca_en50221.c.

#define CMDREG_FRIE   0x40 /* Enable FR interrupt */

Definition at line 69 of file dvb_ca_en50221.c.

#define CMDREG_HC   1 /* Host control */

Definition at line 65 of file dvb_ca_en50221.c.

#define CMDREG_RS   8 /* Reset interface */

Definition at line 68 of file dvb_ca_en50221.c.

#define CMDREG_SR   4 /* Size read */

Definition at line 67 of file dvb_ca_en50221.c.

#define CMDREG_SW   2 /* Size write */

Definition at line 66 of file dvb_ca_en50221.c.

#define CTRLIF_COMMAND   1

Definition at line 60 of file dvb_ca_en50221.c.

#define CTRLIF_DATA   0

Definition at line 59 of file dvb_ca_en50221.c.

#define CTRLIF_SIZE_HIGH   3

Definition at line 63 of file dvb_ca_en50221.c.

#define CTRLIF_SIZE_LOW   2

Definition at line 62 of file dvb_ca_en50221.c.

#define CTRLIF_STATUS   1

Definition at line 61 of file dvb_ca_en50221.c.

#define dprintk   if (dvb_ca_en50221_debug) printk

Definition at line 49 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_INVALID   3

Definition at line 83 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_LINKINIT   7

Definition at line 87 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_NONE   0

Definition at line 80 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_RUNNING   2

Definition at line 82 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_UNINITIALISED   1

Definition at line 81 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_VALIDATE   5

Definition at line 85 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_WAITFR   6

Definition at line 86 of file dvb_ca_en50221.c.

#define DVB_CA_SLOTSTATE_WAITREADY   4

Definition at line 84 of file dvb_ca_en50221.c.

#define HOST_LINK_BUF_SIZE   0x200

Definition at line 53 of file dvb_ca_en50221.c.

#define INIT_TIMEOUT_SECS   10

Definition at line 51 of file dvb_ca_en50221.c.

#define IRQEN   (CMDREG_DAIE)

Definition at line 71 of file dvb_ca_en50221.c.

#define MAX_RX_PACKETS_PER_ITERATION   10

Definition at line 57 of file dvb_ca_en50221.c.

#define RX_BUFFER_SIZE   65535

Definition at line 55 of file dvb_ca_en50221.c.

#define STATUSREG_DA   0x80 /* data available */

Definition at line 76 of file dvb_ca_en50221.c.

#define STATUSREG_FR   0x40 /* module free */

Definition at line 75 of file dvb_ca_en50221.c.

#define STATUSREG_RE   1 /* read error */

Definition at line 73 of file dvb_ca_en50221.c.

#define STATUSREG_TXERR   (STATUSREG_RE|STATUSREG_WE) /* general transfer error */

Definition at line 77 of file dvb_ca_en50221.c.

#define STATUSREG_WE   2 /* write error */

Definition at line 74 of file dvb_ca_en50221.c.

Function Documentation

void dvb_ca_en50221_camchange_irq ( struct dvb_ca_en50221 pubca,
int  slot,
int  change_type 
)

A CAMCHANGE IRQ has occurred.

Parameters
caCA instance.
slotSlot concerned.
change_typeOne of the DVB_CA_CAMCHANGE_* values.

Definition at line 821 of file dvb_ca_en50221.c.

void dvb_ca_en50221_camready_irq ( struct dvb_ca_en50221 pubca,
int  slot 
)

A CAMREADY IRQ has occurred.

Parameters
caCA instance.
slotSlot concerned.

Definition at line 849 of file dvb_ca_en50221.c.

void dvb_ca_en50221_frda_irq ( struct dvb_ca_en50221 pubca,
int  slot 
)

An FR or DA IRQ has occurred.

Parameters
caCA instance.
slotSlot concerned.

Definition at line 868 of file dvb_ca_en50221.c.

int dvb_ca_en50221_init ( struct dvb_adapter dvb_adapter,
struct dvb_ca_en50221 pubca,
int  flags,
int  slot_count 
)

Initialise a new DVB CA EN50221 interface device.

Parameters
dvb_adapterDVB adapter to attach the new CA device to.
caThe dvb_ca instance.
flagsFlags describing the CA device (DVB_CA_FLAG_*).
slot_countNumber of slots supported.
Returns
0 on success, nonzero on failure

Definition at line 1654 of file dvb_ca_en50221.c.

void dvb_ca_en50221_release ( struct dvb_ca_en50221 pubca)

Release a DVB CA EN50221 interface device.

Parameters
ca_devThe dvb_device_t instance for the CA device.
caThe associated dvb_ca instance.

Definition at line 1735 of file dvb_ca_en50221.c.

EXPORT_SYMBOL ( dvb_ca_en50221_camchange_irq  )
EXPORT_SYMBOL ( dvb_ca_en50221_camready_irq  )
EXPORT_SYMBOL ( dvb_ca_en50221_frda_irq  )
EXPORT_SYMBOL ( dvb_ca_en50221_init  )
EXPORT_SYMBOL ( dvb_ca_en50221_release  )
module_param_named ( cam_debug  ,
dvb_ca_en50221_debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( cam_debug  ,
"enable verbose debug messages"   
)