}
}
+static void conn_pkt_tx(struct hci_conn *conn, struct timeval *tv,
+ uint16_t size)
+{
+ struct timeval *last_tx;
+
+ conn->tx_num++;
+
+ last_tx = new0(struct timeval, 1);
+ memcpy(last_tx, tv, sizeof(*tv));
+ queue_push_tail(conn->tx_queue, last_tx);
+ conn->tx_bytes += size;
+
+ if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
+ conn->tx_pkt_min = size;
+ if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
+ conn->tx_pkt_max = size;
+}
+
static void acl_pkt(struct timeval *tv, uint16_t index, bool out,
const void *data, uint16_t size)
{
}
if (out) {
- struct timeval *last_tx;
-
- conn->tx_num++;
- last_tx = new0(struct timeval, 1);
- memcpy(last_tx, tv, sizeof(*tv));
- queue_push_tail(conn->tx_queue, last_tx);
- conn->tx_bytes += size;
-
- if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
- conn->tx_pkt_min = size;
- if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
- conn->tx_pkt_max = size;
+ conn_pkt_tx(conn, tv, size);
} else {
conn->rx_num++;
}
}
-static void conn_pkt_tx(struct hci_conn *conn, struct timeval *tv,
- uint16_t size)
-{
- struct timeval *last_tx;
-
- last_tx = new0(struct timeval, 1);
- memcpy(last_tx, tv, sizeof(*tv));
- queue_push_tail(conn->tx_queue, last_tx);
- conn->tx_bytes += size;
-
- if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
- conn->tx_pkt_min = size;
- if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
- conn->tx_pkt_max = size;
-}
-
static void sco_pkt(struct timeval *tv, uint16_t index, bool out,
const void *data, uint16_t size)
{
return;
if (out) {
- conn->tx_num++;
conn_pkt_tx(conn, tv, size - sizeof(*hdr));
} else {
conn->rx_num++;
return;
if (out) {
- conn->tx_num++;
conn_pkt_tx(conn, tv, size - sizeof(*hdr));
} else {
conn->rx_num++;