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: Anders J. <and...@us...> - 2001-10-16 16:25:00
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 test.h 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 unplug_test.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Changed functions to return a value. * Added HCI_INQUIRY_FAILED The diff of the modified file(s): --- bt_errno.h 2001/10/12 12:03:45 1.4 +++ bt_errno.h 2001/10/16 16:24:51 1.5 @@ -107,3 +107,4 @@ #define BT_ALREADYCONNECTED 0x2 #define BT_TIMEOUT 0x3 #define BT_LINE_BUSY 0x4 +#define BT_INQ_FAILED 0x5 --- test.h 2001/08/27 15:42:37 1.10 +++ test.h 2001/10/16 16:24:51 1.11 @@ -76,7 +76,7 @@ void test_disconnect_cfm(l2cap_con *l2cap); void test_receive_data(l2cap_con *l2cap, u8 *data, u32 len); s32 test_send_data(l2cap_con *con, u8 *testdata, s32 len); -void test_process_cmd(u8 *cmd, s32 size); +s32 test_process_cmd(u8 *cmd, s32 size); =20 #endif /****************** END OF FILE sdp.h ************************************= ***/ --- unplug_test.h 2001/08/27 15:42:00 1.2 +++ unplug_test.h 2001/10/16 16:24:50 1.3 @@ -44,7 +44,7 @@ =20 =20 void unplug_test_init(void); -void process_test_cmd(s32 test_case); -void do_sdp_test(int n); +s32 process_test_cmd(s32 test_case); +s32 do_sdp_test(int n); =20 #endif |
From: Anders J. <and...@us...> - 2001-10-16 16:23:52
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- test.c 1.29 1.30=20=20=20=20=20=20=20=20=20=20=20=20 unplug_test.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * All testcases in unplug_test.c should now return a value. * Made some functions in test.c return proper values. The diff of the modified file(s): --- test.c 2001/10/10 14:58:18 1.29 +++ test.c 2001/10/16 16:23:47 1.30 @@ -171,13 +171,13 @@ s32 test_connect_req(BD_ADDR bd) { + s32 retval =3D 0; D_STATE("test_connect_req to psm 0x%x\n", L2CAP_TEST_LAYER); =20 - if (l2ca_connect_req(bd, L2CAP_TEST_LAYER)) { + if ((retval =3D l2ca_connect_req(bd, L2CAP_TEST_LAYER)) < 0) { D_ERR(" tcs_connect_req: l2ca_connect_req failed\n"); - return -1;=20 } - return 0; + return retval; } =20 s32 @@ -414,15 +414,18 @@ =20 printk("test_send_data : sending %d bytes\n", len); =20=09 - if (!con) + if (!con) { + D_ERR("test_send_data : No connection object\n"); return -1; + } +=09 =20 /* tx bufs are all the same for each upper layer ... FIX one common */ tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + len); =20 if (!tx_buf) { D_ERR("test_send_data : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D len; @@ -435,7 +438,7 @@ =20 /* FIXME -- add new commands in user application menu !!!! */ =20 -void +s32 test_process_cmd(unsigned char *cmd, s32 size) {=20 #ifdef CONFIG_BLUETOOTH_UNPLUG_TEST @@ -456,13 +459,13 @@ bd[2], bd[1], bd[0]); =20=09=09 l2cap_create_con(bd); - lp_connect_req(bd); + return lp_connect_req(bd); } else if(strncmp(cmd, "t ", 2) =3D=3D 0) { testcase =3D strtoul(cmd+2, NULL, 0); =20 if (testcase > 0) { - process_test_cmd(testcase); + return process_test_cmd(testcase); } else { printk("test_process_cmd: Couldn't parse testcase\n"); @@ -470,16 +473,17 @@ } else if(!strncmp(cmd, "bb_disc ", 8)) { int i =3D strtoul(cmd+8, NULL, 0); - lp_disconnect((unsigned short)i); + return lp_disconnect((unsigned short)i); } else if(!strncmp(cmd, "lcid_disconnect ", 16)) { l2cap_con *con =3D NULL; int i =3D strtoul(cmd + 16, NULL, 0); if((con =3D get_lcon(i))) { - l2ca_disconnect_req(con); + return l2ca_disconnect_req(con); } else { printk("Didn't find lcid %d\n", i); + return -1; } } else if(!strncmp(cmd, "test_case_reject ", 17)) { @@ -490,7 +494,7 @@ printk("bb_conn read [%d] =3D 0x%x\n", i, bd[i]); p++; }=20=20 - l2ca_connect_req(bd, fake_psm); + return l2ca_connect_req(bd, fake_psm); } else if(!strncmp(cmd, "tx_data ", 8)) { int lcid, len; @@ -503,23 +507,27 @@ con =3D get_lcon(lcid); if (!con) { printk("Found no connection with lcid : %d\n", lcid); - return; + return -1; } =20 - test_send_data(con, testdata, len); + return test_send_data(con, testdata, len); } else if(!strncmp(cmd, "sdptest ", 8)) { int n =3D strtoul(cmd+8, NULL, 0);=09 - do_sdp_test(n); + return do_sdp_test(n); } else if(!strcmp(cmd, "test_case_disable_disconnect")) { dont_send_disconnect_rsp =3D 1; + return 0; } else if(!strcmp(cmd, "test_case_enable_disconnect")) { dont_send_disconnect_rsp =3D 0; + return 0; } else { printk("Unknown test cmd!\n"); + return -1; } =20=09 #else printk("test_process_cmd: Not available\n"); + return 0; #endif } =20 --- unplug_test.c 2001/08/27 15:22:04 1.5 +++ unplug_test.c 2001/10/16 16:23:45 1.6 @@ -331,16 +331,18 @@ #define SERVER 0 #define CLIENT 1 =20 -static void test_server(void) +static s32 test_server(void) { printk("Now we are test server (device A)\n"); test_role =3D SERVER; + return 0; } =20 -static void test_client(void) +static s32 test_client(void) { printk("Now we are test client (device B)\n"); test_role =3D CLIENT; + return 0; } =20 =20 @@ -369,55 +371,56 @@ * Test case : Data transfer via Open L2CAP Channel (L2CAP Test 3) */ =20 -static void test_2_2_1(void) +static s32 test_2_2_1(void) { /* client sends 10 bytes */ printk("test_2_2_1, client sends 10 bytes\n");=20 - test_send_data(testcon, testdata, 10); + return test_send_data(testcon, testdata, 10); } =20 -static void test_2_2_2(void) +static s32 test_2_2_2(void) { /* client sends 350 bytes */ printk("test_2_2_2, client sends 350 bytes\n");=20 - test_send_data(testcon, testdata, 350); + return test_send_data(testcon, testdata, 350); } =20 -static void test_2_2_3(void) +static s32 test_2_2_3(void) { /* client sends 672 bytes */ printk("test_2_2_3, client sends 672 bytes\n");=20 - test_send_data(testcon, testdata, 672); + return test_send_data(testcon, testdata, 672); } =20 -static void test_2_2_4(void) +static s32 test_2_2_4(void) { /* server sends 10 bytes */ printk("test_2_2_4, server sends 10 bytes\n");=20 - test_send_data(testcon, testdata, 10); + return test_send_data(testcon, testdata, 10); } =20 -static void test_2_2_5(void) +static s32 test_2_2_5(void) { /* server sends 350 bytes */ printk("test_2_2_5, server sends 350 bytes\n");=20 - test_send_data(testcon, testdata, 350); + return test_send_data(testcon, testdata, 350); } =20 -static void test_2_2_6(void) +static s32 test_2_2_6(void) { /* server sends 672 bytes */ printk("test_2_2_6, server sends 672 bytes\n");=20 - test_send_data(testcon, testdata, 672); + return test_send_data(testcon, testdata, 672); } =20 -/* - * Test case : Disconnection of a Connection Oriented Channel - * Device B Initiator (L2CAP Test 3) - * (see btd.c, issue command 'test_disc <local CID>') - */ +static s32 test_2_3(void) +{ + printk("test_2_3, disconnect\n"); + return test_disconnect_req(testcon); +} =20 =20=20 +=20 /* * Test case : Echo * Device A Initiator (L2CAP Test 4) @@ -434,57 +437,64 @@ #define OPTION_MTU1 4096 #define OPTION_MTU2 8192 =20 -static void test_2_5_1(void) +static s32 test_2_5_1(void) { + s32 retval =3D 0; printk("[Client] Sending config req for mtu =3D %d\n", OPTION_MTU1); - if (l2ca_config_req(testcon, OPTION_MTU1, NULL, 0, 0)) { + if ((retval =3D l2ca_config_req(testcon, OPTION_MTU1, NULL, 0, 0)) < 0) { D_ERR("l2ca_connect_cfm : Configuration request failed\n"); } + return retval; } =20 -static void test_2_5_2(void) +static s32 test_2_5_2(void) { printk("[Server] Set our in_mtu to :%d\n", OPTION_MTU2); test_inmtu =3D OPTION_MTU2; + return 0; } =20 =20 -static void test_2_5_3(void) +static s32 test_2_5_3(void) { + s32 retval =3D 0; printk("[Client] Sending config req for mtu =3D %d\n", OPTION_MTU2); - if (l2ca_config_req(testcon, OPTION_MTU2, NULL, 0xffff, 0)) { + if ((retval =3D l2ca_config_req(testcon, OPTION_MTU2, NULL, 0xffff, 0)) <= 0) { D_ERR("l2ca_connect_cfm : Configuration request failed\n"); } + return retval; } =20 -static void test_2_5_4(void) +static s32 test_2_5_4(void) { printk("[Server] Set our in_mtu to :%d\n", OPTION_MTU1); test_inmtu =3D OPTION_MTU1; + return 0; } =20 -static void test_2_5_5(void) +static s32 test_2_5_5(void) { /* Client sends 8192 bytes of data */ printk("Sends 8192 bytes\n"); - test_send_data(testcon, testdata, 8192); + return test_send_data(testcon, testdata, 8192); } =20 -static void test_2_5_6(void) +static s32 test_2_5_6(void) { printk("Sending 4096 bytes\n"); /* Server sends 4096 bytes of data */ - test_send_data(testcon, testdata, 4096); + return test_send_data(testcon, testdata, 4096); } =20 /* * Test case : Connection reject on psm 0x4561 */ =20 -static void test_2_6_1(void) +static s32 test_2_6_1(void) { printk("Now disabling test psm\n"); disable_testpsm =3D 1; + return 0; } =20 /* @@ -498,58 +508,63 @@ */ =20 =20 -static void test_2_7_2(void) +static s32 test_2_7_2(void) { printk("Emulating authorization pending...\n"); emulate_pending =3D 1; + return 0; } =20 -static void test_2_8_1(void) +static s32 test_2_8_1(void) { printk("Client sends 350 bytes on testcon 1\n"); - test_send_data(testcon, testdata, 350); + return test_send_data(testcon, testdata, 350); } =20 -static void test_2_8_2(void) +static s32 test_2_8_2(void) { printk("Server sends 350 bytes on testcon 1\n"); - test_send_data(testcon, testdata, 350); + return test_send_data(testcon, testdata, 350); } =20 -static void test_2_8_3(void) +static s32 test_2_8_3(void) { printk("Client sends 350 bytes on testcon 2\n"); - test_send_data(testcon2, testdata, 350); + return test_send_data(testcon2, testdata, 350); } =20 -static void test_2_8_4(void) +static s32 test_2_8_4(void) { printk("Server sends 350 bytes on testcon 2\n"); - test_send_data(testcon2, testdata, 350); + return test_send_data(testcon2, testdata, 350); } =20 -static void test_2_9_1(void) +static s32 test_2_9_1(void) { + s32 retval =3D 0; printk("Now testing timeout in reconfigure state\n"); printk("Client tries to reconfigure mtu 4096\n"); =20 - if (l2ca_config_req(testcon, 4096, NULL, 0xffff, 0)) { + if ((retval =3D l2ca_config_req(testcon, 4096, NULL, 0xffff, 0)) < 0){ D_ERR("test_connect_cfm : Configuration request failed\n"); } + return retval; } =20 -static void test_2_9_2(void) +static s32 test_2_9_2(void) { printk("Server won't send a config req back...\n"); dont_send_config_req =3D 1; + return 0; } =20 =20 -static void test_2_10(void) +static s32 test_2_10(void) { /* set to use mutiple config parameters */ printk("Using multiple config parameters\n"); use_multiple_conf_params =3D 1; + return 0; } =20 #if 0 @@ -566,8 +581,9 @@ } flow; #endif =20 -static void test_2_13_1(void) +static s32 test_2_13_1(void) { + s32 retval =3D 0; flow qos; init_flow(&qos); qos.bucket_size =3D 0x16; @@ -575,30 +591,31 @@ qos.service =3D 0x2; =20 printk("Client sending QOS options\n"); - if (l2ca_config_req(testcon, 0, &qos, 0, 0)) { + if ((retval =3D l2ca_config_req(testcon, 0, &qos, 0, 0)) < 0) { D_ERR("test_connect_cfm : Configuration request failed\n"); } + return retval; } =20 =20 =20 -static void test_2_13_5(void) +static s32 test_2_13_5(void) { printk("test_2_13_5, client sending 672 bytes\n");=20 - test_send_data(testcon, testdata, 672);=09 + return test_send_data(testcon, testdata, 672);=09 } =20 -static void test_2_13_6(void) +static s32 test_2_13_6(void) { printk("test_2_13_6, server sending 672 bytes\n");=20 - test_send_data(testcon, testdata, 672);=09 + return test_send_data(testcon, testdata, 672);=09 } =20 /* * SDP Stuff */ =20 -void do_sdp_test(int n) +s32 do_sdp_test(int n) { unsigned char *q; int q_len; @@ -618,233 +635,242 @@ case 9: q =3D q9; break; case 10: q =3D q10; break; case 11: q =3D q11; break; - default: printk("Unknown SDP test.\n");return; + default: printk("Unknown SDP test.\n"); + return -1; } =20 q_len =3D q[4] + 5; /* assumes less than 255 bytes long pdu:s */ =20=09 /* Now send the request */=20=20 - sdp_send_data(&sdp_con_list[0], q, q_len); + return sdp_send_data(&sdp_con_list[0], q, q_len); } =20 =20 =20 -static void sdp_test_52111(void) +static s32 sdp_test_52111(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_52111, sdp_data_52111[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_52111, sdp_data_52111[4] = + 5); } =20 -static void sdp_test_52113(void) +static s32 sdp_test_52113(void) { static int t =3D 0; + s32 retval =3D 0; =20 if (!t) { - sdp_send_data(&sdp_con_list[0], sdp_data_52113_1, sdp_data_52113_1[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_52113_1, sdp_data_52= 113_1[4] + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_data_52113_2, sdp_data_52113_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_52113_2, sdp_data_52= 113_2[4] + 5); t =3D 0; } + return retval; } =20 =20 -static void sdp_test_52114(void) +static s32 sdp_test_52114(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_52114, sdp_data_52114[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_52114, sdp_data_52114[4] = + 5); } =20 -static void sdp_test_52121(void) +static s32 sdp_test_52121(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_52121, sdp_data_52121[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_52121, sdp_data_52121[4] = + 5); } =20 -static void sdp_test_52122(void) +static s32 sdp_test_52122(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_52122, sdp_data_52122[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_52122, sdp_data_52122[4] = + 5); } =20 -static void sdp_test_53111(void) +static s32 sdp_test_53111(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53111, sdp_data_53111[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53111, sdp_data_53111[4] = + 5); } =20 -static void sdp_test_53113(void) +static s32 sdp_test_53113(void) { static int t =3D 0; + s32 retval; =20 if (!t) { - sdp_send_data(&sdp_con_list[0], sdp_data_53113_1, sdp_data_53113_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_53113_1, sdp_data_53= 113_2[4] + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_data_53113_2, sdp_data_53113_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_53113_2, sdp_data_53= 113_2[4] + 5); t =3D 0; } + return retval; } =20 -static void sdp_test_53114(void) +static s32 sdp_test_53114(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53114, sdp_data_53114[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53114, sdp_data_53114[4] = + 5); } =20 -static void sdp_test_53115(void) +static s32 sdp_test_53115(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53115, sdp_data_53115[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53115, sdp_data_53115[4] = + 5); } =20 -static void sdp_test_53118(void) +static s32 sdp_test_53118(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53118, sdp_data_53118[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53118, sdp_data_53118[4] = + 5); } =20 -static void sdp_test_531110(void) +static s32 sdp_test_531110(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_531110, sdp_data_531110[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_531110, sdp_data_531110[4= ] + 5); } =20 -static void sdp_test_531117(void) +static s32 sdp_test_531117(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_531117, sdp_data_531117[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_531117, sdp_data_531117[4= ] + 5); } =20 -static void sdp_test_531120(void) +static s32 sdp_test_531120(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_531120, sdp_data_531120[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_531120, sdp_data_531120[4= ] + 5); } =20 -static void sdp_test_53121(void) +static s32 sdp_test_53121(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53121, sdp_data_53121[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53121, sdp_data_53121[4] = + 5); } =20 -static void sdp_test_53122(void) +static s32 sdp_test_53122(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53122, sdp_data_53122[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53122, sdp_data_53122[4] = + 5); } =20 -static void sdp_test_53123(void) +static s32 sdp_test_53123(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_53123, sdp_data_53123[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_53123, sdp_data_53123[4] = + 5); } =20 -static void sdp_test_54111(void) +static s32 sdp_test_54111(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54111, sdp_data_54111[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54111, sdp_data_54111[4] = + 5); } =20 -static void sdp_test_54112(void) +static s32 sdp_test_54112(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54112, sdp_data_54112[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54112, sdp_data_54112[4] = + 5); } =20 -static void sdp_test_54113(void) +static s32 sdp_test_54113(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54113, sdp_data_54113[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54113, sdp_data_54113[4] = + 5); } =20 -static void sdp_test_54114(void) +static s32 sdp_test_54114(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54114, sdp_data_54114[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54114, sdp_data_54114[4] = + 5); } =20 -static void sdp_test_54116(void) +static s32 sdp_test_54116(void) { static int t =3D 0; - + s32 retval; if (!t) { - sdp_send_data(&sdp_con_list[0], sdp_data_54116_1, sdp_data_54116_1[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_54116_1, sdp_data_54= 116_1[4] + 5); t =3D 1; } else { - sdp_send_data(&sdp_con_list[0], sdp_data_54116_2, sdp_data_54116_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_54116_2, sdp_data_54= 116_2[4] + 5); t =3D 0; }=20 + return retval; } =20 -static void sdp_test_541110(void) +static s32 sdp_test_541110(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_541110, sdp_data_541110[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_541110, sdp_data_541110[4= ] + 5); } =20 -static void sdp_test_541111(void) +static s32 sdp_test_541111(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_541111, sdp_data_541111[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_541111, sdp_data_541111[4= ] + 5); } =20 -static void sdp_test_541112(void) +static s32 sdp_test_541112(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_541112, sdp_data_541112[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_541112, sdp_data_541112[4= ] + 5); } =20 -static void sdp_test_541120(void) +static s32 sdp_test_541120(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_541120, sdp_data_541120[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_541120, sdp_data_541120[4= ] + 5); } =20 -static void sdp_test_54121(void) +static s32 sdp_test_54121(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54121, sdp_data_54121[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54121, sdp_data_54121[4] = + 5); } =20 -static void sdp_test_54122(void) +static s32 sdp_test_54122(void) { - sdp_send_data(&sdp_con_list[0], sdp_data_54122, sdp_data_54122[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_data_54122, sdp_data_54122[4] = + 5); } =20 -static void sdp_test_55111(void) +static s32 sdp_test_55111(void) { static int t =3D 0; + s32 retval =3D 0; =20 switch (t) { case 0: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_1, sdp_data_55111_1[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_1, sdp_data_55= 111_1[4] + 5); t =3D 1; break; =20 case 1: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_2, sdp_data_55111_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_2, sdp_data_55= 111_2[4] + 5); t =3D 2; // break; case 2: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_3, sdp_data_55111_3[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_3, sdp_data_55= 111_3[4] + 5); t =3D 3; // break; case 3: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_4, sdp_data_55111_4[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_4, sdp_data_55= 111_4[4] + 5); t =3D 4; // break; case 4: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_5, sdp_data_55111_5[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_5, sdp_data_55= 111_5[4] + 5); t =3D 5; // break; case 5: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_6, sdp_data_55111_6[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_6, sdp_data_55= 111_6[4] + 5); t =3D 6; // break; case 6: - sdp_send_data(&sdp_con_list[0], sdp_data_55111_7, sdp_data_55111_7[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_7, sdp_data_55= 111_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); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55111_8, sdp_data_55= 111_8[4] + 5); t =3D 0; break;=20=20 }=20 + return retval; } =20 -static void sdp_test_55112(void) +static s32 sdp_test_55112(void) { static int t =3D 0; - + s32 retval =3D 0; switch (t) { case 0: - sdp_send_data(&sdp_con_list[0], sdp_data_55112_1, sdp_data_55112_1[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55112_1, sdp_data_55= 112_1[4] + 5); t =3D 1; break; =20 case 1: - sdp_send_data(&sdp_con_list[0], sdp_data_55112_2, sdp_data_55112_2[4] + = 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_data_55112_2, sdp_data_55= 112_2[4] + 5); t =3D 0; break; } + return retval; } =20 =20 @@ -852,9 +878,10 @@ * Serial Port Profile Stuff */ =20 -static void spp_test_52211(void) +static s32 spp_test_52211(void) { static int t =3D 0; + s32 retval =3D 0; =20=20=20 unsigned char sdp_query[] =3D { 0x06, 0x88, 0x88, 0x00, 0x0d, 0x35, 0x03, 0x19, 0x11, 0x01, 0x00, 0xff, @@ -862,7 +889,7 @@ =20 switch (t) { case 0: - sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); + retval =3D sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); t++; break; =20 @@ -876,110 +903,118 @@ t =3D 0; break; } + return retval; } =20 -static void spp_test_52311(void) +static s32 spp_test_52311(void) { static int t =3D 0; + s32 retval =3D 0; =20 switch (t) { case 0: - hci_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xff, 0xf0, 0x10, 0x05= ); + retval =3D hci_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xff, 0xf0,= 0x10, 0x05); t =3D 1; break; =20 case 1: - hci_exit_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl); + retval =3D hci_exit_sniff_mode(rfcomm_con_list[0].l2cap->hci_hdl); t =3D 0; break; } + return retval; } =20 -static void spp_test_52312(void) +static s32 spp_test_52312(void) { static int t =3D 0; + s32 retval =3D 0; =20 switch (t) { case 0: - hci_park_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); + retval =3D hci_park_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); t =3D 1; break; =20 case 1: - hci_exit_park_mode(rfcomm_con_list[0].l2cap->hci_hdl); + retval =3D hci_exit_park_mode(rfcomm_con_list[0].l2cap->hci_hdl); t =3D 0; break; } + return retval; } =20 -static void spp_test_52313(void) +static s32 spp_test_52313(void) { - hci_hold_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); + return hci_hold_mode(rfcomm_con_list[0].l2cap->hci_hdl, 0xfff, 0xf0); } =20 -static void spp_test_52314(void) +static s32 spp_test_52314(void) { printk(__FUNCTION__": Do test 52211, then do a M/S switch\n"); + return 0; } =20 =20 -static void spp_test_53112(void) +static s32 spp_test_53112(void) { /* Establish a L2CAP channel in PSM 3 (RFCOMM), before doing this test */ =20 - rfcomm_sabm_msg(&rfcomm_con_list[0], 0); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 0); } =20 -static void spp_test_53211(void) +static s32 spp_test_53211(void) { /* This test has to be done rigth after test 53112 */ =20 - rfcomm_disc_msg(&rfcomm_con_list[0], 0); + return rfcomm_disc_msg(&rfcomm_con_list[0], 0); } =20 -static void spp_test_53312(void) +static s32 spp_test_53312(void) { /* Establish a L2CAP channel in PSM 3 (RFCOMM), and establish DLCI 0 before doing this test */ =20 - rfcomm_sabm_msg(&rfcomm_con_list[0], 2); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2); } =20 -static void spp_test_53411(void) +static s32 spp_test_53411(void) { /* Establish a L2CAP channel in PSM 3 (RFCOMM), and establish DLCI 0 and 2 before doing this test */ =20 /* Here the BAP should send the disc command so we just have to wait for that, rf_disc should probably work in the BAP */ + return 0; } =20 -static void spp_test_53412(void) +static s32 spp_test_53412(void) { /* This test has to be done rigth after test 53116 */ =20 - rfcomm_disc_msg(&rfcomm_con_list[0], 2); + return rfcomm_disc_msg(&rfcomm_con_list[0], 2); } =20 -static void spp_test_53511(void) +static s32 spp_test_53511(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ =20 /* Send data from the BAp with the rf_send command */ =20=20=20 - rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 2); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 2); } =20 -static void spp_test_53611(void) +static s32 spp_test_53611(void) { /* Do test 52211 before 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=20 /* Then send data from the BAP with the rf_send command */ + return 0; } =20 -static void spp_test_53711(void) +static s32 spp_test_53711(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ @@ -987,85 +1022,88 @@ unsigned char data[] =3D {0,1,2,3,4,5,6,7,9}; =20 /* We send a test messages of ten bytes size */ - rfcomm_test_msg(&rfcomm_con_list[0], data, 10, MCC_CMD); + return rfcomm_test_msg(&rfcomm_con_list[0], data, 10, MCC_CMD); } =20 -static void spp_test_53811(void) +static s32 spp_test_53811(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ - + s32 retval =3D 0; static int t =3D 0; =20 switch (t) { case 0: - rfcomm_fcoff_msg(&rfcomm_con_list[0], MCC_CMD); + retval =3D rfcomm_fcoff_msg(&rfcomm_con_list[0], MCC_CMD); printk(__FUNCTION__": Flow is set to OFF\n"); t++; break; =20 case 1: - rfcomm_fcon_msg(&rfcomm_con_list[0], MCC_CMD); + retval =3D rfcomm_fcon_msg(&rfcomm_con_list[0], MCC_CMD); printk(__FUNCTION__": Flow is set to ON\n"); t =3D 0; break; } + return retval; } =20 -static void spp_test_53911(void) +static s32 spp_test_53911(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ =20 - rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0x05); + return rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0x05); } =20 -static void spp_test_531011(void) +static s32 spp_test_531011(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ =20 static int t =3D 0; + s32 retval =3D 0; =20 switch (t) { case 0: - rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 1000); + retval =3D rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 1000); t++; break; =20 case 1: - rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 667); + retval =3D rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 667); break; } + return retval; } =20 -static void spp_test_531111(void) +static s32 spp_test_531111(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ =20 - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); + return rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); } =20 -static void spp_test_531112(void) +static s32 spp_test_531112(void) { /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have to verify so both sides have sent a MSC command with flow on */ =20 - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); + return rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); } =20 -static void spp_test_55111(void) +static s32 spp_test_55111(void) { /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 unsigned char sdp_query[] =3D { 0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x03, 0x00, 0xff, 0x00 }; =20 - sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); } =20 -static void spp_test_55112(void) +static s32 spp_test_55112(void) { /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 @@ -1074,10 +1112,10 @@ 0x09, 0x00, 0x01, 0x09, 0x00, 0x04, 0x09, 0x01, 0x00, 0x00 }; =20 - sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); } =20 -static void spp_test_55113(void) +static s32 spp_test_55113(void) { /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 @@ -1086,294 +1124,307 @@ 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x04, 0x09, 0x01, 0x00, 0x00 }; =20 - sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); + return sdp_send_data(&sdp_con_list[0], sdp_query, sdp_query[4] + 5); } =20 =20 -static void spp_test_56211(void) +static s32 spp_test_56211(void) { /* Run the hci_write_encryption_mode(1) in hci_init */ + return 0; } =20 /*=20 * RFCOMM stuff=20 */ =20 -static void test_4_1(void) +static s32 test_4_1(void) { /* Create a connection */ printk("Please use rf_conn server channel 2\n"); + return 0; } =20 -static void test_4_2_1(void) +static s32 test_4_2_1(void) { /* Send stop flow command on dlci 4*/ printk("test_4_2\n"); - rfcomm_msc_msg(&rfcomm_con_list[0], 0x87 ,MCC_CMD, 4); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x87 ,MCC_CMD, 4); } =20 -static void test_4_2_2(void) +static s32 test_4_2_2(void) { /* Send start flow command on dlci 4 */ printk("test_4_2\n"); - rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 4); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 4); } =20 -static void test_4_2_3(void) +static s32 test_4_2_3(void) { /* Send start flow command on dlci 4 */ printk("test_4_2\n"); - rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 3); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 3); } =20 -static void test_4_2_4(void) +static s32 test_4_2_4(void) { /* Send start flow command on dlci 4 */ printk("test_4_2\n"); - rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 2); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x85 ,MCC_CMD, 2); } =20 -static void test_4_3(void) +static s32 test_4_3(void) { + s32 retval =3D 0; /* Here we should send data after we received a flow stop command */ printk("test_4_3\n"); =20=09 - if (rfcomm_send_data(CREATE_RFCOMM_ID(0,4),testdata, 1024) =3D=3D 0) { - printk("Success!\n"); + if ((retval =3D rfcomm_send_data(CREATE_RFCOMM_ID(0,4),testdata, 1024)) <= 0) { + D_ERR("rfcomm_send_data: Failed\n"); } + return retval; } =20 -static void test_4_4(void) +static s32 test_4_4(void) { /* If we should initiate the disconnection we do this */ printk("test_4_4\n"); - rfcomm_disconnect_req(0); + return rfcomm_disconnect_req(0); } =20 -static void test_4_5_1(void) +static s32 test_4_5_1(void) { printk("test_4_5_1\n"); - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); + return rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); } =20 -static void test_4_5_2(void) +static s32 test_4_5_2(void) { + s32 retval =3D 0; printk("test_4_5_2\n"); rpn_val.rtr_input =3D 1; rpn_val.rtr_output =3D 1; rpn_val.pm.rtr_input =3D 1; rpn_val.pm.rtr_output =3D 1; - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); + retval =3D rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); rpn_val.pm.rtr_input =3D 0; rpn_val.pm.rtr_output =3D 0; + return retval; } =20 -static void test_4_6(void) +static s32 test_4_6(void) { u8 data[1]; =20 printk("test_4_6\n"); data[0] =3D 'b'; /* We send a test messages of one byte size */ - rfcomm_test_msg(&rfcomm_con_list[0], data, 1, MCC_CMD); + return rfcomm_test_msg(&rfcomm_con_list[0], data, 1, MCC_CMD); } =20 -static void test_4_7(void) +static s32 test_4_7(void) { printk("test_4_7\n"); - rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0x03); + return rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0x03); } =20 -static void test_4_8_1(void) +static s32 test_4_8_1(void) { /* Here we send a fcoff command */ printk("test_4_8\n"); - rfcomm_fcoff_msg(&rfcomm_con_list[0], MCC_CMD); + return rfcomm_fcoff_msg(&rfcomm_con_list[0], MCC_CMD); } =20 -static void test_4_8_2(void) +static s32 test_4_8_2(void) { /* Here we send a fcon command */ printk("test_4_8\n"); - rfcomm_fcon_msg(&rfcomm_con_list[0], MCC_CMD); + return rfcomm_fcon_msg(&rfcomm_con_list[0], MCC_CMD); } =20 -static void test_4_9(void) +static s32 test_4_9(void) { /* Test to send data after received fcoff command */ printk("test_4_9\n"); - test_4_3(); + return test_4_3(); } =20 -static void test_4_10(void) +static s32 test_4_10(void) { /* Create a connection on serverchannel one */ printk("Please use rfcomm_connect server channel 1, line 0 instead\n"); + return 0; } =20 -static void test_4_11(void) +static s32 test_4_11(void) { /* Same as test 4.10, but here we should be the responder */ printk("test_4_11\n"); - test_4_10(); + return test_4_10(); } =20 -static void test_4_12(void) +static s32 test_4_12(void) { printk("test_4_12\n"); - test_4_4(); + return test_4_4(); } =20 -static void test_4_13(void) +static s32 test_4_13(void) {=09 printk("test_4_13\n"); - rfcomm_set_mtu(&rfcomm_con_list[0], 4, 500); + return rfcomm_set_mtu(&rfcomm_con_list[0], 4, 500); printk("MTU set to 500\n"); printk("Please use rfcomm_connect server channel 2, line 0 to connect\n"); } =20 -static void test_4_14(void) +static s32 test_4_14(void) { printk("test_4_14\n"); printk("PLease use rfcomm_conn on serverchannel 4\n"); + return 0; } =20 -static void test_4_15(void) +static s32 test_4_15(void) { printk("test_4_15\n"); - rfcomm_crap_msg(&rfcomm_con_list[0]); + return rfcomm_crap_msg(&rfcomm_con_list[0]); } =20 -static void test_4_16(void) +static s32 test_4_16(void) { printk("test_4_16\n"); - rfcomm_msc_msg(&rfcomm_con_list[0], 0x8d ,MCC_CMD, 8); + return rfcomm_msc_msg(&rfcomm_con_list[0], 0x8d ,MCC_CMD, 8); } =20 -static void test_4_21_1(void) +static s32 test_4_21_1(void) { printk("test_4_21_1\n"); - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 1); + return rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 1); } =20 -static void test_4_21_2(void) +static s32 test_4_21_2(void) { + s32 retval =3D 0; printk("test_4_21_2\n"); rpn_val.rtr_input =3D 1; rpn_val.rtr_output =3D 1; rpn_val.pm.rtr_input =3D 1; rpn_val.pm.rtr_output =3D 1; - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0); + retval =3D rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0); rpn_val.pm.rtr_input =3D 0; rpn_val.pm.rtr_output =3D 0; + return retval; } =20 -static void test_4_22_1(void) +static s32 test_4_22_1(void) { + s32 retval =3D 0; printk("test_4_22_1\n"); rpn_val.rtr_input =3D 1; rpn_val.rtr_output =3D 1; rpn_val.pm.rtr_input =3D 1; rpn_val.pm.rtr_output =3D 1; - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0); + retval =3D rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0); rpn_val.pm.rtr_input =3D 0; rpn_val.pm.rtr_output =3D 0; + return retval; } =20 -static void test_4_22_2(void) +static s32 test_4_22_2(void) { printk("test_4_22_2\n"); - rfcomm_sabm_msg(&rfcomm_con_list[0], 2);; + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2);; } =20 -static void test_4_22_3(void) +static s32 test_4_22_3(void) { printk("test_4_21_1\n"); - rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 1); + return rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 2, 1); } =20 -static void test_4_23_1(void) +static s32 test_4_23_1(void) { printk("test_4_23_1\n"); - test_4_22_1(); + return test_4_22_1(); } =20 -static void test_4_23_2(void) +static s32 test_4_23_2(void) { printk("test_4_23_2\n"); - rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 127); + return rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 127); } =20 -static void test_4_23_3(void) +static s32 test_4_23_3(void) { printk("test_4_23_2\n"); - rfcomm_sabm_msg(&rfcomm_con_list[0], 2); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2); } =20 -static void test_4_23_4(void) +static s32 test_4_23_4(void) { printk("test_4_23_1\n"); - test_4_22_3(); + return test_4_22_3(); } =20 -static void test_4_24_1(void) +static s32 test_4_24_1(void) { printk("test_4_23_1\n"); - test_4_23_2(); + return test_4_23_2(); } =20 -static void test_4_24_2(void) +static s32 test_4_24_2(void) { printk("test_4_23_2\n"); - test_4_23_1(); + return test_4_23_1(); } =20 -static void test_4_24_3(void) +static s32 test_4_24_3(void) { printk("test_4_23_2\n"); - rfcomm_sabm_msg(&rfcomm_con_list[0], 2); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2); } =20 -static void test_4_24_4(void) +static s32 test_4_24_4(void) { printk("test_4_23_1\n"); - rfcomm_sabm_msg(&rfcomm_con_list[0], 2); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2); } =20 -static void test_4_25_1(void) +static s32 test_4_25_1(void) { printk("test_4_25_1\n"); - rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 500); + return rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 500); } =20 -static void test_4_25_2(void) +static s32 test_4_25_2(void) { printk("test_4_25_2\n"); rfcomm_con_list[0].l2cap->local_mtu =3D 65; + return 0; } =20 -static void test_4_25_3(void) +static s32 test_4_25_3(void) { printk("test_4_25_3\n"); - rfcomm_sabm_msg(&rfcomm_con_list[0], 2); + return rfcomm_sabm_msg(&rfcomm_con_list[0], 2); } =20 -static void test_4_26(void) +static s32 test_4_26(void) { printk("test_4_26\n"); - rfcomm_pn_msg(&rfcomm_con_list[0], 4, 0, 127); + return rfcomm_pn_msg(&rfcomm_con_list[0], 4, 0, 127); } =20 -static void test_4_27(void) +static s32 test_4_27(void) { printk("test_4_27\n"); - rfcomm_pn_msg(&rfcomm_con_list[0], 4, 10, 127); + return rfcomm_pn_msg(&rfcomm_con_list[0], 4, 10, 127); } =20 -static void test_4_28(void) +static s32 test_4_28(void) { printk("test_4_28\n"); - rfcomm_send_credits(&rfcomm_con_list[0], 4, 10); + return rfcomm_send_credits(&rfcomm_con_list[0], 4, 10); } =20 =20 @@ -1382,22 +1433,22 @@ * TCS stuff */ =20 -static void test_5_1(void) +static s32 test_5_1(void) { if (!tcs[0].l2cap) { printk("Please connect TCS first with tcs_connect bd_addr\n"); - return; + return -1; } - tcs_setup(tcs[0].l2cap, NULL, 0); + return tcs_setup(tcs[0].l2cap, NULL, 0); } =20 -static void test_5_1_1(void) +static s32 test_5_1_1(void) { u8 nbr[2]; =20 if (!tcs[0].l2cap) { printk("Please connect TCS first with tcs_connect bd_addr\n"); - return; + return -1; } =20=20=20 nbr[0] =3D '0'; @@ -1413,61 +1464,61 @@ nbr[10] =3D '7'; nbr[11] =3D '2'; =20=20=20 - tcs_setup(tcs[0].l2cap, nbr, 12); + return tcs_setup(tcs[0].l2cap, nbr, 12); } =20 =20 -static void test_5_2(void) +static s32 test_5_2(void) { if (!tcs[0].l2cap) { printk("Please connect TCS first with tcs_connect bd_addr\n"); - return; + return -1; } - tcs_connect(tcs[0].l2cap); + return tcs_connect(tcs[0].l2cap); } =20 -static void test_5_3(void) +static s32 test_5_3(void) { if (!tcs[0].l2cap) { printk("Please connect TCS first with tcs_connect bd_addr\n"); - return; + return -1; } - tcs_disconnect(tcs[0].l2cap); + return tcs_disconnect(tcs[0].l2cap); } =20 -static void test_5_4(void) +static s32 test_5_4(void) { - test_5_1(); + return test_5_1(); } =20 -static void test_5_5(void) +static s32 test_5_5(void) { - test_5_2(); + return test_5_2(); } =20 -static void test_5_6(void) +static s32 test_5_6(void) { - test_5_3(); + return test_5_3(); } =20 -static void test_5_7(void) +static s32 test_5_7(void) { if (!tcs[0].l2cap) { printk("Please connect TCS first with tcs_connect bd_addr\n"); - return;=20 + return -1;=20 } - tcs_send_information(tcs[0].l2cap, '1'); + return tcs_send_information(tcs[0].l2cap, '1'); } =20 -static void test_gateway_call(void) +static s32 test_gateway_call(void) { unsigned char *atd =3D "ATD4257272353\r\n"; =20 printk("test_gateway_call, sending %s\n", atd); - rfcomm_send_data(CREATE_RFCOMM_ID(0,2), atd, strlen(atd)); + return rfcomm_send_data(CREATE_RFCOMM_ID(0,2), atd, strlen(atd)); } =20 -void process_test_cmd(s32 test_case) +s32 process_test_cmd(s32 test_case) { if (!test_is_initialized) { unplug_test_init(); @@ -1476,261 +1527,137 @@ printk("test_case %d\n",test_case); =20 switch (test_case) { - case 0: test_server(); - break; - case 1: test_client(); - break; - - case 221: test_2_2_1(); - break; - case 222: test_2_2_2(); - break; - case 223: test_2_2_3(); - break; - case 224: test_2_2_4(); - break; - case 225: test_2_2_5(); - break; - case 226: test_2_2_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(); - break;=20=20 - case 255: test_2_5_5(); - break; - case 256: test_2_5_6(); - break; - case 261: test_2_6_1(); - break; - - case 272: test_2_7_2(); - break; - - case 281: test_2_8_1(); - break; - case 282: test_2_8_2(); - break; - case 283: test_2_8_3(); - break; - case 284: test_2_8_4(); - break; - - case 291: test_2_9_1(); - break; - case 292: test_2_9_2(); - break; - - case 210: test_2_10(); - break; + case 0: return test_server(); + case 1: return test_client(); =20 - case 2131 : test_2_13_1(); - break; + case 221: return test_2_2_1(); + case 222: return test_2_2_2(); + case 223: return test_2_2_3(); + case 224: return test_2_2_4(); + case 225: return test_2_2_5(); + case 226: return test_2_2_6(); + case 23: return test_2_3(); + case 251: return test_2_5_1(); + case 252: return test_2_5_2(); + case 253: return test_2_5_3(); + case 254: return test_2_5_4(); + case 255: return test_2_5_5(); + case 256: return test_2_5_6(); + case 261: return test_2_6_1(); + case 272: return test_2_7_2(); + case 281: return test_2_8_1(); + case 282: return test_2_8_2(); + case 283: return test_2_8_3(); + case 284: return test_2_8_4(); =20 - case 52111: sdp_test_52111(); - break; - case 52113: sdp_test_52113(); - break; - case 52114: sdp_test_52114(); - break;=20 - case 52121: sdp_test_52121(); - break; - case 52122: sdp_test_52122(); - break;=20=20 - case 53111: sdp_test_53111(); - break; - case 53113: sdp_test_53113(); - break; - case 53114: sdp_test_53114(); - break; - case 53115: sdp_test_53115(); - break; - case 53118: sdp_test_53118(); - break; - case 531110: sdp_test_531110(); - break; - case 531117: sdp_test_531117(); - break; - case 531120: sdp_test_531120(); - break; - case 53121: sdp_test_53121(); - break; - case 53122: sdp_test_53122(); - break; - case 53123: sdp_test_53123(); - break; - case 54111: sdp_test_54111(); - break; - case 54112: sdp_test_54112(); - break; - case 54113: sdp_test_54113(); - break; - case 54114: sdp_test_54114(); - break; - case 54116: sdp_test_54116(); - break; - case 541110: sdp_test_541110(); - break; - case 541111: sdp_test_541111(); - break; - case 541112: sdp_test_541112(); - break; - case 541120: sdp_test_541120(); - break; - case 54121: sdp_test_54121(); - break; - case 54122: sdp_test_54122(); - break; - case 55111: sdp_test_55111(); - break; - case 55112: sdp_test_55112(); - break; + case 291: return test_2_9_1(); + case 292: return test_2_9_2(); =20 - case 62211: spp_test_52211(); - break; + case 210: return test_2_10(); =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; + case 2131 : return test_2_13_1(); =20 - case 41: test_4_1(); - break; - case 421: test_4_2_1(); - break; - case 422: test_4_2_2(); - break; - case 423: test_4_2_3(); - break; - case 424: test_4_2_4(); - break; - case 43: test_4_3(); - break; - case 44: test_4_4(); - break; - case 451: test_4_5_1(); - break; - case 452: test_4_5_2(); - break;=20=20 - case 46: test_4_6(); - break; - case 47: test_4_7(); - break; - case 481: test_4_8_1(); - break; - case 482: test_4_8_2(); - break; - case 49: test_4_9(); - break; - case 410: test_4_10(); - break; - case 411: test_4_11(); - break; - case 412: test_4_12(); - break; - case 413: test_4_13(); - break; - case 414: test_4_14(); - break; - case 415: test_4_15(); - break; - case 416: test_4_16(); - break; - case 4211: test_4_21_1(); - break; - case 4212: test_4_21_2(); - break; - case 4221: test_4_22_1(); - break; - case 4222: test_4_22_2(); - break; - case 4223: test_4_22_3(); - break; - case 4231: test_4_23_1(); - break; - case 4232: test_4_23_2(); - break; - case 4233: test_4_23_3(); - break; - case 4234: test_4_23_4(); - break; - case 4241: test_4_24_1(); - break; - case 4242: test_4_24_2(); - break; - case 4243: test_4_24_3(); - break; - case 4244: test_4_24_4(); - break; - case 4251: test_4_25_1(); - break; - case 4252: test_4_25_2(); - break; - case 426: test_4_26(); - break; - case 427: test_4_27(); - break; - case 428: test_4_28(); - break; + case 52111: return sdp_test_52111(); + case 52113: return sdp_test_52113(); + case 52114: return sdp_test_52114(); + case 52121: return sdp_test_52121(); + case 52122: return sdp_test_52122(); + case 53111: return sdp_test_53111(); + case 53113: return sdp_test_53113(); + case 53114: return sdp_test_53114(); + case 53115: return sdp_test_53115(); + case 53118: return sdp_test_53118(); + case 531110: return sdp_test_531110(); + case 531117: return sdp_test_531117(); + case 531120: return sdp_test_531120(); + case 53121: return sdp_test_53121(); + case 53122: return sdp_test_53122(); + case 53123: return sdp_test_53123(); + case 54111: return sdp_test_54111(); + case 54112: return sdp_test_54112(); + case 54113: return sdp_test_54113(); + case 54114: return sdp_test_54114(); + case 54116: return sdp_test_54116(); + case 541110: return sdp_test_541110(); + case 541111: return sdp_test_541111(); + case 541112: return sdp_test_541112(); + case 541120: return sdp_test_541120(); + case 54121: return sdp_test_54121(); + case 54122: return sdp_test_54122(); + case 55111: return sdp_test_55111(); + case 55112: return sdp_test_55112(); =20 - case 51: test_5_1(); - break; - case 511: test_5_1_1(); - break; - case 52: test_5_2(); - break;=09 - case 53: test_5_3(); - break; - case 54: test_5_4(); - break; - case 55: test_5_5(); - break; - case 56: test_5_6(); - break; - case 57: test_5_7(); - break; + case 62211: return spp_test_52211(); =20 - case 100: test_gateway_call(); - break; + case 62311: return spp_test_52311(); + case 62312: return spp_test_52312(); + case 62313: return spp_test_52313(); + case 62314: return spp_test_52314(); + case 63112: return spp_test_53112(); + case 63211: return spp_test_53211(); + case 63312: return spp_test_53312(); + case 63411: return spp_test_53411(); + case 63412: return spp_test_53412(); + case 63511: return spp_test_53511(); + case 63611: return spp_test_53611(); + case 63711: return spp_test_53711(); + case 63811: return spp_test_53811(); + case 63911: return spp_test_53911(); + case 631011: return spp_test_531011(); + case 631111: return spp_test_531111(); + case 631112: return spp_test_531112(); + case 66211: return spp_test_56211(); =20 + case 41: return test_4_1(); + case 421: return test_4_2_1(); + case 422: return test_4_2_2(); + case 423: return test_4_2_3(); + case 424: return test_4_2_4(); + case 43: return test_4_3(); + case 44: return test_4_4(); + case 451: return test_4_5_1(); + case 452: return test_4_5_2(); + case 46: return test_4_6(); + case 47: return test_4_7(); + case 481: return test_4_8_1(); + case 482: return test_4_8_2(); + case 49: return test_4_9(); + case 410: return test_4_10(); + case 411: return test_4_11(); + case 412: return test_4_12(); + case 413: return test_4_13(); + case 414: return test_4_14(); + case 415: return test_4_15(); + case 416: return test_4_16(); + case 4211: return test_4_21_1(); + case 4212: return test_4_21_2(); + case 4221: return test_4_22_1(); + case 4222: return test_4_22_2(); + case 4223: return test_4_22_3(); + case 4231: return test_4_23_1(); + case 4232: return test_4_23_2(); + case 4233: return test_4_23_3(); + case 4234: return test_4_23_4(); + case 4241: return test_4_24_1(); + case 4242: return test_4_24_2(); + case 4243: return test_4_24_3(); + case 4244: return test_4_24_4(); + case 4251: return test_4_25_1(); + case 4252: return test_4_25_2(); + case 426: return test_4_26(); + case 427: return test_4_27(); + case 428: return test_4_28(); + case 51: return test_5_1(); + case 511: return test_5_1_1(); + case 52: return test_5_2(); + case 53: return test_5_3(); + case 54: return test_5_4(); + case 55: return test_5_5(); + case 56: return test_5_6(); + case 57: return test_5_7(); + case 100: return test_gateway_call(); default: printk("Unknown test case\n"); - break; + return -1; } } |
From: Anders J. <and...@us...> - 2001-10-16 16:12:14
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.206 1.207=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * BTISLOWERCONNECTED changed back to only allow a specified line. The diff of the modified file(s): --- bluetooth.c 2001/10/16 14:44:56 1.206 +++ bluetooth.c 2001/10/16 16:12:14 1.207 @@ -621,8 +621,7 @@ s32 line;=09=20=20 =20 copy_from_user(&line, (s32*)arg, size); - return (line >=3D 0 && SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || - (line < 0 && SESSIONSTATE(GET_TTYLINE(tty)) =3D=3D BT_LOWERCONNEC= TED); + return SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED; } =20=09 case BTINITSTACK: |
From: Peter K. <pk...@us...> - 2001-10-16 14:59:45
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.c 1.125 1.126=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Replaced swap_pn_msg() with use of le16_to_cpuu(), and put_unaligned() and cpu_to_le16() to make sure it works on unaligned addresses (thanks to Alain Paschoud for pointing this out). The diff of the modified file(s): --- rfcomm.c 2001/10/16 09:30:12 1.125 +++ rfcomm.c 2001/10/16 14:59:29 1.126 @@ -52,6 +52,8 @@ #include <linux/string.h> #include <linux/sched.h> =20 +#include <asm/unaligned.h> + #include <linux/bluetooth/rfcomm.h> #include <linux/bluetooth/rfcomm_sec.h> #include <linux/bluetooth/btmem.h> @@ -145,25 +147,24 @@ #define UIH 0xef =20 /* The values in the type field in a multiplexer command packet */ -#define TEST 0x8 +#define TEST 0x08 #define FCON 0x28 #define FCOFF 0x18 #define MSC 0x38 #define RPN 0x24 #define RLS 0x14 #define PN 0x20 -#define NSC 0x4 +#define NSC 0x04 =20 /* Define of some V.24 signals modem control signals in RFCOMM */ -#define FC 0x2 -#define RTC 0x4 -#define RTR 0x8 +#define FC 0x02 +#define RTC 0x04 +#define RTR 0x08 #define DV 0x80 =20 /* endian-swapping macros for structs */ #define swap_long_frame(x) ((x)->h.length.val =3D le16_to_cpu((x)->h.lengt= h.val)) #define swap_mcc_long_frame(x) (swap_long_frame(x)) -#define swap_pn_msg(x) ((x)->frame_size =3D le16_to_cpu((x)->frame_size)) =20 #define RFCOMM_CON_TIMEOUT (5*HZ) =20 @@ -190,8 +191,8 @@ =20 typedef union long_length { struct bits { - u8 ea:1; - unsigned short len:15; + u16 ea:1; + u16 len:15; } __attribute__ ((packed)) bits; u16 val; } __attribute__ ((packed)) long_length; @@ -337,8 +338,8 @@ =20 typedef union long_length { struct bits { - unsigned short len:15; - u8 ea:1; + u16 len:15; + u16 ea:1; } __attribute__ ((packed)) bits; u16 val; } __attribute__ ((packed)) long_length; @@ -1568,17 +1569,19 @@ } break; } + case PN: /*DLC parameter negotiation*/ { - pn_msg *pn_pkt =3D (pn_msg*) data; + pn_msg *pn_pkt; + D_CTRL(FNC"Received DLC parameter negotiation, PN\n"); if (longpkt) { /* If a long length field is used, then move the payload pointer one byte ahead */ data++; - pn_pkt =3D (pn_msg*) data; }=20=20 - swap_pn_msg(pn_pkt); + pn_pkt =3D (pn_msg*) data; + if (pn_pkt->mcc_s_head.type.cr =3D=3D MCC_CMD) { u8 tmp_dlci; u16 frame_size; @@ -1588,7 +1591,7 @@ back a response */ =20 tmp_dlci =3D pn_pkt->dlci; - frame_size =3D pn_pkt->frame_size; + frame_size =3D le16_to_cpuu(&pn_pkt->frame_size); =20 frame_size =3D MIN(frame_size, rfcomm->l2cap->local_mtu - RFCOMM_MAX_HD= R_SIZE); credit =3D pn_pkt->credit_flow; @@ -1615,11 +1618,11 @@ u8 tmp_dlci; tmp_dlci =3D pn_pkt->dlci; D_CTRL(FNC"received PN response with:\n"); - D_CTRL(FNC"Frame size:%d\n",pn_pkt->frame_size); + D_CTRL(FNC"Frame size:%d\n", le16_to_cpuu(&pn_pkt->frame_size)); D_CTRL(FNC"credit_flow:%d\n", pn_pkt->credit_flow); D_CTRL(FNC"credits:%d\n", pn_pkt->credits); =20=09=09=09 - rfcomm->dlci[tmp_dlci].mtu =3D pn_pkt->frame_size; + rfcomm->dlci[tmp_dlci].mtu =3D le16_to_cpuu(&pn_pkt->frame_size); =20=09=09=09 if (pn_pkt->credit_flow =3D=3D 0xe) { DSYS(FNC"Credit flow control used\n"); @@ -1634,10 +1637,9 @@ if (rfcomm->dlci[tmp_dlci].state =3D=3D NEGOTIATING) { send_sabm(rfcomm, tmp_dlci); } - - } } break; + } =20=20=20=20=20 case NSC: /*Non supported command resonse*/ D_CTRL(FNC"Received Non supported command response\n"); @@ -1650,7 +1652,6 @@ =20=20=20=20=20 break; } - } =20 =20 @@ -2247,8 +2248,7 @@ D_CTRL("send_pn_msg: DLCI 0x%02x, prior:0x%02x, frame_size:%d, credit_flo= w:%x, credits:%d, cr:%x\n", dlci, prior, frame_size, credit_flow, credits, cr); =20 - /* FIXME: Can't use structures here, sizeof doesn't work... */ - rfcomm_frame_size =3D 14; //sizeof(pn_msg); + rfcomm_frame_size =3D sizeof *pn_pkt; tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size); =20 if (!tx_buf) { @@ -2280,12 +2280,10 @@ pn_pkt->credit_flow =3D credit_flow; pn_pkt->prior =3D prior; pn_pkt->ack_timer =3D 0; - pn_pkt->frame_size =3D frame_size; + put_unaligned(cpu_to_le16(frame_size), &pn_pkt->frame_size); pn_pkt->credits =3D credits; pn_pkt->max_nbrof_retrans =3D 0; =20=20=20 - swap_pn_msg(pn_pkt); - return l2cap_send_data(tx_buf,rfcomm->l2cap); } =20 |
From: Peter K. <pk...@us...> - 2001-10-16 14:58:17
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.186 1.187=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Moved definitions of le16_to_cpuu() and le32_to_cpuu() macros to btcommon.h The diff of the modified file(s): --- hci.c 2001/10/10 13:16:41 1.186 +++ hci.c 2001/10/16 14:57:10 1.187 @@ -85,11 +85,6 @@ =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 -/* These two macros are the same as le16_to_cpup() and le32_to_cpup() - only that they work with unaligned addresses */ -#define le16_to_cpuu(addr) (le16_to_cpu(get_unaligned((u16 *)addr))) -#define le32_to_cpuu(addr) (le32_to_cpu(get_unaligned((u32 *)addr))) - #define ACL_LINK 1 #define SCO_LINK 0 =20 |
From: Peter K. <pk...@us...> - 2001-10-16 14:57:22
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btcommon.h 1.87 1.88=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Moved definitions of le16_to_cpuu() and le32_to_cpuu() macros to btcommon.h The diff of the modified file(s): --- btcommon.h 2001/10/10 15:00:42 1.87 +++ btcommon.h 2001/10/16 14:57:10 1.88 @@ -94,6 +94,12 @@ =20 /* extract line number from tty */ #define GET_TTYLINE(tty) (MINOR(tty->device) - tty->driver.minor_start) + +/* These two macros are the same as le16_to_cpup() and le32_to_cpup() + only that they work with unaligned addresses */ +#define le16_to_cpuu(addr) (le16_to_cpu(get_unaligned((u16 *)addr))) +#define le32_to_cpuu(addr) (le32_to_cpu(get_unaligned((u32 *)addr))) + /****************** Defines realted to the bluetooth implementation ******= ***/ =20 #define SERIAL_PORT_PROFILE 0 |
From: Peter K. <pk...@us...> - 2001-10-16 14:45:21
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.205 1.206=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: If theline argument to the BTISLOWERCONNECTED ioctl is negative, it checks the status for the current tty. The diff of the modified file(s): --- bluetooth.c 2001/10/16 11:10:14 1.205 +++ bluetooth.c 2001/10/16 14:44:56 1.206 @@ -621,7 +621,8 @@ s32 line;=09=20=20 =20 copy_from_user(&line, (s32*)arg, size); - return (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED); + return (line >=3D 0 && SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || + (line < 0 && SESSIONSTATE(GET_TTYLINE(tty)) =3D=3D BT_LOWERCONNEC= TED); } =20=09 case BTINITSTACK: |
From: Anders J. <and...@us...> - 2001-10-16 14:43:49
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.c 1.124 1.125=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * When we receving a PN message we should fix the frame_size after=20 determine if it's a long packet. The diff of the modified file(s): --- rfcomm.c 2001/10/12 12:03:22 1.124 +++ rfcomm.c 2001/10/16 09:30:12 1.125 @@ -1571,7 +1571,6 @@ case PN: /*DLC parameter negotiation*/ { pn_msg *pn_pkt =3D (pn_msg*) data; - swap_pn_msg(pn_pkt); D_CTRL(FNC"Received DLC parameter negotiation, PN\n"); if (longpkt) { /* If a long length field is used, then move the @@ -1579,6 +1578,7 @@ data++; pn_pkt =3D (pn_msg*) data; }=20=20 + swap_pn_msg(pn_pkt); if (pn_pkt->mcc_s_head.type.cr =3D=3D MCC_CMD) { u8 tmp_dlci; u16 frame_size; |
From: Peter K. <pk...@us...> - 2001-10-16 14:43:19
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added #ifdefs around speeds above 115200 in translate_speed(). The diff of the modified file(s): --- bt_misc.c 2001/10/10 16:20:40 1.21 +++ bt_misc.c 2001/10/16 10:25:36 1.22 @@ -337,15 +337,21 @@ case 115200: speed_c =3D B115200; break; +#ifdef B230400 case 230400: speed_c =3D B230400; break; +#endif +#ifdef B460800 case 460800: speed_c =3D B460800; break; +#endif +#ifdef B921600 case 921600: speed_c =3D B921600; break; +#endif =20 default: printf("Bad baudrate %d.\n", spd); |
From: Peter K. <pk...@us...> - 2001-10-16 14:43:17
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.58 1.59=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added support for baud rates lower than 57600 for Ericsson (thanks to Alain Paschoud for this). The diff of the modified file(s): --- hci_vendor.c 2001/10/05 12:25:46 1.58 +++ hci_vendor.c 2001/10/16 11:13:09 1.59 @@ -156,6 +156,21 @@ c_pkt.opcode =3D hci_put_opcode(ERICSSON_SET_UART_BAUD_RATE, MANUFACTURER= _SPEC); c_pkt.len =3D 1; switch (baudrate) { + case 9600: + c_pkt.data[0] =3D 0x14; + break; + case 14400: + c_pkt.data[0] =3D 0x05; + break; + case 19200: + c_pkt.data[0] =3D 0x13; + break; + case 28800: + c_pkt.data[0] =3D 0x04; + break; + case 38400: + c_pkt.data[0] =3D 0x12; + break; case 57600: c_pkt.data[0] =3D 0x03; break; |
From: Peter K. <pk...@us...> - 2001-10-16 14:38:18
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.204 1.205=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Make sure KERNEL_VERSION() is defined before using it (thanks to Alain Paschoud for spotting this). The diff of the modified file(s): --- bluetooth.c 2001/10/12 12:03:22 1.204 +++ bluetooth.c 2001/10/16 11:10:14 1.205 @@ -51,6 +51,11 @@ #include <linux/delay.h> #include <linux/timer.h> =20 +/* Make sure KERNEL_VERSION() is defined */ +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) # ifdef MODULE # define module_init(x) int init_module(void) { return x(); } |
From: Peter K. <pk...@us...> - 2001-10-16 14:38:18
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.c 1.121 1.122=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed an error message. The diff of the modified file(s): --- l2cap.c 2001/10/10 14:58:18 1.121 +++ l2cap.c 2001/10/16 10:51:29 1.122 @@ -2969,7 +2969,7 @@ =20 retval =3D lp_connect_req(con->remote_bd); if(retval < 0) { - D_ERR(__FUNCTION__, ": lp_connect_req failed (status %d)\n", retval); + D_ERR(__FUNCTION__ ": lp_connect_req failed (status %d)\n", retval); delete_con(con); return retval; } |
From: Peter K. <pk...@us...> - 2001-10-15 13:50:39
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.30 1.31=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed a couple of unnecessary &. The diff of the modified file(s): --- btd.c 2001/10/05 14:14:16 1.30 +++ btd.c 2001/10/15 13:50:39 1.31 @@ -426,8 +426,7 @@ PEER(line).ipset =3D &IPSET(line); =20=20=20=20=20=20=20=20=20 STATE(line) =3D WAITING_PPPCONF; - if (ipa_sendrequest(line, (unsigned char *)&PEER(line).remote_bd,= =20 - IPAREQ_GETIPSET) < 0) + if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_GETIPSET) <= 0) { syslog(LOG_INFO, "IPA request failed or no IPA server"); =20=20=20=20=20=20=20=20=20=20=20 @@ -758,8 +757,7 @@ {=20 STATE(line) =3D WAITING_RETURN_PPPCONF; =20=20=20=20=20=20=20 - if (ipa_sendrequest(line, (unsigned char *)&PEER(line).remote_bd,=20 - IPAREQ_RELEASEIPSET) < 0) + if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_RELEASEIPSET)= < 0) { syslog(LOG_INFO, "IPA request failed or no IPA server"); /* put peer into state NOCONNECTION, if still connected this @@ -923,7 +921,7 @@ msg->len =3D sizeof(struct ipa_request); req =3D (struct ipa_request*)msg->msg; req->id =3D line; - memcpy(&req->remote_bd, bd, 6);=20 + memcpy(req->remote_bd, bd, 6);=20 return ipa_write(ipa_fd, msg); } =20 @@ -933,7 +931,7 @@ { case IPARSP_STATUS: { - ipa_status *rsp =3D (struct ipa_status*)(msg->msg); + ipa_status *rsp =3D (struct ipa_status*)msg->msg; D(syslog(LOG_INFO, __FUNCTION__ ": Got status %d on line %d",=20 rsp->status, rsp->id)); =20 @@ -964,7 +962,7 @@ =20=20=20=20=20 case IPARSP_PEERSETTINGS: { - ipa_response* rsp =3D (struct ipa_response*)(msg->msg); + ipa_response* rsp =3D (struct ipa_response*)msg->msg; D(syslog(LOG_INFO, __FUNCTION__ ": Got client settings")); =20=20=20=20=20=20=20 /* Check state */ |
From: Peter K. <pk...@us...> - 2001-10-15 13:29:07
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- sdp.c 1.80 1.81=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed a typo (duinr -> during). The diff of the modified file(s): --- sdp.c 2001/09/21 12:51:06 1.80 +++ sdp.c 2001/10/15 13:29:06 1.81 @@ -737,7 +737,7 @@ if (sdp_id <=3D MAX_NBR_SDP && (sdp->state =3D=3D SDP_CONNECTING || sdp->state =3D=3D SDP_CONNECTED)= ) { if ((err =3D l2ca_disconnect_req(sdp_con_list[sdp_id].l2cap)) !=3D 0) { - D_ERR(__FUNCTION__ ", An error with error code %d occured duinr disconn= etion of sdp channel %d\n", err, sdp_id); + D_ERR(__FUNCTION__ ", An error with error code %d occured during discon= netion of sdp channel %d\n", err, sdp_id); sdp_con_list[sdp_id].state =3D SDP_DISCONNECTED; sdp_con_list[sdp_id].l2cap =3D NULL;=20=20 }=20 |
From: Anders J. <and...@us...> - 2001-10-15 08:48:55
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.39 1.40=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.h 1.27 1.28=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Made bt_inq return a returnvalue. * Added errormessages. The diff of the modified file(s): --- bt_if.c 2001/10/12 14:56:41 1.39 +++ bt_if.c 2001/10/15 08:48:53 1.40 @@ -663,9 +663,10 @@ /* HCI functions */ =20 =20 -void +int bt_inquiry(int bt_cfd, int nbr_rsp, int t) { + int retval =3D 0; #ifdef BTD_USERSTACK char inq_lap[6]; =20 @@ -675,7 +676,7 @@ inq_lap[1] =3D 0x8b; inq_lap[2] =3D 0x9e; =20 - hci_inquiry(inq_lap, t, nbr_rsp); + retval =3D hci_inquiry(inq_lap, t, nbr_rsp); #else int i; inquiry_results *inq_res; @@ -683,15 +684,17 @@ if (!(inq_res =3D malloc(sizeof *inq_res + nbr_rsp * 6))) { fprintf(stderr, __FUNCTION__ ": Failed to allocate result structure!\n= "); + return -ENOMEM; } =20 inq_res->nbr_of_units =3D nbr_rsp; inq_res->inq_time =3D t; =20 - if (ioctl(bt_cfd, HCIINQUIRY, inq_res) < 0) + if ((retval =3D ioctl(bt_cfd, HCIINQUIRY, inq_res)) < 0) { - perror(__FUNCTION__); - exit(1); + printf("Inquiry failed [%s (%d)]\n", error_msg(retval), MSG_GET_CODE(-= retval)); + free(inq_res); + return retval; } =20 for (i =3D 0; i < inq_res->nbr_of_units; i++) @@ -704,6 +707,7 @@ =20 free(inq_res); #endif + return retval; } =20 void --- bt_if.h 2001/10/10 14:56:00 1.27 +++ bt_if.h 2001/10/15 08:48:53 1.28 @@ -317,7 +317,7 @@ int bt_getinfo(int bt_cfd, unsigned char bd[6], unsigned short type); int bt_testcmd(int bt_cfd, unsigned char *cmd); =20 -void bt_inquiry(int bt_cfd, int nbr_rsp, int t); +int bt_inquiry(int bt_cfd, int nbr_rsp, int t); int bt_set_baudrate(int bt_cfd, const char *speedstr); void bt_set_bd_addr(int bt_cfd, unsigned char *bd); void read_local_bd(int bt_cfd, unsigned char *bd_addr); |
From: Peter K. <pk...@us...> - 2001-10-12 14:56:43
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Free allocated memory in bt_inquiry() (thanks to Andreas Petralia). The diff of the modified file(s): --- bt_if.c 2001/10/12 12:01:16 1.38 +++ bt_if.c 2001/10/12 14:56:41 1.39 @@ -680,7 +680,11 @@ int i; inquiry_results *inq_res; =20 - inq_res =3D (inquiry_results*) malloc(sizeof(inquiry_results) + nbr_rsp = * 6); + if (!(inq_res =3D malloc(sizeof *inq_res + nbr_rsp * 6))) + { + fprintf(stderr, __FUNCTION__ ": Failed to allocate result structure!\n= "); + } + inq_res->nbr_of_units =3D nbr_rsp; inq_res->inq_time =3D t; =20 @@ -697,6 +701,8 @@ 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]); } + + free(inq_res); #endif } =20 |
From: Anders J. <and...@us...> - 2001-10-12 12:03:45
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added RFCOMM error messages. The diff of the modified file(s): --- bt_errno.h 2001/10/10 14:59:17 1.3 +++ bt_errno.h 2001/10/12 12:03:45 1.4 @@ -82,6 +82,11 @@ =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=3D=3D=3D*/ /* RFCOMM */ +#define RFCOMM_INVALID_LINE 0xf0 +#define RFCOMM_SRVCHN_CONNECTED 0xf1 +#define RFCOMM_NO_DATA_ALLOWED 0xf2 +#define RFCOMM_NO_CONNECTION 0xf3 +#define RFCOMM_BAD_MAGIC_NUMBER 0Xf4 =20 /* fixme */ =20 |
From: Anders J. <and...@us...> - 2001-10-12 12:03:23
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.203 1.204=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.123 1.124=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected bug in RFCOMM, now using correct length when determine if there= are any data in the ACL packet. * Changed returnvalues to use bt_err-errorcodes and standard defines. The diff of the modified file(s): --- bluetooth.c 2001/10/10 14:58:18 1.203 +++ bluetooth.c 2001/10/12 12:03:22 1.204 @@ -1855,6 +1855,7 @@ case RFCOMM_LAYER: { u8 srv_ch; + s32 retval =3D 0; =20 CHECK_RFCOMM(con_id); srv_ch =3D GET_RFCOMMSRVCH(con_id);=20 @@ -1865,9 +1866,9 @@ srv_ch, line); BT_DATADUMP("Remote BD: ", bd_addr, 6); =20 - if (rfcomm_connect_req(bd_addr, srv_ch, line) < 0) { + if ((retval =3D rfcomm_connect_req(bd_addr, srv_ch, line)) < 0) { BT_DRIVER(__FUNCTION__ ": Failed\n"); - return bt_ctrl.session[line].connect_status; + return retval; } =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 /* sleep if not yet connected */ --- rfcomm.c 2001/10/10 14:58:18 1.123 +++ rfcomm.c 2001/10/12 12:03:22 1.124 @@ -58,6 +58,7 @@ #include <linux/bluetooth/l2cap.h> #include <linux/bluetooth/bluetooth.h> #include <linux/bluetooth/btconfig.h> +#include <linux/bluetooth/bt_errno.h> #else #include <stdlib.h> #include <string.h> @@ -68,6 +69,7 @@ #include "include/l2cap.h" #include "include/bluetooth.h" #include "include/local.h" +#include "include/bt_errno.h" #endif =20 /****************** DEBUG CONSTANT AND MACRO SECTION *********************= ***/ @@ -671,13 +673,14 @@ { rfcomm_con *rfcomm; u8 tmp_dlci; + s32 retval =3D 0; =20=20=20 D_CTRL(FNC"server channel:%d, line:%d\n", server_chn, line); =20 if (!(rfcomm =3D get_rfcomm_con(line))) { D_ERR(FNC"%d is an invalid line\n", line); - return 0; + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_INVALID_LINE); } =20 if (rfcomm->dlci[0].state =3D=3D DISCONNECTED) { @@ -693,13 +696,14 @@ rfcomm->dlci[0].state =3D CONNECTING;=20=20=20=20 =20 /* we don't have a l2cap connection yet */ - if (l2ca_connect_req(bd_addr, RFCOMM_LAYER)) { + if ((retval =3D l2ca_connect_req(bd_addr, RFCOMM_LAYER)) < 0) { D_ERR(FNC"l2ca_connect_req failed\n"); - return -1; + return retval; } } else if (!((rfcomm->l2cap)->current_state =3D=3D OPEN)) { =20 D_ERR(FNC"L2CAP_CON exists but is not in OPEN state (yet?)\n"); + /* FIXME: Should we really return no error here? */ return 0; } else if (rfcomm->dlci[0].state !=3D CONNECTED) { =20 @@ -713,19 +717,19 @@ } else { rfcomm->dlci[0].state =3D CONNECTING; /* Establish the control channel */ - send_sabm(rfcomm, 0); + return send_sabm(rfcomm, 0); } } else if (rfcomm->dlci[tmp_dlci].state !=3D DISCONNECTED) { =20 D_ERR(FNC"trying to connect a non DISCONNECTED server channel (%d)\n",se= rver_chn); - return 0; + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_SRVCHN_CONNECTED); } else { D_CTRL(FNC"We are negotiating rfcomm (pn msg)\n"); rfcomm->dlci[tmp_dlci].state =3D NEGOTIATING; /* must fit i l2cap mtu */ D_CTRL(FNC"negotiate mtu : %d bytes\n", rfcomm->l2cap->remote_mtu - 5); - send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, 0, 0, + return send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, 0, 0, tmp_dlci, TRUE); } =20 @@ -742,6 +746,11 @@ s32 tmp; =20 D_CTRL("rfcomm_disconnect_req %d\n", line); + if(line >=3D BT_NBR_DATAPORTS) { + D_ERR("rfcomm_disconnect_req : Invalid line\n"); + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_INVALID_LINE); + } +=09 if (!(rfcomm =3D &rfcomm_con_list[line])) { D_ERR("rfcomm_disconnect_req : no rfcomm con\n"); @@ -1268,7 +1277,7 @@ #endif D_REC(FNC"Local_credits:%d\n", rfcomm->dlci[tmp_dlci].local_credits);= =20 uih_data_start++; - if (short_pkt->h.length.len =3D=3D 0) { + if (uih_len =3D=3D 0) { break; } =20=09=09=09 @@ -1330,7 +1339,7 @@ =20=09 if (dlci =3D=3D 0) { D_ERR(FNC"Not allowed to send data on DLCI 0\n"); - return -1; + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_NO_DATA_ALLOWED); } =20=09 rfcomm =3D &rfcomm_con_list[line]; @@ -1338,17 +1347,15 @@ =20 if (rfcomm =3D=3D NULL) { D_ERR(FNC" ERROR rfcomm_con =3D=3D NULL\n"); - return -1; + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_NO_CONNECTION); } else if (rfcomm->magic !=3D RFCOMM_MAGIC) { D_ERR(FNC"ERROR magic test failed\n"); - return -1; + return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_BAD_MAGIC_NUMBER); } else if(rfcomm->dlci[0].state =3D=3D FLOW_STOPPED) { D_SND(FNC"Flow stopped on all channels, returning zero\n"); - /* FIXME: We need to buffer the incoming data here... */ return 0; } else if (rfcomm->dlci[dlci].state =3D=3D FLOW_STOPPED) { D_SND(FNC"Flow stopped, returning zero\n"); - /* FIXME: We need to buffer the incoming data here... */ return 0; } /* Check whether there are any data channels connected */ @@ -1665,7 +1672,7 @@ =20=09 if (!tx_buf) { D_ERR("send_ua : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20=09 tx_buf->cur_len =3D rfcomm_frame_size; @@ -1706,7 +1713,7 @@ =20 if (!tx_buf) { D_ERR("send_dm : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -1745,7 +1752,7 @@ =20=09 if (!tx_buf) { D_ERR("send_sabm : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -1784,7 +1791,7 @@ =20 if (!tx_buf) { D_ERR("send_disc : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -1819,6 +1826,7 @@ bt_tx_buf *tx_buf; u32 rfcomm_frame_size; u8 send_credit =3D 0; + s32 retval =3D 0; =20=09=09 D_CTRL(FNC"Creating UIH packet with %d bytes data to DLCI %d\n", len, dlci); @@ -1853,7 +1861,7 @@ + rfcomm_frame_size);=20=20=20=20 if (!tx_buf) { D_ERR(FNC"didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } tx_buf->cur_len =3D rfcomm_frame_size; =20=20=20=20=20 @@ -1885,7 +1893,7 @@ + rfcomm_frame_size); if (!tx_buf) { D_ERR(FNC"didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } tx_buf->cur_len =3D rfcomm_frame_size; =20=20=20=20=20 @@ -1909,7 +1917,10 @@ /* FIXME - How should we propagate result up to higher layers ? through len or success/no success? */ tx_buf->line =3D rfcomm->line; - l2cap_send_data(tx_buf, rfcomm->l2cap); + if((retval =3D l2cap_send_data(tx_buf, rfcomm->l2cap)) < 0) { + return retval; + } +=09 return len; } =20 @@ -1927,7 +1938,7 @@ =20 if (!tx_buf) { D_ERR("rfcomm_fcon_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -1964,7 +1975,7 @@ + rfcomm_frame_size); if (!tx_buf) { D_ERR("rfcomm_test_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } tx_buf->cur_len =3D rfcomm_frame_size; uih_pkt =3D (long_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf)); @@ -1996,7 +2007,7 @@ + rfcomm_frame_size); if (!tx_buf) { D_ERR("rfcomm_test_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20=09=09 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2029,7 +2040,7 @@ + rfcomm_frame_size); if (!tx_buf) { D_ERR("rfcomm_test_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20=09=09 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2071,7 +2082,7 @@ =20 if (!tx_buf) { D_ERR("rfcomm_fcon_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2108,7 +2119,7 @@ =20 if (!tx_buf) { D_ERR("rfcomm_fcoff_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2149,7 +2160,7 @@ =20 if (!tx_buf) { D_ERR("rfcomm_rpn_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2198,7 +2209,7 @@ =20 if (!tx_buf) { D_ERR("rfcomm_rls_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2242,7 +2253,7 @@ =20 if (!tx_buf) { D_ERR("send_pn_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2292,7 +2303,7 @@ =20 if (!tx_buf) { D_ERR("send_nsc_msg : didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2330,7 +2341,7 @@ =20 if (!tx_buf) { D_ERR(FNC"didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; @@ -2398,6 +2409,9 @@ rfcomm_con*=20 get_rfcomm_con(u8 line) { + if(line >=3D BT_NBR_DATAPORTS) { + return NULL; + } return &rfcomm_con_list[line]; } =20 @@ -2553,7 +2567,7 @@ =20 if (!tx_buf) { D_ERR(FNC"didn't get a valid tx_buf\n"); - return -1; + return -ENOMEM; } =20 tx_buf->cur_len =3D rfcomm_frame_size; |
From: Anders J. <and...@us...> - 2001-10-12 12:01:17
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.c 1.37 1.38=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added RFCOMM error messages. The diff of the modified file(s): --- bt_errno.h 2001/10/10 14:56:00 1.2 +++ bt_errno.h 2001/10/12 12:01:16 1.3 @@ -82,6 +82,11 @@ =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=3D=3D=3D*/ /* RFCOMM */ +#define RFCOMM_INVALID_LINE 0xf0 +#define RFCOMM_SRVCHN_CONNECTED 0xf1 +#define RFCOMM_NO_DATA_ALLOWED 0xf2 +#define RFCOMM_NO_CONNECTION 0xf3 +#define RFCOMM_BAD_MAGIC_NUMBER 0Xf4 =20 /* fixme */ =20 --- bt_if.c 2001/10/10 14:56:00 1.37 +++ bt_if.c 2001/10/12 12:01:16 1.38 @@ -1131,6 +1131,11 @@ case MSG_LAYER_RFCOMM: switch(code) { + case RFCOMM_INVALID_LINE: return "RFCOMM: Trying to use an invalid li= ne";=20 + case RFCOMM_SRVCHN_CONNECTED: return "RFCOMM: Serverchannel already c= onnected"; + case RFCOMM_NO_DATA_ALLOWED: return "RFCOMM: No data allowed on contr= ol channel"; + case RFCOMM_NO_CONNECTION: return "RFCOMM: No connection"; + case RFCOMM_BAD_MAGIC_NUMBER: return "RFCOMM: Bad magic number";=20 default: return "RFCOMM: No debug msg defined"; } case MSG_LAYER_SDP: |
From: Peter K. <pk...@us...> - 2001-10-12 07:37:40
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added inclusion of limits.h The diff of the modified file(s): --- btconfig.c 2001/10/10 16:33:21 1.9 +++ btconfig.c 2001/10/12 07:37:39 1.10 @@ -56,6 +56,7 @@ #include <ctype.h> #include <arpa/inet.h> #include <net/if.h> +#include <limits.h> =20 #include "btd.h" #include "bt_if.h" |
From: Peter K. <pk...@us...> - 2001-10-10 16:33:22
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Change MaxPower to MaxTransmitPower. The diff of the modified file(s): --- btconfig.c 2001/10/10 16:22:10 1.8 +++ btconfig.c 2001/10/10 16:33:21 1.9 @@ -459,10 +459,10 @@ var_max_connections =3D atoi(value); D(syslog(LOG_INFO, __FUNCTION__ ": Maximum BT connections: %s", value)= ); } - else if (!strcasecmp(field, "MaxPower")) + else if (!strcasecmp(field, "MaxTransmitPower")) {=20 var_max_power =3D atoi(value); - D(syslog(LOG_INFO, __FUNCTION__ ": Maximum power: %s", value)); + D(syslog(LOG_INFO, __FUNCTION__ ": Maximum transmit power: %s", value)= ); } =20=20=20 return TRUE; |
From: Peter K. <pk...@us...> - 2001-10-10 16:22:11
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- Makefile 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 bt_vendor.c 1.29 1.30=20=20=20=20=20=20=20=20=20=20=20=20 bt_vendor.h 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 btconfig.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made it possible to specify the maximum transmit power to use (only supported for CSR). The diff of the modified file(s): --- Makefile 2001/09/26 14:24:26 1.9 +++ Makefile 2001/10/10 16:22:10 1.10 @@ -30,7 +30,7 @@ BTDISCOBJS =3D btdisc.o bt_if.o bt_misc.o BTINQOBJS =3D btinq.o bt_if.o bt_misc.o BTTESTOBJS =3D bttest.o bt_misc.o bt_vendor.o bt_if.o -BTCONFIGOBJS =3D btconfig.o bt_if.o bt_misc.o +BTCONFIGOBJS =3D btconfig.o bt_vendor.o bt_if.o bt_misc.o =20 ifdef HAVE_READLINE_READLINE LDLIBS +=3D -lreadline -ltermcap --- bt_vendor.c 2001/10/03 17:46:13 1.29 +++ bt_vendor.c 2001/10/10 16:22:10 1.30 @@ -49,6 +49,8 @@ #include <signal.h> #include <string.h> #include <stdlib.h> +#include <limits.h> +#include <errno.h> =20 #include "bt_misc.h" #include "bt_vendor.h" @@ -74,6 +76,7 @@ static void unknown_init_hw(int bt_cfd, int phys_fd, const char *speedstr); =20 static void csr_change_if(int bt_cfd, int phys_fd, const char *speedstr); +static int csr_set_max_power(int bt_cfd, short max_power); =20 void init_phys(int fd) @@ -155,7 +158,20 @@ } } =20 +int +bt_set_max_power(int bt_cfd, short max_power) +{ + switch (hw_vendor()) + { + case HW_CSR: + return csr_set_max_power(bt_cfd, max_power); =20 + default: + errno =3D EPERM; + return -1; + } +} + /*=20 * This function tries to recover stack if init failed=20 * For now all other vendors but CSR is left to restart=20 @@ -235,13 +251,14 @@ /* 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_LC_MAX_TX_POWER 0x0017 #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 =20 - /* Set the phys device to CSR default, 115200 */=20 void csr_init_phys(int fd) @@ -505,6 +522,29 @@ syslog(LOG_INFO, "Did not set baudrate in CSR module as its firmware= is too old (%d)", firmware); } } +} + +int +csr_set_max_power(int bt_cfd, short max_power) +{ + short old_max_power =3D SHRT_MAX; + + /* We need to wait a little here for some reason, or the reading of the + current maximum power may fail and return 0 */ + usleep(50000); + + csr_pskey(bt_cfd, PSKEY_LC_MAX_TX_POWER, CSR_PSKEY_GETREQ, (unsigned sho= rt *)&old_max_power, 1); + + if (old_max_power !=3D max_power) + { + csr_pskey(bt_cfd, PSKEY_LC_MAX_TX_POWER, CSR_PSKEY_SETREQ, (unsigned s= hort *)&max_power, 1); + if (restart_btd() < 0) + { + syslog(LOG_INFO, "Failed to restart btd"); + } + } + + return 0; } =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*/ --- bt_vendor.h 2001/10/03 17:46:40 1.10 +++ bt_vendor.h 2001/10/10 16:22:10 1.11 @@ -68,6 +68,8 @@ void init_phys(int fd); void init_failed(int bt_cfd, int phys_fd, const char *speedstr); =20 +int bt_set_max_power(int bt_cfd, short max_power); + int hw_vendor(void); =20 void csr_bcsp_to_h4(int bt_cfd, int phys_fd, const char *speedstr); --- btconfig.c 2001/09/10 12:01:18 1.7 +++ btconfig.c 2001/10/10 16:22:10 1.8 @@ -61,6 +61,7 @@ #include "bt_if.h" #include "bt_conf.h" #include "bt_misc.h" +#include "bt_vendor.h" =20=20=20=20=20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 @@ -107,6 +108,7 @@ static int var_force_ms_switch =3D -1; /* not yet set */ static int var_set_local_name =3D 0; static int var_max_connections =3D -1; /* not yet set */ +static short var_max_power =3D SHRT_MAX; /* not yet set */ =20 /* long option list */ static struct option long_options[] =3D @@ -204,7 +206,8 @@ if (var_set_local_name || var_write_scan_enable >=3D 0 || var_force_ms_switch >=3D 0 || - var_max_connections >=3D 0) + var_max_connections >=3D 0 || + var_max_power !=3D SHRT_MAX) { /* Open BT ctrl device */=20=20 if ((bt_cfd =3D bt_openctrl()) < 0) @@ -233,6 +236,9 @@ if (var_max_connections >=3D 0) bt_set_max_conections(bt_cfd, var_max_connections); =20 + if (var_max_power !=3D SHRT_MAX) + bt_set_max_power(bt_cfd, var_max_power); +=20=20=20=20 close(bt_cfd); } =20 @@ -452,6 +458,11 @@ {=20 var_max_connections =3D atoi(value); D(syslog(LOG_INFO, __FUNCTION__ ": Maximum BT connections: %s", value)= ); + } + else if (!strcasecmp(field, "MaxPower")) + {=20 + var_max_power =3D atoi(value); + D(syslog(LOG_INFO, __FUNCTION__ ": Maximum power: %s", value)); } =20=20=20 return TRUE; |
From: Peter K. <pk...@us...> - 2001-10-10 16:20:42
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20 bt_misc.h 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added restart_btd() which sends SIGUSR1 to the pid registered in /var/run/btd.pid to make it reinitialise the stack. The diff of the modified file(s): --- bt_misc.c 2001/10/04 15:10:40 1.20 +++ bt_misc.c 2001/10/10 16:20:40 1.21 @@ -96,6 +96,36 @@ return pid_fd; } =20 +int +restart_btd(void) +{ + int fd; + int pid =3D -1; + int size; + char buf[100]; + + if ((fd =3D open("/var/run/btd.pid", O_RDONLY)) < 0) + { + return -1; + } + + if ((size =3D read(fd, buf, sizeof buf - 1)) > 0) + { + buf[size-1] =3D '\0'; + pid =3D atoi(buf); + } + + close(fd); + + if (pid > 0) + { + kill(pid, SIGUSR1); + return 0; + } + + return -1; +} + /* Local UNIX socket */ int open_socket(const char *name, int role) --- bt_misc.h 2001/10/03 17:45:44 1.10 +++ bt_misc.h 2001/10/10 16:20:40 1.11 @@ -59,6 +59,9 @@ int open_tcpsocket(const char *addrstr, int role); =20 int write_pidfile(const char *pidname); + +int restart_btd(void); + char *get_local_ip_address(void); const char *bd2str(const unsigned char *bd); #ifndef BT_USERSTACK |
From: Anders J. <and...@us...> - 2001-10-10 15:00:43
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btcommon.h 1.86 1.87=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Defined GET_LINE macro. The diff of the modified file(s): --- btcommon.h 2001/10/05 11:54:24 1.86 +++ btcommon.h 2001/10/10 15:00:42 1.87 @@ -94,7 +94,6 @@ =20 /* extract line number from tty */ #define GET_TTYLINE(tty) (MINOR(tty->device) - tty->driver.minor_start) - /****************** Defines realted to the bluetooth implementation ******= ***/ =20 #define SERIAL_PORT_PROFILE 0 @@ -106,9 +105,14 @@ #define PICONET_BROADCAST 2 =20 #define MAX_NBR_OF_CONNECTIONS 7 + +/* Macro to extract the linenumber in a conid used by applications/stack. = */ +#define GET_LINE(conID) ( ((conID & 0xff00) >> 8) ) + /* Define to control usage of the security manager */=20=20 =20 /****************** Defines realated to the management of the bt-driver **= ***/ + =20 #define BT_NBR_DATAPORTS 7 #define BT_NBR_CTRLPORTS 1 |
From: Anders J. <and...@us...> - 2001-10-10 14:59:18
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 rfcomm.h 1.40 1.41=20=20=20=20=20=20=20=20=20=20=20=20 sdp.h 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * RFCOMM_GETLINE, SDP_GETLINE -> GET_LINE * Added more errorcodes. The diff of the modified file(s): --- bt_errno.h 2001/04/17 15:48:15 1.2 +++ bt_errno.h 2001/10/10 14:59:17 1.3 @@ -45,19 +45,21 @@ =20 /* Unique status codes 32 bits : | layer 16 bits | code 16 bits | */ #define MSGCODE(layer, msgcode) ((((layer)<<16)&0xffff0000) | ((msgcode)&0= xffff)) +#define MSG_GET_LAYER(msg) ((msg >> 16) & 0x0000ffff) +#define MSG_GET_CODE(msg) (msg & 0x0000ffff) =20 /* Layer ID */ -#define MSG_LAYER_HCI 0 -#define MSG_LAYER_L2CAP 1 -#define MSG_LAYER_RFCOMM 2 +#define MSG_LAYER_HCI 1 +#define MSG_LAYER_L2CAP 2 +#define MSG_LAYER_RFCOMM 3 #define MSG_LAYER_SDP 4 -#define MSG_LAYER_TCS 8 -#define MSG_BT_INTERFACE 16 +#define MSG_LAYER_TCS 5 +#define MSG_BT_INTERFACE 6 =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=3D=3D=3D*/ /* HCI */ =20 -/* fixme */ +/* Uses errorcodes as specified in the BT specification */ =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=3D=3D=3D*/ /* L2CAP */ @@ -73,6 +75,10 @@ /* General l2cap return codes */ #define L2CAP_FAILED 0xf0 #define L2CAP_CON_UNRESPONSIVE 0xf1 +#define L2CAP_INVALID_STATE 0xf2 +#define L2CAP_NO_CONNECTION 0xf3 +#define L2CAP_EXCEED_REMOTE_MTU 0xf4 +#define L2CAP_RTX_TIMEOUT 0xf5 =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=3D=3D=3D*/ /* RFCOMM */ @@ -95,3 +101,4 @@ #define BT_NOTCONNECTED 0x1 #define BT_ALREADYCONNECTED 0x2 #define BT_TIMEOUT 0x3 +#define BT_LINE_BUSY 0x4 --- rfcomm.h 2001/10/05 12:06:43 1.40 +++ rfcomm.h 2001/10/10 14:59:17 1.41 @@ -71,7 +71,6 @@ D_ERR("con id 0x%x is not a RFCOMM ID (%s, l.= %d)\n", id, __FILE__, __LINE__);\ } while (0) =20 -#define GET_RFCOMMLINE(con_id) ((con_id >> 8) & 0xff) #define GET_RFCOMMSRVCH(con_id) ((con_id&0xff) >> 1) #define GET_RFCOMMDLCI(con_id) (con_id&0xff) =20 --- sdp.h 2001/03/30 09:45:45 1.26 +++ sdp.h 2001/10/10 14:59:17 1.27 @@ -69,7 +69,6 @@ =20 #define CREATE_SDP_ID(line, index) ( ((SDP_LAYER << 16) & 0xffff0000) | ((= line << 8) & 0x0000ff00) | (index & 0xff) ) #define GET_SDPINDEX(conID) ( (conID & 0xff) ) -#define GET_SDPLINE(conID) ( ((conID & 0xff00) >> 8) ) =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 |