~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/cris/arch-v10/drivers/serial.h

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * serial.h: Arch-dep definitions for the Etrax100 serial driver.
  3  *
  4  * Copyright (C) 1998, 1999, 2000 Axis Communications AB
  5  */
  6 
  7 #ifndef _ETRAX_SERIAL_H
  8 #define _ETRAX_SERIAL_H
  9 
 10 #include <linux/config.h>
 11 #include <linux/circ_buf.h>
 12 #include <asm/termios.h>
 13 
 14 /* Software state per channel */
 15 
 16 #ifdef __KERNEL__
 17 /*
 18  * This is our internal structure for each serial port's state.
 19  * 
 20  * Many fields are paralleled by the structure used by the serial_struct
 21  * structure.
 22  *
 23  * For definitions of the flags field, see tty.h
 24  */
 25 
 26 #define SERIAL_RECV_DESCRIPTORS 8
 27 
 28 struct etrax_recv_buffer {
 29         struct etrax_recv_buffer *next;
 30         unsigned short length;
 31         unsigned char error;
 32         unsigned char pad;
 33 
 34         unsigned char buffer[0];
 35 };
 36 
 37 struct e100_serial {
 38         int                     baud;
 39         volatile u8             *port; /* R_SERIALx_CTRL */
 40         u32                     irq;  /* bitnr in R_IRQ_MASK2 for dmaX_descr */
 41 
 42         /* Output registers */
 43         volatile u8             *oclrintradr; /* adr to R_DMA_CHx_CLR_INTR */
 44         volatile u32            *ofirstadr;   /* adr to R_DMA_CHx_FIRST */
 45         volatile u8             *ocmdadr;     /* adr to R_DMA_CHx_CMD */
 46         const volatile u8       *ostatusadr;  /* adr to R_DMA_CHx_STATUS */
 47         volatile u32            *ohwswadr;    /* adr to R_DMA_CHx_HWSW */
 48         volatile u32            *odescradr;   /* adr to R_DMA_CHx_DESCR */
 49 
 50         /* Input registers */
 51         volatile u8             *iclrintradr; /* adr to R_DMA_CHx_CLR_INTR */
 52         volatile u32            *ifirstadr;   /* adr to R_DMA_CHx_FIRST */
 53         volatile u8             *icmdadr;     /* adr to R_DMA_CHx_CMD */
 54         const volatile u8       *istatusadr;  /* adr to R_DMA_CHx_STATUS */
 55         volatile u32            *ihwswadr;    /* adr to R_DMA_CHx_HWSW */
 56         volatile u32            *idescradr;   /* adr to R_DMA_CHx_DESCR */
 57 
 58         int                     flags;  /* defined in tty.h */
 59 
 60         u8                      rx_ctrl; /* shadow for R_SERIALx_REC_CTRL */
 61         u8                      tx_ctrl; /* shadow for R_SERIALx_TR_CTRL */
 62         u8                      iseteop; /* bit number for R_SET_EOP for the input dma */
 63 
 64         int                     enabled; /* Set to 1 if the port is enabled in HW config */
 65   
 66         /* end of fields defined in rs_table[] in .c-file */
 67 
 68         int                     uses_dma; /* Set to 1 if DMA should be used */
 69         unsigned char           forced_eop; /* a fifo eop has been forced */
 70 
 71         struct etrax_dma_descr  tr_descr;
 72         struct etrax_dma_descr  rec_descr[SERIAL_RECV_DESCRIPTORS];
 73         int                     cur_rec_descr;
 74 
 75         volatile int            tr_running; /* 1 if output is running */
 76 
 77         struct tty_struct       *tty;
 78         int                     read_status_mask;
 79         int                     ignore_status_mask;
 80         int                     x_char; /* xon/xoff character */
 81         int                     close_delay;
 82         unsigned short          closing_wait;
 83         unsigned short          closing_wait2;
 84         unsigned long           event;
 85         unsigned long           last_active;
 86         int                     line;
 87         int                     type;  /* PORT_ETRAX */
 88         int                     count;      /* # of fd on device */
 89         int                     blocked_open; /* # of blocked opens */
 90         struct circ_buf         xmit;
 91         struct etrax_recv_buffer *first_recv_buffer;
 92         struct etrax_recv_buffer *last_recv_buffer;
 93         unsigned int            recv_cnt;
 94         unsigned int            max_recv_cnt;
 95 
 96         struct work_struct      work;
 97         struct async_icount     icount;   /* error-statistics etc.*/
 98 #ifdef DECLARE_WAITQUEUE
 99         wait_queue_head_t       open_wait;
100         wait_queue_head_t       close_wait;
101 #else
102         struct wait_queue       *open_wait;
103         struct wait_queue       *close_wait;
104 #endif  
105 
106         unsigned long           char_time_usec;       /* The time for 1 char, in usecs */
107         unsigned long           last_tx_active_usec;  /* Last tx usec in the jiffies */
108         unsigned long           last_tx_active;       /* Last tx time in jiffies */
109         unsigned long           last_rx_active_usec;  /* Last rx usec in the jiffies */
110         unsigned long           last_rx_active;       /* Last rx time in jiffies */
111 
112         int                     break_detected_cnt;
113         int                     errorcode;
114 
115 #ifdef CONFIG_ETRAX_RS485
116         struct rs485_control    rs485;  /* RS-485 support */
117 #endif
118 };
119 
120 /* this PORT is not in the standard serial.h. it's not actually used for
121  * anything since we only have one type of async serial-port anyway in this
122  * system.
123  */
124 
125 #define PORT_ETRAX 1
126 
127 /*
128  * Events are used to schedule things to happen at timer-interrupt
129  * time, instead of at rs interrupt time.
130  */
131 #define RS_EVENT_WRITE_WAKEUP   0
132 
133 #endif /* __KERNEL__ */
134 
135 #endif /* !_ETRAX_SERIAL_H */
136 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp