Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
pc300.h File Reference
#include <linux/hdlc.h>
#include "hd64572.h"
#include "pc300-falc-lh.h"

Go to the source code of this file.

Data Structures

struct  RUNTIME_9050
 
struct  falc
 
struct  falc_status
 
struct  rsv_x21_status
 
struct  pc300stats
 
struct  pc300status
 
struct  pc300loopback
 
struct  pc300patterntst
 
struct  pc300dev
 
struct  pc300hw
 
struct  pc300chconf
 
struct  pc300ch
 
struct  pc300
 
struct  pc300conf
 

Macros

#define PC300_PROTO_MLPPP   1
 
#define PC300_MAXCHAN   2 /* Number of channels per card */
 
#define PC300_RAMSIZE   0x40000 /* RAM window size (256Kb) */
 
#define PC300_FALCSIZE   0x400 /* FALC window size (1Kb) */
 
#define PC300_OSC_CLOCK   24576000
 
#define PC300_PCI_CLOCK   33000000
 
#define BD_DEF_LEN   0x0800 /* DMA buffer length (2KB) */
 
#define DMA_TX_MEMSZ   0x8000 /* Total DMA Tx memory size (32KB/ch) */
 
#define DMA_RX_MEMSZ   0x10000 /* Total DMA Rx memory size (64KB/ch) */
 
#define N_DMA_TX_BUF   (DMA_TX_MEMSZ / BD_DEF_LEN) /* DMA Tx buffers */
 
#define N_DMA_RX_BUF   (DMA_RX_MEMSZ / BD_DEF_LEN) /* DMA Rx buffers */
 
#define DMA_TX_BASE
 
#define DMA_RX_BASE   (DMA_TX_BASE + PC300_MAXCHAN*DMA_TX_MEMSZ)
 
#define DMA_TX_BD_BASE   0x0000
 
#define DMA_RX_BD_BASE
 
#define TX_BD_ADDR(chan, n)
 
#define RX_BD_ADDR(chan, n)
 
#define F_REG(reg, chan)   (0x200*(chan) + ((reg)<<2))
 
#define cpc_writeb(port, val)   {writeb((u8)(val),(port)); mb();}
 
#define cpc_writew(port, val)   {writew((ushort)(val),(port)); mb();}
 
#define cpc_writel(port, val)   {writel((u32)(val),(port)); mb();}
 
#define cpc_readb(port)   readb(port)
 
#define cpc_readw(port)   readw(port)
 
#define cpc_readl(port)   readl(port)
 
#define PLX_9050_LINT1_ENABLE   0x01
 
#define PLX_9050_LINT1_POL   0x02
 
#define PLX_9050_LINT1_STATUS   0x04
 
#define PLX_9050_LINT2_ENABLE   0x08
 
#define PLX_9050_LINT2_POL   0x10
 
#define PLX_9050_LINT2_STATUS   0x20
 
#define PLX_9050_INTR_ENABLE   0x40
 
#define PLX_9050_SW_INTR   0x80
 
#define PC300_CLKSEL_MASK   (0x00000004UL)
 
#define PC300_CHMEDIA_MASK(chan)   (0x00000020UL<<(chan*3))
 
#define PC300_CTYPE_MASK   (0x00000800UL)
 
#define CPLD_REG1   0x140 /* Chip resets, DCD/CTS status */
 
#define CPLD_REG2   0x144 /* Clock enable , LED control */
 
#define CPLD_V2_REG1   0x100 /* Chip resets, DCD/CTS status */
 
#define CPLD_V2_REG2   0x104 /* Clock enable , LED control */
 
#define CPLD_ID_REG   0x108 /* CPLD version */
 
#define CPLD_REG1_FALC_RESET   0x01
 
#define CPLD_REG1_SCA_RESET   0x02
 
#define CPLD_REG1_GLOBAL_CLK   0x08
 
#define CPLD_REG1_FALC_DCD   0x10
 
#define CPLD_REG1_FALC_CTS   0x20
 
#define CPLD_REG2_FALC_TX_CLK   0x01
 
