Commit e7681c00 authored by Martin Ghosal's avatar Martin Ghosal

Apply patch 0001-bluetooth-Add-bluetooth-support-for-QCA6174-chip.patch

parent e888073b
......@@ -29,7 +29,10 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \
tools/hciattach_ath3k.c \
tools/hciattach_qualcomm.c \
tools/hciattach_intel.c \
tools/hciattach_bcm43xx.c
tools/hciattach_bcm43xx.c \
tools/hciattach_rome.c \
tools/hciattach_rome.h
tools_hciattach_LDADD = lib/libbluetooth-private.la
tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c \
......
......@@ -68,6 +68,8 @@ struct uart_t {
#define ENABLE_PM 1
#define DISABLE_PM 0
int line_disp = 1;
static volatile sig_atomic_t __io_canceled = 0;
static void sig_hup(int sig)
......@@ -318,6 +320,12 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
return ath3k_post(fd, u->pm);
}
static int qca(int fd, struct uart_t *u, struct termios *ti)
{
fprintf(stderr,"qca\n");
return qca_soc_init(fd, u->bdaddr);
}
static int qualcomm(int fd, struct uart_t *u, struct termios *ti)
{
return qualcomm_init(fd, u->speed, ti, u->bdaddr);
......@@ -1152,6 +1160,10 @@ struct uart_t uart[] = {
{ "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200,
FLOW_CTL, DISABLE_PM, NULL, NULL, ath3k_ps, ath3k_pm },
/* QCA ROME */
{ "qca", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
FLOW_CTL, DISABLE_PM, NULL, NULL, qca, NULL },
/* QUALCOMM BTS */
{ "qualcomm", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
......@@ -1255,6 +1267,8 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw)
return -1;
}
if(line_disp){
fprintf(stderr, "Setting TTY to N_HCI line discipline\n");
/* Set TTY to N_HCI line discipline */
i = N_HCI;
if (ioctl(fd, TIOCSETD, &i) < 0) {
......@@ -1262,6 +1276,7 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw)
return -1;
}
if (flags && ioctl(fd, HCIUARTSETFLAGS, flags) < 0) {
perror("Can't set UART flags");
return -1;
......@@ -1271,7 +1286,7 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw)
perror("Can't set device");
return -1;
}
}
if (u->post && u->post(fd, u, &ti) < 0)
return -1;
......@@ -1311,6 +1326,11 @@ int main(int argc, char *argv[])
send_break = 1;
break;
case 'd':
line_disp = atoi(optarg);
fprintf(stderr, "Line_disp val : %d\n", line_disp);
break;
case 'n':
detach = 0;
break;
......@@ -1494,12 +1514,15 @@ int main(int argc, char *argv[])
break;
}
/* Restore TTY line discipline */
ld = N_TTY;
if (ioctl(n, TIOCSETD, &ld) < 0) {
perror("Can't restore line discipline");
exit(1);
}
if(line_disp){
fprintf(stderr, "Restoring the Line Discipline driver\n");
/* Restore TTY line discipline */
ld = N_TTY;
if (ioctl(n, TIOCSETD, &ld) < 0) {
perror("Can't restore line discipline");
exit(1);
}
}
return 0;
}
......@@ -39,6 +39,7 @@
#define HCI_UART_H4DS 3
#define HCI_UART_LL 4
#define HCI_UART_ATH3K 5
#define HCI_UART_IBS 6
#define HCI_UART_RAW_DEVICE 0
#define HCI_UART_RESET_ON_INIT 1
......@@ -56,6 +57,7 @@ int bgb2xx_init(int dd, bdaddr_t *bdaddr);
int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
struct termios *ti);
int ath3k_post(int fd, int pm);
int qca_soc_init(int fd, char *bdaddr);
int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr);
int intel_init(int fd, int init_speed, int *speed, struct termios *ti);
int bcm43xx_init(int fd, int speed, struct termios *ti, const char *bdaddr,
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment