diff options
Diffstat (limited to 'drivers/tty/synclinkmp.c')
-rw-r--r-- | drivers/tty/synclinkmp.c | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c index fd43fb6f7cee..545402509cab 100644 --- a/drivers/tty/synclinkmp.c +++ b/drivers/tty/synclinkmp.c | |||
@@ -262,8 +262,7 @@ typedef struct _synclinkmp_info { | |||
262 | bool sca_statctrl_requested; | 262 | bool sca_statctrl_requested; |
263 | 263 | ||
264 | u32 misc_ctrl_value; | 264 | u32 misc_ctrl_value; |
265 | char flag_buf[MAX_ASYNC_BUFFER_SIZE]; | 265 | char *flag_buf; |
266 | char char_buf[MAX_ASYNC_BUFFER_SIZE]; | ||
267 | bool drop_rts_on_tx_done; | 266 | bool drop_rts_on_tx_done; |
268 | 267 | ||
269 | struct _input_signal_events input_signal_events; | 268 | struct _input_signal_events input_signal_events; |
@@ -762,7 +761,7 @@ static int open(struct tty_struct *tty, struct file *filp) | |||
762 | goto cleanup; | 761 | goto cleanup; |
763 | } | 762 | } |
764 | 763 | ||
765 | info->port.tty->low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 764 | info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
766 | 765 | ||
767 | spin_lock_irqsave(&info->netlock, flags); | 766 | spin_lock_irqsave(&info->netlock, flags); |
768 | if (info->netcount) { | 767 | if (info->netcount) { |
@@ -2008,9 +2007,6 @@ static void bh_handler(struct work_struct *work) | |||
2008 | SLMP_INFO *info = container_of(work, SLMP_INFO, task); | 2007 | SLMP_INFO *info = container_of(work, SLMP_INFO, task); |
2009 | int action; | 2008 | int action; |
2010 | 2009 | ||
2011 | if (!info) | ||
2012 | return; | ||
2013 | |||
2014 | if ( debug_level >= DEBUG_LEVEL_BH ) | 2010 | if ( debug_level >= DEBUG_LEVEL_BH ) |
2015 | printk( "%s(%d):%s bh_handler() entry\n", | 2011 | printk( "%s(%d):%s bh_handler() entry\n", |
2016 | __FILE__,__LINE__,info->device_name); | 2012 | __FILE__,__LINE__,info->device_name); |
@@ -2132,13 +2128,11 @@ static void isr_rxint(SLMP_INFO * info) | |||
2132 | /* process break detection if tty control | 2128 | /* process break detection if tty control |
2133 | * is not set to ignore it | 2129 | * is not set to ignore it |
2134 | */ | 2130 | */ |
2135 | if ( tty ) { | 2131 | if (!(status & info->ignore_status_mask1)) { |
2136 | if (!(status & info->ignore_status_mask1)) { | 2132 | if (info->read_status_mask1 & BRKD) { |
2137 | if (info->read_status_mask1 & BRKD) { | 2133 | tty_insert_flip_char(&info->port, 0, TTY_BREAK); |
2138 | tty_insert_flip_char(tty, 0, TTY_BREAK); | 2134 | if (tty && (info->port.flags & ASYNC_SAK)) |
2139 | if (info->port.flags & ASYNC_SAK) | 2135 | do_SAK(tty); |
2140 | do_SAK(tty); | ||
2141 | } | ||
2142 | } | 2136 | } |
2143 | } | 2137 | } |
2144 | } | 2138 | } |
@@ -2170,7 +2164,6 @@ static void isr_rxrdy(SLMP_INFO * info) | |||
2170 | { | 2164 | { |
2171 | u16 status; | 2165 | u16 status; |
2172 | unsigned char DataByte; | 2166 | unsigned char DataByte; |
2173 | struct tty_struct *tty = info->port.tty; | ||
2174 | struct mgsl_icount *icount = &info->icount; | 2167 | struct mgsl_icount *icount = &info->icount; |
2175 | 2168 | ||
2176 | if ( debug_level >= DEBUG_LEVEL_ISR ) | 2169 | if ( debug_level >= DEBUG_LEVEL_ISR ) |
@@ -2203,26 +2196,22 @@ static void isr_rxrdy(SLMP_INFO * info) | |||
2203 | 2196 | ||
2204 | status &= info->read_status_mask2; | 2197 | status &= info->read_status_mask2; |
2205 | 2198 | ||
2206 | if ( tty ) { | 2199 | if (status & PE) |
2207 | if (status & PE) | 2200 | flag = TTY_PARITY; |
2208 | flag = TTY_PARITY; | 2201 | else if (status & FRME) |
2209 | else if (status & FRME) | 2202 | flag = TTY_FRAME; |
2210 | flag = TTY_FRAME; | 2203 | if (status & OVRN) { |
2211 | if (status & OVRN) { | 2204 | /* Overrun is special, since it's |
2212 | /* Overrun is special, since it's | 2205 | * reported immediately, and doesn't |
2213 | * reported immediately, and doesn't | 2206 | * affect the current character |
2214 | * affect the current character | 2207 | */ |
2215 | */ | 2208 | over = true; |
2216 | over = true; | ||
2217 | } | ||
2218 | } | 2209 | } |
2219 | } /* end of if (error) */ | 2210 | } /* end of if (error) */ |
2220 | 2211 | ||
2221 | if ( tty ) { | 2212 | tty_insert_flip_char(&info->port, DataByte, flag); |
2222 | tty_insert_flip_char(tty, DataByte, flag); | 2213 | if (over) |
2223 | if (over) | 2214 | tty_insert_flip_char(&info->port, 0, TTY_OVERRUN); |
2224 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
2225 | } | ||
2226 | } | 2215 | } |
2227 | 2216 | ||
2228 | if ( debug_level >= DEBUG_LEVEL_ISR ) { | 2217 | if ( debug_level >= DEBUG_LEVEL_ISR ) { |
@@ -2232,8 +2221,7 @@ static void isr_rxrdy(SLMP_INFO * info) | |||
2232 | icount->frame,icount->overrun); | 2221 | icount->frame,icount->overrun); |
2233 | } | 2222 | } |
2234 | 2223 | ||
2235 | if ( tty ) | 2224 | tty_flip_buffer_push(&info->port); |
2236 | tty_flip_buffer_push(tty); | ||
2237 | } | 2225 | } |
2238 | 2226 | ||
2239 | static void isr_txeom(SLMP_INFO * info, unsigned char status) | 2227 | static void isr_txeom(SLMP_INFO * info, unsigned char status) |
@@ -3553,6 +3541,13 @@ static int alloc_tmp_rx_buf(SLMP_INFO *info) | |||
3553 | info->tmp_rx_buf = kmalloc(info->max_frame_size, GFP_KERNEL); | 3541 | info->tmp_rx_buf = kmalloc(info->max_frame_size, GFP_KERNEL); |
3554 | if (info->tmp_rx_buf == NULL) | 3542 | if (info->tmp_rx_buf == NULL) |
3555 | return -ENOMEM; | 3543 | return -ENOMEM; |
3544 | /* unused flag buffer to satisfy receive_buf calling interface */ | ||
3545 | info->flag_buf = kzalloc(info->max_frame_size, GFP_KERNEL); | ||
3546 | if (!info->flag_buf) { | ||
3547 | kfree(info->tmp_rx_buf); | ||
3548 | info->tmp_rx_buf = NULL; | ||
3549 | return -ENOMEM; | ||
3550 | } | ||
3556 | return 0; | 3551 | return 0; |
3557 | } | 3552 | } |
3558 | 3553 | ||
@@ -3560,6 +3555,8 @@ static void free_tmp_rx_buf(SLMP_INFO *info) | |||
3560 | { | 3555 | { |
3561 | kfree(info->tmp_rx_buf); | 3556 | kfree(info->tmp_rx_buf); |
3562 | info->tmp_rx_buf = NULL; | 3557 | info->tmp_rx_buf = NULL; |
3558 | kfree(info->flag_buf); | ||
3559 | info->flag_buf = NULL; | ||
3563 | } | 3560 | } |
3564 | 3561 | ||
3565 | static int claim_resources(SLMP_INFO *info) | 3562 | static int claim_resources(SLMP_INFO *info) |