summaryrefslogtreecommitdiffstats
path: root/hw/bt/l2cap.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/bt/l2cap.c')
-rw-r--r--hw/bt/l2cap.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c
index e342045140..9cf27f0df6 100644
--- a/hw/bt/l2cap.c
+++ b/hw/bt/l2cap.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "qemu-common.h"
#include "qemu/timer.h"
#include "qemu/bswap.h"
@@ -467,8 +468,8 @@ static void l2cap_channel_close(struct l2cap_instance_s *l2cap,
if (likely(ch)) {
if (ch->remote_cid != source_cid) {
- fprintf(stderr, "%s: Ignoring a Disconnection Request with the "
- "invalid SCID %04x.\n", __FUNCTION__, source_cid);
+ error_report("%s: Ignoring a Disconnection Request with the "
+ "invalid SCID %04x.", __func__, source_cid);
return;
}
@@ -790,8 +791,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
#if 0
/* TODO: do the IDs really have to be in sequence? */
if (!id || (id != l2cap->last_id && id != l2cap->next_id)) {
- fprintf(stderr, "%s: out of sequence command packet ignored.\n",
- __FUNCTION__);
+ error_report("%s: out of sequence command packet ignored.",
+ __func__);
return;
}
#else
@@ -813,9 +814,9 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
}
/* We never issue commands other than Command Reject currently. */
- fprintf(stderr, "%s: stray Command Reject (%02x, %04x) "
- "packet, ignoring.\n", __FUNCTION__, id,
- le16_to_cpu(((l2cap_cmd_rej *) params)->reason));
+ error_report("%s: stray Command Reject (%02x, %04x) "
+ "packet, ignoring.", __func__, id,
+ le16_to_cpu(((l2cap_cmd_rej *) params)->reason));
break;
case L2CAP_CONN_REQ:
@@ -836,8 +837,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
}
/* We never issue Connection Requests currently. TODO */
- fprintf(stderr, "%s: unexpected Connection Response (%02x) "
- "packet, ignoring.\n", __FUNCTION__, id);
+ error_report("%s: unexpected Connection Response (%02x) "
+ "packet, ignoring.", __func__, id);
break;
case L2CAP_CONF_REQ:
@@ -865,8 +866,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
le16_to_cpu(((l2cap_conf_rsp *) params)->scid),
((l2cap_conf_rsp *) params)->data,
len - L2CAP_CONF_RSP_SIZE(0)))
- fprintf(stderr, "%s: unexpected Configure Response (%02x) "
- "packet, ignoring.\n", __FUNCTION__, id);
+ error_report("%s: unexpected Configure Response (%02x) "
+ "packet, ignoring.", __func__, id);
break;
case L2CAP_DISCONN_REQ:
@@ -887,8 +888,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
}
/* We never issue Disconnection Requests currently. TODO */
- fprintf(stderr, "%s: unexpected Disconnection Response (%02x) "
- "packet, ignoring.\n", __FUNCTION__, id);
+ error_report("%s: unexpected Disconnection Response (%02x) "
+ "packet, ignoring.", __func__, id);
break;
case L2CAP_ECHO_REQ:
@@ -897,8 +898,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
case L2CAP_ECHO_RSP:
/* We never issue Echo Requests currently. TODO */
- fprintf(stderr, "%s: unexpected Echo Response (%02x) "
- "packet, ignoring.\n", __FUNCTION__, id);
+ error_report("%s: unexpected Echo Response (%02x) "
+ "packet, ignoring.", __func__, id);
break;
case L2CAP_INFO_REQ:
@@ -917,8 +918,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
}
/* We never issue Information Requests currently. TODO */
- fprintf(stderr, "%s: unexpected Information Response (%02x) "
- "packet, ignoring.\n", __FUNCTION__, id);
+ error_report("%s: unexpected Information Response (%02x) "
+ "packet, ignoring.", __func__, id);
break;
default:
@@ -1066,8 +1067,8 @@ static void l2cap_frame_in(struct l2cap_instance_s *l2cap,
uint16_t len = le16_to_cpu(frame->len);
if (unlikely(cid >= L2CAP_CID_MAX || !l2cap->cid[cid])) {
- fprintf(stderr, "%s: frame addressed to a non-existent L2CAP "
- "channel %04x received.\n", __FUNCTION__, cid);
+ error_report("%s: frame addressed to a non-existent L2CAP "
+ "channel %04x received.", __func__, cid);
return;
}
@@ -1128,9 +1129,9 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len)
struct l2cap_chan_s *chan = (struct l2cap_chan_s *) parm;
if (len > chan->params.remote_mtu) {
- fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n",
- __FUNCTION__,
- chan->remote_cid, chan->params.remote_mtu);
+ error_report("%s: B-Frame for CID %04x longer than %i octets.",
+ __func__,
+ chan->remote_cid, chan->params.remote_mtu);
exit(-1);
}
@@ -1353,8 +1354,8 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu,
struct bt_l2cap_psm_s *new_psm = l2cap_psm(dev, psm);
if (new_psm) {
- fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",
- __FUNCTION__, psm, dev->device.lmp_name);
+ error_report("%s: PSM %04x already registered for device `%s'.",
+ __func__, psm, dev->device.lmp_name);
exit(-1);
}