Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mal.h File Reference

Go to the source code of this file.

Data Structures

struct  mal_descriptor
 
struct  mal_commac_ops
 
struct  mal_commac
 
struct  mal_instance
 
struct  mal_regs
 

Macros

#define MAL_CFG   0x00
 
#define MAL_CFG_SR   0x80000000
 
#define MAL_CFG_PLBB   0x00004000
 
#define MAL_CFG_OPBBL   0x00000080
 
#define MAL_CFG_EOPIE   0x00000004
 
#define MAL_CFG_LEA   0x00000002
 
#define MAL_CFG_SD   0x00000001
 
#define MAL1_CFG_PLBP_MASK   0x00c00000
 
#define MAL1_CFG_PLBP_10   0x00800000
 
#define MAL1_CFG_GA   0x00200000
 
#define MAL1_CFG_OA   0x00100000
 
#define MAL1_CFG_PLBLE   0x00080000
 
#define MAL1_CFG_PLBT_MASK   0x00078000
 
#define MAL1_CFG_DEFAULT   (MAL1_CFG_PLBP_10 | MAL1_CFG_PLBT_MASK)
 
#define MAL2_CFG_RPP_MASK   0x00c00000
 
#define MAL2_CFG_RPP_10   0x00800000
 
#define MAL2_CFG_RMBS_MASK   0x00300000
 
#define MAL2_CFG_WPP_MASK   0x000c0000
 
#define MAL2_CFG_WPP_10   0x00080000
 
#define MAL2_CFG_WMBS_MASK   0x00030000
 
#define MAL2_CFG_PLBLE   0x00008000
 
#define MAL2_CFG_DEFAULT
 
#define MAL_ESR   0x01
 
#define MAL_ESR_EVB   0x80000000
 
#define MAL_ESR_CIDT   0x40000000
 
#define MAL_ESR_CID_MASK   0x3e000000
 
#define MAL_ESR_CID_SHIFT   25
 
#define MAL_ESR_DE   0x00100000
 
#define MAL_ESR_OTE   0x00040000
 
#define MAL_ESR_OSE   0x00020000
 
#define MAL_ESR_PEIN   0x00010000
 
#define MAL_ESR_DEI   0x00000010
 
#define MAL_ESR_OTEI   0x00000004
 
#define MAL_ESR_OSEI   0x00000002
 
#define MAL_ESR_PBEI   0x00000001
 
#define MAL1_ESR_ONE   0x00080000
 
#define MAL1_ESR_ONEI   0x00000008
 
#define MAL2_ESR_PTE   0x00800000
 
#define MAL2_ESR_PRE   0x00400000
 
#define MAL2_ESR_PWE   0x00200000
 
#define MAL2_ESR_PTEI   0x00000080
 
#define MAL2_ESR_PREI   0x00000040
 
#define MAL2_ESR_PWEI   0x00000020
 
#define MAL_IER   0x02
 
#define MAL_IER_DE   0x00000010
 
#define MAL_IER_OTE   0x00000004
 
#define MAL_IER_OE   0x00000002
 
#define MAL_IER_PE   0x00000001
 
#define MAL1_IER_NWE   0x00000008
 
#define MAL1_IER_SOC_EVENTS   MAL1_IER_NWE
 
#define MAL1_IER_EVENTS
 
#define MAL2_IER_PT   0x00000080
 
#define MAL2_IER_PRE   0x00000040
 
#define MAL2_IER_PWE   0x00000020
 
#define MAL2_IER_SOC_EVENTS   (MAL2_IER_PT | MAL2_IER_PRE | MAL2_IER_PWE)
 
#define MAL2_IER_EVENTS
 
#define MAL_TXCASR   0x04
 
#define MAL_TXCARR   0x05
 
#define MAL_TXEOBISR   0x06
 
#define MAL_TXDEIR   0x07
 
#define MAL_RXCASR   0x10
 
#define MAL_RXCARR   0x11
 
#define MAL_RXEOBISR   0x12
 
#define MAL_RXDEIR   0x13
 
#define MAL_TXCTPR(n)   ((n) + 0x20)
 
#define MAL_RXCTPR(n)   ((n) + 0x40)
 
#define MAL_RCBS(n)   ((n) + 0x60)
 
#define MAL_MAX_TX_SIZE   4080
 
#define MAL_MAX_RX_SIZE   4080
 
#define MAL_CHAN_MASK(n)   (0x80000000 >> (n))
 