#define CPLD_REG2_FALC_RX_CLK   0x02
 
#define CPLD_REG2_FALC_LED1   0x10
 
#define CPLD_REG2_FALC_LED2   0x20
 
#define PC300_FALC_MAXLOOP   0x0000ffff /* for falc_issue_cmd() */
 
#define N_SPPP_IOCTLS   2
 
#define PC300_RSV   0x01
 
#define PC300_X21   0x02
 
#define PC300_TE   0x03
 
#define PC300_PCI   0x00
 
#define PC300_PMC   0x01
 
#define PC300_LC_AMI   0x01
 
#define PC300_LC_B8ZS   0x02
 
#define PC300_LC_NRZ   0x03
 
#define PC300_LC_HDB3   0x04
 
#define PC300_FR_ESF   0x01
 
#define PC300_FR_D4   0x02
 
#define PC300_FR_ESF_JAPAN   0x03
 
#define PC300_FR_MF_CRC4   0x04
 
#define PC300_FR_MF_NON_CRC4   0x05
 
#define PC300_FR_UNFRAMED   0x06
 
#define PC300_LBO_0_DB   0x00
 
#define PC300_LBO_7_5_DB   0x01
 
#define PC300_LBO_15_DB   0x02
 
#define PC300_LBO_22_5_DB   0x03
 
#define PC300_RX_SENS_SH   0x01
 
#define PC300_RX_SENS_LH   0x02
 
#define PC300_TX_TIMEOUT   (2*HZ)
 
#define PC300_TX_QUEUE_LEN   100
 
#define PC300_DEF_MTU   1600
 

Typedefs

typedef struct falc falc_t
 
typedef struct falc_status falc_status_t
 
typedef struct rsv_x21_status rsv_x21_status_t
 
typedef struct pc300stats pc300stats_t
 
typedef struct pc300status pc300status_t
 
typedef struct pc300loopback pc300loopback_t
 
typedef struct pc300patterntst pc300patterntst_t
 
typedef struct pc300dev pc300dev_t
 
typedef struct pc300hw pc300hw_t
 
typedef struct pc300chconf pc300chconf_t
 
typedef struct pc300ch pc300ch_t
 
typedef struct pc300 pc300_t
 
typedef struct pc300conf pc300conf_t
 

Enumerations

enum  pc300_ioctl_cmds {
  SIOCCPCRESERVED = (SIOCDEVPRIVATE + N_SPPP_IOCTLS), SIOCGPC300CONF, SIOCSPC300CONF, SIOCGPC300STATUS,
  SIOCGPC300FALCSTATUS, SIOCGPC300UTILSTATS, SIOCGPC300UTILSTATUS, SIOCSPC300TRACE,
  SIOCSPC300LOOPBACK, SIOCSPC300PATTERNTEST
}
 
enum  pc300_loopback_cmds {
  PC300LOCLOOP = 1, PC300REMLOOP, PC300PAYLOADLOOP, PC300GENLOOPUP,
  PC300GENLOOPDOWN
}
 

Functions

int cpc_open (struct net_device *dev)
 

Macro Definition Documentation

#define BD_DEF_LEN   0x0800 /* DMA buffer length (2KB) */

Definition at line 116 of file pc300.h.

#define cpc_readb (   port)    readb(port)

Definition at line 150 of file pc300.h.

#define cpc_readl (   port)    readl(port)

Definition at line 152 of file pc300.h.

#define cpc_readw (   port)    readw(port)

Definition at line 151 of file pc300.h.

#define cpc_writeb (   port,
  val 
)    {writeb((u8)(val),(port)); mb();}

Definition at line 146 of file pc300.h.

#define cpc_writel (   port,
  val 
)    {writel((u32)(val),(port)); mb();}

Definition at line 148 of file pc300.h.

#define cpc_writew (   port,
  val 
)    {writew((ushort)(val),(port)); mb();}

Definition at line 147 of file pc300.h.

#define CPLD_ID_REG   0x108 /* CPLD version */

Definition at line 194 of file pc300.h.

