Re: Problem with tcgetattr
From: Laurent H. (l.huge_at_nospam.wanadoo.fr)
Date: 09/06/03
- Next message: Laurent H.: "Re: Problem with tcgetattr"
- Previous message: Peter T. Breuer: "Re: Problem with tcgetattr"
- In reply to: Peter T. Breuer: "Re: Problem with tcgetattr"
- Next in thread: Laurent H.: "Re: Problem with tcgetattr"
- Reply: Laurent H.: "Re: Problem with tcgetattr"
- Reply: Peter T. Breuer: "Re: Problem with tcgetattr"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 06 Sep 2003 11:27:07 +0200
Peter T. Breuer a écrit :
> That makes no difference. Which module registers the char device?
I'm not. I've only implemented a line discipline for the serial port,
but all the rest is the serial driver.
> That's the one whose ioctl functions are used.
>> $ strace stty < /dev/ttyS0
>> ...
>> ioctl(0, SNDCTL_TMR_TIMEBASE, 0xbffff7f0) = -1 EINVAL
>> (Invalid argument)
> There you are. You are intercepting the ioctl or else replacing the
> serial drivers ioctl. And not doing it right.
I've got not ioctl in my module, so what's doing it ?
>> ioctl (wrong flag !). Do I have to implement an ioctl inside my
>> module ?
> If you are the one regisitering the functions for that major/minor,
> yes, of course. Show us what cat /proc/devices shows. That'll tell
> us who has registered for the char device with major 4. Are you
> replacing the ioctl?
$ cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 ttyS
5 cua
...
226 drm
231 ccsds
245 pcmcia
Block devices:
...
The char device ccsds is a simple rw device in which I derivate the
CCSDS flow (spatial standard) ; it has nothing to do with serial
port, and I'm sure it doesn't interact with it.
So the only thing I do against serial module is the line discipline :
struct tty_ldisc sport_ldisc = {
magic : TTY_LDISC_MAGIC,
name : "ccsds_sport_ldisc",
flags : 0,
open : sport_open,
close : sport_close,
receive_buf : sport_receive,
receive_room : sport_room,
};
which I register with tty_register_ldisc(N_TTY, &sport_ldisc) during
the module initialization.
Does that mean I replace the serial duty on ioctl ?
-- Laurent H. (pour m'écrire, enlever nospam de l'adresse de réponse)
- Next message: Laurent H.: "Re: Problem with tcgetattr"
- Previous message: Peter T. Breuer: "Re: Problem with tcgetattr"
- In reply to: Peter T. Breuer: "Re: Problem with tcgetattr"
- Next in thread: Laurent H.: "Re: Problem with tcgetattr"
- Reply: Laurent H.: "Re: Problem with tcgetattr"
- Reply: Peter T. Breuer: "Re: Problem with tcgetattr"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|