#define MAL_RX_CTRL_EMPTY   0x8000
 
#define MAL_RX_CTRL_WRAP   0x4000
 
#define MAL_RX_CTRL_CM   0x2000
 
#define MAL_RX_CTRL_LAST   0x1000
 
#define MAL_RX_CTRL_FIRST   0x0800
 
#define MAL_RX_CTRL_INTR   0x0400
 
#define MAL_RX_CTRL_SINGLE   (MAL_RX_CTRL_LAST | MAL_RX_CTRL_FIRST)
 
#define MAL_IS_SINGLE_RX(ctrl)   (((ctrl) & MAL_RX_CTRL_SINGLE) == MAL_RX_CTRL_SINGLE)
 
#define MAL_TX_CTRL_READY   0x8000
 
#define MAL_TX_CTRL_WRAP   0x4000
 
#define MAL_TX_CTRL_CM   0x2000
 
#define MAL_TX_CTRL_LAST   0x1000
 
#define MAL_TX_CTRL_INTR   0x0400
 
#define MAL_COMMAC_RX_STOPPED   0
 
#define MAL_COMMAC_POLL_DISABLED   1
 
#define MAL_FTR_CLEAR_ICINTSTAT   0x00000001
 
#define MAL_FTR_COMMON_ERR_INT   0x00000002
 

Enumerations

enum  { MAL_FTRS_ALWAYS = 0, MAL_FTRS_POSSIBLE }
 

Functions

int mal_init (void)
 
void mal_exit (void)
 
int mal_register_commac (struct mal_instance *mal, struct mal_commac *commac)
 
void mal_unregister_commac (struct mal_instance *mal, struct mal_commac *commac)
 
int mal_set_rcbs (struct mal_instance *mal, int channel, unsigned long size)
 
int mal_tx_bd_offset (struct mal_instance *mal, int channel)
 
int mal_rx_bd_offset (struct mal_instance *mal, int channel)
 
void mal_enable_tx_channel (struct mal_instance *mal, int channel)
 
void mal_disable_tx_channel (struct mal_instance *mal, int channel)
 
void mal_enable_rx_channel (struct mal_instance *mal, int channel)
 
void mal_disable_rx_channel (struct mal_instance *mal, int channel)
 
void mal_poll_disable (struct mal_instance *mal, struct mal_commac *commac)
 
void mal_poll_enable (struct mal_instance *mal, struct mal_commac *commac)
 
void mal_poll_add (struct mal_instance *mal, struct mal_commac *commac)
 
void mal_poll_del (struct mal_instance *mal, struct mal_commac *commac)
 
int mal_get_regs_len (struct mal_instance *mal)
 
voidmal_dump_regs (struct mal_instance *mal, void *buf)
 

Macro Definition Documentation

#define MAL1_CFG_DEFAULT   (MAL1_CFG_PLBP_10 | MAL1_CFG_PLBT_MASK)

Definition at line 57 of file mal.h.

#define MAL1_CFG_GA   0x00200000

Definition at line 53 of file mal.h.

#define MAL1_CFG_OA   0x00100000

Definition at line 54 of file mal.h.

#define MAL1_CFG_PLBLE   0x00080000

Definition at line 55 of file mal.h.

#define MAL1_CFG_PLBP_10   0x00800000

Definition at line 52 of file mal.h.

#define MAL1_CFG_PLBP_MASK   0x00c00000

Definition at line 51 of file mal.h.

#define MAL1_CFG_PLBT_MASK   0x00078000

Definition at line 56 of file mal.h.

#define MAL1_ESR_ONE   0x00080000

Definition at line 85 of file mal.h.

#define MAL1_ESR_ONEI   0x00000008

Definition at line 86 of file mal.h.

#define MAL1_IER_EVENTS
Value:

Definition at line 105 of file mal.h.

#define MAL1_IER_NWE   0x00000008

Definition at line 103 of file mal.h.

#define MAL1_IER_SOC_EVENTS   MAL1_IER_NWE

Definition at line 104 of file mal.h.

#define MAL2_CFG_DEFAULT
Value:

Definition at line 67 of file mal.h.

#define MAL2_CFG_PLBLE   0x00008000

Definition at line 66 of file mal.h.

#define MAL2_CFG_RMBS_MASK   0x00300000

Definition at line 62 of file mal.h.

#define MAL2_CFG_RPP_10   0x00800000

