|
From: Anders J. <and...@us...> - 2003-11-17 14:57:36
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bluetooth.c 1.244 1.245=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added IOCTL to enable/disable on-board LED, only for CRIS.
The diff of the modified file(s):
--- bluetooth.c 2003/11/12 10:15:05 1.244
+++ bluetooth.c 2003/11/17 14:56:55 1.245
@@ -185,7 +185,7 @@ typedef struct bt_inbuffer
=20
#define NO_BLUETOOTH_ACTIVITY 0
#define BLUETOOTH_ACTIVITY 1
-
+static int ledenable =3D 1;
static struct timer_list bt_clear_led_timer;
static int bt_led_next_time;
static int bt_led_active;
@@ -1661,6 +1661,28 @@ hci_inq_exit0:
break;
}=20=20=20
=20
+ case BTLEDSTATUS:
+ {=20=20=20
+#ifdef __CRIS__
+ u8 enable;
+ u8 writeparam;
+ GET_USER(tmp, (s32*)arg);
+ writeparam =3D (u8)(tmp & 0xf0);
+ enable =3D (u8)(tmp & 0x0f);
+ if(writeparam) {
+ ledenable =3D enable;
+ if(!ledenable)
+ {
+ LED_ACTIVE_SET(LED_OFF);
+ }
+ } else {
+ tmp =3D ledenable;
+ put_user(tmp, (s32*)arg);
+ }
+#endif
+ return 0;=09
+ }
+=09
default:
return -ENOIOCTLCMD;
}
@@ -2708,6 +2730,7 @@ bt_hangupline(s32 line)
static void
bt_clear_led(unsigned long dummy)
{
+=09
if (bt_led_active && jiffies > bt_led_next_time) {
bt_set_leds(NO_BLUETOOTH_ACTIVITY);
=20
@@ -2735,11 +2758,13 @@ bt_flash_led(void)
static void
bt_set_leds(int active)
{
+ if(ledenable) {=09
if ((!hci_ctrl.nbr_of_connections && active =3D=3D BLUETOOTH_ACTIVITY) ||
(hci_ctrl.nbr_of_connections && active =3D=3D NO_BLUETOOTH_ACT=
IVITY)) {
LED_ACTIVE_SET(bt_dfu_mode(-1) ? LED_ORANGE : LED_GREEN);
} else {
LED_ACTIVE_SET(LED_OFF);
+ }
}
}
=20
|