2005-02-26 03:19:03

by Mathias Adam

[permalink] [raw]
Subject: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hello,

I'm trying to install a Socket Bluetooth Compactflash Card (Revision H)
in my Thinkpad X21. I tested it with the 2.4.29 kernel (from Debian
unstable) and it works, but I would like to use 2.6 and there it doesn't
work.

With 2.6, the serial_cs module gets loaded as I insert the card and
dmesg shows the following:

-----
ttyS1: detected caps 00000700 should be 00000100
ttyS1 at I/O 0x2f8 (irq = 11) is a 16C950/954
-----

Then I run modprobe hci_uart and this is what dmesg says:

-----
Bluetooth: HCI UART driver ver 2.1
Bluetooth: HCI BCSP protocol initialized
-----
(I didn't include CONFIG_BT_HCIUART_H4 in my kernel this time)

No problem so far, but then: hciattach ttyS1 socket
and it says "BCSP initialization timed out" and hcitool dev doesn't show
any devices.

I already searched this list's archives and found that some cards (the
Socket and some Xircom?) seem to have those problems with 2.6 while some
others (Zoom?) don't. Does anybody know yet how to solve this problem?
If there is no other solution: as my card works well with kernel 2.4, I
wonder if it is possible to use the old hci_uart module from 2.4 in 2.6?

Thanks for advice

Mathias


--
Perfection is achieved not when you have nothing more to add,
but when you have nothing left to take away.
- Antoine de Saint-Exupery


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2005-02-28 22:02:09

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Marcel,

