public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nozomi DTR/RTS
@ 2007-08-24 10:02 Eric Lammerts
  2007-08-24 10:45 ` Alan Cox
  2007-09-09 16:26 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Lammerts @ 2007-08-24 10:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: p.hardwick, greg, akpm

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

Hi,
I noticed that DTR toggling doesn't work with the nozomi driver 
(TIOCMBIS/TIOCMBIC ioctls have no effect). This is a nuisance because 
that makes it hard to get the modem back in command mode.

Attached patch adds a tty_ops->tiocmset function that makes it work.

Should we also rip out the TIOCMBIS/TIOCMBIC handling in ntty_ioctl()? 
It doesn't seem to be used anyway.

Patch is against 2.6.23-rc3-mm1, but not tested with that. I tested it 
with 2.6.18.4 and the pharscape.org driver.

Eric

[-- Attachment #2: nozomi-dtr-patch-2.6.23-rc3-mm1 --]
[-- Type: text/plain, Size: 1288 bytes --]

--- linux-2.6.23-rc3-mm1/drivers/char/nozomi.c.orig	2007-08-24 05:39:06.000000000 -0400
+++ linux-2.6.23-rc3-mm1/drivers/char/nozomi.c	2007-08-24 05:41:07.000000000 -0400
@@ -1930,12 +1930,16 @@
 }
 
 /* Sets io controls parameters */
-static int ntty_tiocmset(struct tty_struct *tty, struct file *file, u32 arg)
+static int ntty_tiocmset(struct tty_struct *tty, struct file *file,
+	unsigned int set, unsigned int clear)
 {
 	struct port *port = (struct port *)tty->driver_data;
 
-	set_rts(port->tty_index, (arg & TIOCM_RTS) ? 1 : 0);
-	set_dtr(port->tty_index, (arg & TIOCM_DTR) ? 1 : 0);
+	if(set & TIOCM_RTS) set_rts(port->tty_index, 1);
+	else if(clear & TIOCM_RTS) set_rts(port->tty_index, 0);
+	
+	if(set & TIOCM_DTR) set_dtr(port->tty_index, 1);
+	else if(clear & TIOCM_DTR) set_dtr(port->tty_index, 0);
 
 	return 0;
 }
@@ -2039,7 +2043,7 @@
 		spin_unlock_irqrestore(&dc->spin_mutex, flags);
 		break;
 	case TIOCMSET:
-		rval = ntty_tiocmset(tty, file, arg);
+		rval = ntty_tiocmset(tty, file, arg, ~arg);
 		break;
 	case TIOCMBIC:
 		if (get_user(mask, (unsigned long __user *)arg))
@@ -2152,6 +2156,7 @@
 	.set_termios = ntty_set_termios,
 	.chars_in_buffer = ntty_chars_in_buffer,
 	.put_char = ntty_put_char,
+	.tiocmset = ntty_tiocmset,
 };
 
 /* Initializes the tty */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nozomi DTR/RTS
  2007-08-24 10:02 [PATCH] nozomi DTR/RTS Eric Lammerts
@ 2007-08-24 10:45 ` Alan Cox
  2007-09-09 16:26 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2007-08-24 10:45 UTC (permalink / raw)
  To: Eric Lammerts; +Cc: linux-kernel, p.hardwick, greg, akpm

> Attached patch adds a tty_ops->tiocmset function that makes it work.
> 
> Should we also rip out the TIOCMBIS/TIOCMBIC handling in ntty_ioctl()? 
> It doesn't seem to be used anyway.

Yes - its bogus.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nozomi DTR/RTS
  2007-08-24 10:02 [PATCH] nozomi DTR/RTS Eric Lammerts
  2007-08-24 10:45 ` Alan Cox
@ 2007-09-09 16:26 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2007-09-09 16:26 UTC (permalink / raw)
  To: Eric Lammerts; +Cc: linux-kernel, p.hardwick, akpm

On Fri, Aug 24, 2007 at 12:02:40PM +0200, Eric Lammerts wrote:
> Hi,
> I noticed that DTR toggling doesn't work with the nozomi driver 
> (TIOCMBIS/TIOCMBIC ioctls have no effect). This is a nuisance because that 
> makes it hard to get the modem back in command mode.
>
> Attached patch adds a tty_ops->tiocmset function that makes it work.
>
> Should we also rip out the TIOCMBIS/TIOCMBIC handling in ntty_ioctl()? It 
> doesn't seem to be used anyway.
>
> Patch is against 2.6.23-rc3-mm1, but not tested with that. I tested it with 
> 2.6.18.4 and the pharscape.org driver.

Thanks, I've updated the driver in -mm with these changes.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-09 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-24 10:02 [PATCH] nozomi DTR/RTS Eric Lammerts
2007-08-24 10:45 ` Alan Cox
2007-09-09 16:26 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox