Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ctcm_main.h File Reference
#include <asm/ccwdev.h>
#include <asm/ccwgroup.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include "fsm.h"
#include "ctcm_dbug.h"
#include "ctcm_mpc.h"

Go to the source code of this file.

Data Structures

struct  ctcm_profile
 
struct  channel
 
struct  ctcm_priv
 
struct  ll_header
 

Macros

#define CTC_DRIVER_NAME   "ctcm"
 
#define CTC_DEVICE_NAME   "ctc"
 
#define MPC_DEVICE_NAME   "mpc"
 
#define CTC_DEVICE_GENE   CTC_DEVICE_NAME "%d"
 
#define MPC_DEVICE_GENE   MPC_DEVICE_NAME "%d"
 
#define CHANNEL_FLAGS_READ   0
 
#define CHANNEL_FLAGS_WRITE   1
 
#define CHANNEL_FLAGS_INUSE   2
 
#define CHANNEL_FLAGS_BUFSIZE_CHANGED   4
 
#define CHANNEL_FLAGS_FAILED   8
 
#define CHANNEL_FLAGS_WAITIRQ   16
 
#define CHANNEL_FLAGS_RWMASK   1
 
#define CHANNEL_DIRECTION(f)   (f & CHANNEL_FLAGS_RWMASK)
 
#define LOG_FLAG_ILLEGALPKT   1
 
#define LOG_FLAG_ILLEGALSIZE   2
 
#define LOG_FLAG_OVERRUN   4
 
#define LOG_FLAG_NOMEM   8
 
#define ctcm_pr_debug(fmt, arg...)   printk(KERN_DEBUG fmt, ##arg)
 
#define CTCM_PR_DEBUG(fmt, arg...)
 
#define CTCM_PR_DBGDATA(fmt, arg...)
 
#define CTCM_D3_DUMP(buf, len)
 
#define CTCM_CCW_DUMP(buf, len)
 
#define CCW_CMD_WRITE   0x01
 
#define CCW_CMD_READ   0x02
 
#define CCW_CMD_NOOP   0x03
 
#define CCW_CMD_TIC   0x08
 
#define CCW_CMD_SENSE_CMD   0x14
 
#define CCW_CMD_WRITE_CTL   0x17
 
#define CCW_CMD_SET_EXTENDED   0xc3
 
#define CCW_CMD_PREPARE   0xe3
 
#define CTCM_PROTO_S390   0
 
#define CTCM_PROTO_LINUX   1
 
#define CTCM_PROTO_LINUX_TTY   2
 
#define CTCM_PROTO_OS390   3
 
#define CTCM_PROTO_MPC   4
 
#define CTCM_PROTO_MAX   4
 
#define CTCM_BUFSIZE_LIMIT   65535
 
#define CTCM_BUFSIZE_DEFAULT   32768
 
#define MPC_BUFSIZE_DEFAULT   CTCM_BUFSIZE_LIMIT
 
#define CTCM_TIME_1_SEC   1000
 
#define CTCM_TIME_5_SEC   5000
 
#define CTCM_TIME_10_SEC   10000
 
#define CTCM_INITIAL_BLOCKLEN   2
 
#define CTCM_READ   0
 
#define CTCM_WRITE   1
 
#define CTCM_ID_SIZE   20+3
 
#define IS_MPC(p)   ((p)->protocol == CTCM_PROTO_MPC)
 
#define IS_MPCDEV(dev)   IS_MPC((struct ctcm_priv *)dev->ml_priv)
 
#define LL_HEADER_LENGTH   (sizeof(struct ll_header))
 

Enumerations

enum  ctcm_channel_types { ctcm_channel_type_none, ctcm_channel_type_parallel, ctcm_channel_type_ficon, ctcm_channel_type_escon }
 

Functions

int ctcm_open (struct net_device *dev)
 
int ctcm_close (struct net_device *dev)
 
void ctcm_unpack_skb (struct channel *ch, struct sk_buff *pskb)
 
