aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-16 16:55:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:12:36 -0400
commitb5391e29f428d11755ca2c91074c6db6f5c69d7c (patch)
treec7d98ff50e5f22569290066ecb33077a7a3165b5 /drivers/char/rio
parent4982d6b37a5ccebe6c2af79970c7a15c1939243a (diff)
gs: use tty_port
Switch drivers using the old "generic serial" driver to use the tty_port structures Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/rio')
-rw-r--r--drivers/char/rio/rio_linux.c20
-rw-r--r--drivers/char/rio/riocmd.c10
-rw-r--r--drivers/char/rio/riointr.c10
-rw-r--r--drivers/char/rio/rioparam.c2
-rw-r--r--drivers/char/rio/riotty.c16
5 files changed, 29 insertions, 29 deletions
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index e49e6e6372f3..0cdfee152916 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -431,7 +431,7 @@ static void rio_disable_tx_interrupts(void *ptr)
431{ 431{
432 func_enter(); 432 func_enter();
433 433
434 /* port->gs.flags &= ~GS_TX_INTEN; */ 434 /* port->gs.port.flags &= ~GS_TX_INTEN; */
435 435
436 func_exit(); 436 func_exit();
437} 437}
@@ -455,7 +455,7 @@ static void rio_enable_tx_interrupts(void *ptr)
455 * In general we cannot count on "tx empty" interrupts, although 455 * In general we cannot count on "tx empty" interrupts, although
456 * the interrupt routine seems to be able to tell the difference. 456 * the interrupt routine seems to be able to tell the difference.
457 */ 457 */
458 PortP->gs.flags &= ~GS_TX_INTEN; 458 PortP->gs.port.flags &= ~GS_TX_INTEN;
459 459
460 func_exit(); 460 func_exit();
461} 461}
@@ -510,7 +510,7 @@ static void rio_shutdown_port(void *ptr)
510 func_enter(); 510 func_enter();
511 511
512 PortP = (struct Port *) ptr; 512 PortP = (struct Port *) ptr;
513 PortP->gs.tty = NULL; 513 PortP->gs.port.tty = NULL;
514 func_exit(); 514 func_exit();
515} 515}
516 516
@@ -529,7 +529,7 @@ static void rio_hungup(void *ptr)
529 func_enter(); 529 func_enter();
530 530
531 PortP = (struct Port *) ptr; 531 PortP = (struct Port *) ptr;
532 PortP->gs.tty = NULL; 532 PortP->gs.port.tty = NULL;
533 533
534 func_exit(); 534 func_exit();
535} 535}
@@ -549,12 +549,12 @@ static void rio_close(void *ptr)
549 549
550 riotclose(ptr); 550 riotclose(ptr);
551 551
552 if (PortP->gs.count) { 552 if (PortP->gs.port.count) {
553 printk(KERN_ERR "WARNING port count:%d\n", PortP->gs.count); 553 printk(KERN_ERR "WARNING port count:%d\n", PortP->gs.port.count);
554 PortP->gs.count = 0; 554 PortP->gs.port.count = 0;
555 } 555 }
556 556
557 PortP->gs.tty = NULL; 557 PortP->gs.port.tty = NULL;
558 func_exit(); 558 func_exit();
559} 559}
560 560
@@ -849,8 +849,8 @@ static int rio_init_datastructures(void)
849 /* 849 /*
850 * Initializing wait queue 850 * Initializing wait queue
851 */ 851 */
852 init_waitqueue_head(&port->gs.open_wait); 852 init_waitqueue_head(&port->gs.port.open_wait);
853 init_waitqueue_head(&port->gs.close_wait); 853 init_waitqueue_head(&port->gs.port.close_wait);
854 } 854 }
855#else 855#else
856 /* We could postpone initializing them to when they are configured. */ 856 /* We could postpone initializing them to when they are configured. */
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 391f0b4da7ea..01f2654d5a2e 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -484,12 +484,12 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc
484 ** If the device is a modem, then check the modem 484 ** If the device is a modem, then check the modem
485 ** carrier. 485 ** carrier.
486 */ 486 */
487 if (PortP->gs.tty == NULL) 487 if (PortP->gs.port.tty == NULL)
488 break; 488 break;
489 if (PortP->gs.tty->termios == NULL) 489 if (PortP->gs.port.tty->termios == NULL)
490 break; 490 break;
491 491
492 if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) && ((PortP->State & (RIO_MOPEN | RIO_WOPEN)))) { 492 if (!(PortP->gs.port.tty->termios->c_cflag & CLOCAL) && ((PortP->State & (RIO_MOPEN | RIO_WOPEN)))) {
493 493
494 rio_dprintk(RIO_DEBUG_CMD, "Is there a Carrier?\n"); 494 rio_dprintk(RIO_DEBUG_CMD, "Is there a Carrier?\n");
495 /* 495 /*
@@ -506,7 +506,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc
506 ** wakeup anyone in WOPEN 506 ** wakeup anyone in WOPEN
507 */ 507 */
508 if (PortP->State & (PORT_ISOPEN | RIO_WOPEN)) 508 if (PortP->State & (PORT_ISOPEN | RIO_WOPEN))
509 wake_up_interruptible(&PortP->gs.open_wait); 509 wake_up_interruptible(&PortP->gs.port.open_wait);
510 } 510 }
511 } else { 511 } else {
512 /* 512 /*
@@ -514,7 +514,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc
514 */ 514 */
515 if (PortP->State & RIO_CARR_ON) { 515 if (PortP->State & RIO_CARR_ON) {
516 if (PortP->State & (PORT_ISOPEN | RIO_WOPEN | RIO_MOPEN)) 516 if (PortP->State & (PORT_ISOPEN | RIO_WOPEN | RIO_MOPEN))
517 tty_hangup(PortP->gs.tty); 517 tty_hangup(PortP->gs.port.tty);
518 PortP->State &= ~RIO_CARR_ON; 518 PortP->State &= ~RIO_CARR_ON;
519 rio_dprintk(RIO_DEBUG_CMD, "Carrirer just went down\n"); 519 rio_dprintk(RIO_DEBUG_CMD, "Carrirer just went down\n");
520 } 520 }
diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c
index 11c7987821c4..71f87600907c 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/char/rio/riointr.c
@@ -102,7 +102,7 @@ void RIOTxEnable(char *en)
102 102
103 PortP = (struct Port *) en; 103 PortP = (struct Port *) en;
104 p = (struct rio_info *) PortP->p; 104 p = (struct rio_info *) PortP->p;
105 tty = PortP->gs.tty; 105 tty = PortP->gs.port.tty;
106 106
107 107
108 rio_dprintk(RIO_DEBUG_INTR, "tx port %d: %d chars queued.\n", PortP->PortNum, PortP->gs.xmit_cnt); 108 rio_dprintk(RIO_DEBUG_INTR, "tx port %d: %d chars queued.\n", PortP->PortNum, PortP->gs.xmit_cnt);
@@ -158,7 +158,7 @@ void RIOTxEnable(char *en)
158 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 158 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
159 159
160 if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN)) 160 if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN))
161 tty_wakeup(PortP->gs.tty); 161 tty_wakeup(PortP->gs.port.tty);
162 162
163} 163}
164 164
@@ -241,7 +241,7 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP)
241 ** find corresponding tty structure. The process of mapping 241 ** find corresponding tty structure. The process of mapping
242 ** the ports puts these here. 242 ** the ports puts these here.
243 */ 243 */
244 ttyP = PortP->gs.tty; 244 ttyP = PortP->gs.port.tty;
245 245
246 /* 246 /*
247 ** Lock the port before we begin working on it. 247 ** Lock the port before we begin working on it.
@@ -335,7 +335,7 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP)
335 ** find corresponding tty structure. The process of mapping 335 ** find corresponding tty structure. The process of mapping
336 ** the ports puts these here. 336 ** the ports puts these here.
337 */ 337 */
338 ttyP = PortP->gs.tty; 338 ttyP = PortP->gs.port.tty;
339 /* If ttyP is NULL, the port is getting closed. Forget about it. */ 339 /* If ttyP is NULL, the port is getting closed. Forget about it. */
340 if (!ttyP) { 340 if (!ttyP) {
341 rio_dprintk(RIO_DEBUG_INTR, "no tty, so skipping.\n"); 341 rio_dprintk(RIO_DEBUG_INTR, "no tty, so skipping.\n");
@@ -542,7 +542,7 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
542 542
543 intCount++; 543 intCount++;
544 544
545 TtyP = PortP->gs.tty; 545 TtyP = PortP->gs.port.tty;
546 if (!TtyP) { 546 if (!TtyP) {
547 rio_dprintk(RIO_DEBUG_INTR, "RIOReceive: tty is null. \n"); 547 rio_dprintk(RIO_DEBUG_INTR, "RIOReceive: tty is null. \n");
548 return; 548 return;
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c
index 447ca34a6a72..d687c17be152 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/char/rio/rioparam.c
@@ -160,7 +160,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
160 160
161 func_enter(); 161 func_enter();
162 162
163 TtyP = PortP->gs.tty; 163 TtyP = PortP->gs.port.tty;
164 164
165 rio_dprintk(RIO_DEBUG_PARAM, "RIOParam: Port:%d cmd:%d Modem:%d SleepFlag:%d Mapped: %d, tty=%p\n", PortP->PortNum, cmd, Modem, SleepFlag, PortP->Mapped, TtyP); 165 rio_dprintk(RIO_DEBUG_PARAM, "RIOParam: Port:%d cmd:%d Modem:%d SleepFlag:%d Mapped: %d, tty=%p\n", PortP->PortNum, cmd, Modem, SleepFlag, PortP->Mapped, TtyP);
166 166
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index 95a88a4138e8..2fb49e89b324 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -140,14 +140,14 @@ int riotopen(struct tty_struct *tty, struct file *filp)
140 140
141 tty->driver_data = PortP; 141 tty->driver_data = PortP;
142 142
143 PortP->gs.tty = tty; 143 PortP->gs.port.tty = tty;
144 PortP->gs.count++; 144 PortP->gs.port.count++;
145 145
146 rio_dprintk(RIO_DEBUG_TTY, "%d bytes in tx buffer\n", PortP->gs.xmit_cnt); 146 rio_dprintk(RIO_DEBUG_TTY, "%d bytes in tx buffer\n", PortP->gs.xmit_cnt);
147 147
148 retval = gs_init_port(&PortP->gs); 148 retval = gs_init_port(&PortP->gs);
149 if (retval) { 149 if (retval) {
150 PortP->gs.count--; 150 PortP->gs.port.count--;
151 return -ENXIO; 151 return -ENXIO;
152 } 152 }
153 /* 153 /*
@@ -293,7 +293,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
293 ** insert test for carrier here. -- ??? 293 ** insert test for carrier here. -- ???
294 ** I already see that test here. What's the deal? -- REW 294 ** I already see that test here. What's the deal? -- REW
295 */ 295 */
296 if ((PortP->gs.tty->termios->c_cflag & CLOCAL) || 296 if ((PortP->gs.port.tty->termios->c_cflag & CLOCAL) ||
297 (PortP->ModemState & RIOC_MSVR1_CD)) { 297 (PortP->ModemState & RIOC_MSVR1_CD)) {
298 rio_dprintk(RIO_DEBUG_TTY, "open(%d) Modem carr on\n", SysPort); 298 rio_dprintk(RIO_DEBUG_TTY, "open(%d) Modem carr on\n", SysPort);
299 /* 299 /*
@@ -301,16 +301,16 @@ int riotopen(struct tty_struct *tty, struct file *filp)
301 wakeup((caddr_t) &tp->tm.c_canq); 301 wakeup((caddr_t) &tp->tm.c_canq);
302 */ 302 */
303 PortP->State |= RIO_CARR_ON; 303 PortP->State |= RIO_CARR_ON;
304 wake_up_interruptible(&PortP->gs.open_wait); 304 wake_up_interruptible(&PortP->gs.port.open_wait);
305 } else { /* no carrier - wait for DCD */ 305 } else { /* no carrier - wait for DCD */
306 /* 306 /*
307 while (!(PortP->gs.tty->termios->c_state & CARR_ON) && 307 while (!(PortP->gs.port.tty->termios->c_state & CARR_ON) &&
308 !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted ) 308 !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted )
309 */ 309 */
310 while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) { 310 while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) {
311 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort); 311 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort);
312 /* 312 /*
313 PortP->gs.tty->termios->c_state |= WOPEN; 313 PortP->gs.port.tty->termios->c_state |= WOPEN;
314 */ 314 */
315 PortP->State |= RIO_WOPEN; 315 PortP->State |= RIO_WOPEN;
316 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 316 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
@@ -380,7 +380,7 @@ int riotclose(void *ptr)
380 /* PortP = p->RIOPortp[SysPort]; */ 380 /* PortP = p->RIOPortp[SysPort]; */
381 rio_dprintk(RIO_DEBUG_TTY, "Port is at address %p\n", PortP); 381 rio_dprintk(RIO_DEBUG_TTY, "Port is at address %p\n", PortP);
382 /* tp = PortP->TtyP; *//* Get tty */ 382 /* tp = PortP->TtyP; *//* Get tty */
383 tty = PortP->gs.tty; 383 tty = PortP->gs.port.tty;
384 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address %p\n", tty); 384 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address %p\n", tty);
385 385
386 if (PortP->gs.closing_wait) 386 if (PortP->gs.closing_wait)