aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ser_a2232.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2008-07-26 19:39:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:29:03 -0400
commit732730d48dc777f6577a6e0fece42b860324998e (patch)
treee1ef7cfaed95d0ad3b81043eca5f7a1e1ba37764 /drivers/char/ser_a2232.c
parentbdee6ac7d1c9a4a9b65db1753b0bfa0b61361dde (diff)
m68k: gs: use tty_port fixes
commit b5391e29f428d11755ca2c91074c6db6f5c69d7c ("gs: use tty_port") forgot to update the m68k gs serial drivers. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ser_a2232.c')
-rw-r--r--drivers/char/ser_a2232.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 4ba3aec9e1cd..7b0c35207d9b 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -192,7 +192,7 @@ static inline void a2232_receive_char(struct a2232_port *port, int ch, int err)
192 Maybe one could implement a more efficient version by not only 192 Maybe one could implement a more efficient version by not only
193 transferring one character at a time. 193 transferring one character at a time.
194*/ 194*/
195 struct tty_struct *tty = port->gs.tty; 195 struct tty_struct *tty = port->gs.port.tty;
196 196
197#if 0 197#if 0
198 switch(err) { 198 switch(err) {
@@ -226,7 +226,7 @@ static void a2232_disable_tx_interrupts(void *ptr)
226 226
227 /* Does this here really have to be? */ 227 /* Does this here really have to be? */
228 local_irq_save(flags); 228 local_irq_save(flags);
229 port->gs.flags &= ~GS_TX_INTEN; 229 port->gs.port.flags &= ~GS_TX_INTEN;
230 local_irq_restore(flags); 230 local_irq_restore(flags);
231} 231}
232 232
@@ -242,7 +242,7 @@ static void a2232_enable_tx_interrupts(void *ptr)
242 242
243 /* Does this here really have to be? */ 243 /* Does this here really have to be? */
244 local_irq_save(flags); 244 local_irq_save(flags);
245 port->gs.flags |= GS_TX_INTEN; 245 port->gs.port.flags |= GS_TX_INTEN;
246 local_irq_restore(flags); 246 local_irq_restore(flags);
247} 247}
248 248
@@ -276,9 +276,9 @@ static void a2232_shutdown_port(void *ptr)
276 276
277 local_irq_save(flags); 277 local_irq_save(flags);
278 278
279 port->gs.flags &= ~GS_ACTIVE; 279 port->gs.port.flags &= ~GS_ACTIVE;
280 280
281 if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL) { 281 if (port->gs.port.tty && port->gs.port.tty->termios->c_cflag & HUPCL) {
282 /* Set DTR and RTS to Low, flush output. 282 /* Set DTR and RTS to Low, flush output.
283 The NetBSD driver "msc.c" does it this way. */ 283 The NetBSD driver "msc.c" does it this way. */
284 stat->Command = ( (stat->Command & ~A2232CMD_CMask) | 284 stat->Command = ( (stat->Command & ~A2232CMD_CMask) |
@@ -309,7 +309,7 @@ static int a2232_set_real_termios(void *ptr)
309 volatile struct a2232status *status; 309 volatile struct a2232status *status;
310 volatile struct a2232memory *mem; 310 volatile struct a2232memory *mem;
311 311
312 if (!port->gs.tty || !port->gs.tty->termios) return 0; 312 if (!port->gs.port.tty || !port->gs.port.tty->termios) return 0;
313 313
314 status = a2232stat(port->which_a2232, port->which_port_on_a2232); 314 status = a2232stat(port->which_a2232, port->which_port_on_a2232);
315 mem = a2232mem(port->which_a2232); 315 mem = a2232mem(port->which_a2232);
@@ -345,7 +345,7 @@ static int a2232_set_real_termios(void *ptr)
345 } 345 }
346 a2232_param |= rate; 346 a2232_param |= rate;
347 347
348 cflag = port->gs.tty->termios->c_cflag; 348 cflag = port->gs.port.tty->termios->c_cflag;
349 349
350 // get character size 350 // get character size
351 chsize = cflag & CSIZE; 351 chsize = cflag & CSIZE;
@@ -382,7 +382,7 @@ static int a2232_set_real_termios(void *ptr)
382 the conventional way of inserting START/STOP characters 382 the conventional way of inserting START/STOP characters
383 by hand in throttle()/unthrottle(). 383 by hand in throttle()/unthrottle().
384 */ 384 */
385 softflow = !!( port->gs.tty->termios->c_iflag & IXOFF ); 385 softflow = !!( port->gs.port.tty->termios->c_iflag & IXOFF );
386 386
387 // get Parity (Enabled/Disabled? If Enabled, Odd or Even?) 387 // get Parity (Enabled/Disabled? If Enabled, Odd or Even?)
388 parity = cflag & (PARENB | PARODD); 388 parity = cflag & (PARENB | PARODD);
@@ -400,9 +400,9 @@ static int a2232_set_real_termios(void *ptr)
400 /* Hmm. Maybe an own a2232_port structure 400 /* Hmm. Maybe an own a2232_port structure
401 member would be cleaner? */ 401 member would be cleaner? */
402 if (cflag & CLOCAL) 402 if (cflag & CLOCAL)
403 port->gs.flags &= ~ASYNC_CHECK_CD; 403 port->gs.port.flags &= ~ASYNC_CHECK_CD;
404 else 404 else
405 port->gs.flags |= ASYNC_CHECK_CD; 405 port->gs.port.flags |= ASYNC_CHECK_CD;
406 406
407 407
408 /* Now we have all parameters and can go to set them: */ 408 /* Now we have all parameters and can go to set them: */
@@ -482,18 +482,18 @@ static int a2232_open(struct tty_struct * tty, struct file * filp)
482 port = &a2232_ports[line]; 482 port = &a2232_ports[line];
483 483
484 tty->driver_data = port; 484 tty->driver_data = port;
485 port->gs.tty = tty; 485 port->gs.port.tty = tty;
486 port->gs.count++; 486 port->gs.port.count++;
487 retval = gs_init_port(&port->gs); 487 retval = gs_init_port(&port->gs);
488 if (retval) { 488 if (retval) {
489 port->gs.count--; 489 port->gs.port.count--;
490 return retval; 490 return retval;
491 } 491 }
492 port->gs.flags |= GS_ACTIVE; 492 port->gs.port.flags |= GS_ACTIVE;
493 retval = gs_block_til_ready(port, filp); 493 retval = gs_block_til_ready(port, filp);
494 494
495 if (retval) { 495 if (retval) {
496 port->gs.count--; 496 port->gs.port.count--;
497 return retval; 497 return retval;
498 } 498 }
499 499
@@ -522,7 +522,7 @@ int ch, err, n, p;
522 for (p = 0; p < NUMLINES; p++){ /* for every port on this board */ 522 for (p = 0; p < NUMLINES; p++){ /* for every port on this board */
523 err = 0; 523 err = 0;
524 port = &a2232_ports[n*NUMLINES+p]; 524 port = &a2232_ports[n*NUMLINES+p];
525 if ( port->gs.flags & GS_ACTIVE ){ /* if the port is used */ 525 if ( port->gs.port.flags & GS_ACTIVE ){ /* if the port is used */
526 526
527 status = a2232stat(n,p); 527 status = a2232stat(n,p);
528 528
@@ -577,8 +577,8 @@ int ch, err, n, p;
577 obuf = mem->OutBuf[p]; 577 obuf = mem->OutBuf[p];
578 bufpos = status->OutHead; 578 bufpos = status->OutHead;
579 while ( (port->gs.xmit_cnt > 0) && 579 while ( (port->gs.xmit_cnt > 0) &&
580 (!port->gs.tty->stopped) && 580 (!port->gs.port.tty->stopped) &&
581 (!port->gs.tty->hw_stopped) ){ /* While there are chars to transmit */ 581 (!port->gs.port.tty->hw_stopped) ){ /* While there are chars to transmit */
582 if (((bufpos+1) & A2232_IOBUFLENMASK) != status->OutTail) { /* If the A2232 buffer is not full */ 582 if (((bufpos+1) & A2232_IOBUFLENMASK) != status->OutTail) { /* If the A2232 buffer is not full */
583 ch = port->gs.xmit_buf[port->gs.xmit_tail]; /* get the next char to transmit */ 583 ch = port->gs.xmit_buf[port->gs.xmit_tail]; /* get the next char to transmit */
584 port->gs.xmit_tail = (port->gs.xmit_tail+1) & (SERIAL_XMIT_SIZE-1); /* modulo-addition for the gs.xmit_buf ring-buffer */ 584 port->gs.xmit_tail = (port->gs.xmit_tail+1) & (SERIAL_XMIT_SIZE-1); /* modulo-addition for the gs.xmit_buf ring-buffer */
@@ -592,8 +592,8 @@ int ch, err, n, p;
592 status->OutHead = bufpos; 592 status->OutHead = bufpos;
593 593
594 /* WakeUp if output buffer runs low */ 594 /* WakeUp if output buffer runs low */
595 if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.tty) { 595 if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.port.tty) {
596 tty_wakeup(port->gs.tty); 596 tty_wakeup(port->gs.port.tty);
597 } 597 }
598 } // if the port is used 598 } // if the port is used
599 } // for every port on the board 599 } // for every port on the board
@@ -613,16 +613,16 @@ int ch, err, n, p;
613 struct a2232_port *port = &a2232_ports[n*7+p]; 613 struct a2232_port *port = &a2232_ports[n*7+p];
614 port->cd_status = !(ncd & 1); /* ncd&1 <=> CD is now off */ 614 port->cd_status = !(ncd & 1); /* ncd&1 <=> CD is now off */
615 615
616 if (!(port->gs.flags & ASYNC_CHECK_CD)) 616 if (!(port->gs.port.flags & ASYNC_CHECK_CD))
617 ; /* Don't report DCD changes */ 617 ; /* Don't report DCD changes */
618 else if (port->cd_status) { // if DCD on: DCD went UP! 618 else if (port->cd_status) { // if DCD on: DCD went UP!
619 619
620 /* Are we blocking in open?*/ 620 /* Are we blocking in open?*/
621 wake_up_interruptible(&port->gs.open_wait); 621 wake_up_interruptible(&port->gs.port.open_wait);
622 } 622 }
623 else { // if DCD off: DCD went DOWN! 623 else { // if DCD off: DCD went DOWN!
624 if (port->gs.tty) 624 if (port->gs.port.tty)
625 tty_hangup (port->gs.tty); 625 tty_hangup (port->gs.port.tty);
626 } 626 }
627 627
628 } // if CD changed for this port 628 } // if CD changed for this port
@@ -655,8 +655,8 @@ static void a2232_init_portstructs(void)
655#ifdef NEW_WRITE_LOCKING 655#ifdef NEW_WRITE_LOCKING
656 mutex_init(&(port->gs.port_write_mutex)); 656 mutex_init(&(port->gs.port_write_mutex));
657#endif 657#endif
658 init_waitqueue_head(&port->gs.open_wait); 658 init_waitqueue_head(&port->gs.port.open_wait);
659 init_waitqueue_head(&port->gs.close_wait); 659 init_waitqueue_head(&port->gs.port.close_wait);
660 } 660 }
661} 661}
662 662