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

[bluetooth-dev] Re: Suggestion and question for USB bluetooth driver



Title: Re: Suggestion and question for USB bluetooth driver

> > I have another problem that
> > the FTP file transfer from Digianswer PC card to USB Ericcson module to
> >(many calls for bluetooth_read_bulk_callback() and small calls for
> >bluetooth_int_callback()  are needed in this case.)   
> >always fails ...
> Again, kernel debug log output would help out a lot here.  But it sounds
> like the Bluetooth device is getting out of sequence.  Could this be due
> to the data coming in on the different endpoints?
I found that the reason is the tty buffer overflow
when receiving ACL packets whose size is greater than 512 bytes.

 /usr/include/linux/tty_flip.h
_INLINE_ void tty_insert_flip_char(struct tty_struct *tty,
                                   unsigned char ch, char flag)
{
        if (tty->flip.count < TTY_FLIPBUF_SIZE) {
                tty->flip.count++;
                *tty->flip.flag_buf_ptr++ = flag;
                *tty->flip.char_buf_ptr++ = ch;
        }
}
In the current tty implementation,   TTY_FLIPBUF_SIZE is 512.
How about using "netlink device" instead of tty?
The netlink device also looks like more reasonable because it can provide "datagram transfer" instead of "stream transfer".

>> Yes. The problem is that
> >the FTP file transfer from USB Ericcson module to Digianswer PC card
> >(many calls for "bluetooth_write()" are used in this case)
> >frequently fails because of the bluetooth USB driver's fail.
>>But if I change the non-blocking code to blocking code,
>> the FTP transfer is almost always stable.
>Could you send me the kernel debug log output for when you are using the
>non-blocking code?  The userspace application and the Bluetooth stack
>above the driver should be able to handle a short write by the driver
>(if not then it needs to be fixed.)
Sure. Let me attch the system log.
Thanks,
-----------
Myunggyu Kim
mgkim@xxxxxxx.kr
-----------------------------------------------------------------------------------------------------------------------------

