Skip to contentSkip to conversation

ircomm ioctls

PROBLEM Jean Tourrilhes 2 participants 5 messages Jan 13, 2004 – Jan 14, 2004 Networking

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · Russell King
Quoted 5 lines · Jozef Vesely

I am gettig this error (while connecting to my mobile phone):
------

# gsmctl -d /dev/ircomm0  ALL
gsmctl[ERROR]: clearing DTR failed (errno: 22/Invalid argument)
------

ircomm needs updating to use the tiocmset/tiocmget driver calls. Could you see if the following patch solves your problem please?

Good catch. Is there any other API changes worth looking into ?

By the way, I would rather keep the function
ircomm_tty_tiocmget() and ircomm_tty_tiocmset() in ircomm_tty_ioctl.c, because ircomm_tty.c is already big and messy.
Check the patch below (quickly tested).

Thanks !

Jean

---------------------------------------------------------------------

include/net/irda/ircomm_tty.h renamed from include/net/irda/ircomm_tty.d5.h +3 -0
diff -u -p linux/include/net/irda/ircomm_tty.d5.h linux/include/net/irda/ircomm_tty.h
@@ -122,6 +122,9 @@ void ircomm_tty_stop(struct tty_struct *
 void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self);
 
 extern void ircomm_tty_change_speed(struct ircomm_tty_cb *self);
