|
From: Peter K. <pk...@us...> - 2001-04-17 16:05:12
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.164 1.165=20=20=20=20=20=20=20=20=20=20=20
bt_proc.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20
hci_vendor.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Clean-up of functions to get HW vendor and firmware version.
The diff of the modified file(s):
--- bluetooth.c 2001/04/17 12:07:57 1.164
+++ bluetooth.c 2001/04/17 16:05:11 1.165
@@ -183,6 +183,7 @@
static void bt_handle_indata(const __u8 *data, s32 count);
#endif
=20
+static void bt_show_version(void);
static void bt_init_stack(void);
static s32 bt_ctrl_init(void);
static s32 bt_connect(u8 *bd_addr, u32 con_id);
@@ -272,6 +273,7 @@
static struct termios *bt_termios[BT_NBR_PORTS];=20
static struct termios *bt_termios_locked[BT_NBR_PORTS];
=20
+#ifdef BT_USELINEBUF
/* temp buffer used to store data received at upper tty when line is not=
=20
active yet */
=20
@@ -286,6 +288,7 @@
} tty_linebuffer;
=20
static tty_linebuffer tty_linebuf;
+#endif /* BT_USELINEBUF */
=20
static struct timer_list bt_timer;
=20
@@ -703,7 +706,7 @@
extern void test_process_cmd(unsigned char *cmd, s32 size);
u8 cmd[size];
copy_from_user(cmd, (s32*)arg, size);
- printk("TEST_COMMAND ", cmd, size);
+ printk("TEST_COMMAND %d %d\n", cmd, size);
test_process_cmd(cmd, size);
}
=20
@@ -1977,7 +1980,7 @@
s32 procfs_status =3D -1;
#endif
=20
- show_bt_version();
+ bt_show_version();
=20
/* Initialize the tty_driver structure */
=20=09
@@ -2170,6 +2173,12 @@
return 0; /*success*/
}
=20
+static void
+bt_show_version(void)
+{
+ printk("Bluetooth Driver v1.3, Copyright (c) 2000, 2001 Axis Communicatio=
ns AB\n");
+}
+
s32
bt_initiated()
{
@@ -2205,7 +2214,7 @@
=20=09
DSYS("Initialising Bluetooth Stack\n");
=20
- show_bt_vendor();
+ bt_show_vendor();
hci_init();
l2cap_init();
=20
@@ -2317,12 +2326,6 @@
bt_ctrl.session[line].rfcomm =3D NULL;
bt_ctrl.session[line].dlci =3D 0;=20
bt_ctrl.session[line].state =3D BT_INACTIVE;
-}
-
-void
-show_bt_version(void)
-{
- printk("Bluetooth Driver v1.2, Copyright (c) 2000 Axis Communications AB\=
n");
}
=20
u8 *statename(s32 state)
--- bt_proc.c 2001/03/02 21:52:15 1.20
+++ bt_proc.c 2001/04/17 16:05:11 1.21
@@ -151,11 +151,8 @@
=20
/* HW Info */
len +=3D sprintf(buf + len, "\n[Hardware]\n");
- len +=3D sprintf(buf + len, " %s ",
- get_hw_name());
-=09
- len +=3D sprintf(buf + len, "firmware info: %s\n",=20
- (char*)&bt_hw_firmware_info);
+ len +=3D sprintf(buf + len, "Vendor: %s\n", bt_hw_vendor());
+ len +=3D sprintf(buf + len, "Firmware info: %s\n", bt_hw_firmware());
=20=09
/* print all active sessions */
=20
--- hci_vendor.c 2001/04/17 10:00:26 1.22
+++ hci_vendor.c 2001/04/17 16:05:11 1.23
@@ -83,6 +83,8 @@
/* Digianswer defines */
#endif
=20
+#define BT_HW_INFO_MAX 255
+
/****************** LOCAL VARIABLE DECLARATION SECTION *******************=
***/
=20
/* These are declared in hci.c */
@@ -98,7 +100,7 @@
=20
extern hci_controller hci_ctrl;
=20
-u8 bt_hw_firmware_info[255];
+static u8 bt_hw_firmware_info[BT_HW_INFO_MAX+1];
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
=20
@@ -214,12 +216,11 @@
=20=20=20=20=20
case ERICSSON_READ_REVISION_INFORMATION:
release_cmd_timer();
- printk("Ericsson HW revision info: %s\n\n",
- (r_val + 1));
+ printk("Ericsson HW revision info: %s\n\n", r_val + 1);
=20=20=20=20=20
/* Store this for later retrieval */
- memcpy(&bt_hw_firmware_info, r_val + 1, strlen(r_val+1));
- bt_hw_firmware_info[strlen(r_val+1)]=3D0;
+ strncpy(bt_hw_firmware_info, r_val + 1, BT_HW_INFO_MAX);
+ bt_hw_firmware_info[BT_HW_INFO_MAX] =3D '\0';
=20
wake_up_interruptible(&hci_wq);
break;
@@ -265,7 +266,7 @@
}
=20
char*
-get_hw_name(void)
+bt_hw_vendor(void)
{
return "Ericsson";
}
@@ -379,7 +380,7 @@
}
=20
char*
-get_hw_name(void)
+bt_hw_vendor(void)
{
return "Digianswer";
}
@@ -445,7 +446,7 @@
}
=20
char*
-get_hw_name(void)
+bt_hw_vendor(void)
{
return "CSR";
}
@@ -455,6 +456,8 @@
/************************* HW_NOINIT and HW_GENERIC **********************=
****/
/*************************************************************************=
****/
=20
+#define VENDOR " [Generic]"
+
s32=20
hci_set_bd_addr(u8 bd[6])
{
@@ -489,14 +492,20 @@
}
=20
char*
-get_hw_name(void)
+bt_hw_vendor(void)
{
return "Unknown hardware";
}
#endif
=20
+char*
+bt_hw_firmware(void)
+{
+ return bt_hw_firmware_info;
+}
+
void
-show_bt_vendor()
+bt_show_vendor()
{
DSYS("Current HW: %s\n", VENDOR);
}
|