#define CPLD_REG1   0x140 /* Chip resets, DCD/CTS status */

Definition at line 189 of file pc300.h.

#define CPLD_REG1_FALC_CTS   0x20

Definition at line 203 of file pc300.h.

#define CPLD_REG1_FALC_DCD   0x10

Definition at line 202 of file pc300.h.

#define CPLD_REG1_FALC_RESET   0x01

Definition at line 199 of file pc300.h.

#define CPLD_REG1_GLOBAL_CLK   0x08

Definition at line 201 of file pc300.h.

#define CPLD_REG1_SCA_RESET   0x02

Definition at line 200 of file pc300.h.

#define CPLD_REG2   0x144 /* Clock enable , LED control */

Definition at line 190 of file pc300.h.

#define CPLD_REG2_FALC_LED1   0x10

Definition at line 207 of file pc300.h.

#define CPLD_REG2_FALC_LED2   0x20

Definition at line 208 of file pc300.h.

#define CPLD_REG2_FALC_RX_CLK   0x02

Definition at line 206 of file pc300.h.

#define CPLD_REG2_FALC_TX_CLK   0x01

Definition at line 205 of file pc300.h.

#define CPLD_V2_REG1   0x100 /* Chip resets, DCD/CTS status */

Definition at line 192 of file pc300.h.

#define CPLD_V2_REG2   0x104 /* Clock enable , LED control */

Definition at line 193 of file pc300.h.

#define DMA_RX_BASE   (DMA_TX_BASE + PC300_MAXCHAN*DMA_TX_MEMSZ)

Definition at line 126 of file pc300.h.

#define DMA_RX_BD_BASE
Value:
BD_DEF_LEN) * sizeof(pcsca_bd_t)))

Definition at line 130 of file pc300.h.

#define DMA_RX_MEMSZ   0x10000 /* Total DMA Rx memory size (64KB/ch) */

Definition at line 118 of file pc300.h.

#define DMA_TX_BASE
Value:

Definition at line 124 of file pc300.h.

#define DMA_TX_BD_BASE   0x0000

Definition at line 129 of file pc300.h.

#define DMA_TX_MEMSZ   0x8000 /* Total DMA Tx memory size (32KB/ch) */

Definition at line 117 of file pc300.h.

#define F_REG (   reg,
  chan 
)    (0x200*(chan) + ((reg)<<2))

Definition at line 140 of file pc300.h.

#define N_DMA_RX_BUF   (DMA_RX_MEMSZ / BD_DEF_LEN) /* DMA Rx buffers */

Definition at line 121 of file pc300.h.

#define N_DMA_TX_BUF   (DMA_TX_MEMSZ / BD_DEF_LEN) /* DMA Tx buffers */

Definition at line 120 of file pc300.h.

#define N_SPPP_IOCTLS   2

Definition at line 374 of file pc300.h.

#define PC300_CHMEDIA_MASK (   chan)    (0x00000020UL<<(chan*3))

Definition at line 184 of file pc300.h.

#define PC300_CLKSEL_MASK   (0x00000004UL)

Definition at line 183 of file pc300.h.

#define PC300_CTYPE_MASK   (0x00000800UL)

Definition at line 185 of file pc300.h.

#define PC300_DEF_MTU   1600

Definition at line 431 of file pc300.h.

#define PC300_FALC_MAXLOOP   0x0000ffff /* for falc_issue_cmd() */

Definition at line 211 of file pc300.h.

#define PC300_FALCSIZE   0x400 /* FALC window size (1Kb) */

Definition at line 111 of file pc300.h.

#define PC300_FR_D4   0x02

Definition at line 413 of file pc300.h.

#define PC300_FR_ESF   0x01

Definition at line 412 of file pc300.h.

#define PC300_FR_ESF_JAPAN   0x03

Definition at line 414 of file pc300.h.

#define PC300_FR_MF_CRC4   0x04

Definition at line 417 of file pc300.h.

#define PC300_FR_MF_NON_CRC4   0x05

Definition at line 418 of file pc300.h.

