Forum Linux.noyau Driver serie + PPP

Posté par  .
Étiquettes : aucune
0
21
juin
2007
Bonjour,
J'ai fait un driver Série en partant de serial.c
Je souhaite utiliser mon port avec le ppp
Mais il y a un problème, voici l'erreur remonté par le ppp :
Couldn't get channel number : Input/Output error

je pense que ça viens de ma struct tty_driver, mais pourquoi???

et autre question a quoi sert le device /dev/cua ?

voici mon bout de code :

static int __init rs_init(void)
{
int i;
struct serial_state * state;

init_timer(&serial_timer);
serial_timer.function = rs_timer;
mod_timer(&serial_timer, jiffies + RS_STROBE_TIME);

show_driver_dss1337_version();

/* Initialize the tty_driver structure */

memset(&serial_driver, 0, sizeof(struct tty_driver));
serial_driver.magic = TTY_DRIVER_MAGIC;
serial_driver.driver_name = "dss1337";
#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
serial_driver.name = "ttsl/%d";
#else
serial_driver.name = "ttySl";
#endif
DDEBUG("driver: Voici mon nom : %s\n",serial_driver.name);
//Map{
// serial_driver.major = TTY_MAJOR;
// serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET;
// serial_driver.name_base = SERIAL_DEV_OFFSET;
serial_driver.major = 254;
serial_driver.minor_start = 0;
//serial_driver.name_base = 0;
//Map}

serial_driver.num = 1; //NR_PORTS; //Nombre de port com --> fixe
DDEBUG("driver: Voici mon num : %d\n",serial_driver.num);

serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
serial_driver.subtype = SERIAL_TYPE_NORMAL;
serial_driver.init_termios = tty_std_termios;
serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;

serial_driver.open = rs_open;
serial_driver.close = rs_close;
serial_driver.write = rs_write;
serial_driver.put_char = rs_put_char;
serial_driver.flush_chars = rs_flush_chars;
serial_driver.write_room = rs_write_room;
serial_driver.chars_in_buffer = rs_chars_in_buffer;
serial_driver.flush_buffer = rs_flush_buffer;
serial_driver.ioctl = rs_ioctl;
serial_driver.throttle = rs_throttle;
serial_driver.unthrottle = rs_unthrottle;
serial_driver.set_termios = rs_set_termios;
serial_driver.stop = rs_stop;
serial_driver.start = rs_start;
serial_driver.hangup = rs_hangup;
serial_driver.break_ctl = rs_break;
serial_driver.send_xchar = rs_send_xchar;
serial_driver.wait_until_sent = rs_wait_until_sent;
serial_driver.read_proc = rs_read_proc;


/*
* The callout device is just like normal device except for
* major number and the subtype code.
*/
callout_driver = serial_driver;
#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
callout_driver.name = "cuSl/%d";
#else
callout_driver.name = "cuSl";
#endif
callout_driver.major = 255;
callout_driver.subtype = SERIAL_TYPE_CALLOUT;
#if (LINUX_VERSION_CODE >= 131343)
callout_driver.read_proc = 0;
callout_driver.proc_entry = 0;
#endif

if (tty_register_driver(&serial_driver)) panic("dss1337: Couldn't register serial driver\n");
DDEBUG ("driver: Voici mon cuSl = %s\n",callout_driver.name );
// if (tty_register_driver(&callout_driver)) panic("dss1337: Couldn't register callout driver\n");

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.