You can subscribe to this list here.
| 2001 |
Jan
|
Feb
(44) |
Mar
(202) |
Apr
(134) |
May
(89) |
Jun
(94) |
Jul
(58) |
Aug
(58) |
Sep
(56) |
Oct
(75) |
Nov
(26) |
Dec
(14) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(24) |
Feb
(30) |
Mar
(15) |
Apr
(49) |
May
(12) |
Jun
(6) |
Jul
(11) |
Aug
(20) |
Sep
(19) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
| 2003 |
Jan
(7) |
Feb
(4) |
Mar
(7) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(51) |
Dec
(1) |
| 2004 |
Jan
(11) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Peter K. <pk...@us...> - 2001-04-18 14:46:18
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.52 1.53=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed bt_show_vendor(). The diff of the modified file(s): --- hci.h 2001/04/18 00:53:37 1.52 +++ hci.h 2001/04/18 14:46:17 1.53 @@ -159,7 +159,5 @@ char *bt_hw_vendor(void); char *bt_hw_firmware(void); =20 -void bt_show_vendor(void); - #endif /****************** END OF FILE hci.h ************************************= ***/ |
|
From: Peter K. <pk...@us...> - 2001-04-18 14:45:22
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.167 1.168=20=20=20=20=20=20=20=20=20=20=20
hci_vendor.c 1.24 1.25=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Removed bt_show_vendor().
The diff of the modified file(s):
--- bluetooth.c 2001/04/18 00:53:37 1.167
+++ bluetooth.c 2001/04/18 14:45:21 1.168
@@ -2255,7 +2255,8 @@
=20=09
DSYS("Initialising Bluetooth Stack\n");
=20
- bt_show_vendor();
+ DSYS("Current HW: %s\n", bt_hw_vendor());
+
hci_init();
l2cap_init();
=20
--- hci_vendor.c 2001/04/17 21:55:56 1.24
+++ hci_vendor.c 2001/04/18 14:45:21 1.25
@@ -494,20 +494,22 @@
char*
bt_hw_vendor(void)
{
- return "Unknown hardware";
+#if defined(CONFIG_BLUETOOTH_USB)
+ return "USB";
+#elif defined(CONFIG_BLUETOOTH_GENERIC)
+ return "Generic";
+#else
+ return "Unknown";
+#endif
}
#endif
=20
+/*************************************************************************=
****/
+
char*
bt_hw_firmware(void)
{
return bt_hw_firmware_info;
-}
-
-void
-bt_show_vendor(void)
-{
- DSYS("Current HW: %s\n", VENDOR);
}
=20
/********************* END OF FILE hci_vendor.c **************************=
****/
|
|
From: Peter K. <pk...@us...> - 2001-04-18 14:25:31
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
l2cap.c 1.99 1.100=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Made local functions static.
* insert_upper() now returns -ENOMEM if memory allocation failed.
* Changed a number of "return -1;" to return something more appropriate.
* Replaced all FNC and function names in strings with __FUNCTION__.
The diff of the modified file(s):
--- l2cap.c 2001/04/12 15:10:01 1.99
+++ l2cap.c 2001/04/18 14:25:30 1.100
@@ -63,6 +63,7 @@
#include <string.h>
#include <sys/time.h>
#include <signal.h>
+#include <errno.h>
#include "include/l2cap.h"
#include "include/hci.h"
#include "include/l2cap_internal.h"
@@ -212,9 +213,9 @@
static void print_flow(flow *f);
static s32 l2cap_cmdrej(s32 hci_hdl, u8 reason, u8 *opt_data, s32 opt_len);
=20
-void insert_upper(protocol_layer *upper_layer);
-protocol_layer* get_upper(u32 psm);
-void remove_all_upper(void);
+static s32 insert_upper(protocol_layer *upper_layer);
+static protocol_layer* get_upper(u32 psm);
+static void remove_all_upper(void);
=20
#ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
=20
@@ -225,20 +226,20 @@
=20
=20
#ifdef __KERNEL__
-void l2cap_rtx_timeout(unsigned long ptr);
-void l2cap_ertx_timeout(unsigned long ptr);
+static void l2cap_rtx_timeout(unsigned long ptr);
+static void l2cap_ertx_timeout(unsigned long ptr);
#else /* usermode stack */
-l2cap_con *timeout_con =3D NULL;
-s32 timer_cancelled =3D 0;
-void l2cap_rtx_timeout(void);
-void l2cap_ertx_timeout(unsigned long ptr);
+static l2cap_con *timeout_con =3D NULL;
+static s32 timer_cancelled =3D 0;
+static void l2cap_rtx_timeout(void);
+static void l2cap_ertx_timeout(unsigned long ptr);
#endif
=20
-void start_rtx(l2cap_con *con, unsigned short timeout, unsigned short acti=
on);
-void disable_rtx(l2cap_con *con);
+static void start_rtx(l2cap_con *con, unsigned short timeout, unsigned sho=
rt action);
+static void disable_rtx(l2cap_con *con);
=20
-void start_ertx(l2cap_con *con, unsigned short timeout);
-void disable_ertx(l2cap_con *con);
+static void start_ertx(l2cap_con *con, unsigned short timeout);
+static void disable_ertx(l2cap_con *con);
=20
#endif
=20
@@ -292,8 +293,7 @@
(l2cap->my_bd[2] =3D=3D 0) && (l2cap->my_bd[3] =3D=3D 0) &&
(l2cap->my_bd[4] =3D=3D 0) && (l2cap->my_bd[5] =3D=3D 0))
D_ERR("Failed to get local BD addr\n");
- else
- {
+ else {
i =3D l2cap_sprint_bd(bd_name, l2cap->my_bd);
bd_name[i] =3D 0;
DSYS("Local bd [%s]\n", bd_name);
@@ -336,15 +336,14 @@
void=20
l2cap_register_default_upper(struct protocol_layer *prot)
{
- memcpy(&default_protocol, prot, sizeof(protocol_layer));
+ memcpy(&default_protocol, prot, sizeof default_protocol);
}
=20
s32=20
l2cap_shutdown(void)
{
DSYS("Shutting down L2CAP\n");
- if (!l2cap->initiated)
- {
+ if (!l2cap->initiated) {
D_ERR("L2CAP not initiated\n");
return -1;
}
@@ -368,6 +367,7 @@
#ifdef __CRIS__
bt_connections =3D 0;
#endif
+
/*ALWAYS SUCCESS*/
return 0;
}
@@ -379,49 +379,44 @@
l2cap_register_upper(u16 psm, struct protocol_layer *prot)=20
{
if (((psm % 2) =3D=3D 0) || (prot =3D=3D NULL)) {
- D_ERR("l2cap_register_upper : incorrect parameters\n");
- return -1;
+ D_ERR(__FUNCTION__ ": incorrect parameters\n");
+ return -EINVAL;
}
=20=20=20=20=20
- D_MISC("l2cap_register_upper : psm 0x%x\n", psm);
+ D_MISC(__FUNCTION__ ": psm 0x%x\n", psm);
=20
if ((psm > MAX_PSM) && (psm < MIN_DYNAMIC_PSM)) {
- D_ERR("l2cap_register_upper : value of psm reserved\n");
- return -1;
+ D_ERR(__FUNCTION__ ": value of psm reserved\n");
+ return -EINVAL;
}
=20
if (psm > MAX_DYNAMIC_PSM) {
- D_ERR("l2cap_register_upper : psm not valid!\n");
- return -1;
+ D_ERR(__FUNCTION__ ": psm not valid!\n");
+ return -EINVAL;
}
=20
prot->psm =3D psm;
- insert_upper(prot);
- return 1;
+ return insert_upper(prot);
}
=20
/* Inserts the function pointers to a new upper layer in the list */
=20
-void
+s32
insert_upper(protocol_layer *upper_layer)
{
- protocol_layer *tmp_layer, *new_layer;
- D_MISC("insert_upper: Inserting layer psm:0x%x\n",upper_layer->psm);
+ protocol_layer *new_layer;
+ D_MISC(__FUNCTION__ ": Inserting layer psm:0x%x\n", upper_layer->psm);
=20=09
- new_layer =3D (protocol_layer*) kmalloc(sizeof(protocol_layer),
- GFP_ATOMIC);
- memcpy(new_layer, upper_layer, sizeof(protocol_layer));
- new_layer->next_layer =3D NULL;
+ if (!(new_layer =3D kmalloc(sizeof *new_layer, GFP_ATOMIC)))
+ return -ENOMEM;
=20=09
- tmp_layer =3D l2cap->upper_layers;
- if (tmp_layer !=3D NULL) {
- while (tmp_layer->next_layer !=3D NULL) {
- tmp_layer =3D tmp_layer->next_layer;
- }
- tmp_layer->next_layer =3D new_layer;
- } else {
+ memcpy(new_layer, upper_layer, sizeof *new_layer);
+
+ /* Add to head of list of upper layers */
+ new_layer->next_layer =3D l2cap->upper_layers;
l2cap->upper_layers =3D new_layer;
- }
+
+ return 0;
}
=20=20
protocol_layer*
@@ -431,29 +426,29 @@
=20=09
/* Check PSM value */
if((psm % 2) =3D=3D 0) {
- D_ERR("get_upper : incorrect psm\n");
+ D_ERR(__FUNCTION__ ": incorrect psm\n");
return &default_protocol;
}
if((psm > MAX_PSM) && (psm < MIN_DYNAMIC_PSM)) {
- D_ERR("get_upper : value of psm reserved\n");
+ D_ERR(__FUNCTION__ ": value of psm reserved\n");
return &default_protocol;
}
if(psm > MAX_DYNAMIC_PSM) {
- D_ERR("get_upper : psm not valid!\n");
+ D_ERR(__FUNCTION__ ": psm not valid!\n");
return &default_protocol;
}
=20
- D_MISC("get_upper: Try to retrieve psm 0x%x\n",psm);
+ D_MISC(__FUNCTION__ ": Try to retrieve psm 0x%x\n",psm);
tmp_layer =3D l2cap->upper_layers;
while (tmp_layer !=3D NULL) {
if (tmp_layer->psm =3D=3D psm) {
- D_MISC("get_upper: Actually got psm:0x%x\n",
+ D_MISC(__FUNCTION__ ": Actually got psm:0x%x\n",
tmp_layer->psm);
return tmp_layer;
}
tmp_layer =3D tmp_layer->next_layer;
}
- D_MISC("get_upper: Didn't get any layer, returning default\n");
+ D_MISC(__FUNCTION__ ": Didn't get any layer, returning default\n");
return &default_protocol;
}
=20
@@ -462,13 +457,12 @@
{
protocol_layer *tmp_layer;
=20
- D_MISC("remove_all_upper: Freeing all upper layers\n");
+ D_MISC(__FUNCTION__ ": Freeing all upper layers\n");
=20
while (l2cap->upper_layers !=3D NULL) {
tmp_layer =3D l2cap->upper_layers;
l2cap->upper_layers =3D tmp_layer->next_layer;
kfree(tmp_layer);
- tmp_layer =3D NULL;
}
}
=20
@@ -516,21 +510,20 @@
l2cap_receive_data(u8 *data, u32 len, u16 hci_handle, /*u8 pb_flag,*/=20=
=20
/*u8 bc_flag,*/ u32 *l2cap_len)
{
-#define FNC "l2cap_receive_data : "
l2cap_packet *pkt =3D NULL;
l2cap_con *con;
u16 pkt_len;
CID pkt_cid;
=20
- D_RCV(FNC" got %d bytes on hci_handle : %d\n", len, hci_handle);
- PRINTPKT("l2cap_receive_data : ", data, len);
+ D_RCV(__FUNCTION__ ": got %d bytes on hci_handle : %d\n", len, hci_handl=
e);
+ PRINTPKT(__FUNCTION__ ": ", data, len);
=20
if (*l2cap_len =3D=3D 0) {
/* Start of a new frame received,=20
parse header and set l2cap_len */
=20=09=09
if (len < 4) {
- D_RCV(FNC"Incomplete frame header!\n");
+ D_RCV(__FUNCTION__ ": Incomplete frame header!\n");
return;
}
=20
@@ -543,7 +536,7 @@
has been received in hci this function is called again */
*l2cap_len =3D pkt_len + L2CAP_HDRSIZE;
=20=20=20=20=20
- D_RCV(FNC"New frame len:%d cid:%d\n", pkt_len, pkt_cid);
+ D_RCV(__FUNCTION__ ": New frame len:%d cid:%d\n", pkt_len, pkt_cid);
=20
/* check length */
if (!(pkt_len =3D=3D (len - L2CAP_HDRSIZE)))
@@ -552,7 +545,7 @@
/* Not recieved full frame yet or BIG packet */
=20=09=09
if (len > *l2cap_len) {
- DSYS(FNC"BIG PACKET ! (%d bytes) discard\n", len);
+ DSYS(__FUNCTION__ ": BIG PACKET ! (%d bytes) discard\n", len);
hci_clear_buffer(hci_handle);
}
return;
@@ -566,7 +559,7 @@
switch (pkt_cid) {
case CIDSIG:
/* Signalling channel */
- D_RCV("l2cap_receive_data : Signal data !\n");
+ D_RCV(__FUNCTION__ ": Signal data !\n");
=20=09=09
signal_handler(hci_handle, data + L2CAP_HDRSIZE,=20
len-L2CAP_HDRSIZE);
@@ -578,7 +571,7 @@
return;
}
=20=09=09
- D_RCV("l2cap_receive_data: Connectionless data\n");
+ D_RCV(__FUNCTION__ ": Connectionless data\n");
=20
/* FIXME: Move data 2 bytes ahead since there is a psm value
in the connection less packet */
@@ -598,14 +591,13 @@
if (con->current_state =3D=3D OPEN ) {=20=20=20=20=20=20
process_frame(con, pkt->data, pkt_len);
} else {
- D_ERR("l2cap_receive_data : not OPEN yet, discard data\n");
+ D_ERR(__FUNCTION__ ": not OPEN yet, discard data\n");
}
break;
}
=20
/* free hci inbuffer */
hci_clear_buffer(hci_handle);=20
-#undef FNC
}
=20
/* Signalling between two l2cap entities on remote devices */
@@ -614,7 +606,6 @@
signal_handler(u16 hci_handle, u8 *data,=20
u32 len)
{
-#define FNC "signal_handler : "=20=20=20=20=20=20=20
sig_cmd *cmd;
s32 pos =3D 0; /* position in packet */
=20
@@ -622,20 +613,20 @@
=20=20=20
cmd->len =3D le16_to_cpu(cmd->len);
=20
- D_RCV(FNC"received %d bytes\n", len);
- PRINTPKT(FNC"data", data, len);
+ D_RCV(__FUNCTION__ ": received %d bytes\n", len);
+ PRINTPKT(__FUNCTION__ ": data", data, len);
=20
if (len < (cmd->len + 4)) {
- D_ERR(FNC"Length doesn't match\n");
+ D_ERR(__FUNCTION__ ": Length doesn't match\n");
return;=20
} else if (len > (cmd->len + 4)) {=20=20
- D_RCV(FNC"Multiple commands !\n");=20=20
+ D_RCV(__FUNCTION__ ": Multiple commands !\n");=20=20
} else {
- D_RCV(FNC"Single command\n");
+ D_RCV(__FUNCTION__ ": Single command\n");
}=20=20
=20
while (pos < len) {
- D_RCV(FNC"got packet (%d bytes) with ID : %d\n",
+ D_RCV(__FUNCTION__ ": got packet (%d bytes) with ID : %d\n",
cmd->len, cmd->id);
=20=20=20=20=20
if (ISREQUEST(cmd->code)) {=20
@@ -654,19 +645,16 @@
cmd->len);
}
}=20
-#undef FNC=09=09
}
=20
=20
void process_request(u16 hci_handle, struct sig_cmd *req)
{
-#define FNC "process_request : "
-=20
sig_conreq *conreq;
sig_confreq *confreq;
sig_discreq *discreq;
l2cap_con *con =3D NULL;
- D_STATE(FNC"Got request : 0x%x id:%d\n", req->code, req->id);
+ D_STATE(__FUNCTION__ ": Got request : 0x%x id:%d\n", req->code, req->id);
=20=09
/* FIXME -- Add check for cmd len in each request type=20
(used to detect corrupt packets) */
@@ -678,8 +666,8 @@
conreq->psm =3D le16_to_cpu(conreq->psm);
conreq->src_cid =3D le16_to_cpu(conreq->src_cid);
=20=09=09
- D_STATE(FNC"Connection request\n");
- D_STATE(FNC"id:%d len:%d PSM 0x%x src_cid:%d\n",
+ D_STATE(__FUNCTION__ ": Connection request\n");
+ D_STATE(__FUNCTION__ ": id:%d len:%d PSM 0x%x src_cid:%d\n",
req->id, req->len, conreq->psm, conreq->src_cid);
/*=20
Two cases :
@@ -697,15 +685,14 @@
=20=09=09
if ((con =3D check_remote_cid(hci_handle,=20
conreq->src_cid)) =3D=3D NULL) {
- D_ERR(FNC"couldn't find l2cap connection\n");
+ D_ERR(__FUNCTION__ ": couldn't find l2cap connection\n");
l2cap_cmdrej(hci_handle, CMDREJ_INVALIDCID,
"Invalid CID", 13);
return;
}
=20=09=09
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n",=20
- __FILE__, __LINE__);
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
return;
}
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
@@ -736,7 +723,7 @@
confreq->dst_cid =3D le16_to_cpu(confreq->dst_cid);
confreq->flags =3D le16_to_cpu(confreq->flags);
=20=09=09
- D_STATE(FNC"config request cid:%d flags: 0x%x\n",=20
+ D_STATE(__FUNCTION__ ": config request cid:%d flags: 0x%x\n",=20
confreq->dst_cid, confreq->flags);
=20=09=09
if ((con =3D get_lcon(confreq->dst_cid)) =3D=3D NULL) {
@@ -844,7 +831,7 @@
discreq->dst_cid =3D le16_to_cpu(discreq->dst_cid);
discreq->src_cid =3D le16_to_cpu(discreq->src_cid);
=20
- D_STATE(FNC"disconnection request id %d\n",=20
+ D_STATE(__FUNCTION__ ": disconnection request id %d\n",=20
req->id);
=20
if ((con =3D get_rcon(discreq->src_cid)) =3D=3D NULL) {
@@ -858,7 +845,7 @@
=20
/* if already closed, simply acknowledge */
if ((con->current_state =3D=3D CLOSED)) {
- D_STATE(FNC"connection closed, send disc rsp\n");
+ D_STATE(__FUNCTION__ ": connection closed, send disc rsp\n");
l2cap_disconnect_rsp(con);
return;
}
@@ -872,7 +859,7 @@
=20=20=20=20=20=20=20=20
case SIG_ECHOREQ: {
sig_echo_pkt* echo;
- D_STATE(FNC"Echo request\n");
+ D_STATE(__FUNCTION__ ": Echo request\n");
=20=09=09
echo =3D (sig_echo_pkt *)(req->data);=09=09
=20
@@ -884,7 +871,7 @@
case SIG_INFOREQ: {
/* Implementation specific */
sig_info_req *info;
- D_STATE(FNC"Info request\n");
+ D_STATE(__FUNCTION__ ": Info request\n");
=20=09=09
info =3D (sig_info_req*)(req->data);
info->type =3D le16_to_cpu(info->type);
@@ -907,22 +894,19 @@
}=20=20=20=20
=20=20=20=20=20=20=20=20
case SIG_RESERVED:
- D_STATE(FNC"Reserved !\n");
+ D_STATE(__FUNCTION__ ": Reserved!\n");
break;
=20=20=20=20=20=20=20=20=20
default:
/* Not a valid command */
- DSYS(FNC"Invalid command (code 0x%x)s\n", req->code);
+ DSYS(__FUNCTION__ ": Invalid command (code 0x%x)s\n", req->code);
l2cap_cmdrej(hci_handle, CMDREJ_NOTUNDERSTOOD, NULL, 0);
break;
}
-#undef FNC
}
=20
void process_response(u16 hci_handle, struct sig_cmd *rsp)
{
-#define FNC "process_response :"
-
sig_conrsp *conrsp;
sig_confrsp *confrsp;
sig_discrsp *discrsp;
@@ -933,7 +917,7 @@
s32 failure =3D 0;
u16 opt_len =3D 0;
=20
- D_STATE(FNC"Got response : 0x%x id:%d\n",=20
+ D_STATE(__FUNCTION__ ": Got response: 0x%x id:%d\n",
rsp->code, rsp->id);
=20
/* FIXME -- Add check for cmd len in each response type=20
@@ -941,31 +925,31 @@
=20
switch (rsp->code) {
case SIG_CMDREJECT:
- D_STATE(FNC"Command reject - \n");
+ D_STATE(__FUNCTION__ ": Command reject - \n");
DSYS("Got command reject\n");
cmdreject =3D (sig_cmdreject*)rsp->data;
cmdreject->reason =3D le16_to_cpu(cmdreject->reason);
opt_len =3D rsp->len - sizeof(sig_cmdreject);
switch (cmdreject->reason) {
case 0:
- D_STATE(FNC"Command not understood\n");=20
+ D_STATE(__FUNCTION__ ": Command not understood\n");=20
break;
=20=20=20=20=20=20=20=20=20=20=20=20
case 1:
- D_STATE(FNC"Signalling MTU exceeded\n");
+ D_STATE(__FUNCTION__ ": Signalling MTU exceeded\n");
break;
=20=20=20=20=20=20=20=20=20=20=20=20
case 2:
- D_STATE(FNC"Invalid CID in request\n");
+ D_STATE(__FUNCTION__ ": Invalid CID in request\n");
break;
=20=20=20=20=20=20=20=20=20=20=20=20
default:
- D_STATE(FNC"Not recognized cmd reject reason\n");
+ D_STATE(__FUNCTION__ ": Not recognized cmd reject reason\n");
break;
}
=20=09=09
if (opt_len > 0)
- print_data(FNC"optional data : ",=20
+ print_data(__FUNCTION__ ": optional data : ",=20
cmdreject->data, rsp->len-2);
=20
/* fixme -- set 'real' reason code */
@@ -980,7 +964,7 @@
=20=20=20=20=20=20=20=20
case SIG_CONRSP:
/* client */
- D_STATE(FNC"Got connection response\n");
+ D_STATE(__FUNCTION__ ": Got connection response\n");
conrsp =3D (sig_conrsp *)rsp->data;
conrsp->src_cid =3D le16_to_cpu(conrsp->src_cid);
conrsp->dst_cid =3D le16_to_cpu(conrsp->dst_cid);
@@ -989,7 +973,7 @@
=20
/* find connection */
if ((con =3D get_lcon(conrsp->src_cid)) =3D=3D NULL) {
- D_ERR(FNC"con rsp, NO CONNECTION FOUND\n");
+ D_ERR(__FUNCTION__ ": con rsp, NO CONNECTION FOUND\n");
return;
}
=20
@@ -997,7 +981,7 @@
=20
/* match id with request */
if (!id_matched(con, rsp->id)) {
- D_ERR(FNC"ID doesn't match ! [%d:%d]\n", con->sig_id_sent, rsp->id);
+ D_ERR(__FUNCTION__ ": ID doesn't match ! [%d:%d]\n", con->sig_id_sent, =
rsp->id);
return;
}
=20=20=20=20=20=20=20=20=20=20
@@ -1022,27 +1006,27 @@
disable_rtx(con);
start_ertx(con, ERTX_TIMEOUT);
#endif
- D_STATE(FNC"connection pending\n");
+ D_STATE(__FUNCTION__ ": connection pending\n");
break;
=20
case RES_PSMNEG:
- DSYS(FNC"connection refused, psm 0x%x not supp\n",=20
+ DSYS(__FUNCTION__ ": connection refused, psm 0x%x not supp\n",=20
con->psm);
failure =3D 1;
break;
=20
case RES_SECNEG:
- DSYS(FNC"connection refused, security block\n");
+ DSYS(__FUNCTION__ ": connection refused, security block\n");
failure =3D 1;
break;
=20=20=20=20=20=20=20=20=20=20=20=20
case RES_NOSRC:
- DSYS(FNC"connection refused, no resources\n");
+ DSYS(__FUNCTION__ ": connection refused, no resources\n");
failure =3D 1;
break;
=20=20=20=20=20=20=20=20=20=20=20=20
default:
- D_ERR(FNC"SIG_CONRSP\n");
+ D_ERR(__FUNCTION__ ": SIG_CONRSP\n");
break;
}
=20=20=20=20=20=20=20=20=20=20
@@ -1063,28 +1047,28 @@
break;
=20=20=20=20=20=20=20=20
case SIG_CONFRSP:
- D_STATE(FNC"Got configuration response\n");
+ D_STATE(__FUNCTION__ ": Got configuration response\n");
confrsp =3D (sig_confrsp *)rsp->data;
confrsp->src_cid =3D le16_to_cpu(confrsp->src_cid);
confrsp->flags =3D le16_to_cpu(confrsp->flags);
confrsp->result =3D le16_to_cpu(confrsp->result);
opt_len =3D rsp->len - sizeof(sig_confrsp);
=20
- PRINTPKT(FNC"config response", rsp->data, rsp->len);
+ PRINTPKT(__FUNCTION__ ": config response", rsp->data, rsp->len);
=20
/* check that remote CID is in list */
if ((con =3D get_lcon(confrsp->src_cid)) =3D=3D NULL)
return;
=20
if (con->current_state !=3D CONFIG) {
- D_ERR(FNC"SIG_CONFRSP invalid state\n");
+ D_ERR(__FUNCTION__ ": SIG_CONFRSP invalid state\n");
PRINTSTATE(con);
return;=20
}
=20=09=09=09=20=20=20=20=20=20=20
/* match id with request */
if (!id_matched(con, rsp->id)) {
- D_ERR(FNC"ID doesn't match ! [%d:%d]\n", con->sig_id_sent, rsp->id);=09=
=09=09
+ D_ERR(__FUNCTION__ ": ID doesn't match ! [%d:%d]\n", con->sig_id_sent, =
rsp->id);=09=09=09
return;
}
=20
@@ -1121,22 +1105,22 @@
/* store remote side configuration */
parse_options(con, confrsp->options, opt_len);
=20
- D_STATE(FNC"config failure, unacceptable params\n");
+ D_STATE(__FUNCTION__ ": config failure, unacceptable params\n");
l2ca_config_cfm(con, confrsp->result);
break;
=20=20=20=20=20=20=20=20=20=20=20=20
case CONF_REJ:
- D_STATE(FNC"connection refused, no reason\n");
+ D_STATE(__FUNCTION__ ": connection refused, no reason\n");
l2ca_config_cfm(con, confrsp->result);
break;
=20=20=20=20=20=20=20=20=20=20=20=20
case CONF_UNKNOWN:
- D_STATE(FNC"connection refused, unknown options\n");
+ D_STATE(__FUNCTION__ ": connection refused, unknown options\n");
l2ca_config_cfm(con, confrsp->result);
break;
=20=20=20=20=20=20=20=20=20=20=20=20=20
default:
- D_ERR(FNC"SIG_CONFRSP\n");
+ D_ERR(__FUNCTION__ ": SIG_CONFRSP\n");
break;
}
=20=20=20=20=20=20
@@ -1147,7 +1131,7 @@
#endif
=20
if (con->current_state !=3D CONFIG)
- D_ERR(FNC"SIG_CONFRSP invalid state\n");
+ D_ERR(__FUNCTION__ ": SIG_CONFRSP invalid state\n");
PRINTSTATE(con);
=20
/* print failed options */
@@ -1158,25 +1142,25 @@
break;
=20=20=20=20=20=20=20=20=20
case SIG_DISCRSP:
- D_STATE(FNC"Got disconnect response\n");
+ D_STATE(__FUNCTION__ ": Got disconnect response\n");
discrsp =3D (sig_discrsp *)rsp->data;
discrsp->dst_cid =3D le16_to_cpu(discrsp->dst_cid);
discrsp->src_cid =3D le16_to_cpu(discrsp->src_cid);
- PRINTPKT(FNC"disconnect response", rsp->data, rsp->len);
+ PRINTPKT(__FUNCTION__ ": disconnect response", rsp->data, rsp->len);
=20
/* find connection */
if ((con =3D get_lcon(discrsp->src_cid)) =3D=3D NULL)
return;
=20=20=20=20=20=20=20=20=20=20
if (con->current_state !=3D W4_L2CAP_DISCONNECT_RSP) {
- D_ERR(FNC"SIG_DISCRSP invalid state\n");
+ D_ERR(__FUNCTION__ ": SIG_DISCRSP invalid state\n");
PRINTSTATE(con);
return;=20
}
=20=09=20=20=20=20=20=20=20=09=20=20=20=20=20=20=20
/* match id with request */
if (!id_matched(con, rsp->id)) {
- D_ERR(FNC"ID doesn't match ! [%d:%d]\n",=20
+ D_ERR(__FUNCTION__ ": ID doesn't match ! [%d:%d]\n",=20
con->sig_id_sent, rsp->id);
return;
}
@@ -1192,7 +1176,7 @@
case SIG_ECHORSP: {
l2cap_con *tempcon;
=20=09=09
- D_STATE(FNC"Got echo response\n");=09=09
+ D_STATE(__FUNCTION__ ": Got echo response\n");=09=09
=20
if ((tempcon =3D get_con_hcihdl(hci_handle))=3D=3DNULL) {
D_STATE("Echo rsp : could not find connection\n");
@@ -1203,7 +1187,7 @@
opt_len =3D rsp->len;
=20=09=09=09
if (opt_len > 0)
- PRINTPKT(FNC"optional data ",=20
+ PRINTPKT(__FUNCTION__ ": optional data ",=20
echo->data, rsp->len-sizeof(sig_echo_pkt));
=20
#ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
@@ -1230,7 +1214,7 @@
info->type =3D le16_to_cpu(info->type);
info->result =3D le16_to_cpu(info->result);
=20=09=09
- D_STATE(FNC"Got info response : result %d\n", info->result);
+ D_STATE(__FUNCTION__ ": Got info response: result %d\n", info->result);
=20
#ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
disable_rtx(tempcon);
@@ -1245,12 +1229,10 @@
=20=09
default:
/* Not a valid command */
- DSYS(FNC"Invalid command 0x%x\n", rsp->code);
+ DSYS(__FUNCTION__ ": Invalid command 0x%x\n", rsp->code);
l2cap_cmdrej(hci_handle, CMDREJ_NOTUNDERSTOOD, NULL, 0);
break;
}
-=09
-#undef FNC
}
=20
=20
@@ -1278,12 +1260,12 @@
void=20
lp_connect_ind(BD_ADDR bd_addr)
{
- PRINTPKT("lp_connect_ind from :",bd_addr, 6);
+ PRINTPKT(__FUNCTION__ ": from: ", bd_addr, 6);
=20
/* Check BD_ADDR */
if ((bd_addr[0]=3D=3D0) && (bd_addr[1]=3D=3D0) && (bd_addr[2]=3D=
=3D0) &&
(bd_addr[3]=3D=3D0) && (bd_addr[4]=3D=3D0) && (bd_addr[5]=3D=
=3D0)) {
- D_ERR("lp_connect_ind : no BD addr\n");
+ D_ERR(__FUNCTION__ ": no BD addr\n");
return;
}
=20=20
@@ -1292,7 +1274,7 @@
/* We are server and creates an l2cap connection object=20
which we set hci handle when we received lp_connect_cfm */
=20=20=20
- D_CON("lp_connect_ind: Accepting connection\n");
+ D_CON(__FUNCTION__ ": Accepting connection\n");
l2cap_create_con(bd_addr);
lp_connect_rsp(bd_addr,1);
}
@@ -1302,8 +1284,8 @@
l2cap_create_con(BD_ADDR bd)
{
l2cap_con *con;
- D_RCV("l2cap_create_con\n");=09
- PRINTPKT("l2cap_create_con : bd ", bd, 6);
+ D_RCV(__FUNCTION__ "\n");=09
+ PRINTPKT(__FUNCTION__ ": bd ", bd, 6);
=20
/* create a new l2cap connection obj and insert it in list */
=20
@@ -1314,7 +1296,7 @@
=20=09
/* Check connection */
if (con =3D=3D NULL) {
- D_ERR("l2cap_create_con : no connection created");
+ D_ERR(__FUNCTION__ ": no connection created");
return;
}
=20=20=20=20=20=20=20=20=20
@@ -1336,17 +1318,17 @@
lp_connect_cfm(u8 *bd_addr, u32 status, u16 con_hdl)
{
l2cap_con *con;
- D_STATE("lp_connect_cfm: %s (hci_handle : %d)\n",=20
+ D_STATE(__FUNCTION__ ": %s (hci_handle : %d)\n",=20
get_err_msg(status), con_hdl);
=20
- D_STATE("lp_connect_cfm : bd %s\n", bd2str(bd_addr));
+ D_STATE(__FUNCTION__ ": bd %s\n", bd2str(bd_addr));
=20
/* FIXME -- use bt session list to notify upper layers that=20
con failed !!! */
=20
/* search for the corresponding l2cap connection */
if ((con =3D get_con(bd_addr, CLOSED)) =3D=3D NULL) {
- D_ERR("lp_connect_cfm : couldn't find l2cap con!\n");
+ D_ERR(__FUNCTION__ ": couldn't find l2cap con!\n");
return;
}
=20
@@ -1360,8 +1342,7 @@
/* see if there is someone to wakeup */
l2ca_wakeup("lp_connect_cfm (pos)", con);
=20=09=09
- if (con->c_flags & FLAG_RETURNNOW)
- {
+ if (con->c_flags & FLAG_RETURNNOW) {
printk("Return NOW\n");
/* clear flag & set status */
con->c_flags &=3D ~FLAG_RETURNNOW;
@@ -1376,23 +1357,22 @@
/* now wait for a connection request */
} else {
D_STATE("We are client\n");
- PRINTPKT("lp_connect_cfm : HCI connected to ",=20
+ PRINTPKT(__FUNCTION__ ": HCI connected to ",=20
bd_addr,6);
=20=20=20=20=20=20=20
ENTERSTATE(con, W4_L2CAP_CONNECT_RSP);
PRINTSTATE(con);
=20=09=09=09
- l2ca_wakeup("lp_connect_cfm", con);
+ l2ca_wakeup(__FUNCTION__, con);
}
} else {
/* neg cfm */
- D_STATE("lp_connect_cfm : (neg) %s\n",get_err_msg(status));
+ D_STATE(__FUNCTION__ ": (neg) %s\n",get_err_msg(status));
con->link_up =3D FALSE;
=20
- l2ca_wakeup("lp_connect_cfm (neg)", con);
+ l2ca_wakeup(__FUNCTION__ " (neg)", con);
=20=09=09
- if (con->c_flags & FLAG_RETURNNOW)
- {
+ if (con->c_flags & FLAG_RETURNNOW) {
con->c_flags &=3D ~FLAG_RETURNNOW;
return;
}
@@ -1448,7 +1428,7 @@
}
}
=20=20=20=20
- D_CON("lp_disconnect_ind : no more l2cap cons on this handle\n");
+ D_CON(__FUNCTION__ ": no more l2cap cons on this handle\n");
=20
/* flush old buffers waiting to be sent on this handle */
btmem_flushhandle((u16)con_hdl);
@@ -1480,11 +1460,11 @@
void=20
process_frame(l2cap_con *con, u8 *data, u32 len)
{=20=20
- PRINTPKT("process_frame : ", data, len);
+ PRINTPKT(__FUNCTION__ ": ", data, len);
=20
if (len > (con->local_mtu)) {
- DSYS("l2cap process_frame : len > local_mtu (%d/%d)\n",=20
- len- L2CAP_HDRSIZE, con->local_mtu);
+ DSYS("l2cap process_frame : len > local_mtu (%ld/%d)\n",=20
+ (long)(len - L2CAP_HDRSIZE), con->local_mtu);
l2cap_cmdrej(con->hci_hdl, CMDREJ_MTUEXCEEDED, NULL, 0);
return;
}=20
@@ -1505,28 +1485,28 @@
s32 i;
u8 rev_bd[6];
=20
- D_RCV("l2ca_connect_req\n");
- PRINTPKT("l2ca_connect_req : sent to bd ",bd, 6);
+ D_RCV(__FUNCTION__ "\n");
+ PRINTPKT(__FUNCTION__ ": sent to bd ",bd, 6);
=20
/* Check bd_addr */
if ((bd[0]=3D=3D0) && (bd[1]=3D=3D0) && (bd[2]=3D=3D0) && (bd[3]=3D=3D0) =
&&
(bd[4]=3D=3D0) && (bd[5]=3D=3D0)) {
- D_ERR("l2ca_connect req : No BD-addr\n");
- return -1;
+ D_ERR(__FUNCTION__ ": No BD-addr\n");
+ return -EINVAL;
}
=20
/* Check PSM */
if ((psm % 2) =3D=3D 0) {
- D_ERR("l2ca_connect_req : incorrect PSM value\n");
- return -1;
+ D_ERR(__FUNCTION__ ": incorrect PSM value\n");
+ return -EINVAL;
}
if ((psm > MAX_PSM) && (psm < MIN_DYNAMIC_PSM)) {
- D_ERR("l2ca_connect_req : value of PSM preserved\n");
- return -1;
+ D_ERR(__FUNCTION__ ": value of PSM preserved\n");
+ return -EINVAL;
}
if (psm > MAX_DYNAMIC_PSM) {
- D_ERR("l2ca_connect_req : PSM value not valid\n");
- return -1;
+ D_ERR(__FUNCTION__ ": PSM value not valid\n");
+ return -EINVAL;
}
=20=09
/* bd is big endian, reverse byte order to little endian */
@@ -1540,8 +1520,8 @@
con =3D create_con(0/* not yet set */, get_cid(), 0/* not yet set */);
/* Check connection */
if (con =3D=3D NULL) {
- D_ERR("l2ca_connect_req : no connection created\n");
- return -1;
+ D_ERR(__FUNCTION__ ": no connection created\n");
+ return -ENOMEM;
}
=20
memcpy(con->remote_bd, rev_bd, 6);
@@ -1563,7 +1543,7 @@
=20
/* if this physical bd link exist for another l2cap con, use that!*/
if (tmpcon) {
- D_STATE("l2ca_connect_req : hci handle already exist.\n");
+ D_STATE(__FUNCTION__ ": hci handle already exist.\n");
con->hci_hdl =3D tmpcon->hci_hdl;
con->link_up =3D 1;
ENTERSTATE(con, W4_L2CAP_CONNECT_RSP);
@@ -1571,19 +1551,19 @@
=20
l2cap_connect_req(con, psm);
=20
- l2ca_wait("l2cap_connect_req : wait rsp", con);
+ l2ca_wait(__FUNCTION__ ": wait rsp", con);
=20
/* fixme -- use con->c_status */
return 0;
} else {
- D_STATE("l2ca_connect_req : create new baseband link\n");
+ D_STATE(__FUNCTION__ ": create new baseband link\n");
lp_connect_req(con->remote_bd);=20=20
=20
/* wait here until we received a lp_connect_cfm */
- l2ca_wait("l2ca_connect_req : wait baseband", con);
+ l2ca_wait(__FUNCTION__ ": wait baseband", con);
=20=09=09
if (con->c_status !=3D RES_SUCCESS) {
- D_ERR("l2cap_connect_req failed !\n");
+ D_ERR(__FUNCTION__ ": failed !\n");
delete_con(con);
return -1;
}
@@ -1593,15 +1573,13 @@
con->c_status =3D CSTATUS_RTX_TIMEOUT;
=20
/* Leave loop when either status failed or success */
- while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT)
- {
+ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) {
/* baseband is up, now initiate send connect req */
l2cap_connect_req(con, con->psm);
=20
/* wait until we received a response or after timeout */
=20
- l2ca_wait("l2cap_connect_req : wait rsp", con);
-
+ l2ca_wait(__FUNCTION__ ": wait rsp", con);
}
=20
return con->c_result;
@@ -1613,8 +1591,8 @@
u16 flush_timeout, u16 link_to)
{=20=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
- return -1;
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
+ return -EINVAL;
}
=20
D_STATE("l2ca_config_req remote cid %d, in_mtu %d\n",=20
@@ -1648,9 +1626,8 @@
=20
return l2cap_config_req(con, in_mtu, outflow,=20
flush_timeout, link_to);=20=20
- return -1;
} else {
- D_ERR("l2cap_config_req : invalid state\n");
+ D_ERR(__FUNCTION__ ": invalid state\n");
PRINTSTATE(con);
return -1;
}
@@ -1662,11 +1639,11 @@
s32 result =3D -1;
=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
- return -1;
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
+ return -EINVAL;
}
=20
- D_STATE("l2ca_disconnect_req remote cid : %d\n", con->remote_cid);
+ D_STATE(__FUNCTION__ ": remote cid : %d\n", con->remote_cid);
=20
if (con->current_state =3D=3D OPEN || con->current_state =3D=3D CONFIG) {
=20
@@ -1675,13 +1652,13 @@
ENTERSTATE(con, W4_L2CAP_DISCONNECT_RSP);
PRINTSTATE(con);
} else {
- D_ERR("l2ca_disconnect_req : Invalid state !\n");
+ D_ERR(__FUNCTION__ ": Invalid state!\n");
PRINTSTATE(con);
return -1;=20=20=20=20
}
=20=09
/* wait here until we get a confirm */
- l2ca_wait("l2ca_disconnect_req", con);
+ l2ca_wait(__FUNCTION__, con);
=20
return con->c_result;
}
@@ -1694,17 +1671,17 @@
{
s32 result;
=20
- D_STATE("l2ca_connect_rsp\n");
+ D_STATE(__FUNCTION__ "\n");
=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
- return -1;
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
+ return -EINVAL;
}
=20
/* optionally send l2cap_connect_rsp_pnd() */=20=20
=20
if (con->current_state !=3D W4_L2CA_CONNECT_RSP) {
- D_ERR("l2ca_connect_rsp : invalid state \n");
+ D_ERR(__FUNCTION__ ": invalid state \n");
PRINTSTATE(con);
return -1;
}
@@ -1714,11 +1691,9 @@
if (response =3D=3D RES_SUCCESS) {=20=20
ENTERSTATE(con, CONFIG);
PRINTSTATE(con);
- }=20
- else if (response =3D=3D RES_PENDING) {
+ } else if (response =3D=3D RES_PENDING) {
/* remain in same state */
- }
- else if (response >=3D RES_PSMNEG) {
+ } else if (response >=3D RES_PSMNEG) {
/* 'l2ca_connect_rsp_neg()' */
ENTERSTATE(con, CLOSED);
PRINTSTATE(con);
@@ -1732,19 +1707,18 @@
s32=20
l2ca_config_rsp(l2cap_con* con, u32 out_mtu, flow *in_flow, s32 result)
{
-#define FNC "l2ca_config_rsp : "
s32 ret_val =3D -1;
=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
- return -1;
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
+ return -EINVAL;
}
=20
- D_STATE(FNC"remote cid %d remote mtu %d\n",=20
+ D_STATE(__FUNCTION__ ": remote cid %d remote mtu %d\n",=20
con->remote_cid, con->remote_mtu);
=20
if (con->current_state !=3D CONFIG) {
- D_ERR("l2ca_config_rsp : invalid state\n");
+ D_ERR(__FUNCTION__": invalid state\n");
PRINTSTATE(con);
return -1;
}
@@ -1771,7 +1745,7 @@
l2ca_config_cfm(con, RES_SUCCESS);
=20
} else {
- D_STATE(FNC"Conf not done or flags set\n");
+ D_STATE(__FUNCTION__ ": Conf not done or flags set\n");
}
} else {
D_STATE("We don't accepted remote options\n");
@@ -1779,18 +1753,17 @@
}
=20
return ret_val;
-#undef FNC
}
=20
s32=20
l2ca_disconnect_rsp(l2cap_con* con)
{
s32 result =3D -1;
- D_STATE("l2ca_disconnect_rsp\n");
+ D_STATE(__FUNCTION__ "\n");
=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
- return -1;
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
+ return -EINVAL;
}
=20
SHOW_CON("disconnecting : ", con);
@@ -1820,7 +1793,7 @@
/* If this con is the last with this hci_hdl, it is deleted=20
when the baseband link goes down */
} else {
- D_ERR("l2ca_disconnect_rsp : invalid state !\n\n");
+ D_ERR(__FUNCTION__ ": invalid state !\n\n");
PRINTSTATE(con);
}
return result;=20=20=20=20
@@ -1858,17 +1831,15 @@
/* do some paranoia checks */
=20
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
return;
}
=20
- D_TIM("l2cap_rtx_timeout (current no rtx : %d)\n",=20
- con->timer.rtx_no);
+ D_TIM(__FUNCTION__ ": current no rtx : %d\n", con->timer.rtx_no);
=20=20=20=20=20=20=20
con->timer.rtx_inuse =3D 0;
=20=20=20
- if (con->timer.rtx_no =3D=3D MAX_NO_RTX)
- {
+ if (con->timer.rtx_no =3D=3D MAX_NO_RTX) {
con->c_status =3D CSTATUS_MAX_NO_RTX;
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
D_TIM("Connection unresponsive\n");
@@ -1887,21 +1858,17 @@
/* start ertx timer */
D_TIM("Starting ERTX\n");
start_ertx(con, ERTX_TIMEOUT);
- }
- else if (con->timer.rtx_action =3D=3D RTX_ACTION_TERMINATE){
+ } else if (con->timer.rtx_action =3D=3D RTX_ACTION_TERMINATE) {
D_TIM("Removing connection\n");
l2ca_disconnect_ind(con);
ENTERSTATE(con, CLOSED);
delete_con(con);
- }
}
- else
- {=20=20
+ } else {
con->timer.rtx_no++;
l2ca_timeoutind(con);=09
}
=20=09
-=09
#ifndef __KERNEL__
timeout_con =3D NULL;
#endif
@@ -1911,12 +1878,12 @@
l2cap_ertx_timeout(unsigned long ptr)
{
l2cap_con *con;
- D_TIM("l2cap_ertx_timeout\n");
+ D_TIM(__FUNCTION__ "\n");
con =3D (l2cap_con*)ptr;
=20
/* do paranoia check */
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
return;
}
=20
@@ -1976,11 +1943,11 @@
sig_conreq *req;
u16 payload_len;
=20
- D_XMIT("l2cap_connect_req: Connecting %s (rcid:%d)\n",psm2str(psm)=
,=20
+ D_XMIT(__FUNCTION__ ": Connecting %s (rcid:%d)\n",psm2str(psm),=20
con->remote_cid);
=20=09
if (con->current_state !=3D W4_L2CAP_CONNECT_RSP) {
- D_ERR("l2cap_connect_req : Invalid state !!!\n");
+ D_ERR(__FUNCTION__ ": Invalid state !!!\n");
return -1;
}
=20
@@ -1988,8 +1955,8 @@
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_connect_req : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2034,7 +2001,7 @@
s32 opt_len=3D0;
struct l2cap_option *opt;
=20
- D_XMIT("l2cap_config_req : rcid :%d\n", con->remote_cid);
+ D_XMIT(__FUNCTION__ ": rcid :%d\n", con->remote_cid);
=20
/******************************************************************/
/* | len2 | CID2 || code1 | id1 || destcid2 | flags1 | options? | */
@@ -2042,7 +2009,7 @@
/* | l2cap hdr || sig cmd hdr || data | */
/******************************************************************/
=20
- D_STATE("l2cap_config_req: inmtu : %d, local mtu : %d\n",
+ D_STATE(__FUNCTION__ ": inmtu : %d, local mtu : %d\n",
in_mtu, con->local_mtu);
=20
if (in_mtu !=3D 0) {
@@ -2060,15 +2027,15 @@
=20=09
if (outflow !=3D NULL){
/* We inform peer about our QOS settings */
- opt_len +=3Dsizeof(flow);
+ opt_len +=3D sizeof *outflow;
}
=20=09
payload_len =3D SIGCMD_HDRSIZE + CONF_REQSIZE + opt_len;=20=20
=20=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_config_req : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2108,8 +2075,8 @@
printk("Sending conf req outflow\n");
print_flow(outflow);
opt->type =3D OPT_QOS;
- opt->len =3D sizeof(flow);
- memcpy((char*)opt+2, outflow, sizeof(flow));
+ opt->len =3D sizeof *outflow;
+ memcpy((char*)opt+2, outflow, sizeof *outflow);
}
}
=20
@@ -2150,14 +2117,14 @@
sig_discreq *req;
u16 payload_len;
=20=20
- D_XMIT("l2cap_disconnect_req : rcid %d\n", con->remote_cid);
+ D_XMIT(__FUNCTION__ ": rcid %d\n", con->remote_cid);
=20
payload_len =3D SIGCMD_HDRSIZE + DISC_REQSIZE;=20=20
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_disconnect_req : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2197,11 +2164,11 @@
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_echo_pkt) + opt_len;
=20
- D_XMIT("l2cap_echo_req\n");
+ D_XMIT(__FUNCTION__ "\n");
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_echo_req : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2242,14 +2209,14 @@
sig_echo_pkt *rsp;
u16 payload_len;
=20
- D_XMIT("l2cap_echo_rsp\n");
+ D_XMIT(__FUNCTION__ "\n");
=20
payload_len =3D SIGCMD_HDRSIZE + opt_len;
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_echo_rsp : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}=20
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2287,12 +2254,12 @@
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_info_req);
=20
- D_XMIT("l2cap_info_req\n");
+ D_XMIT(__FUNCTION__ "\n");
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_info_req : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2328,14 +2295,14 @@
sig_info_rsp *rsp;
s32 payload_len;
=20
- D_XMIT("l2cap_info_rsp\n");
+ D_XMIT(__FUNCTION__ "\n");
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_info_rsp) + info_len;
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE + payload_le=
n);
if (!tx) {
- D_ERR("l2cap_echo_rsp : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}=20
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2376,12 +2343,12 @@
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_cmdreject) + opt_len;
=20
- D_XMIT("l2cap_cmdrej : %s\n", cmdrej_reason[reason]);
+ D_XMIT(__FUNCTION__ ": %s\n", cmdrej_reason[reason]);
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_cmdrej : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}=20=20
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2424,15 +2391,15 @@
sig_conrsp *rsp;
u16 payload_len;
=20=20=20
- D_XMIT("l2cap_connect_rsp : rcid:%d lcid:%d result:%d status:%d \n",
+ D_XMIT(__FUNCTION__ ": rcid:%d lcid:%d result:%d status:%d \n",
con->remote_cid, con->local_cid, response, status);
=20
payload_len =3D SIGCMD_HDRSIZE + CON_RSPSIZE;
=20=20=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_connect_rsp : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2476,7 +2443,7 @@
int opt_len =3D 0;
struct l2cap_option *opt;
=20
- D_XMIT("l2cap_config_rsp : rcid : %d, out_mtu: %d \n",=20
+ D_XMIT(__FUNCTION__ ": rcid : %d, out_mtu: %d \n",=20
con->remote_cid, out_mtu);
=20
/* If negative, the accepted options are sent back */
@@ -2490,7 +2457,7 @@
}
if (in_flow !=3D NULL){
/* The accepted settings for incoming traffic */
- opt_len +=3Dsizeof(flow);
+ opt_len +=3D sizeof *in_flow;
}
}
=20
@@ -2499,8 +2466,8 @@
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) +=20
L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_config_rsp : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2515,8 +2482,7 @@
rsp->result =3D cpu_to_le16((u16)result);
=20
/* Include unaccepted options if any */
- if (opt_len)
- {
+ if (opt_len) {
opt =3D (struct l2cap_option*)(rsp + CONF_RSPSIZE);
=20
if (out_mtu !=3D 0) {
@@ -2534,8 +2500,8 @@
printk("Sending conf req in_flow\n");
print_flow(in_flow);
opt->type =3D OPT_QOS;
- opt->len =3D sizeof(flow);
- memcpy((char*)opt+2, in_flow, sizeof(flow));
+ opt->len =3D sizeof *in_flow;
+ memcpy((char*)opt+2, in_flow, sizeof *in_flow);
}
print_data("options : ", (u8*)rsp, opt_len + CONF_RSPSIZE);
}
@@ -2571,11 +2537,11 @@
=20=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_discrsp);
=20
- D_XMIT("l2cap_disconnect_rsp : rcid %d\n", con->remote_cid);
+ D_XMIT(__FUNCTION__ ": rcid %d\n", con->remote_cid);
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
- D_ERR("l2cap_disconnect_rsp : didn't get a valid tx buf\n");
- return -1;
+ D_ERR(__FUNCTION__ ": didn't get a valid tx buf\n");
+ return -ENOMEM;
}
=20
l2cap_buf =3D (l2cap_tx_buf *)(tx->data);
@@ -2610,13 +2576,13 @@
{
l2cap_tx_buf *l2cap_buf;
=20=20=20
- D_XMIT("l2cap_send_data : hdl : %d, rcid : %d, len:%d \n",
+ D_XMIT(__FUNCTION__ ": hdl : %d, rcid : %d, len:%d \n",
con->hci_hdl, con->remote_cid, tx->cur_len);
=20=09
if (PARANOIA_CHECKCON(con)) {
- D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
+ D_ERR(__FUNCTION__ ": Paranoia check failed\n");
tx->flushed =3D 1; /* flush this buffer */
- return -1;
+ return -EINVAL;
}
=20
if (tx->cur_len > con->remote_mtu) {
@@ -2625,13 +2591,12 @@
=20=09=20=20=20=20
D_ERR("SETTING FLUSHED ON THIS BUFFER !!!\n");
tx->flushed=3D1;
-=09=20=20=20=20
return -1;
}
=20
/* Only send on an OPEN channel */
if (con->current_state !=3D OPEN) {
- D_ERR("l2cap_send_data : not in open state\n");
+ D_ERR(__FUNCTION__ ": not in open state\n");
D_ERR("SETTING FLUSHED ON THIS BUFFER !!!\n");
tx->flushed=3D1;
return -1;
@@ -2649,7 +2614,7 @@
payload len of l2cap i.e an entire
frame of upper layers*/
=20
- PRINTPKT("l2cap_send_data : ", l2cap_buf->frame, tx->cur_len);
+ PRINTPKT(__FUNCTION__ ": ", l2cap_buf->frame, tx->cur_len);
=20
return hci_send_data(tx);
}
@@ -2661,11 +2626,11 @@
void=20
l2ca_connect_ind(l2cap_con *con)=20
{
- D_STATE("l2ca_connect_ind : remote cid : %d psm 0x%x\n",=20
+ D_STATE(__FUNCTION__ ": remote cid : %d psm 0x%x\n",=20
con->remote_cid, con->psm);
=20
if (get_upper(con->psm) =3D=3D &default_protocol) {
- D_STATE("l2ca_connect_ind : PSM not registered\n");
+ D_STATE(__FUNCTION__ ": PSM not registered\n");
l2ca_connect_rsp(con, RES_PSMNEG, STAT_NOINFO);
return;
}
@@ -2676,11 +2641,11 @@
void=20
l2ca_connect_pnd(l2cap_con *con, s32 status)
{
- D_STATE("l2ca_connect_pnd : rCID %d, status %d\n",=20
+ D_STATE(__FUNCTION__ ": rCID %d, status %d\n",=20
con->remote_cid, status);
=20=09
if (!con->initiator) {=20
- D_ERR(" l2ca_connect_cfm : server is not initiator !!!\n")=
;=20
+ D_ERR(__FUNCTION__": server is not initiator !!!\n");=20
return;
}
=20=09
@@ -2692,11 +2657,11 @@
void=20
l2ca_connect_cfm(l2cap_con *con, s32 result)
{
- D_STATE("l2ca_connect_cfm : rCID %d, result %d\n",=20
+ D_STATE(__FUNCTION__ ": rCID %d, result %d\n",=20
con->remote_cid, result);
=20=09
if (!con->initiator) {=20
- D_ERR(" l2ca_connect_cfm : server is not initiator !!!\n")=
;=20
+ D_ERR(__FUNCTION__ ": server is not initiator !!!\n");=20
return;
}
=20
@@ -2706,7 +2671,7 @@
void=20
l2ca_config_ind(l2cap_con* con)
{=20=20
- D_STATE("l2ca_config_ind : remote cid : %d\n", con->remote_cid);=20
+ D_STATE(__FUNCTION__ ": remote cid : %d\n", con->remote_cid);=20
=20=20=20
get_upper(con->psm)->conf_ind(con);=20
}
@@ -2718,7 +2683,7 @@
void=20
l2ca_config_cfm(l2cap_con *con, s32 result)
{
- D_STATE("l2ca_config_cfm : remote cid : %d result %d\n",=20
+ D_STATE(__FUNCTION__ ": remote cid : %d result %d\n",=20
con->remote_cid, result);
=20
get_upper(con->psm)->conf_cfm(con, result);=20
@@ -2727,7 +2692,7 @@
void=20
l2ca_disconnect_ind(l2cap_con *con)
{
- D_STATE("l2ca_disconnect_ind \n");
+ D_STATE(__FUNCTION__ "\n");
=20
get_upper(con->psm)->disc_ind(con);
}
@@ -2737,7 +2702,7 @@
{
s32 tmp_hdl;
=20
- D_STATE("l2ca_disconnect_cfm : remote cid : %d\n", con->remote_cid);
+ D_STATE(__FUNCTION__ ": remote cid : %d\n", con->remote_cid);
=20
/* tell upper layers that connection is down */
get_upper(con->psm)->disc_cfm(con);
@@ -2754,7 +2719,7 @@
delete_con(con);
=20
#ifdef __KERNEL__
- l2ca_wakeup("l2ca_disconnect_cfm", con);
+ l2ca_wakeup(__FUNCTION__, con);
#endif
=20
/* fixme -- if we want to keep baseband connection we must=20
@@ -2762,7 +2727,7 @@
simply just clear l2cap params but keep hci handle ! */
=20=09
if (count_con(tmp_hdl) =3D=3D 0) {
- DSYS("l2ca_disconnect_cfm : (C) no more l2cap connections\n");
+ DSYS(__FUNCTION__ ": (C) no more l2cap connections\n");
DSYS("Shutdown baseband\n");
lp_disconnect(tmp_hdl);
}
@@ -2785,12 +2750,12 @@
con =3D get_con(rev_bd, ANY_STATE);
=20
if (con =3D=3D NULL) {
- D_STATE("l2ca_ping : create new baseband link\n");
+ D_STATE(__FUNCTION__ ": create new baseband link\n");
con =3D create_con(0/* not yet set */,=20
get_cid(), 0/* not yet set */);
if (con =3D=3D NULL) {
- D_ERR("l2ca_ping : no connection created");
- return -1;
+ D_ERR(__FUNCTION__ ": no connection created");
+ return -ENOMEM;
}
=20
memcpy(con->remote_bd, rev_bd, 6);
@@ -2805,14 +2770,13 @@
lp_connect_req(con->remote_bd);
=20
/* wait here until we received a lp_connect_cfm */
- l2ca_wait("l2ca_ping : wait baseband", con);
+ l2ca_wait(__FUNCTION__ ": wait baseband", con);
=20=09=09
=20
if (con->c_status =3D=3D RES_SUCCESS) {
/* check status */
printk("Now we got baseband, send echo req !\n");
- }
- else {
+ } else {
printk("Ping failed !\n");
delete_con(con);
return -1;
@@ -2824,21 +2788,19 @@
con->c_status =3D CSTATUS_RTX_TIMEOUT;
=20
/* leave loop when either status failed or success */
- while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT)
- {
+ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) {
printk("Sending echo req...\n");
l2cap_echo_req(con, opt_data, len);=09
/* wait until we received a response or after timeout */
=20=09=09
printk("Waiting for response or timeout\n");
=20
- l2ca_wait("l2ca_ping wait echo resp", con);
+ l2ca_wait(__FUNCTION__ ": wait echo resp", con);
=20
printk("Woke up after sending echo req\n");
}
=20
- if (con->c_status =3D=3D CSTATUS_MAX_NO_RTX)
- {
+ if (con->c_status =3D=3D CSTATUS_MAX_NO_RTX) {
/* max number reached, try to disconnect */
l2ca_disconnect_req(con);
}
@@ -2862,12 +2824,12 @@
con =3D get_con(rev_bd, ANY_STATE);
=20
if (con =3D=3D NULL) {
- D_STATE("l2ca_getinfo : create new baseband link\n");
+ D_STATE(__FUNCTION__ ": create new baseband link\n");
con =3D create_con(0/* not yet set */,=20
get_cid(), 0/* not yet set */);
if (con =3D=3D NULL) {
- D_ERR("l2ca_getinfo : no connection created");
- return -1;
+ D_ERR(__FUNCTION__ ": no connection created");
+ return -ENOMEM;
}
=20
memcpy(con->remote_bd, rev_bd, 6);
@@ -2883,13 +2845,12 @@
lp_connect_req(con->remote_bd);
=20
/* wait here until we received a lp_connect_cfm */
- l2ca_wait("l2ca_getinfo : wait baseband", con);
+ l2ca_wait(__FUNCTION__ ": wait baseband", con);
=20=09=09
if (con->c_status =3D=3D RES_SUCCESS) {
/* check status */
printk("Now we got baseband, send info req !\n");
- }
- else {
+ } else {
printk("GetInfo failed ! [cstatus %d]\n",=20
con->c_status);
delete_con(con);
@@ -2897,21 +2858,19 @@
}
}
=20=09
-
/* Now send info req */=09
=20
con->c_status =3D CSTATUS_RTX_TIMEOUT;
=20
/* leave loop when either status failed or success */
- while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT)
- {
+ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) {
printk("Sending info req...\n");
l2cap_info_req(con, infotype);=09
/* wait until we received a response or after timeout */
=20=09=09
printk("Waiting for response or timeout\n");
=20
- l2ca_wait("l2ca_ping wait echo resp", con);
+ l2ca_wait(__FUNCTION__ ": wait echo resp", con);
=20
printk("Woke up after sending info req\n");
}
@@ -2943,9 +2902,8 @@
D_TIM("Starting RTX timer (%d sec)\n", timeout);
=20
/* fixme -- add timer list for multiple calls */
- if (con->timer.rtx_inuse)
- {
- D_ERR("start_rtx : timer already used\n");
+ if (con->timer.rtx_inuse) {
+ D_ERR(__FUNCTION__ ": timer already used\n");
return;
}
=20
@@ -2995,8 +2953,7 @@
con->timer.rtx_inuse =3D 0;
con->timer.rtx_no =3D 0;
con->timer.rtx_action =3D RTX_ACTION_DISCONNECT;
- }
- else
+ } else
D_TIM("RTX never started\n");
#else
timer_cancelled =3D 1;
@@ -3010,9 +2967,8 @@
{
D_TIM("Starting ERTX timer (%d sec)\n", timeout);
=20
- if (con->timer.ertx_inuse)
- {
- D_TIM("start_ertx : timer already used\n");
+ if (con->timer.ertx_inuse) {
+ D_TIM(__FUNCTION__ ": timer already used\n");
return;
}
=20
@@ -3038,8 +2994,7 @@
del_timer(&con->timer.ertx);
con->timer.ertx_inuse =3D 0;
con->timer.ertx_action =3D ERTX_ACTION_DISCONNECT;
- }
- else
+ } else
D_TIM("ERTX never started\n");
#else /* Usermode stack */
/* FIXME */
@@ -3077,10 +3032,10 @@
l2cap_option *opt;
s32 found_option =3D 0;
=20
- D_RCV("parse_options : Storing remote options on rCID %d\n",=20
+ D_RCV(__FUNCTION__ ": Storing remote options on rCID %d\n",=20
con->remote_cid);
=20
- PRINTPKT("parse_options : ", data, len);
+ PRINTPKT(__FUNCTION__ ": ", data, len);
=20
while (pos < len) {
opt =3D (l2cap_option*)(data + pos);
@@ -3105,7 +3060,7 @@
=20
/* FIXME -- return error code if not accepted */
=20=09=09=09
- D_RCV("parse_options : flush timeout %d ms\n",=20
+ D_RCV(__FUNCTION__ ": flush timeout %d ms\n",=20
con->flush_timeout);
=20
found_option =3D 1;
@@ -3117,20 +3072,20 @@
=20=09=09=09
/* FIXME -- return error code if not accepted */
=20
- D_RCV("parse_options : qos\n");
+ D_RCV(__FUNCTION__ ": qos\n");
print_flow(&con->remote_qos);
found_option =3D 1;
break;
=20=20=20=20=20=20=20
default:
- D_RCV("parse_options : Invalid type !\n");
+ D_RCV(__FUNCTION__ ": Invalid type !\n");
break;
}
pos +=3D opt->len + 2; /* 2 bytes header */
}
=20
if (!found_option)
- D_WARN("parse_options found NO valid options !\n");
+ D_WARN(__FUNCTION__ ": found NO valid options !\n");
=20=09
return RES_SUCCESS;
}
|
|
From: Peter K. <pk...@us...> - 2001-04-18 14:02:27
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Ok, so I removed two includes too many. Include signal.h and sys/time.h again. The diff of the modified file(s): --- btd.c 2001/04/17 18:09:15 1.8 +++ btd.c 2001/04/18 14:02:24 1.9 @@ -86,11 +86,13 @@ #include <string.h> #include <unistd.h> #include <fcntl.h> +#include <signal.h> #include <syslog.h> #include <getopt.h> #include <setjmp.h> #include <termios.h> #include <sys/ioctl.h> +#include <sys/time.h> #include <sys/wait.h> #include <arpa/inet.h> =20 |
|
From: Peter K. <pk...@us...> - 2001-04-18 14:02:27
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Corrected a typo.
The diff of the modified file(s):
--- bt_if.c 2001/04/17 15:45:28 1.8
+++ bt_if.c 2001/04/18 14:01:34 1.9
@@ -487,7 +487,7 @@
{
int ret_val;
=20
- syslog(LOG_INFO, "bt_force_msswitch_as_server : % d\n"), enable;
+ syslog(LOG_INFO, "bt_force_msswitch_as_server: %d\n", enable);
#ifndef BT_USERSTACK=20
if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) !=3D 0)
{
|
|
From: Peter K. <pk...@us...> - 2001-04-18 11:50:33
|
The following file was modified in apps/bluetooth/btd: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.92 1.93=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added a missing include of l2cap_con.h. The diff of the modified file(s): --- btd.c 2001/04/18 00:53:36 1.92 +++ btd.c 2001/04/18 11:50:32 1.93 @@ -179,6 +179,7 @@ #include "include/btmem.h" #include "include/hci.h" #include "include/l2cap.h" +#include "include/l2cap_con.h" #include "include/sdp.h" #include "include/tcs.h" #include "include/test.h" |
|
From: Peter K. <pk...@us...> - 2001-04-18 11:49:42
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.102 1.103=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Made it compile for user stack.
The diff of the modified file(s):
--- rfcomm.c 2001/04/17 16:57:47 1.102
+++ rfcomm.c 2001/04/18 11:49:42 1.103
@@ -1246,7 +1246,9 @@
Tell the tty that the link is down */
printk("RFCOMM control ch disconnected (remotely)\n");
send_ua(rfcomm, 0);
+#ifdef __KERNEL__
bt_unregister_rfcomm(rfcomm->line);
+#endif
} else {
rfcomm->dlci[tmp_dlci].state =3D DISCONNECTED;
send_ua(rfcomm, tmp_dlci);
|
|
From: Gordon M. <gm...@us...> - 2001-04-18 00:54:07
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.166 1.167=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.139 1.140=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Fixed the hci_inquiry hang (hopefully).
The diff of the modified file(s):
--- bluetooth.c 2001/04/17 23:50:26 1.166
+++ bluetooth.c 2001/04/18 00:53:37 1.167
@@ -706,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 %d %d\n", cmd, size);
+ printk("TEST_COMMAND %d %d\n", (int)cmd, (int)size);
test_process_cmd(cmd, size);
}
=20
@@ -719,13 +719,31 @@
inquiry_results *inq_res;
s32 in_param[2];
u8 lap[3];
+ int ret;
=20=09=09
BT_DRIVER(FNC"HCINQUIRY\n");
=20=09=09
copy_from_user(in_param, (s32*)arg, 8);
- if (!(inq_res =3D hci_inquiry(lap, in_param[1] , in_param[0])))
- return -ENOMEM;
- copy_to_user((s32*)arg, inq_res, size + 6 * inq_res->nbr_of_units);
+
+ if ((inq_res =3D=20
+ (inquiry_results*) kmalloc(sizeof(inquiry_results)
+ + 6 * in_param[0],=20
+ GFP_ATOMIC)) < 0) {
+ ret =3D -ENOMEM;
+ goto hci_inq_exit0;
+ }
+
+ if ((ret =3D hci_inquiry(lap, in_param[1], in_param[0],
+ inq_res)) < 0)
+ goto hci_inq_exit1;
+
+ copy_to_user((s32*)arg, inq_res, size + 6 *=20
+ inq_res->nbr_of_units);
+=09=09
+ hci_inq_exit1:
+ kfree(inq_res);=09=09
+ hci_inq_exit0:
+ return ret;
break;
}
=20=09
--- hci.c 2001/04/17 12:04:00 1.139
+++ hci.c 2001/04/18 00:53:37 1.140
@@ -191,7 +191,7 @@
static void init_cmd_buf(void);
static void send_cmd_queue(void);
static void update_nhcp(s32 nhcp);
-static s32 send_inq_cmd_block(u8 *cmd, u8 len);
+static s32 send_inq_cmd_block(u8 *cmd, u8 len, u8 inq_len);
#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
static u8* get_bd(u16 con_hdl);
#endif
@@ -229,8 +229,9 @@
static void release_ncp_timer(void);
#endif
=20
+#define USE_INQTIMER 1
#ifdef USE_INQTIMER
-static void start_inq_timer(void);
+static void start_inq_timer(u8 inq_len);
static void release_inq_timer(void);
#endif
=20
@@ -303,6 +304,7 @@
=20
static u32 hci_cmd_pending =3D 0;
static u32 hci_inq_pending =3D 0;
+static u8 hci_inq_aborted =3D 0;
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
struct wait_queue *hci_wq =3D NULL;
@@ -640,6 +642,9 @@
case INQUIRY_COMPLETE:
D_CMD("INQUIRY_COMPLETE\n");
hci_inq_pending =3D 0;
+#if USE_INQTIMER
+ release_inq_timer();
+#endif
wake_up_interruptible(&inq_wq);
#ifndef __KERNEL__
for (i =3D 0; i < inq_res->nbr_of_units; i++) {
@@ -665,12 +670,15 @@
}
print_data("BD",tmp_bd, 6);
for (j =3D 0; j < inq_res->nbr_of_units; j++) {
- if (!memcmp(inq_res->bd_addr + inq_res->nbr_of_units * 6, tmp_bd, 6)) {
+ if (!memcmp(inq_res->bd_addr +=20
+ inq_res->nbr_of_units * 6, tmp_bd,
+ 6)) {
j =3D inq_res->nbr_of_units;
}
}
if (j >=3D inq_res->nbr_of_units) {
- memcpy(inq_res->bd_addr + inq_res->nbr_of_units * 6, tmp_bd, 6);
+ memcpy(inq_res->bd_addr +=20
+ inq_res->nbr_of_units * 6, tmp_bd, 6);
inq_res->nbr_of_units +=3D 1;
}
}
@@ -843,6 +851,10 @@
=20=09=09
if (buf[0]) {
D_ERR(__FUNCTION__", COMMAND_STATUS: %s\n",get_err_msg(buf[0]));
+#ifdef USE_INQTIMER
+ if (hci_inq_pending)
+ release_inq_timer();
+#endif
}
=20=09=09
update_nhcp(buf[1]);
@@ -1750,27 +1762,23 @@
expires, Inquiry will be halted. The Num_Responses parameter specifies=
=20
the number of responses that can be received before the Inquiry is halt=
ed.*/
=20
-inquiry_results*=20
-hci_inquiry(u8 *lap, u8 inq_len, u8 num_resp)
+int hci_inquiry(u8 *lap, u8 inq_len, u8 num_resp, inquiry_results *results)
{
s32 tmp;
=20
D_CMD(__FUNCTION__", Sending inquiry()\n");
=20
+ if (!results)
+ return -EINVAL;
+
+ inq_res =3D results;
+
/* FIXME: Check if lap is valid first */
/* Set default lap */
lap[0] =3D 0x33;
lap[1] =3D 0x8b;
lap[2] =3D 0x9e;
=20
- /* Free any previous response */
- kfree(inq_res);
-=09
- inq_res =3D (inquiry_results*) kmalloc(sizeof(inquiry_results)
- + 6 * num_resp, GFP_ATOMIC);
- if (!inq_res)
- return NULL;
-
inq_res->nbr_of_units =3D 0;
=20
c_pkt.type =3D CMD_PKT;
@@ -1785,14 +1793,10 @@
c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
=20
tmp =3D send_inq_cmd_block((u8*) &c_pkt,=20
- c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
-
- if (tmp < 0) {
- kfree(inq_res);
- inq_res =3D NULL;
- }
+ c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN,
+ inq_len);
=20
- return inq_res;
+ return tmp;
}
=20
/* This function will cause the Link Manager to create a connection to the
@@ -3556,14 +3560,15 @@
#ifdef USE_INQTIMER
static void
=20
-start_inq_timer(void)
+start_inq_timer(u8 inq_len)
{
#ifdef __KERNEL__
+#define INQ_FUDGE_FACTOR (2 * HZ)
D_CMD(__FUNCTION__"\n");
init_timer(&hci_inq_timer);
hci_inq_timer.function =3D inq_timeout;
hci_inq_timer.data =3D 0;
- hci_inq_timer.expires =3D jiffies + 10*HZ;
+ hci_inq_timer.expires =3D jiffies + inq_len * INQ_FUDGE_FACTOR;
add_timer(&hci_inq_timer);
#endif
}
@@ -3590,6 +3595,7 @@
=20
printk(__FUNCTION__", Timeout when waiting for inquiry response\n");
hci_inq_pending =3D 0;
+ hci_inq_aborted =3D 1;
wake_up_interruptible(&inq_wq);
}
#endif
@@ -3633,9 +3639,10 @@
}
=20
s32=20
-send_inq_cmd_block(u8 *cmd, u8 len)
+send_inq_cmd_block(u8 *cmd, u8 len, u8 inq_len)
{
u32 tmp;
+
#ifdef __KERNEL__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
struct wait_queue wait =3D { current, NULL};
@@ -3644,24 +3651,35 @@
#endif
=20
down(&hci_inq_semaphore);
-
add_wait_queue(&inq_wq, &wait);
current->state =3D TASK_INTERRUPTIBLE;
-
hci_inq_pending =3D 1;
-#endif
=20
- /*FIXME: currently we have no timer for inquiry */
- tmp =3D send_cmd(cmd, len);
+ if ((tmp =3D send_cmd(cmd, len)) < 0)
+ goto inq_done;
=20=20=20
-#ifdef __KERNEL__
+#ifdef USE_INQTIMER
+ hci_inq_aborted =3D 0;
+ start_inq_timer(inq_len);
+#endif
while (hci_inq_pending)
schedule();
=20
- remove_wait_queue(&inq_wq, &wait);
+#ifdef USE_INQTIMER
+ if (hci_inq_aborted)
+ tmp =3D -ETIME;
+#endif
=20
+ inq_done:
+ remove_wait_queue(&inq_wq, &wait);
up(&hci_inq_semaphore);
-#endif
+
+#else /* __KERNEL__ */
+
+ tmp =3D send_cmd(cmd, len);
+
+#endif /* __KERNEL__ */
+
return tmp;
}
=20
|
|
From: Gordon M. <gm...@us...> - 2001-04-18 00:54:07
|
The following file was modified in apps/bluetooth/btd:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.91 1.92=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Fixed the hci_inquiry hang (hopefully).
The diff of the modified file(s):
--- btd.c 2001/04/17 12:09:10 1.91
+++ btd.c 2001/04/18 00:53:36 1.92
@@ -2900,6 +2900,7 @@
{
#ifdef BTD_USERSTACK
char inq_lap[6];
+ inquiry_results *inq_res;
=20
printf("Inquiring...\n");
=20
@@ -2907,7 +2908,8 @@
inq_lap[1] =3D 0x8b;
inq_lap[2] =3D 0x9e;
=20
- hci_inquiry(inq_lap, t, nbr_rsp);
+ inq_res =3D (inquiry_results*) malloc(sizeof(inquiry_results) + nbr_rsp =
* 6);
+ hci_inquiry(inq_lap, t, nbr_rsp, inq_res);
#else
int i;
inquiry_results *inq_res;
|
|
From: Gordon M. <gm...@us...> - 2001-04-18 00:53:37
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.51 1.52=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed the hci_inquiry hang (hopefully). The diff of the modified file(s): --- hci.h 2001/04/17 16:06:49 1.51 +++ hci.h 2001/04/18 00:53:37 1.52 @@ -99,7 +99,7 @@ s32 hci_sprint_local_info(u8 *buf); s32 hci_sprint_local_bd(u8 *buf); =20 -inquiry_results* hci_inquiry(u8 lap[], u8 inq_len, u8 num_resp); +int hci_inquiry(u8 lap[], u8 inq_len, u8 num_resp, inquiry_results*); s32 hci_add_sco_connection(u32 hci_hdl); =20 /* Link control commands */ |
|
From: Gordon M. <gm...@us...> - 2001-04-17 23:50:27
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.165 1.166=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Fixed a bug that could cause an SDP connection request to block the user =
process indefinitely.
The diff of the modified file(s):
--- bluetooth.c 2001/04/17 16:05:11 1.165
+++ bluetooth.c 2001/04/17 23:50:26 1.166
@@ -1678,6 +1678,29 @@
* half to process the request and get back to us.=20=20=20
*/
=20=09=09=09
+ /* I seem to be having a lot of trouble with the L2CAP
+ traffic just not appearing on this side of the link
+ while I'm waiting for the SDP conneciton to finish
+ up. So let's start a timer to wake us up if things
+ don't appear to be working out.
+ --gmcnutt
+ */
+ /* fixme -- we probably need a lock on this timer since
+ multiple processes could be trying to use it at the
+ same time... or maybe use one timer per session.
+ */
+ start_wq_timer(&bt_timer, BT_CON_TIMEOUT,=20
+ &bt_ctrl.connect_wq[line]);
+
+ /* The timeout routine doesn't have a hendle to our=20
+ session status, so set things up to reflect a=20
+ timeout error by default. If we really do get a=20
+ connection then this value _should_ be changed by
+ the time we wake up to reflect a good connection.
+ --gmcnutt
+ */
+ bt_ctrl.session[line].connect_status =3D -ETIMEDOUT;
+
BT_DRIVER(FNC"sleep on line %d\n", line);
interruptible_sleep_on(&bt_ctrl.connect_wq[line]);
=20
@@ -2408,6 +2431,8 @@
{
s32 found =3D 0;
=20
+ printk(__FUNCTION__ ": line =3D %d (gjm)\n", line);
+
if (!bt_stack_initiated) {
D_WARN("bt_register_sdp : Bluetooth stack not initialized\n");
return -1;=09
@@ -2686,8 +2711,7 @@
#else
struct wait_queue **wq =3D (struct wait_queue **)ptr;
#endif /* LINUX_VERSION_CODE */
-
- //printk("wq_timeout wq 0x%x\n", wq);
+ DSYS(__FUNCTION__"\n");
=20
/* wake up wait queue */
wake_up_interruptible(wq);
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 21:55:57
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.23 1.24=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Fixed a compiler warning.
The diff of the modified file(s):
--- hci_vendor.c 2001/04/17 16:05:11 1.23
+++ hci_vendor.c 2001/04/17 21:55:56 1.24
@@ -505,7 +505,7 @@
}
=20
void
-bt_show_vendor()
+bt_show_vendor(void)
{
DSYS("Current HW: %s\n", VENDOR);
}
|
|
From: Peter K. <pk...@us...> - 2001-04-17 18:09:16
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Do not add ipa_fd to the set of selected file descriptos if
USE_IPASSIGN is not defined.
* The --modem-emul (-m) option now has an effect again.
* Removed some unnecessary includes.
The diff of the modified file(s):
--- btd.c 2001/04/04 10:43:04 1.7
+++ btd.c 2001/04/17 18:09:15 1.8
@@ -81,26 +81,17 @@
=20
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =
- */
=20
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <time.h>
#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <termios.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
#include <syslog.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <signal.h>
#include <getopt.h>
#include <setjmp.h>
-
-/* inet_ntoa */
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
#include <arpa/inet.h>
=20
#include "btd.h"
@@ -155,8 +146,8 @@
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* IPA stuff */
=20
-static int ipa_fd =3D -1;
#ifdef USE_IPASSIGN
+static int ipa_fd =3D -1;
static struct ipa_msg *msg;
static unsigned char ipa_buf[256];
static int parse_ipa_response(struct ipa_msg *msg);
@@ -316,11 +307,12 @@
tv.tv_usec =3D 0;
=20
FD_ZERO(&rfd);=20=20
+#ifdef USE_IPASSIGN
FD_SET(ipa_fd, &rfd);
+#endif
FD_SET(0, &rfd);
=20
- result =3D select(FD_SETSIZE, &rfd, (fd_set*)0,=20
- (fd_set*)0, &tv);
+ result =3D select(FD_SETSIZE, &rfd, NULL, NULL, &tv);
switch (result)
{
case 0:
@@ -487,8 +479,7 @@
=20=20=20=20=20
get_local_addr(local_ip);
/* local/remote ip */
- sprintf(ip_addresses, "%s:%s", local_ip,=20
- inet_ntoa(ipset->ip));
+ sprintf(ip_addresses, "%s:%s", local_ip, inet_ntoa(ipset->ip));
=20=20=20=20=20
printf("IP used : %s\n", ip_addresses);
=20
@@ -602,9 +593,12 @@
=20=20=20=20=20=20=20
_exit(0);
}=20
+ else if (PEER(line).pppd_pid > 0)
+ {
syslog(LOG_INFO, "Started modem emulator on %s [pid : %d]",=20
dev, PEER(line).pppd_pid);=20
}
+ }
else
{
STATE(line) =3D PPPD_STARTED;
@@ -619,6 +613,10 @@
=20=20=20=20=20=20=20
_exit(0);
}=20
+ else if (PEER(line).pppd_pid > 0)
+ {
+ D(syslog(LOG_INFO, "Started pppd on %s [pid: %d]", dev, PEER(line).p=
ppd_pid));
+ }
}
=20=20=20
return 0;=20
@@ -743,7 +741,7 @@
{
PEER(i).state =3D NOCONNECTION;
PEER(i).pppd_pid =3D -1;
- PEER(i).do_modememul =3D 1; /* all enabled per default */
+ PEER(i).do_modememul =3D modem_emul;
PEER(i).ipset =3D NULL;
}=20=20
=20=20=20
|
|
From: Peter K. <pk...@us...> - 2001-04-17 17:35:07
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_vendor.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Changed bt_send_raw_data() to bt_send_raw_hci().
* Removed a lot of unnecessary includes.
The diff of the modified file(s):
--- bt_vendor.c 2001/04/17 12:25:50 1.7
+++ bt_vendor.c 2001/04/17 17:35:03 1.8
@@ -40,31 +40,11 @@
*
*/
=20=20
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <time.h>
#include <stdio.h>
-#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
-#include <stdlib.h>
-#include <string.h>
#include <syslog.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <getopt.h>
-
-/* The following includes are required to be able to determine the local
- * address by examining eth0 */
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/un.h>
-#include <arpa/inet.h>
+#include <sys/ioctl.h>
=20
#include "bt_misc.h"
#include "bt_vendor.h"
@@ -148,7 +128,7 @@
printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[12]);
printf("Length_Of_Test_Data : 0x%x\n", tmp[8]);
=20
- bt_send_raw_data(test_msg, 16);
+ bt_send_raw_hci(bt_cfd, test_msg, 16);
}
=20
void
@@ -165,7 +145,7 @@
=20
printf("*** Sending enter test mode (handle : 0x%x)***\n", tmp[0]);
=20
- bt_send_raw_data(ecs_test_msg, 7);
+ bt_send_raw_hci(bt_cfd, ecs_test_msg, 7);
}
=20
void
@@ -229,7 +209,7 @@
printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[13]);
printf("Length_Of_Test_Data : 0x%x\n", tmp[10]);
=20=20=20
- bt_send_raw_data(bt_cfd, test_msg, 17);
+ bt_send_raw_hci(bt_cfd, test_msg, 17);
=20
printf("TX test starting.\n");
}
|
|
From: Peter K. <pk...@us...> - 2001-04-17 16:57:48
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.101 1.102=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Unregister rfcomm when disconnecting control channel remotely.
The diff of the modified file(s):
--- rfcomm.c 2001/04/17 10:00:26 1.101
+++ rfcomm.c 2001/04/17 16:57:47 1.102
@@ -1245,7 +1245,8 @@
/* FIXME:
Tell the tty that the link is down */
printk("RFCOMM control ch disconnected (remotely)\n");
- send_ua(rfcomm, tmp_dlci);
+ send_ua(rfcomm, 0);
+ bt_unregister_rfcomm(rfcomm->line);
} else {
rfcomm->dlci[tmp_dlci].state =3D DISCONNECTED;
send_ua(rfcomm, tmp_dlci);
|
|
From: Peter K. <pk...@us...> - 2001-04-17 16:06:50
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.h 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20 btcommon.h 1.70 1.71=20=20=20=20=20=20=20=20=20=20=20=20 hci.h 1.50 1.51=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.h 2001/03/30 10:51:53 1.38 +++ bluetooth.h 2001/04/17 16:06:49 1.39 @@ -73,8 +73,6 @@ s32 bt_registered(struct tty_struct *tty); =20 void bt_shutdown(void); -void show_bt_version(void); -char *get_hw_name(void); void bt_hangupline(s32 line); void bt_feedstack(void); =20 --- btcommon.h 2001/04/12 15:14:50 1.70 +++ btcommon.h 2001/04/17 16:06:49 1.71 @@ -194,9 +194,9 @@ =20 /* NOTE ! * N_BT should be defined in /include/asm/termios.h=20 - * However, if you are compiling this source standalone - * the following define can be useful. If this number is taken=20 - * simply change it to something not taken. + * However, if you are compiling this source standalone, the following def= ine + * may be useful. If this number is already used simply change it to somet= hing + * that is not used. */ =20 #ifndef N_BT @@ -535,9 +535,6 @@ u32 serport_name_length; u8 serport_name[64]; } serport_profile_info; - -extern s32 bt_current_hw; -extern u8 bt_hw_firmware_info[255]; =20 #endif /****************** END OF FILE btcommon.h *******************************= ***/ --- hci.h 2001/03/31 15:49:39 1.50 +++ hci.h 2001/04/17 16:06:49 1.51 @@ -155,7 +155,11 @@ s32 hci_set_bd_addr(u8 bd[6]); s32 hci_set_baudrate(u32 baudrate);=20 s32 hci_read_firmware_rev_info(void); -void show_bt_vendor(void); + +char *bt_hw_vendor(void); +char *bt_hw_firmware(void); + +void bt_show_vendor(void); =20 #endif /****************** END OF FILE hci.h ************************************= ***/ |
|
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);
}
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 15:48:15
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: added more error codes The diff of the modified file(s): --- bt_errno.h 2001/03/30 12:18:55 1.1 +++ bt_errno.h 2001/04/17 15:48:15 1.2 @@ -57,6 +57,8 @@ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* HCI */ =20 +/* fixme */ + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* L2CAP */ =20 @@ -75,9 +77,21 @@ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* RFCOMM */ =20 +/* fixme */ + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* SDP */ =20 +/* fixme */ + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* TCS*/ =20 +/* fixme */ + +/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ +/* BT INTERFACE */ + +#define BT_NOTCONNECTED 0x1 +#define BT_ALREADYCONNECTED 0x2 +#define BT_TIMEOUT 0x3 |
|
From: Mattias A. <mat...@us...> - 2001-04-17 15:45:28
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added more error messages
The diff of the modified file(s):
--- bt_if.c 2001/04/17 12:24:58 1.7
+++ bt_if.c 2001/04/17 15:45:28 1.8
@@ -62,6 +62,7 @@
#include "bt_misc.h"
#include "bt_conf.h"
#include "bt_user.h"
+#include "bt_errno.h"
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* Functions common for kernel and usermode stack */
@@ -858,7 +859,7 @@
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* Misc functions */
=20
-/* See spec p 769 error codes for HCI */
+/* See bt_errno.h for error codes */
const char *error_msg(int err)
{
int layer =3D (err >> 16) & 0xffff;
@@ -868,6 +869,8 @@
{
case MSG_LAYER_HCI:
{
+
+ /* fixme -- add these as defines in bt_errno.h */
switch(code)
{=20=20=20=20=20=20=20
case 0x03:=20=20=20=20=20=20=20=20
@@ -913,6 +916,43 @@
}
break;
=20=20=20=20=20
+ case MSG_LAYER_RFCOMM:
+ {
+ /* fixme */
+ return "RFCOMM - unknown reason";
+ }
+ break;
+
+ case MSG_LAYER_SDP:
+ {
+ /* fixme */
+ return "SDP - unknown reason";
+ }
+ break;
+=20=20=20=20
+ case MSG_LAYER_TCS:
+ {
+ /* fixme */
+ return "TCS - unknown reason";
+ }
+ break;
+=20=20=20=20
+ case MSG_BT_INTERFACE:
+ {
+ switch(code)
+ {=20
+ case BT_NOTCONNECTED:
+ return "BT_INTERFACE - Not connected";
+ case BT_ALREADYCONNECTED:
+ return "BT_INTERFACE - Already connected";
+ case BT_TIMEOUT:
+ return "BT_INTERFACE - Timeout";
+ default:
+ return "BT_INTERFACE - unknown reason";
+ }
+ }
+ break;
+
default:
return "General failure";
}
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 15:42:52
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
modememul.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
*=A0added more parsing of ppp frame to distinguish PPP connect from disconn=
ect
* removed palm fix (unused)
* added debug macro to turn off/on syslog
* minor changes & cleanup
The diff of the modified file(s):
--- modememul.c 2001/03/13 22:21:17 1.3
+++ modememul.c 2001/04/17 15:42:51 1.4
@@ -60,18 +60,20 @@
#include "btd.h"
#include "bt_misc.h"
=20
-#define PPPDCMD "pppd"
+#define D(x) //x
=20
-//#define PALM_FIX
+#define PPPDCMD "pppd"
=20
/* Modem emulator stuff */
=20
-
#define RESTART 0
#define START_PPP 1
=20
-#define PPP_DELIMITER 0x7e
+#define PPP_FLAGSEQUENCE 0x7e
+#define PPP_CONTROL_ESCAPE 0x7d
+#define PPP_CONF_REQ 0x1
#define PPP_TERM_REQ 0x5
+#define PROT_LCP 0xc021
=20
int modem_emulator(int bt_fd);
int parse_modem_data(int bt_fd, char *data, int len);
@@ -79,7 +81,6 @@
=20
/* add sig handler which traps SIGHUP */
=20
-
void
sighandler(int sig)
{
@@ -91,7 +92,6 @@
}
}
=20
-
void
init_sighandler(void)
{
@@ -125,7 +125,9 @@
exit(1);
}
=20=20=20=20=20
+ /* not necessary for BT devices... */
fd_setup(btfd, speed, USE_NO_FLOW);
+
syslog(LOG_INFO, "done.");
done =3D modem_emulator(btfd);
syslog(LOG_INFO, "Exit modem emulator");
@@ -145,8 +147,7 @@
=20
int modem_emulator(int bt_fd)
{=20
- /* FIXME -- adjust this to real speed */
- char *connect =3D "CONNECT 115200\r\n";
+ char *connect =3D "CONNECT\r\n";
char *client_server =3D "CLIENTSERVER\r\n";
char *ok =3D "OK\r\n";
char data[128];
@@ -165,39 +166,73 @@
int len =3D read(bt_fd, &data, 128);=20=20=20=20=20=20
data[len] =3D 0;
=20
+ D(syslog(LOG_INFO, "Modem emulator got %d bytes\n", len));
+=20=20=20=20=20=20
if (len <=3D 0)
return RESTART;
-
=20=20=20=20=20=20=20
- /* Check if data is a ppp frame, if so start pppd right away=20
- and hope we catch a retransmission */
+ /* Check if data is a ppp frame, if so start pppd right away */
=20=20=20=20=20=20=20
for (i =3D 0; i < len; i++)
{
- if (data[i] =3D=3D PPP_DELIMITER)
- {
- /* fixme<3> -- check prot field + LCP code for conf req aswell */
=20=09=20=20
+ if ((data[i] =3D=3D PPP_FLAGSEQUENCE))
+ {
if ((len - i) >=3D 7)
{
- if (((data[i+7]^0x20) =3D=3D PPP_TERM_REQ))
+ unsigned short prot;
+ unsigned short type;
+
+ /* check for escaped chars */=20=20=20=20=20=20=20=20=20=20=20=
=20
+ if (data[i+2] =3D=3D PPP_CONTROL_ESCAPE)=20
+ {=20
+ D(syslog(LOG_INFO, "Found ctrl esc\n"));
+ prot =3D ((data[i+4]<<8) | (data[i+5]));
+ }
+ else
+ {
+ prot =3D ((data[i+3]<<8) | (data[i+4]));
+ }
+=20=20=20=20=20=20=20=20=20=20=20=20
+ D(syslog(LOG_INFO, "prot : %x", prot));
+=20=20=20=20=20=20=20=20=20=20=20=20
+ D(print_data("ppp packet : ", data, len));
+=20=20=20=20=20=20=20=20=20=20=20=20
+ if (prot =3D=3D PROT_LCP)
+ {
+ type =3D (data[i+7]^0x20);
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20
+ if (type =3D=3D PPP_TERM_REQ)
{
syslog(LOG_INFO, "Found PPP Terminate, restart modem emulator");
return RESTART;
- }
}
- syslog(LOG_INFO, "Found PPP Frame, start pppd");
+ else if (type =3D=3D PPP_CONF_REQ)
+ {=20=20
+ syslog(LOG_INFO, "Found PPP Connect, start pppd");
return START_PPP;
}
+ else
+ {
+ syslog(LOG_INFO, "Unknown PPP LCP type [%d]", type);
+ return START_PPP; /* start pppd anyway */
+ }=20
+ }
+ else
+ {
+ syslog(LOG_INFO, "Unknown PPP prot type [%d]", prot);
+ return RESTART;=20
}=20=20=20=20=20=20
+ }
+ }=20=20=20=20=20=20
+ }
=20=20=20=20=20=20=20
+ /* AT commands */
+
if(!strncasecmp(data, "ATD", 3)) /* windows standard modem */
{
syslog(LOG_INFO, "got ATD");
=20=09
-#ifdef PALM_FIX
- sleep(2); /* wait for client */
-#endif
syslog(LOG_INFO, "Write : %s", connect);
write(bt_fd, connect, strlen(connect));=20=20=20
syslog(LOG_INFO, "Modem connected !");
@@ -210,13 +245,6 @@
syslog(LOG_INFO, "Nullmodem connected !");
return START_PPP;
}
-#ifdef PALM_FIX
- else if (search_str(data, "DT")) /* palm */
- {
- syslog(LOG_INFO, "found DT");
- return START_PPP;
- }
-#endif=20=20=20=20=20=20
else
{
syslog(LOG_INFO, "Modem emulator replies OK");
@@ -226,27 +254,3 @@
}
return done;
}
-
-#ifdef PALM_FIX
-int=20
-search_str(char *data, const char *searchstr)=09
-{
- int cur =3D 0;
- int len =3D strlen(data);
-
- if (len < 0)
- return 0;
-
- while (cur < (len-strlen(searchstr)))
- {
- if(!strncasecmp(data+cur, searchstr, strlen(searchstr)))
- {
- /* found searchstr */
- //printf("search_str : found %s!\n", (char*)search_str);
- return 1;
- }
- cur++;
- }
- return 0;
-}
-#endif
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 14:18:27
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.1 Added The accompanying log: initial version (skeleton) |
|
From: Mattias A. <mat...@us...> - 2001-04-17 12:43:39
|
The following files were modified in apps/bluetooth/sdp_server:
Name Old version New version Comment
---- ----------- ----------- -------
sdp_parser.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20
sdp_server.c 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
changed syslog priority
The diff of the modified file(s):
--- sdp_parser.c 2001/03/26 13:48:28 1.17
+++ sdp_parser.c 2001/04/17 12:43:39 1.18
@@ -71,31 +71,31 @@
#endif
=20
#if SDP_DEBUG_XMIT
-#define D_XMIT(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_XMIT(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_XMIT(fmt...)
#endif
=20
#if SDP_DEBUG_REC
-#define D_REC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_REC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_REC(fmt...)
#endif
=20
#if SDP_DEBUG_MISC
-#define D_MISC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_MISC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_MISC(fmt...)
#endif
=20
#if SDP_DEBUG_MEM
-#define D_MEM(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_MEM(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_MEM(fmt...)
#endif
=20
#if SDP_DEBUG_PROC
-#define D_PROC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_PROC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_PROC(fmt...)
#endif
@@ -163,6 +163,7 @@
int sdp_con_id;
data_struct *db_hdl;
=20
+ D_REC("%d bytes",len);
PRINT_DATA(__FUNCTION__, data, len);
=20
db_hdl =3D (data_struct*)data;
@@ -347,6 +348,7 @@
if (len < cur_pos)
{
D_ERR("Packet length (%d) shorter than actual packet length (%d)", len=
, cur_pos);
+
send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE);
return;
}
@@ -819,7 +821,7 @@
}
else if (len =3D=3D 0)
{
- syslog(LOG_DEBUG, "No data was read");
+ syslog(LOG_INFO, "No data was read");
}
else
{
--- sdp_server.c 2001/03/27 18:12:47 1.26
+++ sdp_server.c 2001/04/17 12:43:39 1.27
@@ -77,37 +77,37 @@
#define SDP_DEBUG_PRINT_DATA 0
=20
#if SDP_DEBUG_SUBFNC
-#define S_FNC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define S_FNC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define S_FNC(fmt...)
#endif
=20
#if SDP_DEBUG_INCOMING
-#define D_REC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_REC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_REC(fmt...)
#endif
=20
#if SDP_DEBUG_MISC
-#define D_MISC(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_MISC(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_MISC(fmt...)
#endif
=20
#if SDP_DEBUG_GET_ATTRIBUTES
-#define D_ATTR(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_ATTR(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_ATTR(fmt...)
#endif
=20
#if SDP_DEBUG_GET_RECORD_HDL
-#define D_RHDL(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_RHDL(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_RHDL(fmt...)
#endif
=20
#if SDP_DEBUG_MEM
-#define D_MEM(fmt...) syslog(LOG_DEBUG, __FUNCTION__ ": " fmt)
+#define D_MEM(fmt...) syslog(LOG_INFO, __FUNCTION__ ": " fmt)
#else
#define D_MEM(fmt...)
#endif
@@ -165,21 +165,21 @@
int t, offs =3D 0;
char tmp[100];
=20
- syslog(LOG_DEBUG, "%s (%d):", message, len);
+ syslog(LOG_INFO, "%s (%d):", message, len);
=20
for (t =3D 0; t < len; t++)=20
{
offs +=3D sprintf(tmp + offs, " 0x%02x", (unsigned int)buf[t]);
if (!((t+1) % 8))
{
- syslog(LOG_DEBUG, tmp);
+ syslog(LOG_INFO, tmp);
offs =3D 0;
}
}
=20
if (offs)
{
- syslog(LOG_DEBUG, tmp);
+ syslog(LOG_INFO, tmp);
}
}
=20
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 12:26:06
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_vendor.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added set event filter for all HW
The diff of the modified file(s):
--- bt_vendor.c 2001/04/04 12:39:17 1.6
+++ bt_vendor.c 2001/04/17 12:25:50 1.7
@@ -85,12 +85,12 @@
void
init_hw(int bt_cfd, int phys_fd, int spd)
{
- bt_write_scan_enable(bt_cfd, 0 /* not used */);
+ bt_write_scan_enable(bt_cfd, 0 /* inpars not used */);
=20
sleep(1);
=20
/* set_event_filter must be called for m/s switch on IrmaC! */
- bt_set_event_filter(bt_cfd, 0 /* not used */);
+ bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
=20
sleep(1); // wait for HW...
=20
@@ -259,6 +259,8 @@
printf("WARNING : Does this HW really support speeds > 115200 ?\n");
}
=20=20=20
+ bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+
/* Now set phys device speed to whatever HW was set to use */
fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20
=20
@@ -294,6 +296,8 @@
=20
sleep(1);
=20
+ bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+
syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20
=20
bt_set_baudrate(bt_cfd, spd);
@@ -318,13 +322,13 @@
void
init_hw(int bt_cfd, int phys_fd, int spd)
{
-#ifndef BT_USERSTACK
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
=20
printf("Setting write_scan_enable in USB module!\n");
=20=20=20
bt_write_scan_enable(bt_cfd, wrscan);
-#endif
+ bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+
}
=20
#elif HW_USED(HW_NOINIT)
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 12:25:00
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
corrected wrong external variable name
The diff of the modified file(s):
--- bt_if.c 2001/04/11 12:42:30 1.6
+++ bt_if.c 2001/04/17 12:24:58 1.7
@@ -1241,20 +1241,30 @@
int
bt_register_rfcomm(struct rfcomm_con *rfcomm, u8 dlci)
{
+ printf("bt_register_rfcomm on dlci %d\n", dlci);
test_rfcomm =3D rfcomm;
- testdlci =3D dlci;
+ test_dlci =3D dlci;
return 0;
}
=20
s32
+bt_unregister_rfcomm(s32 line)
+{
+ printf("bt_unregister_rfcomm on line %d\n", line);
+ /* fixme -- stub for now */
+}
+
+s32
bt_register_sdp(u8 line, u8 sdpID)
{
printf("bt_register_sdp\n");
+ return 0;
}
=20
s32 bt_unregister_sdp(s32 line)
{
printf("bt_unregister_sdp\n");
+ return 0;
}
=20
int bt_initiated(void)
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 12:09:11
|
The following file was modified in apps/bluetooth/btd:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.90 1.91=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added setting event filter for CSR Hw too.
* added return code in start_sdp_server
* fixed correct args when starting sdp_server in usermode stack
* fixed shutting down sdp_server when quitting btd
* changed how test_disc works, now shut down all l2cap connections
* minor changes
The diff of the modified file(s):
--- btd.c 2001/04/11 12:23:45 1.90
+++ btd.c 2001/04/17 12:09:10 1.91
@@ -231,7 +231,7 @@
#define BT_DATA(fmt...)=20
#endif
=20
-#if BT_DATAFLOW_DEBUG
+#if BT_DATADUMP_DEBUG
#define PRINTPKT(str, data, len) print_data(str, data, len)
#else
#define PRINTPKT(str, data, len)
@@ -285,9 +285,7 @@
static int open_socket(char *name, int role);
=20
static int sdpsrv_pid =3D 0;
-#ifndef BTD_USERSTACK
-static void start_sdp_server(void);
-#endif
+static int start_sdp_server(void);
=20
/* misc */
#ifndef BTD_USERSTACK
@@ -732,12 +730,8 @@
physdev, btdev, speedstring);
#endif
=20
- /* FIXME -- add check for pppd */
-
-#ifndef BTD_USERSTACK
if (role =3D=3D SERVER)
- start_sdp_server();
-#endif
+ sdpsrv_pid =3D start_sdp_server();
=20=20=20
spd =3D atoi(speedstring);
=20
@@ -776,10 +770,6 @@
{
read_history(BTD_HISTORY_FILE);
=20
-#ifdef BTD_USERSTACK
- sleep(2); /* temp fix - wait for last command response to be returned =
*/
-#endif
-
printf("Now entering cmd line mode\n");
=20
show_menu();
@@ -917,21 +907,32 @@
}
#endif /* !HAVE_READLINE */
=20
-#ifndef BTD_USERSTACK
-static void start_sdp_server(void)
+#define SDPSRV_CONF "/etc/sdp.xml"
+
+#ifdef BTD_USERSTACK
+#define SDPSRV_PROC "/tmp/sdp_sock"
+#else
+#define SDPSRV_PROC "/proc/sdp_srv"
+#endif
+
+int start_sdp_server(void)
{
- syslog(LOG_INFO, "Starting SDP server\n");
+ int sdpsrv_pid;
+ char *args[] =3D { SDPSRV_CMD, SDPSRV_CONF, SDPSRV_PROC, NULL };
=20=20=20
+ syslog(LOG_INFO, "Starting SDP server [%s]\n", SDPSRV_CMD);=20=20
+
if (!(sdpsrv_pid =3D vfork()))
{
- execlp(SDPSRV_CMD, SDPSRV_CMD);
+ execvp(SDPSRV_CMD, args);
=20
fprintf(stderr, "%s: no such file or directory\n", SDPSRV_CMD);
+ syslog(LOG_INFO, "%s not found", SDPSRV_CMD);
=20
_exit(0);
}
+ return sdpsrv_pid;
}
-#endif
=20
static void start_pppd(void)
{
@@ -1546,12 +1547,25 @@
}
else if (strncmp(buf, "test_disc", 9) =3D=3D 0)
{
- printf("Disconnecting TEST layer\n");
+ l2cap_con *con =3D get_first_con();
+ printf("Disconnecting all l2cap cons\n");
+
+#if 1
+ con =3D get_first_con();
+ while (con!=3D NULL) {
+ l2ca_disconnect_req(con);
+ con =3D get_first_con();
+ sleep(1);
+ }
+#else
test_disconnect_req(testcon); /* extern l2cap_con set in test.c */
sleep(2);
test_disconnect_req(testcon2);
sleep(2);
test_disconnect_req(testcon3);
+#endif=20=20=20=20
+ /* shutdown baseband ? */
+
}
else if(sscanf(buf, "bb_conn %x:%x:%x:%x:%x:%x",
&bd[5], &bd[4], &bd[3], &bd[2], &bd[1], &bd[0]) =3D=3D 6)
@@ -1732,6 +1746,9 @@
bt_initdone =3D 0;
}
#endif
+
+ btd_killchilds();
+
}
=20
int open_device(char* dev, int flags, int role)
@@ -2168,7 +2185,7 @@
if (pthread_create(&read_thread, NULL,=20
(void*)hci_receive_thread, NULL)!=3D0)
perror("pthread_create");=20=20=20=20
- sleep(1); /* wait for thread to start */
+=20
return 0;
}
=20
@@ -2290,6 +2307,8 @@
int retval;
int bytes_sent =3D 0;
=20
+ printf("bt_write_top : try sending data on last connected ch\n");
+
BT_DATA(" |X|<-- %3d [%d]\n", count, line);
=20=20=20
while (bytes_sent!=3Dcount)
@@ -2300,13 +2319,12 @@
if (retval > 0)
bytes_sent+=3Dretval;
else if (retval=3D=3D0)
- usleep(1000); /* wait some ... */
+ usleep(100000); /* wait some ... */
else
{
printf("error\n");
return retval;
}
-=20=20=20
usleep(1000); /* wait some time ... */
};
=20
@@ -3153,7 +3171,7 @@
=20
/* set_event_filter must be called for m/s switch on IrmaC! */
sleep(1);
- evfilter[0] =3D 0x02; /* Conenction setup */
+ evfilter[0] =3D 0x02; /* Connection setup */
evfilter[1] =3D 0x00; /* All devices */
evfilter[2] =3D 0x01; /* No auto accept */
printf("Setting event filter in Ericsson module!\n");
@@ -3228,6 +3246,7 @@
{=20=20
#ifndef BTD_USERSTACK
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
+ unsigned char evfilter[3];=20
unsigned int tmp[2];
tmp[0]=3D0x50;
tmp[1]=3D0x20;
@@ -3248,6 +3267,19 @@
perror("HCIWRITESCANENABLE");
exit(1);
}
+
+ sleep(1);
+ evfilter[0] =3D 0x02; /* Connection setup */
+ evfilter[1] =3D 0x00; /* All devices */
+ evfilter[2] =3D 0x01; /* No auto accept */
+ printf("Setting event filter in CSR module!\n");
+ if (ioctl(bt_cfd, HCISET_EVENT_FILTER, &evfilter) < 0)
+ {=20
+ perror("HCISET_EVENT_FILTER");
+ exit(1);
+ }
+
+
#else
printf("Setting write_scan_enable in CSR module!\n");
hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE);
|