Module with strange behavior
Hi,
i wrote a kernel-module for linux-kernel (3.X). So, ever when i'm loading the module for the first time, it works fine. when i remove it and load it again, i can't use it. That module is a high-level-driver for the serial-port. i use inputattach to bind the module to a port. It also uses the input-subsystem to create a jsX and an eventX node. yes, it is an input-device-driver for the serial port :) . here something from syslog: first load + bind with inputattach Code:
connect called Code:
disconnect called Code:
connect called Code:
disconnect called Code:
connect called now i remove the module (after killing inputattach) and load it again + bind with inputattach Code:
connect called so has anyone of you an idea? i will post my code (it will be open source anyway), if you need it. thanks! |
With out looking at the code my best guess is you are missing something in the disconnect part, it is not completely disconnecting, thus when the next connect is attempted it leads to immediate disconnect. But again that is just a guess.
|
OK,
here are my init, exit, connect and disconnect functions: init and exit Code:
static int __init xj_init(void) Code:
static int xj_connect(struct serio* serio, struct serio_driver* drv) Code:
static void xj_disconnect(struct serio *serio) Code:
static struct serio_device_id xj_serio_ids[] = { |
The code looks ok.... try adding printks in connect and disconnect to figure out at which step is the disconnect being called.
|
I will do it today.
|
All times are GMT -5. The time now is 08:54 AM. |