+extern int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file);
+extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
+			       unsigned int set, unsigned int clear);
 extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 
 			    unsigned int cmd, unsigned long arg);
 extern void ircomm_tty_set_termios(struct tty_struct *tty, 
net/irda/ircomm/ircomm_tty.c renamed from net/irda/ircomm/ircomm_tty.d5.c +3 -1
diff -u -p linux/net/irda/ircomm/ircomm_tty.d5.c linux/net/irda/ircomm/ircomm_tty.c
@@ -86,7 +86,9 @@ static struct tty_operations ops = {
 	.write_room      = ircomm_tty_write_room,
 	.chars_in_buffer = ircomm_tty_chars_in_buffer,
 	.flush_buffer    = ircomm_tty_flush_buffer,
-	.ioctl           = ircomm_tty_ioctl,
+	.ioctl           = ircomm_tty_ioctl,	/* ircomm_tty_ioctl.c */
+	.tiocmget        = ircomm_tty_tiocmget,	/* ircomm_tty_ioctl.c */
+	.tiocmset        = ircomm_tty_tiocmset,	/* ircomm_tty_ioctl.c */
 	.throttle        = ircomm_tty_throttle,
 	.unthrottle      = ircomm_tty_unthrottle,
 	.send_xchar      = ircomm_tty_send_xchar,
net/irda/ircomm/ircomm_tty_ioctl.c renamed from net/irda/ircomm/ircomm_tty_ioctl.d5.c +19 -51

109 lines not on this page · raw message

#1 lore raw
Quoted 11 lines · Jean Tourrilhes
Quoted 9 lines · Russell King
Quoted 5 lines · Jozef Vesely

I am gettig this error (while connecting to my mobile phone):
------

# gsmctl -d /dev/ircomm0  ALL
gsmctl[ERROR]: clearing DTR failed (errno: 22/Invalid argument)
------

ircomm needs updating to use the tiocmset/tiocmget driver calls. Could you see if the following patch solves your problem please?

Quoted 6 lines

Good catch. Is there any other API changes worth looking into ?

By the way, I would rather keep the function
ircomm_tty_tiocmget() and ircomm_tty_tiocmset() in ircomm_tty_ioctl.c, because ircomm_tty.c is already big and messy.
Check the patch below (quickly tested).

I think this patch is missing some of the error checking (TTY_IO_ERROR) which I included in my later patch.

Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core
#2 lore raw
Quoted 9 lines · Russell King
Quoted 5 lines · Jean Tourrilhes

By the way, I would rather keep the function
ircomm_tty_tiocmget() and ircomm_tty_tiocmset() in ircomm_tty_ioctl.c, because ircomm_tty.c is already big and messy.
Check the patch below (quickly tested).

I think this patch is missing some of the error checking (TTY_IO_ERROR) which I included in my later patch.

Oh well... I probably missed your subsequent patch. Sorry
about that.
I used this patch of yours :
http://marc.theaimsgroup.com/?l=linux-kernel&m=107399412221312&w=2

Quoted 1 line

Russell King

Thanks, and have fun...

Jean

#3 lore raw
In reply to Russell King
Quoted 14 lines · Russell King
Quoted 13 lines · Jean Tourrilhes
Quoted 9 lines · Russell King
Quoted 5 lines · Jozef Vesely

I am gettig this error (while connecting to my mobile phone):
------

# gsmctl -d /dev/ircomm0  ALL
gsmctl[ERROR]: clearing DTR failed (errno: 22/Invalid argument)
------

ircomm needs updating to use the tiocmset/tiocmget driver calls. Could you see if the following patch solves your problem please?

Good catch. Is there any other API changes worth looking into ?

Quoted 7 lines
Quoted 4 lines

By the way, I would rather keep the function
ircomm_tty_tiocmget() and ircomm_tty_tiocmset() in ircomm_tty_ioctl.c, because ircomm_tty.c is already big and messy.
Check the patch below (quickly tested).

I think this patch is missing some of the error checking (TTY_IO_ERROR) which I included in my later patch.

Gotcha. Thanks. The patch would look like attached.

By the way, are you sending this patch as part of your mega
patch or do you want me to send it ? I just want to avoid patch collision ;-)

	Thanks...

	Jean

--------------------------------------------------------------

include/net/irda/ircomm_tty.h renamed from include/net/irda/ircomm_tty.d5.h +3 -0
diff -u -p linux/include/net/irda/ircomm_tty.d5.h linux/include/net/irda/ircomm_tty.h
@@ -122,6 +122,9 @@ void ircomm_tty_stop(struct tty_struct *
 void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self);
 
 extern void ircomm_tty_change_speed(struct ircomm_tty_cb *self);
+extern int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file);
+extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
+			       unsigned int set, unsigned int clear);
 extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 
 			    unsigned int cmd, unsigned long arg);
 extern void ircomm_tty_set_termios(struct tty_struct *tty, 
net/irda/ircomm/ircomm_tty.c renamed from net/irda/ircomm/ircomm_tty.d5.c +3 -1
diff -u -p linux/net/irda/ircomm/ircomm_tty.d5.c linux/net/irda/ircomm/ircomm_tty.c
@@ -86,7 +86,9 @@ static struct tty_operations ops = {
 	.write_room      = ircomm_tty_write_room,
 	.chars_in_buffer = ircomm_tty_chars_in_buffer,
 	.flush_buffer    = ircomm_tty_flush_buffer,
-	.ioctl           = ircomm_tty_ioctl,
+	.ioctl           = ircomm_tty_ioctl,	/* ircomm_tty_ioctl.c */
+	.tiocmget        = ircomm_tty_tiocmget,	/* ircomm_tty_ioctl.c */
+	.tiocmset        = ircomm_tty_tiocmset,	/* ircomm_tty_ioctl.c */
 	.throttle        = ircomm_tty_throttle,
 	.unthrottle      = ircomm_tty_unthrottle,
 	.send_xchar      = ircomm_tty_send_xchar,
net/irda/ircomm/ircomm_tty_ioctl.c renamed from net/irda/ircomm/ircomm_tty_ioctl.d5.c +25 -52

120 lines not on this page · raw message

#4 lore raw
Quoted 3 lines · Jean Tourrilhes

By the way, are you sending this patch as part of your mega
patch or do you want me to send it ? I just want to avoid patch collision ;-)

I'd prefer these patches to go via the maintainers themselves. Also, the patch looks fine from my perspective.

Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core