aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/pc300_tty.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 931cbdf6d791..b2a23aed4428 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -125,8 +125,8 @@ static int cpc_tty_write_room(struct tty_struct *tty);
125static int cpc_tty_chars_in_buffer(struct tty_struct *tty); 125static int cpc_tty_chars_in_buffer(struct tty_struct *tty);
126static void cpc_tty_flush_buffer(struct tty_struct *tty); 126static void cpc_tty_flush_buffer(struct tty_struct *tty);
127static void cpc_tty_hangup(struct tty_struct *tty); 127static void cpc_tty_hangup(struct tty_struct *tty);
128static void cpc_tty_rx_work(void *data); 128static void cpc_tty_rx_work(struct work_struct *work);
129static void cpc_tty_tx_work(void *data); 129static void cpc_tty_tx_work(struct work_struct *work);
130static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); 130static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len);
131static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); 131static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx);
132static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); 132static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char);
@@ -261,8 +261,8 @@ void cpc_tty_init(pc300dev_t *pc300dev)
261 cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; 261 cpc_tty->tty_minor = port + CPC_TTY_MINOR_START;
262 cpc_tty->pc300dev = pc300dev; 262 cpc_tty->pc300dev = pc300dev;
263 263
264 INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty); 264 INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work);
265 INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port); 265 INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work);
266 266
267 cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; 267 cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL;
268 268
@@ -659,21 +659,23 @@ static void cpc_tty_hangup(struct tty_struct *tty)
659 * o call the line disc. read 659 * o call the line disc. read
660 * o free memory 660 * o free memory
661 */ 661 */
662static void cpc_tty_rx_work(void * data) 662static void cpc_tty_rx_work(struct work_struct *work)
663{ 663{
664 st_cpc_tty_area *cpc_tty;
664 unsigned long port; 665 unsigned long port;
665 int i, j; 666 int i, j;
666 st_cpc_tty_area *cpc_tty;
667 volatile st_cpc_rx_buf *buf; 667 volatile st_cpc_rx_buf *buf;
668 char flags=0,flg_rx=1; 668 char flags=0,flg_rx=1;
669 struct tty_ldisc *ld; 669 struct tty_ldisc *ld;
670 670
671 if (cpc_tty_cnt == 0) return; 671 if (cpc_tty_cnt == 0) return;
672
673 672
674 for (i=0; (i < 4) && flg_rx ; i++) { 673 for (i=0; (i < 4) && flg_rx ; i++) {
675 flg_rx = 0; 674 flg_rx = 0;
676 port = (unsigned long)data; 675
676 cpc_tty = container_of(work, st_cpc_tty_area, tty_rx_work);
677 port = cpc_tty - cpc_tty_area;
678
677 for (j=0; j < CPC_TTY_NPORTS; j++) { 679 for (j=0; j < CPC_TTY_NPORTS; j++) {
678 cpc_tty = &cpc_tty_area[port]; 680 cpc_tty = &cpc_tty_area[port];
679 681
@@ -882,9 +884,10 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
882 * o if need call line discipline wakeup 884 * o if need call line discipline wakeup
883 * o call wake_up_interruptible 885 * o call wake_up_interruptible
884 */ 886 */
885static void cpc_tty_tx_work(void *data) 887static void cpc_tty_tx_work(struct work_struct *work)
886{ 888{
887 st_cpc_tty_area *cpc_tty = (st_cpc_tty_area *) data; 889 st_cpc_tty_area *cpc_tty =
890 container_of(work, st_cpc_tty_area, tty_tx_work);
888 struct tty_struct *tty; 891 struct tty_struct *tty;
889 892
890 CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); 893 CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name);