|
From: Peter K. <pk...@us...> - 2001-09-10 11:17:12
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.192 1.193=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Clean-up (basically use of __FUNCTION__ for debug messages, and a
rewrite of bt_reset_phys_hw()).
The diff of the modified file(s):
--- bluetooth.c 2001/09/07 12:53:24 1.192
+++ bluetooth.c 2001/09/10 11:17:11 1.193
@@ -414,7 +414,7 @@
s32 line =3D GET_TTYLINE(tty);
s32 ret_val;
=20=09
- BT_DRIVER("bt_open on line %d\n", line);=09
+ BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09
=20=09
ret_val =3D bt_register_tty(tty) ;
=20
@@ -432,7 +432,7 @@
{
s32 line =3D GET_TTYLINE(tty);
=20
- BT_DRIVER("bt_close on line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Line %d\n", line);
=20
/* FIXME - flush channels etc */
/* close rfcomm channel associated with this tty ?? */
@@ -446,14 +446,14 @@
static void
bt_put_char(struct tty_struct *tty, u8 ch)
{
- BT_DRIVER("bt_put_char %c\n", ch);
+ BT_DRIVER(__FUNCTION__ ": %c\n", ch);
bt_write_top(tty, 0, &ch, 1);
}
=20
static void
bt_flush_chars(struct tty_struct *tty)
{
- BT_DRIVER("bt_flush_chars\n");
+ BT_DRIVER(__FUNCTION__ "\n");
if (sertty !=3D NULL && sertty->driver.flush_chars)
sertty->driver.flush_chars(sertty);
}
@@ -464,7 +464,7 @@
{
s32 n =3D buf_write_room();
=20
- BT_DRIVER("bt_write_room : %d\n", n);
+ BT_DRIVER(__FUNCTION__ ": %d\n", n);
return n;
}
=20
@@ -473,7 +473,7 @@
{
u16 n =3D buf_byte_count(GET_TTYLINE(tty));
=20
- BT_DRIVER("bt_chars_in_buffer : %d\n", n);
+ BT_DRIVER(__FUNCTION__ ": %d\n", n);
return n;
}
=20
@@ -482,7 +482,7 @@
{
/* Clearing the buffers here may lead to them being cleared before
they are sent when diconnecting a connection */
- BT_DRIVER("bt_flush_buffer, ignored\n");
+ BT_DRIVER(__FUNCTION__ ": Ignored\n");
#if 0
bt_tx_buf* tx_buf;
while ((tx_buf =3D get_bt_buf())) {
@@ -496,7 +496,6 @@
__bt_ioctl(struct tty_struct *tty, struct file * file,
u32 cmd, unsigned long arg)
{
-#define FNC "bt_ioctl: "
s32 tmp;
u32 utmp;
s32 err =3D 0;
@@ -533,55 +532,54 @@
=20
/* Copy arguments to kernel space */
=20
- BT_DRIVER(FNC"Copying arguments from user to kernel space\n");
+ BT_DRIVER(__FUNCTION__ ": Copying arguments from user to kernel space\n"=
);
copy_from_user(&sdpRequest, (s32*)arg, size);
=20=09=09
/* Now execute the request */
=20
- BT_DRIVER(FNC"Executing bt_execute_sdp_request\n");
+ BT_DRIVER(__FUNCTION__ ": Executing bt_execute_sdp_request\n");
=20
if ((returnValue =3D bt_execute_sdp_request(&sdpRequest)) >=3D 0) {
=20
/* Copy the data back to user space and return */
=20
- BT_DRIVER(FNC"Copying data back to user space\n");
+ BT_DRIVER(__FUNCTION__ ": Copying data back to user space\n");
copy_to_user((s32*)arg, &sdpRequest, size);
}
=20
return returnValue;
}
+
#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER=20=20
case BT_GETCACHEDLINKKEY:
{
unsigned char link_key_info[6 + 16];
=20
/* Now execute the request */
- BT_DRIVER(FNC"Executing sec_man_get_cached_link_key\n");
+ BT_DRIVER(__FUNCTION__ ": Executing sec_man_get_cached_link_key\n");
=20
sec_man_get_cached_link_key(link_key_info);
=20
- BT_DRIVER(FNC"Copying data back to user space\n");
+ BT_DRIVER(__FUNCTION__ ": Copying data back to user space\n");
copy_to_user((s32*)arg, link_key_info, 6 + 16);
=20
return 0;
}
#endif=20=20=20=20=20=20=20=20
+
case BTCONNECT:=20
- {
/* argument is an object with all info to start a remote=20
connection */
-
copy_from_user(&btcon, (s32*)arg, size);
=20
- BT_DRIVER(FNC"BTCONNECT\n");
-=09=09=09=20=20=20=20=20=20=20
+ BT_DRIVER(__FUNCTION__ ": BTCONNECT\n");
return bt_connect(btcon.bd, btcon.id);
- }
=20=09
case BTDISCONNECT:
{
s32 con_id;
- BT_DRIVER(FNC"BTDISCONNECT\n");
+
+ BT_DRIVER(__FUNCTION__ ": BTDISCONNECT\n");
copy_from_user(&con_id, (s32*)arg, size);
return bt_disconnect(con_id);
}
@@ -589,6 +587,7 @@
case BTWAITFORCONNECTION:
{
s32 line;
+
copy_from_user(&line, (s32*)arg, size);
=20
/* check if we already have a connection otherwise wait... */
@@ -604,23 +603,21 @@
}
=20=09
case BTWAITNEWCONNECTIONS:
- {
/* wait for any new connections coming in */
BT_DRIVER("Waiting for new connections\n");
interruptible_sleep_on(&bt_ctrl.any_wq);
break;
- }
=20
case BTISLOWERCONNECTED:
{
s32 line;=09=20=20
+
copy_from_user(&line, (s32*)arg, size);
return (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED);
}
=20=09
case BTINITSTACK:
return bt_init_stack();
- break;
=20
case BTSHUTDOWN:
bt_shutdown();
@@ -632,7 +629,7 @@
s32 line;=09=20=20
u16 i;
=20
- BT_DRIVER(FNC"BTREADREMOTEBDADDR\n");
+ BT_DRIVER(__FUNCTION__ ": BTREADREMOTEBDADDR\n");
=20
copy_from_user(&line, (s32*)arg, size);
=20
@@ -659,7 +656,7 @@
break;
=20
case BTFIRMWAREINFO:
- BT_DRIVER(FNC"BTFIRMWAREINFO\n");
+ BT_DRIVER(__FUNCTION__ ": BTFIRMWAREINFO\n");
copy_to_user((u8*)arg, bt_hw_firmware(), strlen(bt_hw_firmware())+1);
break;
=20
@@ -672,6 +669,7 @@
case HCITESTCONNECTREQ:
{
u8 bd[6];
+
copy_from_user(bd, (s32*)arg, 6);
return hci_test_connect_req(bd);
}
@@ -698,7 +696,7 @@
u8 lap[3];
int ret;
=20=09=09
- BT_DRIVER(FNC"HCINQUIRY\n");
+ BT_DRIVER(__FUNCTION__ ": HCINQUIRY\n");
=20=09=09
copy_from_user(in_param, (s32*)arg, 8);
=20
@@ -728,7 +726,7 @@
u8 param[size];
s32 result;
=20=09=09
- BT_DRIVER(FNC"HCILINKKEYREPLY\n");
+ BT_DRIVER(__FUNCTION__ ": HCILINKKEYREPLY\n");
copy_from_user(param, (s32*)arg, size);
/* First part of param contains BD address, last part link key,
see Bluetooth specification for more info*/
@@ -742,7 +740,7 @@
u8 bd_addr[size];
s32 result;
=20=09=09
- BT_DRIVER(FNC"HCILINKKEYNEGATIVEREPLY\n");
+ BT_DRIVER(__FUNCTION__ ": HCILINKKEYNEGATIVEREPLY\n");
copy_from_user(bd_addr, (s32*)arg, size);
result =3D hci_link_key_request_negative_reply(bd_addr);
put_user(result, (s32*)arg);
@@ -754,7 +752,7 @@
u8 param[size];
s32 result;
=20=09=09
- BT_DRIVER(FNC"HCIPINCODEREPLY\n");
+ BT_DRIVER(__FUNCTION__ ": HCIPINCODEREPLY\n");
copy_from_user(param, (s32*)arg, size);
/* First part of param contains BD address, second part of the
pin code, and the last part och the pin code length */
@@ -768,7 +766,7 @@
u8 bd_addr[size];
s32 result;
=20=09=09
- BT_DRIVER(FNC"HCIPINCODENEGATIVEREPLY\n");
+ BT_DRIVER(__FUNCTION__ ": HCIPINCODENEGATIVEREPLY\n");
copy_from_user(bd_addr, (s32*)arg, size);
result =3D hci_pin_code_request_negative_reply(bd_addr);
put_user(result, (s32*)arg);
@@ -779,7 +777,7 @@
{
u8 bd_addr[size];
=20=09=09
- BT_DRIVER(FNC"HCIAUTHENTICATION_REQUESTED\n");
+ BT_DRIVER(__FUNCTION__ ": HCIAUTHENTICATION_REQUESTED\n");
copy_from_user(bd_addr, (s32*)arg, size);
hci_authentication_requested_bd(bd_addr);
break;
@@ -789,7 +787,7 @@
{
u8 param[7];
=20=09=09=09=09
- BT_DRIVER(FNC"HCISETCONNECTION_ENCRYPTION\n");
+ BT_DRIVER(__FUNCTION__ ": HCISETCONNECTION_ENCRYPTION\n");
copy_from_user(param, (s32*)arg, size);
hci_set_connection_encryption_bd(param + 1, *param);
break;
@@ -799,6 +797,7 @@
case HCISWITCHROLE:
{
u8 param[size];
+
copy_from_user(param, (s32*)arg, size);
=20=09=09
hci_switch_role(¶m[0], param[6]);
@@ -817,7 +816,8 @@
case HCICREATE_NEW_UNIT_KEY:
{
s32 result;
- BT_DRIVER(FNC"HCICREATE_NEW_UNIT_KEY\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCICREATE_NEW_UNIT_KEY\n");
result =3D hci_create_new_unit_link_key();
put_user(result, (s32*)arg);
break;
@@ -828,7 +828,7 @@
s32 result;
u8 param[size];
=20
- BT_DRIVER(FNC"HCIREADSTOREDLINKKEY\n");
+ BT_DRIVER(__FUNCTION__ ": HCIREADSTOREDLINKKEY\n");
copy_from_user(param, (s32*)arg, size);
=20
result =3D hci_read_stored_link_key(param + 1, *param);
@@ -841,7 +841,7 @@
s32 result;
u8 param[size];
=20=09=09
- BT_DRIVER(FNC"HCIWRITESTOREDLINKKEY\n");
+ BT_DRIVER(__FUNCTION__ ": HCIWRITESTOREDLINKKEY\n");
copy_from_user(param, (s32*)arg, size);
=20=09=09
result =3D hci_write_stored_link_key(param, param + 6);
@@ -854,7 +854,7 @@
s32 result;
u8 param[size];
=20
- BT_DRIVER(FNC"HCIDELETESTOREDLINKKEY\n");
+ BT_DRIVER(__FUNCTION__ ": HCIDELETESTOREDLINKKEY\n");
copy_from_user(param, (s32*)arg, size);
=20
result =3D hci_delete_stored_link_key(param + 1, *param);
@@ -867,7 +867,8 @@
/* FIXME: If we send the length of the string too, we don't
have to copy all the 248 byte... */
u8 local_name[248];
- BT_DRIVER(FNC"HCISETLOCALNAME\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCISETLOCALNAME\n");
copy_from_user(local_name, (s32*)arg, 248);
hci_change_local_name(local_name);
break;
@@ -888,6 +889,7 @@
case HCIWRITEPAGESCANACTIVITY:
{
u32 par[2];
+
copy_from_user(&par, (s32*)arg, size);
BT_DRIVER("Setting write page scan activity : [0x%x,0x%x]\n",=20
par[0], par[1]);
@@ -898,7 +900,8 @@
case HCIWRITECLASSOFDEVICE:
{
u8 class_of_device[3];
- BT_DRIVER(FNC"HCIWRITECLASSOFDEVICE\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCIWRITECLASSOFDEVICE\n");
copy_from_user(class_of_device, (s32*)arg, size);
hci_write_class_of_device(class_of_device);
break;
@@ -907,7 +910,8 @@
case HCIREAD_AUTHENTICATION_ENABLE:
{
s32 result =3D hci_read_authentication_enable();
- BT_DRIVER(FNC"HCIREAD_AUTHENTICATION_ENABLE\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCIREAD_AUTHENTICATION_ENABLE\n");
put_user(result, (s32*)arg);
break;
}
@@ -916,7 +920,8 @@
{
u8 enable;
s32 result =3D 0;
- BT_DRIVER(FNC"HCIWRITE_AUTHENTICATION_ENABLE\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCIWRITE_AUTHENTICATION_ENABLE\n");
GET_USER(tmp, (s32*)arg);
=20
enable =3D (u8)(tmp & 0xff);
@@ -928,7 +933,8 @@
case HCIREAD_ENCRYPTION_MODE:
{
s32 result =3D hci_read_encryption_mode();
- BT_DRIVER(FNC"HCIREAD_ENCRYPTION_MODE\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCIREAD_ENCRYPTION_MODE\n");
put_user(result, (s32*)arg);
break;
}
@@ -937,7 +943,8 @@
{
u8 enable;
s32 result =3D 0;
- BT_DRIVER(FNC"HCIWRITE_ENCRYPTION_MODE\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCIWRITE_ENCRYPTION_MODE\n");
GET_USER(tmp, (s32*)arg);
=20
enable =3D (u8)(tmp & 0xff);
@@ -950,7 +957,8 @@
case HCISET_EVENT_FILTER:
{
u8 param[size];
- BT_DRIVER(FNC"HCISET_EVENT_FILTER\n");
+
+ BT_DRIVER(__FUNCTION__ ": HCISET_EVENT_FILTER\n");
copy_from_user(param, (s32*)arg, size);
=20=09=09
hci_set_event_filter(param);
@@ -960,23 +968,24 @@
/* Informational Parameters */
=20
case HCIREADLOCALBDADDR:
- BT_DRIVER(FNC"HCIREADLOCALBDADDR\n");
-=09=09
- hci_read_local_bd(bd_addr);
-
{
BD_ADDR rev_bd;
u16 i;
+
+ BT_DRIVER(__FUNCTION__ ": HCIREADLOCALBDADDR\n");
+=09=09
+ hci_read_local_bd(bd_addr);
+
/* return as big endian */
for (i =3D 0; i < 6; i++) {
rev_bd[5-i] =3D bd_addr[i];
}
copy_to_user((s32*)arg, rev_bd, 6);
- }
break;
+ }
=20
case HCIREADCOUNTRYCODE:
- BT_DRIVER(FNC"HCIREADCOUNTRYCODEn");
+ BT_DRIVER(__FUNCTION__ ": HCIREADCOUNTRYCODE\n");
=20=09=09
tmp =3D hci_read_country_code();
put_user(tmp, (s32*) arg);
@@ -995,16 +1004,17 @@
case HCISETBAUDRATE:
{=09
s32 tmp;
+
/* Set baudrate in hardware */=20
GET_USER(tmp, (s32*)arg);
- BT_DRIVER(FNC"Setting baudrate in host controller to %d\n", tmp);
+ BT_DRIVER(__FUNCTION__ ": Setting baudrate in host controller to %d\n", =
tmp);
tmp =3D hci_set_baudrate(tmp);
return tmp;
}
=20=09
case HCIWRITEBDADDR:
copy_from_user(&bd_addr, (s32*)arg, size);
- BT_DRIVER(FNC"Setting BD_ADDR to \n");
+ BT_DRIVER(__FUNCTION__ ": Setting BD_ADDR to\n");
print_data("bd :",(u8*)bd_addr,6);
hci_set_bd_addr(bd_addr);
break;
@@ -1048,7 +1058,7 @@
copy_from_user(&bd, (u8*)arg, 6);
copy_from_user(&type, (u8*)arg + 6, 2);
=20
- BT_DRIVER("l2ca_getinfo : type %d\n", type);
+ BT_DRIVER("BTGETINFO: Type %d\n", type);
=20=09=09
return l2ca_getinfo(bd, type);
}
@@ -1082,16 +1092,13 @@
}
=20
case BTSETBCSPMODE:
- {
GET_USER(tmp, (s32*)arg);
=20
BT_DRIVER("BTSETBCSPMODE: %d\n", tmp);
=20=09=09
tmp =3D bt_use_bcsp(tmp);
put_user(tmp, (s32*)arg);
-
return 0;
- }
=20
#ifdef CONFIG_BLUETOOTH_CSR
/* | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])| */
@@ -1111,26 +1118,21 @@
=20
#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP
case BTINITBCSP:
- {
BT_DRIVER("BTINITBCSP\n");
if (bcsp_init() < 0) {
printk("Sync failed\n");
return -ETIMEDOUT;
}
return 0;
- }
=20
case BT_SET_DFU_MODE:
- {
GET_USER(tmp, (s32*)arg);
=20
BT_DRIVER("BT_SET_DFU_MODE: %d\n", tmp);
=20
tmp =3D bt_dfu_mode(tmp);
put_user(tmp, (s32*)arg);
-
return 0;
- }
=20
case BT_SEND_DFU_COMMAND:
{
@@ -1174,10 +1176,9 @@
=20
default:=09=09
return -ENOIOCTLCMD;
-
}
+
return 0;
-#undef FNC
}
=20
static s32
@@ -1186,9 +1187,9 @@
{
s32 tmp;
=20
-// printk(__FUNCTION__"[%s:%x] lock !\n", current->comm, cmd);
+// printk(__FUNCTION__ ": [%s:%x] lock !\n", current->comm, cmd);
down(&ioctl_sem);
-// printk(__FUNCTION__"[%s:%x] running...\n", current->comm, cmd);
+// printk(__FUNCTION__ ": [%s:%x] running...\n", current->comm, cmd);
tmp =3D __bt_ioctl(tty, file, cmd, arg);
up(&ioctl_sem);
return tmp;
@@ -1197,43 +1198,43 @@
static void
bt_throttle(struct tty_struct * tty)
{
- BT_DRIVER("bt_throttle (nothing done)\n");
+ BT_DRIVER(__FUNCTION__ ": Nothing done\n");
}
=20
static void
bt_unthrottle(struct tty_struct * tty)
{
- BT_DRIVER("bt_unthrottle (nothing done)\n");
+ BT_DRIVER(__FUNCTION__ ": Nothing done\n");
}
=20
=20
static void
bt_set_termios(struct tty_struct *tty, struct termios *old_termios)
{
- BT_DRIVER("bt_set_termios - forwarding to serial driver\n");
+ BT_DRIVER(__FUNCTION__ ": Forwarding to serial driver\n");
=20
/* modify serial tty not bt tty */
if (sertty !=3D NULL)
sertty->driver.set_termios(sertty, old_termios);
else
- D_ERR("bt_set_termios : no sertty set !!\n");
+ D_ERR(__FUNCTION__ ": No sertty set!!\n");
}
=20
static void bt_start(struct tty_struct *tty)
{
- BT_DRIVER("bt_start (nothing done)\n");
+ BT_DRIVER(__FUNCTION__ ": Nothing done\n");
}
=20
static void
bt_stop(struct tty_struct *tty)
{
- BT_DRIVER("bt_stop (nothing done)\n");
+ BT_DRIVER(__FUNCTION__ ": Nothing done\n");
}
=20
void
bt_hangup(struct tty_struct *tty)
{
- BT_DRIVER("bt_hangup on line %d (nothing done) pid %d (%s)\n",
+ BT_DRIVER(__FUNCTION__ ": Line %d (nothing done) pid %d (%s)\n",
GET_TTYLINE(tty), current->pid, current->comm);
}
=20
@@ -1260,7 +1261,7 @@
#endif
{
/* should not read data directly over serial tty */
- BT_LDISC("bt_tty_read (disabled)\n");
+ BT_LDISC(__FUNCTION__ ": Disabled\n");
return 0;
}
=20
@@ -1282,7 +1283,7 @@
{
/* should simply discard data since ttySx only exists for internal use
*/
- BT_LDISC("bt_tty_write (%d) done !x\n", count);
+ BT_LDISC(__FUNCTION__ ": (%d) done!\n", count);
=20=20=20
return tty->driver.write(tty, 1/*from user*/, data, count);
}
@@ -1292,19 +1293,15 @@
bt_tty_ioctl(struct tty_struct *tty, struct file * file,
u32 cmd, unsigned long arg)
{
-#define FNC "bt_tty_ioctl: "
-
switch (cmd) {
-
default:
/* forward rest to n_tty line discipline, it takes care of
termios settings etc, the rest goes to the tty driver=20
(serial driver) */
- BT_LDISC(FNC"forwarding ioctl 0x%x to n_tty line disc\n", cmd);
+ BT_LDISC(__FUNCTION__ ": Forwarding ioctl 0x%x to n_tty line disc\n", cm=
d);
return n_tty_ioctl(tty, file, cmd, arg);
}
return -ENOIOCTLCMD;
-#undef FNC
}
=20
#ifdef __USE_OLD_SYMTAB__
@@ -1315,7 +1312,7 @@
bt_tty_select(struct tty_struct *tty, struct inode *inode,
struct file *filp, s32 sel_type, select_table * wait)
{
- BT_LDISC("bt_tty_select (nothing done!)\n");
+ BT_LDISC(__FUNCTION__ ": Nothing done!\n");
return 0;
}
#else
@@ -1326,7 +1323,7 @@
struct file *file,
struct poll_table_struct *wait)
{
- BT_LDISC("bt_tty_poll (nothing done!)\n");
+ BT_LDISC(__FUNCTION__ ": Nothing done!\n");
return 0;
}
#endif
@@ -1334,7 +1331,7 @@
static s32
bt_tty_open(struct tty_struct *tty)
{
- BT_LDISC("bt_tty_open\n");
+ BT_LDISC(__FUNCTION__ "\n");
DSYS("Setting BT driver to use serial tty\n");
sertty =3D tty;
return 0;
@@ -1374,7 +1371,7 @@
static s32
bt_tty_room(struct tty_struct *tty)
{
- BT_LDISC("bt_tty_room (return 65536 !)\n");
+ BT_LDISC(__FUNCTION__ ": Return 65536!\n");
return 65536; /* We can handle an infinite amount of data. :-) */
}
=20
@@ -1386,75 +1383,44 @@
static void
bt_tty_wakeup(struct tty_struct *tty)
{
- printk("bt_tty_wakeup : not done\n");
+ printk(__FUNCTION__ ": Nothing done\n");
}
=20
void bt_reset_phys_hw(void)
{
-#define FNC __FUNCTION__": "=09
#ifdef __CRIS__
-=09
#ifdef CONFIG_BLUETOOTH_CSR
-#define CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH
+ int do_reset =3D 1;
#else
-#undef CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH
+ int do_reset =3D 0;
#endif
=20
#if defined(CONFIG_BLUETOOTH_RESET_PA7)
-#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
- BT_DRIVER(FNC"Resetting hardware (PA7) Active High\n");
- REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1);
- udelay(1000);
- REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0);
-#else
- BT_DRIVER(FNC"Resetting hardware (PA7) Active Low\n");
- REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0);
+ BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin PA7 (Act=
ive %s)\n", (do_reset ? "High" : "Low"));
+ REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, do_reset);
udelay(1000);
- REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1);
-#endif
+ REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, !do_reset);
#elif defined(CONFIG_BLUETOOTH_RESET_PB5)
-#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
- BT_DRIVER(FNC"Resetting hardware (PB5) Active High\n");
- REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1);
- udelay(1000);
- REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0);
-#else
- BT_DRIVER(FNC"Resetting hardware (PB5) Active Low\n");
- REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0);
+ BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin PB5 (Act=
ive %s)\n", (do_reset ? "High" : "Low"));
+ REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, do_reset);
udelay(1000);
- REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1);
-#endif
+ REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, !do_reset);
#elif defined(CONFIG_BLUETOOTH_RESET_G10)
-#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
- BT_DRIVER(FNC"Resetting hardware (G10) Active High\n");
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1);
- udelay(1000);
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0);
-#else
- BT_DRIVER(FNC"Resetting hardware (G10) Active Low\n ");
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0);
+ BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin G10 (Act=
ive %s)\n", (do_reset ? "High" : "Low"));
+ REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, do_reset);
udelay(1000);
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1);
-#endif
+ REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, !do_reset);
#elif defined(CONFIG_BLUETOOTH_RESET_G11)
-#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
- BT_DRIVER(FNC"Resetting hardware (G11) Active High\n");
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1);
- udelay(1000);
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0);
-#else
- BT_DRIVER(FNC"Resetting hardware (G11) Active Low\n ");
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0);
+ BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin G11 (Act=
ive %s)\n", (do_reset ? "High" : "Low"));
+ REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, do_reset);
udelay(1000);
- REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1);
-#endif
+ REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, !do_reset);
#else
- D_ERR(FNC"Resetting hardware : No reset pin defined\n");
+ D_ERR(__FUNCTION__ ": Resetting Bluetooth hardware: No reset pin defined\=
n");
#endif
#else
- BT_DRIVER(FNC"Do not know how to reset the bluetooth hardware!\n");
-#endif
-#undef FNC
+ BT_DRIVER(__FUNCTION__ ": Do not know how to reset the Bluetooth hardware=
!\n");
+#endif /* __CRIS__ */
}
=20
/************************/
@@ -1462,8 +1428,7 @@
/************************/
=20
/*
- * HCI calls this function to write to lower layer=20
- * driver
+ * HCI calls this function to write to lower layer driver
*/
=20
s32
@@ -1480,10 +1445,8 @@
bt_write_lower_driver_real(u8 *data, s32 len)
#endif
{
-#define FNC "bt_write_lower_driver: "
-
if (len < 0) { /* (!) */
- D_ERR("Can't write neg length...\n");
+ D_ERR(__FUNCTION__ ": Can't write negative length...\n");
return 0;
}
=20=09
@@ -1497,7 +1460,7 @@
s32 sent;
=20=09=09
if ((tmp =3D sertty->driver.write_room(sertty)) < len){
- printk("ser tx buffers can't send all, wait (%d/%d)\n",
+ printk(__FUNCTION__ ": ser tx buffers can't send all, wait (%d/%d)\n",
tmp, len);
return 0;
} else {
@@ -1507,7 +1470,7 @@
}
=20=09=09
if (sent !=3D len) {
- printk(FNC"Only sent %d of total %d\n",=20
+ printk(__FUNCTION__ ": Only sent %d of total %d\n",=20
sent, len);
/* fixme -- discard packet and add tx error in stat */
}
@@ -1515,10 +1478,9 @@
=20
return sent;
} else {
- D_ERR(FNC"no sertty is set\n");
+ D_ERR(__FUNCTION__ ": No sertty is set\n");
}
return 0;
-#undef FNC
}
=20
/*
@@ -1552,7 +1514,6 @@
bt_write_top(struct tty_struct * tty, s32 from_user,
const u8 *buf, s32 count)
{
-#define FNC "bt_write_top"
s32 line =3D GET_TTYLINE(tty);
s32 bytes_sent;
u32 rfcomm_conid;
@@ -1564,13 +1525,13 @@
bt =3D (bt_session *)tty->driver_data;
=20=09
if ((bt->rfcomm !=3D NULL) && (bt->rfcomm->magic !=3D RFCOMM_MAGIC)) {
- D_ERR(FNC": rfcomm magic failed (0x%x !=3D 0x%x)\n",=20
+ D_ERR(__FUNCTION__ ": rfcomm magic failed (0x%x !=3D 0x%x)\n",=20
bt->rfcomm->magic, RFCOMM_MAGIC);
return 0;
}
=20
if (SESSIONSTATE(line) !=3D BT_ACTIVE) {
- D_WARN("bt_write_top : line %d is not in active state\n",
+ D_WARN(__FUNCTION__ ": Line %d is not in active state\n",
line);
return 0;
}
@@ -1592,7 +1553,6 @@
bt_stat.bytes_sent +=3D bytes_sent;
=20
return bytes_sent;
-#undef FNC
}
=20
/*
@@ -1618,11 +1578,11 @@
=20
#ifdef BT_USELINEBUF
/* WINDOZE FIX */
- BT_DATA("bt_receive_top : (%d) line %d not active yet..., buffer it !\n"=
, len, line);
+ BT_DATA(__FUNCTION__ ": (%d) line %d not active yet..., buffer it !\n", =
len, line);
/* FIXME -- only buffer first packet ? */
bt_linebuf_add(line, data, len);
#else
- BT_DATA("bt_receive_top : (%d) line %d not active yet... silent discard!=
\n", len, line);
+ BT_DATA(__FUNCTION__ ": (%d) line %d not active yet... silent discard!\n=
", len, line);
#endif
return 0;
}
@@ -1634,7 +1594,7 @@
if (upper_tty) {
upper_tty->ldisc.receive_buf(upper_tty, data, NULL, len);=20=20
} else {
-// D_ERR("No upper tty registered !!!\n");
+// D_ERR(__FUNCTION__ ": No upper tty registered !!!\n");
return -1;
}
return 0;
@@ -1644,7 +1604,6 @@
=20
void bt_feedstack(void)
{
-#define FNC "bt_feedstack: "
struct tty_struct *upper_tty =3D NULL;
s32 check_line;
s32 nbr_checked =3D 0;
@@ -1671,7 +1630,7 @@
check_line =3D bt_ctrl.tty_last_unthrottled+1;=09
}
=20=09=09
-// BT_DATA("bt_feedstack : start on line %d\n", check_line);
+// BT_DATA(__FUNCTION__ ": Start on line %d\n", check_line);
=20=09=09
/* skip non-active and control port (last) */
while ((SESSIONSTATE(check_line) !=3D BT_ACTIVE) &&=20
@@ -1686,7 +1645,7 @@
if (nbr_checked > BT_NBR_DATAPORTS)
return;
=20
-// BT_DATA("bt_feedstack : wakeup line %d !\n", check_line);
+// BT_DATA(__FUNCTION__ ": Wakeup line %d !\n", check_line);
upper_tty =3D GET_UPPERTTY(check_line);
bt_ctrl.tty_last_unthrottled =3D check_line;
=20=09=09
@@ -1717,7 +1676,6 @@
// BT_DATA(" |X|<<*** [%d] (n_tty)\n", check_line);
wake_up_interruptible(&upper_tty->write_wait);
}
-#undef FNC
}
=20
/* Used to wait for dma to finish transmission */
@@ -1751,7 +1709,7 @@
if (hci_data.put >=3D hci_data.get) {
/* check for overruns... */
if (hci_data.put + count - BT_INBUFFER_SIZE >=3D hci_data.get) {
- D_ERR("bt_handle_indata : buffer overrun!\n");
+ D_ERR(__FUNCTION__ ": Buffer overrun!\n");
} else {
/* Calculate how much space there is left at the end=20
of the buffer */
@@ -1770,7 +1728,7 @@
/* hci_data.put < hci_data.get */
/* check for overruns ... */
if (hci_data.put + count >=3D hci_data.get) {
- D_ERR("bt_handle_indata: buffer overrun!\n");
+ D_ERR(__FUNCTION__ ": Buffer overrun!\n");
} else {
/* Copy the data to the buffer */
memcpy(hci_data.put, (u8*)data, count);
@@ -1878,8 +1836,6 @@
{
u8 line;=09=09=09=09
=20
-#define FNC "bt_connect : "
-=09
switch (GET_PSM(con_id)) {
case RFCOMM_LAYER:
{
@@ -1892,19 +1848,19 @@
/* check if we already have a connection otherwise wait... */
if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED)||
(SESSIONSTATE(line) =3D=3D BT_ACTIVE)) {
- D_WARN("already got connection on line %d\n",=20
+ D_WARN(__FUNCTION__ ": Already got connection on line %d\n",=20
GET_RFCOMMLINE(con_id));=20
return -1;
}=20
=20
bt_ctrl.session[line].connect_status =3D -1;
=20
- BT_DRIVER(FNC"Connecting srv ch %d on line %d\n",
+ BT_DRIVER(__FUNCTION__ ": Connecting srv ch %d on line %d\n",
srv_ch, line);
BT_DATADUMP("Remote BD : ", bd_addr, 6);
=20
if (rfcomm_connect_req(bd_addr, srv_ch, line) < 0){
- BT_DRIVER("bt_connect failed\n");
+ BT_DRIVER(__FUNCTION__ ": Failed\n");
return bt_ctrl.session[line].connect_status;
}
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
@@ -1931,14 +1887,14 @@
=20
if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) ||
(SESSIONSTATE(line) =3D=3D BT_ACTIVE)) {
- D_WARN("already got connection on line %d\n",
+ D_WARN(__FUNCTION__ ": Already got connection on line %d\n",
GET_SDPLINE(con_id));=20
return -1;
}
=20
/* Initiate the connection */
=20
- BT_DRIVER(FNC"Connecting SDP on line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Connecting SDP on line %d\n", line);
BT_DATADUMP("Remote BD : ", bd_addr, 6);
if ((sdp_connection_id =3D sdp_connect_req(bd_addr, line)) >=3D 0) {
=20=09=09=20=20
@@ -1972,7 +1928,7 @@
*/
bt_ctrl.session[line].connect_status =3D -ETIMEDOUT;
=20
- BT_DRIVER(FNC"sleep on line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Sleep on line %d\n", line);
interruptible_sleep_on(&bt_ctrl.connect_wq[line]);
=20
/*=20
@@ -1981,7 +1937,7 @@
* Therefore return the sdp_connection_id=20=20=20=20=20=20=20=20=20=20=
=20=20
*/
=20=09=09=09
- BT_DRIVER(FNC"Wake up - line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Wake up - line %d\n", line);
if (bt_ctrl.session[line].connect_status >=3D 0) {
return_value =3D sdp_connection_id;
} else {
@@ -1999,19 +1955,19 @@
case L2CAP_TEST2_LAYER:
case L2CAP_TEST3_LAYER:
line =3D (con_id & 0x0000ffff);
- BT_DRIVER(FNC"Connecting TEST_LAYER (psm %02X) on line %d\n", GET_PSM(co=
n_id), line);
+ BT_DRIVER(__FUNCTION__ ": Connecting TEST_LAYER (psm %02X) on line %d\n"=
, GET_PSM(con_id), line);
=20
/* Check the line to assure no other connections on it */
=20
if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) ||
(SESSIONSTATE(line) =3D=3D BT_ACTIVE)) {
- D_WARN("already got connection on line %d\n",
+ D_WARN(__FUNCTION__ ": Already got connection on line %d\n",
line);=20
return -1;
}
=20
if(test_connect_psmreq(bd_addr, GET_PSM(con_id)) < 0) {
- BT_DRIVER("bt_connect failed\n");
+ BT_DRIVER(__FUNCTION__ ": Failed\n");
return bt_ctrl.session[line].connect_status;
}
=20=20=20=20=20
@@ -2021,11 +1977,11 @@
return tcs_connect_req(bd_addr);
=20=09=20=20=20=20
default:=20=20=20=20
- BT_DRIVER(FNC"PSM %d not supported as client\n", GET_PSM(con_id));
+ BT_DRIVER(__FUNCTION__ ": PSM %d not supported as client\n",
+ GET_PSM(con_id));
break;
}
return -1;
-#undef FNC
}
=20
static s32 bt_execute_sdp_request(bt_sdp_request *sdpRequest)
@@ -2037,12 +1993,11 @@
=20
/* SDP connection not active! Don't issue the request */
=20
- BT_DRIVER(__FUNCTION__": line %d does not have an active "\
- "connection!\n", line);
+ BT_DRIVER(__FUNCTION__ ": Line %d does not have an active connection!\n"=
, line);
return -ENOTCONN;
}
=20
- BT_DRIVER("bt_execute_sdp_request: line %d SDP index %d\n",
+ BT_DRIVER(__FUNCTION__ ": Line %d SDP index %d\n",
line, sdpIndex);
=20
if (sdpStartRequest(sdpIndex,
@@ -2053,7 +2008,7 @@
=20
/* Sleep on this line while the response is going through */
=20
- printk("bt_execute_sdp_request: sleep on line %d\n", line);
+ printk(__FUNCTION__ ": Sleep on line %d\n", line);
interruptible_sleep_on(&bt_ctrl.connect_wq[line]);
=20
/* If we're back, there may be data to send back.
@@ -2061,8 +2016,7 @@
=20=09
if (bt_ctrl.session[line].sdpRequestResponseData) {
=20
- BT_DRIVER(__FUNCTION__": sdpRequestResponseData 0x%x"\
- "- copying\n",=20
+ BT_DRIVER(__FUNCTION__ ": sdpRequestResponseData 0x%x - copying\n",=20
(int)bt_ctrl.session[line].sdpRequestResponseData);
=20
memcpy(sdpRequest->requestResponse,
@@ -2080,10 +2034,10 @@
bt_connect_ind(u32 con_id)=20
{
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- BT_DRIVER("bt_connect_ind : RFCOMM dlci : %d\n",=20
+ BT_DRIVER(__FUNCTION__ ": RFCOMM dlci : %d\n",=20
GET_RFCOMMDLCI(con_id));
else
- BT_DRIVER("bt_connect_ind : psm %d\n", GET_PSM(con_id));
+ BT_DRIVER(__FUNCTION__ ": PSM %d\n", GET_PSM(con_id));
}
=20
void
@@ -2096,19 +2050,18 @@
=20
switch (psm) {
case RFCOMM_LAYER:
-
line =3D GET_RFCOMMLINE(con_id);
CHECK_RFCOMM(con_id);
=20
if ((line < 0) || (line > BT_NBR_DATAPORTS)) {
=20=09=09=20=20
- D_ERR("bt_connect_cfm on invalid line (%d)\n", line);
+ D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line);
return;
}
=20
bt_ctrl.session[line].connect_status =3D status;
=20
- BT_DRIVER("bt_connect_cfm, line %d [%s]\n",
+ BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n",
GET_RFCOMMLINE(con_id), psmname(psm));
=20
release_wq_timer(&bt_timer);
@@ -2121,26 +2074,26 @@
=20
/* Check incoming line for validity */
if ((line < 0) || (line > BT_NBR_DATAPORTS)) {
- D_ERR("bt_connect_cfm on invalid line (%d)\n", line);
+ D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line);
return;
}
=20
/* Record the connection status for bt_connect() to process. */
=20
bt_ctrl.session[line].connect_status =3D status;
- BT_DRIVER("bt_connect_cfm, line %d [%s]\n", GET_SDPLINE(con_id), psmname=
(psm));
- BT_DRIVER("wake up line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", GET_SDPLINE(con_id), psmname(=
psm));
+ BT_DRIVER(__FUNCTION__ ": Wake up line %d\n", line);
release_wq_timer(&bt_timer);
wake_up_interruptible(&bt_ctrl.connect_wq[line]);
wake_up_interruptible(&bt_ctrl.any_wq);
break;
=20=09=09
case TCS_LAYER:
- BT_DRIVER("bt_connect_cfm [%s]\n", psmname(psm));
+ BT_DRIVER(__FUNCTION__ ": [%s]\n", psmname(psm));
break;
=20
default:
- D_ERR("bt_connect_cfm : unknown layer %d\n", psm);
+ D_ERR(__FUNCTION__ ": Unknown layer %d\n", psm);
break;
}
}
@@ -2150,7 +2103,7 @@
{
/* Check the line for validity */
if (line > BT_NBR_DATAPORTS) {
- D_ERR("bt_connect_cfm on invalid line (%d)\n", line);
+ D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line);
return;
}
=20=09
@@ -2161,8 +2114,7 @@
/* If previous data, deallocate it */
=20
if (bt_ctrl.session[line].sdpRequestResponseData) {
- D_WARN(__FUNCTION__": sdpRequestResponseData set - "\
- "deallocate\n");
+ D_WARN(__FUNCTION__ ": sdpRequestResponseData set - deallocate\n");
kfree(bt_ctrl.session[line].sdpRequestResponseData);
bt_ctrl.session[line].sdpRequestResponseData =3D NULL;
bt_ctrl.session[line].sdpRequestResponseDataLength =3D 0;
@@ -2237,10 +2189,10 @@
bt_disconnect_ind(u32 con_id)=20
{
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- BT_DRIVER("bt_disconnect_ind : RFCOMM dlci : %d\n",=20
+ BT_DRIVER(__FUNCTION__ ": RFCOMM dlci: %d\n",=20
GET_RFCOMMDLCI(con_id));
else
- BT_DRIVER("bt_disconnect_ind : psm %d\n", GET_PSM(con_id));
+ BT_DRIVER(__FUNCTION__ ": PSM %d\n", GET_PSM(con_id));
}
=20
void
@@ -2248,7 +2200,7 @@
{
u32 line =3D GET_RFCOMMLINE(con_id);
=20
- BT_DRIVER("bt_disconnect_cfm : psm %d, status %d\n",=20
+ BT_DRIVER(__FUNCTION__ ": PSM %d, status %d\n",=20
GET_PSM(con_id), status);
=20
bt_ctrl.session[line].disconnect_status =3D status;
@@ -2263,7 +2215,7 @@
{
struct tty_struct *upper_tty;
=20
- BT_DRIVER("bt_hangupline : hanging up line %d\n", line);
+ BT_DRIVER(__FUNCTION__ ": Hanging up line %d\n", line);
=20
/* find corresponding upper tty */
upper_tty =3D GET_UPPERTTY(line);
@@ -2271,7 +2223,7 @@
if (upper_tty)
tty_hangup(upper_tty);
else
- D_WARN("bt_hangupline : no upper tty\n");
+ D_WARN(__FUNCTION__ ": No upper tty\n");
}
=20
#ifdef __CRIS__
@@ -2328,7 +2280,7 @@
#endif
=20
/**********************************/
-/* Bluetooth Stack Initialization */
+/* Bluetooth Stack Initialisation */
/**********************************/
=20
#if defined(MODULE) || defined(__KERNEL__)
@@ -2345,7 +2297,7 @@
=20
bt_show_version();
=20
- /* Initialize the tty_driver structure */
+ /* Initialise the tty_driver structure */
=20=09
memset(&bt_driver, 0, sizeof(bt_driver));
bt_driver.magic =3D BT_TTY_DRIVER_MAGIC;
@@ -2390,9 +2342,9 @@
bt_driver.hangup =3D bt_hangup;
=20=20=20
if (tty_register_driver(&bt_driver))
- panic("Couldn't register bluetooth driver\n");
+ panic("Could not register bluetooth driver\n");
=20
- DSYS("Bluetooth driver registered in %s\n", bt_driver.name);
+ DSYS("Bluetooth driver registered as %s\n", bt_driver.name);
=20
/*
* Register the tty discipline
@@ -2419,12 +2371,12 @@
if (status =3D=3D 0) {
DSYS("Bluetooth line discipline registered.\n");
} else {
- printk (KERN_ERR "error registering line discipline: %d\n",
+ printk (KERN_ERR "Error registering line discipline: %d\n",
status);
return status;
}
=20
- /* Initialize the tty_driver structure */
+ /* Initialise the tty_driver structure */
bt_ctrl_init();
=20=09
sertty =3D NULL;
@@ -2468,7 +2420,7 @@
#endif /* LINUX_VERSION_CODE */
=20
if (procfs_status < 0) {
- D_ERR("Couldn't register proc file bt_internal_info %d\n",
+ D_ERR("Could not register proc file bt_internal_info %d\n",
procfs_status);
}
=20
@@ -2488,7 +2440,7 @@
#endif /* LINUX_VERSION_CODE */
=20
if (procfs_status < 0) {
- D_ERR("Couldn't register proc file bt_status %d\n",=20
+ D_ERR("Could not register proc file bt_status %d\n",=20
procfs_status);
}
=20
@@ -2511,7 +2463,7 @@
#endif /* LINUX_VERSION_CODE */
=20
if (procfs_status < 0) {
- D_ERR("Couldn't register proc file for tci database %d\n",
+ D_ERR("Could not register proc file for tci database %d\n",
procfs_status);
}
#endif /* CONFIG_BLUETOOTH_USE_TCI */
@@ -2636,7 +2588,7 @@
if (!bt_dfu_mode(-1)) {
/* Always check if hci succeeded */
if (hci_init() < 0){
- D_ERR("HCI failed to initialize\n");
+ D_ERR("HCI failed to initialise\n");
goto init_failed_exit1;
}
=20=09
@@ -2670,10 +2622,8 @@
return 0;
=20
init_failed_exit1:=20
- printk("init_failed_exit1\n");
hci_shutdown();
init_failed_exit0:
- printk("init_failed_exit0\n");
btmem_shutdown();
if (tmp_bt_buf) {
free_page((unsigned long) tmp_bt_buf);
@@ -2695,19 +2645,19 @@
{
/* check if this line was the one previously used */
if ((line !=3D tty_linebuf.line) && (tty_linebuf.line !=3D TTY_NOLINE)) {
- D_ERR("Line %d not active and linebuf busy, silent discard...\n", line);
+ D_ERR(__FUNCTION__ ": Line %d not active and linebuf busy, silent discar=
d...\n", line);
return;
} else if (tty_linebuf.line =3D=3D TTY_NOLINE)
tty_linebuf.line =3D line;
=20
/* is there room for data ? */
if ((tty_linebuf.cur_len + len) > TTY_LINEBUFLEN) {
- D_ERR("Line %d not active and linebuf full, silent discard (consider inc=
reasing line buffer [%d])\n", line, TTY_LINEBUFLEN);
+ D_ERR(__FUNCTION__ ": Line %d not active and linebuf full, silent discar=
d (consider increasing line buffer [%d])\n", line, TTY_LINEBUFLEN);
return;
}
=20=09
/* ok, add it ! */
- DSYS("bt_linebuf_add : adding %d bytes\n", len);
+ DSYS(__FUNCTION__ ": Adding %d bytes\n", len);
memcpy(tty_linebuf.data+tty_linebuf.cur_len, data, len);
tty_linebuf.cur_len +=3D len;
}
@@ -2720,14 +2670,14 @@
return;
=20
if (upper_tty && tty_linebuf.cur_len > 0) {
- DSYS("bt_linebuf_empty : now sending buffered data [%d] to line %d\n", t=
ty_linebuf.cur_len, line);
+ DSYS(__FUNCTION__ ": Now sending buffered data [%d] to line %d\n", tty_l=
inebuf.cur_len, line);
=20
upper_tty->ldisc.receive_buf(upper_tty, tty_linebuf.data,=20
NULL, tty_linebuf.cur_len);=20=20
=20
bt_reset_linebuf();
} else
- DSYS("bt_linebuf_empty : no data sent\n");
+ DSYS(__FUNCTION__ ": No data sent\n");
}
#endif /* BT_USELINEBUF */
=20
@@ -2735,7 +2685,7 @@
bt_ctrl_init(void)
{
s32 i;
- BT_DRIVER("Initiating bt ctrl struct\n");
+ BT_DRIVER("Initialising bt ctrl struct\n");
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
for (i =3D 0; i < BT_NBR_PORTS; i++) {
@@ -2825,7 +2775,7 @@
if ((SESSIONSTATE(line) =3D=3D BT_INACTIVE) ||=20
(SESSIONSTATE(line) =3D=3D BT_UPPERCONNECTED)) {
/* now register ! */
- DSYS("bt_register_rfcomm : dlci %d on line %d\n", dlci, line);
+ DSYS(__FUNCTION__ ": dlci %d on line %d\n", dlci, line);
=20=09=09
bt_ctrl.session[line].rfcomm =3D rfcomm;=20
bt_ctrl.session[line].dlci =3D dlci;
@@ -2839,7 +2789,7 @@
}
=20=09
if (!found)
- D_WARN("bt_register_rfcomm : line %d busy [%s]\n",=20
+ D_WARN(__FUNCTION__ ": Line %d busy [%s]\n",=20
line, statename(SESSIONSTATE(line)));
return found;
}
@@ -2850,26 +2800,26 @@
s32 found =3D 0;
=20
if (!bt_stack_initiated) {
- D_WARN("bt_register_sdp : Bluetooth stack not initialized\n");
+ D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n");
return -1;=09
}
=20
/* Better not have any sdp data pending for this connection */
=20
if (bt_ctrl.session[line].sdpRequestResponseData) {
- D_WARN("bt_register_sdp: Pending SDP data for this new connection @ line=
%d\n", line);
+ D_WARN(__FUNCTION__ ": Pending SDP data for this new connection on line =
%d\n", line);
}
=20
if (SESSIONSTATE(line) =3D=3D BT_INACTIVE) {
/* now register ! */
- DSYS("bt_register_sdp : line %d\n", line);
+ DSYS(__FUNCTION__ ": Line %d\n", line);
SESSIONSTATE(line) =3D BT_ACTIVE;
bt_ctrl.session[line].sdpID =3D sdpID;
found =3D 1;
}
=20
if (!found)
- D_WARN("bt_register_sdp : could not find any available lines\n");
+ D_WARN(__FUNCTION__ ": Could not find any available lines\n");
=20
return found;
}
@@ -2877,7 +2827,7 @@
s32
bt_unregister_rfcomm(s32 line)
{
- BT_DRIVER("bt_unregister_rfcomm : line %d\n", line);=09
+ BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09
=20
if (SESSIONSTATE(line) =3D=3D BT_ACTIVE) {
bt_ctrl.session[line].rfcomm =3D 0;=20
@@ -2892,7 +2842,7 @@
} else if (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) {
bt_reset_session(line);=09=09
} else {
- D_WARN("bt_unregister_rfcomm : inactive session\n");
+ D_WARN(__FUNCTION__ ": Inactive session\n");
return -1;
}
=20
@@ -2905,10 +2855,10 @@
=20
s32 bt_unregister_sdp(s32 line)
{
- BT_DRIVER("bt_unregister_sdp : line %d\n", line);=09
+ BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09
=20
if (!bt_stack_initiated) {
- D_WARN("bt_unregister_sdp : Bluetooth stack not initialized\n");
+ D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n");
return -1;=09
}
=20
@@ -2916,7 +2866,7 @@
response data AND clear length and pointer */
=20
if (bt_ctrl.session[line].sdpRequestResponseData) {
- DSYS("bt_unregister_sdp: Free request data 0x%x\n",
+ DSYS(__FUNCTION__ ": Free request data 0x%x\n",
(unsigned int)bt_ctrl.session[line].sdpRequestResponseData);
kfree(bt_ctrl.session[line].sdpRequestResponseData);
bt_ctrl.session[line].sdpRequestResponseData =3D NULL;
@@ -2949,7 +2899,7 @@
} else {
/* Data line ! */
if (!bt_stack_initiated) {
- D_WARN("bt_register_tty : Bluetooth stack not initiated\n");
+ D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n");
return -EPERM;
}
}
@@ -2973,7 +2923,7 @@
}
return 0;
} else {
- D_WARN("bt_register_tty : line busy !\n");
+ D_WARN(__FUNCTION__ ": Line busy !\n");
}
return -EBUSY;
}
@@ -2991,7 +2941,7 @@
/* Check that the pid closing is the one that opened the tty */
if (current->pid !=3D bt_ctrl.session[line].pid)
{
- BT_DRIVER(__FUNCTION__" invalid pid\n");
+ BT_DRIVER(__FUNCTION__ ": Invalid pid\n");
return -1;
}
=20
@@ -3010,7 +2960,7 @@
NBR_UPPER--;
}
else {
- D_WARN("bt_unregister_tty : tty not prev registered\n");
+ D_WARN(__FUNCTION__ ": TTY not previously registered\n");
return -ENODEV;
}
return 0; /* Until the above is fixed */
@@ -3078,13 +3028,13 @@
{
#if BT_PARANOIA_CHECK
if (!bt_tty) {
- printk("Warning: null tty_driver struct for (%s) in %s\n",
+ printk("Warning: Null tty_driver struct for (%s) in %s\n",
kdevname(device), routine);
return -EINVAL;
}
=20
if (bt_tty->magic !=3D BT_TTY_DRIVER_MAGIC) {
- printk("Warning: bad magic number for bluetooth driver struct (%s) in %s=
\n", kdevname(device), routine);
+ printk("Warning: Bad magic number for bluetooth driver struct (%s) in %s=
\n", kdevname(device), routine);
return -EINVAL;
}
#endif
@@ -3122,7 +3072,7 @@
wq_timer->data =3D (unsigned long)wq;
wq_timer->expires =3D jiffies + timeout;
add_timer(wq_timer);
-// printk("start_wq_timer wq 0x%x : timer 0x%x\n", wq, wq_timer);
+// printk(__FUNCTION__ ": wq: 0x%x, timer: 0x%x\n", wq, wq_timer);
}
=20
=20
@@ -3131,7 +3081,7 @@
release_wq_timer(struct timer_list *wq_timer)
{
del_timer(wq_timer);
-// printk("release_wq_timer timer 0x%x\n", wq_timer);
+// printk(__FUNCTION__ ": timer: 0x%x\n", wq_timer);
}
=20
void
@@ -3161,7 +3111,7 @@
save_flags(flags);
cli();
if ((error =3D tty_unregister_driver(&bt_driver)))
- printk("SERIAL: failed to unregister bluetooth driver (%d)\n",
+ printk("SERIAL: Failed to unregister bluetooth driver (%d)\n",
error);
restore_flags(flags);
=20
|