Skip to contentSkip to conversation

add support for Texas Instruments' BRF63xx chips

PATCH In review Ohad Ben-Cohen 2 participants 2 messages Apr 30, 2007 – May 4, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add support for Texas Instruments' BRF63xx chips

Introduces initializing procedures for Texas Instruments' BRF63xx chips. These procedures take care of:
1. Loading TI's init script
2. Setting up HCILL, TI's runtime power-management UART protocol

An additional, tiny feature, which proved useful for stress checkings, is added to l2test: random delays.

The patch is against the current CVS tree of bluez-utils.

---
 test/l2test.c        |   22 +++-
 tools/Makefile.am    |    2 +-
 tools/hciattach.8    |    3 +
 tools/hciattach.c    |  154 ++++++++++++---------
 tools/hciattach.h    |   73 ++++++++++
 tools/hciattach_ti.c |  382 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/hciattach_ti.h |  107 ++++++++++++++
 7 files changed, 673 insertions(+), 70 deletions(-)
 create mode 100644 tools/hciattach.h
 create mode 100644 tools/hciattach_ti.c
 create mode 100644 tools/hciattach_ti.h
test/l2test.c +19 -3
index 733c052..08745f1 100644
@@ -84,6 +84,9 @@ static int count = 1;
 /* Default delay after sending count number of frames */
 static unsigned long delay = 0;
 
+/* Default delay random switch  (0 is off, else is on) */
+static int random_delay = 0;
+
 static char *filename = NULL;
 
 static int flowctl = 0;
@@ -580,10 +583,16 @@ static void recv_mode(int sk)
 	}
 }
 
+static double double_random(void)
+{
+	return ((double)rand())/((double)RAND_MAX);
+}
+
 static void do_send(int sk)
 {
 	uint32_t seq;
 	int i, fd, len;
+	unsigned long tmp_delay;
 
 	syslog(LOG_INFO, "Sending ...");
 
@@ -615,8 +624,10 @@ static void do_send(int sk)
 			exit(1);
 		}
 
-		if (num_frames && delay && count && !(seq % count))
-			usleep(delay);
+		if (num_frames && delay && count && !(seq % count)) {
+			tmp_delay = random_delay?delay*double_random():delay;
+			usleep(tmp_delay);
+		}
 	}
 }
 
@@ -814,6 +825,7 @@ static void usage(void)
 		"\t[-N num] send num frames (default = infinite)\n"
 		"\t[-C num] send num frames before delay (default = 1)\n"
 		"\t[-D milliseconds] delay after sending num frames (default = 0)\n"
+		"\t[-Z] random delay between 0 to the value that is set using -D\n"
 		"\t[-R] reliable mode\n"
 		"\t[-G] use connectionless channel (datagram)\n"
 		"\t[-F] enable flow control\n"
@@ -830,7 +842,7 @@ int main(int argc, char *argv[])
 
 	bacpy(&bdaddr, BDADDR_ANY);
 
-	while ((opt=getopt(argc,argv,"rdscuwmnxyzb:i:P:I:O:B:N:L:C:D:RGFAESM")) != EOF) {
+	while ((opt=getopt(argc,argv,"rdscuwmnxyzb:i:P:I:O:B:N:L:C:D:ZRGFAESM")) != EOF) {
 		switch(opt) {
 		case 'r':
 			mode = RECV;
@@ -953,6 +965,10 @@ int main(int argc, char *argv[])
 			socktype = SOCK_DGRAM;
 			break;
 
+		case 'Z':
+			random_delay = 1;
+			break;
+
 		default:
 			usage();
 			exit(1);
tools/Makefile.am +1 -1
index 0ebb351..75142da 100644
@@ -37,7 +37,7 @@ bin_PROGRAMS = hcitool l2ping sdptool ciptool $(dfutool_programs)
 
 noinst_PROGRAMS = hcisecfilter ppporc
 
-hciattach_SOURCES = hciattach.c hciattach_st.c
+hciattach_SOURCES = hciattach.c hciattach_st.c hciattach_ti.c
 hciattach_LDADD = @BLUEZ_LIBS@
 
 hciconfig_SOURCES = hciconfig.c csr.h csr.c
tools/hciattach.8 +3 -0
index f9d295e..62f773f 100644
@@ -69,6 +69,9 @@ Silicon Wave kits
 .TP
 .B bcsp
 Serial adapters using CSR chips with BCSP serial protocol
+.TP
+.B texas
+Texas Instruments' BRF 63xx chips with HCILL serial protocol
 .RE
 
 Supported IDs are (manufacturer id, product id)
tools/hciattach.c +88 -66

287 lines not on this page · raw message

tools/hciattach.h new file +73 -0

73 lines not on this page · raw message

tools/hciattach_ti.c new file +382 -0

382 lines not on this page · raw message

tools/hciattach_ti.h new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
1.5.0.6
maintainer
#1 lore raw

Hi Ohad,

Quoted 4 lines

Introduces initializing procedures for Texas Instruments' BRF63xx chips. These procedures take care of:
1. Loading TI's init script
2. Setting up HCILL, TI's runtime power-management UART protocol

patch looks good, but needs some major cleanups. Especially the header file stuff needs fixing. However without hardware to test this with, I am not going to touch it.

Quoted 2 lines

An additional, tiny feature, which proved useful for stress checkings, is added to l2test: random delays.

Please never combine totally unrelated things into one big patch. This needs to be a separate patch.

Regards

Marcel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel