Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
lcs.h File Reference
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <asm/ccwdev.h>

Go to the source code of this file.

Data Structures

struct  lcs_header
 
struct  lcs_ip_mac_pair
 
struct  lcs_ipm_list
 
struct  lcs_cmd
 
struct  lcs_buffer
 
struct  lcs_reply
 
struct  lcs_channel
 
struct  lcs_card
 

Macros

#define LCS_DBF_TEXT(level, name, text)
 
#define LCS_DBF_HEX(level, name, addr, len)
 
#define LCS_DBF_TEXT_(level, name, text...)
 
#define CARD_FROM_DEV(cdev)
 
#define LCS_CCW_WRITE   0x01
 
#define LCS_CCW_READ   0x02
 
#define LCS_CCW_TRANSFER   0x08
 
#define LCS_CMD_STARTLAN   0x01
 
#define LCS_CMD_STOPLAN   0x02
 
#define LCS_CMD_LANSTAT   0x04
 
#define LCS_CMD_STARTUP   0x07
 
#define LCS_CMD_SHUTDOWN   0x08
 
#define LCS_CMD_QIPASSIST   0xb2
 
#define LCS_CMD_SETIPM   0xb4
 
#define LCS_CMD_DELIPM   0xb5
 
#define LCS_INITIATOR_TCPIP   0x00
 
#define LCS_INITIATOR_LGW   0x01
 
#define LCS_STD_CMD_SIZE   16
 
#define LCS_MULTICAST_CMD_SIZE   404
 
#define LCS_IPASS_ARP_PROCESSING   0x0001
 
#define LCS_IPASS_IN_CHECKSUM_SUPPORT   0x0002
 
#define LCS_IPASS_OUT_CHECKSUM_SUPPORT   0x0004
 
#define LCS_IPASS_IP_FRAG_REASSEMBLY   0x0008
 
#define LCS_IPASS_IP_FILTERING   0x0010
 
#define LCS_IPASS_IPV6_SUPPORT   0x0020
 
#define LCS_IPASS_MULTICAST_SUPPORT   0x0040
 
#define LCS_SENSE_BYTE_0   0
 
#define LCS_SENSE_BYTE_1   1
 
#define LCS_SENSE_BYTE_2   2
 
#define LCS_SENSE_BYTE_3   3
 
#define LCS_SENSE_INTERFACE_DISCONNECT   0x01
 
#define LCS_SENSE_EQUIPMENT_CHECK   0x10
 
#define LCS_SENSE_BUS_OUT_CHECK   0x20
 
#define LCS_SENSE_INTERVENTION_REQUIRED   0x40
 
#define LCS_SENSE_CMD_REJECT   0x80
 
#define LCS_SENSE_RESETTING_EVENT   0x80
 
#define LCS_SENSE_DEVICE_ONLINE   0x20
 
#define LCS_FRAME_TYPE_CONTROL   0
 
#define LCS_FRAME_TYPE_ENET   1
 
#define LCS_FRAME_TYPE_TR   2
 
#define LCS_FRAME_TYPE_FDDI   7
 
#define LCS_FRAME_TYPE_AUTO   -1
 
#define LCS_ILLEGAL_OFFSET   0xffff
 
#define LCS_IOBUFFERSIZE   0x5000
 
#define LCS_NUM_BUFFS   32 /* needs to be power of 2 */
 
#define LCS_MAC_LENGTH   6
 
#define LCS_INVALID_PORT_NO   -1
 
#define LCS_LANCMD_TIMEOUT_DEFAULT   5
 
#define LCS_IPM_STATE_SET_REQUIRED   0
 
#define LCS_IPM_STATE_DEL_REQUIRED   1
 
#define LCS_IPM_STATE_ON_CARD   2
 
#define LCS_IPASS_ARP_PROCESSING   0x0001
 
#define LCS_IPASS_INBOUND_CSUM_SUPP   0x0002
 
#define LCS_IPASS_OUTBOUND_CSUM_SUPP   0x0004
 
#define LCS_IPASS_IP_FRAG_REASSEMBLY   0x0008
 
#define LCS_IPASS_IP_FILTERING   0x0010
 
