dect
/
libnl
Archived
13
0
Fork 0

dect: add X-crc statistic

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2009-11-26 03:21:28 +01:00
parent 464d806d27
commit c335c58b68
4 changed files with 9 additions and 2 deletions

View File

@ -60,6 +60,7 @@ enum dect_slot_attrs {
DECTA_SLOT_RX_PACKETS,
DECTA_SLOT_RX_BYTES,
DECTA_SLOT_RX_A_CRC_ERRORS,
DECTA_SLOT_RX_X_CRC_ERRORS,
DECTA_SLOT_TX_PACKETS,
DECTA_SLOT_TX_BYTES,
__DECTA_SLOT_MAX

View File

@ -835,6 +835,7 @@ struct nl_dect_transceiver_slot {
uint32_t dts_rx_bytes;
uint32_t dts_rx_packets;
uint32_t dts_rx_a_crc_errors;
uint32_t dts_rx_x_crc_errors;
uint32_t dts_tx_bytes;
uint32_t dts_tx_packets;
};

View File

@ -51,6 +51,7 @@ static struct nla_policy slot_policy[DECTA_SLOT_MAX + 1] = {
[DECTA_SLOT_RX_BYTES] = { .type = NLA_U32 },
[DECTA_SLOT_RX_PACKETS] = { .type = NLA_U32 },
[DECTA_SLOT_RX_A_CRC_ERRORS] = { .type = NLA_U32 },
[DECTA_SLOT_RX_X_CRC_ERRORS] = { .type = NLA_U32 },
[DECTA_SLOT_TX_BYTES] = { .type = NLA_U32 },
[DECTA_SLOT_TX_PACKETS] = { .type = NLA_U32 },
};
@ -88,6 +89,8 @@ static int slot_parser(struct nl_dect_transceiver *trx, struct nlattr *nla)
dts->dts_rx_packets = nla_get_u32(tb[DECTA_SLOT_RX_PACKETS]);
if (tb[DECTA_SLOT_RX_A_CRC_ERRORS] != NULL)
dts->dts_rx_a_crc_errors = nla_get_u32(tb[DECTA_SLOT_RX_A_CRC_ERRORS]);
if (tb[DECTA_SLOT_RX_X_CRC_ERRORS] != NULL)
dts->dts_rx_x_crc_errors = nla_get_u32(tb[DECTA_SLOT_RX_X_CRC_ERRORS]);
if (tb[DECTA_SLOT_TX_BYTES] != NULL)
dts->dts_tx_bytes = nla_get_u32(tb[DECTA_SLOT_TX_BYTES]);
if (tb[DECTA_SLOT_TX_PACKETS] != NULL)

View File

@ -60,8 +60,10 @@ static void slot_dump(struct nl_dect_transceiver_slot *dts, unsigned int n,
nl_dect_rssi_to_dbm(dts->dts_rssi));
nl_dump(p, "\n");
nl_dump(p, "\t RX: bytes %u packets %u crc-errors %u\n",
dts->dts_rx_bytes, dts->dts_rx_packets, dts->dts_rx_a_crc_errors);
nl_dump(p, "\t RX: bytes %u packets %u a-crc-errors %u x-crc-errors %u\n",
dts->dts_rx_bytes, dts->dts_rx_packets,
dts->dts_rx_a_crc_errors,
dts->dts_rx_x_crc_errors);
nl_dump(p, "\t TX: bytes %u packets %u\n",
dts->dts_tx_bytes, dts->dts_tx_packets);
}