* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
@ 2008-07-11 6:12 pramod gurav
2008-07-11 8:43 ` Ohad Ben-Cohen
0 siblings, 1 reply; 12+ messages in thread
From: pramod gurav @ 2008-07-11 6:12 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 1628 bytes --]
Hi Ohad
Sorry to break the link.
I am working on arm platform. I want to configure TI's brf6350 on UART.
I read some of the mail on the list. I came to know that hci_ll.c provides support for brf6350.
Is the hci lower level support in kernel enough to drive the chip?
What else I have to do at kernel side to bring UP my brf6350?
Where would I get the brf script file for my chip?
Your response is much awaited.
Thanks and Best regards
Pramod
----- Original Message ----
From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Sent: Thursday, 10 July, 2008 6:03:23 PM
Subject: Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
Hi Ohad,
> > please put all the TI code into hciattach_ti.c and then I gonna apply
> > this patch.
>
> I'm gonna have to put some common definitions in hciattach.h then
> (mainly struct uart_t).
>
> Is that ok ?
no. Do the same as I did for hciattach_st.c
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/
[-- Attachment #1.2: Type: text/html, Size: 2526 bytes --]
[-- Attachment #2: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 6:12 [Bluez-devel] [PATCH] Add support for Texas Instruments' chips pramod gurav
@ 2008-07-11 8:43 ` Ohad Ben-Cohen
0 siblings, 0 replies; 12+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-11 8:43 UTC (permalink / raw)
To: pramod gurav, BlueZ development; +Cc: brflinux-devel
Hi Pramod,
On Fri, Jul 11, 2008 at 9:12 AM, pramod gurav
<pramod_gurav_etc@yahoo.co.in> wrote:
> Hi Ohad
> Sorry to break the link.
> I am working on arm platform. I want to configure TI's brf6350 on UART.
> I read some of the mail on the list. I came to know that hci_ll.c provides
> support for brf6350.
> Is the hci lower level support in kernel enough to drive the chip?
Yes.
> What else I have to do at kernel side to bring UP my brf6350?
In general, if you are using 2.6.24 or higher, you don't need to do anything.
Otherwise, you will have to patch it with the HCILL patch.
That said, there are additional power management features we wrote for
the OMAP platform (e.g., the chip can wake up the host on Bluetooth
acitivity).
If you're interested in those patches, take a look at
http://brflinux.sourceforge.net/.
> Where would I get the brf script file for my chip?
That depends on the chip version and several decisions you should make.
We have a dedicated mailing list for that - please write to
brflinux-devel@lists.sourceforge.net for further assistance.
(you can subscribe to the list at
https://lists.sourceforge.net/lists/listinfo/brflinux-devel)
Best Regards,
Ohad.
>
> Your response is much awaited.
> Thanks and Best regards
>
> Pramod
>
> ----- Original Message ----
> From: Marcel Holtmann <marcel@holtmann.org>
> To: BlueZ development <bluez-devel@lists.sourceforge.net>
> Sent: Thursday, 10 July, 2008 6:03:23 PM
> Subject: Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
>
> Hi Ohad,
>
>> > please put all the TI code into hciattach_ti.c and then I gonna apply
>> > this patch.
>>
>> I'm gonna have to put some common definitions in hciattach.h then
>> (mainly struct uart_t).
>>
>> Is that ok ?
>
> no. Do the same as I did for hciattach_st.c
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
> ________________________________
> From Chandigarh to Chennai - find friends all over India. Click here.
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
@ 2008-07-03 10:02 Ben-cohen, Ohad
2008-07-10 4:07 ` Marcel Holtmann
0 siblings, 1 reply; 12+ messages in thread
From: Ben-cohen, Ohad @ 2008-07-03 10:02 UTC (permalink / raw)
To: bluez-devel@lists.sourceforge.net
[-- Attachment #1: Type: text/plain, Size: 35 bytes --]
See attached.
Thanks,
Ohad.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Texas-Instruments-support.patch --]
[-- Type: text/x-diff; name="0001-Texas-Instruments-support.patch", Size: 19787 bytes --]
From d3662c48c59cc3a15c10c2a73a003583969ab34a Mon Sep 17 00:00:00 2001
From: Ohad <ohad@muesli.(none)>
Date: Thu, 3 Jul 2008 12:54:30 +0300
Subject: [PATCH] Texas Instruments support
---
utils/tools/hciattach.c | 526 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 491 insertions(+), 35 deletions(-)
diff --git a/utils/tools/hciattach.c b/utils/tools/hciattach.c
index 36f3c72..71ea5be 100644
--- a/utils/tools/hciattach.c
+++ b/utils/tools/hciattach.c
@@ -42,6 +42,7 @@
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <linux/types.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
@@ -59,17 +60,26 @@
#define HCI_UART_BCSP 1
#define HCI_UART_3WIRE 2
#define HCI_UART_H4DS 3
+#define HCI_UART_LL 4
+
+#ifdef HCIATTACH_DEBUG
+#define DPRINTF(x...) printf(x)
+#else
+#define DPRINTF(x...)
+#endif
struct uart_t {
char *type;
int m_id;
int p_id;
int proto;
+ __u16 device_param;
int init_speed;
int speed;
int flags;
char *bdaddr;
int (*init) (int fd, struct uart_t *u, struct termios *ti);
+ int (*init_post) (int fd, struct uart_t *u, struct termios *ti);
};
#define FLOW_CTL 0x0001
@@ -287,11 +297,439 @@ static int digi(int fd, struct uart_t *u, struct termios *ti)
return 0;
}
+#ifndef MAKEWORD
+#define MAKEWORD(a, b) ((__u16)(((__u8)(a)) | ((__u16)((__u8)(b))) << 8))
+#endif
+
+#define TI_MANUFACTURER_ID 13
+
+#define FIRMWARE_DIRECTORY "/lib/firmware/"
+
+#define ACTION_SEND_COMMAND 1
+#define ACTION_WAIT_EVENT 2
+#define ACTION_SERIAL 3
+#define ACTION_DELAY 4
+#define ACTION_RUN_SCRIPT 5
+#define ACTION_REMARKS 6
+
+#define BRF_DEEP_SLEEP_OPCODE_BYTE_1 0x0c
+#define BRF_DEEP_SLEEP_OPCODE_BYTE_2 0xfd
+#define BRF_DEEP_SLEEP_OPCODE \
+ (BRF_DEEP_SLEEP_OPCODE_BYTE_1 |(BRF_DEEP_SLEEP_OPCODE_BYTE_2 << 8))
+
+#define FILE_HEADER_MAGIC 0x42535442
+
+/*
+ * BRF Firmware header
+ */
+struct bts_header {
+ __u32 magic;
+ __u32 version;
+ __u8 future[24];
+ __u8 actions[0];
+}__attribute__ ((packed));
+
+/*
+ * BRF Actions structure
+ */
+struct bts_action {
+ __u16 type;
+ __u16 size;
+ __u8 data[0];
+} __attribute__ ((packed));
+
+struct bts_action_send
+{
+ __u8 data[0];
+} __attribute__ ((packed));
+
+struct bts_action_wait
+{
+ __u32 msec;
+ __u32 size;
+ __u8 data[0];
+}__attribute__ ((packed));
+
+struct bts_action_delay
+{
+ __u32 msec;
+}__attribute__ ((packed));
+
+struct bts_action_serial
+{
+ __u32 baud;
+ __u32 flow_control;
+}__attribute__ ((packed));
+
+FILE *bts_load_script(const char* file_name, __u32* version)
+{
+ struct bts_header header;
+ FILE* fp;
+
+ fp = fopen(file_name, "rb");
+ if (!fp) {
+ perror("can't open firmware file");
+ goto out;
+ }
+
+ if (1 != fread(&header, sizeof(struct bts_header), 1, fp)) {
+ perror("can't read firmware file");
+ goto errclose;
+ }
+
+ if (header.magic != FILE_HEADER_MAGIC) {
+ fprintf(stderr, "%s not a legal TI firmware file\n", file_name);
+ goto errclose;
+ }
+
+ if (NULL != version)
+ *version = header.version;
+
+ goto out;
+
+errclose:
+ fclose(fp);
+ fp = NULL;
+out:
+ return fp;
+}
+
+unsigned long bts_fetch_action(FILE* fp,
+ unsigned char* action_buf,
+ unsigned long buf_size,
+ __u16* action_type)
+{
+ struct bts_action action_hdr;
+ unsigned long nread;
+
+ if (!fp)
+ return 0;
+
+ if (1 != fread(&action_hdr, sizeof(struct bts_action), 1, fp))
+ return 0;
+
+ if (action_hdr.size > buf_size) {
+ fprintf(stderr, "bts_next_action: not enough space to read next action\n");
+ return 0;
+ }
+
+ nread = fread(action_buf, sizeof(__u8), action_hdr.size, fp);
+ if (nread != (action_hdr.size)) {
+ fprintf(stderr, "bts_next_action: fread failed to read next action\n");
+ return 0;
+ }
+
+ *action_type = action_hdr.type;
+
+ return nread * sizeof(__u8);
+}
+
+void bts_unload_script(FILE* fp)
+{
+ if (fp)
+ fclose(fp);
+}
+
+int is_it_texas(const __u8 *respond)
+{
+ __u16 manufacturer_id;
+
+ manufacturer_id = MAKEWORD(respond[11], respond[12]);
+
+ return TI_MANUFACTURER_ID == manufacturer_id ? 1 : 0;
+}
+
+const char *get_firmware_name(const __u8 *respond)
+{
+ static char firmware_file_name[PATH_MAX] = {0};
+ __u16 version = 0, chip = 0, min_ver = 0, maj_ver = 0;
+
+ version = MAKEWORD(respond[13], respond[14]);
+ chip = (version & 0x7C00) >> 10;
+ min_ver = (version & 0x007F);
+ maj_ver = (version & 0x0380) >> 7;
+
+ if (version & 0x8000)
+ maj_ver |= 0x0008;
+
+ sprintf(firmware_file_name, FIRMWARE_DIRECTORY "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver);
+
+ return firmware_file_name;
+}
+
+static void brf_delay(struct bts_action_delay *delay)
+{
+ usleep(1000*delay->msec);
+}
+
+static int brf_set_serial_params(struct bts_action_serial *serial_action,
+ int fd,
+ struct uart_t *u,
+ struct termios *ti)
+{
+ fprintf(stderr, "texas: changing baud rate to %u, flow control to %u\n",
+ serial_action->baud, serial_action->flow_control );
+ tcflush(fd, TCIOFLUSH);
+
+ if (serial_action->flow_control)
+ ti->c_cflag |= CRTSCTS;
+ else
+ ti->c_cflag &= ~CRTSCTS;
+
+ if (tcsetattr(fd, TCSANOW, ti) < 0) {
+ perror("Can't set port settings");
+ return -1;
+ }
+
+ u->speed = serial_action->baud;
+
+ tcflush(fd, TCIOFLUSH);
+
+ if (set_speed(fd, ti, serial_action->baud) < 0) {
+ perror("Can't set baud rate");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int brf_send_command_socket(int fd, struct bts_action_send* send_action)
+{
+ char response[1024] = {0};
+ hci_command_hdr *cmd = (hci_command_hdr *) send_action->data;
+ uint16_t opcode = cmd->opcode;
+
+ struct hci_request rq;
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = cmd_opcode_ogf(opcode);
+ rq.ocf = cmd_opcode_ocf(opcode);
+ rq.event = EVT_CMD_COMPLETE;
+ rq.cparam = &send_action->data[3];
+ rq.clen = send_action->data[2];
+ rq.rparam = response;
+ rq.rlen = sizeof(response);
+
+ if (hci_send_req(fd, &rq, 15) < 0) {
+ perror("Cannot send hci command to socket");
+ return -1;
+ }
+
+ /* verify success */
+ if (response[0]) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
+static int brf_send_command_file(int fd, struct bts_action_send* send_action, long size)
+{
+ unsigned char response[1024] = {0};
+ long ret = 0;
+
+ /* send command */
+ if (size != write(fd, send_action, size)) {
+ perror("Texas: Failed to write action command");
+ return -1;
+ }
+
+ /* read response */
+ ret = read_hci_event(fd, response, sizeof(response));
+ if (ret < 0) {
+ perror("texas: failed to read command response");
+ return -1;
+ }
+
+ /* verify success */
+ if (ret < 7 || 0 != response[6]) {
+ fprintf( stderr, "TI init command failed.\n" );
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int brf_send_command(int fd, struct bts_action_send* send_action, long size, int hcill_installed)
+{
+ int ret = 0;
+ char *fixed_action;
+
+ /* remove packet type when giving to socket API */
+ if (hcill_installed) {
+ fixed_action = ((char *) send_action) + 1;
+ ret = brf_send_command_socket(fd, (struct bts_action_send *) fixed_action);
+ } else {
+ ret = brf_send_command_file(fd, send_action, size);
+ }
+
+ return ret;
+}
+
+static int brf_do_action( __u16 brf_type, __u8 *brf_action,
+ long brf_size, int fd,
+ struct uart_t *u, struct termios *ti,
+ int hcill_installed)
+{
+ int ret = 0;
+
+ switch (brf_type) {
+ case ACTION_SEND_COMMAND:
+ DPRINTF("W");
+ ret = brf_send_command(fd, (struct bts_action_send*) brf_action, brf_size, hcill_installed);
+ break;
+ case ACTION_WAIT_EVENT:
+ DPRINTF("R");
+ break;
+ case ACTION_SERIAL:
+ DPRINTF("S");
+ ret = brf_set_serial_params((struct bts_action_serial *) brf_action, fd, u, ti);
+ break;
+ case ACTION_DELAY:
+ DPRINTF("D");
+ brf_delay((struct bts_action_delay *) brf_action);
+ break;
+ case ACTION_REMARKS:
+ DPRINTF("C");
+ break;
+ default:
+ fprintf(stderr, "brf_init: unknown firmware action type (%d)\n", brf_type);
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * tests whether a given brf action is a HCI_VS_Sleep_Mode_Configurations cmd
+ */
+static int brf_action_is_deep_sleep(struct uart_t *u, __u8 *brf_action, long brf_size, __u16 brf_type)
+{
+ __u16 opcode;
+
+ if (brf_type != ACTION_SEND_COMMAND)
+ return 0;
+
+ if (brf_size < 3)
+ return 0;
+
+ if (brf_action[0] != HCI_COMMAND_PKT)
+ return 0;
+
+ /* HCI data is little endian */
+ opcode = brf_action[1] | (brf_action[2] << 8);
+
+ if (opcode != u->device_param)
+ return 0;
+
+ /* action is deep sleep configuration command ! */
+ return 1;
+}
+
+/*
+ * This function is called twice.
+ * The first time it is called, it loads the brf script, and executes its
+ * commands until it reaches a deep sleep command (or its end).
+ * The second time it is called, it assumes HCILL protocol is set up,
+ * and sends rest of brf script via the supplied socket.
+ */
+int brf_do_script(int fd, struct uart_t *u, struct termios *ti, const char *bts_file)
+{
+ int ret = 0, hcill_installed = bts_file ? 0 : 1;
+ __u32 vers;
+ static FILE *brf_script_file = NULL;
+ static __u8 brf_action[256];
+ static long brf_size;
+ static __u16 brf_type;
+
+ /* is it the first time we are called ? */
+ if (0 == hcill_installed) {
+ DPRINTF("Sending script to serial device\n");
+ brf_script_file = bts_load_script(bts_file, &vers );
+ if (!brf_script_file) {
+ fprintf(stderr, "Warning: cannot find BTS file: %s\n",
+ bts_file);
+ return 0;
+ }
+
+ fprintf( stderr, "Loaded BTS script version %u\n", vers );
+
+ brf_size = bts_fetch_action( brf_script_file,
+ brf_action,
+ sizeof(brf_action),
+ &brf_type );
+ if (brf_size == 0) {
+ fprintf(stderr, "Warning: BTS file is empty !");
+ return 0;
+ }
+ }
+ else {
+ DPRINTF("Sending script to bluetooth socket\n");
+ }
+
+ /* execute current action and continue to parse brf script file */
+ while (brf_size != 0) {
+ ret = brf_do_action( brf_type, brf_action, brf_size,
+ fd, u, ti, hcill_installed);
+ if (ret == -1)
+ break;
+
+ brf_size = bts_fetch_action( brf_script_file,
+ brf_action,
+ sizeof(brf_action),
+ &brf_type );
+
+ /* if this is the first time we run (no HCILL yet) */
+ /* and a deep sleep command is encountered */
+ /* we exit */
+ if ( 0 == hcill_installed &&
+ brf_action_is_deep_sleep(u, brf_action,
+ brf_size, brf_type))
+ return 0;
+ }
+
+ bts_unload_script(brf_script_file);
+ brf_script_file = NULL;
+ DPRINTF("\n");
+
+ return ret;
+}
+
+static int texas_continue_script(int fd, struct uart_t *u, struct termios *ti)
+{
+ int dev_id, dd, ret = 0;
+
+ sleep(1);
+
+ dev_id = ioctl(fd, HCIUARTGETDEVICE, 0);
+ if (dev_id < 0) {
+ perror("cannot get device id");
+ return -1;
+ }
+
+ DPRINTF("\nAdded device hci%d\n", dev_id);
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ perror("HCI device open failed");
+ return -1;
+ }
+
+ ret = brf_do_script(dd, u, ti, NULL);
+
+ hci_close_dev(dd);
+
+ return ret;
+}
+
static int texas(int fd, struct uart_t *u, struct termios *ti)
{
struct timespec tm = {0, 50000};
char cmd[4];
unsigned char resp[100]; /* Response */
+ const char *bts_file;
int n;
memset(resp,'\0', 100);
@@ -327,17 +765,20 @@ static int texas(int fd, struct uart_t *u, struct termios *ti)
} while (resp[4] != cmd[1] && resp[5] != cmd[2]);
/* Verify manufacturer */
- if ((resp[11] & 0xFF) != 0x0d)
- fprintf(stderr,"WARNING : module's manufacturer is not Texas Instrument\n");
+ if (! is_it_texas(resp)) {
+ fprintf(stderr,"ERROR: module's manufacturer is not Texas Instruments\n");
+ return -1;
+ }
- /* Print LMP version */
- fprintf(stderr, "Texas module LMP version : 0x%02x\n", resp[10] & 0xFF);
+ fprintf(stderr, "Found a Texas Instruments' chip!\n");
- /* Print LMP subversion */
- fprintf(stderr, "Texas module LMP sub-version : 0x%02x%02x\n", resp[14] & 0xFF, resp[13] & 0xFF);
+ bts_file = get_firmware_name(resp);
+ fprintf(stderr, "Firmware file : %s\n", bts_file);
+
+ n = brf_do_script( fd, u, ti, bts_file);
nanosleep(&tm, NULL);
- return 0;
+ return n;
}
static int read_check(int fd, void *buf, int count)
@@ -1050,69 +1491,71 @@ static int bcm2035(int fd, struct uart_t *u, struct termios *ti)
}
struct uart_t uart[] = {
- { "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
- { "ericsson", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, FLOW_CTL, NULL, ericsson },
- { "digi", 0x0000, 0x0000, HCI_UART_H4, 9600, 115200, FLOW_CTL, NULL, digi },
- { "texas", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, texas },
+ { "any", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, NULL, NULL },
+ { "ericsson", 0x0000, 0x0000, HCI_UART_H4, 0, 57600, 115200, FLOW_CTL, NULL, ericsson, NULL },
+ { "digi", 0x0000, 0x0000, HCI_UART_H4, 0, 9600, 115200, FLOW_CTL, NULL, digi, NULL },
+
+ /* Texas Instruments Bluelink (BRF) modules */
+ { "texas", 0x0000, 0x0000, HCI_UART_LL, BRF_DEEP_SLEEP_OPCODE, 115200, 115200, FLOW_CTL, NULL, texas, texas_continue_script },
- { "bcsp", 0x0000, 0x0000, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "bcsp", 0x0000, 0x0000, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* Xircom PCMCIA cards: Credit Card Adapter and Real Port Adapter */
- { "xircom", 0x0105, 0x080a, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
+ { "xircom", 0x0105, 0x080a, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, NULL, NULL },
/* CSR Casira serial adapter or BrainBoxes serial dongle (BL642) */
- { "csr", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, csr },
+ { "csr", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, csr, NULL },
/* BrainBoxes PCMCIA card (BL620) */
- { "bboxes", 0x0160, 0x0002, HCI_UART_H4, 115200, 460800, FLOW_CTL, NULL, csr },
+ { "bboxes", 0x0160, 0x0002, HCI_UART_H4, 0, 115200, 460800, FLOW_CTL, NULL, csr, NULL },
/* Silicon Wave kits */
- { "swave", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, swave },
+ { "swave", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, swave, NULL },
/* ST Microelectronics minikits based on STLC2410/STLC2415 */
- { "st", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, FLOW_CTL, NULL, st },
+ { "st", 0x0000, 0x0000, HCI_UART_H4, 0, 57600, 115200, FLOW_CTL, NULL, st, NULL },
/* ST Microelectronics minikits based on STLC2500 */
- { "stlc2500", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, "00:80:E1:00:AB:BA", stlc2500 },
+ { "stlc2500", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, "00:80:E1:00:AB:BA", stlc2500, NULL },
/* Philips generic Ericsson IP core based */
- { "philips", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
+ { "philips", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, NULL, NULL },
/* Philips BGB2xx Module */
- { "bgb2xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, "BD:B2:10:00:AB:BA", bgb2xx },
+ { "bgb2xx", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, "BD:B2:10:00:AB:BA", bgb2xx, NULL },
/* Sphinx Electronics PICO Card */
- { "picocard", 0x025e, 0x1000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
+ { "picocard", 0x025e, 0x1000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, NULL, NULL },
/* Inventel BlueBird Module */
- { "inventel", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
+ { "inventel", 0x0000, 0x0000, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, NULL, NULL },
/* COM One Platinium Bluetooth PC Card */
- { "comone", 0xffff, 0x0101, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "comone", 0xffff, 0x0101, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* TDK Bluetooth PC Card and IBM Bluetooth PC Card II */
- { "tdk", 0x0105, 0x4254, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "tdk", 0x0105, 0x4254, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* Socket Bluetooth CF Card (Rev G) */
- { "socket", 0x0104, 0x0096, HCI_UART_BCSP, 230400, 230400, 0, NULL, bcsp },
+ { "socket", 0x0104, 0x0096, HCI_UART_BCSP, 0, 230400, 230400, 0, NULL, bcsp, NULL },
/* 3Com Bluetooth Card (Version 3.0) */
- { "3com", 0x0101, 0x0041, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, csr },
+ { "3com", 0x0101, 0x0041, HCI_UART_H4, 0, 115200, 115200, FLOW_CTL, NULL, csr, NULL },
/* AmbiCom BT2000C Bluetooth PC/CF Card */
- { "bt2000c", 0x022d, 0x2000, HCI_UART_H4, 57600, 460800, FLOW_CTL, NULL, csr },
+ { "bt2000c", 0x022d, 0x2000, HCI_UART_H4, 0, 57600, 460800, FLOW_CTL, NULL, csr, NULL },
/* Zoom Bluetooth PCMCIA Card */
- { "zoom", 0x0279, 0x950b, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "zoom", 0x0279, 0x950b, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* Sitecom CN-504 PCMCIA Card */
- { "sitecom", 0x0279, 0x950b, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "sitecom", 0x0279, 0x950b, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* Billionton PCBTC1 PCMCIA Card */
- { "billionton", 0x0279, 0x950b, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
+ { "billionton", 0x0279, 0x950b, HCI_UART_BCSP, 0, 115200, 115200, 0, NULL, bcsp, NULL },
/* Broadcom BCM2035 */
- { "bcm2035", 0x0A5C, 0x2035, HCI_UART_H4, 115200, 460800, FLOW_CTL, NULL, bcm2035 },
+ { "bcm2035", 0x0A5C, 0x2035, HCI_UART_H4, 0, 115200, 115200, 0, NULL, bcm2035, NULL },
{ NULL, 0 }
};
@@ -1205,6 +1648,9 @@ int init_uart(char *dev, struct uart_t *u, int send_break)
return -1;
}
+ if (u->init_post && u->init_post(fd, u, &ti) < 0)
+ return -1;
+
return fd;
}
@@ -1212,7 +1658,7 @@ static void usage(void)
{
printf("hciattach - HCI UART driver initialization utility\n");
printf("Usage:\n");
- printf("\thciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]\n");
+ printf("\thciattach [-n] [-p] [-b] [-g device_param] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]\n");
printf("\thciattach -l\n");
}
@@ -1220,8 +1666,9 @@ int main(int argc, char *argv[])
{
struct uart_t *u = NULL;
int detach, printpid, opt, i, n, ld, err;
- int to = 5;
+ int to = 10;
int init_speed = 0;
+ __u16 device_param = 0;
int send_break = 0;
pid_t pid;
struct sigaction sa;
@@ -1231,7 +1678,7 @@ int main(int argc, char *argv[])
detach = 1;
printpid = 0;
- while ((opt=getopt(argc, argv, "bnpt:s:l")) != EOF) {
+ while ((opt=getopt(argc, argv, "bnpt:g:s:l")) != EOF) {
switch(opt) {
case 'b':
send_break = 1;
@@ -1249,6 +1696,10 @@ int main(int argc, char *argv[])
to = atoi(optarg);
break;
+ case 'g':
+ device_param = (__u16)strtol(optarg, NULL, 16);
+ break;
+
case 's':
init_speed = atoi(optarg);
break;
@@ -1328,12 +1779,17 @@ int main(int argc, char *argv[])
if (init_speed)
u->init_speed = init_speed;
+ /* If user specified a device parameter, use that instead of
+ the hardware's default */
+ if (device_param)
+ u->device_param = device_param;
+
memset(&sa, 0, sizeof(sa));
sa.sa_flags = SA_NOCLDSTOP;
sa.sa_handler = sig_alarm;
sigaction(SIGALRM, &sa, NULL);
- /* 5 seconds should be enough for initialization */
+ /* 10 seconds should be enough for initialization */
alarm(to);
n = init_uart(dev, u, send_break);
--
1.5.4.3
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-03 10:02 Ben-cohen, Ohad
@ 2008-07-10 4:07 ` Marcel Holtmann
2008-07-10 5:36 ` Ohad Ben-Cohen
0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-07-10 4:07 UTC (permalink / raw)
To: BlueZ development
Hi Ohad,
> See attached.
please put all the TI code into hciattach_ti.c and then I gonna apply
this patch.
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-10 4:07 ` Marcel Holtmann
@ 2008-07-10 5:36 ` Ohad Ben-Cohen
2008-07-10 12:33 ` Marcel Holtmann
2008-07-11 6:14 ` Marcel Holtmann
0 siblings, 2 replies; 12+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-10 5:36 UTC (permalink / raw)
To: BlueZ development
Hi Marcel,
On Thu, Jul 10, 2008 at 7:07 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> please put all the TI code into hciattach_ti.c and then I gonna apply
> this patch.
I'm gonna have to put some common definitions in hciattach.h then
(mainly struct uart_t).
Is that ok ?
(you previously objected to the creation of hciattach.h)
Thanks,
Ohad.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-10 5:36 ` Ohad Ben-Cohen
@ 2008-07-10 12:33 ` Marcel Holtmann
2008-07-11 6:14 ` Marcel Holtmann
1 sibling, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2008-07-10 12:33 UTC (permalink / raw)
To: BlueZ development
Hi Ohad,
> > please put all the TI code into hciattach_ti.c and then I gonna apply
> > this patch.
>
> I'm gonna have to put some common definitions in hciattach.h then
> (mainly struct uart_t).
>
> Is that ok ?
no. Do the same as I did for hciattach_st.c
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-10 5:36 ` Ohad Ben-Cohen
2008-07-10 12:33 ` Marcel Holtmann
@ 2008-07-11 6:14 ` Marcel Holtmann
2008-07-11 8:21 ` Ben-cohen, Ohad
1 sibling, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-07-11 6:14 UTC (permalink / raw)
To: BlueZ development
Hi Ohad,
> > please put all the TI code into hciattach_ti.c and then I gonna apply
> > this patch.
>
> I'm gonna have to put some common definitions in hciattach.h then
> (mainly struct uart_t).
I did the hard work and put this into CVS as I see it should be done.
Please double check if that is working for you.
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 6:14 ` Marcel Holtmann
@ 2008-07-11 8:21 ` Ben-cohen, Ohad
2008-07-11 8:37 ` Marcel Holtmann
0 siblings, 1 reply; 12+ messages in thread
From: Ben-cohen, Ohad @ 2008-07-11 8:21 UTC (permalink / raw)
To: BlueZ development
Hi Marcel,
> I did the hard work and put this into CVS as I see it should be done.
> Please double check if that is working for you.
It is.
One note: you took away TI's Copyright line and I don't think lawyers here will like that. Can you please add it back ?
Thank you for your work!
Ohad.
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 8:21 ` Ben-cohen, Ohad
@ 2008-07-11 8:37 ` Marcel Holtmann
2008-07-11 8:38 ` Ohad Ben-Cohen
0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-07-11 8:37 UTC (permalink / raw)
To: BlueZ development
Hi Ohad,
> > I did the hard work and put this into CVS as I see it should be done.
> > Please double check if that is working for you.
>
> It is.
good.
> One note: you took away TI's Copyright line and I don't think lawyers here will like that. Can you please add it back ?
No I didn't. You sent it without any copyright note. Please check your
original patch.
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 8:37 ` Marcel Holtmann
@ 2008-07-11 8:38 ` Ohad Ben-Cohen
2008-07-11 8:50 ` Marcel Holtmann
0 siblings, 1 reply; 12+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-11 8:38 UTC (permalink / raw)
To: BlueZ development
Hi Marcel,
On Fri, Jul 11, 2008 at 11:37 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> No I didn't. You sent it without any copyright note. Please check your
> original patch.
You are right, it was only on my second patch with the separate
hciattach_ti.c file.
Can you please add:
Copyright (C) 2007-2008 Texas Instruments, Inc.
to the hciattach_ti.c file ?
Thanks,
Ohad.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 8:38 ` Ohad Ben-Cohen
@ 2008-07-11 8:50 ` Marcel Holtmann
2008-07-11 8:52 ` Ohad Ben-Cohen
0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2008-07-11 8:50 UTC (permalink / raw)
To: BlueZ development
Hi Ohad,
> On Fri, Jul 11, 2008 at 11:37 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> > No I didn't. You sent it without any copyright note. Please check your
> > original patch.
>
> You are right, it was only on my second patch with the separate
> hciattach_ti.c file.
> Can you please add:
>
> Copyright (C) 2007-2008 Texas Instruments, Inc.
>
> to the hciattach_ti.c file ?
done.
Regards
Marcel
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] [PATCH] Add support for Texas Instruments' chips
2008-07-11 8:50 ` Marcel Holtmann
@ 2008-07-11 8:52 ` Ohad Ben-Cohen
0 siblings, 0 replies; 12+ messages in thread
From: Ohad Ben-Cohen @ 2008-07-11 8:52 UTC (permalink / raw)
To: BlueZ development
On Fri, Jul 11, 2008 at 11:50 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> done.
Marcel, thank you for your work.
BR,
Ohad.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-07-11 8:52 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11 6:12 [Bluez-devel] [PATCH] Add support for Texas Instruments' chips pramod gurav
2008-07-11 8:43 ` Ohad Ben-Cohen
-- strict thread matches above, loose matches on Subject: below --
2008-07-03 10:02 Ben-cohen, Ohad
2008-07-10 4:07 ` Marcel Holtmann
2008-07-10 5:36 ` Ohad Ben-Cohen
2008-07-10 12:33 ` Marcel Holtmann
2008-07-11 6:14 ` Marcel Holtmann
2008-07-11 8:21 ` Ben-cohen, Ohad
2008-07-11 8:37 ` Marcel Holtmann
2008-07-11 8:38 ` Ohad Ben-Cohen
2008-07-11 8:50 ` Marcel Holtmann
2008-07-11 8:52 ` Ohad Ben-Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox