summary refs log tree commit diff stats
path: root/hw/bt
diff options
context:
space:
mode:
Diffstat (limited to 'hw/bt')
-rw-r--r--hw/bt/core.c10
-rw-r--r--hw/bt/hci-csr.c14
-rw-r--r--hw/bt/hci.c26
-rw-r--r--hw/bt/hid.c2
-rw-r--r--hw/bt/l2cap.c22
-rw-r--r--hw/bt/sdp.c6
6 files changed, 40 insertions, 40 deletions
diff --git a/hw/bt/core.c b/hw/bt/core.c
index 615f0af073..c1806b71a3 100644
--- a/hw/bt/core.c
+++ b/hw/bt/core.c
@@ -32,23 +32,23 @@ static void bt_dummy_lmp_connection_complete(struct bt_link_s *link)
 {
     if (link->slave->reject_reason)
         fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n",
-                        __FUNCTION__);
+                        __func__);
     else
         fprintf(stderr, "%s: stray LMP_accepted received, fixme\n",
-                        __FUNCTION__);
+                        __func__);
     exit(-1);
 }
 
 static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link)
 {
-    fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __FUNCTION__);
+    fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__);
     exit(-1);
 }
 
 static void bt_dummy_lmp_acl_resp(struct bt_link_s *link,
                 const uint8_t *data, int start, int len)
 {
-    fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__);
+    fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __func__);
     exit(-1);
 }
 
@@ -113,7 +113,7 @@ void bt_device_done(struct bt_device_s *dev)
     while (*p && *p != dev)
         p = &(*p)->next;
     if (*p != dev) {
-        fprintf(stderr, "%s: bad bt device \"%s\"\n", __FUNCTION__,
+        fprintf(stderr, "%s: bad bt device \"%s\"\n", __func__,
                         dev->lmp_name ?: "(null)");
         exit(-1);
     }
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index d13192b9b5..ac067b81f6 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -111,14 +111,14 @@ static uint8_t *csrhci_out_packet(struct csrhci_s *s, int len)
 
     if (off < FIFO_LEN) {
         if (off + len > FIFO_LEN && (s->out_size = off + len) > FIFO_LEN * 2) {
-            fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len);
+            fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len);
             exit(-1);
         }
         return s->outfifo + off;
     }
 
     if (s->out_len > s->out_size) {
-        fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len);
+        fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len);
         exit(-1);
     }
 
@@ -169,7 +169,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf,
 
             s->hci->bdaddr_set(s->hci, s->bd_addr.b);
             fprintf(stderr, "%s: bd_address loaded from firmware: "
-                            "%02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
+                            "%02x:%02x:%02x:%02x:%02x:%02x\n", __func__,
                             s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2],
                             s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]);
         }
@@ -181,7 +181,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf,
         break;
 
     default:
-        fprintf(stderr, "%s: got a bad CMD packet\n", __FUNCTION__);
+        fprintf(stderr, "%s: got a bad CMD packet\n", __func__);
         return;
     }
 
@@ -226,7 +226,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt)
     case H4_NEG_PKT:
         if (s->in_hdr != sizeof(csrhci_neg_packet) ||
                         memcmp(pkt - 1, csrhci_neg_packet, s->in_hdr)) {
-            fprintf(stderr, "%s: got a bad NEG packet\n", __FUNCTION__);
+            fprintf(stderr, "%s: got a bad NEG packet\n", __func__);
             return;
         }
         pkt += 2;
@@ -241,7 +241,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt)
 
     case H4_ALIVE_PKT:
         if (s->in_hdr != 4 || pkt[1] != 0x55 || pkt[2] != 0x00) {
-            fprintf(stderr, "%s: got a bad ALIVE packet\n", __FUNCTION__);
+            fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__);
             return;
         }
 
@@ -254,7 +254,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt)
     default:
     bad_pkt:
         /* TODO: error out */
-        fprintf(stderr, "%s: got a bad packet\n", __FUNCTION__);
+        fprintf(stderr, "%s: got a bad packet\n", __func__);
         break;
     }
 
diff --git a/hw/bt/hci.c b/hw/bt/hci.c
index 476ebec0ab..df05f07887 100644
--- a/hw/bt/hci.c
+++ b/hw/bt/hci.c
@@ -458,7 +458,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci,
 
     if (len > 255) {
         fprintf(stderr, "%s: HCI event params too long (%ib)\n",
-                        __FUNCTION__, len);
+                        __func__, len);
         exit(-1);
     }
 
@@ -589,7 +589,7 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci,
         bt_hci_inquiry_result_with_rssi(hci, slave);
         return;
     default:
-        fprintf(stderr, "%s: bad inquiry mode %02x\n", __FUNCTION__,
+        fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__,
                         hci->lm.inquiry_mode);
         exit(-1);
     }
@@ -1528,7 +1528,7 @@ static void bt_submit_hci(struct HCIInfo *info,
                             "the Inquiry command has been issued, a Command "
                             "Status event has been received for the Inquiry "
                             "command, and before the Inquiry Complete event "
-                            "occurs", __FUNCTION__);
+                            "occurs", __func__);
             bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED);
             break;
         }
@@ -1567,7 +1567,7 @@ static void bt_submit_hci(struct HCIInfo *info,
                             "the Inquiry command has been issued, a Command "
                             "Status event has been received for the Inquiry "
                             "command, and before the Inquiry Complete event "
-                            "occurs", __FUNCTION__);
+                            "occurs", __func__);
             bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED);
             break;
         }
@@ -1972,7 +1972,7 @@ static void bt_submit_hci(struct HCIInfo *info,
 
     short_hci:
         fprintf(stderr, "%s: HCI packet too short (%iB)\n",
-                        __FUNCTION__, length);
+                        __func__, length);
         bt_hci_event_status(hci, HCI_INVALID_PARAMETERS);
         break;
     }
@@ -1992,7 +1992,7 @@ static inline void bt_hci_lmp_acl_data(struct bt_hci_s *hci, uint16_t handle,
 
     if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) {
         fprintf(stderr, "%s: can't take ACL packets %i bytes long\n",
-                        __FUNCTION__, len);
+                        __func__, len);
         return;
     }
     memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len);
@@ -2030,7 +2030,7 @@ static void bt_submit_acl(struct HCIInfo *info,
 
     if (length < HCI_ACL_HDR_SIZE) {
         fprintf(stderr, "%s: ACL packet too short (%iB)\n",
-                        __FUNCTION__, length);
+                        __func__, length);
         return;
     }
 
@@ -2042,7 +2042,7 @@ static void bt_submit_acl(struct HCIInfo *info,
 
     if (bt_hci_handle_bad(hci, handle)) {
         fprintf(stderr, "%s: invalid ACL handle %03x\n",
-                        __FUNCTION__, handle);
+                        __func__, handle);
         /* TODO: signal an error */
         return;
     }
@@ -2050,7 +2050,7 @@ static void bt_submit_acl(struct HCIInfo *info,
 
     if (datalen > length) {
         fprintf(stderr, "%s: ACL packet too short (%iB < %iB)\n",
-                        __FUNCTION__, length, datalen);
+                        __func__, length, datalen);
         return;
     }
 
@@ -2061,7 +2061,7 @@ static void bt_submit_acl(struct HCIInfo *info,
             hci->asb_handle = handle;
         else if (handle != hci->asb_handle) {
             fprintf(stderr, "%s: Bad handle %03x in Active Slave Broadcast\n",
-                            __FUNCTION__, handle);
+                            __func__, handle);
             /* TODO: signal an error */
             return;
         }
@@ -2074,7 +2074,7 @@ static void bt_submit_acl(struct HCIInfo *info,
             hci->psb_handle = handle;
         else if (handle != hci->psb_handle) {
             fprintf(stderr, "%s: Bad handle %03x in Parked Slave Broadcast\n",
-                            __FUNCTION__, handle);
+                            __func__, handle);
             /* TODO: signal an error */
             return;
         }
@@ -2106,13 +2106,13 @@ static void bt_submit_sco(struct HCIInfo *info,
 
     if (bt_hci_handle_bad(hci, handle)) {
         fprintf(stderr, "%s: invalid SCO handle %03x\n",
-                        __FUNCTION__, handle);
+                        __func__, handle);
         return;
     }
 
     if (datalen > length) {
         fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n",
-                        __FUNCTION__, length, datalen);
+                        __func__, length, datalen);
         return;
     }
 
diff --git a/hw/bt/hid.c b/hw/bt/hid.c
index f6affbbb44..09d17322e4 100644
--- a/hw/bt/hid.c
+++ b/hw/bt/hid.c
@@ -420,7 +420,7 @@ static void bt_hid_interrupt_sdu(void *opaque, const uint8_t *data, int len)
     return;
 bad:
     fprintf(stderr, "%s: bad transaction on Interrupt channel.\n",
-                    __FUNCTION__);
+                    __func__);
 }
 
 /* "Virtual cable" plug/unplug event.  */
diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c
index e342045140..3e53dd082d 100644
--- a/hw/bt/l2cap.c
+++ b/hw/bt/l2cap.c
@@ -468,7 +468,7 @@ 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);
+                            "invalid SCID %04x.\n", __func__, source_cid);
             return;
         }
 
@@ -791,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
     /* 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__);
+                        __func__);
         return;
     }
 #else
@@ -814,7 +814,7 @@ 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,
+                        "packet, ignoring.\n", __func__, id,
                         le16_to_cpu(((l2cap_cmd_rej *) params)->reason));
         break;
 
@@ -837,7 +837,7 @@ 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);
+                        "packet, ignoring.\n", __func__, id);
         break;
 
     case L2CAP_CONF_REQ:
@@ -866,7 +866,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id,
                         ((l2cap_conf_rsp *) params)->data,
                         len - L2CAP_CONF_RSP_SIZE(0)))
             fprintf(stderr, "%s: unexpected Configure Response (%02x) "
-                            "packet, ignoring.\n", __FUNCTION__, id);
+                            "packet, ignoring.\n", __func__, id);
         break;
 
     case L2CAP_DISCONN_REQ:
@@ -888,7 +888,7 @@ 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);
+                        "packet, ignoring.\n", __func__, id);
         break;
 
     case L2CAP_ECHO_REQ:
@@ -898,7 +898,7 @@ 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);
+                        "packet, ignoring.\n", __func__, id);
         break;
 
     case L2CAP_INFO_REQ:
@@ -918,7 +918,7 @@ 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);
+                        "packet, ignoring.\n", __func__, id);
         break;
 
     default:
@@ -1067,7 +1067,7 @@ static void l2cap_frame_in(struct l2cap_instance_s *l2cap,
 
     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);
+                        "channel %04x received.\n", __func__, cid);
         return;
     }
 
@@ -1129,7 +1129,7 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len)
 
     if (len > chan->params.remote_mtu) {
         fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n",
-                        __FUNCTION__,
+                        __func__,
                         chan->remote_cid, chan->params.remote_mtu);
         exit(-1);
     }
@@ -1354,7 +1354,7 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu,
 
     if (new_psm) {
         fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n",
-                        __FUNCTION__, psm, dev->device.lmp_name);
+                        __func__, psm, dev->device.lmp_name);
         exit(-1);
     }
 
diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c
index 3cb60b9495..7c0d38b504 100644
--- a/hw/bt/sdp.c
+++ b/hw/bt/sdp.c
@@ -506,7 +506,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len)
     int rsp_len = 0;
 
     if (len < 5) {
-        fprintf(stderr, "%s: short SDP PDU (%iB).\n", __FUNCTION__, len);
+        fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len);
         return;
     }
 
@@ -518,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len)
 
     if (len != plen) {
         fprintf(stderr, "%s: wrong SDP PDU length (%iB != %iB).\n",
-                        __FUNCTION__, plen, len);
+                        __func__, plen, len);
         err = SDP_INVALID_PDU_SIZE;
         goto respond;
     }
@@ -545,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len)
     case SDP_SVC_SEARCH_ATTR_RSP:
     default:
         fprintf(stderr, "%s: unexpected SDP PDU ID %02x.\n",
-                        __FUNCTION__, pdu_id);
+                        __func__, pdu_id);
         err = SDP_INVALID_SYNTAX;
         break;
     }