|
From: Anders J. <and...@us...> - 2003-11-06 19:12:54
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bluetooth.c 1.242 1.243=20=20=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.211 1.212=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added IOCTL:s to write/read pincode type.=20
The diff of the modified file(s):
--- bluetooth.c 2003/11/05 19:03:12 1.242
+++ bluetooth.c 2003/11/06 19:12:52 1.243
@@ -1634,6 +1634,33 @@ hci_inq_exit0:
return name_request_response[0];
}
=20
+ case HCIREADPINTYPE:
+ {
+ tmp =3D hci_read_pin_type();
+ if(tmp < 0)
+ {
+ tmp =3D -MSGCODE(MSG_LAYER_HCI, -tmp);
+ }
+=09=09
+ put_user(tmp, (s32*) arg);
+ break;
+ }
+
+ case HCIWRITEPINTYPE:
+ {
+ u8 type;
+ GET_USER(tmp, (s32*)arg);
+ type =3D (u8)(tmp & 0xff);
+ BT_DRIVER("BTWRITEPINTYPE: %d\n", type);
+ tmp =3D hci_write_pin_type(type);
+ if(tmp < 0)
+ {
+ tmp =3D -MSGCODE(MSG_LAYER_HCI, -tmp);
+ }
+ put_user(tmp, (s32*)arg);
+ break;
+ }=20=20=20
+
default:
return -ENOIOCTLCMD;
}
--- hci.c 2003/11/05 15:21:58 1.211
+++ hci.c 2003/11/06 19:12:52 1.212
@@ -1583,6 +1583,29 @@ process_return_param(u8 *buf)
D_CMD(__FUNCTION__ ": WRITE_NUM_BROADCAST_RETRANSMISSIONS \n ");
break;
=20
+ case READ_PIN_TYPE:
+ D_CMD(__FUNCTION__ ": READ_PIN_TYPE\n");
+ if (r_val[0]) {
+ D_ERR(__FUNCTION__ ": READ_PIN_TYPE: %s\n",=20
+ get_err_msg(r_val[0]));
+ result_param =3D -r_val[0];
+ } else {
+ result_param =3D r_val[1];
+ D_CMD(__FUNCTION__ ": READ_PIN_TYPE: %s\n", r_val[1] ? "Fixed" : "Vari=
able");
+ }
+ break;
+
+ case WRITE_PIN_TYPE:
+ D_CMD(__FUNCTION__ ": WRITE_PIN_TYPE\n");
+ if (r_val[0]) {
+ D_ERR(__FUNCTION__ ": WRITE_PIN_TYPE: %s\n",=20
+ get_err_msg(r_val[0]));
+ result_param =3D -r_val[0];
+ } else {
+ D_CMD(__FUNCTION__ ": WRITE_PIN_TYPE Success\n");
+ result_param =3D 0;
+ }
+ break;
=20
default:
D_CMD(__FUNCTION__ ": HCI_HC, ocf %d not recognised!\n", ocf);
@@ -3538,6 +3561,31 @@ s32 hci_read_rssi(u32 hdl)
tmp =3D send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
=20
return (tmp<0)|(result_param=3D=3D256) ? 2<<8 : result_param|(1<<8);
+}
+
+s32 hci_read_pin_type(void)
+{
+ s32 tmp;
+ c_pkt.type =3D CMD_PKT;
+ c_pkt.opcode =3D hci_put_opcode(READ_PIN_TYPE, HCI_HC);
+ c_pkt.len =3D 0;
+ if((tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HD=
R_LEN, DEFAULT_TIMEOUT)) < 0) {
+ return tmp;
+ }
+ return result_param;
+}
+
+s32 hci_write_pin_type(u8 type)
+{
+ s32 tmp;
+ c_pkt.type =3D CMD_PKT;
+ c_pkt.opcode =3D hci_put_opcode(WRITE_PIN_TYPE, HCI_HC);
+ c_pkt.data[0] =3D type;
+ c_pkt.len =3D 1;=09
+ if((tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HD=
R_LEN, DEFAULT_TIMEOUT)) < 0) {
+ return tmp;
+ }
+ return result_param;
}
=20
/* Sends a connect request to the BT unit with the address bd_addr */
|