Definition at line 61 of file mal.h.

#define MAL2_CFG_RPP_MASK   0x00c00000

Definition at line 60 of file mal.h.

#define MAL2_CFG_WMBS_MASK   0x00030000

Definition at line 65 of file mal.h.

#define MAL2_CFG_WPP_10   0x00080000

Definition at line 64 of file mal.h.

#define MAL2_CFG_WPP_MASK   0x000c0000

Definition at line 63 of file mal.h.

#define MAL2_ESR_PRE   0x00400000

Definition at line 90 of file mal.h.

#define MAL2_ESR_PREI   0x00000040

Definition at line 93 of file mal.h.

#define MAL2_ESR_PTE   0x00800000

Definition at line 89 of file mal.h.

#define MAL2_ESR_PTEI   0x00000080

Definition at line 92 of file mal.h.

#define MAL2_ESR_PWE   0x00200000

Definition at line 91 of file mal.h.

#define MAL2_ESR_PWEI   0x00000020

Definition at line 94 of file mal.h.

#define MAL2_IER_EVENTS
Value:

Definition at line 113 of file mal.h.

#define MAL2_IER_PRE   0x00000040

Definition at line 110 of file mal.h.

#define MAL2_IER_PT   0x00000080

Definition at line 109 of file mal.h.

#define MAL2_IER_PWE   0x00000020

Definition at line 111 of file mal.h.

#define MAL2_IER_SOC_EVENTS   (MAL2_IER_PT | MAL2_IER_PRE | MAL2_IER_PWE)

Definition at line 112 of file mal.h.

#define MAL_CFG   0x00

Definition at line 42 of file mal.h.

#define MAL_CFG_EOPIE   0x00000004

Definition at line 46 of file mal.h.

#define MAL_CFG_LEA   0x00000002

Definition at line 47 of file mal.h.

#define MAL_CFG_OPBBL   0x00000080

Definition at line 45 of file mal.h.

#define MAL_CFG_PLBB   0x00004000

Definition at line 44 of file mal.h.

#define MAL_CFG_SD   0x00000001

Definition at line 48 of file mal.h.

#define MAL_CFG_SR   0x80000000

Definition at line 43 of file mal.h.

#define MAL_CHAN_MASK (   n)    (0x80000000 >> (n))

Definition at line 146 of file mal.h.

#define MAL_COMMAC_POLL_DISABLED   1

Definition at line 185 of file mal.h.

#define MAL_COMMAC_RX_STOPPED   0

Definition at line 184 of file mal.h.

#define MAL_ESR   0x01

Definition at line 70 of file mal.h.

#define MAL_ESR_CID_MASK   0x3e000000

Definition at line 73 of file mal.h.

#define MAL_ESR_CID_SHIFT   25

Definition at line 74 of file mal.h.

#define MAL_ESR_CIDT   0x40000000

Definition at line 72 of file mal.h.

#define MAL_ESR_DE   0x00100000

Definition at line 75 of file mal.h.

#define MAL_ESR_DEI   0x00000010

Definition at line 79 of file mal.h.

#define MAL_ESR_EVB   0x80000000

Definition at line 71 of file mal.h.

#define MAL_ESR_OSE   0x00020000

Definition at line 77 of file mal.h.

#define MAL_ESR_OSEI   0x00000002

Definition at line 81 of file mal.h.

#define MAL_ESR_OTE   0x00040000

Definition at line 76 of file mal.h.

#define MAL_ESR_OTEI   0x00000004

Definition at line 80 of file mal.h.

#define MAL_ESR_PBEI   0x00000001

Definition at line 82 of file mal.h.

#define MAL_ESR_PEIN   0x00010000

Definition at line 78 of file mal.h.

#define MAL_FTR_CLEAR_ICINTSTAT   0x00000001

Definition at line 237 of file mal.h.

#define MAL_FTR_COMMON_ERR_INT   0x00000002

Definition at line 242 of file mal.h.

#define MAL_IER   0x02

Definition at line 97 of file mal.h.

#define MAL_IER_DE   0x00000010

Definition at line 98 of file mal.h.

#define MAL_IER_OE   0x00000002

Definition at line 100 of file mal.h.

#define MAL_IER_OTE   0x00000004

Definition at line 99 of file mal.h.

#define MAL_IER_PE   0x00000001

Definition at line 101 of file mal.h.

