|
From: Peter K. <pk...@us...> - 2001-04-27 16:49:38
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_vendor.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added support for Infineon BlueMoon I hardware (as best as I could
without having any hardware to test with).
The diff of the modified file(s):
--- bt_vendor.c 2001/04/26 10:51:28 1.11
+++ bt_vendor.c 2001/04/27 16:49:38 1.12
@@ -52,22 +52,25 @@
#include "bt_if.h"
=20
#define HW_NOT_PROBED -1
-#define HW_ERICSSON 0
-#define HW_CSR 1
-#define HW_DIGIANSWER 2
-#define HW_USB 3
-#define HW_GENERIC 4
-#define HW_NO_INIT 5
-#define HW_UNKNOWN 6
+#define HW_CSR 0
+#define HW_DIGIANSWER 1
+#define HW_ERICSSON 2
+#define HW_INFINEON 3
+#define HW_USB 4
+#define HW_GENERIC 5
+#define HW_NO_INIT 6
+#define HW_UNKNOWN 7
=20
static int hw_vendor(void);
=20
-static void ericsson_init_phys(int fd);
-static void ericsson_init_hw(int bt_cfd, int phys_fd, int spd);
static void csr_init_phys(int fd);
static void csr_init_hw(int bt_cfd, int phys_fd, int spd);
static void digianswer_init_phys(int fd);
static void digianswer_init_hw(int bt_cfd, int phys_fd, int spd);
+static void ericsson_init_phys(int fd);
+static void ericsson_init_hw(int bt_cfd, int phys_fd, int spd);
+static void infineon_init_phys(int fd);
+static void infineon_init_hw(int bt_cfd, int phys_fd, int spd);
static void usb_init_phys(int fd);
static void usb_init_hw(int bt_cfd, int phys_fd, int spd);
static void generic_init_phys(int fd);
@@ -82,10 +85,6 @@
{
switch (hw_vendor())
{
- case HW_ERICSSON:
- ericsson_init_phys(fd);
- break;
-
case HW_CSR:
csr_init_phys(fd);
break;
@@ -94,6 +93,14 @@
digianswer_init_phys(fd);
break;
=20
+ case HW_ERICSSON:
+ ericsson_init_phys(fd);
+ break;
+
+ case HW_INFINEON:
+ infineon_init_phys(fd);
+ break;
+
case HW_USB:
usb_init_phys(fd);
break;
@@ -118,10 +125,6 @@
{
switch (hw_vendor())
{
- case HW_ERICSSON:
- ericsson_init_hw(bt_cfd, phys_fd, spd);
- break;
-
case HW_CSR:
csr_init_hw(bt_cfd, phys_fd, spd);
break;
@@ -130,6 +133,14 @@
digianswer_init_hw(bt_cfd, phys_fd, spd);
break;
=20
+ case HW_ERICSSON:
+ ericsson_init_hw(bt_cfd, phys_fd, spd);
+ break;
+
+ case HW_INFINEON:
+ infineon_init_hw(bt_cfd, phys_fd, spd);
+ break;
+
case HW_USB:
usb_init_hw(bt_cfd, phys_fd, spd);
break;
@@ -160,12 +171,14 @@
=20
if (!vendor)
hw_vendor =3D HW_UNKNOWN;
- else if (!strcmp(vendor, "Ericsson"))
- hw_vendor =3D HW_ERICSSON;
else if (!strcmp(vendor, "CSR"))
hw_vendor =3D HW_CSR;
else if (!strcmp(vendor, "Digianswer"))
hw_vendor =3D HW_DIGIANSWER;
+ else if (!strcmp(vendor, "Ericsson"))
+ hw_vendor =3D HW_ERICSSON;
+ else if (!strcmp(vendor, "Infineon"))
+ hw_vendor =3D HW_INFINEON;
else if (!strcmp(vendor, "USB"))
hw_vendor =3D HW_USB;
else if (!strcmp(vendor, "Generic"))
@@ -180,42 +193,6 @@
}
=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*/
-/* Ericsson 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*/
-
-/* Set the phys device to Ericsson default speed, 57600 */
-void
-ericsson_init_phys(int fd)
-{
- fd_setup(fd, 57600, USE_FLOW_CTRL);
-}
-
-void
-ericsson_init_hw(int bt_cfd, int phys_fd, int spd)
-{
- /* Connection setup, all devices, no auto accept */
- unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
- unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
-
- bt_write_scan_enable(bt_cfd, wrscan);
-
- sleep(1);
-
- /* set_event_filter must be called for m/s switch on IrmaC! */
- bt_set_event_filter(bt_cfd, filter);
-
- sleep(1); // wait for HW...
-
- syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20
- bt_set_baudrate(bt_cfd, spd);
- usleep(10000);
-
- /* Now set phys device speed to whatever HW was set to use */
- fd_setup(phys_fd, spd, USE_FLOW_CTRL);
- tcflush(phys_fd, TCIOFLUSH);
-}
-
-/* =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*/
/* CSR 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*/
=20
@@ -289,7 +266,69 @@
=20
/* Now set phys device speed to whatever HW was set to use */
fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20
+ tcflush(phys_fd, TCIOFLUSH);
+}
+
+/* =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*/
+/* Ericsson 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*/
+
+/* Set the phys device to Ericsson default speed, 57600 */
+void
+ericsson_init_phys(int fd)
+{
+ fd_setup(fd, 57600, USE_FLOW_CTRL);
+}
+
+void
+ericsson_init_hw(int bt_cfd, int phys_fd, int spd)
+{
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
+ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
+
+ bt_write_scan_enable(bt_cfd, wrscan);
+
+ sleep(1);
+
+ /* set_event_filter must be called for m/s switch on IrmaC! */
+ bt_set_event_filter(bt_cfd, filter);
+
+ sleep(1); // wait for HW...
+
+ syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20
+ bt_set_baudrate(bt_cfd, spd);
+ usleep(10000);
+
+ /* Now set phys device speed to whatever HW was set to use */
+ fd_setup(phys_fd, spd, USE_FLOW_CTRL);
+ tcflush(phys_fd, TCIOFLUSH);
+}
=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*/
+/* 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 bt_cfd, int phys_fd, int spd)
+{
+ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
+=20=20
+ sleep(1);
+ syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!\n");
+ bt_write_scan_enable(bt_cfd, wrscan);
+
+ sleep(1); // wait for HW...=20
+ syslog(LOG_INFO, "Setting baudrate in Infineon module!\n");=20=20
+ bt_set_baudrate(bt_cfd, spd);
+=20=20
+ /* Now set phys device speed to whatever HW was set to use */
+ fd_setup(phys_fd, spd, USE_FLOW_CTRL);
tcflush(phys_fd, TCIOFLUSH);
}
=20
|