|
From: Peter K. <pk...@us...> - 2001-08-29 09:36:46
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.30 1.31=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20
bt_vendor.c 1.23 1.24=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Moved csr_bcspmode() to bt_if.c and renamed it to bt_bcsp_mode().
The diff of the modified file(s):
--- bt_if.c 2001/08/29 08:39:09 1.30
+++ bt_if.c 2001/08/29 09:36:45 1.31
@@ -168,6 +168,29 @@
return buffer;
#else
return bt_hw_firmware();
+#endif
+}
+
+int
+bt_bcsp_mode(int bt_cfd, int enable)
+{
+#ifndef BT_USERSTACK
+ int fd =3D (bt_cfd < 0 ? bt_openctrl() : bt_cfd);
+
+ if (fd < 0 || ioctl(fd, BTSETBCSPMODE, &enable) < 0)
+ {
+ perror(__FUNCTION__);
+ exit(1);
+ }
+
+ if (bt_cfd < 0)
+ {
+ close(fd);
+ }
+
+ return enable;
+#else
+ return 0;
#endif
}
=20
--- bt_if.h 2001/08/29 08:39:09 1.20
+++ bt_if.h 2001/08/29 09:36:45 1.21
@@ -248,7 +248,7 @@
#define BTTESTCOMMAND _IOW(BT_IOC_MAGIC, 0xf2, unsigned char[261])
=20
#define BTSETMSSWITCH _IOW(BT_IOC_MAGIC, 0xf3, unsigned char)
-#define BTSETBCSPMODE _IOW(BT_IOC_MAGIC, 0xf4, unsigned char)
+#define BTSETBCSPMODE _IOWR(BT_IOC_MAGIC, 0xf4, int)
=20
#define CSR_PSKEY_MSGHDR_SIZE 3
#define CSR_PSKEY_MAXPARAMS 10
@@ -299,6 +299,7 @@
char* bt_hw_vendor(void);
#endif
char* bt_firmware_info(void);
+int bt_bcsp_mode(int bt_cfd, int enable);
void reset_hw(void);
int bt_openctrl(void);
void set_bt_line_disc(int phys_fd, int bt_disc, char* physdev);
--- bt_vendor.c 2001/08/29 08:51:47 1.23
+++ bt_vendor.c 2001/08/29 09:36:45 1.24
@@ -257,17 +257,7 @@
fd_setup(fd, 115200, USE_FLOW_CTRL, USE_BCSP);
}
=20
-void
-csr_bcspmode(int bt_cfd, int enable)
-{
- if (ioctl(bt_cfd, BTSETBCSPMODE, &enable) < 0)
- {
- perror(__FUNCTION__);
- exit(1);
- }
-}
=20
-
/*
* Read/Write any PS key in CSR module=20
* ps_vals holds return values / set params depending on=20
@@ -342,7 +332,7 @@
syslog(LOG_INFO, "Changing CSR host IF: H4 -> BCSP");
=20=20=20=20=20
/* Temporarily set stack to use BCSP framing */
- csr_bcspmode(bt_cfd, 1);
+ bt_bcsp_mode(bt_cfd, 1);
=20=20=20=20=20
/* Setup serial port for BCSP (default baudrate) */
fd_setup(phys_fd, 115200, USE_FLOW_CTRL, USE_BCSP);
@@ -395,14 +385,14 @@
}=20=20=20
=20=20=20=20=20
/* Set back stack to use H4 framing */
- csr_bcspmode(bt_cfd, 0);
+ bt_bcsp_mode(bt_cfd, 0);
}
else
{
syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4");
=20
/* Set stack to use H4 temporarily */=20=20=20=20=20=20=20=20
- csr_bcspmode(bt_cfd, 0);
+ bt_bcsp_mode(bt_cfd, 0);
=20=20=20=20=20
/* Setup serial port for H4 (default baudrate) */
fd_setup(phys_fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP);
@@ -440,7 +430,7 @@
/* Should not be needed if hw_vendor is changed in kernel ....*/
=20=20=20=20=20=20=20
/* Set back stack to use BCSP framing */
- csr_bcspmode(bt_cfd, 1);
+ bt_bcsp_mode(bt_cfd, 1);
}=20
else
{
|