#define MAL_IS_SINGLE_RX (   ctrl)    (((ctrl) & MAL_RX_CTRL_SINGLE) == MAL_RX_CTRL_SINGLE)

Definition at line 164 of file mal.h.

#define MAL_MAX_RX_SIZE   4080

Definition at line 133 of file mal.h.

#define MAL_MAX_TX_SIZE   4080

Definition at line 132 of file mal.h.

#define MAL_RCBS (   n)    ((n) + 0x60)

Definition at line 127 of file mal.h.

#define MAL_RX_CTRL_CM   0x2000

Definition at line 159 of file mal.h.

#define MAL_RX_CTRL_EMPTY   0x8000

Definition at line 157 of file mal.h.

#define MAL_RX_CTRL_FIRST   0x0800

Definition at line 161 of file mal.h.

#define MAL_RX_CTRL_INTR   0x0400

Definition at line 162 of file mal.h.

#define MAL_RX_CTRL_LAST   0x1000

Definition at line 160 of file mal.h.

#define MAL_RX_CTRL_SINGLE   (MAL_RX_CTRL_LAST | MAL_RX_CTRL_FIRST)

Definition at line 163 of file mal.h.

#define MAL_RX_CTRL_WRAP   0x4000

Definition at line 158 of file mal.h.

#define MAL_RXCARR   0x11

Definition at line 122 of file mal.h.

#define MAL_RXCASR   0x10

Definition at line 121 of file mal.h.

#define MAL_RXCTPR (   n)    ((n) + 0x40)

Definition at line 126 of file mal.h.

#define MAL_RXDEIR   0x13

Definition at line 124 of file mal.h.

#define MAL_RXEOBISR   0x12

Definition at line 123 of file mal.h.

#define MAL_TX_CTRL_CM   0x2000

Definition at line 168 of file mal.h.

#define MAL_TX_CTRL_INTR   0x0400

Definition at line 170 of file mal.h.

#define MAL_TX_CTRL_LAST   0x1000

Definition at line 169 of file mal.h.

#define MAL_TX_CTRL_READY   0x8000

Definition at line 166 of file mal.h.

#define MAL_TX_CTRL_WRAP   0x4000

Definition at line 167 of file mal.h.

#define MAL_TXCARR   0x05

Definition at line 118 of file mal.h.

#define MAL_TXCASR   0x04

Definition at line 117 of file mal.h.

#define MAL_TXCTPR (   n)    ((n) + 0x20)

Definition at line 125 of file mal.h.

#define MAL_TXDEIR   0x07

Definition at line 120 of file mal.h.

#define MAL_TXEOBISR   0x06

Definition at line 119 of file mal.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAL_FTRS_ALWAYS 
MAL_FTRS_POSSIBLE 

Definition at line 244 of file mal.h.

Function Documentation

void mal_disable_rx_channel ( struct mal_instance mal,
int  channel 
)

Definition at line 159 of file mal.c.

void mal_disable_tx_channel ( struct mal_instance mal,
int  channel 
)

Definition at line 130 of file mal.c.

void* mal_dump_regs ( struct mal_instance mal,
void buf 
)

Definition at line 486 of file mal.c.

void mal_enable_rx_channel ( struct mal_instance mal,
int  channel 
)

Definition at line 137 of file mal.c.

void mal_enable_tx_channel ( struct mal_instance mal,
int  channel 
)

Definition at line 116 of file mal.c.

void mal_exit ( void  )

Definition at line 806 of file mal.c.

int mal_get_regs_len ( struct mal_instance mal)

Definition at line 480 of file mal.c.

int mal_init ( void  )

Definition at line 801 of file mal.c.

void mal_poll_add ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 174 of file mal.c.

void mal_poll_del ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 190 of file mal.c.

void mal_poll_disable ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 372 of file mal.c.

void mal_poll_enable ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 382 of file mal.c.

int mal_register_commac ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 36 of file mal.c.

int mal_rx_bd_offset ( struct mal_instance mal,
int  channel 
)

Definition at line 110 of file mal.c.

int mal_set_rcbs ( struct mal_instance mal,
int  channel,
unsigned long  size 
)

Definition at line 85 of file mal.c.

int mal_tx_bd_offset ( struct mal_instance mal,
int  channel 
)

Definition at line 103 of file mal.c.

void mal_unregister_commac ( struct mal_instance mal,
struct mal_commac commac 
)

Definition at line 66 of file mal.c.