X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Flinux%2Fn_r3964.h;h=90a803aa42e8cc1075e63dfc0bc17967d318f40f;hb=aba24888d9af19e0bd1c7e7344fd27841611d7a8;hp=54b8e0d8d9161e310ea11df8f81f81c44c1cfa1d;hpb=47935a731b7b850a4c6c0e55ed0741e3dd25d889;p=deliverable%2Flinux.git diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h index 54b8e0d8d916..90a803aa42e8 100644 --- a/include/linux/n_r3964.h +++ b/include/linux/n_r3964.h @@ -43,15 +43,12 @@ * * */ - #ifndef __LINUX_N_R3964_H__ #define __LINUX_N_R3964_H__ -/* line disciplines for r3964 protocol */ - -#ifdef __KERNEL__ #include +#include /* * Common ascii handshake characters: @@ -73,32 +70,6 @@ #define R3964_TO_RX_PANIC ((4000)*HZ/1000) #define R3964_MAX_RETRIES 5 -#endif - -/* - * Ioctl-commands - */ - -#define R3964_ENABLE_SIGNALS 0x5301 -#define R3964_SETPRIORITY 0x5302 -#define R3964_USE_BCC 0x5303 -#define R3964_READ_TELEGRAM 0x5304 - -/* Options for R3964_SETPRIORITY */ -#define R3964_MASTER 0 -#define R3964_SLAVE 1 - -/* Options for R3964_ENABLE_SIGNALS */ -#define R3964_SIG_ACK 0x0001 -#define R3964_SIG_DATA 0x0002 -#define R3964_SIG_ALL 0x000f -#define R3964_SIG_NONE 0x0000 -#define R3964_USE_SIGIO 0x1000 - -/* - * r3964 operation states: - */ -#ifdef __KERNEL__ enum { R3964_IDLE, R3964_TX_REQUEST, R3964_TRANSMITTING, @@ -127,29 +98,6 @@ struct r3964_client_info { }; -#endif - -/* types for msg_id: */ -enum {R3964_MSG_ACK=1, R3964_MSG_DATA }; - -#define R3964_MAX_MSG_COUNT 32 - -/* error codes for client messages */ -#define R3964_OK 0 /* no error. */ -#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */ -#define R3964_OVERFLOW -2 /* msg queue overflow */ - -/* the client gets this struct when calling read(fd,...): */ -struct r3964_client_message { - int msg_id; - int arg; - int error_code; -}; - -#define R3964_MTU 256 - - -#ifdef __KERNEL__ struct r3964_block_header; @@ -204,9 +152,6 @@ struct r3964_info { unsigned char *rx_buf; /* ring buffer */ unsigned char *tx_buf; - wait_queue_head_t read_wait; - //struct wait_queue *read_wait; - struct r3964_block_header *rx_first; struct r3964_block_header *rx_last; struct r3964_block_header *tx_first; @@ -216,8 +161,9 @@ struct r3964_info { unsigned char last_rx; unsigned char bcc; unsigned int blocks_in_rx_queue; - - + + struct mutex read_lock; /* serialize r3964_read */ + struct r3964_client_info *firstClient; unsigned int state; unsigned int flags; @@ -226,6 +172,4 @@ struct r3964_info { int nRetry; }; -#endif - #endif