int ctcm_ch_alloc_buffer (struct channel *ch)
 
struct mpc_groupctcmpc_init_mpc_group (struct ctcm_priv *priv)
 

Variables

struct attribute_groupctcm_attr_groups []
 
int loglevel
 
struct channelchannels
 

Macro Definition Documentation

#define CCW_CMD_NOOP   0x03

Definition at line 88 of file ctcm_main.h.

#define CCW_CMD_PREPARE   0xe3

Definition at line 93 of file ctcm_main.h.

#define CCW_CMD_READ   0x02

Definition at line 87 of file ctcm_main.h.

#define CCW_CMD_SENSE_CMD   0x14

Definition at line 90 of file ctcm_main.h.

#define CCW_CMD_SET_EXTENDED   0xc3

Definition at line 92 of file ctcm_main.h.

#define CCW_CMD_TIC   0x08

Definition at line 89 of file ctcm_main.h.

#define CCW_CMD_WRITE   0x01

Definition at line 86 of file ctcm_main.h.

#define CCW_CMD_WRITE_CTL   0x17

Definition at line 91 of file ctcm_main.h.

#define CHANNEL_DIRECTION (   f)    (f & CHANNEL_FLAGS_RWMASK)

Definition at line 33 of file ctcm_main.h.

#define CHANNEL_FLAGS_BUFSIZE_CHANGED   4

Definition at line 29 of file ctcm_main.h.

#define CHANNEL_FLAGS_FAILED   8

Definition at line 30 of file ctcm_main.h.

#define CHANNEL_FLAGS_INUSE   2

Definition at line 28 of file ctcm_main.h.

#define CHANNEL_FLAGS_READ   0

Definition at line 26 of file ctcm_main.h.

#define CHANNEL_FLAGS_RWMASK   1

Definition at line 32 of file ctcm_main.h.

#define CHANNEL_FLAGS_WAITIRQ   16

Definition at line 31 of file ctcm_main.h.

#define CHANNEL_FLAGS_WRITE   1

Definition at line 27 of file ctcm_main.h.

#define CTC_DEVICE_GENE   CTC_DEVICE_NAME "%d"

Definition at line 23 of file ctcm_main.h.

#define CTC_DEVICE_NAME   "ctc"

Definition at line 21 of file ctcm_main.h.

#define CTC_DRIVER_NAME   "ctcm"

Definition at line 20 of file ctcm_main.h.

#define CTCM_BUFSIZE_DEFAULT   32768

Definition at line 103 of file ctcm_main.h.

#define CTCM_BUFSIZE_LIMIT   65535

Definition at line 102 of file ctcm_main.h.

#define CTCM_CCW_DUMP (   buf,
  len 
)
Value:
do { \
if (do_debug_ccw) \
ctcmpc_dumpit(buf, len); \
} while (0)

Definition at line 60 of file ctcm_main.h.

#define CTCM_D3_DUMP (   buf,
  len 
)
Value:
do { \
ctcmpc_dumpit(buf, len); \
} while (0)

Definition at line 54 of file ctcm_main.h.

#define CTCM_ID_SIZE   20+3

Definition at line 115 of file ctcm_main.h.

#define CTCM_INITIAL_BLOCKLEN   2

Definition at line 110 of file ctcm_main.h.

