diff options
Diffstat (limited to 'drivers/tty/synclink.c')
-rw-r--r-- | drivers/tty/synclink.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 9e071f6985f6..555fdc0ed0f1 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c | |||
@@ -291,8 +291,7 @@ struct mgsl_struct { | |||
291 | bool lcr_mem_requested; | 291 | bool lcr_mem_requested; |
292 | 292 | ||
293 | u32 misc_ctrl_value; | 293 | u32 misc_ctrl_value; |
294 | char flag_buf[MAX_ASYNC_BUFFER_SIZE]; | 294 | char *flag_buf; |
295 | char char_buf[MAX_ASYNC_BUFFER_SIZE]; | ||
296 | bool drop_rts_on_tx_done; | 295 | bool drop_rts_on_tx_done; |
297 | 296 | ||
298 | bool loopmode_insert_requested; | 297 | bool loopmode_insert_requested; |
@@ -1440,7 +1439,6 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info ) | |||
1440 | u16 status; | 1439 | u16 status; |
1441 | int work = 0; | 1440 | int work = 0; |
1442 | unsigned char DataByte; | 1441 | unsigned char DataByte; |
1443 | struct tty_struct *tty = info->port.tty; | ||
1444 | struct mgsl_icount *icount = &info->icount; | 1442 | struct mgsl_icount *icount = &info->icount; |
1445 | 1443 | ||
1446 | if ( debug_level >= DEBUG_LEVEL_ISR ) | 1444 | if ( debug_level >= DEBUG_LEVEL_ISR ) |
@@ -1502,19 +1500,19 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info ) | |||
1502 | if (status & RXSTATUS_BREAK_RECEIVED) { | 1500 | if (status & RXSTATUS_BREAK_RECEIVED) { |
1503 | flag = TTY_BREAK; | 1501 | flag = TTY_BREAK; |
1504 | if (info->port.flags & ASYNC_SAK) | 1502 | if (info->port.flags & ASYNC_SAK) |
1505 | do_SAK(tty); | 1503 | do_SAK(info->port.tty); |
1506 | } else if (status & RXSTATUS_PARITY_ERROR) | 1504 | } else if (status & RXSTATUS_PARITY_ERROR) |
1507 | flag = TTY_PARITY; | 1505 | flag = TTY_PARITY; |
1508 | else if (status & RXSTATUS_FRAMING_ERROR) | 1506 | else if (status & RXSTATUS_FRAMING_ERROR) |
1509 | flag = TTY_FRAME; | 1507 | flag = TTY_FRAME; |
1510 | } /* end of if (error) */ | 1508 | } /* end of if (error) */ |
1511 | tty_insert_flip_char(tty, DataByte, flag); | 1509 | tty_insert_flip_char(&info->port, DataByte, flag); |
1512 | if (status & RXSTATUS_OVERRUN) { | 1510 | if (status & RXSTATUS_OVERRUN) { |
1513 | /* Overrun is special, since it's | 1511 | /* Overrun is special, since it's |
1514 | * reported immediately, and doesn't | 1512 | * reported immediately, and doesn't |
1515 | * affect the current character | 1513 | * affect the current character |
1516 | */ | 1514 | */ |
1517 | work += tty_insert_flip_char(tty, 0, TTY_OVERRUN); | 1515 | work += tty_insert_flip_char(&info->port, 0, TTY_OVERRUN); |
1518 | } | 1516 | } |
1519 | } | 1517 | } |
1520 | 1518 | ||
@@ -1525,7 +1523,7 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info ) | |||
1525 | } | 1523 | } |
1526 | 1524 | ||
1527 | if(work) | 1525 | if(work) |
1528 | tty_flip_buffer_push(tty); | 1526 | tty_flip_buffer_push(&info->port); |
1529 | } | 1527 | } |
1530 | 1528 | ||
1531 | /* mgsl_isr_misc() | 1529 | /* mgsl_isr_misc() |
@@ -3416,7 +3414,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) | |||
3416 | goto cleanup; | 3414 | goto cleanup; |
3417 | } | 3415 | } |
3418 | 3416 | ||
3419 | info->port.tty->low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 3417 | info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
3420 | 3418 | ||
3421 | spin_lock_irqsave(&info->netlock, flags); | 3419 | spin_lock_irqsave(&info->netlock, flags); |
3422 | if (info->netcount) { | 3420 | if (info->netcount) { |
@@ -3898,7 +3896,13 @@ static int mgsl_alloc_intermediate_rxbuffer_memory(struct mgsl_struct *info) | |||
3898 | info->intermediate_rxbuffer = kmalloc(info->max_frame_size, GFP_KERNEL | GFP_DMA); | 3896 | info->intermediate_rxbuffer = kmalloc(info->max_frame_size, GFP_KERNEL | GFP_DMA); |
3899 | if ( info->intermediate_rxbuffer == NULL ) | 3897 | if ( info->intermediate_rxbuffer == NULL ) |
3900 | return -ENOMEM; | 3898 | return -ENOMEM; |
3901 | 3899 | /* unused flag buffer to satisfy receive_buf calling interface */ | |
3900 | info->flag_buf = kzalloc(info->max_frame_size, GFP_KERNEL); | ||
3901 | if (!info->flag_buf) { | ||
3902 | kfree(info->intermediate_rxbuffer); | ||
3903 | info->intermediate_rxbuffer = NULL; | ||
3904 | return -ENOMEM; | ||
3905 | } | ||
3902 | return 0; | 3906 | return 0; |
3903 | 3907 | ||
3904 | } /* end of mgsl_alloc_intermediate_rxbuffer_memory() */ | 3908 | } /* end of mgsl_alloc_intermediate_rxbuffer_memory() */ |
@@ -3917,6 +3921,8 @@ static void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info) | |||
3917 | { | 3921 | { |
3918 | kfree(info->intermediate_rxbuffer); | 3922 | kfree(info->intermediate_rxbuffer); |
3919 | info->intermediate_rxbuffer = NULL; | 3923 | info->intermediate_rxbuffer = NULL; |
3924 | kfree(info->flag_buf); | ||
3925 | info->flag_buf = NULL; | ||
3920 | 3926 | ||
3921 | } /* end of mgsl_free_intermediate_rxbuffer_memory() */ | 3927 | } /* end of mgsl_free_intermediate_rxbuffer_memory() */ |
3922 | 3928 | ||