|
From: Mattias A. <mat...@us...> - 2001-08-27 15:22:05
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
unplug_test.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added real unplug SDP test cases
The diff of the modified file(s):
--- unplug_test.c 2001/08/02 16:04:47 1.4
+++ unplug_test.c 2001/08/27 15:22:04 1.5
@@ -80,6 +80,76 @@
extern s32 disable_testpsm;
s32 test_role;
=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=3D=3D=3D=3D=3D=3D */=
=20
+/* Unplug Test Cases 1-13 */
+
+/* [Test-01] Service search request for UUID 0x1103 (DialUp Profile) */
+unsigned char q1_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08,
+ 0x35, 0x03, 0x19, 0x11, 0x03, 0x00, 0xff, 0x00};
+
+/* Service attribute request for Rec Hdl 00010000
+ * Attr : ProtDescrList=20
+ */
+unsigned char q1_2[] =3D {0x04, 0x77, 0x77, 0x00, 0x0c,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x03,
+ 0x09, 0x00, 0x04, 0x00};
+
+/* [Test-02] Service browsing.=20
+ * Service Search Attribute Req for UUID 1002 (Public=20
+ * Browse Group) Attr : ServiceName=20
+ */
+unsigned char q2[] =3D {0x06, 0x77, 0x77, 0x00, 0x0d,
+ 0x35, 0x03, 0x19, 0x10, 0x02, 0x00, 0xff, 0x35,
+ 0x03, 0x09, 0x01, 0x00, 0x00};
+
+/* [Test-3]=20
+ * Continued query with limiting MaximumAttrByteCount
+ */
+unsigned char q3_1[] =3D {0x06, 0x77, 0x77, 0x00, 0x0f,
+ 0x35, 0x03, 0x19, 0x11, 0x05, 0x00, 0x45, 0x35,
+ 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x00};
+
+/* The continued request */
+unsigned char q3_2[] =3D {0x06, 0x88, 0x88, 0x00, 0x13,
+ 0x35, 0x03, 0x19, 0x11, 0x05, 0x00, 0x45, 0x35,
+ 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00};
+
+/* [Test-04]=20
+ * Search for non-existing service=20
+ */
+unsigned char q4[] =3D {0x02, 0x88, 0x88, 0x00, 0x08,
+ 0x35, 0x03, 0x19, 0x12, 0x35, 0x00, 0xff, 0x00};
+
+unsigned char q5[] =3D {0x04, 0x88, 0x88, 0x00, 0x0c,
+ 0x12, 0x34, 0x56, 0x78, 0x00, 0xff, 0x35, 0x03,
+ 0x09, 0x00, 0x06, 0x00};
+
+unsigned char q6[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d,
+ 0x35, 0x03, 0x19, 0x11, 0x11, 0x00, 0xff, 0x35, 0x03,
+ 0x09, 0xab, 0xcd, 0x00};
+
+unsigned char q7[] =3D {0x04, 0x88, 0x88, 0x00, 0x50,
+ 0x00, 0x01, 0x00, 0x02, 0x00, 0xff, 0x35, 0x03, 0x09,
+ 0x00, 0x09, 0x00};
+
+unsigned char q8[] =3D {0x06, 0x88, 0x88, 0x00, 0x0d,
+ 0x35, 0x03, 0x09, 0x11, 0x11, 0x00, 0xff, 0x35, 0x03,
+ 0x09, 0x00, 0x09, 0x00};
+
+unsigned char q9[] =3D {0x06, 0x88, 0x88, 0x00, 0x13,
+ 0x35, 0x09, 0x19, 0x11, 0x05, 0x19, 0x00, 0x03, 0x19,
+ 0x01, 0x00, 0x00, 0xff, 0x35, 0x03, 0x09, 0x00, 0x04,
+ 0x00};
+
+unsigned char q10[] =3D {0x02, 0x88, 0x88, 0x00, 0x08,
+ 0x35, 0x03, 0x19, 0x00, 0x03, 0x00, 0x02, 0x00};
+
+unsigned char q11[] =3D {0x04, 0x88, 0x88, 0x00, 0x12,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x35, 0x09, 0x09,
+ 0x00, 0x06, 0x09, 0x00, 0x11, 0x09, 0x01, 0x00, 0x00};
+
+/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=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
+
unsigned char sdp_data_52111[] =3D { 0x02, 0x77, 0x77, 0x00, 0x08,
0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0xff,
0x00 };
@@ -241,8 +311,7 @@
0x35, 0x05, 0x0a, 0x00, 0x00, 0xff, 0xff,
0x00 };
=20
-#define UPDATA_MAXLEN 16384
-static u8 tmpdata[UPDATA_MAXLEN];
+extern u8 testdata[];
static u8 test_is_initialized =3D 0;
=20
static void
@@ -253,8 +322,8 @@
printk("Initializing Unplug Test\n");
=20
/* group data into 0xff chunks */
- for (i =3D 0; i < UPDATA_MAXLEN; i++) {
- *(tmpdata+i) =3D (u8) i%0x100;
+ for (i =3D 0; i < UPTEST_DATA_LEN; i++) {
+ *(testdata+i) =3D (u8) i%0x100;
}
test_is_initialized =3D 1;
}
@@ -304,42 +373,42 @@
{
/* client sends 10 bytes */
printk("test_2_2_1, client sends 10 bytes\n");=20
- test_send_data(testcon, tmpdata, 10);
+ test_send_data(testcon, testdata, 10);
}
=20
static void test_2_2_2(void)
{
/* client sends 350 bytes */
printk("test_2_2_2, client sends 350 bytes\n");=20
- test_send_data(testcon, tmpdata, 350);
+ test_send_data(testcon, testdata, 350);
}
=20
static void test_2_2_3(void)
{
/* client sends 672 bytes */
printk("test_2_2_3, client sends 672 bytes\n");=20
- test_send_data(testcon, tmpdata, 672);
+ test_send_data(testcon, testdata, 672);
}
=20
static void test_2_2_4(void)
{
/* server sends 10 bytes */
printk("test_2_2_4, server sends 10 bytes\n");=20
- test_send_data(testcon, tmpdata, 10);
+ test_send_data(testcon, testdata, 10);
}
=20
static void test_2_2_5(void)
{
/* server sends 350 bytes */
printk("test_2_2_5, server sends 350 bytes\n");=20
- test_send_data(testcon, tmpdata, 350);
+ test_send_data(testcon, testdata, 350);
}
=20
static void test_2_2_6(void)
{
/* server sends 672 bytes */
printk("test_2_2_6, server sends 672 bytes\n");=20
- test_send_data(testcon, tmpdata, 672);
+ test_send_data(testcon, testdata, 672);
}
=20
/*
@@ -398,14 +467,14 @@
{
/* Client sends 8192 bytes of data */
printk("Sends 8192 bytes\n");
- test_send_data(testcon, tmpdata, 8192);
+ test_send_data(testcon, testdata, 8192);
}
=20
static void test_2_5_6(void)
{
printk("Sending 4096 bytes\n");
/* Server sends 4096 bytes of data */
- test_send_data(testcon, tmpdata, 4096);
+ test_send_data(testcon, testdata, 4096);
}
=20
/*
@@ -438,25 +507,25 @@
static void test_2_8_1(void)
{
printk("Client sends 350 bytes on testcon 1\n");
- test_send_data(testcon, tmpdata, 350);
+ test_send_data(testcon, testdata, 350);
}
=20
static void test_2_8_2(void)
{
printk("Server sends 350 bytes on testcon 1\n");
- test_send_data(testcon, tmpdata, 350);
+ test_send_data(testcon, testdata, 350);
}
=20
static void test_2_8_3(void)
{
printk("Client sends 350 bytes on testcon 2\n");
- test_send_data(testcon2, tmpdata, 350);
+ test_send_data(testcon2, testdata, 350);
}
=20
static void test_2_8_4(void)
{
printk("Server sends 350 bytes on testcon 2\n");
- test_send_data(testcon2, tmpdata, 350);
+ test_send_data(testcon2, testdata, 350);
}
=20
static void test_2_9_1(void)
@@ -516,20 +585,50 @@
static void test_2_13_5(void)
{
printk("test_2_13_5, client sending 672 bytes\n");=20
- test_send_data(testcon, tmpdata, 672);=09
+ test_send_data(testcon, testdata, 672);=09
}
=20
static void test_2_13_6(void)
{
printk("test_2_13_6, server sending 672 bytes\n");=20
- test_send_data(testcon, tmpdata, 672);=09
+ test_send_data(testcon, testdata, 672);=09
}
=20
-
/*
* SDP Stuff
*/
=20
+void do_sdp_test(int n)
+{
+ unsigned char *q;
+ int q_len;
+ printk(__FUNCTION__" -- %d\n", n);
+ switch(n) {
+=09=09
+ case 101: q =3D q1_1; break;
+ case 102: q =3D q1_2; break;
+ case 2: q =3D q2; break;
+ case 301: q =3D q3_1; break;
+ case 302: q =3D q3_2; break;
+ case 4: q =3D q4; break;
+ case 5: q =3D q5; break;
+ case 6: q =3D q6; break;
+ case 7: q =3D q7; break;
+ case 8: q =3D q8; break;
+ 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;
+ }
+
+ q_len =3D q[4] + 5; /* assumes less than 255 bytes long pdu:s */
+=09
+ /* Now send the request */=20=20
+ sdp_send_data(&sdp_con_list[0], q, q_len);
+}
+
+
+
static void sdp_test_52111(void)
{
sdp_send_data(&sdp_con_list[0], sdp_data_52111, sdp_data_52111[4] + 5);
@@ -1039,7 +1138,7 @@
/* 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),tmpdata, 1024) =3D=3D 0) {
+ if (rfcomm_send_data(CREATE_RFCOMM_ID(0,4),testdata, 1024) =3D=3D 0) {
printk("Success!\n");
}
}
@@ -1367,10 +1466,6 @@
printk("test_gateway_call, sending %s\n", atd);
rfcomm_send_data(CREATE_RFCOMM_ID(0,2), atd, strlen(atd));
}
-
-/*=20
- * main switch case called from btd in process_cmd=20
- */
=20
void process_test_cmd(s32 test_case)
{
|