The system log for the problem "bluetooth_write()" :
(This problem is solved when changing the non-blocking code to the blocking one.

Nov 23 10:42:28 combi3 kernel: usb.c: USB new device connect, assigned device number 2
Nov 23 10:42:28 combi3 kernel: usb.c: USB device 2 (prod/vend 0x8ea/0xabba) is not claimed by any active driver.
Nov 23 10:42:28 combi3 kernel: bluetooth.c: USB Bluetooth support registered
Nov 23 10:42:28 combi3 kernel: usb.c: registered new driver bluetooth
Nov 23 10:42:28 combi3 kernel: bluetooth.c: USB Bluetooth converter detected
Nov 23 10:42:28 combi3 kernel: bluetooth.c: Bluetooth converter now attached to ttyUB0 (or usb/ttub/0 for devfs)
Nov 23 10:42:28 combi3 usbmgr[495]: "bluetooth" was loaded
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 387
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 396
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 426
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 436
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 446
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 456
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 466
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 476
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 486
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 496
Nov 23 10:42:48 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 506
Nov 23 10:43:35 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 518
Nov 23 10:43:35 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 519
Nov 23 10:43:52 combi3 kernel: usb-uhci.c: interrupt, status 3, frame# 1077
Nov 23 10:44:17 combi3 ftpd[1735]: FTP LOGIN FROM btnet2 [192.168.2.2], mgkim
Nov 23 10:44:31 combi3 PAM_pwdb[684]: (login) session opened for user mgkim by LOGIN(uid=0)
Nov 23 10:45:09 combi3 kernel:  7b b8 17 d8 06 87 3d e1 be 9e 6f 8b de fa 7d 6e b7 5d 19 75 ef 4f 75 af 7a 3d 7b 4e ee 2f 3d ba bd be 97 6e f6 a0 64 44 37 ca 1f 67 5e 00 2f af 7c bb 02 df 5d 75 de f0 00 74 52 80 17 9e 00 05 b8 7a 68 db af 3c 26 aa 0c 1e 7d 99 1f 6d 57 d6 fa 3e 7d b3 de 7d 7d 1f 79 50 1d 8c 76 fb e3 3c 00 01 5f 4d 68 1f 52 00 76 c3 5d 1a e0 02 04 87 d0 3b 3d 7c 95 bc 7a 50 07 d0 68 01 a0 03 40 7c 6c ef b0 0d 7d d8 03 cb db 28 50 a2 8d 00 1a a0 1f 0f 7b 1e f3 8a 9a 0d 37 b3 e8 f1 45 ec 03 4b df 6e 92 f6 c8 51 50 14 52 45 6a d9 2a a8 fb 06 7a 51 80 05 7a db 2b 74 d5 40 79 b0 a0 50 00 7b 58 68 02 85 28 91 ad 28 f2 32 05 4a 9f 6c 05 d5 3e fb dd 50 52 41 22 6d a0 04 9d 19 db be c7 bd 99 e9 a9 d3 20 5f 7a da e5 17 a3 76 31 9c 1d d9 76 c1 d1 da 8d 42 4a 76 c3 c0 00 1f 67 57 be db d7 9d 0a 24 07 d6 41 f5 91 48 4a 80 28 29 42 a9 04 a8 a0 f4 1d d8 a2 81 5d d5 f0 a1 de f6 c1 6b 45 6d 82 15 53 d6 95 52 04 9d b0 15 40 17 6c 41 00 00 0a 00 00 05 0d 00 35 11 54 a0 01 02 6c 66 cc 90 52 eb 26 f9 ae d0 10 2a 24 8

Nov 23 10:45:09 combi3 kernel:  f7 66 cf b5 eb 75 bd c1 cf b6 f5 60 d3 5f 4f be de f1 29 40 03 ef 30 1d 00 e3 39 ba 8e bc 00 ef 66 a3 7c ce 35 6e f3 bb 2d dd 2b 5c f3 b8 1f 66 f7 96 <7>bluetooth.c: bluetooth_write_bulk_callback

Nov 23 10:45:09 combi3 kernel: a2 ec 65 c2 d6 97 5f 41 a0 00 27 ac d0 00 00 68 7a 19 00 00 00 39 b0 a0 fb be 34 00 02 9a 1d d8 fa 79 10 d8 2f 1f 40 d8 0f 8f ac a9 37 87 96 b8 94 00 2d 7b ea cf 00 5e f7 3e 87 47 bb bb ae bd c0 7a e1 d6 ef ad e5 da 6e 5a ea bc 1e da 80 1e f7 dd e0 00 00 9a 9f 3e 7c 2b 9d cd ee da d1 4f 8d df 5a 7b b5 2e ee 6b 25 3d 0a 

Nov 23 10:45:09 combi3 kernel:  98 7c f6 ef a3 5d 3d 29 79 bd 5d ba f7 b7 bd 9a cd 87 b6 4f 5e ee 5c fb d7 72 77 bd 73 8a b1 ed 5f 6d 78 db d7 2c e6 63 2a b3 eb 4b 6f 27 b6 0d 8f 13 ef 72 4f 79 d0 ef 77 5d f7 da ea 6e ed f6 c6 f5 be f7 8d eb ce 9f 4f 6b dd f7 a1 dc ed ee f8 bd 1e fb dc aa 7b b4 be 8f 8b e5 bb b7 3d 1d 28 7d df 5c 7c 9e b4 51 f0 b6 d6 f7 77 9c c3 9f 46 90 a5 ee c7 4a 07 da df 27 a6 d6 f4 3d 35 f6 39 cd 65 5e ba e6 7b c5 b7 95 76 ef 77 bb af 6e ce eb 75 ce 68 a4 ab b7 5d 7a 30 74 be f7 c0 3e af bd 9d c3 49 0b 6d 54 5d f1 4e 7d 51 e0 ed e6 a7 3a f5 9f 66 bb db 93 71 b9 6b dd f7 6f 7d de ef ae f8 7b ba f7 db e9 d5 0e 7c d2 79 5b e3 1e bd 38 f9 0a d9 94 f7 6b d6 48 ed ee f6 dc be b5 4f 6d eb 5b 6f 5d 3a a7 b6 eb c7 d1 f7 df 7c cf 6d 75 ee ee 3e ed cb 6c 7b ae ee db ec 5d bd 2f 76 ee ec c3 d7 2e f7 71 ae dd 77 20 9b 1f 39 9b 7d f5 ed ee 5d ce f6 75 7a 77 5e 7a ea f6 77 77 5a 7a f7 a7 b9 e6 74 e7 3c eb 9e ee dd 2c f0 1e fb df 77 da be bb dc 9b de a1 de f5 de 9f 3d aa be 7d bb af b7 6e b9 d7 bb dc f1 d

Nov 23 10:45:09 combi3 kernel:  ca 03 ee 5e fa e0 cd f0 be d5 d6 79 ba f7 b4 ad 4e 05 ee dc 0a 9f 78 f0 ba be 7d bb bc ef 19 66 5e 4b d3 b7 75 57 39 b0 68 73 73 49 b6 ed db 38 ae f6 e6 de b2 6b dd bc b7 dd df 3e 73 27 26 e8 d4 b0 15 dd 9c dd c3 ee de 3d d2 

Nov 23 10:45:09 combi3 kernel:  ad 43 b6 e8 00 00 1a d3 92 86 ec e8 1d c9 a5 62 af 7d ab cb ed f2 b1 7c ed 76 f2 73 bd ef 7a d7 7b 78 5b 6b 57 b7 56 cb 4d c8 fb 9e bb 7a c6 bb 98 da b9 d3 bb df 00 00 06 fb ed 2d f3 0d c3 46 b6 57 4b 7a e0 02 ec 83 7a 3a 80 03 9a bd 6b ad e1 d6 ee 5b 51 d6 eb b4 ee da b3 9e f5 b6 9b 63 79 3d 94 4e f7 59 ef 77 2e d4 7a 01 52 77 26 5e e7 bd c1 db 6d d7 b9 31 40 d0 1c 6c 6c ce 83 1d e6 9d d7 ae f2 5e e8 a8 b4 11 ad d3 36 d9 d9 6e 77 1d ba ac f0 01 a5 ef 5d 27 13 9a 7b 56 de da e6 5f 58 2b c0 2f bb ab 7d d5 7a 5b ac fb 33 ca a9 6d 34 7d b9 47 dc 2b da cd 07 b6 05 68 68 0a 00 68 5e e3 a8 e5 af 7a 3c 77 70 c5 d8 82 10 51 b6 01 db 72 14 f6 7b a8 00 36 f6 ea 13 b4 db 52 72 b9 ad a8 02 12 80 69 d6 a3 c8 f6 cd d9 ca 13 b7 1d 82 9f 63 a7 db 37 dc 02 ee 73 16 db 4d ad a2 b4 39 db 40 a7 53 ee 9c 7a 29 ec da da a7 bd db cb ad b7 65 dc 5b dc 5a e7 21 d4 dd 7a 7a 95 73 00 b7 b8 75 d7 73 2b 85 33 c7 d1 d1 e7 cf b7 1d db 6e cd 4f 57 72 b7 75 13 bb 6f be dc 5f 7d 70 db 33 17 77 25 4a da 55 eb 9c 5

Nov 23 10:45:09 combi3 kernel:  bc f6 ab d5 36 da ee ca 9e 86 af 4a dd 31 50 a2 4a 90 80 e5 dd 27 77 74 c6 f6 0d 7a 19 06 80 01 9b d7 2a 25 e4 d6 78 73 bb 07 4e b0 00 09 6e 3b 79 bd ef 4e ef 77 af 2f 5d 73 72 ce 5c e7 6d ed ef 3d 85 d8 14 cd 62 b8 35 61 d1 54 06 aa ea e1 db de 7d 81 a0 00 07 c8 00 00 3a 3a 07 d3 a7 97 a0 34 00 e4 02 8b ec 03 bd 96 98 af 79 c2 0f 5a 2f 85 df 41 36 f4 f7 75 6c ed 0e ed a8 2b ba 76 97 75 36 eb 5c b5 dc dd 86 bb 37 6d d7 45 bd 50 7a 9e da 1f 6e 47 dd b3 de a7 0e 9b 6b 

Nov 23 10:45:09 combi3 kernel:  d3 4d 0c 81 34 c9 a6 08 62 4c d1 a2 9e 68 9a a9 e6 a7 a6 a7 8a 9e 99 4f 14 69 bd 50 68 11 24 41 00 23 13 53 11 a6 82 62 32 69 a2 62 62 00 13 4a 7b 21 30 aa 7a 6d 34 a7 9a 4f 6a 34 a1 e5 3c a6 98 43 40 0f 3b f5 48 42 2c f8 94 51 ef 8d 89 f3 5c 3f 94 b4 ff e0 11 2a 3f 2e 14 11 0c d5 24 fe 05 7f e2 42 cf fe 48 42 8d cc b9 ff e9 b8 6a 2a 33 ff a7 03 38 03 04 20 c5 03 81 97 87 de fd 5f 87 f4 ee 0d c1 b9 6a 1f fc d9 42 44 22 01 63 51 28 89 d5 10 dd 03 f2 e2 9e 12 4d 1b 43 8f 65 82 85 aa 98 ce 15 29 14 a1 26 43 89 01 a1 a5 16 08 05 28 88 42 65 1a 42 62 ec e0 30 50 54 83 d2 6c 85 04 c8 04 c0 54 4a d1 4a 15 53 02 c9 09 fc 99 33 04 c1 00 50 0d 01 54 03 43 fd 05 99 11 f1 0d b0 09 d9 4a 4a f0 47 f7 73 81 3c 40 33 0b cf f9 eb 3d a9 28 f0 92 89 4f a1 4d a0 50 17 da 95 06 46 08 22 c0 58 8c 3a 4e 60 0f 49 b0 4d 00 61 2a 39 09 4a 35 a1 13 48 91 20 94 01 82 94 3b 45 28 47 ed de 87 42 e6 21 7b 30 38 19 ed 26 49 ef 80 e3 72 40 89 82 99 4e 80 94 62 04 00 8c 65 11 24 a5 0e 9c 60 1e 12 e0 0d 63 99 e8 1

Nov 23 10:45:09 combi3 kernel:  a4 50 f0 e5 4d 0e 09 21 d5 6c 86 b4 01 64 50 d0 d2 97 fe f9 1d 21 8a c0 36 c0 06 e2 25 04 5b 9a 41 14 78 6b 8b 57 75 62 e8 73 42 0a 54 83 11 <7>bluetooth.c: bluetooth_write_bulk_callback

Nov 23 10:45:09 combi3 kernel: cc 01 4c 6c 6d b3 ff 96 51 d2 2a cd 37 1b 3a 6a 47 41 7f 64 0a 67 fc a1 ff 9c 0f fa 
Nov 23 10:45:09 combi3 kernel: a4 50 f0 e5 4d 0e 09 21 d5 6c 86 b4 01 64 50 d0 d2 97 fe f9 1d 21 8a c0 36 c0 06 e2 25 04 5b 9a 41 14 78 6b 8b 57 75 62 e8 73 42 0a 54 83 11 cc 01 4c 6c 6d b3 ff 96 51 d2 2a cd 37 1b 3a 6a 47 41 7f 64 0a 67 fc a1 ff 9c 0f fa