#define CTCM_PR_DBGDATA (   fmt,
  arg... 
)
Value:
do { \
printk(KERN_DEBUG fmt, ##arg); \
} while (0)

Definition at line 48 of file ctcm_main.h.

#define ctcm_pr_debug (   fmt,
  arg... 
)    printk(KERN_DEBUG fmt, ##arg)

Definition at line 40 of file ctcm_main.h.

#define CTCM_PR_DEBUG (   fmt,
  arg... 
)
Value:
do { \
if (do_debug) \
printk(KERN_DEBUG fmt, ##arg); \
} while (0)

Definition at line 42 of file ctcm_main.h.

#define CTCM_PROTO_LINUX   1

Definition at line 96 of file ctcm_main.h.

#define CTCM_PROTO_LINUX_TTY   2

Definition at line 97 of file ctcm_main.h.

#define CTCM_PROTO_MAX   4

Definition at line 100 of file ctcm_main.h.

#define CTCM_PROTO_MPC   4

Definition at line 99 of file ctcm_main.h.

#define CTCM_PROTO_OS390   3

Definition at line 98 of file ctcm_main.h.

#define CTCM_PROTO_S390   0

Definition at line 95 of file ctcm_main.h.

#define CTCM_READ   0

Definition at line 112 of file ctcm_main.h.

#define CTCM_TIME_10_SEC   10000

Definition at line 108 of file ctcm_main.h.

#define CTCM_TIME_1_SEC   1000

Definition at line 106 of file ctcm_main.h.

#define CTCM_TIME_5_SEC   5000

Definition at line 107 of file ctcm_main.h.

#define CTCM_WRITE   1

Definition at line 113 of file ctcm_main.h.

#define IS_MPC (   p)    ((p)->protocol == CTCM_PROTO_MPC)

Definition at line 295 of file ctcm_main.h.

#define IS_MPCDEV (   dev)    IS_MPC((struct ctcm_priv *)dev->ml_priv)

Definition at line 298 of file ctcm_main.h.

#define LL_HEADER_LENGTH   (sizeof(struct ll_header))

Definition at line 313 of file ctcm_main.h.

#define LOG_FLAG_ILLEGALPKT   1

Definition at line 35 of file ctcm_main.h.

#define LOG_FLAG_ILLEGALSIZE   2

Definition at line 36 of file ctcm_main.h.

#define LOG_FLAG_NOMEM   8

Definition at line 38 of file ctcm_main.h.

#define LOG_FLAG_OVERRUN   4

Definition at line 37 of file ctcm_main.h.

#define MPC_BUFSIZE_DEFAULT   CTCM_BUFSIZE_LIMIT

Definition at line 104 of file ctcm_main.h.

#define MPC_DEVICE_GENE   MPC_DEVICE_NAME "%d"

Definition at line 24 of file ctcm_main.h.

#define MPC_DEVICE_NAME   "mpc"

Definition at line 22 of file ctcm_main.h.

Enumeration Type Documentation

Enum for classifying detected devices

Enumerator:
ctcm_channel_type_none 
ctcm_channel_type_parallel 
ctcm_channel_type_ficon 
ctcm_channel_type_escon 

Definition at line 69 of file ctcm_main.h.

Function Documentation

int ctcm_ch_alloc_buffer ( struct channel ch)

Definition at line 381 of file ctcm_main.c.

int ctcm_close ( struct net_device dev)

Close an interface. Called from generic network layer when ifconfig down is run.

dev Pointer to interface struct.

returns 0 on success, -ERRNO on failure. (Never fails.)

Definition at line 442 of file ctcm_main.c.

int ctcm_open ( struct net_device dev)

Open an interface. Called from generic network layer when ifconfig up is run.

dev Pointer to interface struct.

returns 0 on success, -ERRNO on failure. (Never fails.)

Definition at line 424 of file ctcm_main.c.

void ctcm_unpack_skb ( struct channel ch,
struct sk_buff pskb 
)

Unpack a just received skb and hand it over to upper layers.

ch The channel where this skb has been received. pskb The received skb.

Definition at line 74 of file ctcm_main.c.

struct mpc_group* ctcmpc_init_mpc_group ( struct ctcm_priv priv)
read

Definition at line 1280 of file ctcm_mpc.c.

Variable Documentation

struct channel* channels

dma_request_channel - try to allocate an exclusive channel : capabilities that the channel must satisfy

: opaque parameter to pass to dma_filter_fn

Definition at line 65 of file ctcm_main.c.

struct attribute_group* ctcm_attr_groups[]

Definition at line 201 of file ctcm_sysfs.c.

int loglevel