Skip to content
Browse files

Bluetooth: add Qualcomm In-Band Sleep support

This adds "qualcomm-ibs" to the supported controller types list
and claims HCI UART protocol number 5 for it. This corresponds the
kernel tty line discipline configured as HCI_UART_IBS, which
supports Qualcomm's Software In-Band Sleep protocol.

Change-Id: Ie6f568833db76e234d3bed89f9d4b06a005e3d30
  • Loading branch information...
1 parent bdd4b23 commit 1b5f1e7edc0a8af4d62e6255a4fd62ac4e02a635 Ankit Verma committed with Whitehawkx Nov 16, 2011
Showing with 41 additions and 5 deletions.
  1. +37 −2 tools/hciattach.c
  2. +4 −3 tools/hciattach.h
View
39 tools/hciattach.c
@@ -2,10 +2,9 @@
*
* BlueZ - Bluetooth protocol stack for Linux
*
- * Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
- *
+ * Copyright (C) 2000-2001, 2010, 2011 Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1034,6 +1033,39 @@ static int bcm2035(int fd, struct uart_t *u, struct termios *ti)
return 0;
}
+static int qcom_uart_init(int fd, struct uart_t *u, struct termios *ti)
+{
+ int flags = 0;
+
+ if (ioctl(fd, TIOCMGET, &flags) < 0){
+ perror("TIOCMGET failed in init \n");
+ return -1;
+ }
+ flags &= ~TIOCM_RTS;
+ if (ioctl(fd, TIOCMSET, &flags) < 0){
+ perror("TIOCMSET failed in init: HW Flow-off error \n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int qcom_uart_post(int fd, struct uart_t *u, struct termios *ti)
+{
+ int flags = 0;
+
+ if (ioctl(fd, TIOCMGET, &flags) < 0){
+ perror("TIOCMGET failed in post \n");
+ return -1;
+ }
+ flags &= ~TIOCM_RTS;
+ if (ioctl(fd, TIOCMSET, &flags) < 0){
+ perror("TIOCMSET failed in post: HW Flow-on error \n");
+ return -1;
+ }
+ return 0;
+}
+
struct uart_t uart[] = {
{ "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
FLOW_CTL, DISABLE_PM, NULL, NULL },
@@ -1137,6 +1169,9 @@ struct uart_t uart[] = {
{ "qualcomm", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
FLOW_CTL, DISABLE_PM, NULL, qualcomm, NULL },
+ { "qualcomm-ibs", 0x0000, 0x0000, HCI_UART_IBS, 115200, 115200,
+ FLOW_CTL, DISABLE_PM, NULL, qcom_uart_init, qcom_uart_post },
+
{ NULL, 0 }
};
View
7 tools/hciattach.h
@@ -2,8 +2,8 @@
*
* BlueZ - Bluetooth protocol stack for Linux
*
- * Copyright (C) 2003-2010 Marcel Holtmann <marcel@holtmann.org>
- *
+ * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2010, 2011 Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +38,8 @@
#define HCI_UART_3WIRE 2
#define HCI_UART_H4DS 3
#define HCI_UART_LL 4
-#define HCI_UART_ATH3K 5
+#define HCI_UART_IBS 5
+#define HCI_UART_ATH3K 6
#define HCI_UART_RAW_DEVICE 0

0 comments on commit 1b5f1e7

Please sign in to comment.
Something went wrong with that request. Please try again.