linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PROBLEM] ircomm ioctls
@ 2004-01-13 11:00 Jozef Vesely
  2004-01-13 11:36 ` Russell King
  0 siblings, 1 reply; 22+ messages in thread
From: Jozef Vesely @ 2004-01-13 11:00 UTC (permalink / raw)
  To: irda-users; +Cc: linux-kernel

Hi,

since upgrading to the 2.6.1 (from 2.4.22)

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)
------

the code in: gsmlib-1.10/gsmlib/gsm_unix_serial.cc
------
    // toggle DTR to reset modem
    int mctl = TIOCM_DTR;
    if (ioctl(_fd, TIOCMBIC, &mctl) < 0)
      throwModemException(_("clearing DTR failed"));
    // the waiting time for DTR toggling is increased with each loop
    usleep(holdoff[initTries]);
    if (ioctl(_fd, TIOCMBIS, &mctl) < 0)
      throwModemException(_("setting DTR failed"));
------

pointed me to tke kernel:
the ioctls TIOCMBIC, TIOCMBIS, TIOCMSET and TIOCMGET are handled both in

net/irda/ircomm/ircomm_tty_ioctl.c  function  ircomm_tty_ioctl()
-----
       switch (cmd) {
        case TIOCMGET:
                ret = ircomm_tty_get_modem_info(self, (unsigned int *) arg);
                break;
        case TIOCMBIS:
        case TIOCMBIC:
        case TIOCMSET:
                ret = ircomm_tty_set_modem_info(self, cmd, (unsigned int *) arg);
                break;
-----

and in
drivers/char/tty_io.c function tty_ioctl()
-----
      switch (cmd) {
...
                case TIOCMGET:
                        return tty_tiocmget(tty, file, arg);

                case TIOCMSET:
                case TIOCMBIC:
                case TIOCMBIS:
                        return tty_tiocmset(tty, file, cmd, arg);
        }
        if (tty->driver->ioctl) {
                int retval = (tty->driver->ioctl)(tty, file, cmd, arg);
                if (retval != -ENOIOCTLCMD)
                        return retval;
        }
-----

The tty_tiocmset() checks for driver->tiocmset and calls it. In case
of ircomm driver->tiocmset is not set since those ioctls are meant
to be handled by driver->ioctl, however tty_tiocmset returns with -EINVAL
and driver->ioctl never gets called.

I am beginner in the kernel programing, and therefore I would rather let more
experienced to create the patch (I don't want to mess up something).

I hope this descrition would be helpful, and somebody fixes the problem.

Thank you in advance

Jozef Vesely
vesely@gjh.sk




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

end of thread, other threads:[~2004-01-25 21:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-13 11:00 [PROBLEM] ircomm ioctls Jozef Vesely
2004-01-13 11:36 ` Russell King
2004-01-13 11:49   ` Outstanding fixups (was: Re: [PROBLEM] ircomm ioctls) Russell King
2004-01-13 17:15     ` Russell King
2004-01-13 17:24       ` [1/3] Serial fixups (mostly tested) Russell King
2004-01-24  6:16         ` [lkml] pseudo tty / kernel compile question Karl Tatgenhorst
2004-01-25 21:53           ` David Woodhouse
2004-01-13 17:33       ` [2/3] Russell King
2004-01-13 17:55         ` [2/3] Henrique Oliveira
2004-01-13 18:53           ` [2/3] John Stoffel
2004-01-13 22:15         ` [2/3] Paul Mackerras
2004-01-14  7:01           ` [2/3] Benjamin Herrenschmidt
2004-01-16 11:34             ` [2/3] Matthias Urlichs
2004-01-16  0:54         ` [2/3] Greg KH
2004-01-18 12:43         ` [2/3] Greg Ungerer
2004-01-18 15:42           ` [2/3] Russell King
2004-01-18 23:23             ` [2/3] Greg Ungerer
2004-01-13 17:42       ` [3/3] 2.6 broken serial drivers Russell King
2004-01-13 20:21         ` Andrew Morton
2004-01-13 21:10           ` Russell King
2004-01-18 16:16             ` Russell King
2004-01-14 12:42         ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).