From: Peter K. <pk...@us...> - 2001-07-05 21:45:10
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.48 1.49=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made it compile for 2.4.x again (this fix was accidentally removed in the last commit). The diff of the modified file(s): --- hci_vendor.c 2001/07/05 10:53:18 1.48 +++ hci_vendor.c 2001/07/05 21:45:08 1.49 @@ -691,10 +691,14 @@ /* wait for command status */ while (hci_ctrl.hc_buf.cmd_num =3D=3D 0) { - current->timeout =3D HZ/100; current->state =3D TASK_INTERRUPTIBLE; +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0) + schedule_timeout(HZ/100); +#else + current->timeout =3D HZ/100; schedule(); current->timeout =3D 0; +#endif } } =20 |
From: Peter K. <pk...@us...> - 2001-08-16 13:05:56
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.49 1.50=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Rewrote the Eicsson version of hci_set_bd_addr() to create the hci packet just like all the other functions do. * Use defines instead of hardcoded values. The diff of the modified file(s): --- hci_vendor.c 2001/07/05 21:45:08 1.49 +++ hci_vendor.c 2001/08/16 13:05:55 1.50 @@ -71,9 +71,9 @@ =20 #ifdef CONFIG_BLUETOOTH_ERICSSON /* Ericsson defines */ -#define ERICSSON_SET_UART_BAUD_RATE 0x9 -#define ERICSSON_WRITE_BD_ADDR 0xd -#define ERICSSON_READ_REVISION_INFORMATION 0xF +#define ERICSSON_SET_UART_BAUD_RATE 0x09 +#define ERICSSON_WRITE_BD_ADDR 0x0D +#define ERICSSON_READ_REVISION_INFORMATION 0x0F =20 #define ERICSSON_ENTER_TEST_MODE 0x11 #define ERICSSON_TEST_CONTROL 0x12 @@ -115,7 +115,6 @@ s32=20 hci_set_bd_addr(u8 bd[6]) { - u8 pkt[10]; u8 tmp_bd[6]; s32 i; =20=20=20 @@ -126,13 +125,12 @@ } =20=20=20 PRINTPKT(__FUNCTION__ VENDOR ":", bd, 6); - pkt[0] =3D CMD_PKT; - pkt[1] =3D 0x0d; - pkt[2] =3D 0xfc; - pkt[3] =3D 0x06; - memcpy(pkt + 4, tmp_bd, 6); + c_pkt.type =3D CMD_PKT; + c_pkt.opcode =3D hci_put_opcode(ERICSSON_WRITE_BD_ADDR, MANUFACTURER_SPEC= ); + c_pkt.len =3D 6; + memcpy(c_pkt.data, tmp_bd, 6); =20=20=20 - return send_cmd_block(pkt, 10, DEFAULT_TIMEOUT); + return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); } =20=20 s32 @@ -140,7 +138,7 @@ { D_CMD(__FUNCTION__ VENDOR "\n"); c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0xf, 0x3f) ; + c_pkt.opcode =3D hci_put_opcode(ERICSSON_READ_REVISION_INFORMATION, MANUF= ACTURER_SPEC); c_pkt.len =3D 0; =20 return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); @@ -155,7 +153,7 @@ =20 D_CMD(__FUNCTION__ VENDOR " (%u baud)\n", baudrate); c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(ERICSSON_SET_UART_BAUD_RATE, 0x3f) ; + c_pkt.opcode =3D hci_put_opcode(ERICSSON_SET_UART_BAUD_RATE, MANUFACTURER= _SPEC); c_pkt.len =3D 1; switch (baudrate) { case 57600: @@ -664,7 +662,7 @@ =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + cmd->len * 2; =20=09 msg =3D (csr_msg *)c_pkt.data; @@ -717,7 +715,7 @@ =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + n_pars*sizeof(u16); =20 msg =3D (csr_msg *)c_pkt.data; @@ -772,7 +770,7 @@ =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + 4*sizeof(u16); =20 msg =3D (csr_msg *)c_pkt.data; @@ -816,7 +814,7 @@ =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + 1*sizeof(u16); =20 msg =3D (csr_msg *)c_pkt.data; @@ -864,7 +862,7 @@ =20=09 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + 5*sizeof(u16) + 6*sizeof(u16); =20 msg =3D (csr_msg *)c_pkt.data; @@ -945,7 +943,7 @@ =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); c_pkt.len =3D 1 + 5*sizeof(u16) + 4*sizeof(u16); =20 msg =3D (csr_msg *)c_pkt.data; @@ -1190,7 +1188,7 @@ { D_CMD(__FUNCTION__ VENDOR "\n"); c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x0005, 0x3f); + c_pkt.opcode =3D hci_put_opcode(0x05, MANUFACTURER_SPEC); c_pkt.len =3D 0; =20 return send_cmd_block((u8*) &c_pkt, |
From: Peter K. <pk...@us...> - 2001-08-29 10:08:43
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.50 1.51=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not differentiate between BCSP and H4 in the CSR version of bt_hw_vendor(). The diff of the modified file(s): --- hci_vendor.c 2001/08/16 13:05:55 1.50 +++ hci_vendor.c 2001/08/29 10:08:42 1.51 @@ -1163,10 +1163,7 @@ char* bt_hw_vendor(void) { - if (bt_use_bcsp(-1)) - return "CSR (BCSP)"; - else - return "CSR (H4)"; + return "CSR"; } =20 #elif defined(CONFIG_BLUETOOTH_INFINEON_BMI) |
From: Peter K. <pk...@us...> - 2001-09-18 12:22:01
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.53 1.54=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use GET_BITS() and SET_BITS() instead of using bitfields for the descriptor byte in CSR messages. The diff of the modified file(s): --- hci_vendor.c 2001/09/18 08:32:50 1.53 +++ hci_vendor.c 2001/09/18 12:22:00 1.54 @@ -463,16 +463,18 @@ #define CSR_VARID_PACKET_STAT_REPORT 0x1001 #define CSR_VARID_BITERR_REPORT 0x1006 =20 -typedef struct payload_descr -{ - u8 ch_id:6; - u8 first:1; - u8 last:1; -} __attribute__ ((packed)) payload_descr; +#define CSR_GET_CH_ID(msg) GET_BITS((msg)->descr, 0, 6) +#define CSR_SET_CH_ID(msg, id) SET_BITS((msg)->descr, 0, 6, id) =20 +#define CSR_GET_FIRST(msg) GET_BITS((msg)->descr, 6, 1) +#define CSR_SET_FIRST(msg, x) SET_BITS((msg)->descr, 6, 1, (x) !=3D 0) + +#define CSR_GET_LAST(msg) GET_BITS((msg)->descr, 7, 1) +#define CSR_SET_LAST(msg, x) SET_BITS((msg)->descr, 7, 1, (x) !=3D 0) + typedef struct csr_msg { - payload_descr p_descr; + u8 descr; u8 msg[0]; } __attribute__ ((packed)) csr_msg; =20 @@ -761,9 +763,9 @@ msg =3D (csr_msg *)c_pkt.data; =20=09 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_HQ; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_HQ); =20 memcpy(msg->msg, cmd, cmd->len * 2); =20 @@ -816,9 +818,9 @@ ps =3D (csr_bccmd_ps *)cmd->payload; =20 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); =20 /* BCCMD type */ =20 @@ -871,9 +873,9 @@ ps =3D (csr_bccmd_ps *)cmd->payload; =20 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); =20 /* BCCMD type */ cmd->type =3D CSR_MSGTYPE_SETREQ; @@ -915,9 +917,9 @@ ps =3D (csr_bccmd_ps *)cmd->payload; =20 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); =20 /* BCCMD type */ cmd->type =3D CSR_MSGTYPE_SETREQ; @@ -962,9 +964,9 @@ cmd =3D (csr_bccmd *)msg->msg; =20 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); =20 /* BCCMD type */ cmd->type =3D CSR_MSGTYPE_GETREQ; @@ -1044,9 +1046,9 @@ ps =3D (csr_bccmd_ps *)cmd->payload; =20 /* General msg header */ - msg->p_descr.last =3D 1; /* first and last segment */ - msg->p_descr.first =3D 1; - msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + CSR_SET_LAST(msg, 1); /* first and last segment */ + CSR_SET_FIRST(msg, 1); + CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); =20 cmd->type =3D CSR_MSGTYPE_SETREQ; cmd->len =3D 5 + 4; @@ -1100,7 +1102,7 @@ cmd =3D (struct csr_bccmd *)msg->msg; ps =3D (struct csr_bccmd_ps *)cmd->payload; =20 - switch (msg->p_descr.ch_id) { + switch (CSR_GET_CH_ID(msg)) { case CSR_CH_ID_BCCMD: if (cmd->type =3D=3D CSR_MSGTYPE_GETRESP && cmd->status =3D=3D CSR_STATUS_OK) { @@ -1176,12 +1178,12 @@ =20 #ifdef VERBOSE printk("msg: last: %d, first: %d, chID: %d\n",=20 - msg->p_descr.last, msg->p_descr.first, msg->p_descr.ch_id); + CSR_GET_LAST(msg), CSR_GET_FIRST(msg), CSR_GET_CH_ID(msg)); =20 printk("cmd: type: 0x%04X, msg_len: %d, seq_nbr: %d, varid: 0x%04X, statu= s: 0x%04X\n", cmd->type, cmd->len, cmd->seq, cmd->var_id, cmd->status); =20 - switch (msg->p_descr.ch_id) { + switch (CSR_GET_CH_ID(msg)) { case CSR_CH_ID_BCCMD: printk("BCCMD MSG\n"); =20 |
From: Peter K. <pk...@us...> - 2001-10-03 17:19:11
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.55 1.56=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use copy_to_user() instead of copy_from_user() to copy data to user mode... The diff of the modified file(s): --- hci_vendor.c 2001/10/02 11:00:25 1.55 +++ hci_vendor.c 2001/10/03 17:19:10 1.56 @@ -743,7 +743,7 @@ return -E2BIG; } =20 - copy_from_user(data, response->data, length); + copy_to_user(data, response->data, length); =20 kfree(response); =20 |
From: Peter K. <pk...@us...> - 2001-10-16 14:43:17
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.58 1.59=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added support for baud rates lower than 57600 for Ericsson (thanks to Alain Paschoud for this). The diff of the modified file(s): --- hci_vendor.c 2001/10/05 12:25:46 1.58 +++ hci_vendor.c 2001/10/16 11:13:09 1.59 @@ -156,6 +156,21 @@ c_pkt.opcode =3D hci_put_opcode(ERICSSON_SET_UART_BAUD_RATE, MANUFACTURER= _SPEC); c_pkt.len =3D 1; switch (baudrate) { + case 9600: + c_pkt.data[0] =3D 0x14; + break; + case 14400: + c_pkt.data[0] =3D 0x05; + break; + case 19200: + c_pkt.data[0] =3D 0x13; + break; + case 28800: + c_pkt.data[0] =3D 0x04; + break; + case 38400: + c_pkt.data[0] =3D 0x12; + break; case 57600: c_pkt.data[0] =3D 0x03; break; |
From: Peter K. <pk...@us...> - 2001-10-23 09:21:00
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.59 1.60=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Let csr_waitcmdnum() timeout after five seconds to not hang there indefinitely if no COMMAND_STATUS event is received. The diff of the modified file(s): --- hci_vendor.c 2001/10/16 11:13:09 1.59 +++ hci_vendor.c 2001/10/23 09:20:59 1.60 @@ -796,10 +796,12 @@ =20 void csr_waitcmdnum(void) { + int count =3D 5 * HZ; +=20=20 D_CMD(__FUNCTION__"\n"); hci_ctrl.hc_buf.cmd_num =3D 0; /* wait for command status */ - while (hci_ctrl.hc_buf.cmd_num =3D=3D 0) + while (hci_ctrl.hc_buf.cmd_num =3D=3D 0 && --count) { current->state =3D TASK_INTERRUPTIBLE; #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0) @@ -809,6 +811,11 @@ schedule(); current->timeout =3D 0; #endif + } + + if (!count) { + D_WARN(__FUNCTION__ ": Did not receive COMMAND_STATUS within five second= s!\n"); + hci_ctrl.hc_buf.cmd_num =3D 1; } } =20 |
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 |
From: Willy S. <sag...@us...> - 2002-04-11 10:30:52
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci_vendor.c 1.62 1.63=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added linux version ifdef for malloc.h/slab.h The diff of the modified file(s): --- hci_vendor.c 28 Feb 2002 20:12:15 -0000 1.62 +++ hci_vendor.c 11 Apr 2002 10:16:48 -0000 1.63 @@ -46,7 +46,11 @@ #ifdef __KERNEL__ #include <linux/config.h> #include <linux/bluetooth/sysdep-2.1.h> +#if LINUX_VERSION_CODE >=3D 0x20200 +#include <linux/slab.h> +#else #include <linux/malloc.h> +#endif #include <linux/timer.h> #include <linux/bluetooth/hci.h> #include <linux/bluetooth/hci_internal.h> |
From: Alain P. <apa...@us...> - 2002-07-22 17:29:51
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci_vendor.c 1.65 1.66=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made several CSR specific things Big Endian compatible : - Interpretation of BUILD_ID (consequence : speed can now be set in big end= ian) - Reading and writing PS keys Note : hci_set_bd_addr and setting speed are for the moment not big-endian = compatible. The diff of the modified file(s): --- hci_vendor.c 15 May 2002 13:29:41 -0000 1.65 +++ hci_vendor.c 22 Jul 2002 17:29:50 -0000 1.66 @@ -572,7 +572,6 @@ csr_bccmd_ps *ps; =20=09 D_REC(__FUNCTION__ "\n"); - hci_ctrl.hc_buf.cmd_num =3D 1;=20=20 =20 release_cmd_timer(); @@ -595,12 +594,10 @@ 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: @@ -861,8 +858,6 @@ 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 @@ -882,16 +877,16 @@ =20 /* BCCMD type */ =20 - cmd->type =3D rw_mode; - cmd->len =3D 5 + 3 + n_pars; - cmd->seq =3D csr_count++; - cmd->var_id =3D CSR_CMD_PS; - cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ + cmd->type =3D cpu_to_le16(rw_mode); + cmd->len =3D cpu_to_le16(5 + 3 + n_pars); + cmd->seq =3D cpu_to_le16(csr_count++); + cmd->var_id =3D cpu_to_le16(CSR_CMD_PS); + cmd->status =3D cpu_to_le16(CSR_STATUS_OK); /* always OK in SETREQ */ =20 /* Actual PS key request */ - ps->ps_key =3D ps_key; - ps->ps_len =3D n_pars; /* x 16 bits */ - ps->unused =3D 0x0000; + ps->ps_key =3D cpu_to_le16(ps_key); + ps->ps_len =3D cpu_to_le16(n_pars); /* x 16 bits */ + ps->unused =3D cpu_to_le16(0x0000); =20 if (rw_mode =3D=3D CSR_MSGTYPE_GETREQ) memset(ps->ps_val, 0, n_pars*sizeof(u16)); /* zero params in GETREQ */ @@ -910,9 +905,6 @@ /* Signal status back in SETREQ ? */ =20 return tmp; -#else - return 0; -#endif } =20 s32=20 |
From: Alain P. <apa...@us...> - 2002-11-22 08:29:44
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci_vendor.c 1.66 1.67=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Write PS keys for CSR modules now big-endian compatible The diff of the modified file(s): --- hci_vendor.c 22 Jul 2002 17:29:50 -0000 1.66 +++ hci_vendor.c 22 Nov 2002 08:29:13 -0000 1.67 @@ -1111,6 +1111,13 @@ cmd =3D (struct csr_bccmd *)msg->msg; 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); + switch (CSR_GET_CH_ID(msg)) { case CSR_CH_ID_BCCMD: if (cmd->type =3D=3D CSR_MSGTYPE_GETRESP && |