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

RE: [bluetooth-dev] Error setting serial_struct with TIOCSSERIAL

> -----Original Message-----
> From: Matthias Fuchs [mailto:matthias.fuchs@xxxxxxx.com]
> Sent: Friday, October 12, 2001 18:20
> To: bluetooth-dev
> Subject: [bluetooth-dev] Error setting serial_struct with TIOCSSERIAL
> Hi,
> I have been working for an older version of OpenBT since some 
> weeks. But now it was time to update to the recent cvs version.
> If I hadn't :-)
> Here is the first problem:
> When I start btdm as normal: "btdm -s 57600 -R -u /dev/ttyS1" on my
> target I get this output in the console:
> 	Error setting serial_struct with TIOCSSERIAL: Address already in use 
> 	Error setting serial_struct with TIOCSSERIAL: Address already in use 
> There is a pause with about 1 second length between the two messages.
> What does that mean ? Serial communication with my Ericcson 
> HW seems to work.

TIOCGSERIAL and TIOCSSERIAL are use to get and set a struct called
serial_struct in the serial driver. It provides the means to set baud
rates other than the standard ones.

If you build your kernel yourself, you could try and instrument the
code in drivers/char/serial.c (assuming that is the serial driver you
use) around where it returns -EADDRINUSE. Something like:

        /* Make sure address is not already in use */
        if (new_serial.type) {
                for (i = 0 ; i < NR_PORTS; i++)
                        if ((state != &rs_table[i]) &&
                            (rs_table[i].port == new_port) &&
                            rs_table[i].type) {
                                printk("i:                    %u", i);
                                printk("state:                0x%p", state);
                                printk("&rs_table[i]:         0x%p", &rs_table[i]);
                                printk("new_port:             %lu", new_port);
                                printk("rs_table[i].port:     %lu", rs_table[i].port);
                                printk("rs_table[i].type:     %d", rs_table[i].type);
                                printk("new_serial.port:      %u", new_serial.port);
                                printk("new_serial.port_high: %u", new_serial.port_high);
                                return -EADDRINUSE;

You could also try and see if it makes any difference if you change 
the order in fd_setup() so that the call to tcsetattr() is done after
the TIOCSSERIAL ioctl is called.

> Matthias

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