|
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;
}
}
|