|
From: Gordon M. <gm...@us...> - 2001-04-27 15:38:34
|
The following file was modified in apps/bluetooth/btd:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.95 1.96=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Added the Infineon BlueMoon Chipset support provided by Christian Kranz.
The diff of the modified file(s):
--- btd.c 2001/04/25 18:13:05 1.95
+++ btd.c 2001/04/27 15:38:03 1.96
@@ -326,7 +326,10 @@
static void no_init_hw(int spd);
static void unknown_init_phys(int fd);
static void unknown_init_hw(int spd);
+static void infineon_init_phys(int fd);
+static void infineon_init_hw(int spd);
=20
+
#undef ECS_TEST_FUNCTIONS
=20
#ifdef ECS_TEST_FUNCTIONS
@@ -422,6 +425,7 @@
#define HW_GENERIC 4
#define HW_NO_INIT 5
#define HW_UNKNOWN 6
+#define HW_INFINEON 7
=20
/*=20
Bluetooth discipline define. Should reside in /include/asm/termios.h
@@ -3209,6 +3213,10 @@
usb_init_phys(fd);
break;
=20
+ case HW_INFINEON:
+ infineon_init_phys(fd);
+ break;
+
case HW_GENERIC:
generic_init_phys(fd);
break;
@@ -3245,6 +3253,10 @@
usb_init_hw(spd);
break;
=20
+ case HW_INFINEON:
+ infineon_init_hw(spd);
+ break;
+
case HW_GENERIC:
generic_init_hw(spd);
break;
@@ -3283,6 +3295,8 @@
hw_vendor =3D HW_GENERIC;
else if (!strcmp(vendor, "No Init"))
hw_vendor =3D HW_NO_INIT;
+ else if (!strcmp(vendor, "Infineon"))
+ hw_vendor =3D HW_INFINEON;
else
hw_vendor =3D HW_UNKNOWN;
}
@@ -3467,6 +3481,52 @@
hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE);
sleep(1); /* wait for HW */
#endif
+}
+
+
+/* =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*/
+/* Infineon specific commands */
+/* =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*/
+
+void infineon_init_phys(int fd)
+{
+ fd_setup(fd, 115200, USE_FLOW_CTRL);
+}
+
+void
+infineon_init_hw(int spd)
+{
+#ifndef BTD_USERSTACK
+ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
+=20=20
+ sleep(1);
+ printf("Setting write_scan_enable in Infineon chip!\n");
+ if (ioctl(bt_cfd, HCIWRITESCANENABLE, &wrscan) < 0)
+ {=20
+ perror("HCIWRITESCANENABLE");
+ exit(1);
+ }
+
+ sleep(1); // wait for HW...=20
+ printf("Setting baudrate in Infineon module!\n");=20=20
+ if (ioctl(bt_cfd, HCISETBAUDRATE, &spd) < 0)
+ {
+ perror("HCISETBAUDRATE");
+ exit(1);
+ }
+ printf("read Firmware version number\n");
+
+#else=20=20
+ printf("Setting write_scan_enable in Infineon chip!\n");
+ hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE);=20=20=20=20=
=20=20=20=20=20=20
+ sleep(1); /* wait for HW... */
+=20=20
+ tcflush(phys_fd, TCIOFLUSH);
+
+ printf("Setting baudrate in Infineon chip!\n");
+ hci_set_baudrate(spd);=20=20
+#endif
+
}
=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*/
|