#define LCS_IPASS_IPV6_SUPPORT   0x0020
 
#define LCS_IPASS_MULTICAST_SUPPORT   0x0040
 

Enumerations

enum  lcs_channel_types { lcs_channel_type_none, lcs_channel_type_parallel, lcs_channel_type_2216, lcs_channel_type_osa2 }
 
enum  lcs_buffer_states { LCS_BUF_STATE_EMPTY, LCS_BUF_STATE_LOCKED, LCS_BUF_STATE_READY, LCS_BUF_STATE_PROCESSED }
 
enum  lcs_channel_states {
  LCS_CH_STATE_INIT, LCS_CH_STATE_HALTED, LCS_CH_STATE_STOPPED, LCS_CH_STATE_RUNNING,
  LCS_CH_STATE_SUSPENDED, LCS_CH_STATE_CLEARED, LCS_CH_STATE_ERROR
}
 
enum  lcs_dev_states { DEV_STATE_DOWN, DEV_STATE_UP, DEV_STATE_RECOVER }
 
enum  lcs_threads { LCS_SET_MC_THREAD = 1, LCS_RECOVERY_THREAD = 2 }
 

Functions

struct lcs_header __attribute__ ((packed))
 
struct lcs_card __attribute__ ((aligned(8)))
 Packet vector entry.
 

Variables

__u16 offset
 
__u8 type
 
__u8 slot
 
__be32 ip_addr
 
__u8 mac_addr [LCS_MAC_LENGTH]
 
__u8 reserved [2]
 
struct lcs_ipm_list __attribute__
 
struct {
   __u8   lan_type
 
   __u8   portno
 
   __u16   parameter_count
 
   __u8   operator_flags [3]
 
   __u8   reserved [3]
 
lcs_std_cmd
 
struct {
   __u16   unused1
 
   __u16   buff_size
 
   __u8   unused2 [6]
 
lcs_startup
 
struct {
   __u8   lan_type
 
   __u8   portno
 
   __u8   unused [10]
 
   __u8   mac_addr [LCS_MAC_LENGTH]
 
   __u32   num_packets_deblocked
 
   __u32   num_packets_blocked
 
   __u32   num_packets_tx_on_lan
 
   __u32   num_tx_errors_detected
 
   __u32   num_tx_packets_disgarded
 
   __u32   num_packets_rx_from_lan
 
   __u32   num_rx_errors_detected
 
   __u32   num_rx_discarded_nobuffs_avail
 
   __u32   num_rx_packets_too_large
 
lcs_lanstat_cmd
 
__u8 cmd_code
 
__u8 initiator
 
__u16 sequence_no
 
__u16 return_code
 
spinlock_t lock
 
spinlock_t ipm_lock
 
enum lcs_dev_states state
 
struct net_devicedev
 
struct net_device_stats stats
 
__be16(* lan_type_trans )(struct sk_buff *skb, struct net_device *dev)
 
struct ccwgroup_devicegdev
 
struct lcs_channel read
 
struct lcs_channel write
 
struct lcs_buffertx_buffer
 
int tx_emitted
 
struct list_head lancmd_waiters
 
int lancmd_timeout
 
struct work_struct kernel_thread_starter
 
spinlock_t mask_lock
 
unsigned long thread_start_mask
 
unsigned long thread_running_mask
 
unsigned long thread_allowed_mask
 
wait_queue_head_t wait_q
 
__u8 mac [LCS_MAC_LENGTH]
 
__u16 ip_assists_supported
 
__u16 ip_assists_enabled
 
__u32 pkt_seq
 
u8 device_forced
 
u8 max_port_no
 
u8 hint_port_no
 
s16 port_protocol_no
 

Macro Definition Documentation

#define CARD_FROM_DEV (   cdev)
Value:
&((struct ccwgroup_device *)dev_get_drvdata(&cdev->dev))->dev);

sysfs related stuff

Definition at line 36 of file lcs.h.

#define LCS_CCW_READ   0x02

Definition at line 61 of file lcs.h.

#define LCS_CCW_TRANSFER   0x08

Definition at line 62 of file lcs.h.

#define LCS_CCW_WRITE   0x01

CCW commands used in this driver

Definition at line 60 of file lcs.h.

#define LCS_CMD_DELIPM   0xb5

Definition at line 74 of file lcs.h.

#define LCS_CMD_LANSTAT   0x04

Definition at line 69 of file lcs.h.

#define LCS_CMD_QIPASSIST   0xb2

Definition at line 72 of file lcs.h.

#define LCS_CMD_SETIPM   0xb4

Definition at line 73 of file lcs.h.

#define LCS_CMD_SHUTDOWN   0x08

Definition at line 71 of file lcs.h.

#define LCS_CMD_STARTLAN   0x01

LCS device status primitives

Definition at line 67 of file lcs.h.

#define LCS_CMD_STARTUP   0x07

Definition at line 70 of file lcs.h.

#define LCS_CMD_STOPLAN   0x02

Definition at line 68 of file lcs.h.

#define LCS_DBF_HEX (   level,
  name,
  addr,
  len 
)
Value:
do { \
debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
} while (0)

Definition at line 14 of file lcs.h.

#define LCS_DBF_TEXT (   level,
  name,
  text 
)
Value:
do { \
debug_text_event(lcs_dbf_##name, level, text); \
} while (0)

Definition at line 9 of file lcs.h.

#define LCS_DBF_TEXT_ (   level,
  name,
  text... 
)
Value:
do { \
if (lcs_dbf_passes(lcs_dbf_##name, level)) { \
sprintf(debug_buffer, text); \
debug_text_event(lcs_dbf_##name, level, debug_buffer); \
} \
} while (0)

Definition at line 25 of file lcs.h.

#define LCS_FRAME_TYPE_AUTO   -1

Definition at line 116 of file lcs.h.

#define LCS_FRAME_TYPE_CONTROL   0

LCS packet type definitions

Definition at line 112 of file lcs.h.

#define LCS_FRAME_TYPE_ENET   1

Definition at line 113 of file lcs.h.

#define LCS_FRAME_TYPE_FDDI   7

Definition at line 115 of file lcs.h.

#define LCS_FRAME_TYPE_TR   2

Definition at line 114 of file lcs.h.

#define LCS_ILLEGAL_OFFSET   0xffff

some more definitions,we will sort them later

Definition at line 121 of file lcs.h.

#define LCS_INITIATOR_LGW   0x01

Definition at line 77 of file lcs.h.

#define LCS_INITIATOR_TCPIP   0x00

Definition at line 76 of file lcs.h.

#define LCS_INVALID_PORT_NO   -1

Definition at line 125 of file lcs.h.

#define LCS_IOBUFFERSIZE   0x5000

Definition at line 122 of file lcs.h.

#define LCS_IPASS_ARP_PROCESSING   0x0001

LCS IPASSIST MASKS,only used when multicast is switched on

LCS IP Assist declarations seems to be only used for multicast

Definition at line 139 of file lcs.h.

#define LCS_IPASS_ARP_PROCESSING   0x0001

LCS IPASSIST MASKS,only used when multicast is switched on

LCS IP Assist declarations seems to be only used for multicast

Definition at line 139 of file lcs.h.

#define LCS_IPASS_IN_CHECKSUM_SUPPORT   0x0002

Definition at line 86 of file lcs.h.

#define LCS_IPASS_INBOUND_CSUM_SUPP   0x0002

Definition at line 140 of file lcs.h.

#define LCS_IPASS_IP_FILTERING   0x0010

Definition at line 143 of file lcs.h.

#define LCS_IPASS_IP_FILTERING   0x0010

Definition at line 143 of file lcs.h.

#define LCS_IPASS_IP_FRAG_REASSEMBLY   0x0008

Definition at line 142 of file lcs.h.

#define LCS_IPASS_IP_FRAG_REASSEMBLY   0x0008

Definition at line 142 of file lcs.h.

#define LCS_IPASS_IPV6_SUPPORT   0x0020

Definition at line 144 of file lcs.h.

#define LCS_IPASS_IPV6_SUPPORT   0x0020

Definition at line 144 of file lcs.h.

#define LCS_IPASS_MULTICAST_SUPPORT   0x0040

Definition at line 145 of file lcs.h.

#define LCS_IPASS_MULTICAST_SUPPORT   0x0040

Definition at line 145 of file lcs.h.

#define LCS_IPASS_OUT_CHECKSUM_SUPPORT   0x0004

Definition at line 87 of file lcs.h.

#define LCS_IPASS_OUTBOUND_CSUM_SUPP   0x0004

Definition at line 141 of file lcs.h.

#define LCS_IPM_STATE_DEL_REQUIRED   1

Definition at line 132 of file lcs.h.

#define LCS_IPM_STATE_ON_CARD   2

Definition at line 133 of file lcs.h.

#define LCS_IPM_STATE_SET_REQUIRED   0

Multicast state

Definition at line 131 of file lcs.h.

#define LCS_LANCMD_TIMEOUT_DEFAULT   5

Definition at line 126 of file lcs.h.

#define LCS_MAC_LENGTH   6

Definition at line 124 of file lcs.h.

#define LCS_MULTICAST_CMD_SIZE   404

Definition at line 79 of file lcs.h.

#define LCS_NUM_BUFFS   32 /* needs to be power of 2 */

Definition at line 123 of file lcs.h.

#define LCS_SENSE_BUS_OUT_CHECK   0x20

Definition at line 103 of file lcs.h.

#define LCS_SENSE_BYTE_0   0

LCS sense byte definitions

Definition at line 97 of file lcs.h.

#define LCS_SENSE_BYTE_1   1

Definition at line 98 of file lcs.h.

#define LCS_SENSE_BYTE_2   2

Definition at line 99 of file lcs.h.

#define LCS_SENSE_BYTE_3   3

Definition at line 100 of file lcs.h.

#define LCS_SENSE_CMD_REJECT   0x80

Definition at line 105 of file lcs.h.

#define LCS_SENSE_DEVICE_ONLINE   0x20

Definition at line 107 of file lcs.h.

#define LCS_SENSE_EQUIPMENT_CHECK   0x10

Definition at line 102 of file lcs.h.

#define LCS_SENSE_INTERFACE_DISCONNECT   0x01

Definition at line 101 of file lcs.h.

#define LCS_SENSE_INTERVENTION_REQUIRED   0x40

Definition at line 104 of file lcs.h.

#define LCS_SENSE_RESETTING_EVENT   0x80

Definition at line 106 of file lcs.h.

#define LCS_STD_CMD_SIZE   16

Definition at line 78 of file lcs.h.

Enumeration Type Documentation

LCS Buffer states

Enumerator:
LCS_BUF_STATE_EMPTY 
LCS_BUF_STATE_LOCKED 
LCS_BUF_STATE_READY 
LCS_BUF_STATE_PROCESSED 

Definition at line 150 of file lcs.h.

LCS Channel State Machine declarations

Enumerator:
LCS_CH_STATE_INIT 
LCS_CH_STATE_HALTED 
LCS_CH_STATE_STOPPED 
LCS_CH_STATE_RUNNING 
LCS_CH_STATE_SUSPENDED 
LCS_CH_STATE_CLEARED 
LCS_CH_STATE_ERROR 

Definition at line 160 of file lcs.h.

Enum for classifying detected devices.

Enumerator:
lcs_channel_type_none 
lcs_channel_type_parallel 
lcs_channel_type_2216 
lcs_channel_type_osa2 

Definition at line 43 of file lcs.h.

LCS device state machine

Enumerator:
DEV_STATE_DOWN 
DEV_STATE_UP 
DEV_STATE_RECOVER 

Definition at line 173 of file lcs.h.

Enumerator:
LCS_SET_MC_THREAD 
LCS_RECOVERY_THREAD 

Definition at line 179 of file lcs.h.

Function Documentation

struct lcs_header __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

Packet vector entry.

This data structure is used with netio_send_packet_vector() to send multiple packets with one NetIO call. The structure should be initialized by calling netio_pkt_vector_set(), rather than by setting the fields directly.

This structure is guaranteed to be a power of two in size, no bigger than one L2 cache line, and to be aligned modulo its size.

Reserved for use by the user application. When initialized with the netio_set_pkt_vector_entry() function, this field is guaranteed to be visible to readers only after all other fields are already visible. This way it can be used as a valid flag or generation counter.

Low 8 bits of the packet address to send. The high bits are acquired from the 'handle' field.

Number of bytes to transmit.

The raw handle from a netio_pkt_t. If this is NETIO_PKT_HANDLE_NONE, this vector entry will be skipped and no packet will be transmitted.

Definition at line 9 of file extable.c.

Variable Documentation

__u16 buff_size

Definition at line 266 of file lcs.h.

__u8 cmd_code

Definition at line 261 of file lcs.h.

Definition at line 348 of file lcs.h.

u8 device_forced

Definition at line 378 of file lcs.h.

Definition at line 352 of file lcs.h.

u8 hint_port_no

Definition at line 380 of file lcs.h.

__u8 initiator

Definition at line 262 of file lcs.h.

__be32 ip_addr

Definition at line 198 of file lcs.h.

__u16 ip_assists_enabled

Definition at line 372 of file lcs.h.

__u16 ip_assists_supported

Definition at line 371 of file lcs.h.

spinlock_t ipm_lock

Definition at line 346 of file lcs.h.

struct work_struct kernel_thread_starter

Definition at line 360 of file lcs.h.

__s8 lan_type

Definition at line 258 of file lcs.h.

__be16(* lan_type_trans)(struct sk_buff *skb, struct net_device *dev)

Definition at line 350 of file lcs.h.

int lancmd_timeout

Definition at line 358 of file lcs.h.

struct list_head lancmd_waiters

Definition at line 357 of file lcs.h.

struct { ... } lcs_lanstat_cmd
struct { ... } lcs_startup
struct { ... } lcs_std_cmd
spinlock_t lock

Definition at line 345 of file lcs.h.

Definition at line 370 of file lcs.h.

Definition at line 199 of file lcs.h.

spinlock_t mask_lock

Definition at line 361 of file lcs.h.

u8 max_port_no

Definition at line 379 of file lcs.h.

__u32 num_packets_blocked

Definition at line 275 of file lcs.h.

__u32 num_packets_deblocked

Definition at line 274 of file lcs.h.

__u32 num_packets_rx_from_lan

Definition at line 279 of file lcs.h.

__u32 num_packets_tx_on_lan

Definition at line 276 of file lcs.h.

__u32 num_rx_discarded_nobuffs_avail

Definition at line 281 of file lcs.h.

__u32 num_rx_errors_detected

Definition at line 280 of file lcs.h.

__u32 num_rx_packets_too_large

Definition at line 282 of file lcs.h.

__u32 num_tx_errors_detected

Definition at line 277 of file lcs.h.

__u32 num_tx_packets_disgarded

Definition at line 278 of file lcs.h.

Definition at line 192 of file lcs.h.

__u8 operator_flags[3]

Definition at line 261 of file lcs.h.

__u16 parameter_count

Definition at line 260 of file lcs.h.

__u32 pkt_seq

Definition at line 374 of file lcs.h.

s16 port_protocol_no

Definition at line 381 of file lcs.h.

__s16 portno

Definition at line 259 of file lcs.h.

Definition at line 353 of file lcs.h.

__u8 reserved[3]

Definition at line 200 of file lcs.h.

__u16 return_code

Definition at line 264 of file lcs.h.

__u16 sequence_no

Definition at line 263 of file lcs.h.

Definition at line 194 of file lcs.h.

Definition at line 347 of file lcs.h.

Definition at line 349 of file lcs.h.

unsigned long thread_allowed_mask

Definition at line 364 of file lcs.h.

unsigned long thread_running_mask

Definition at line 363 of file lcs.h.

unsigned long thread_start_mask

Definition at line 362 of file lcs.h.

struct lcs_buffer* tx_buffer

Definition at line 355 of file lcs.h.

int tx_emitted

Definition at line 356 of file lcs.h.

Definition at line 193 of file lcs.h.

__u8 unused[10]

Definition at line 272 of file lcs.h.

__u16 unused1

Definition at line 265 of file lcs.h.

__u8 unused2[6]

Definition at line 267 of file lcs.h.

Definition at line 365 of file lcs.h.

static int write

Definition at line 354 of file lcs.h.