On 28.02.05 09:13:51, Marcel Holtmann wrote:
> > I'm trying to install a Socket Bluetooth Compactflash Card (Revision H)
> > in my Thinkpad X21. I tested it with the 2.4.29 kernel (from Debian
> > unstable) and it works, but I would like to use 2.6 and there it doesn't
> > work.
> >
> > With 2.6, the serial_cs module gets loaded as I insert the card and
> > dmesg shows the following:
> >
> > -----
> > ttyS1: detected caps 00000700 should be 00000100
> > ttyS1 at I/O 0x2f8 (irq = 11) is a 16C950/954
> > -----
> >
> > Then I run modprobe hci_uart and this is what dmesg says:
> >
> > -----
> > Bluetooth: HCI UART driver ver 2.1
> > Bluetooth: HCI BCSP protocol initialized
> > -----
> > (I didn't include CONFIG_BT_HCIUART_H4 in my kernel this time)
> >
> > No problem so far, but then: hciattach ttyS1 socket
> > and it says "BCSP initialization timed out" and hcitool dev doesn't show
> > any devices.
>
> what kind of 2.6 kernel is this? Give 2.6.11-rc5 a chance. Do you see
> anything special with dmesg?

Before I have tried 2.6.9-1-686 (Debian unstable) and 2.6.10 (from
http://www.kernel.org). Now I patched the 2.6.10 up to 2.6.11-rc5, but it seems
to behave the same - same messages in dmesg as before, still timeout
when running hciattach (nothing in dmesg after this command)...
Also the same with the -mh4 patch (against a clean 2.6.10).

I checked what the working 2.4.29 shows in dmesg, maybe this helps
somewhat:

Inserting the card:
-----
cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xcffff
0xd8000-0xfffff
ttyS01 at port 0x02f8 (irq = 11) is a 16C950/954
-----

modprobe hci_uart:
-----
BlueZ HCI UART driver ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
Written 2000,2001 by Maxim Krasnyansky <[email protected]>
-----

hciattach ttyS1 socket:
-----
bcsp_recv: Out-of-order packet arrived, got 1 expected 0
-----
(but the bluetooth device works despite this error)

One idea: is there an (easy) way to log what's going on on the ttyS1
device (I mean the communication between the hci_uart driver and the cf
card)? This way one could compare the logs of kernel 2.4 and 2.6 and
maybe see what's wrong...

Another question: What about the btuart_cs.ko module, what's the
difference to the hci_uart module?

Thanks in advance

Mathias

--
http://www.adamis.de/adam/
Es gibt mehr Leute, die kapitulieren, als solche, die scheitern.
- Henry Ford


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-28 08:13:51

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Mathias,

> I'm trying to install a Socket Bluetooth Compactflash Card (Revision H)
> in my Thinkpad X21. I tested it with the 2.4.29 kernel (from Debian
> unstable) and it works, but I would like to use 2.6 and there it doesn't
> work.
>
> With 2.6, the serial_cs module gets loaded as I insert the card and
> dmesg shows the following:
>
> -----
> ttyS1: detected caps 00000700 should be 00000100
> ttyS1 at I/O 0x2f8 (irq = 11) is a 16C950/954
> -----
>
> Then I run modprobe hci_uart and this is what dmesg says:
>
> -----
> Bluetooth: HCI UART driver ver 2.1
> Bluetooth: HCI BCSP protocol initialized
> -----
> (I didn't include CONFIG_BT_HCIUART_H4 in my kernel this time)
>
> No problem so far, but then: hciattach ttyS1 socket
> and it says "BCSP initialization timed out" and hcitool dev doesn't show
> any devices.

what kind of 2.6 kernel is this? Give 2.6.11-rc5 a chance. Do you see
anything special with dmesg?

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-06 19:37:24

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Marcel,

On 05.03.05 20:55:37, Marcel Holtmann wrote:
> I get these extra log messages with your patch and the Xircom card:
>
> ttyS2: autoconf (0x03e8, 0x00000000): iir=3 iir1=6 iir2=6 Xscale type=XScale
> ttyS2 at I/O 0x3e8 (irq = 20) is a XScale
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=9600 quot=12
> ***** Serial: baud=115200 quot=1
>
> Don't ask why the type is now Xscale. It seems it is Xscale for every
^^^ was it different without my patch?
Shouldn't be...
> serial port in my system and it is a normal P4 system.

What kernel version did you patch? What does dmesg show when calling
hciattach (should be some ***** Serial messages)?
Does the card work with a 2.4 kernel (e.g. 2.4.29)?

> > > For the Socket card the baud rate is 230400 and yes, this is to slow for
> > > the full bandwith of a piconet. However I never did any bandwith test
> > > with this card, but actually there are cards out there where the UART
> > > limits the total possible bandwidth.
> >
> > Huh - but at least it's still a lot faster than a GPRS connection so it's
> > okay for me...
>
> If you have another system with an USB Bluetooth dongle, you can simply
> check what's the max piconet bandwidth. Use a PAN connection or test it
> with the l2test or rctest program.

I didn't find l2test nor rctest but I tried some OBEX file transfers and
only got around 25-30 KiByte/s, the same with Windows so it seems the
card really is limited to 230400 baud...
Btw, do you know another cf card without external antenna?

Regards,
Mathias


--
There are only 10 types of people in this world:
those who understand binary, and those who don't.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 19:55:37

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Mathias,

> > I only have the old Socket cards (dtl1_cs driver) at hand and so I can't
> > test it, but my Xircom card is still not working.
>
> Is that Xircom card similar to the newer Socket cards? i.e. does it have
> a 16C95x UART? If yes you could try this patch which I used while
> investigating the problem, it includes some debug messages which might
> help.

I get these extra log messages with your patch and the Xircom card:

ttyS2: autoconf (0x03e8, 0x00000000): iir=3 iir1=6 iir2=6 Xscale type=XScale
ttyS2 at I/O 0x3e8 (irq = 20) is a XScale
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=9600 quot=12
***** Serial: baud=115200 quot=1

Don't ask why the type is now Xscale. It seems it is Xscale for every
serial port in my system and it is a normal P4 system.

> > For the Socket card the baud rate is 230400 and yes, this is to slow for
> > the full bandwith of a piconet. However I never did any bandwith test
> > with this card, but actually there are cards out there where the UART
> > limits the total possible bandwidth.
>
> Huh - but at least it's still a lot faster than a GPRS connection so it's
> okay for me...

If you have another system with an USB Bluetooth dongle, you can simply
check what's the max piconet bandwidth. Use a PAN connection or test it
with the l2test or rctest program.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 19:25:39

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Marcel,

On 05.03.05 19:17:50, Marcel Holtmann wrote:
> I only have the old Socket cards (dtl1_cs driver) at hand and so I can't
> test it, but my Xircom card is still not working.

Is that Xircom card similar to the newer Socket cards? i.e. does it have
a 16C95x UART? If yes you could try this patch which I used while
investigating the problem, it includes some debug messages which might
help.

> For the Socket card the baud rate is 230400 and yes, this is to slow for
> the full bandwith of a piconet. However I never did any bandwith test
> with this card, but actually there are cards out there where the UART
> limits the total possible bandwidth.

Huh - but at least it's still a lot faster than a GPRS connection so it's
okay for me...

Regards,
Mathias


--
The first time you'll get a Microsoft product that doesn't suck,
will be the day they start producing vacuum cleaners.


Attachments:
(No filename) (893.00 B)
debug-patch (1.70 kB)
Download all attachments

2005-03-05 18:17:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Mathias,

> > > I just got it working by doing a little change in the serial driver
> > > (8250.c). I tested it with 2.6.11 but I think it could work for any 2.6
> > > kernel.
> >
> > please provide a patch for your change.
>
> So - after some cleaning - here it is. A short description:
>
> The BlueZ driver requests a baud rate
> of 230400 which is uartclk/8 (serial_cs sets uartclk=1843200). However
> serial8250_set_termios() refuses to program a baud rate larger than
> uartclk/16 which should be ok for most UARTs. I looked into the 2.4
> driver and found some code that changes the internal prescaler to values
> between 1:16 and 1:4 to support baud rates up to uartclk/4 respectively
> (this is done for 16C950 UARTs only). The datasheet of oxford's oxcf950
> chip confirms this feature.
>
> Apply the patch to the file drivers/serial/8250.c
>
> Please let me know if there are problems or if it does work.

I only have the old Socket cards (dtl1_cs driver) at hand and so I can't
test it, but my Xircom card is still not working.

> > > One thing I discovered while debugging this: the hci_uart driver
> > > seems to initialize the actual UART with only 230400 baud. Is this
> > > really the case or are those UARTs clocked at nonstandard (higher)
> > > frequencies so that this setting does result in a higher real baud rate?
> >
> > The hci_uart is only a line discipline. Every initialization and baud
> > rate settings are done with hciattach.
>
> ok so it's hciattach that sets the baudrate - but that wasn't the point
> (or I misunderstood your answer?): I wonder if the bluetooth module is
> really accessed at only 230400 baud (that's the rate which is given to
> the 8250 driver) which seems a little bit slow thinking of bluetooths
> >700kbaud maximum rate...

For the Socket card the baud rate is 230400 and yes, this is to slow for
the full bandwith of a piconet. However I never did any bandwith test
with this card, but actually there are cards out there where the UART
limits the total possible bandwidth.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 14:42:05

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

On 05.03.05 10:17:46, Erwin Authried wrote:
> > seems to initialize the actual UART with only 230400 baud. Is this
> > really the case or are those UARTs clocked at nonstandard (higher)
> > frequencies so that this setting does result in a higher real baud rate?
>
> I can't say for sure if that applies to your specific CF card, but
> usually PCMCIA/CF uarts are just register-compatible emulations of a
> standard uart, and the clockrate doesn't matter at all. The actual data
> rate can be very high.

Hmm, I don't know... as the card didn't work with the wrong baud rate
programmed in its UART I think it does use the selected clock rate - ok, at
least the divisor must be right, the UART might be clocked internally at
much more than the standard ~1.8MHz giving a higher real baud rate.

Regards
Mathias



--
Twenty years from now you will be more disappointed by the things that
you didn't do than by the ones you did do. So throw off the bowlines.
Sail away from the safe harbor. Catch the trade winds in your sails.
Explore. Dream. Discover. (Mark Twain)


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 14:35:20

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

On 05.03.05 15:18:58, Mathias Adam wrote:
> + unsigned int baud_base = port->uartclk/16;

OK, this line can be removed...


Regards

Mathias


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 14:18:58

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Marcel,

On 05.03.05 12:24:19, Marcel Holtmann wrote:
> > I just got it working by doing a little change in the serial driver
> > (8250.c). I tested it with 2.6.11 but I think it could work for any 2.6
> > kernel.
>
> please provide a patch for your change.

So - after some cleaning - here it is. A short description:

The BlueZ driver requests a baud rate
of 230400 which is uartclk/8 (serial_cs sets uartclk=1843200). However
serial8250_set_termios() refuses to program a baud rate larger than
uartclk/16 which should be ok for most UARTs. I looked into the 2.4
driver and found some code that changes the internal prescaler to values
between 1:16 and 1:4 to support baud rates up to uartclk/4 respectively
(this is done for 16C950 UARTs only). The datasheet of oxford's oxcf950
chip confirms this feature.

Apply the patch to the file drivers/serial/8250.c

Please let me know if there are problems or if it does work.

> > One thing I discovered while debugging this: the hci_uart driver
> > seems to initialize the actual UART with only 230400 baud. Is this
> > really the case or are those UARTs clocked at nonstandard (higher)
> > frequencies so that this setting does result in a higher real baud rate?
>
> The hci_uart is only a line discipline. Every initialization and baud
> rate settings are done with hciattach.

ok so it's hciattach that sets the baudrate - but that wasn't the point
(or I misunderstood your answer?): I wonder if the bluetooth module is
really accessed at only 230400 baud (that's the rate which is given to
the 8250 driver) which seems a little bit slow thinking of bluetooths
>700kbaud maximum rate...


Regards

Mathias


--
Der Jammer der Menschen ist, da? die Narren so sicher sind und die
Klugen so voller Zweifel. (Bertrand Russel)


Attachments:
(No filename) (1.74 kB)
patch-serial-16c950 (1.50 kB)
Download all attachments

2005-03-05 11:24:19

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Mathias,

> I just got it working by doing a little change in the serial driver
> (8250.c). I tested it with 2.6.11 but I think it could work for any 2.6
> kernel.

please provide a patch for your change.

> One thing I discovered while debugging this: the hci_uart driver
> seems to initialize the actual UART with only 230400 baud. Is this
> really the case or are those UARTs clocked at nonstandard (higher)
> frequencies so that this setting does result in a higher real baud rate?

The hci_uart is only a line discipline. Every initialization and baud
rate settings are done with hciattach.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 09:17:46

by Erwin Authried

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

On Sat, 2005-03-05 at 06:37, Mathias Adam wrote:
> Hi,
>
> I just got it working by doing a little change in the serial driver
> (8250.c). I tested it with 2.6.11 but I think it could work for any 2.6
> kernel.
>
> Marcel Holtmann schrieb:
> > I am not an serial card expert. This is a problem in the serial
> > subsystem and a BlueZ problem.
>
> That proved to be true.
>
> Marcel: One thing I discovered while debugging this: the hci_uart driver
> seems to initialize the actual UART with only 230400 baud. Is this
> really the case or are those UARTs clocked at nonstandard (higher)
> frequencies so that this setting does result in a higher real baud rate?

I can't say for sure if that applies to your specific CF card, but
usually PCMCIA/CF uarts are just register-compatible emulations of a
standard uart, and the clockrate doesn't matter at all. The actual data
rate can be very high.

Regards,
Erwin




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-05 05:37:28

by Mathias Adam

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi,

I just got it working by doing a little change in the serial driver
(8250.c). I tested it with 2.6.11 but I think it could work for any 2.6
kernel.

Marcel Holtmann schrieb:
> I am not an serial card expert. This is a problem in the serial
> subsystem and a BlueZ problem.

That proved to be true.

Marcel: One thing I discovered while debugging this: the hci_uart driver
seems to initialize the actual UART with only 230400 baud. Is this
really the case or are those UARTs clocked at nonstandard (higher)
frequencies so that this setting does result in a higher real baud rate?


Regards,
Mathias


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-03-01 08:29:36

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Once again: Socket CF card and Kernel 2.6

Hi Mathias,

> > what kind of 2.6 kernel is this? Give 2.6.11-rc5 a chance. Do you see
> > anything special with dmesg?
>
> Before I have tried 2.6.9-1-686 (Debian unstable) and 2.6.10 (from
> http://www.kernel.org). Now I patched the 2.6.10 up to 2.6.11-rc5, but it seems
> to behave the same - same messages in dmesg as before, still timeout
> when running hciattach (nothing in dmesg after this command)...
> Also the same with the -mh4 patch (against a clean 2.6.10).
>
> I checked what the working 2.4.29 shows in dmesg, maybe this helps
> somewhat:
>
> Inserting the card:
> -----
> cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xcffff
> 0xd8000-0xfffff
> ttyS01 at port 0x02f8 (irq = 11) is a 16C950/954
> -----
>
> modprobe hci_uart:
> -----
> BlueZ HCI UART driver ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
> Written 2000,2001 by Maxim Krasnyansky <[email protected]>
> -----
>
> hciattach ttyS1 socket:
> -----
> bcsp_recv: Out-of-order packet arrived, got 1 expected 0
> -----
> (but the bluetooth device works despite this error)
>
> One idea: is there an (easy) way to log what's going on on the ttyS1
> device (I mean the communication between the hci_uart driver and the cf
> card)? This way one could compare the logs of kernel 2.4 and 2.6 and
> maybe see what's wrong...

I am not an serial card expert. This is a problem in the serial
subsystem and a BlueZ problem.

> Another question: What about the btuart_cs.ko module, what's the
> difference to the hci_uart module?

It only supports H:4 and is very limited and no longer supported.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users