#define PC300_FR_UNFRAMED   0x06

Definition at line 419 of file pc300.h.

#define PC300_LBO_0_DB   0x00

Definition at line 421 of file pc300.h.

#define PC300_LBO_15_DB   0x02

Definition at line 423 of file pc300.h.

#define PC300_LBO_22_5_DB   0x03

Definition at line 424 of file pc300.h.

#define PC300_LBO_7_5_DB   0x01

Definition at line 422 of file pc300.h.

#define PC300_LC_AMI   0x01

Definition at line 406 of file pc300.h.

#define PC300_LC_B8ZS   0x02

Definition at line 407 of file pc300.h.

#define PC300_LC_HDB3   0x04

Definition at line 409 of file pc300.h.

#define PC300_LC_NRZ   0x03

Definition at line 408 of file pc300.h.

#define PC300_MAXCHAN   2 /* Number of channels per card */

Definition at line 108 of file pc300.h.

#define PC300_OSC_CLOCK   24576000

Definition at line 113 of file pc300.h.

#define PC300_PCI   0x00

Definition at line 403 of file pc300.h.

#define PC300_PCI_CLOCK   33000000

Definition at line 114 of file pc300.h.

#define PC300_PMC   0x01

Definition at line 404 of file pc300.h.

#define PC300_PROTO_MLPPP   1

Definition at line 106 of file pc300.h.

#define PC300_RAMSIZE   0x40000 /* RAM window size (256Kb) */

Definition at line 110 of file pc300.h.

#define PC300_RSV   0x01

Definition at line 399 of file pc300.h.

#define PC300_RX_SENS_LH   0x02

Definition at line 427 of file pc300.h.

#define PC300_RX_SENS_SH   0x01

Definition at line 426 of file pc300.h.

#define PC300_TE   0x03

Definition at line 401 of file pc300.h.

#define PC300_TX_QUEUE_LEN   100

Definition at line 430 of file pc300.h.

#define PC300_TX_TIMEOUT   (2*HZ)

Definition at line 429 of file pc300.h.

#define PC300_X21   0x02

Definition at line 400 of file pc300.h.

#define PLX_9050_INTR_ENABLE   0x40

Definition at line 179 of file pc300.h.

#define PLX_9050_LINT1_ENABLE   0x01

Definition at line 173 of file pc300.h.

#define PLX_9050_LINT1_POL   0x02

Definition at line 174 of file pc300.h.

#define PLX_9050_LINT1_STATUS   0x04

Definition at line 175 of file pc300.h.

#define PLX_9050_LINT2_ENABLE   0x08

Definition at line 176 of file pc300.h.

#define PLX_9050_LINT2_POL   0x10

Definition at line 177 of file pc300.h.

#define PLX_9050_LINT2_STATUS   0x20

Definition at line 178 of file pc300.h.

#define PLX_9050_SW_INTR   0x80

Definition at line 180 of file pc300.h.

#define RX_BD_ADDR (   chan,
  n 
)
Value:

Definition at line 136 of file pc300.h.

#define TX_BD_ADDR (   chan,
  n 
)
Value:

Definition at line 134 of file pc300.h.

Typedef Documentation

typedef struct falc falc_t
typedef struct pc300 pc300_t

Enumeration Type Documentation

Enumerator:
SIOCCPCRESERVED 
SIOCGPC300CONF 
SIOCSPC300CONF 
SIOCGPC300STATUS 
SIOCGPC300FALCSTATUS 
SIOCGPC300UTILSTATS 
SIOCGPC300UTILSTATUS 
SIOCSPC300TRACE 
SIOCSPC300LOOPBACK 
SIOCSPC300PATTERNTEST 

Definition at line 376 of file pc300.h.

Enumerator:
PC300LOCLOOP 
PC300REMLOOP 
PC300PAYLOADLOOP 
PC300GENLOOPUP 
PC300GENLOOPDOWN 

Definition at line 390 of file pc300.h.

Function Documentation

int cpc_open ( struct net_device dev)

Definition at line 3139 of file pc300_drv.c.