|
From: Alain P. <apa...@us...> - 2002-02-28 10:40:08
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.60 1.61=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added big endian support when askping firmware version
Sorry : add a define (CONFIG_BLUETOOTH_SD_SPECIFIC) because the
module doesn't work if the firmware value is stored in the string.
I will remove this define a soon as I understood why it change
the csr module behavior.
The diff of the modified file(s):
--- hci_vendor.c 23 Oct 2001 09:20:59 -0000 1.60
+++ hci_vendor.c 28 Feb 2002 10:40:05 -0000 1.61
@@ -557,6 +557,13 @@
cmd =3D (struct csr_bccmd *)data;
ps =3D (struct csr_bccmd_ps *)cmd->payload;
=20
+ /* Invert u16 if big endian */
+ cmd->type =3D le16_to_cpu(cmd->type);
+ cmd->len =3D le16_to_cpu(cmd->len);
+ cmd->seq =3D le16_to_cpu(cmd->seq);
+ cmd->var_id =3D le16_to_cpu(cmd->var_id);
+ cmd->status =3D le16_to_cpu(cmd->status);
+
if (cmd->status =3D=3D CSR_STATUS_OK) {
if (cmd->type =3D=3D CSR_MSGTYPE_GETRESP) {
switch (cmd->var_id) {
@@ -565,10 +572,12 @@
break;
=20=09=09=09=09
case CSR_CMD_BUILD_ID:
+#ifndef CONFIG_BLUETOOTH_SD_SPECIFIC
/* Store this for later retrieval */
sprintf(bt_hw_firmware_info,
"\n Firmware version: %d",
cmd->payload[0]);
+#endif
break;
=20=09=09=09=09
case CSR_CMD_CHIP_VER:
@@ -829,6 +838,8 @@
csr_bccmd *cmd;
csr_bccmd_ps *ps;
=20
+#ifndef CONFIG_BLUETOOTH_SD_SPECIFIC
+
D_CMD(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09
PRINTPKT("pars : ", (u8*)retb, n_pars*sizeof(u16));
=20
@@ -876,6 +887,9 @@
/* Signal status back in SETREQ ? */
=20
return tmp;
+#else
+ return 0;
+#endif
}
=20
s32=20
@@ -944,26 +958,26 @@
CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD);
=20
/* BCCMD type */
- cmd->type =3D CSR_MSGTYPE_GETREQ;
- cmd->len =3D 5 + 6;
- cmd->seq =3D csr_count++;
- cmd->var_id =3D CSR_CMD_BUILD_ID;
- cmd->status =3D CSR_STATUS_OK; /* always OK in GETREQ */
+ cmd->type =3D cpu_to_le16(CSR_MSGTYPE_GETREQ);
+ cmd->len =3D cpu_to_le16(5 + 6);
+ cmd->seq =3D cpu_to_le16(csr_count++);
+ cmd->var_id =3D cpu_to_le16(CSR_CMD_BUILD_ID);
+ cmd->status =3D cpu_to_le16(CSR_STATUS_OK); /* always OK in GETREQ */
memset(cmd->payload, 0, 6*sizeof(u16));
=20
tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE=
N, DEFAULT_TIMEOUT);
if (tmp < 0)
return tmp;
=20
- cmd->seq =3D csr_count++;
- cmd->var_id =3D CSR_CMD_CHIP_VER;
+ cmd->seq =3D cpu_to_le16(csr_count++);
+ cmd->var_id =3D cpu_to_le16(CSR_CMD_CHIP_VER);
memset(cmd->payload, 0, 6*sizeof(u16));
tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE=
N, DEFAULT_TIMEOUT);
if (tmp < 0)
return tmp;
=20
- cmd->seq =3D csr_count++;
- cmd->var_id =3D CSR_CMD_CHIP_REV;
+ cmd->seq =3D cpu_to_le16(csr_count++);
+ cmd->var_id =3D cpu_to_le16(CSR_CMD_CHIP_REV);
memset(cmd->payload, 0, 6*sizeof(u16));
tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE=
N, DEFAULT_TIMEOUT);
=20
|