|
From: Peter K. <pk...@us...> - 2001-08-29 09:43:49
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_vendor.c 1.24 1.25=20=20=20=20=20=20=20=20=20=20=20=20
bt_vendor.h 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Broke out the functionality to change between BCSP and H4 from
csr_change_if() to csr_bcsp_to_h4() and csr_h4_to_bcsp().
The diff of the modified file(s):
--- bt_vendor.c 2001/08/29 09:36:45 1.24
+++ bt_vendor.c 2001/08/29 09:43:49 1.25
@@ -257,7 +257,6 @@
fd_setup(fd, 115200, USE_FLOW_CTRL, USE_BCSP);
}
=20
-
/*
* Read/Write any PS key in CSR module=20
* ps_vals holds return values / set params depending on=20
@@ -324,12 +323,23 @@
=20
void csr_change_if(int bt_cfd, int phys_fd)
{
+ /* This may seem reversed, but hw_vendor() returns what we want,
+ not what we have, in this situation... */
+ if (hw_vendor() =3D=3D HW_CSR_H4)
+ {
+ csr_bcsp_to_h4(bt_cfd, phys_fd);
+ }
+ else
+ {
+ csr_h4_to_bcsp(bt_cfd, phys_fd);
+ }
+}
=20
+void csr_bcsp_to_h4(int bt_cfd, int phys_fd)
+{
unsigned short ps_parbuf[10];
=20
- if (hw_vendor() =3D=3D HW_CSR_H4)
- {
- syslog(LOG_INFO, "Changing CSR host IF: H4 -> BCSP");
+ syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4");
=20=20=20=20=20
/* Temporarily set stack to use BCSP framing */
bt_bcsp_mode(bt_cfd, 1);
@@ -387,9 +397,12 @@
/* Set back stack to use H4 framing */
bt_bcsp_mode(bt_cfd, 0);
}
- else
+
+void csr_h4_to_bcsp(int bt_cfd, int phys_fd)
{
- syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4");
+ unsigned short ps_parbuf[10];
+
+ syslog(LOG_INFO, "Changing CSR host IF: H4 -> BCSP");
=20
/* Set stack to use H4 temporarily */=20=20=20=20=20=20=20=20
bt_bcsp_mode(bt_cfd, 0);
@@ -436,8 +449,8 @@
{
syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_pa=
rbuf[1]);
}
- }
}
+
=20
/* fixme -- remove hardcoded values */
void
--- bt_vendor.h 2001/08/29 08:39:09 1.5
+++ bt_vendor.h 2001/08/29 09:43:49 1.6
@@ -72,5 +72,7 @@
int hw_vendor(void);
=20
void csr_change_if(int bt_cfd, int phys_fd);
+void csr_bcsp_to_h4(int bt_cfd, int phys_fd);
+void csr_h4_to_bcsp(int bt_cfd, int phys_fd);
=20
#endif /* __BT_VENDOR_H__*/
|