You can subscribe to this list here.
2001 |
Jan
|
Feb
(44) |
Mar
(202) |
Apr
(134) |
May
(89) |
Jun
(94) |
Jul
(58) |
Aug
(58) |
Sep
(56) |
Oct
(75) |
Nov
(26) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(24) |
Feb
(30) |
Mar
(15) |
Apr
(49) |
May
(12) |
Jun
(6) |
Jul
(11) |
Aug
(20) |
Sep
(19) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
2003 |
Jan
(7) |
Feb
(4) |
Mar
(7) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(51) |
Dec
(1) |
2004 |
Jan
(11) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mats F. <ma...@us...> - 2001-06-08 14:01:29
|
The following file was modified in apps/bluetooth/userstack: Name Old version New version Comment ---- ----------- ----------- ------- unplug_test.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added some more tests for SDP The diff of the modified file(s): --- unplug_test.c 2001/02/28 19:31:10 1.14 +++ unplug_test.c 2001/06/08 14:01:27 1.15 @@ -63,6 +63,7 @@ extern sdp_con sdp_con_list[7]; =20 extern l2cap_con *testcon; /* is set in test.c */ +extern l2cap_con *test_con; extern s32 emulate_pending; /* is set in test.c */ extern s32 test_assymmetric_mtu; extern s32 dont_send_config_req; @@ -71,158 +72,173 @@ s32 test_role; =20 =20 -unsigned char sdp_test_52111[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, +unsigned char sdp_data_52111[] =3D {0x06, 0x00, 0x08, 0x00, 0x0d, + 0x35, 0x03, 0x19, 0x11, 0x02, 0x00, 0x64, + 0x35, 0x03, 0x09, 0x00, 0x04, 0x00}; +#if 0 +unsigned char sdp_data_52111[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0xff, 0x00}; - -unsigned char sdp_test_52113_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, +#endif +unsigned char sdp_data_52113_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_52113_2[] =3D {0x02, 0x77, 0x77, 0x00, 0x09, +unsigned char sdp_data_52113_2[] =3D {0x02, 0x77, 0x77, 0x00, 0x09, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00}; =20 -unsigned char sdp_test_52114[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, +unsigned char sdp_data_52114[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x12, 0x34, 0x00, 0xff, 0x00}; =20 -unsigned char sdp_test_52121[] =3D {0x02, 0x77, 0x77, 0x00, 0x0a, +unsigned char sdp_data_52121[] =3D {0x02, 0x77, 0x77, 0x00, 0x0a, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0xff, 0x00}; =20 -unsigned char sdp_test_52122[] =3D {0x02, 0x77, 0x77, 0x00, 0x06, +unsigned char sdp_data_52122[] =3D {0x02, 0x77, 0x77, 0x00, 0x06, 0x19, 0x00, 0x01, 0x00, 0xff, 0x00}; =20=20=20 -unsigned char sdp_test_53111[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53111[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_53113_1[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53113_1[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_53113_2[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53113_2[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x35, 0x03, 0x09, 0x00, 0x01, 0x01}; =20 -unsigned char sdp_test_53114[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53114[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_53115[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53115[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x04, 0x00}; =20 -unsigned char sdp_test_53118[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53118[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x05, 0x00}; =20 -unsigned char sdp_test_531110[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_531110[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x08, 0x00}; =20 -unsigned char sdp_test_531117[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_531117[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x09, 0x00}; =20 -unsigned char sdp_test_531120[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_531120[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x01, 0xff, 0x00}; =20 -unsigned char sdp_test_53121[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, +unsigned char sdp_data_53121[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_53122[] =3D {0x04, 0x88, 0x88, 0x00, 0x0a, +unsigned char sdp_data_53122[] =3D {0x04, 0x88, 0x88, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_53123[] =3D {0x04, 0x88, 0x88, 0x00, 0x0a, +unsigned char sdp_data_53123[] =3D {0x04, 0x88, 0x88, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_54111[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_54111[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x12, 0x34, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_54112[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_54112[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0xff, 0x35, 0x03, 0x09, 0x01, 0xff, 0x00}; =20 -unsigned char sdp_test_54113[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_54113[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x12, 0x34, 0x00, 0xff, 0x35, 0x03, 0x09, 0x01, 0xff, 0x00}; =20 -unsigned char sdp_test_54114[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_54114[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_54116_1[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_54116_1[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0x06, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_54116_2[] =3D {0x06, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_54116_2[] =3D {0x06, 0x88, 0x88, 0x00, 0x0e, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0x06, 0x35, 0x03, 0x09, 0x00, 0x01, 0x01, 0x00}; =20 -unsigned char sdp_test_541110[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_541110[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_541111[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_541111[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x04, 0x00}; =20 -unsigned char sdp_test_541112[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_541112[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x05, 0x00}; =20 -unsigned char sdp_test_541120[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, +unsigned char sdp_data_541120[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x09, 0x00}; =20 -unsigned char sdp_test_54121[] =3D {0x06, 0x88, 0x88, 0x00, 0x0b, +unsigned char sdp_data_54121[] =3D {0x06, 0x88, 0x88, 0x00, 0x0b, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x09, 0x00, 0x09, 0x00}; =20 -unsigned char sdp_test_54122[] =3D {0x06, 0x88, 0x88, 0x00, 0x0f, +unsigned char sdp_data_54122[] =3D {0x06, 0x88, 0x88, 0x00, 0x0f, 0x35, 0x03, 0x19, 0x10, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00}; =20 -unsigned char sdp_test_55111_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, +unsigned char sdp_data_55111_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x10, 0x02, 0x00, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_2[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_2[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_3[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_3[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_4[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_4[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x00, 0x10, 0xff, 0xff, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_5[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_5[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x00, 0x11, 0xff, 0xff, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_6[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_6[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x01, 0x00, 0xff, 0xff, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55111_7[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, +unsigned char sdp_data_55111_7[] =3D {0x04, 0x88, 0x88, 0x00, 0x0e, 0x01, 0x01, 0xff, 0xff, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 -unsigned char sdp_test_55112[] =3D {0x06, 0x88, 0x88, 0x00, 0x0f, +unsigned char sdp_data_55111_8[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, + 0x35, 0x03, 0x19, 0x10, 0x01, 0x00, 0xff, + 0x00}; + +unsigned char sdp_data_55112_1[] =3D {0x06, 0x88, 0x88, 0x00, 0x0f, 0x35, 0x03, 0x19, 0x10, 0x02, 0x00, 0xff, 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00}; =20 +unsigned char sdp_data_55112_2[] =3D {0x06, 0x88, 0x88, 0x00, 0x0f, + 0x35, 0x03, 0x19, 0x10, 0x01, 0x00, 0xff, + 0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0x00}; + + + #define UPDATA_MAXLEN 16384 static u8 tmpdata[UPDATA_MAXLEN]; =20 @@ -350,18 +366,11 @@ void test_2_5_1(void) { /* FIXME - Client sends configure request with MTU 4096 */ - if(l2ca_config_req(testcon, 4096, NULL, 0, 0)){ + if(l2ca_config_req(test_con, 48, NULL, 0, 0)){ D_ERR("l2ca_connect_cfm : Configuration request failed\n"); } } =20 -void test_2_5_2(void) -{ - /* FIXME - Server responds success in configure response */ - printk("Using assymmetric mtu reply as server\n"); - test_assymmetric_mtu =3D 1; -} - void test_2_5_3(void) { /* FIXME - Server sends configure request with MTU 16384 */ @@ -513,219 +522,476 @@ * SDP Stuff */ =20 -void test_52111(void) +void sdp_test_52111(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_52111, sdp_test_52111[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52111, sdp_data_52111[4] + 5); } =20 -void test_52113(void) +void sdp_test_52113(void) { static int t =3D 0; =20 if (!t) { - sdp_send_data(&sdp_con_list[0], sdp_test_52113_1, sdp_test_52113_1[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52113_1, sdp_data_52113_1[4] = + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_test_52113_2, sdp_test_52113_2[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52113_2, sdp_data_52113_2[4] = + 5); t =3D 0; } } =20 =20 -void test_52114(void) +void sdp_test_52114(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_52114, sdp_test_52114[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52114, sdp_data_52114[4] + 5); } =20 -void test_52121(void) +void sdp_test_52121(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_52121, sdp_test_52121[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52121, sdp_data_52121[4] + 5); } =20 -void test_52122(void) +void sdp_test_52122(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_52122, sdp_test_52122[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_52122, sdp_data_52122[4] + 5); } =20 -void test_53111(void) +void sdp_test_53111(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53111, sdp_test_53111[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53111, sdp_data_53111[4] + 5); } =20 -void test_53113(void) +void sdp_test_53113(void) { static int t =3D 0; =20=20=20 if (!t) { - sdp_send_data(&sdp_con_list[0], sdp_test_53113_1, sdp_test_53113_2[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53113_1, sdp_data_53113_2[4] = + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_test_53113_2, sdp_test_53113_2[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53113_2, sdp_data_53113_2[4] = + 5); t =3D 0; } } =20 -void test_53114(void) +void sdp_test_53114(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53114, sdp_test_53114[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53114, sdp_data_53114[4] + 5); } =20 -void test_53115(void) +void sdp_test_53115(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53115, sdp_test_53115[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53115, sdp_data_53115[4] + 5); } =20 -void test_53118(void) +void sdp_test_53118(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53118, sdp_test_53118[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53118, sdp_data_53118[4] + 5); } =20 -void test_531110(void) +void sdp_test_531110(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_531110, sdp_test_531110[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_531110, sdp_data_531110[4] + 5); } =20 -void test_531117(void) +void sdp_test_531117(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_531117, sdp_test_531117[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_531117, sdp_data_531117[4] + 5); } =20 -void test_531120(void) +void sdp_test_531120(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_531120, sdp_test_531120[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_531120, sdp_data_531120[4] + 5); } =20 -void test_53121(void) +void sdp_test_53121(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53121, sdp_test_53121[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53121, sdp_data_53121[4] + 5); } =20 -void test_53122(void) +void sdp_test_53122(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53122, sdp_test_53122[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53122, sdp_data_53122[4] + 5); } =20 -void test_53123(void) +void sdp_test_53123(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_53123, sdp_test_53123[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_53123, sdp_data_53123[4] + 5); } =20 -void test_54111(void) +void sdp_test_54111(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54111, sdp_test_54111[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54111, sdp_data_54111[4] + 5); } =20 -void test_54112(void) +void sdp_test_54112(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54112, sdp_test_54112[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54112, sdp_data_54112[4] + 5); } =20 -void test_54113(void) +void sdp_test_54113(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54113, sdp_test_54113[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54113, sdp_data_54113[4] + 5); } =20 -void test_54114(void) +void sdp_test_54114(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54114, sdp_test_54114[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54114, sdp_data_54114[4] + 5); } =20 -void test_54116(void) +void sdp_test_54116(void) { static int t =3D 0; =20 if(!t) { - sdp_send_data(&sdp_con_list[0], sdp_test_54116_1, sdp_test_54116_1[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54116_1, sdp_data_54116_1[4] = + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_test_54116_2, sdp_test_54116_2[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54116_2, sdp_data_54116_2[4] = + 5); t =3D 0; }=20 } =20 -void test_541110(void) +void sdp_test_541110(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_541110, sdp_test_541110[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_541110, sdp_data_541110[4] + 5); } =20 -void test_541111(void) +void sdp_test_541111(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_541111, sdp_test_541111[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_541111, sdp_data_541111[4] + 5); } =20 -void test_541112(void) +void sdp_test_541112(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_541112, sdp_test_541112[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_541112, sdp_data_541112[4] + 5); } =20 -void test_541120(void) +void sdp_test_541120(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_541120, sdp_test_541120[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_541120, sdp_data_541120[4] + 5); } =20 -void test_54121(void) +void sdp_test_54121(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54121, sdp_test_54121[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54121, sdp_data_54121[4] + 5); } =20 -void test_54122(void) +void sdp_test_54122(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_54122, sdp_test_54122[4] + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_54122, sdp_data_54122[4] + 5); } =20 -void test_55111(void) +void sdp_test_55111(void) { static int t =3D 0; =20 switch(t) { case 0: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_1, sdp_test_55111_1[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_1, sdp_data_55111_1[4] = + 5); t =3D 1; break; case 1: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_2, sdp_test_55111_2[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_2, sdp_data_55111_2[4] = + 5); t =3D 2; //break; case 2: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_3, sdp_test_55111_3[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_3, sdp_data_55111_3[4] = + 5); t =3D 3; //break; case 3: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_4, sdp_test_55111_4[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_4, sdp_data_55111_4[4] = + 5); t =3D 4; //break; case 4: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_5, sdp_test_55111_5[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_5, sdp_data_55111_5[4] = + 5); t =3D 5; //break; case 5: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_6, sdp_test_55111_6[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_6, sdp_data_55111_6[4] = + 5); t =3D 6; //break; case 6: - sdp_send_data(&sdp_con_list[0], sdp_test_55111_7, sdp_test_55111_7[4] = + 5); + sdp_send_data(&sdp_con_list[0], sdp_data_55111_7, sdp_data_55111_7[4] = + 5); + t =3D 7; + //break; + case 7: + sdp_send_data(&sdp_con_list[0], sdp_data_55111_8, sdp_data_55111_8[4] = + 5); t =3D 0; break;=20=20 }=20 } =20 -void test_55112(void) +void sdp_test_55112(void) { - sdp_send_data(&sdp_con_list[0], sdp_test_55112, sdp_test_55112[4] + 5); + static int t =3D 0; + + switch(t) + { + case 0: + sdp_send_data(&sdp_con_list[0], sdp_data_55112_1, sdp_data_55112_1[4] = + 5); + t =3D 1; + break; + case 1: + sdp_send_data(&sdp_con_list[0], sdp_data_55112_2, sdp_data_55112_2[4] = + 5); + t =3D 0; + break; } +} =20 =20 /*=20 + * Serial Port Profile Stuff + */ + +void spp_test_52211(void) +{ + static int t =3D 0; +=20=20 + unsigned char sdp_query[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d, + 0x35, 0x03, 0x19, 0x11, 0x01, 0x00, 0xff, + 0x35, 0x03, 0x09, 0x00, 0x04, 0x00}; + + switch (t) { + case 0: + sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); + t++; + break; + case 1: + printf(__FUNCTION__": Establish RFCOMM on channel 0\n"); + t++; + break; + printf(__FUNCTION__": Establish RFCOMM on channel 2\n"); + t =3D 0; + break; + } +} + +void spp_test_52311(void) +{ + static int t =3D 0; + + switch(t) { + case 0: + hci_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xff, 0xf0, 0x10, 0x= 05); + t =3D 1; + break; + case 1: + hci_exit_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl); + t =3D 0; + break; + } +} + +void spp_test_52312(void) +{ + static int t =3D 0; + + switch(t) { + case 0: + hci_park_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); + t =3D 1; + break; + case 1: + hci_exit_park_mode(rfcomm_con_list[0].l2cap->hci_hdl); + t =3D 0; + break; + } +} + +void spp_test_52313(void) +{ + hci_hold_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); +} + +void spp_test_52314(void) +{ + printf(__FUNCTION__": Do test 52211, then do a M/S switch\n"); +} + + +void spp_test_53112(void) +{ + /* Establish a L2CAP channel in PSM 3 (RFCOMM), before doing this test */ + + rfcomm_sabm_msg(&rfcomm_con_list[0], 0); +} + +void spp_test_53211(void) +{ /* This test has to be done rigth after test 53112 */ + + rfcomm_disc_msg(&rfcomm_con_list[0], 0); +} + +void spp_test_53312(void) +{ + /* Establish a L2CAP channel in PSM 3 (RFCOMM), and establish DLCI 0 bef= ore + doing this test */ + + rfcomm_sabm_msg(&rfcomm_con_list[0], 2); +} + +void spp_test_53411(void) +{ + /* Establish a L2CAP channel in PSM 3 (RFCOMM), and establish DLCI 0 and= 2 + before doing this test */ + + /* Here the BAP should send the disc command so we just have to wait for + that, rf_disc should probably work in the BAP */ +=09 +} + +void spp_test_53412(void) +{ /* This test has to be done rigth after test 53116 */ + + rfcomm_disc_msg(&rfcomm_con_list[0], 2); +} + +void spp_test_53511(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + /* Send data from the BAp with the rf_send command */ +=20=20 + rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 2); +} + +void spp_test_53611(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ +=20=20 + /* Then send data from the BAP with the rf_send command */ +} + +void spp_test_53711(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + unsigned char data[] =3D {0,1,2,3,4,5,6,7,9}; +=20=20 + /* We send a test messages of ten bytes size */ + rfcomm_test_msg(&rfcomm_con_list[0], data, 10, MCC_CMD); +} + +void spp_test_53811(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + static int t =3D 0; + + switch (t) { + case 0: + rfcomm_fcoff_msg(&rfcomm_con_list[0], MCC_CMD); + printf(__FUNCTION__": Flow is set to OFF\n"); + t++; + break; + case 1: + rfcomm_fcon_msg(&rfcomm_con_list[0], MCC_CMD); + printf(__FUNCTION__": Flow is set to ON\n"); + t =3D 0; + break; + } +} + +void spp_test_53911(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0x05); +} + +void spp_test_531011(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + static int t =3D 0; +=20=20 + switch (t) { + case 0: + rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 1000); + t++; + break; + case 1: + rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 667); + break; + } +} + +void spp_test_531111(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); +} + +void spp_test_531112(void) +{ + /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + verify so both sides have sent a MSC command with flow on */ + + rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); +} + +void spp_test_55111(void) +{ + /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + + unsigned char sdp_query[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, + 0x35, 0x03, 0x19, 0x00, 0x03, 0x00, 0xff, 0x00}; + + sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); +} + +void spp_test_55112(void) +{ + /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + + unsigned char sdp_query[] =3D {0x04, 0x88, 0x88, 0x00, 0x12, + 0x01, 0x00, 0xff, 0xff, 0x00, 0xff, 0x35, 0x09, + 0x09, 0x00, 0x01, 0x09, 0x00, 0x04, 0x09, 0x01, + 0x00, 0x00}; + + + sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); +} + +void spp_test_55113(void) +{ + /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + + unsigned char sdp_query[] =3D {0x06, 0x88, 0x88, 0x00, 0x13, + 0x35, 0x03, 0x19, 0x12, 0x34, 0x00, 0xff, 0x35, + 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x04, 0x09, + 0x01, 0x00, 0x00}; + + + sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); +} + + +void spp_test_56211(void) +{ + /* Run the hci_write_encryption_mode(1) in hci_init */ +} + +/*=20 * RFCOMM stuff=20 */ =20 @@ -1126,8 +1392,6 @@ break; case 251: test_2_5_1(); break; - case 252: test_2_5_2(); - break; case 253: test_2_5_3(); break; case 254: test_2_5_4(); @@ -1162,64 +1426,104 @@ case 2131 : test_2_13_1(); break; =20=20=20=20=20 - case 52111: test_52111(); + case 52111: sdp_test_52111(); break; - case 52113: test_52113(); + case 52113: sdp_test_52113(); break; - case 52114: test_52114(); + case 52114: sdp_test_52114(); break;=20 - case 52121: test_52121(); + case 52121: sdp_test_52121(); break; - case 52122: test_52122(); + case 52122: sdp_test_52122(); break;=20=20 - case 53111: test_53111(); + case 53111: sdp_test_53111(); break; - case 53113: test_53113(); + case 53113: sdp_test_53113(); break; - case 53114: test_53114(); + case 53114: sdp_test_53114(); break; - case 53115: test_53115(); + case 53115: sdp_test_53115(); break; - case 53118: test_53118(); + case 53118: sdp_test_53118(); break; - case 531110: test_531110(); + case 531110: sdp_test_531110(); break; - case 531117: test_531117(); + case 531117: sdp_test_531117(); break; - case 531120: test_531120(); + case 531120: sdp_test_531120(); break; - case 53121: test_53121(); + case 53121: sdp_test_53121(); break; - case 53122: test_53122(); + case 53122: sdp_test_53122(); break; - case 53123: test_53123(); + case 53123: sdp_test_53123(); break; - case 54111: test_54111(); + case 54111: sdp_test_54111(); break; - case 54112: test_54112(); + case 54112: sdp_test_54112(); break; - case 54113: test_54113(); + case 54113: sdp_test_54113(); break; - case 54114: test_54114(); + case 54114: sdp_test_54114(); break; - case 54116: test_54116(); + case 54116: sdp_test_54116(); break; - case 541110: test_541110(); + case 541110: sdp_test_541110(); break; - case 541111: test_541111(); + case 541111: sdp_test_541111(); break; - case 541112: test_541112(); + case 541112: sdp_test_541112(); break; - case 541120: test_541120(); + case 541120: sdp_test_541120(); break; - case 54121: test_54121(); + case 54121: sdp_test_54121(); break; - case 54122: test_54122(); + case 54122: sdp_test_54122(); break; - case 55111: test_55111(); + case 55111: sdp_test_55111(); break; - case 55112: test_55112(); + case 55112: sdp_test_55112(); + break; + + case 62211: spp_test_52211(); + break; +=20=20=20=20 + case 62311: spp_test_52311(); + break; + case 62312: spp_test_52312(); + break; + case 62313: spp_test_52313(); + break; + case 62314: spp_test_52314(); + break; + case 63112: spp_test_53112(); break; + case 63211: spp_test_53211(); + break; + case 63312: spp_test_53312(); + break; + case 63411: spp_test_53411(); + break; + case 63412: spp_test_53412(); + break; + case 63511: spp_test_53511(); + break; + case 63611: spp_test_53611(); + break; + case 63711: spp_test_53711(); + break; + case 63811: spp_test_53811(); + break; + case 63911: spp_test_53911(); + break; + case 631011: spp_test_531011(); + break; + case 631111: spp_test_531111(); + break; + case 631112: spp_test_531112(); + break; + case 66211: spp_test_56211(); + break; =20=20=20=20=20 case 41: test_4_1(); break; @@ -1299,7 +1603,6 @@ break; case 428: test_4_28(); break;=20=20=20=20=20=20=20=20=20=20=20=20=20 -=20=20=20=20 =20 case 51: test_5_1(); break; |
From: Mats F. <ma...@us...> - 2001-06-08 12:50:16
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_internal.h 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed trash_buffer from hci_controller struct The diff of the modified file(s): --- hci_internal.h 2001/06/06 14:58:20 1.17 +++ hci_internal.h 2001/06/08 12:50:15 1.18 @@ -325,16 +325,11 @@ u8 name[248]; } __attribute__ ((packed)) hci_con; =20 -/* Used as a control object for the entire HCI layer. The trash_buffer is - only used as an emergency buffer to avoid a program crash if something = has - gone wrong with the hci_in_buffers */ - -/* FIXME: Do we really need the trash_buffer? */ +/* Used as a control object for the entire HCI layer */ =20 typedef struct hci_controller { host_controller_buffers hc_buf; hci_in_buffer hci_in_buf[NBR_OF_HCI_INBUFFERS]; - hci_in_buffer trash_buffer; u32 nbr_of_connections; u8 local_bd[6]; s32 active_connection; |
From: Mats F. <ma...@us...> - 2001-06-08 12:46:50
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_sequence.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: If winspace becomes greater than WINSIZE, set winspace to WINSIZE The diff of the modified file(s): --- bcsp_sequence.c 2001/06/07 09:11:48 1.12 +++ bcsp_sequence.c 2001/06/08 12:46:49 1.13 @@ -255,6 +255,7 @@ } else if (winspace > WINSIZE) { printk(__FUNCTION__": ERROR winspace > WINSIZE [%d]\n",=20 winspace); + winspace =3D WINSIZE; release_resend_timer(); }=20 =20=09 |
From: Mats F. <ma...@us...> - 2001-06-08 12:39:43
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.43 1.44=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: The sequence nbr should not be updated in a GETRESP The diff of the modified file(s): --- hci_vendor.c 2001/06/06 16:28:01 1.43 +++ hci_vendor.c 2001/06/08 12:39:42 1.44 @@ -637,7 +637,6 @@ DSYS(__FUNCTION__": Received a SETREQ, sending back GETRESP\n"); print_data(__FUNCTION__, data, count); cmd->type =3D CSR_MSGTYPE_GETRESP; - cmd->seq =3D csr_count++; =20=09 csr_send_general_hq(cmd); =20=09=09=09 @@ -924,7 +923,6 @@ c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); c_pkt.len =3D 1 + 5*sizeof(u16) + 4*sizeof(u16); - =20 msg =3D (csr_msg *)c_pkt.data; cmd =3D (csr_bccmd *)msg->msg; |
From: Peter K. <pk...@us...> - 2001-06-08 12:01:27
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.156 1.157=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Minor change to debug messages. The diff of the modified file(s): --- hci.c 2001/06/07 14:33:41 1.156 +++ hci.c 2001/06/08 12:01:26 1.157 @@ -256,6 +256,7 @@ #endif =20 static void send_acl_data_task(void); + /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 /* Struct used for sending command packets */ @@ -357,7 +358,7 @@ u8 *buf; /* Temporary pointer to the incoming data */ u32 tmp_data_len; =20=20 - PRINTPKT(__FUNCTION__", ", data, count); + PRINTPKT(__FUNCTION__ ": ", data, count); =20=20=20 tmp_data_len =3D count; buf =3D data; @@ -366,14 +367,14 @@ packet is received it is copied into a buffer and sent to the=20 processing function */ =20=20=20 - D_INDATA(__FUNCTION__", hci-%d\n", tmp_data_len); + D_INDATA(__FUNCTION__ ": hci-%d\n", tmp_data_len); while (count > 0) { switch (state) { =20=09=09=09 /* The first byte will tell us whether it is an event or a data packet */ case WAIT_FOR_PACKET_TYPE: - D_STATE(__FUNCTION__", WAIT_FOR_PACKET_TYPE\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_PACKET_TYPE\n"); tmp_pos =3D 0; switch(*buf) { case EVENT_PKT: state =3D WAIT_FOR_EVENT_TYPE; break; @@ -400,7 +401,7 @@ /* If it is an event packet we wait for the next byte which tell us which kind of event it is */=20 case WAIT_FOR_EVENT_TYPE: - D_STATE(__FUNCTION__", WAIT_FOR_EVENT_TYPE\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_EVENT_TYPE\n"); event_type =3D *buf; state =3D WAIT_FOR_EVENT_LENGTH; buf++; @@ -409,7 +410,7 @@ =20 /* If it is an event the length-field is one byte */ case WAIT_FOR_EVENT_LENGTH: - D_STATE(__FUNCTION__", WAIT_FOR_EVENT_LENGTH\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_EVENT_LENGTH\n"); event_len =3D *buf; buf++; count--; @@ -441,7 +442,7 @@ /* Before we can parse the event, we wait for the whole event */ case WAIT_FOR_EVENT_PARAM: - D_STATE(__FUNCTION__", WAIT_FOR_EVENT_PARAM\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_EVENT_PARAM\n"); if (tmp_pos < event_len) { c =3D MIN(count, event_len - tmp_pos); memcpy(event_buf + tmp_pos, buf, c); @@ -458,7 +459,7 @@ =20 /* Here we wait for the whole data header, four bytes*/ case WAIT_FOR_ACL_HDR: - D_STATE(__FUNCTION__", WAIT_FOR_ACL_HDR\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_ACL_HDR\n"); c =3D MIN(count, ACL_HDR_LEN - tmp_pos); memcpy(hdr + tmp_pos, buf, c); tmp_pos +=3D c; @@ -484,14 +485,14 @@ } =20 if (pb_flag =3D=3D L2CAP_FRAME_START) { - D_REC(__FUNCTION__", new frame\n"); + D_REC(__FUNCTION__ ": New frame\n"); in_buf =3D get_free_inbuffer(); if (in_buf) { in_buf->nbr_of_hci_pkt =3D 1; in_buf->hci_hdl =3D hci_hdl; }=09 } else { - D_REC(__FUNCTION__", cont frame\n"); + D_REC(__FUNCTION__ ": Cont frame\n"); in_buf =3D get_inbuffer(hci_hdl); if (in_buf) { in_buf->nbr_of_hci_pkt++; @@ -506,9 +507,9 @@ tmp_pos =3D 0; state =3D WAIT_FOR_ACL_DATA; } else if (tmp_pos < ACL_HDR_LEN) { - D_REC(__FUNCTION__" Didn't got whole header length, waiting for more\n= "); + D_REC(__FUNCTION__ ": Didn't got whole header length, waiting for more= \n"); } else { - D_ERR(__FUNCTION__" incorredt ACL header length\n"); + D_ERR(__FUNCTION__ ": incorredt ACL header length\n"); } break; =20 @@ -516,7 +517,7 @@ whole data packet and then we send it to a higher protocol layer, in this case the L2CAP-layer */ case WAIT_FOR_ACL_DATA: - D_STATE(__FUNCTION__", WAIT_FOR_ACL_DATA\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_ACL_DATA\n"); /* Find out how much data we can copy, don't copy more than one HCI packet at time */ c =3D MIN(count, data_len - tmp_pos); @@ -524,7 +525,7 @@ memcpy(in_buf->buf_ptr, buf, c); in_buf->buf_ptr +=3D c; in_buf->count +=3D c; - D_REC(__FUNCTION__", in_buf->count =3D %d\n",in_buf->count); + D_REC(__FUNCTION__ ": in_buf->count =3D %d\n",in_buf->count); } =20=20=20=20=20=20=20 /* Increase the data_index and decrease the amount of @@ -532,7 +533,7 @@ tmp_pos +=3D c; count -=3D c; =20=20=20=20=20=20=20 - D_REC(__FUNCTION__", Copied %d bytes into inbuffer\n",c); + D_REC(__FUNCTION__ ": Copied %d bytes into inbuffer\n",c); if (tmp_pos =3D=3D data_len) { if (in_buf) { process_acl_data(in_buf, pb_flag); @@ -546,7 +547,7 @@ =20=20=20=20=20=20=20 /* wait for the SCO header, three bytes */ case WAIT_FOR_SCO_HDR: - D_STATE(__FUNCTION__", WAIT_FOR_SCO_HDR\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_SCO_HDR\n"); if (tmp_pos < SCO_HDR_LEN) { c =3D MIN(count,SCO_HDR_LEN - tmp_pos); memcpy(hdr + tmp_pos, buf, c); @@ -565,7 +566,7 @@ /* Wait for the rest of the SCO packet and send it to the tty */ case WAIT_FOR_SCO_DATA: - D_STATE(__FUNCTION__", WAIT_FOR_SCO_DATA\n"); + D_STATE(__FUNCTION__ ": WAIT_FOR_SCO_DATA\n"); c =3D MIN(count, data_len - tmp_pos); process_sco_packet(buf, hci_hdl, c); tmp_pos +=3D c; @@ -580,7 +581,7 @@ break; =20 default: - D_ERR(__FUNCTION__", : Oups shouldn't be possible...\n"); + D_ERR(__FUNCTION__ ": Oops shouldn't be possible...\n"); break; } } @@ -601,7 +602,7 @@ tmp_buf +=3D 2; count -=3D 2; =20 - D_REC(__FUNCTION__", Received event 0x%02x with len:%d\n", event_type, e= vent_len); + D_REC(__FUNCTION__ ": Received event 0x%02x with len:%d\n", event_type, = event_len); =20=09=09 process_event(tmp_buf, event_len, event_type); tmp_buf +=3D event_len; @@ -643,14 +644,14 @@ } =20=09=09 if (pb_flag =3D=3D L2CAP_FRAME_START) { - D_REC(__FUNCTION__", new L2CAP frame\n"); + D_REC(__FUNCTION__ ": New L2CAP frame\n"); in_buf =3D get_free_inbuffer(); if (in_buf) { in_buf->nbr_of_hci_pkt =3D 1; in_buf->hci_hdl =3D hci_hdl; }=09 } else { - D_REC(__FUNCTION__", cont L2CAP frame\n"); + D_REC(__FUNCTION__ ": Cont L2CAP frame\n"); in_buf =3D get_inbuffer(hci_hdl); if (in_buf) { in_buf->nbr_of_hci_pkt++; @@ -659,13 +660,13 @@ =20=09=09 if (in_buf) { memcpy(in_buf->buf_ptr, tmp_buf, data_len); - D_REC(__FUNCTION__", Copied %d bytes into inbuffer\n", + D_REC(__FUNCTION__ ": Copied %d bytes into inbuffer\n", data_len); in_buf->buf_ptr +=3D data_len; in_buf->count +=3D data_len; - D_REC(__FUNCTION__", in_buf->count:%d\n", in_buf->count); + D_REC(__FUNCTION__ ": in_buf->count: %d\n", in_buf->count); } else { - D_ERR(__FUNCTION__", No inbuffer was found, "\ + D_ERR(__FUNCTION__ ": No inbuffer was found, "\ "discarding data\n"); return; } @@ -705,7 +706,7 @@ { s32 i; =20 - D_REC(__FUNCTION__", acl_num before : %d\n", hci_ctrl.hc_buf.acl_num); + D_REC(__FUNCTION__ ": acl_num before: %d\n", hci_ctrl.hc_buf.acl_num); =20=09 /* FIXME */ /* Check if we have to register which connection handlers that @@ -718,7 +719,7 @@ =20=09 D_QUEUE("<NCP:%d>\n",hci_ctrl.hc_buf.acl_num); =20 - D_REC(__FUNCTION__", acl_num after : %d\n", hci_ctrl.hc_buf.acl_num); + D_REC(__FUNCTION__ ": acl_num after: %d\n", hci_ctrl.hc_buf.acl_num); =20 /* We've just been notified that the hardware has free buffers. If we have any outstanding packets, send_acl_data_task will try @@ -766,7 +767,7 @@ wake_up_interruptible(&inq_wq); #ifndef __KERNEL__ for (i =3D 0; i < inq_res->nbr_of_units; i++) { - D_CMD(__FUNCTION__", BD %d: %02x:%02x:%02x:%02x:%02x:%02x\n",i, + D_CMD(__FUNCTION__ ": BD %d: %02x:%02x:%02x:%02x:%02x:%02x\n",i, inq_res->bd_addr[0+6*i],inq_res->bd_addr[1+6*i], inq_res->bd_addr[2+6*i],inq_res->bd_addr[3+6*i], inq_res->bd_addr[4+6*i],inq_res->bd_addr[5+6*i]); @@ -779,7 +780,7 @@ s32 i, j; u8 tmp_bd[6]; =20 - D_CMD(__FUNCTION__", INQUIRY_RESULT\n"); + D_CMD(__FUNCTION__ ": INQUIRY_RESULT\n"); for(i =3D 1; i < (buf[0] * 14) + 1; i +=3D 14) {=09=09 printk("BD addr %d\n", i % 14); =20=09=09=09 @@ -807,7 +808,7 @@ { u8 link_type; =20 - D_CMD(__FUNCTION__", CONNECTION_COMPLETE: %s\n", + D_CMD(__FUNCTION__ ": CONNECTION_COMPLETE: %s\n", get_err_msg(buf[0])); =20 hci_ctrl.nbr_of_connections++; @@ -822,12 +823,12 @@ #ifndef HCI_EMULATION if (buf[0]) { /* remove hci handle if connection failed */ - DSYS(__FUNCTION__", CONNECTION_COMPLETE %s\n",=20 + DSYS(__FUNCTION__ ": CONNECTION_COMPLETE %s\n", get_err_msg(buf[0])); hci_ctrl.nbr_of_connections--; reset_hci_con_bd(hci_hdl); } else { - DSYS(__FUNCTION__", ACL link is up\n"); + DSYS(__FUNCTION__ ": ACL link is up\n"); #ifdef CONFIG_BLUETOOTH_ERICSSON change_connection_packet_type(hci_hdl,=20 DM3|DH3|DM5|DH5); @@ -865,18 +866,18 @@ break; } case CONNECTION_REQUEST: - D_CMD(__FUNCTION__", CONNECTION_REQUEST\n"); + D_CMD(__FUNCTION__ ": CONNECTION_REQUEST\n"); =20 if (buf[9] =3D=3D ACL_LINK) { lp_connect_ind(buf); /* BD_ADDRESS */ } else { - printk(__FUNCTION__", CONNECTION_REQUEST for SCO LINK"); + printk(__FUNCTION__ ": CONNECTION_REQUEST for SCO LINK"); accept_connection_request(buf, 0x01); /* role ignored for SCO */ } break; =20 case DISCONNECTION_COMPLETE: - DSYS(__FUNCTION__", DISCONNECTION_COMPLETE %s\n", get_err_msg(buf[3])); + DSYS(__FUNCTION__ ": DISCONNECTION_COMPLETE %s\n", get_err_msg(buf[3])); lp_disconnect_ind(CHAR2INT12(buf[2], buf[1])); /* FIXME: No more NBR_OF_COMPLETE_PACKETS will arrive for this connection handle, if we only support point-to-point @@ -892,10 +893,10 @@ break; =20 case AUTHENTICATION_COMPLETE: - DSYS(__FUNCTION__", AUTHENTICATION_COMPLETE\n"); + DSYS(__FUNCTION__ ": AUTHENTICATION_COMPLETE\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER if (buf[0]) { - D_ERR(__FUNCTION__", AUTHENTICATION_COMPLETE: %s\n", get_err_msg(buf[0]= )); + D_ERR(__FUNCTION__ ": AUTHENTICATION_COMPLETE: %s\n", get_err_msg(buf[0= ])); =20=09=09=09 } =20=09=09 @@ -904,13 +905,13 @@ break; =20 case REMOTE_NAME_REQUEST_COMPLETE: - D_CMD(__FUNCTION__", REMOTE_NAME_REQUEST_COMPLETE %s\n", buf + 7); + D_CMD(__FUNCTION__ ": REMOTE_NAME_REQUEST_COMPLETE %s\n", buf + 7); if (buf[0]) { - D_ERR(__FUNCTION__", REMOTE_NAME_REQUEST_COMPLETE: %s\n", + D_ERR(__FUNCTION__ ": REMOTE_NAME_REQUEST_COMPLETE: %s\n", get_err_msg(buf[0])); } else { if (strlen(buf + 7) > 248) { - D_ERR(__FUNCTION__", REMOTE_NAME_REQUEST_COMPLETE: too long name lengt= h %d\n", (int)strlen(buf + 7)); + D_ERR(__FUNCTION__ ": REMOTE_NAME_REQUEST_COMPLETE: too long name leng= th %d\n", (int)strlen(buf + 7)); break; } set_hci_con_name(buf + 1, buf + 7); @@ -918,10 +919,10 @@ break; =20 case ENCRYPTION_CHANGE: - DSYS(__FUNCTION__", ENCRYPTION_CHANGE\n"); + DSYS(__FUNCTION__ ": ENCRYPTION_CHANGE\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER if (buf[0]) { - D_ERR(__FUNCTION__", ENCRYPTION_CHANGE: %s\n", get_err_msg(buf[0])); + D_ERR(__FUNCTION__ ": ENCRYPTION_CHANGE: %s\n", get_err_msg(buf[0])); } =20 { @@ -935,27 +936,27 @@ break; =20=09 case CHANGE_CONNECTION_LINK_KEY_COMPLETE: - DSYS(__FUNCTION__", CHANGE_CONNECTION_LINK_KEY_COMPLETE Not implemented!= \n"); + DSYS(__FUNCTION__ ": CHANGE_CONNECTION_LINK_KEY_COMPLETE Not implemented= !\n"); break; =20 case MASTER_LINK_KEY_COMPLETE: - DSYS(__FUNCTION__", MASTER_LINK_KEY_COMPLETE Not implemented!\n"); + DSYS(__FUNCTION__ ": MASTER_LINK_KEY_COMPLETE Not implemented!\n"); break; =20 case READ_REMOTE_SUPPORTED_FEATURES_COMPLETE: - DSYS(__FUNCTION__", READ_REMOTE_SUPPORTED_FEATURES_COMPLETE Not implemen= ted!\n"); + DSYS(__FUNCTION__ ": READ_REMOTE_SUPPORTED_FEATURES_COMPLETE Not impleme= nted!\n"); break; =20 case READ_REMOTE_VERSION_INFORMATION_COMPLETE: - DSYS(__FUNCTION__", READ_REMOTE_VERSION_INFORMATION_COMPLETE Not impleme= nted!\n"); + DSYS(__FUNCTION__ ": READ_REMOTE_VERSION_INFORMATION_COMPLETE Not implem= ented!\n"); break; =20 case QOS_SETUP_COMPLETE: - DSYS(__FUNCTION__", QOS_SETUP_COMPLETE\n"); + DSYS(__FUNCTION__ ": QOS_SETUP_COMPLETE\n"); break; =20 case COMMAND_COMPLETE: - D_CMD(__FUNCTION__", COMMAND_COMPLETE\n"); + D_CMD(__FUNCTION__ ": COMMAND_COMPLETE\n"); =20 /* FIXME - stop any outstanding send timers if cmd_num is > 0*/ D_QUEUE("<CC>\n"); @@ -970,7 +971,7 @@ =20=09=09 case COMMAND_STATUS: =20=09=09 - D_CMD(__FUNCTION__", COMMAND_STATUS\n"); + D_CMD(__FUNCTION__ ": COMMAND_STATUS\n"); =20=09=09 if (buf[0]) {=09=09=09 =20 @@ -979,7 +980,7 @@ command status with "ACL link already exist" is returned=20 This must be signalled using lp_connect_cfm (neg) */ - D_ERR(__FUNCTION__", COMMAND_STATUS: %s\n",get_err_msg(buf[0])); + D_ERR(__FUNCTION__ ": COMMAND_STATUS: %s\n", get_err_msg(buf[0])); #ifdef USE_INQTIMER if (hci_inq_pending) release_inq_timer(); @@ -989,48 +990,48 @@ update_nhcp(buf[1]); break; case FLUSH_OCCURRED: - D_CMD(__FUNCTION__", FLUSH_OCCURRED on hci_hdl %d\n", + D_CMD(__FUNCTION__ ": FLUSH_OCCURRED on hci_hdl %d\n", CHAR2INT12(buf[1],buf[0])); btmem_flushhandle(CHAR2INT12(buf[1],buf[0])); break; =20 case HARDWARE_ERROR: - D_ERR(__FUNCTION__", An hardware error with error code 0x%02x occurred\n= Please refer to your bluetooth module manual\n", buf[0]); + D_ERR(__FUNCTION__ ": An hardware error with error code 0x%02x occurred\= n Please refer to your bluetooth module manual\n", buf[0]); break; =20 case ROLE_CHANGED: - DSYS(__FUNCTION__", ROLE_CHANGED\n"); + DSYS(__FUNCTION__ ": ROLE_CHANGED\n"); =20=09=09 if (buf[0]) {=20 - D_ERR(__FUNCTION__", Role changed failed due to %s\n", + D_ERR(__FUNCTION__ ": Role changed failed due to %s\n", get_err_msg(buf[0])); =20=09=09=09 /* fixme -- Notify l2cap that this BD will go down */ =20=09=09=09 } else if (buf[7]) { - DSYS(__FUNCTION__", Current master is 0x%04x%08x\n",=20 + DSYS(__FUNCTION__ ": Current master is 0x%04x%08x\n",=20 CHAR2INT16(buf[6], buf[5]),=20 CHAR2INT32(buf[4], buf[3], buf[2], buf[1])); } else { - DSYS(__FUNCTION__", Our role is master for BD Address 0x%04x%08x\n", CH= AR2INT16(buf[6], buf[5]), CHAR2INT32(buf[4], buf[3], buf[2], buf[1])); + DSYS(__FUNCTION__ ": Our role is master for BD Address 0x%04x%08x\n", C= HAR2INT16(buf[6], buf[5]), CHAR2INT32(buf[4], buf[3], buf[2], buf[1])); } break; =20 case NBR_OF_COMPLETED_PACKETS:=20 =20 - D_CMD(__FUNCTION__", NUMBER_OF_COMPLETED_PACKETS\n"); + D_CMD(__FUNCTION__ ": NUMBER_OF_COMPLETED_PACKETS\n"); =20 update_ncp(buf[0], buf + 1); =20 break; =20 case MODE_CHANGE: - D_CMD(__FUNCTION__", MODE_CHANGE on hci_hdl %d\n", + D_CMD(__FUNCTION__ ": MODE_CHANGE on hci_hdl %d\n", CHAR2INT12(buf[2],buf[1])); break; =20 case RETURN_LINK_KEYS: - D_CMD(__FUNCTION__", RETURN_LINK_KEYS event\n"); + D_CMD(__FUNCTION__ ": RETURN_LINK_KEYS event\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER { u8 tmp_str[23]; @@ -1047,57 +1048,56 @@ break; =20=09 case PIN_CODE_REQUEST: - D_CMD(__FUNCTION__", PIN_CODE_REQUEST forwarding event to security manag= er\n"); + D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST forwarding event to security mana= ger\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER sec_man_event(HCI, buf, PIN_CODE_REQUEST, NULL, 0); #endif break; =20=09 case LINK_KEY_REQUEST: - D_CMD(__FUNCTION__", LINK_KEY_REQUEST\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER sec_man_event(HCI, buf, LINK_KEY_REQUEST, NULL, 0); #endif break; =20 case LINK_KEY_NOTIFICATION: - D_CMD(__FUNCTION__", LINK_KEY_NOTIFICATION forwarding event to security = manager\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_NOTIFICATION forwarding event to security= manager\n"); #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER sec_man_event(HCI, buf, LINK_KEY_NOTIFICATION, buf + 6, 16); #endif break; =20 case LOOPBACK_COMMAND: - DSYS(__FUNCTION__", LOOPBACK_COMMAND, loopback mode not supported\n"); + DSYS(__FUNCTION__ ": LOOPBACK_COMMAND, loopback mode not supported\n"); break; =20 case DATA_BUFFER_OVERFLOW: - D_ERR(__FUNCTION__", DATA_BUFFER_OVERFLOW\n"); + D_ERR(__FUNCTION__ ": DATA_BUFFER_OVERFLOW\n"); break; =20 case MAX_SLOTS_CHANGE: - D_CMD(__FUNCTION__", MAX_SLOTS_CHANGE to %d\n", - (u32) buf[2]); + D_CMD(__FUNCTION__ ": MAX_SLOTS_CHANGE to %d\n", (u32) buf[2]); break; =20 case READ_CLOCK_OFFSET_COMPLETE: - D_CMD(__FUNCTION__", READ_CLOCK_OFFSET_COMPLETE\n"); + D_CMD(__FUNCTION__ ": READ_CLOCK_OFFSET_COMPLETE\n"); break; =20 case CONNECTION_PACKET_TYPE_CHANGED: - D_CMD(__FUNCTION__", CHANGE_CONNECTION_PACKET_TYPE\n"); + D_CMD(__FUNCTION__ ": CHANGE_CONNECTION_PACKET_TYPE\n"); break; =20 case QOS_VIOLATION: - D_CMD(__FUNCTION__", QOS_VIOLATION\n"); + D_CMD(__FUNCTION__ ": QOS_VIOLATION\n"); break; =20 case PAGE_SCAN_MODE_CHANGE: - DSYS(__FUNCTION__", PAGE_SCAN_MODE_CHANGE Not implemented\n"); + DSYS(__FUNCTION__ ": PAGE_SCAN_MODE_CHANGE Not implemented\n"); break; =20 case PAGE_SCAN_REPETITION_MODE_CHANGE: - DSYS(__FUNCTION__", PAGE_SCAN_REPETITION_MODE_CHANGE Not implemented\n"); + DSYS(__FUNCTION__ ": PAGE_SCAN_REPETITION_MODE_CHANGE Not implemented\n"= ); break;=09 =20 case VENDOR_EVENT: @@ -1105,7 +1105,7 @@ break; =20 default: - DSYS(__FUNCTION__", UNKNOWN EVENT CODE 0x%x\n",event_code); + DSYS(__FUNCTION__ ": UNKNOWN EVENT CODE 0x%x\n", event_code); break; } } @@ -1142,13 +1142,13 @@ case LINK_KEY_REQUEST_REPLY: release_cmd_timer(); =20=09=09=09 - D_CMD(__FUNCTION__", LINK_KEY_REQUEST_REPLY\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_REPLY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", LINK_KEY_REQUEST_REPLY %s\n", get_err_msg(r_val[0= ])); + D_ERR(__FUNCTION__ ": LINK_KEY_REQUEST_REPLY %s\n", get_err_msg(r_val[= 0])); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", LINK_KEY_REQUEST_REPLY Success\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_REPLY Success\n"); result_param =3D 0; } =20=09=09=09 @@ -1158,13 +1158,13 @@ case LINK_KEY_REQUEST_NEGATIVE_REPLY: release_cmd_timer(); =20=09=09=09 - D_CMD(__FUNCTION__", LINK_KEY_REQUEST_NEGATIVE_REPLY\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_NEGATIVE_REPLY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", LINK_KEY_REQUEST_NEGATIVE_REPLY %s\n", get_err_ms= g(r_val[0])); + D_ERR(__FUNCTION__ ": LINK_KEY_REQUEST_NEGATIVE_REPLY %s\n", get_err_m= sg(r_val[0])); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", LINK_KEY_REQUEST_NEGATIVE_REPLY Success\n"); + D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_NEGATIVE_REPLY Success\n"); result_param =3D 0; } =20=09=09=09 @@ -1174,13 +1174,13 @@ case PIN_CODE_REQUEST_REPLY: release_cmd_timer(); =20=09=09=09=09=09 - D_CMD(__FUNCTION__", PIN_CODE_REQUEST_REPLY\n"); + D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_REPLY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", PIN_CODE_REQUEST_REPLY %s\n", get_err_msg(r_val[0= ])); + D_ERR(__FUNCTION__ ": PIN_CODE_REQUEST_REPLY %s\n", get_err_msg(r_val[= 0])); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", PIN_CODE_REQUEST_REPLY Success\n"); + D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_REPLY Success\n"); result_param =3D 0; } =20 @@ -1191,13 +1191,13 @@ case PIN_CODE_REQUEST_NEGATIVE_REPLY: release_cmd_timer(); =20=09=09=09 - D_CMD(__FUNCTION__", PIN_CODE_REQUEST_NEGATIVE_REPLY\n"); + D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_NEGATIVE_REPLY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", PIN_CODE_REQUEST_NEGATIVE_REPLY %s\n", get_err_ms= g(r_val[0])); + D_ERR(__FUNCTION__ ": PIN_CODE_REQUEST_NEGATIVE_REPLY %s\n", get_err_m= sg(r_val[0])); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", PIN_CODE_REQUEST_NEGATIVE_REPLY Success\n"); + D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_NEGATIVE_REPLY Success\n"); result_param =3D 0; } =20 @@ -1205,7 +1205,7 @@ break;=09 =20 default: - D_CMD(__FUNCTION__", HCI_LC, ocf %d not recognised!\n", ocf); + D_CMD(__FUNCTION__ ": HCI_LC, ocf %d not recognised!\n", ocf); break; } =20 @@ -1219,64 +1219,64 @@ switch (ocf) { =20=09=09=09 case CREATE_NEW_UNIT_KEY: - D_CMD(__FUNCTION__", CREATE_NEW_UNIT_KEY\n"); + D_CMD(__FUNCTION__ ": CREATE_NEW_UNIT_KEY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", CREATE_NEW_UNIT_KEY %s\n", get_err_msg(r_val[0])); + D_ERR(__FUNCTION__ ": CREATE_NEW_UNIT_KEY %s\n", get_err_msg(r_val[0])= ); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", CREATE_NEW_UNIT_KEY Success\n"); + D_CMD(__FUNCTION__ ": CREATE_NEW_UNIT_KEY Success\n"); result_param =3D 0; } break; =20=09=09=09 =20=09=09=09 case READ_STORED_LINK_KEY: - DSYS(__FUNCTION__", READ_STORED_LINK_KEY\n"); + DSYS(__FUNCTION__ ": READ_STORED_LINK_KEY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_STORED_LINK_KEY %s\n", get_err_msg(r_val[0])= ); + D_ERR(__FUNCTION__ ": READ_STORED_LINK_KEY %s\n", get_err_msg(r_val[0]= )); result_param =3D - r_val[0]; } else { - D_CMD(__FUNCTION__", READ_STORED_LINK_KEY Success\n"); + D_CMD(__FUNCTION__ ": READ_STORED_LINK_KEY Success\n"); result_param =3D CHAR2INT32(r_val[4], r_val[3], r_val[2], r_val[= 1]); } - DSYS(__FUNCTION__", Max number of Linkkeys: %d\n", + DSYS(__FUNCTION__ ": Max number of Linkkeys: %d\n", CHAR2INT16(r_val[2], r_val[1])); - DSYS(__FUNCTION__", Number of Linkkeys read: %d\n", + DSYS(__FUNCTION__ ": Number of Linkkeys read: %d\n", CHAR2INT16(r_val[4], r_val[3])); break; =20 case WRITE_STORED_LINK_KEY: - D_CMD(__FUNCTION__", WRITE_STORED_LINK_KEY\n"); + D_CMD(__FUNCTION__ ": WRITE_STORED_LINK_KEY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_STORED_LINK_KEY %s\n", get_err_msg(r_val[0]= )); + D_ERR(__FUNCTION__ ": WRITE_STORED_LINK_KEY %s\n", get_err_msg(r_val[0= ])); result_param =3D - r_val[0];=20 } else { - D_CMD(__FUNCTION__", WRITE_STORED_LINK_KEY Success\n"); + D_CMD(__FUNCTION__ ": WRITE_STORED_LINK_KEY Success\n"); result_param =3D 0; } break; =20 case DELETE_STORED_LINK_KEY: - D_CMD(__FUNCTION__", DELETE_STORED_LINK_KEY\n"); + D_CMD(__FUNCTION__ ": DELETE_STORED_LINK_KEY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", DELETE_STORED_LINK_KEY %s\n", get_err_msg(r_val[0= ])); + D_ERR(__FUNCTION__ ": DELETE_STORED_LINK_KEY %s\n", get_err_msg(r_val[= 0])); result_param =3D - r_val[0]; } else { - D_CMD(__FUNCTION__", DELETE_STORED_LINK_KEY Success\n"); + D_CMD(__FUNCTION__ ": DELETE_STORED_LINK_KEY Success\n"); result_param =3D CHAR2INT16(r_val[2], r_val[1]); } =20=09=09=09 - D_CMD(__FUNCTION__", Number of Linkkeys deleted: %d\n", + D_CMD(__FUNCTION__ ": Number of Linkkeys deleted: %d\n", CHAR2INT16(r_val[2], r_val[1])); break;=09 =20=20=20=20=20=20=20=20=20=20=20=20=20 case READ_TRANSMIT_POWER_LEVEL:=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=09=09=20=20 - printk(__FUNCTION__", READ_TRANSMIT_POWER_LEVEL\n"); + printk(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_TRANSMIT_POWER_LEVEL: %s\n", + D_ERR(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL: %s\n", get_err_msg(r_val[0])); break; } else { @@ -1286,34 +1286,34 @@ break; =20 case SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL: - D_CMD(__FUNCTION__", SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL\n"); + D_CMD(__FUNCTION__ ": SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL: %s\n", + D_ERR(__FUNCTION__ ": SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL: %s\n", get_err_msg(r_val[0])); break; } break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case HOST_BUFFER_SIZE:=20=20 - D_CMD(__FUNCTION__", HOST_BUFFER_SIZE\n"); + D_CMD(__FUNCTION__ ": HOST_BUFFER_SIZE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", HOST_BUFFER_SIZE: %s\n", + D_ERR(__FUNCTION__ ": HOST_BUFFER_SIZE: %s\n", get_err_msg(r_val[0])); } break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case CHANGE_LOCAL_NAME: - D_CMD(__FUNCTION__", CHANGE_LOCAL_NAME\n");=20=20=20=20=20=20=20=20=20= =20=20=20 + D_CMD(__FUNCTION__ ": CHANGE_LOCAL_NAME\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", CHANGE_LOCAL_NAME: %s\n", + D_ERR(__FUNCTION__ ": CHANGE_LOCAL_NAME: %s\n", get_err_msg(r_val[0])); } break; =20 case READ_SCAN_ENABLE: - D_CMD(__FUNCTION__", READ_SCAN_ENABLE\n"); + D_CMD(__FUNCTION__ ": READ_SCAN_ENABLE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_SCAN_ENABLE: %s\n", + D_ERR(__FUNCTION__ ": READ_SCAN_ENABLE: %s\n", get_err_msg(r_val[0])); result_param =3D -r_val[0]; } else { @@ -1323,34 +1323,34 @@ break; =20=09=09=09 case WRITE_SCAN_ENABLE: - D_CMD(__FUNCTION__", WRITE_SCAN_ENABLE\n"); + D_CMD(__FUNCTION__ ": WRITE_SCAN_ENABLE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_SCAN_ENABLE: %s\n", + D_ERR(__FUNCTION__ ": WRITE_SCAN_ENABLE: %s\n", get_err_msg(r_val[0])); } break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case WRITE_PAGESCAN_ACTIVITY: - D_CMD(__FUNCTION__", WRITE_PAGESCAN_ACTIVITY\n"); + D_CMD(__FUNCTION__ ": WRITE_PAGESCAN_ACTIVITY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_PAGESCAN_ACTIVITY: %s\n", + D_ERR(__FUNCTION__ ": WRITE_PAGESCAN_ACTIVITY: %s\n", get_err_msg(r_val[0])); } break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case WRITE_INQUIRYSCAN_ACTIVITY: - D_CMD(__FUNCTION__", WRITE_INQUIRYSCAN_ACTIVITY\n"); + D_CMD(__FUNCTION__ ": WRITE_INQUIRYSCAN_ACTIVITY\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_INQUIRYSCAN_ACTIVITY: %s\n", + D_ERR(__FUNCTION__ ": WRITE_INQUIRYSCAN_ACTIVITY: %s\n", get_err_msg(r_val[0])); result_param =3D -r_val[0]; } break; =20 case READ_AUTHENTICATION_ENABLE: - D_CMD(__FUNCTION__", READ_AUTHENTICATION_ENABLE\n"); + D_CMD(__FUNCTION__ ": READ_AUTHENTICATION_ENABLE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_AUTHENTICATION_ENABLE: %s\n", get_err_msg(r_= val[0])); + D_ERR(__FUNCTION__ ": READ_AUTHENTICATION_ENABLE: %s\n", get_err_msg(r= _val[0])); result_param =3D -r_val[0]; } else { result_param =3D r_val[1]; @@ -1358,18 +1358,18 @@ break; =20=09=09=09 case WRITE_AUTHENTICATION_ENABLE: - D_CMD(__FUNCTION__", WRITE_AUTHENTICATION_ENABLE\n"); + D_CMD(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE\n"); if(r_val[0]) { - D_ERR(__FUNCTION__", WRITE_AUTHENTICATION_ENABLE: %s\n", + D_ERR(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE: %s\n", get_err_msg(r_val[0])); result_param =3D -r_val[0]; }=20 break; =20=09=09=09 case READ_ENCRYPTION_MODE: - D_CMD(__FUNCTION__", READ_ENCRYPTION_MODE\n"); + D_CMD(__FUNCTION__ ": READ_ENCRYPTION_MODE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_ENCRYPTION_MODE: %s\n", get_err_msg(r_val[0]= )); + D_ERR(__FUNCTION__ ": READ_ENCRYPTION_MODE: %s\n", get_err_msg(r_val[0= ])); result_param =3D -r_val[0]; } else { result_param =3D r_val[1]; @@ -1377,57 +1377,57 @@ break; =20=09=09=09 case WRITE_ENCRYPTION_MODE: - D_CMD(__FUNCTION__", WRITE_AUTHENTICATION_ENABLE\n"); + D_CMD(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE\n"); if(r_val[0]) { - D_ERR(__FUNCTION__", WRITE_AUTHENTICATION_ENABLE: %s\n", + D_ERR(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE: %s\n", get_err_msg(r_val[0])); result_param =3D -r_val[0]; } break; =20=09=09=09 case WRITE_CLASS_OF_DEVICE: - D_CMD(__FUNCTION__", WRITE_CLASS_OF_DEVICE\n"); + D_CMD(__FUNCTION__ ": WRITE_CLASS_OF_DEVICE\n"); if(r_val[0]) { - D_ERR(__FUNCTION__", WRITE_CLASS_OF_DEVICE: %s\n", + D_ERR(__FUNCTION__ ": WRITE_CLASS_OF_DEVICE: %s\n", get_err_msg(r_val[0])); } break; =20 case WRITE_AUTOMATIC_FLUSH_TIMEOUT: - D_CMD(__FUNCTION__" WRITE_AUTOMATIC_FLUSH_TIMEOUT\n"); + D_CMD(__FUNCTION__ ": WRITE_AUTOMATIC_FLUSH_TIMEOUT\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_AUTOMATIC_FLUSH_TIMEOUT: %s\n", + D_ERR(__FUNCTION__ ": WRITE_AUTOMATIC_FLUSH_TIMEOUT: %s\n", get_err_msg(r_val[0])); } else { - D_CMD(__FUNCTION__", WRITE_AUTOMATIC_FLUSH_TIMEOUT Success\n"); + D_CMD(__FUNCTION__ ": WRITE_AUTOMATIC_FLUSH_TIMEOUT Success\n"); } =20=09=09=09 break; =20 =20=20=20=20=20=20=20=20=20=20=20=20=20 case READ_LINK_SUPERVISION_TIMEOUT: - D_CMD(__FUNCTION__", Link supervision timeout is: %d\n", + D_CMD(__FUNCTION__ ": Link supervision timeout is: %d\n", CHAR2INT16(buf[4],buf[3])); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case WRITE_LINK_SUPERVISION_TIMEOUT: - D_CMD(__FUNCTION__", WRITE_LINK_SUPERVISION_TO (%d)\n", r_val[0]); + D_CMD(__FUNCTION__ ": WRITE_LINK_SUPERVISION_TO (%d)\n", r_val[0]); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_LINK_SUPERVISION_TO: %s\n", + D_ERR(__FUNCTION__ ": WRITE_LINK_SUPERVISION_TO: %s\n", get_err_msg(r_val[0])); } break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case RESET: - D_CMD(__FUNCTION__", RESET\n");=09=09=09=20=20=20=20=20=20 + D_CMD(__FUNCTION__ ": RESET\n"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case SET_EVENT_FILTER: - D_CMD(__FUNCTION__", SET_EVENT_FILTER\n");=09=09=09=20=20=20=20=20=20 + D_CMD(__FUNCTION__ ": SET_EVENT_FILTER\n"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 default: - D_CMD(__FUNCTION__", HCI_HC, ocf %d not recognised!\n", ocf); + D_CMD(__FUNCTION__ ": HCI_HC, ocf %d not recognised!\n", ocf); break; } /* FIX ME : Wake up from the correct queue */ @@ -1437,9 +1437,9 @@ case HCI_LP: /* Link policy commands */ switch (ocf) { case ROLE_DISCOVERY: - printk(__FUNCTION__", ROLE_DISCOVERY: "); + printk(__FUNCTION__ ": ROLE_DISCOVERY: "); if (r_val[0]) { - D_ERR(__FUNCTION__", ROLE_DISCOVERY: %s\n", + D_ERR(__FUNCTION__ ": ROLE_DISCOVERY: %s\n", get_err_msg(r_val[0])); break; } @@ -1449,15 +1449,15 @@ printk("Connected as Master. \n"); break; case WRITE_LINK_POLICY_SETTINGS: - printk(__FUNCTION__", WRITE_LINK_POLICY_SETTINGS \n "); + printk(__FUNCTION__ ": WRITE_LINK_POLICY_SETTINGS \n "); if (r_val[0]) { - D_ERR(__FUNCTION__", WRITE_LINK_POLICY_SETTINGS: %s\n", + D_ERR(__FUNCTION__ ": WRITE_LINK_POLICY_SETTINGS: %s\n", get_err_msg(r_val[0])); break; } break; default: - D_CMD(__FUNCTION__", HCI_LP, ocf %d not recognised!\n", ocf); + D_CMD(__FUNCTION__ ": HCI_LP, ocf %d not recognised!\n", ocf); break; } break; @@ -1468,9 +1468,9 @@ switch (ocf) { =20 case READ_LOCAL_VERSION_INFORMATION: - D_CMD(__FUNCTION__", READ_LOCAL_VERSION_INFORMATION\n"); + D_CMD(__FUNCTION__ ": READ_LOCAL_VERSION_INFORMATION\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_LOCAL_VERSION_INFORMATION: %s\n", + D_ERR(__FUNCTION__ ": READ_LOCAL_VERSION_INFORMATION: %s\n", get_err_msg(r_val[0])); break; } @@ -1478,9 +1478,9 @@ break; =20 case READ_BUFFER_SIZE: - D_CMD(__FUNCTION__", READ_BUFFER_SIZE\n"); + D_CMD(__FUNCTION__ ": READ_BUFFER_SIZE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_BUFFER_SIZE: %s\n", + D_ERR(__FUNCTION__ ": READ_BUFFER_SIZE: %s\n", get_err_msg(r_val[0])); break; } @@ -1502,18 +1502,18 @@ break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case READ_BD_ADDR: - D_CMD(__FUNCTION__", READ_BD_ADDR\n"); + D_CMD(__FUNCTION__ ": READ_BD_ADDR\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", READ_BD_ADDR: %s\n", + D_ERR(__FUNCTION__ ": READ_BD_ADDR: %s\n", get_err_msg(r_val[0])); break; }=20=20=20=20=20=20=20=20=20=20=20=20 - PRINTPKT(__FUNCTION__", READ_BD_ADDR : ", &r_val[1], 6); + PRINTPKT(__FUNCTION__ ": READ_BD_ADDR : ", &r_val[1], 6); memcpy(hci_ctrl.local_bd, &r_val[1],6); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 default: - D_CMD(__FUNCTION__", HCI_IP, ocf %d not recognised!\n", ocf); + D_CMD(__FUNCTION__ ": HCI_IP, ocf %d not recognised!\n", ocf); break; } wake_up_interruptible(&hci_wq); @@ -1524,38 +1524,38 @@ =20 switch (ocf) {=20=20 case READ_LOOPBACK_MODE: - D_ERR(__FUNCTION__", READ_LOOPBACK_MODE -- not impl\n"); + D_ERR(__FUNCTION__ ": READ_LOOPBACK_MODE -- not impl\n"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case WRITE_LOOPBACK_MODE: - D_ERR(__FUNCTION__", WRITE_LOOPBACK_MODE -- not impl\n"); + D_ERR(__FUNCTION__ ": WRITE_LOOPBACK_MODE -- not impl\n"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case ENABLE_DEVICE_UNDER_TEST_MODE: - DSYS(__FUNCTION__", ENABLE_DEVICE_UNDER_TEST_MODE\n"); + DSYS(__FUNCTION__ ": ENABLE_DEVICE_UNDER_TEST_MODE\n"); if (r_val[0]) { - D_ERR(__FUNCTION__", ENABLE_DEVICE_UNDER_TEST_MODE: %s\n", + D_ERR(__FUNCTION__ ": ENABLE_DEVICE_UNDER_TEST_MODE: %s\n", get_err_msg(r_val[0])); break; } - printk(__FUNCTION__", *** Local device now under test\n***"); + printk(__FUNCTION__ ": *** Local device now under test\n***"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 default: - D_ERR(__FUNCTION__", HCI_TC, ocf %d not recognised!\n", ocf); + D_ERR(__FUNCTION__ ": HCI_TC, ocf %d not recognised!\n", ocf); break; } wake_up_interruptible(&hci_wq); break; =20=20=20=20=20=20=20=20=20=20=20 case MANUFACTURER_SPEC: { /* manufacturer specific */ - D_CMD(__FUNCTION__", MANUFACTURER_SPEC\n"); + D_CMD(__FUNCTION__ ": MANUFACTURER_SPEC\n"); process_vendor_return_param(ocf, r_val); } break; =20=20=20=20=20=20=20=20=20 default: - D_CMD(__FUNCTION__", ogf %d, not recognised! \n", ogf); + D_CMD(__FUNCTION__ ": ogf %d, not recognised! \n", ogf); break; } } @@ -1568,7 +1568,7 @@ void=20 process_acl_data(hci_in_buffer *in_buf, u32 pb_flag) { - D_REC(__FUNCTION__", in_buf->count:%d, in_buf->l2cap_len:%d\n", + D_REC(__FUNCTION__ ": in_buf->count:%d, in_buf->l2cap_len:%d\n", in_buf->count, in_buf->l2cap_len); =20 if (pb_flag =3D=3D L2CAP_FRAME_START) { @@ -1589,7 +1589,7 @@ { hci_in_buffer *in_buf; if (!(in_buf =3D get_free_inbuffer())) { - printk(__FUNCTION__", couldn't find free in buffer\n"); + printk(__FUNCTION__ ": couldn't find free in buffer\n"); return; } memcpy(in_buf->buf_ptr, data, len); @@ -1615,7 +1615,7 @@ } } if (i >=3D MAX_NBR_OF_CONNECTIONS) { - D_ERR(__FUNCTION__", : No free connection object\n"); + D_ERR(__FUNCTION__ ": No free connection object\n"); } } =20 @@ -1632,7 +1632,7 @@ } } if (i >=3D MAX_NBR_OF_CONNECTIONS) { - D_ERR(__FUNCTION__", : Didn't find connection with con_hdl %d\n", con_hd= l); + D_ERR(__FUNCTION__ ": Didn't find connection with con_hdl %d\n", con_hdl= ); } } =20 @@ -1642,7 +1642,7 @@ s32 i; =20 if (!name) { - D_ERR(__FUNCTION__", set_hci_con_name: No name defined\n"); + D_ERR(__FUNCTION__ ": set_hci_con_name: No name defined\n"); return; } =20 @@ -1653,7 +1653,7 @@ } } if (i >=3D MAX_NBR_OF_CONNECTIONS) { - D_ERR(__FUNCTION__", : Didn't fin connecton with BD adress 0x%02x:%02x:%= 02x:%02x:%02x:%02x\n", bd[5],bd[4],bd[3],bd[2],bd[1],bd[0]); + D_ERR(__FUNCTION__ ": Didn't fin connecton with BD adress 0x%02x:%02x:%0= 2x:%02x:%02x:%02x\n", bd[5],bd[4],bd[3],bd[2],bd[1],bd[0]); } } =20 @@ -1726,10 +1726,10 @@ { hci_in_buffer *in_buf =3D NULL; =20=20=20 - D_CTRL(__FUNCTION__", \n"); + D_CTRL(__FUNCTION__ "\n"); =20 if (!(in_buf =3D get_inbuffer(hci_hdl))) { - printk(__FUNCTION__", couldn't find in buffer hci_hdl %d\n", hci_hdl); + printk(__FUNCTION__ ": couldn't find in buffer hci_hdl %d\n", hci_hdl); return; } =20 @@ -1754,11 +1754,11 @@ } =20 if (i >=3D NBR_OF_HCI_INBUFFERS) { - D_ERR(__FUNCTION__", WARNING! No inbuffer with hci_hdl %d\n", hci_hdl); + D_ERR(__FUNCTION__ ": WARNING! No inbuffer with hci_hdl %d\n", hci_hdl); return NULL; } =20=09 - D_CTRL(__FUNCTION__", Found inbuffer for hci_hdl %d %p\n",hci_hdl,=20 + D_CTRL(__FUNCTION__ ": Found inbuffer for hci_hdl %d %p\n",hci_hdl,=20 &hci_ctrl.hci_in_buf[i]); =20 return &hci_ctrl.hci_in_buf[i]; @@ -1778,11 +1778,11 @@ } =20 if (i >=3D NBR_OF_HCI_INBUFFERS) { - D_ERR(__FUNCTION__", No free buffer found, discarding data\n"); + D_ERR(__FUNCTION__ ": No free buffer found, discarding data\n"); return NULL; } =20=09 - D_CTRL(__FUNCTION__", inbuffer %d was free\n",i); + D_CTRL(__FUNCTION__ ": inbuffer %d was free\n",i); hci_ctrl.hci_in_buf[i].empty =3D FALSE; return &hci_ctrl.hci_in_buf[i]; } @@ -1792,7 +1792,7 @@ { u32 i; =20 - DSYS(__FUNCTION__", Initialising HCI\n"); + DSYS(__FUNCTION__ ": Initialising HCI\n"); =20 #ifdef HCI_EMULATION DSYS("*** HCI emulator on ***\n"); @@ -1811,7 +1811,7 @@ #endif /* LINUX_VERSION_CODE */ #endif /* __KERNEL__ */ =20 - DSYS(__FUNCTION__", Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); + DSYS(__FUNCTION__ ": Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); =20=09 /* Initiate the hci inbuffers */ for (i =3D 0; i < NBR_OF_HCI_INBUFFERS; i++) { @@ -1861,10 +1861,10 @@ hci_read_firmware_rev_info();=09 =20 #ifdef HOST_FLOW_CTRL - DSYS(__FUNCTION__", Host flow control enabled\n"); + DSYS(__FUNCTION__ ": Host flow control enabled\n"); hci_set_host_controller_flow_control(TRUE); #else - DSYS(__FUNCTION__", Host flow control not enabled\n"); + DSYS(__FUNCTION__ ": Host flow control not enabled\n"); #endif hci_host_buffer_size(HCI_ACL_LEN,HCI_SCO_LEN,HCI_ACL_NUM,HCI_SCO_NUM); =20 @@ -1911,7 +1911,7 @@ { s32 tmp; =20 - D_CMD(__FUNCTION__", Sending inquiry()\n"); + D_CMD(__FUNCTION__ ": Sending inquiry()\n"); =20 if (!results) return -EINVAL; @@ -2012,7 +2012,7 @@ s32=20 accept_connection_request(u8 bd[], u8 role) { - D_CMD(__FUNCTION__", bd_addr %x %x %x %x %x %x\n",bd[0], bd[1], bd[2], + D_CMD(__FUNCTION__ ": bd_addr %x %x %x %x %x %x\n",bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]); =20 c_pkt.type =3D CMD_PKT; @@ -2034,7 +2034,7 @@ { u32 c =3D 0; =20=09 - D_CMD(__FUNCTION__", Rejecting bd_addr %x %x %x %x %x %x\n", + D_CMD(__FUNCTION__ ": Rejecting bd_addr %x %x %x %x %x %x\n", bd[0],bd[1],bd[2],bd[3],bd[4],bd[5]); =20 c_pkt.type =3D CMD_PKT; @@ -2054,8 +2054,8 @@ u32 c =3D 0; s32 tmp; =20=09 - print_data(__FUNCTION__", BD_addr", bd, 6); - print_data(__FUNCTION__", Link Key", link_key, 16); + print_data(__FUNCTION__ ": BD_addr", bd, 6); + print_data(__FUNCTION__ ": Link Key", link_key, 16); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(LINK_KEY_REQUEST_REPLY, HCI_LC) ; @@ -2080,7 +2080,7 @@ { s32 tmp; =20=09 - print_data(__FUNCTION__", BD_addr", bd, 6); + print_data(__FUNCTION__ ": BD_addr", bd, 6); =20=09 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(LINK_KEY_REQUEST_NEGATIVE_REPLY, HCI_LC) ; @@ -2090,7 +2090,7 @@ c_pkt.len =3D 6; =20 tmp =3D send_cmd_block((u8*) &c_pkt , c_pkt.len + CMD_HDR_LEN + HCI_HDR_L= EN); - printk(__FUNCTION__" returned from send_secblock\n"); + printk(__FUNCTION__ ": Returned from send_secblock\n"); if (tmp < 0) { return tmp; } else { @@ -2104,10 +2104,10 @@ u32 c =3D 0; s32 tmp; =20=09 - print_data(__FUNCTION__", New pin is\n", pin, pin_len);=20 + print_data(__FUNCTION__ ": New pin is\n", pin, pin_len);=20 =20 - print_data(__FUNCTION__", BD_addr", bd, 6); - print_data(__FUNCTION__", pin", pin, pin_len); + print_data(__FUNCTION__ ": BD_addr", bd, 6); + print_data(__FUNCTION__ ": pin", pin, pin_len); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(PIN_CODE_REQUEST_REPLY, HCI_LC) ; @@ -2134,7 +2134,7 @@ { s32 tmp; =20=09 - print_data(__FUNCTION__", BD_addr", bd, 6); + print_data(__FUNCTION__ ": BD_addr", bd, 6); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(PIN_CODE_REQUEST_NEGATIVE_REPLY, HCI_LC) ; @@ -2163,7 +2163,7 @@ s32 change_connection_packet_type(u32 hci_hdl, u32 pkt_type) { - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(CHANGE_CONNECTION_PACKET_TYPE, HCI_LC) ; @@ -2201,7 +2201,7 @@ tmp =3D get_con_hdl(bd); =20=09 if (tmp < 0) { - D_ERR(__FUNCTION__", No connection handle found for bd 0x%02x:%02x:%02x:= %02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); + D_ERR(__FUNCTION__ ": No connection handle found for bd 0x%02x:%02x:%02x= :%02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); return -1; } else { return hci_authentication_requested((u16)tmp); @@ -2212,7 +2212,7 @@ hci_authentication_requested(u16 con_hdl) { =20 - D_CMD(__FUNCTION__" at connection handle %d\n", con_hdl); + D_CMD(__FUNCTION__ ": At connection handle %d\n", con_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(AUTHENTICATION_REQUESTED, HCI_LC); @@ -2242,7 +2242,7 @@ tmp =3D get_con_hdl(bd); =20=09 if (tmp < 0) { - D_ERR(__FUNCTION__", No connection handle found for bd 0x%02x:%02x:%02x:= %02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); + D_ERR(__FUNCTION__ ": No connection handle found for bd 0x%02x:%02x:%02x= :%02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); return -1; } else { return hci_set_connection_encryption((u16)tmp, enable); @@ -2253,7 +2253,7 @@ s32 hci_set_connection_encryption(u16 con_hdl, u8 enable) { - D_CMD(__FUNCTION__"enable:%d at connection handle %d\n", enable, con_hdl); + D_CMD(__FUNCTION__ ": enable:%d at connection handle %d\n", enable, con_h= dl); c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(SET_CONNECTION_ENCRYPTION, HCI_LC) ; =20 @@ -2322,7 +2322,7 @@ s32 c =3D 0; s32 zero =3D 0; =20=09=09 - D_CMD(__FUNCTION__", for bd address 0x%02x:%02x:%02x:%02x:%02x:%02x\n" + D_CMD(__FUNCTION__ ": for bd address 0x%02x:%02x:%02x:%02x:%02x:%02x\n" , bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); =20=09 c_pkt.type =3D CMD_PKT; @@ -2349,7 +2349,7 @@ =20=09 for (i =3D 0; i < MAX_NBR_OF_CONNECTIONS; i++) { if (hci_ctrl.con[i].state !=3D NOT_CONNECTED) { - printk(__FUNCTION__", Flushing handle:%d\n",hci_ctrl.con[i].con_hdl); + printk(__FUNCTION__ ": Flushing handle:%d\n",hci_ctrl.con[i].con_hdl); hci_flush(hci_ctrl.con[i].con_hdl); } }=09 @@ -2459,7 +2459,7 @@ hci_change_local_name(u8 *new_name) { #define NAME_LEN 248 - D_CMD(__FUNCTION__", New name: %s\n", new_name); + D_CMD(__FUNCTION__ ": New name: %s\n", new_name); c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(CHANGE_LOCAL_NAME, HCI_HC); =20 @@ -2501,7 +2501,7 @@ s32=20 hci_write_scan_enable(u32 enable) { - D_CMD(__FUNCTION__", enable %d\n", enable); + D_CMD(__FUNCTION__ ": enable %d\n", enable); c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(WRITE_SCAN_ENABLE, HCI_HC) ; =20=20=20 @@ -2520,7 +2520,7 @@ s32=20 hci_write_pagescan_activity(u32 interval, u32 wind) { - D_CMD(__FUNCTION__", \n"); + D_CMD(__FUNCTION__ "\n"); c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(WRITE_PAGESCAN_ACTIVITY, HCI_HC) ; =20 @@ -2542,7 +2542,7 @@ s32=20 write_inquiryscan_activity(u32 interval, u32 wind) { - D_CMD(__FUNCTION__", \n"); + D_CMD(__FUNCTION__ "\n"); c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(WRITE_INQUIRYSCAN_ACTIVITY, HCI_HC) ; =20=20=20 @@ -2649,9 +2649,9 @@ s32 hci_write_class_of_device(u8 *class_of_device) { - D_CMD(__FUNCTION__"Service class 0x%02x, major:0x%01x, minor:0x%01x\n",(c= lass_of_device[2] << 3) | (class_of_device[1] >> 5), (class_of_device[1] & = 0x1f), (class_of_device[0] >> 2)); + D_CMD(__FUNCTION__ ": Service class 0x%02x, major:0x%01x, minor:0x%01x\n"= ,(class_of_device[2] << 3) | (class_of_device[1] >> 5), (class_of_device[1]= & 0x1f), (class_of_device[0] >> 2)); =20 - D_CMD(__FUNCTION__"%01x:%01x:%01x\n", class_of_device[2], class_of_device= [1], class_of_device[0]); + D_CMD(__FUNCTION__ ": %01x:%01x:%01x\n", class_of_device[2], class_of_dev= ice[1], class_of_device[0]); =20=09 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(WRITE_CLASS_OF_DEVICE, HCI_HC) ; @@ -2685,7 +2685,7 @@ s32 write_automatic_flush_timeout(u16 con_hdl, u16 n) { - D_CMD(__FUNCTION__", con_hdl: %d, n:%d\n", con_hdl, n); + D_CMD(__FUNCTION__ ": con_hdl: %d, n:%d\n", con_hdl, n); =20=09 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(WRITE_AUTOMATIC_FLUSH_TIMEOUT, HCI_HC); @@ -2706,7 +2706,7 @@ hci_set_host_controller_flow_control(u32 enable) { #ifdef HOST_FLOW_CTRL - D_CMD(__FUNCTION__", enable:%d\n",enable); + D_CMD(__FUNCTION__ ": enable:%d\n",enable); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL,= HCI_HC) ; @@ -2773,7 +2773,7 @@ #ifdef HOST_FLOW_CTRL s32 tmp; =20=09 - D_CMD(__FUNCTION__", hci_hdl:0x%x, for %d packets\n", hci_hdl,nbr_of_pack= ets); + D_CMD(__FUNCTION__ ": hci_hdl:0x%x, for %d packets\n", hci_hdl,nbr_of_pac= kets); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(HOST_NUMBER_OF_COMPLETED_PACKETS, HCI_HC)= ; @@ -2921,7 +2921,7 @@ s32 hci_hold_mode(u16 hci_hdl, u16 max_int, u16 min_int) {=20=20 - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(HOLD_MODE, HCI_LP); @@ -2940,7 +2940,7 @@ s32 hci_sniff_mode(u16 hci_hdl, u16 max_int, u16 min_int, u16 attempt, u16 tim= eout) {=20=20 - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(SNIFF_MODE, HCI_LP); @@ -2964,7 +2964,7 @@ s32 hci_exit_sniff_mode(u16 hci_hdl) {=20 - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(EXIT_SNIFF_MODE, HCI_LP); @@ -2979,7 +2979,7 @@ s32 hci_park_mode(u16 hci_hdl, u16 max_int, u16 min_int) {=20=20 - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(PARK_MODE, HCI_LP); @@ -2998,7 +2998,7 @@ s32 hci_exit_park_mode(u16 hci_hdl) {=20=20 - D_CMD(__FUNCTION__", for connnection handle 0x%x\n", hci_hdl); + D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(EXIT_PARK_MODE, HCI_LP); @@ -3024,7 +3024,7 @@ } =20 if (i >=3D MAX_NBR_OF_CONNECTIONS) { - D_ERR(__FUNCTION__", No connection handle found for bd 0x%02x:%02x:%02x:= %02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); + D_ERR(__FUNCTION__ ": No connection handle found for bd 0x%02x:%02x:%02x= :%02x:%02x:%02x:\n", bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); return -1; } else { return hci_ctrl.con[i].con_hdl; @@ -3044,7 +3044,7 @@ } =20 if (i >=3D MAX_NBR_OF_CONNECTIONS) { - D_ERR(__FUNCTION__", No BD Address found for connection handle %d\n", co= n_hdl); + D_ERR(__FUNCTION__ ": No BD Address found for connection handle %d\n", c= on_hdl); return NULL; } else { return hci_ctrl.con[i].bd; @@ -3193,7 +3193,7 @@ s32=20 lp_connect_req(u8 bd_addr[]) { - PRINTPKT(__FUNCTION__", bd address is: ", bd_addr, 6); + PRINTPKT(__FUNCTION__ ": bd address is: ", bd_addr, 6); /* FIXME, store the inparameters in the ctrl-block instead */ =20 if (!get_con(bd_addr, ANY_STATE)) @@ -3214,7 +3214,7 @@ s32=20 lp_connect_rsp(u8 bd_addr[], u32 cfm) {=20 - D_CMD(__FUNCTION__"Status:%d\n", cfm); + D_CMD(__FUNCTION__ ": Status: %d\n", cfm); if (cfm) { #ifdef CONFIG_BLUETOOTH_EARLY_MSSWITCH if (force_msswitch) { @@ -3248,7 +3248,7 @@ s32 hci_send_data(bt_tx_buf *tx_buf) { - D_SND(__FUNCTION__", %d bytes \n", tx_buf->cur_len); + D_SND(__FUNCTION__ ": %d bytes\n", tx_buf->cur_len); =20 /* Indicate that this is a L2CAP start frame. If the whole frame can't be sent, send_acl_data will fragment it an set the @@ -3284,10 +3284,10 @@ tx_buf =3D get_bt_buf(); if (tx_buf) { bytes2send =3D tx_buf->cur_len; - D_SND(__FUNCTION__", %d bytes \n", tx_buf->cur_len); + D_SND(__FUNCTION__ ": %d bytes \n", tx_buf->cur_len); } =20 - D_SND(__FUNCTION__", %d bytes \n", bytes2send); + D_SND(__FUNCTION__ ": %d bytes \n", bytes2send); =20=09 /* while there is space in the hardware buffers and we have hci packets to send, we send them. After each sent packet @@ -3340,14 +3340,14 @@ /* Calculate the maximum packet length we can send */ c =3D MIN(tx_buf->cur_len, hci_ctrl.hc_buf.acl_len); =20 - D_SND(__FUNCTION__", send %d bytes (excl HCI header) out of %d\n", + D_SND(__FUNCTION__ ": send %d bytes (excl HCI header) out of %d\n", c, tx_buf->cur_len); =20=20=20 /* Set the temporary cur_data pointer to point at the current data to be sent */ cur_data =3D tx_buf->data + (tx_buf->subscr_len - tx_buf->cur_len); =20=20 - D_SND(__FUNCTION__", There are %d bytes space for the headers\n", + D_SND(__FUNCTION__ ": There are %d bytes space for the headers\n", tx_buf->subscr_len - tx_buf->cur_len); =20=20=20 /* Move the pointer so the HCI header can be filled in, higher @@ -3365,7 +3365,7 @@ tx_buf->hci_hdl); =20 /* Send the whole packet plus its header to the serial driver */ - PRINTPKT(__FUNCTION__", ", cur_data, c + ACL_HDR_LEN + HCI_HDR_LEN); + PRINTPKT(__FUNCTION__ ": ", cur_data, c + ACL_HDR_LEN + HCI_HDR_LEN); =20 #ifdef HCI_EMULATION hci_emulator(cur_data, c + ACL_HDR_LEN + HCI_HDR_LEN); @@ -3381,7 +3381,7 @@ either send all or nothing...=20 (HW need complete packets) */ =20=09=09 - D_SND(__FUNCTION__", cannot send now, leave in buffers\n"); + D_SND(__FUNCTION__ ": cannot send now, leave in buffers\n"); return 0; } #endif @@ -3391,15 +3391,15 @@ /* Decrease the current length of the packet */ tx_buf->cur_len -=3D c; =20 - D_SND(__FUNCTION__", now c =3D %d\n", c); + D_SND(__FUNCTION__ ": now c =3D %d\n", c); =20=20=20 /* Check whether to unsubscribe the subscribed buffer or not */ if (tx_buf->cur_len =3D=3D 0) { - D_SND(__FUNCTION__", unsubscribing tx_buf.\n"); + D_SND(__FUNCTION__ ": unsubscribing tx_buf.\n"); unsubscribe_bt_buf(tx_buf); } else if (tx_buf->cur_len < 0) { - D_ERR(__FUNCTION__", negative cur_len... (%d)\n",=20 + D_ERR(__FUNCTION__ ": negative cur_len... (%d)\n",=20 tx_buf->cur_len); #ifndef __KERNEL__ sleep(10); @@ -3512,7 +3512,7 @@ =20=20=20=20=20=20 case CREATE_CONNECTION: /* Send connection request event */ - D_CMD(__FUNCTION__", CREATE_CONNECTION->connection request\n"); + D_CMD(__FUNCTION__ ": CREATE_CONNECTION->connection request\n"); o_len =3D set_con_req_event(out_event, cmd->data, 1); bt_write_lower_driver(o_event, o_len); =20=20=20=20=20=20=20 @@ -3523,14 +3523,14 @@ the conde for "Connection Terminated by Local Host" and 0x13 is the code for "Other End Terminated Connection: User Ended Connection" */ - D_CMD(__FUNCTION__", DISCONNECT->disconnection complete\n"); + D_CMD(__FUNCTION__ ": DISCONNECT->disconnection complete\n"); o_len =3D set_discon_cpl_event(out_event, CHAR2INT12(cmd->data[1], cmd-= >data[0]), 0x13); bt_write_lower_driver(o_event, o_len); lp_disconnect_ind(CHAR2INT12(cmd->data[1],cmd->data[0])); break; =20=20=20=20=20=20=20 case ACCEPT_CONNECTION_REQUEST: - D_CMD(__FUNCTION__", ACCEPT_CONNECTION->connection complete\n"); + D_CMD(__FUNCTION__ ": ACCEPT_CONNECTION->connection complete\n"); o_len =3D set_con_cpl_event(out_event, 0, cmd->data, HCI_HDL, ACL_CON); #ifndef __KERNEL__ @@ -3541,7 +3541,7 @@ break; =20=20=20=20=20=20=20 case REJECT_CONNECTION_REQUEST: - D_CMD(__FUNCTION__", REJECT_CONNECTION->connection complete\n"); + D_CMD(__FUNCTION__ ": REJECT_CONNECTION->connection complete\n"); o_len =3D set_con_cpl_event(out_event, cmd->data[6], cmd->data, HCI_HDL, ACL_CON); #ifndef __KERNEL__ @@ -3552,7 +3552,7 @@ break; =20=20=20=20=20=20=20 default: - printk(__FUNCTION__", Unknown command ogf:0x%x,ocf:0x%x\n", + printk(__FUNCTION__ ": Unknown command ogf:0x%x,ocf:0x%x\n", hci_get_ogf(cmd->opcode), hci_get_ocf(cmd->opcode)); break; } @@ -3561,7 +3561,7 @@ case HCI_IP: /* Informational parameters */ switch (hci_get_ocf(cmd->opcode)) { case READ_BUFFER_SIZE: - D_CMD(__FUNCTION__", READ_BUFFER_SIZE->setting buffer size\n"); + D_CMD(__FUNCTION__ ": READ_BUFFER_SIZE->setting buffer size\n"); hci_ctrl.hc_buf.acl_num =3D ACL_NUM; hci_ctrl.hc_buf.acl_len =3D ACL_LEN; hci_ctrl.hc_buf.sco_num =3D SCO_NUM; @@ -3569,14 +3569,14 @@ break; =20=20=20 default: - printk(__FUNCTION__", Unknown command ogf:0x%x,ocf:0x%x\n", + printk(__FUNCTION__ ": Unknown command ogf:0x%x,ocf:0x%x\n", hci_get_ogf(cmd->opcode), hci_get_ocf(cmd->opcode)); break; } break; =20 default: - printk(__FUNCTION__", Unknown command ogf:0x%x,ocf:0x%x\n", + printk(__FUNCTION__ ": Unknown command ogf:0x%x,ocf:0x%x\n", hci_get_ogf(cmd->opcode), hci_get_ocf(cmd->opcode)); break; } @@ -3660,7 +3660,7 @@ u32 i; cmd_t *tmp =3D NULL; =20=20 - D_CTRL(__FUNCTION__", Initializing\n"); + D_CTRL(__FUNCTION__ ": Initializing\n"); =20=20=20 while ((tmp =3D get_next_cmd()) !=3D NULL) { kfree(tmp->data); @@ -3692,7 +3692,7 @@ if (cmd_buf.next_to_send >=3D (NBR_CMD_BUFS - 1)) { /* If we are at last cmd in buffer, wrap ! */ cmd_buf.next_to_send =3D 0; - D_CTRL(__FUNCTION__", next_to_send WRAP\n"); + D_CTRL(__FUNCTION__ ": next_to_send WRAP\n"); } else { cmd_buf.next_to_send++; } @@ -3725,7 +3725,7 @@ =20 if (cmd_buf.first_free >=3D (NBR_CMD_BUFS - 1)) { cmd_buf.first_free =3D 0; /* wrap */ - D_CTRL(__FUNCTION__", WRAP\n"); + D_CTRL(__FUNCTION__ ": WRAP\n"); } else { cmd_buf.first_free++; } @@ -3774,7 +3774,7 @@ { hci_ctrl.hc_buf.cmd_num =3D nhcp; =20 - D_CTRL(__FUNCTION__", Num_HCI_Command_Packets=3D%d\n", hci_ctrl.hc_buf.cm= d_num); + D_CTRL(__FUNCTION__ ": Num_HCI_Command_Packets=3D%d\n", hci_ctrl.hc_buf.c= md_num); =20=09 #ifdef __KERNEL__ send_cmd_task.routine =3D (void*)send_cmd_queue; @@ -3796,7 +3796,7 @@ { cmd_t *tmp =3D NULL; =20=20=20 - D_CTRL(__FUNCTION__", start: Num_HCI_Command_Packets=3D%d\n",=20 + D_CTRL(__FUNCTION__ ": start: Num_HCI_Command_Packets=3D%d\n",=20 hci_ctrl.hc_buf.cmd_num); =20 cli(); @@ -3804,7 +3804,7 @@ && ((tmp =3D get_next_cmd()) !=3D NULL)) { sti(); =20=20=20=20 - PRINTPKT(__FUNCTION__", ", tmp->data, tmp->len); + PRINTPKT(__FUNCTION__ ": ", tmp->data, tmp->len); /* more in queue and we can send */ #ifdef HCI_EMULATION hci_emulator(tmp->data, tmp->len); @@ -3819,7 +3819,7 @@ } sti(); =20=09 - D_CTRL(__FUNCTION__", end : %d cmds left in queue\n", cmd_buf.count); + D_CTRL(__FUNCTION__ ": end : %d cmds left in queue\n", cmd_buf.count); =20 /*FIXME: this should really be fixed... */ if (hci_ctrl.hc_buf.cmd_num > 0) { @@ -3901,7 +3901,7 @@ counter to 1 again */ hci_ctrl.hc_buf.cmd_num =3D 1; =20=09 - printk(__FUNCTION__", Timeout when waiting for command response\n"); + printk(__FUNCTION__ ": Timeout when waiting for command response\n"); hci_cmd_pending =3D 0; wake_up_interruptible(&hci_wq); } @@ -3943,7 +3943,7 @@ =20 /* hci_ctrl.hc_buf.cmd_num =3D 1;*/ =20 - printk(__FUNCTION__", Timeout when waiting for inquiry response\n"); + printk(__FUNCTION__ ": Timeout when waiting for inquiry response\n"); hci_inq_pending =3D 0; hci_inq_aborted =3D 1; wake_up_interruptible(&inq_wq); @@ -4047,7 +4047,7 @@ for (i =3D 0; i < NBR_CMD_BUFS; i++) { printk("%d\n", i); if (cmd_buf.buf[i].len > 0) - PRINTPKT(__FUNCTION__", cmd_buf : ", cmd_buf.buf[i].data, cmd_buf.buf[i= ].len);=20=20=20=20=20=20 + PRINTPKT(__FUNCTION__ ": cmd_buf: ", cmd_buf.buf[i].data, cmd_buf.buf[i= ].len);=20=20=20=20=20=20 }=20=20 printk("------------------------------------------\n"); } |
From: Peter K. <pk...@us...> - 2001-06-08 10:17:25
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Marked a debug message as such. The diff of the modified file(s): --- btconfig.c 2001/05/14 11:09:22 1.3 +++ btconfig.c 2001/06/08 10:17:24 1.4 @@ -237,7 +237,7 @@ return TRUE; } =20=20=20 - syslog(LOG_INFO, __FUNCTION__": Opened %s file ok", filename); + D(syslog(LOG_INFO, __FUNCTION__": Opened config file '%s'", filename)); =20 while (fgets(buf, BUF_MAXSIZE, f)) { |
From: Peter K. <pk...@us...> - 2001-06-08 09:56:38
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btinit.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Synchronised with btd.c The diff of the modified file(s): --- btinit.c 2001/05/31 12:38:54 1.9 +++ btinit.c 2001/06/08 09:56:37 1.10 @@ -53,7 +53,7 @@ Sets which uart device that will be used by the stack default: ttyS0 =20=20=20 - -n, --local-name + -n, --local-name <prefix> prefix used for the local bluetooth device name default: nothing =20=20=20 @@ -61,6 +61,10 @@ reset bluetooth hardware before use default: no reset =20=20=20 + -i, --initial-speed <speed> + sets initial uart speed + default: 115200 baud + -s, --speed <speed> sets uart speed 9600, 19200, 38400, 57600, 115200, 230400, 460800 @@ -69,27 +73,21 @@ e.g ./bti --reset --speed 460800 --physdev /dev/ttyS0 --local-name OpenBT =20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - */ =20 -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/wait.h> -#include <sys/time.h> -#include <fcntl.h> -#include <time.h> #include <stdio.h> -#include <fcntl.h> -#include <unistd.h> -#include <termios.h> #include <stdlib.h> #include <string.h> -#include <syslog.h> +#include <unistd.h> #include <errno.h> -#include <stdarg.h> +#include <fcntl.h> #include <signal.h> +#include <syslog.h> #include <getopt.h> #include <setjmp.h> +#include <termios.h> +#include <sys/ioctl.h> +#include <sys/wait.h> =20 #include "btd.h" #include "bt_conf.h" @@ -97,6 +95,8 @@ #include "bt_misc.h" #include "bt_if.h" =20 +#define D(x) //x + /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* General BTD stuff */ =20 @@ -116,6 +116,7 @@ /* long option list */ static struct option long_options[] =3D { + {"initial-speed", 1, NULL, 'i'}, /* initial uart speed */ {"physdev", 1, NULL, 'u'}, /* phys device used from stack */ {"local-name", 1, NULL, 'n'}, /* set local bluetooth name */ {"reset", 1, NULL, 'R'}, /* reset BT HW */ @@ -138,7 +139,7 @@ int opt; int bt_disc =3D N_BT; =20 - syslog(LOG_INFO, "Bluetooth daemon starting\n"); + syslog(LOG_INFO, "Bluetooth daemon starting"); =20 if (atexit(btd_cleanup) < 0) { @@ -155,30 +156,30 @@ case 'i': /* uart device */ init_hw_speed =3D atoi(optarg); - syslog(LOG_INFO, "init_hw_speed %d baud\n", init_hw_speed); + D(syslog(LOG_INFO, "init_hw_speed %d baud", init_hw_speed)); break; =20 case 'n': - printf("setting local name to %s\n", optarg); + D(syslog(LOG_INFO, "setting local name to %s", optarg)); strncpy(local_name, optarg, LOCAL_NAME_LENGTH); local_name[LOCAL_NAME_LENGTH] =3D '\0'; break; =20 case 'R': /* try to reset the hardware */ - printf("reset HW\n"); + D(syslog(LOG_INFO, "reset HW")); do_reset =3D 1; break; =20 case 's': /* speed */ - printf("phys dev running at %s\n", optarg); + D(syslog(LOG_INFO, "phys dev running at %s", optarg)); speedstr =3D optarg; break; =20 case 'u': /* uart device */ - printf("phys dev : %s\n", optarg); + D(syslog(LOG_INFO, "phys dev: %s", optarg)); physdev =3D optarg; break; =20 @@ -190,23 +191,19 @@ /* Set restart point */ if (sigsetjmp(jmpbuffer, 1) !=3D 0) { - syslog(LOG_INFO, "restart...\n\n\n\n"); + syslog(LOG_INFO, "Restart..."); + sleep(1); } =20 init(); =20 - /* Hardreset of BT hardware */ - if (do_reset) - reset_hw(); - if ((phys_fd =3D open(physdev, O_RDWR | O_NOCTTY)) < 0) { - perror("could not open phys dev\n"); + perror("Could not open phys dev"); exit(1); } =20 - /* Set default speed */ - + /* Sets initial HW baudrate */ if (init_hw_speed !=3D 0) fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL, hw_vendor() =3D=3D HW_= CSR_BCSP); else @@ -217,6 +214,12 @@ =20=20=20 bt_cfd =3D bt_openctrl(); =20 + tcflush(phys_fd, TCIOFLUSH); + + /* Hardreset of BT hardware */ + if (do_reset) + reset_hw(); + init_stack(bt_cfd, atoi(speedstr)); =20 if (do_hwinit) @@ -225,8 +228,7 @@ /* All initialized and ready to accept connections in other BT apps */ =20 while (1) - sleep(1); - + sleep(100); } /* main */ =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ @@ -237,30 +239,26 @@ { struct sigaction act; =20 - syslog(LOG_INFO, "Initiating signal handler\n"); + D(syslog(LOG_INFO, "Initiating signal handler")); act.sa_handler =3D sighandler; sigemptyset(&act.sa_mask); act.sa_flags =3D 0; - sigaction(SIGUSR1, &act, 0); - sigaction(SIGTERM, &act, 0); - /* other sigs ? */ + sigaction(SIGUSR1, &act, 0); /* Restart application */ + sigaction(SIGTERM, &act, 0); /* Terminate application */ } =20 static void sighandler(int sig) { - printf("Sighandler : %d\n", sig); + D(syslog(LOG_INFO, "Sighandler got signal: %d", sig)); =20 - /* Restart stack on SIGUSR1 */ if (sig =3D=3D SIGUSR1) { - syslog(LOG_INFO, "Restart stack\n"); -=20=20=20=20 + /* Shutdown all and restart */ btd_cleanup(); -=20 siglongjmp(jmpbuffer, 1); } - if (sig =3D=3D SIGTERM) + else if (sig =3D=3D SIGTERM) { exit(0); } @@ -285,13 +283,12 @@ static void btd_cleanup(void) { - printf("btd_cleanup : Shutting down stack and terminating childs\n"); - syslog(LOG_INFO, "btd_cleanup\n"); + D(syslog(LOG_INFO, __FUNCTION__)); btd_killchilds(); =20 - syslog(LOG_INFO, "shutdown_stack\n"); + printf("Shutting down Bluetooth stack\n"); shutdown_stack(bt_cfd); - syslog(LOG_INFO, "shutdown_stack done\n"); + printf("Bluetooth stack shut down\n"); =20 if (bt_cfd !=3D -1) { @@ -317,10 +314,9 @@ static void btd_killchilds(void) { - syslog(LOG_INFO, "btd_killchilds\n"); if (sdpsrv_pid > 0) { - syslog(LOG_INFO, "Killing SDP server\n"); + D(syslog(LOG_INFO, "Killing SDP server")); kill(sdpsrv_pid, SIGTERM); =20=20=20=20=20 if (waitpid(sdpsrv_pid, NULL, 0) < 0) |
From: Peter K. <pk...@us...> - 2001-06-08 09:55:48
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 bt_ipa.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 bt_vendor.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 btd.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 modememul.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Improved some log messages. * Marked debug messages as such. The diff of the modified file(s): --- bt_if.c 2001/05/29 10:04:12 1.16 +++ bt_if.c 2001/06/08 09:55:47 1.17 @@ -72,7 +72,7 @@ =20 void init_stack(int bt_cfd, int spd) { - syslog(LOG_INFO, "Init stack\n"); + syslog(LOG_INFO, "Init stack"); =20=20=20 #ifdef BT_USERSTACK init_userstack(); @@ -116,7 +116,7 @@ =20 void shutdown_stack(int bt_cfd) { - syslog(LOG_INFO, "Shutting down bluetooth stack\n"); + syslog(LOG_INFO, "Shutting down bluetooth stack"); #ifndef BT_USERSTACK if (bt_cfd !=3D -1 && (ioctl(bt_cfd, BTSHUTDOWN) < 0)) { @@ -183,6 +183,7 @@ int bt_openctrl(void) { int bt_cfd; + D(syslog(LOG_INFO, "Now opening BT Ctrl TTY [" BT_CTRL_TTY "]")); #ifdef BT_USERSTACK printf(__FUNCTION__ ": ignored in userstack\n"); @@ -448,7 +449,7 @@ memcpy(ping.data, data, len); =20=20=20 #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTPING, &ping)) !=3D 0) + if ((ret_val =3D ioctl(bt_cfd, BTPING, &ping)) < 0) { printf("Error : %s\n", error_msg(ret_val)); } @@ -471,7 +472,7 @@ msg[7] =3D (unsigned char)(type & 0xff); =20 #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTGETINFO, &msg)) !=3D 0) + if ((ret_val =3D ioctl(bt_cfd, BTGETINFO, &msg)) < 0) { printf("Error : %s\n", error_msg(ret_val)); } @@ -491,7 +492,7 @@ print_data("cmd ", cmd, strlen(cmd)); =20 #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTTESTCOMMAND, cmd)) !=3D 0) + if ((ret_val =3D ioctl(bt_cfd, BTTESTCOMMAND, cmd)) < 0) { printf("Error : %s\n", error_msg(ret_val)); } @@ -506,9 +507,10 @@ int bt_force_msswitch_as_server(int bt_cfd, int enable) { int ret_val; + syslog(LOG_INFO, __FUNCTION__ ": %d", enable); #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) !=3D 0) + if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) < 0) { fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val)); } @@ -662,7 +664,8 @@ int bt_write_scan_enable(int bt_cfd, unsigned int flags) { int result; - syslog(LOG_INFO, "Setting write_scan_enable [0x%x]\n", flags); + + syslog(LOG_INFO, "Setting write_scan_enable: 0x%x", flags); =20 #ifdef BT_USERSTACK result =3D hci_write_scan_enable(flags); @@ -682,7 +685,6 @@ unsigned int wind) { /* improves reliability when doing a connect */ - syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!"); =20 #ifdef BT_USERSTACK hci_write_pagescan_activity(interval, wind); @@ -706,7 +708,7 @@ { int result; =20 - syslog(LOG_INFO, "Setting event filter [0x%1x 0x%1x 0x%1x]\n",=20 + syslog(LOG_INFO, "Setting event filter [0x%x 0x%x 0x%x]",=20 filter[0], filter[1], filter[2]); =20 #ifdef BT_USERSTACK @@ -751,15 +753,15 @@ break; =20 case 1: - syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format); + syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x", format); break; =20 case 2: - syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format); + syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x", format); break; =20 default: - syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format); + syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x", format); break; } } @@ -770,7 +772,7 @@ int i; unsigned char tmp[7]; =20 - syslog(LOG_INFO, "Performing role switch to peer: %02X:%02X:%02X:%02X:%0= 2X:%02X\n", + syslog(LOG_INFO, "Performing role switch to peer: %02X:%02X:%02X:%02X:%0= 2X:%02X", bd_addr[0], bd_addr[1], bd_addr[2], bd_addr[3], bd_addr[4], bd_addr[5]); =20 @@ -798,10 +800,10 @@ if (ioctl(phys_fd, TIOCSETD, &bt_disc) < 0) { perror(__FUNCTION__); - syslog(LOG_INFO, "Forgot to insmod bt.o ? [bt_disc %d]\n", bt_disc); + syslog(LOG_INFO, "Forgot to insmod bt.o ? [bt_disc %d]", bt_disc); exit(1); } - syslog(LOG_INFO, "Registered bluetooth line discipline on %s\n", physdev= ); + syslog(LOG_INFO, "Registered bluetooth line discipline on %s", physdev); printf("Registered bluetooth line discipline on %s\n", physdev); #else fprintf(stderr, __FUNCTION__ ": ignored in usermode stack\n"); @@ -1024,7 +1026,7 @@ #endif #endif=20=20 =20 - syslog(LOG_INFO, "Opening dev %s\n", dev); + D(syslog(LOG_INFO, "Opening dev %s", dev)); if ((fd =3D open(dev, flags | O_NOCTTY)) < 0) { perror(__FUNCTION__); @@ -1037,7 +1039,7 @@ =20 void close_device(int fd) { - syslog(LOG_INFO, __FUNCTION__); + D(syslog(LOG_INFO, __FUNCTION__)); =20=20=20 #ifdef BT_USERSTACK /* if fake fd is used, ignore close since there are no open fd */ @@ -1054,7 +1056,7 @@ int sdpsrv_pid; char *args[] =3D { SDPSRV_CMD, SDPSRV_CONF, SDPSRV_PROC, NULL }; =20 - syslog(LOG_INFO, "Starting SDP server [%s]\n", SDPSRV_CMD);=20=20 + D(syslog(LOG_INFO, "Starting SDP server [%s]", SDPSRV_CMD)); =20 if (!(sdpsrv_pid =3D vfork())) { @@ -1068,12 +1070,9 @@ return sdpsrv_pid; } =20 - - /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Functions used in usermode stack only */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ - =20 /*=20 * --- bt_ipa.c 2001/05/15 12:13:04 1.4 +++ bt_ipa.c 2001/06/08 09:55:47 1.5 @@ -58,11 +58,13 @@ #include "bt_conf.h" #include "bt_misc.h" =20 +#define D(x) //x + int ipa_open(void) { int ipa_fd; =20=20=20 - syslog(LOG_INFO, "Opening socket to IP Assigner"); + D(syslog(LOG_INFO, "Opening socket to IP Assigner")); if ((ipa_fd =3D open_socket(IPASERVER, CLIENT)) < 0) {=20=20 perror("open_socket"); @@ -73,15 +75,15 @@ =20 void ipa_close(int ipa_fd) { - syslog(LOG_INFO, "Closing socket to IP Assigner");=20=20 + D(syslog(LOG_INFO, "Closing socket to IP Assigner")); close(ipa_fd); } =20 /* Sends msg to IPA socket */ int ipa_write(int ipa_fd, ipa_msg *msg) { - syslog(LOG_INFO, "ipa_send: sending ipa request (type: %d) len %d", - msg->type, msg->len); + D(syslog(LOG_INFO, __FUNCTION__ ": Sending ipa request (type: %d) len %d= ", + msg->type, msg->len)); =20=20=20 return write(ipa_fd, msg, msg->len + sizeof(struct ipa_msg)); } @@ -94,13 +96,13 @@ int offset =3D 0, all_read =3D 0, msg_len =3D -1, c; ipa_msg *tmp; =20 - syslog(LOG_INFO, "ipa_receive: reading response");=20=20 + D(syslog(LOG_INFO, __FUNCTION__ ": Reading response")); =20 while (!all_read) { c =3D read(ipa_fd, &ipa_buf+offset, 256-offset);=20=20 =20 - syslog(LOG_INFO, "ipa_receive: got %d bytes", c);=20=20 + D(syslog(LOG_INFO, __FUNCTION__ ": Got %d bytes", c)); =20 if (c < 0) return c; @@ -120,7 +122,7 @@ =20=20=20 memcpy(msg, ipa_buf, offset); =20 - syslog(LOG_INFO, "Got %d bytes", offset); + D(syslog(LOG_INFO, __FUNCTION__ ": Got %d bytes total", offset)); =20 return msg_len;=20=20 } --- bt_vendor.c 2001/06/06 15:02:54 1.16 +++ bt_vendor.c 2001/06/08 09:55:47 1.17 @@ -54,6 +54,8 @@ #include "bt_vendor.h" #include "bt_if.h" =20 +#define D(x) //x + static void csr_init_phys(int fd); static void csr_init_hw(int bt_cfd, int phys_fd, int spd); static void digianswer_init_phys(int fd); @@ -202,7 +204,7 @@ void csr_init_phys(int fd) { - syslog(LOG_INFO, "Setting default speed 115200"); + D(syslog(LOG_INFO, "Setting default speed 115200")); if (hw_vendor() =3D=3D HW_CSR_H4)=20 fd_setup(fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); else @@ -231,7 +233,7 @@ { unsigned short msg[CSR_PSKEY_MAXPARAMS + CSR_PSKEY_MSGHDR_SIZE]; =20 - syslog(LOG_INFO ,": ps_key 0x%x rw_mode : %d\n", ps_key, rw_mode); + syslog(LOG_INFO, __FUNCTION__": ps_key 0x%x rw_mode : %d", ps_key, rw_mo= de); =20 msg[0] =3D ps_key; msg[1] =3D rw_mode; @@ -239,7 +241,7 @@ =20 if (n_pars > CSR_PSKEY_MAXPARAMS) { - syslog(LOG_INFO, "error : max nbr pskey params is %d [%d]\n",=20 + syslog(LOG_INFO, __FUNCTION__ ": Error: Max nbr pskey params is %d [%d= ]", CSR_PSKEY_MAXPARAMS, n_pars); return; } @@ -277,7 +279,7 @@ =20=20=20 if (hw_vendor() =3D=3D HW_CSR_H4) { - syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); + syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4"); =20=20=20=20=20 /* Temporarily set stack to use BCSP framing */ csr_bcspmode(bt_cfd, 1); @@ -336,7 +338,7 @@ } else { - syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_pa= rbuf[1]); }=20=20=20 =20=20=20=20=20 /* Set back stack to use H4 framing */ @@ -344,7 +346,7 @@ } else { - syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); + syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4"); =20 /* Set stack to use H4 temporarily */=20=20=20=20=20=20=20=20 csr_bcspmode(bt_cfd, 0); @@ -382,7 +384,7 @@ }=20 else { - syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_pa= rbuf[1]); } } =20 @@ -433,18 +435,18 @@ } } =20=20=20 - syslog(LOG_INFO, "Setting write_scan_enable in CSR module!\n"); + D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module!")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!\n"); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 bt_set_event_filter(bt_cfd, filter); =20 - syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 + D(syslog(LOG_INFO, "Setting baudrate in CSR module!")); =20 sleep(1); =20=20=20 @@ -458,7 +460,7 @@ =20 tcflush(phys_fd, TCIOFLUSH); =20 - syslog(LOG_INFO, "Baudrate set\n"); + D(syslog(LOG_INFO, "Baudrate set")); } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ @@ -478,7 +480,7 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; =20 - syslog(LOG_INFO, "Setting baudrate in Digianswer PC card\n"); + D(syslog(LOG_INFO, "Setting baudrate in Digianswer PC card")); =20 bt_set_baudrate(bt_cfd, spd); =20=20=20 @@ -521,7 +523,7 @@ =20 sleep(1); // wait for HW... =20 - syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20 + D(syslog(LOG_INFO, "Setting baudrate in Ericsson module!")); bt_set_baudrate(bt_cfd, spd); usleep(10000); =20 @@ -545,11 +547,11 @@ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20=20=20 sleep(1); - syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!\n"); + D(syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!")); bt_write_scan_enable(bt_cfd, wrscan); =20 sleep(1); // wait for HW...=20 - syslog(LOG_INFO, "Setting baudrate in Infineon module!\n");=20=20 + D(syslog(LOG_INFO, "Setting baudrate in Infineon module!")); bt_set_baudrate(bt_cfd, spd); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ @@ -574,12 +576,12 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - syslog(LOG_INFO, "Setting write_scan_enable in USB module!\n"); + D(syslog(LOG_INFO, "Setting write_scan_enable in USB module!")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!\n"); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 @@ -605,7 +607,7 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - syslog(LOG_INFO, "Setting write_scan_enable in generic module!\n"); + D(syslog(LOG_INFO, "Setting write_scan_enable in generic module!")); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); bt_set_event_filter(bt_cfd, filter); --- btd.c 2001/06/06 15:05:40 1.18 +++ btd.c 2001/06/08 09:55:47 1.19 @@ -50,10 +50,6 @@ =20=09=20=20=20=20=20 options:=20 =20 - -i, --hwinit=20 -=09 - default: ttyS0 -=20=20 -u, --physdev <uart device> Sets which uart device that will be used by the stack default: ttyS0 @@ -63,7 +59,7 @@ Can also be done from command line mode.=20 default: on =20=20=20 - -n, --local-name + -n, --local-name <prefix> prefix used for the local bluetooth device name default: nothing =20=20=20 @@ -71,6 +67,10 @@ reset bluetooth hardware before use default: no reset =20=20=20 + -i, --initial-speed <speed> + sets initial uart speed + default: 115200 baud + -s, --speed <speed> sets uart speed 9600, 19200, 38400, 57600, 115200, 230400, 460800 @@ -85,6 +85,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <errno.h> #include <fcntl.h> #include <signal.h> #include <syslog.h> @@ -184,11 +185,12 @@ /* long option list */ static struct option long_options[] =3D { + {"initial-speed", 1, NULL, 'i'}, /* initial uart speed */ {"physdev", 1, NULL, 'u'}, /* phys device used from stac= k */ - {"speed", 1, NULL, 's'}, /* uart speed towards hw */ + {"modem-emul", 1, NULL, 'm'}, {"local-name", 1, NULL, 'n'}, /* set local bluetooth name = */ {"reset", 1, NULL, 'R'}, /* reset BT HW */ - {"modem-emul", 1, NULL, 'm'}, + {"speed", 1, NULL, 's'}, /* uart speed towards hw */ {0, 0, 0, 0} }; =20 @@ -212,7 +214,7 @@ int result, opt; int bt_disc =3D N_BT; =20=20=20 - syslog(LOG_INFO, "Bluetooth daemon starting\n"); + syslog(LOG_INFO, "Bluetooth daemon starting"); =20=20=20 if (atexit(btd_cleanup) < 0) { @@ -229,7 +231,7 @@ case 'i': /* uart device */ init_hw_speed =3D atoi(optarg); - syslog(LOG_INFO, "init_hw_speed %d baud\n", init_hw_speed); + D(syslog(LOG_INFO, "init_hw_speed %d baud", init_hw_speed)); break; =20 case 'm': @@ -238,28 +240,29 @@ break; =20=20=20=20=20=20=20 case 'n': - syslog(LOG_INFO, "setting local name to %s\n", optarg); + D(syslog(LOG_INFO, "setting local name to %s", optarg)); strncpy(local_name, optarg, LOCAL_NAME_LENGTH); local_name[LOCAL_NAME_LENGTH] =3D '\0'; break; =20=20=20=20=20=20=20 case 'R': /* try to reset the hardware */ - syslog(LOG_INFO, "reset HW\n"); + D(syslog(LOG_INFO, "reset HW")); do_reset =3D 1; break; =20=20=20=20=20=20=20 case 's': /* speed */ - syslog(LOG_INFO, "phys dev running at %s\n", optarg); + D(syslog(LOG_INFO, "phys dev running at %s", optarg)); speedstr =3D optarg; break; =20=20=20=20=20=20=20 case 'u': /* uart device */ - syslog(LOG_INFO, "phys dev : %s\n", optarg); + D(syslog(LOG_INFO, "phys dev: %s", optarg)); physdev =3D optarg; break; + default: break; } @@ -268,7 +271,7 @@ /* Set restart point */ if (sigsetjmp(jmpbuffer, 1) !=3D 0) { - syslog(LOG_INFO, "restart...\n\n\n\n"); + syslog(LOG_INFO, "Restart..."); sleep(1); }=20=20=20=20 =20=20=20 @@ -276,14 +279,13 @@ =20 if ((phys_fd =3D open(physdev, O_RDWR | O_NOCTTY)) < 0) { - perror("could not open phys dev\n"); + perror("Could not open phys dev"); exit(1); } =20 /* Sets initial HW baudrate */ if (init_hw_speed !=3D 0) - fd_setup(phys_fd, init_hw_speed,=20 - USE_FLOW_CTRL, hw_vendor() =3D=3D HW_CSR_BCSP); + fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL, hw_vendor() =3D=3D HW_= CSR_BCSP); else init_phys(phys_fd); =20=20 @@ -332,7 +334,7 @@ if ((STATE(i) =3D=3D WAITING_PPPCONF) || (STATE(i) =3D=3D WAITING_RETURN_PPPCONF)) { - D(syslog(LOG_INFO, "Waiting for IPA response\n")); + D(syslog(LOG_INFO, "Waiting for IPA response")); waiting_iparsp =3D 1; } i++; @@ -390,13 +392,13 @@ { int line; =20 - D(syslog(LOG_INFO, "discover_connections")); + D(syslog(LOG_INFO, __FUNCTION__)); for (line =3D 0; line < BT_NBR_DATAPORTS; line++) { if ((STATE(line) =3D=3D NOCONNECTION) &&=20 bt_isconnected(bt_cfd, line)) { - syslog(LOG_INFO, "Found connection on line : %d !\n", line); + syslog(LOG_INFO, "Found connection on line: %d", line); STATE(line) =3D CONNECTED; =20=20=20=20=20=20=20 read_remote_bd(bt_cfd, PEER(line).remote_bd); @@ -404,7 +406,7 @@ =20=20=20=20=20=20=20 if (ipa_available) {=20=20 - D(syslog(LOG_INFO, "Sending IPA request\n")); + D(syslog(LOG_INFO, "Sending IPA request")); =20=20=20=20=20=20=20=20=20 PEER(line).ipset =3D &IPSET(line); =20=20=20=20=20=20=20=20=20 @@ -442,7 +444,7 @@ if (ipa_available) show_ipset(ipset, line); =20=20=20 - D(syslog(LOG_INFO, "build_pppdopts\n")); + D(syslog(LOG_INFO, __FUNCTION__)); =20=20=20 sprintf(dev, "/dev/ttyBT%d",line); =20 @@ -579,7 +581,7 @@ options.ttyBT1 which contains the remote IP address,=20 dns, wins etc*/ =20=20=20=20=20 - syslog(LOG_INFO, "WARNING No remote ip addr set, only local %s",=20 + syslog(LOG_INFO, "WARNING: No remote ip addr set, only local %s",=20 ip_addresses); =20 opts[i++] =3D ip_addresses; @@ -613,7 +615,7 @@ /* check state */ if (STATE(line) !=3D PPPCONF_DONE) { - syslog(LOG_INFO, "Warning : ppp config not done (%d)\n", STATE(line)); + syslog(LOG_INFO, "Warning: PPP config not done (%d)", STATE(line)); return -1; } =20=20=20 @@ -624,8 +626,6 @@ /* run modem emulator in a child */ if (!(PEER(line).pppd_pid =3D vfork())) { - syslog(LOG_INFO, "Starting modem emulator on %s", dev);=20 -=20=20=20=20=20=20 /* replace first arg with MODEMEMULCMD (is handled by=20 modem emulator) */ =20=20=20=20=20=20=20 @@ -648,8 +648,6 @@ STATE(line) =3D PPPD_STARTED; if (!(PEER(line).pppd_pid =3D vfork())) { - syslog(LOG_INFO, "Starting pppd on %s", dev); -=20=20=20=20=20=20 /* FIXME -- use opts inparam and not static opts */ execvp(PPPDCMD, opts); =20=20=20=20=20=20=20 @@ -674,20 +672,20 @@ { struct sigaction act; =20=20=20 - syslog(LOG_INFO, "Initiating signal handler\n"); + D(syslog(LOG_INFO, "Initiating signal handler")); act.sa_handler =3D sighandler; sigemptyset(&act.sa_mask); act.sa_flags =3D 0; sigaction(SIGCHLD, &act, 0); /* Catches when pppd childs are done */ sigaction(SIGUSR1, &act, 0); /* Restart application */ sigaction(SIGUSR2, &act, 0); /* HW Upgrade ? */ - sigaction(SIGTERM, &act, 0); /* Received when kill cmd is used */ + sigaction(SIGTERM, &act, 0); /* Terminate application */ } =20 static void sighandler(int sig) { - syslog(LOG_INFO, "Sighandler got signal : %d\n", sig); + D(syslog(LOG_INFO, "Sighandler got signal: %d", sig)); =20=20=20 if (sig =3D=3D SIGUSR1) { @@ -703,30 +701,31 @@ /* FIXME -- execvp(hw_upgrade_prog) */ // siglongjmp(jmpbuffer, 1); } - else if (sig =3D=3D SIGTERM) /* ? */ + else if (sig =3D=3D SIGTERM) {=20 - syslog(LOG_INFO, "Got SIGTERM, now exiting"); + D(syslog(LOG_INFO, "Got SIGTERM, now exiting")); exit(0); } else if (sig =3D=3D SIGCHLD)=20=20 { int line =3D 0, pid, status; - syslog(LOG_INFO, "One of the childs terminated\n"); + + D(syslog(LOG_INFO, "One of the childs terminated")); /* Find pid for this child */ =20=20=20=20=20 if ((pid =3D waitpid(-1, &status, WNOHANG)) <=3D 0) return; =20=20=20=20=20 - syslog(LOG_INFO, "pid %d terminated with status %d\n", pid, status); + D(syslog(LOG_INFO, "pid %d terminated with status %d", pid, status)); =20=20=20=20=20 /* find corresponding line */ while (line < BT_NBR_DATAPORTS) {=20=20=20=20=20 - syslog(LOG_INFO, "line %d pid : %d\n", line, PEER(line).pppd_pid); + D(syslog(LOG_INFO, "line %d pid: %d", line, PEER(line).pppd_pid)); =20=20=20=20=20=20=20 if (PEER(line).pppd_pid =3D=3D pid) { - syslog(LOG_INFO, "line %d found\n", line); + D(syslog(LOG_INFO, "line %d found", line)); break; } line++; @@ -734,11 +733,11 @@ =20=20=20=20=20 if (line =3D=3D BT_NBR_DATAPORTS) { - syslog(LOG_INFO, "Not a pppd pid\n"); + D(syslog(LOG_INFO, "Not a pppd pid")); return; } =20=20=20=20=20 - syslog(LOG_INFO, "PPP line %d was shutdown\n", line); + D(syslog(LOG_INFO, "PPP line %d was shutdown", line)); =20=20=20=20=20 if (ipa_available)=20 {=20 @@ -800,7 +799,7 @@ ipa_fd =3D open_socket(IPASERVER, CLIENT); if (ipa_fd < 0) { - syslog(LOG_INFO, "Found no IPA server"); + D(syslog(LOG_INFO, "Found no IPA server")); =20 if (i > 8) {=20=20 @@ -808,35 +807,34 @@ } else { - syslog(LOG_INFO, "Retrying in %d sec", i); + D(syslog(LOG_INFO, "Retrying in %d sec", i)); sleep(i); i *=3D 2; }=20=20=20=20=20=20 } else=20 {=20=20=20=20=20=20 - syslog(LOG_INFO, "Found IPA server"); + D(syslog(LOG_INFO, "Found IPA server")); ipa_available =3D 1; } }=20 #endif =20 if (modem_emul =3D=3D 1) - syslog(LOG_INFO, "Using modem emulation"); + D(syslog(LOG_INFO, "Using modem emulation")); else - syslog(LOG_INFO, "Using NO modem emulation"); + D(syslog(LOG_INFO, "Using NO modem emulation")); } =20 static void btd_cleanup(void) { - syslog(LOG_INFO, "btd_cleanup\n"); + D(syslog(LOG_INFO, __FUNCTION__)); btd_killchilds(); =20=20=20 - printf("shutdown_stack\n"); + printf("Shutting down Bluetooth stack\n"); shutdown_stack(bt_cfd); -=20=20 - printf("shutdown_stack done\n"); + printf("Bluetooth stack shut down\n"); =20=20=20 if (bt_cfd !=3D -1) { @@ -854,7 +852,7 @@ =20 if (ipa_fd !=3D -1) { - syslog(LOG_INFO, "closing IPA"); + D(syslog(LOG_INFO, "Closing connection to IPA")); tcflush(ipa_fd, TCIOFLUSH); close(ipa_fd); ipa_fd =3D -1; @@ -871,10 +869,10 @@ btd_killchilds(void) { int line; - printf("btd_killchilds\n"); + if (sdpsrv_pid > 0) { - syslog(LOG_INFO, "Killing SDP server\n"); + D(syslog(LOG_INFO, "Killing SDP server")); kill(sdpsrv_pid, SIGTERM); =20=20=20=20=20 if (waitpid(sdpsrv_pid, NULL, 0) < 0) @@ -888,7 +886,7 @@ { if (STATE(line) =3D=3D PPPD_STARTED) { - syslog(LOG_INFO, "Killing pppd on line %d\n", line); + D(syslog(LOG_INFO, "Killing pppd on line %d", line)); kill(PEER(line).pppd_pid, SIGTERM); if (waitpid(PEER(line).pppd_pid, NULL, 0) < 0) perror("waitpid pppd"); @@ -906,7 +904,7 @@ struct ipa_msg *msg; struct ipa_request *req; =20=20=20 - D(syslog(LOG_INFO, "ipa_request : type %d\n", type)); + D(syslog(LOG_INFO, __FUNCTION__ ": Type %d", type)); =20 msg =3D (struct ipa_msg*)buf; msg->type =3D type; @@ -924,25 +922,25 @@ case IPARSP_STATUS: { ipa_status *rsp =3D (struct ipa_status*)(msg->msg); - D(syslog(LOG_INFO, "parse_ipa_response : got status %d on line %d\n"= ,=20 + D(syslog(LOG_INFO, __FUNCTION__ ": Got status %d on line %d",=20 rsp->status, rsp->id)); =20 /* Check state */ if (STATE(rsp->id) !=3D WAITING_RETURN_PPPCONF) { - syslog(LOG_INFO, "parse_ipa_response : wrong state"); + syslog(LOG_INFO, __FUNCTION__ ": Wrong state"); return -ERR_WRONGSTATE; } =20 /* Check status */ if (rsp->status =3D=3D IPA_STATUSFAILED) { - syslog(LOG_INFO, "parse_ipa_response : request failed [line:%d]\n"= ,=20 - rsp->id); + syslog(LOG_INFO, __FUNCTION__ ": Request failed [line:%d]", rsp->i= d); return -IPA_STATUSFAILED; }=20=20=20=20=20=20 else - D(syslog(LOG_INFO, "parse_ipa_response : request succeeded [line:%d]\n", = rsp->id)); + D(syslog(LOG_INFO, __FUNCTION__ ": Request succeeded [line:%d]", + rsp->id)); =20 /* put peer into NOCONNECTION, if still connected this will=20 be discovered from timeout */ @@ -955,12 +953,12 @@ case IPARSP_PEERSETTINGS: { ipa_response* rsp =3D (struct ipa_response*)(msg->msg); - D(syslog(LOG_INFO, "parse_ipa_response : got client settings\n")); + D(syslog(LOG_INFO, __FUNCTION__ ": Got client settings")); =20=20=20=20=20=20=20 /* Check state */ if (STATE(rsp->id) !=3D WAITING_PPPCONF) { - syslog(LOG_INFO, "parse_ipa_response : wrong state"); + syslog(LOG_INFO, __FUNCTION__ ": Wrong state"); return -ERR_WRONGSTATE; } =20 @@ -968,7 +966,7 @@ if (rsp->status =3D=3D IPA_STATUSFAILED) { /* error */ - printf("parse_ipa_response : failed to get client settings\n"); + syslog(LOG_INFO, __FUNCTION__ ": Failed to get client settings\n"); return -ERR_REQUESTFAILED; } =20 @@ -984,7 +982,7 @@ } =20=20=20=20=20 default : - syslog(LOG_INFO, "Error : Unknown message type"); + syslog(LOG_INFO, __FUNCTION__ ": Unknown message type"); break; } return 0; --- modememul.c 2001/06/06 15:06:00 1.8 +++ modememul.c 2001/06/08 09:55:47 1.9 @@ -83,10 +83,10 @@ void sighandler(int sig) { - syslog(LOG_INFO, "got signal %d", sig); + D(syslog(LOG_INFO, "Got signal %d", sig)); if ((sig =3D=3D SIGQUIT) || (sig =3D=3D SIGTERM || (sig =3D=3D SIGHUP))) { - syslog(LOG_INFO, "Modem emulator exiting\n"); + D(syslog(LOG_INFO, "Modem emulator exiting")); exit(0); } } @@ -96,13 +96,13 @@ { struct sigaction act; =20 - syslog(LOG_INFO, "Initiating signal handler\n"); + D(syslog(LOG_INFO, "Initiating signal handler")); act.sa_handler =3D sighandler; sigemptyset(&act.sa_mask); act.sa_flags =3D 0; sigaction(SIGHUP, &act, 0); sigaction(SIGQUIT, &act, 0); - sigaction(SIGTERM, &act, 0); /* Received when kill cmd is used */ + sigaction(SIGTERM, &act, 0); } =20 int @@ -119,7 +119,7 @@ =20 while (done !=3D START_PPP) { - syslog(LOG_INFO, "Starting modem emulator on %s\n", argv[1]); + syslog(LOG_INFO, "Starting modem emulator on %s", argv[1]); =20 if ((btfd =3D open(argv[1], O_RDWR, 0)) < 0) { @@ -131,7 +131,7 @@ fd_setup(btfd, speed, USE_NO_FLOW, DONT_USE_BCSP); done =3D modem_emulator(btfd); close(btfd); - syslog(LOG_INFO, "Closing %s", argv[1], speed);=20=20 + D(syslog(LOG_INFO, "Closing %s", argv[1])); } =20 /* replace first arg with pppd instead of modem emulator=20 @@ -154,7 +154,7 @@ int done =3D 0, i; fd_set rfd; =20 - syslog(LOG_INFO, "Modem emulator starting\n"); + D(syslog(LOG_INFO, "Modem emulator starting")); =20 while (!done) {=20=20 @@ -167,7 +167,7 @@ int len =3D read(bt_fd, &data, 128);=20=20=20=20=20=20 data[len] =3D 0; =20=20=20=20=20=20=20 - syslog(LOG_INFO, "Modem emulator got %d bytes\n", len); + D(syslog(LOG_INFO, "Modem emulator got %d bytes", len)); =20=20=20=20=20=20=20 if (len <=3D 0) return RESTART;=20=20=20=20=20=20 @@ -186,7 +186,7 @@ /* check for escaped chars */=20=20=20=20=20=20=20=20=20=20=20= =20 if (data[i+2] =3D=3D PPP_CONTROL_ESCAPE)=20 {=20 - D(syslog(LOG_INFO, "Found ctrl esc\n")); + D(syslog(LOG_INFO, "Found ctrl esc")); prot =3D ((data[i+4]<<8) | (data[i+5])); } else @@ -231,16 +231,16 @@ =20 if(!strncasecmp(data, "ATD", 3)) /* windows standard modem */ { - syslog(LOG_INFO, "got ATD");=09 + D(syslog(LOG_INFO, "Got ATD")); =20 - syslog(LOG_INFO, "Write : %s", connect); + D(syslog(LOG_INFO, "Write: %s", connect)); write(bt_fd, connect, strlen(connect));=20=20=20 syslog(LOG_INFO, "Modem connected !"); return START_PPP; } else if(!strncasecmp(data, "CLIENT", 6)) /* windows null modem */ { - syslog(LOG_INFO, "got CLIENT"); + D(syslog(LOG_INFO, "Got CLIENT")); write(bt_fd, client_server, strlen(client_server));=20=20=20 syslog(LOG_INFO, "Nullmodem connected !"); return START_PPP; |
From: Peter K. <pk...@us...> - 2001-06-08 09:45:38
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.h 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added const as appropriate. The diff of the modified file(s): --- bt_misc.h 2001/05/17 10:32:32 1.7 +++ bt_misc.h 2001/06/08 09:45:37 1.8 @@ -57,15 +57,15 @@ int translate_speed(int spd); =20 /* Socket handling */ -int open_socket(char *name, int role); -int open_tcpsocket(char *addrstr, int role); +int open_socket(const char *name, int role); +int open_tcpsocket(const char *addrstr, int role); =20 -int write_pidfile(char *pidname); +int write_pidfile(const char *pidname); char *get_local_ip_address(void); const char *bd2str(const unsigned char *bd); #ifndef BT_USERSTACK -void print_data(const char *message, unsigned char *buf, int len); +void print_data(const char *message, const unsigned char *buf, int len); #endif -void set_pin_code(char *pin); +void set_pin_code(const char *pin); =20 #endif /* __BT_MISC_H__*/ |
From: Peter K. <pk...@us...> - 2001-06-08 09:44:59
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Close file descriptors in open_socket() and open_tcpsocket() as appropriate. * Added error handling to open_socket() and open_tcpsocket(). * Improved some log messages. * Marked debug messages as such. The diff of the modified file(s): --- bt_misc.c 2001/05/17 10:22:04 1.10 +++ bt_misc.c 2001/06/08 09:44:58 1.11 @@ -65,93 +65,109 @@ #include "btd.h" #include "bt_misc.h" =20 -int write_pidfile(char *pidname) +#define D(x) //x + +int +write_pidfile(const char *pidname) { int pid_fd; char pid_buf[80]; =20 - if ((pid_fd =3D open(pidname, O_CREAT | O_WRONLY |=20 - O_TRUNC | O_EXCL, 0666)) < 0) + if ((pid_fd =3D open(pidname, O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 066= 6)) < 0) { if (errno =3D=3D EEXIST) { - syslog(LOG_INFO, "There is already another version of %s running.\n", + syslog(LOG_INFO, "There is already another version of %s running.", pidname); } else { - syslog(LOG_INFO, "Could not create pid file for btinit.\n"); + syslog(LOG_INFO, "Could not create pid file for btinit."); } exit(0); } =20 sprintf(pid_buf, "%d\n", getpid()); write(pid_fd, pid_buf, strlen(pid_buf)); - /* do not set pid_fd to -1, we use it to mark that we created the pid fi= le */ close(pid_fd); + return pid_fd; } =20 -/* Local UNIX socket stuff */ -int open_socket(char *name, int role) +/* Local UNIX socket */ +int +open_socket(const char *name, int role) { - int server_sockfd; struct sockaddr_un server_address; - int client_sockfd; - struct sockaddr_un client_address; - int server_len; - int client_len;=20=20 + int fd; =20 - syslog(LOG_INFO, "Opening socket %s ", name); + D(syslog(LOG_INFO, "Opening socket %s", name)); + if (role =3D=3D SERVER) { /* remove any old socket */ unlink(name); -=20=20=20=20 - /* open socket */=20=20=20=20 - server_sockfd =3D socket(AF_UNIX, SOCK_STREAM, 0); - server_address.sun_family =3D AF_UNIX; - strcpy(server_address.sun_path, name); - server_len =3D sizeof(server_address); - bind(server_sockfd, (struct sockaddr *)&server_address, server_len); - listen(server_sockfd, 5); - client_sockfd =3D accept(server_sockfd,=20 - (struct sockaddr *)&(client_address), - &client_len); } - else +=20=20=20=20 + if ((fd =3D socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - /* Client */ - client_sockfd =3D socket(AF_UNIX, SOCK_STREAM, 0); + syslog(LOG_ERR, __FUNCTION__ ": Failed to create %s", name); + return -1; + } =20 - /* 'destination' socket */ + memset(&server_address, 0, sizeof server_address); server_address.sun_family =3D AF_UNIX; strcpy(server_address.sun_path, name); - server_len =3D sizeof(server_address); =20=20=20=20=20=20=20 - if (connect(client_sockfd,=20 - (struct sockaddr *)&server_address,=20 - server_len) < 0) { - syslog(LOG_ERR, "open_socket %s failed", name); + if (role =3D=3D SERVER) + { + int tmp_fd; + + if (bind(fd, (struct sockaddr *)&server_address, sizeof server_address= ) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to bind %s", name); + close(fd); return -1; } =20 - syslog(LOG_INFO, "Socket connected to %s\n", server_address.sun_path); + if (listen(fd, 5) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to listen on %s", name); + close(fd); + return -1; } =20 - return client_sockfd; + if ((tmp_fd =3D accept(fd, NULL, NULL)) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to accept %s", name); + close(fd); + return -1; } =20 + close(fd); + fd =3D tmp_fd; + } + else + { + if (connect(fd, (struct sockaddr *)&server_address, sizeof server_addr= ess) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to connect %s", name); + close(fd); + return -1; + } + } + + D(syslog(LOG_INFO, "Socket connected to %s", name)); + + return fd; +} + /* TCP socket */ -int open_tcpsocket(char *addrstr, int role) +int +open_tcpsocket(const char *addrstr, int role) { - int server_sockfd; struct sockaddr_in server_address; - int client_sockfd; - struct sockaddr_in client_address; - - int server_len; - int client_len; + int fd; int port; char ipstr[16]; char *pos;=20=20 @@ -161,7 +177,7 @@ if (!(pos =3D strchr(addrstr, ':'))) { fprintf(stderr, "Port argument missing!\n"); - exit(1); + return -1; } =20 /* copy ip address */ @@ -172,67 +188,74 @@ /* extract port number */ port =3D atoi(pos+1); =20 - if (role =3D=3D SERVER) - { /* open socket */=20=20=20=20 - server_sockfd =3D socket(AF_INET, SOCK_STREAM, 0); + if ((fd =3D socket(AF_INET, SOCK_STREAM, 0)) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to create socket"); + return -1; + } + + memset(&server_address, 0, sizeof server_address); server_address.sin_family =3D AF_INET; + server_address.sin_port =3D htons(port); =20 + if (role =3D=3D SERVER) + { + int tmp_fd; + server_address.sin_addr.s_addr =3D htonl(INADDR_ANY); - server_address.sin_port =3D htons(port); =20 - server_len =3D sizeof(server_address); + if (bind(fd, (struct sockaddr *)&server_address, sizeof server_address= ) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to bind to port %d", port); + close(fd); + return -1; + } =20 - if (bind(server_sockfd, (struct sockaddr *)&server_address, server_len= )) + if (listen(fd, 5) < 0) { - perror("bind"); - exit(1); + syslog(LOG_ERR, __FUNCTION__ ": Failed to listen to port %d", port); + close(fd); + return -1; } =20 - printf("Waiting for connect on port %d\n", port); + D(syslog(LOG_INFO, "Waiting for connection on port %d", port)); =20 - if (listen(server_sockfd, 5)) + /* request for a new connection */ + if ((tmp_fd =3D accept(fd, NULL, NULL)) < 0) { - perror("listen"); - exit(1); + syslog(LOG_ERR, __FUNCTION__ ": Failed to accept on port %d", port); + close(fd); + return -1; } =20=20=20=20=20 - /* request for a new connection */ - client_sockfd =3D accept(server_sockfd, - (struct sockaddr *)&(client_address), - &client_len); + close(fd); + fd =3D tmp_fd; } else { - /* Client */ - - printf("Connecting to TCP server socket [%s:%d]\n", ipstr, port); -=20=20=20=20 - /* open socket */=20=20=20=20 - client_sockfd =3D socket(AF_INET, SOCK_STREAM, 0); + D(syslog(LOG_INFO, "Connecting to %s:%d", ipstr, port)); =20 /* destination address */ - server_address.sin_family =3D AF_INET; server_address.sin_addr.s_addr =3D inet_addr(ipstr); - server_address.sin_port =3D htons(port); /* for example... */ - server_len =3D sizeof(server_address); =20=20 - if (connect(client_sockfd,=20 - (struct sockaddr *)&server_address,=20 - server_len) < 0) { - perror("open_tcpsocket"); - exit(1); + if (connect(fd, (struct sockaddr *)&server_address, sizeof server_addr= ess) < 0) + { + syslog(LOG_ERR, __FUNCTION__ ": Failed to connect to %s:%d", ipstr, = port); + close(fd); + return -1; } } =20 - return client_sockfd; + return fd; } =20 =20 /*=20 * Retrieve the numerical IP address of eth0 for now. */ -char * get_local_ip_address(void) +char * +get_local_ip_address(void) { int fd; struct ifreq ifr; @@ -240,14 +263,14 @@ =20 if ((fd =3D socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - syslog(LOG_INFO, "Could not determine local IP address!"); + syslog(LOG_ERR, __FUNCTION__ ": Failed to create socket"); return "0.0.0.0"; } =20=20=20 strcpy(ifr.ifr_name, "eth0"); if (ioctl(fd, SIOCGIFADDR, (int)&ifr) < 0) { - syslog(LOG_INFO, "Could not determine local IP address!"); + syslog(LOG_INFO, __FUNCTION__ ": Could not determine local IP address!= "); close(fd); return "0.0.0.0"; } @@ -345,7 +368,8 @@ return; } =20 -const char* bd2str(const unsigned char *bd) +const char* +bd2str(const unsigned char *bd) { static char buf[20]; =20 @@ -357,7 +381,7 @@ =20 #ifndef BT_USERSTACK void=20 -print_data(const char *message, unsigned char *buf, int len) +print_data(const char *message, const unsigned char *buf, int len) {=20 int t; =20 @@ -373,7 +397,8 @@ #endif =20 /* Sets pin code to string pin, disabled if using 'disable' as pin */ -void set_pin_code(char *pin) +void +set_pin_code(const char *pin) { #ifdef __CRIS__ char exec_pinstr[100]; |
From: Peter K. <pk...@us...> - 2001-06-08 09:38:40
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.h 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed declaration of open_socket() (it is in bt_misc.h). The diff of the modified file(s): --- bt_if.h 2001/06/06 15:01:41 1.11 +++ bt_if.h 2001/06/08 09:38:39 1.12 @@ -344,7 +344,6 @@ =20 int open_device(char* dev, int flags, int role); void close_device(int fd); -int open_socket(char *name, int role); const char *error_msg(int err); int start_sdp_server(void); =20 |
From: Mats F. <ma...@us...> - 2001-06-07 14:33:42
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.155 1.156=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Initialize host_controller_buffers The diff of the modified file(s): --- hci.c 2001/06/07 06:47:21 1.155 +++ hci.c 2001/06/07 14:33:41 1.156 @@ -266,7 +266,8 @@ =20 /* General HCI controller struct, contains vital information about buffer= =20 sizes and connections */ -hci_controller hci_ctrl; +hci_controller hci_ctrl =3D {{0, 0, 0, 0, 0}}; +=09=09=09=20 =20 #ifdef __KERNEL__ #ifdef USE_NCPTIMER @@ -1838,13 +1839,11 @@ hci_ctrl.nbr_of_connections =3D 0; =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP +=09 + /* If we use bcsp cmd_num will be set from command status event after + syncronizing bcsp */ if (!bt_use_bcsp(-1)) { hci_ctrl.hc_buf.cmd_num =3D 1; - } else { - /* cmd_num will be set from command status event after - syncronizing bcsp, until then we shouldn't send any - commands */ - hci_ctrl.hc_buf.cmd_num =3D 0; } =20 #else |
From: Peter K. <pk...@us...> - 2001-06-07 10:47:38
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.h 1.29 1.30=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added CONFIG_BLUETOOTH_SUPPORT_BCSP. * Only set CONFIG_BLUETOOTH_SUPPORT_BCSP and CONFIG_BLUETOOTH_USE_BCSP if building for CSR hardware. The diff of the modified file(s): --- btconfig.h 2001/05/15 15:02:20 1.29 +++ btconfig.h 2001/06/07 10:47:37 1.30 @@ -82,10 +82,12 @@ #endif =20 #undef CONFIG_BLUETOOTH_ENABLE_MSSWITCH - #undef CONFIG_BLUETOOTH_EARLY_MSSWITCH =20 -#define CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_CSR +#define CONFIG_BLUETOOTH_SUPPORT_BCSP +#undef CONFIG_BLUETOOTH_USE_BCSP +#endif =20 /*************** * HCI * |
From: Mats F. <ma...@us...> - 2001-06-07 09:11:51
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_sequence.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected debug * Added comments The diff of the modified file(s): --- bcsp_sequence.c 2001/06/06 14:55:18 1.11 +++ bcsp_sequence.c 2001/06/07 09:11:48 1.12 @@ -139,7 +139,7 @@ bcsp_sequence_receive(struct bcsp *bcsp) { if (!bcsp_issyncronized()){=09 - D(printk("Still not synced\n")); + D(__FUNCTION__": Still not synced\n"); return 0; } =20=09 @@ -151,6 +151,7 @@ expected_rxseq =3D (expected_rxseq + 1) % 8; sti(); =20 + /* FIXME: Do we need to schedule when winsize > 0 ? */ if ((winspace > 0) && (buf_count())) { /* ack is piggybacked in next tx data packet */ D("<-data ack\n"); @@ -163,8 +164,7 @@ bcsp->identifier); } else { /* out of order rx seq nbr */=20 if ((winspace > 0) && (hci_trig_send())) { - print_data(__FUNCTION__, bcsp->payload,=20 - bcsp->payload_length); + /* ack is piggybacked in next tx data packet */ printk("seq out-of-order [exp:%d, got:%d]\n",=20 expected_rxseq, BCSP_GET_SEQ(bcsp)); } else { |
From: Mats F. <ma...@us...> - 2001-06-07 06:49:10
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.178 1.179=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Undefine BTINITBCSP when not supporting bcsp The diff of the modified file(s): --- bluetooth.c 2001/06/06 14:52:31 1.178 +++ bluetooth.c 2001/06/07 06:49:09 1.179 @@ -1069,6 +1069,7 @@ return 0; } =20 +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP case BTINITBCSP: { printk("BTINITBCSP\n"); @@ -1076,6 +1077,7 @@ printk("Sync failed\n"); return 0; } +#endif =20 #endif =20 |
From: Mats F. <ma...@us...> - 2001-06-07 06:47:23
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.154 1.155=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Initialize cmd_num to 0 when using bcsp The diff of the modified file(s): --- hci.c 2001/06/06 14:53:11 1.154 +++ hci.c 2001/06/07 06:47:21 1.155 @@ -816,8 +816,8 @@ test_hci_hdl =3D hci_hdl; =20 if (link_type =3D=3D ACL_LINK) { - lp_connect_cfm(buf + 3, (u32) buf[0], hci_hdl); =20 + lp_connect_cfm(buf + 3, (u32) buf[0], hci_hdl); #ifndef HCI_EMULATION if (buf[0]) { /* remove hci handle if connection failed */ @@ -1838,12 +1838,14 @@ hci_ctrl.nbr_of_connections =3D 0; =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP - /* After syncing BCSP we receive a command status with cmd num */ - if (!bt_use_bcsp(-1)) + if (!bt_use_bcsp(-1)) { hci_ctrl.hc_buf.cmd_num =3D 1; - - /* don't touch cmd num when using bcsp, is updated=20 - from command status event after syncronizing */ + } else { + /* cmd_num will be set from command status event after + syncronizing bcsp, until then we shouldn't send any + commands */ + hci_ctrl.hc_buf.cmd_num =3D 0; + } =20 #else hci_ctrl.hc_buf.cmd_num =3D 1; |
From: Mattias A. <mat...@us...> - 2001-06-06 16:29:24
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Set bcsp_sync to false in bcsp_shutdown The diff of the modified file(s): --- bcsp.c 2001/06/06 14:54:34 1.12 +++ bcsp.c 2001/06/06 16:29:23 1.13 @@ -155,6 +155,7 @@ DSYS("Shutting down BCSP\n"); bcsp_datagram_shutdown(); /* choke datastream */ bcsp_sequence_shutdown(); + bcsp_sync =3D FALSE; } =20 void=20 |
From: Mattias A. <mat...@us...> - 2001-06-06 16:28:02
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.42 1.43=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added more debug when setting ps keys The diff of the modified file(s): --- hci_vendor.c 2001/06/06 14:53:41 1.42 +++ hci_vendor.c 2001/06/06 16:28:01 1.43 @@ -563,7 +563,7 @@ break; =20=09=09=09=09 case CSR_CMD_PS: - printk("ps key[0x%x] ", ps->ps_key); + printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key); print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); =20=09=09=09=09 /* Now copy this data to return buf */ @@ -689,7 +689,8 @@ csr_bccmd *cmd; csr_bccmd_ps *ps; =20 - printk(__FUNCTION__" : ps 0x%x\n", ps_key);=09 + printk(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09 + print_data("pars : ", (u8*)retb, n_pars*sizeof(u16)); =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; @@ -1005,7 +1006,7 @@ break; =20 case CSR_CMD_PS: - printk("ps key[0x%x] ", ps->ps_key); + printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key); print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); =20=09=09=09=09 /* Now copy this data to return buf */ |
From: Peter K. <pk...@us...> - 2001-06-06 15:52:14
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Makefile 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Check for CONFIG_BLUETOOTH_SUPPORT_BCSP instead of CONFIG_BLUETOOTH_USE_BCSP. The diff of the modified file(s): --- Makefile 2001/05/17 11:15:04 1.21 +++ Makefile 2001/06/06 15:52:13 1.22 @@ -20,11 +20,11 @@ =20 # For 2.4.x obj-$(CONFIG_BLUETOOTH) +=3D $(OBJS) -obj-$(CONFIG_BLUETOOTH_USE_BCSP) +=3D $(BOBJS) +obj-$(CONFIG_BLUETOOTH_SUPPORT_BCSP) +=3D $(BOBJS) =20 # For 2.0.x and 2.2.x O_OBJS =3D $(OBJS) -ifdef CONFIG_BLUETOOTH_USE_BCSP +ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP O_OBJS +=3D $(BOBJS) endif M_OBJS =3D $(O_TARGET) |
From: Peter K. <pk...@us...> - 2001-06-06 15:50:18
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Config.in 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected indentation. |
From: Mattias A. <mat...@us...> - 2001-06-06 15:06:00
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- modememul.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added call to setsid =3D> become session leader to catch SIGHUPS * Removed O_NOCTTY flag when opening ttyBTx The diff of the modified file(s): --- modememul.c 2001/05/17 10:36:36 1.7 +++ modememul.c 2001/06/06 15:06:00 1.8 @@ -83,8 +83,8 @@ void sighandler(int sig) { - syslog(LOG_INFO, "got signal %d\n", sig); - if (sig =3D=3D SIGQUIT) + syslog(LOG_INFO, "got signal %d", sig); + if ((sig =3D=3D SIGQUIT) || (sig =3D=3D SIGTERM || (sig =3D=3D SIGHUP))) { syslog(LOG_INFO, "Modem emulator exiting\n"); exit(0); @@ -100,7 +100,9 @@ act.sa_handler =3D sighandler; sigemptyset(&act.sa_mask); act.sa_flags =3D 0; + sigaction(SIGHUP, &act, 0); sigaction(SIGQUIT, &act, 0); + sigaction(SIGTERM, &act, 0); /* Received when kill cmd is used */ } =20 int @@ -110,15 +112,16 @@ int speed =3D 0; int done =3D 0; =20 - speed =3D atoi(argv[2]); + setsid(); /* become session leader (to catch SIGHUPS) */=20=20 + init_sighandler(); =20 - syslog(LOG_INFO, "Opening %s (%d baud) for modem emulation\n", - argv[1], speed); + speed =3D atoi(argv[2]); =20 while (done !=3D START_PPP) { - syslog(LOG_INFO, "Open %s", argv[1]); - if ((btfd =3D open(argv[1], O_RDWR | O_NOCTTY)) < 0) + syslog(LOG_INFO, "Starting modem emulator on %s\n", argv[1]); + + if ((btfd =3D open(argv[1], O_RDWR, 0)) < 0) { perror("open"); exit(1); @@ -126,11 +129,9 @@ =20 /* not necessary for BT devices... */ fd_setup(btfd, speed, USE_NO_FLOW, DONT_USE_BCSP); - - syslog(LOG_INFO, "done."); done =3D modem_emulator(btfd); - syslog(LOG_INFO, "Exit modem emulator"); close(btfd); + syslog(LOG_INFO, "Closing %s", argv[1], speed);=20=20 } =20 /* replace first arg with pppd instead of modem emulator=20 @@ -154,6 +155,7 @@ fd_set rfd; =20 syslog(LOG_INFO, "Modem emulator starting\n"); + while (!done) {=20=20 FD_ZERO(&rfd);=20 @@ -165,7 +167,7 @@ int len =3D read(bt_fd, &data, 128);=20=20=20=20=20=20 data[len] =3D 0; =20=20=20=20=20=20=20 - D(syslog(LOG_INFO, "Modem emulator got %d bytes\n", len)); + syslog(LOG_INFO, "Modem emulator got %d bytes\n", len); =20=20=20=20=20=20=20 if (len <=3D 0) return RESTART;=20=20=20=20=20=20 @@ -174,7 +176,6 @@ =20 for (i =3D 0; i < len; i++) { - if ((data[i] =3D=3D PPP_FLAGSEQUENCE)) { if ((len - i) >=3D 7) |
From: Mattias A. <mat...@us...> - 2001-06-06 15:05:40
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Moved reset of hw closer to init_stack * Check twice as often for new rfcomm cons (select timer 0,5 sec) The diff of the modified file(s): --- btd.c 2001/05/31 12:18:38 1.17 +++ btd.c 2001/06/06 15:05:40 1.18 @@ -181,7 +181,6 @@ static int phys_fd =3D -1; /* physical device e.g ttyS0 */ static sigjmp_buf jmpbuffer; /* used to jump back in program after doing r= eset */ =20 - /* long option list */ static struct option long_options[] =3D { @@ -275,10 +274,6 @@ =20=20=20 init(); =20 - /* Hardreset of BT hardware */ - if (do_reset) - reset_hw(); -=20=20 if ((phys_fd =3D open(physdev, O_RDWR | O_NOCTTY)) < 0) { perror("could not open phys dev\n"); @@ -287,7 +282,8 @@ =20 /* Sets initial HW baudrate */ if (init_hw_speed !=3D 0) - fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL, hw_vendor() =3D=3D HW_= CSR_BCSP); + fd_setup(phys_fd, init_hw_speed,=20 + USE_FLOW_CTRL, hw_vendor() =3D=3D HW_CSR_BCSP); else init_phys(phys_fd); =20 @@ -296,6 +292,12 @@ =20=20=20 bt_cfd =3D bt_openctrl(); =20=20=20 + tcflush(phys_fd, TCIOFLUSH); + + /* Hardreset of BT hardware */ + if (do_reset) + reset_hw(); + init_stack(bt_cfd, atoi(speedstr)); =20=20=20 if (do_hwinit) @@ -306,8 +308,8 @@ while (1) { int i, waiting_iparsp =3D 0; - tv.tv_sec =3D 1; - tv.tv_usec =3D 0; + tv.tv_sec =3D 0; + tv.tv_usec =3D 500000; =20 FD_ZERO(&rfd);=20=20 =20 @@ -437,7 +439,6 @@ struct ip_set *ipset =3D PEER(line).ipset; char local_ip[20]; =20 -=20=20 if (ipa_available) show_ipset(ipset, line); =20=20=20 @@ -470,7 +471,6 @@ opts[i++] =3D "useradius"; opts[i++] =3D "auth"; opts[i++] =3D "login"; -=20=20=20=20=20=20 opts[i++] =3D "localbdaddr"; =20 read_local_bd(bt_cfd, local_bd); @@ -701,7 +701,6 @@ // btd_cleanup(); =20 /* FIXME -- execvp(hw_upgrade_prog) */ - // siglongjmp(jmpbuffer, 1); } else if (sig =3D=3D SIGTERM) /* ? */ |
From: Mattias A. <mat...@us...> - 2001-06-06 15:02:55
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added some ps key defines * Added csr_bcspmode() to enable/disable bcsp mode in kernel * Added csr_pskey() used to read/write any PS key in HW * Added csr_change_if() which switches host interface in CSR HW (BCSP<->H4) * Added check in init_hw for CSR HW whether init went ok, if not=20 we try changing interface and retry by restarting btd. * Always make sure that deep sleep timer is disabled in HW when=20 using BCSP The diff of the modified file(s): --- bt_vendor.c 2001/05/17 14:53:54 1.15 +++ bt_vendor.c 2001/06/06 15:02:54 1.16 @@ -45,7 +45,10 @@ #include <termios.h> #include <syslog.h> #include <sys/ioctl.h> +#include <sys/types.h> +#include <signal.h> #include <string.h> +#include <stdlib.h> =20 #include "bt_misc.h" #include "bt_vendor.h" @@ -188,6 +191,13 @@ /* CSR specific commands */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ =20 +#define PSKEY_HOSTIO_UART_PS_BLOCK 0x0191 +#define PSKEY_HOST_INTERFACE 0x01f9 +#define PSKEY_UART_SLEEP_TIMEOUT 0x0222 +#define CSR_PSKEY_GETREQ 0x0 +#define CSR_PSKEY_SETREQ 0x2 + + /* Set the phys device to CSR default, 115200 */=20 void csr_init_phys(int fd) @@ -199,6 +209,189 @@ fd_setup(fd, 115200, USE_FLOW_CTRL, USE_BCSP); } =20 +void +csr_bcspmode(int bt_cfd, int enable) +{ + if (ioctl(bt_cfd, BTSETBCSPMODE, &enable) < 0) + { + perror(__FUNCTION__); + exit(1); + } +} + + +/* + * Read/Write any PS key in CSR module=20 + * ps_vals holds return values / set params depending on=20 + * type of operation + */ + +void csr_pskey(int bt_cfd, unsigned short ps_key, unsigned short rw_mode,= =20 + unsigned short *ps_vals, unsigned short n_pars) +{ + unsigned short msg[CSR_PSKEY_MAXPARAMS + CSR_PSKEY_MSGHDR_SIZE]; + + syslog(LOG_INFO ,": ps_key 0x%x rw_mode : %d\n", ps_key, rw_mode); + + msg[0] =3D ps_key; + msg[1] =3D rw_mode; + msg[2] =3D n_pars; + + if (n_pars > CSR_PSKEY_MAXPARAMS) + { + syslog(LOG_INFO, "error : max nbr pskey params is %d [%d]\n",=20 + CSR_PSKEY_MAXPARAMS, n_pars); + return; + } +=20=20 + if (rw_mode =3D=3D CSR_PSKEY_GETREQ) + memset(&msg[CSR_PSKEY_MSGHDR_SIZE], 0, n_pars*2); /* GETREQ */ + else + memcpy(&msg[CSR_PSKEY_MSGHDR_SIZE], ps_vals, n_pars*2);=20=20=20=20 +=20=20 + if (ioctl(bt_cfd, BT_CSR_PSKEY, msg) < 0) + { + perror(__FUNCTION__); + exit(1); + } + + /* Copy back return params if READ (skip message header) */ + if (rw_mode =3D=3D CSR_PSKEY_GETREQ) + memcpy(ps_vals, &msg[CSR_PSKEY_MSGHDR_SIZE], n_pars*2); +} + +/*=20 + * Switches host interface in CSR HW (H4<->BCSP)=20 + */ + +void csr_change_if(int bt_cfd, int phys_fd, int spd) +{ + static int did_restart =3D 0; /* only try once */ + unsigned short ps_parbuf[10]; +=20=20 + if (did_restart) + return; + + shutdown_stack(bt_cfd); + sleep(1); +=20=20 + if (hw_vendor() =3D=3D HW_CSR_H4) + { + syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); +=20=20=20=20 + /* Temporarily set stack to use BCSP framing */ + csr_bcspmode(bt_cfd, 1); +=20=20=20=20 + /* Setup serial port for BCSP (default baudrate) */ + fd_setup(phys_fd, 115200, USE_FLOW_CTRL, USE_BCSP); + reset_hw(); + + if (ioctl(bt_cfd, BTINITBCSP) < 0) + { + perror(__FUNCTION__); + exit(1); + } +=20=20=20=20 + sleep(1); + + /* Make sure that deep sleep timer is disabled to=20 + prevent problems when setting new ps keys */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 1); +=20=20=20=20 + if (ps_parbuf[0] !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf[0] =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + reset_hw(); + + if (ioctl(bt_cfd, BTINITBCSP) < 0) + { + perror(__FUNCTION__); + exit(1); + } + sleep(1); + } +=20=20=20=20 + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 10); + + if (ps_parbuf[1] =3D=3D 6) /* BCSP */ + { + /* Set UART to no parity, non-bcsp, flow control on */ + ps_parbuf[1] =3D 0x00a8; + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 10); + + sleep(1); +=20 + /* Set ps key PSKEY_HOST_INTERFACE */ + ps_parbuf[0] =3D 0x0003; /* H4 */ + csr_pskey(bt_cfd, PSKEY_HOST_INTERFACE,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + sleep(1); + } + else + { + syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + }=20=20=20 +=20=20=20=20 + /* Set back stack to use H4 framing */ + csr_bcspmode(bt_cfd, 0); + } + else + { + syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); + + /* Set stack to use H4 temporarily */=20=20=20=20=20=20=20=20 + csr_bcspmode(bt_cfd, 0); +=20=20=20=20 + /* Setup serial port for H4 (default baudrate) */ + fd_setup(phys_fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); + + reset_hw();=20=20=20=20 + sleep(1); + + /* Initialize stack */ + init_stack(bt_cfd, spd); + + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 10); + + if (ps_parbuf[1] =3D=3D 0xa8) /* non-BCSP */ + { + /* Enable parity bit, disable flow */ + ps_parbuf[1] =3D 0x6; + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 10); + sleep(1); +=20=20=20=20=20 + /* Set ps key PSKEY_HOST_INTERFACE */ + ps_parbuf[0] =3D 0x1; /* BCSP */ + csr_pskey(bt_cfd, PSKEY_HOST_INTERFACE,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + + /* Should not be needed if hw_vendor is changed in kernel ....*/ +=20=20=20=20=20=20 + /* Set back stack to use BCSP framing */ + csr_bcspmode(bt_cfd, 1); + }=20 + else + { + syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + } + } + + did_restart =3D 1; /* Only try once */ + + /* Restart btd */ + kill(getpid(), 10); +} + /* fixme -- remove hardcoded values */ void csr_init_hw(int bt_cfd, int phys_fd, int spd) @@ -206,7 +399,40 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + unsigned char bd[6]; +=20=20 + /* Now test whether stack initialized ok + Try reading local BD address */ =20 + read_local_bd(bt_cfd, bd); +=20=20 + if ((bd[0] =3D=3D 0) && (bd[1] =3D=3D 0) &&=20 + (bd[2] =3D=3D 0) && (bd[3] =3D=3D 0) && + (bd[4] =3D=3D 0) && (bd[5] =3D=3D 0)) + { + syslog(LOG_INFO, "Stack failed to initialize, try changing interface"); + csr_change_if(bt_cfd, phys_fd, spd); + } + + if (hw_vendor() =3D=3D HW_CSR_BCSP) + { + unsigned short ps_parbuf; + /* Make sure uart deep sleep is disabled when using BCSP */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, &ps_parbuf, 1); +=20=20=20=20 + if (ps_parbuf !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, &ps_parbuf, 1); +=20=20=20=20=20=20 + /* Restart btd */ + kill(getpid(), 10); + } + } +=20=20 syslog(LOG_INFO, "Setting write_scan_enable in CSR module!\n"); =20 bt_write_scan_enable(bt_cfd, wrscan); @@ -216,8 +442,6 @@ =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 - sleep(1); - bt_set_event_filter(bt_cfd, filter); =20 syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 |
From: Mattias A. <mat...@us...> - 2001-06-06 15:01:42
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.h 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added ioctls for setting bcsp mode, read/write csr ps key=20 and initializing BCSP The diff of the modified file(s): --- bt_if.h 2001/05/29 10:04:12 1.10 +++ bt_if.h 2001/06/06 15:01:41 1.11 @@ -235,6 +235,17 @@ #define HCITESTCONNECTREQ _IOW(BT_IOC_MAGIC, 0xf1, unsigned char[6]) #define BTTESTCOMMAND _IOW(BT_IOC_MAGIC, 0xf2, unsigned char[261]) #define BTSETMSSWITCH _IOW(BT_IOC_MAGIC, 0xf3, unsigned char) +#define BTSETBCSPMODE _IOW(BT_IOC_MAGIC, 0xf4, unsigned char) + +#define CSR_PSKEY_MSGHDR_SIZE 3 +#define CSR_PSKEY_MAXPARAMS 10 + +/*=20 + * | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])|=20 + */ +#define BT_CSR_PSKEY _IOWR(BT_IOC_MAGIC, 0xf5, unsigned short[CSR_PSKEY_MS= GHDR_SIZE + CSR_PSKEY_MAXPARAMS]) + +#define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6) =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Structs */ |
From: Mattias A. <mat...@us...> - 2001-06-06 15:01:13
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.h 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added function bcsp_issyncronized * Use return val in bcsp_syncronized * Added bcsp_datagram_init/shutdown function The diff of the modified file(s): --- bcsp.h 2001/05/25 14:23:38 1.6 +++ bcsp.h 2001/06/06 15:01:11 1.7 @@ -110,8 +110,9 @@ =20 /************************* functions in bcsp.c ***************************= ***/ =20 -void bcsp_init(void); +s32 bcsp_init(void); void bcsp_shutdown(void); +u32 bcsp_issyncronized(void); void bcsp_syncronized(void); s32 bcsp_write_top(u8 *data, u32 len); s32 bcsp_write_lower(u8 *data, u32 len); @@ -146,6 +147,8 @@ =20 /************************* functions in datagram.c ***********************= ****/ =20 +void bcsp_datagram_init(void); +void bcsp_datagram_shutdown(void); s32 bcsp_datagram_receive(struct bcsp *bcsp); s32 bcsp_datagram_send(u8 *data, u32 len, u8 chn); s32 bcsp_send_sync(u32 type); |