[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bluetooth-dev] kernel mode on ARM+kernel2.4 : ppp problem fi xed.

> > However, except for the missing check of the ioctl function 
> (!=NULL) I
> > cannot see why your code should react strangely on the 
> forwarding of the
> > ioctl. If the forwarded ioctl is not destined for the 
> serial driver either
> > it will just reply with the same error code as the default 
> case in bt_ioctl
> It is not my code that is reacting strangely, but the pppd 
> code. As I said 
> forwarding the ioctl directly to the serial driver prevents 
> tty_io.c to call 
> the line discipline, causing pppd not to work. Please, have a 
> look at how an 
> ioctl is handled by a tty device (file driver/char/tty_io.c) 
> in 2.4 kernel.

From tty_io.c, default case in function tty_ioctl :
	 if (tty->driver.ioctl) {
		 retval = (tty->driver.ioctl)(tty, file,
					      cmd, arg);
		 /* if the ioctl is not for the driver (BT driver) it is forwarded to 
		    the BT lower driver (serial). If this lower driver doesn't
		    recognize it either, -ENOIOCTLCMD will be returned (indirectly) 
	          which makes the next if-statement false and we proceed to the line

		    tty_ioctl()->tty->driver.ioctl() = bt_ioctl -> sertty->driver.ioctl = 
		    rs_ioctl -> return default case = -ENOIOCTLCMD */

		 if (retval != -ENOIOCTLCMD)
			 return retval;

	 if (tty->ldisc.ioctl) {
		 retval = (tty->ldisc.ioctl)(tty, file,
					     cmd, arg);
		 if (retval != -ENOIOCTLCMD)
			 return retval;
	 return -EINVAL;


To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com