|
@@ -31,13 +31,13 @@
|
|
|
|
|
|
/**
|
|
|
* struct connectivity_log_attr - Connectivity logging attribute info
|
|
|
- * @attribute_id: Vendor attribute ID
|
|
|
+ * @attribute_id: Vendor attribute ID. Defined by enum qca_wlan_vendor_attr_diag
|
|
|
* @attribute_type: NL type of the attribute
|
|
|
* @attribute_length: Length of the attribute
|
|
|
* @field_offset: Field offset
|
|
|
*/
|
|
|
struct connectivity_log_attr {
|
|
|
- uint8_t attribute_id;
|
|
|
+ enum qca_wlan_vendor_attr_diag attribute_id;
|
|
|
uint8_t attribute_type;
|
|
|
uint16_t attribute_length;
|
|
|
uint16_t field_offset;
|
|
@@ -136,7 +136,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FREQ, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(conn_info.freq)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(conn_info.conn_status)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -232,7 +232,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DEAUTH_RX] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
@@ -240,9 +240,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.rssi)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.seq_num)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.frame_status_code)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -258,9 +258,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.rssi)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.seq_num)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.frame_status_code)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -270,15 +270,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.rssi)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.seq_num)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.frame_status_code)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -288,15 +288,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.rssi)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.seq_num)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.frame_status_code)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -304,15 +304,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_BEACON_LOSS_DISCONN] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
GET_ATTR_OFFSET(bssid)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.rssi)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.frame_status_code)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -328,14 +328,14 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.trigger_reason)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_TRIGGER_SUB_REASON, NLA_U8,
|
|
|
sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.trigger_sub_reason)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_RSSI, NLA_S32, sizeof(int32_t),
|
|
|
GET_ATTR_OFFSET(roam_trig.current_rssi)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_CU, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(roam_trig.cu_load)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_SCAN_TYPE, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(roam_trig.is_full_scan)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_RSSI_THRESHOLD, NLA_U32,
|
|
|
- sizeof(uint8_t), GET_ATTR_OFFSET(roam_trig.rssi_threshold)},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_RSSI_THRESHOLD, NLA_S32,
|
|
|
+ sizeof(int32_t), GET_ATTR_OFFSET(roam_trig.rssi_threshold)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
@@ -430,7 +430,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(roam_result.roam_fail_reason)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -442,7 +442,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.token)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_QUERY_REASON, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.reason)},
|
|
@@ -458,14 +458,14 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.token)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_MODE, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.mode)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DISASSOC_TIMER, NLA_U32,
|
|
|
- sizeof(uint32_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_VALIDITY_INTERVAL, NLA_U32,
|
|
|
- sizeof(uint32_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DISASSOC_TIMER, NLA_U16,
|
|
|
+ sizeof(uint16_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_VALIDITY_INTERVAL, NLA_U8,
|
|
|
+ sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.disassoc_timer)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_CANDIDATE_LIST_COUNT, NLA_U8,
|
|
|
sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.candidate_list_count)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
@@ -480,7 +480,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_REASON_CODE, NLA_U16, sizeof(uint16_t),
|
|
|
GET_ATTR_OFFSET(btm_info.reason)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BTM_WTC_SUB_REASON_CODE, NLA_U8,
|
|
|
sizeof(uint8_t), GET_ATTR_OFFSET(btm_info.sub_reason)},
|
|
@@ -494,13 +494,15 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_BTM_REQ_CANDI] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_AP_RANK, NLA_U8, sizeof(uint8_t),
|
|
|
+ GET_ATTR_OFFSET(btm_cand.idx)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
GET_ATTR_OFFSET(btm_cand.bssid)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_PREFERENCE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_PREFERENCE, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_cand.preference)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
@@ -514,25 +516,25 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U16, sizeof(uint16_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TOKEN, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.token)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_STATUS_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_STATUS_CODE, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.btm_status_code)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DELAY, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_DELAY, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(btm_info.btm_delay)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_BSSID, NLA_BINARY, QDF_MAC_ADDR_SIZE,
|
|
|
- GET_ATTR_OFFSET(btm_info.target_bssid)},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID, NLA_BINARY,
|
|
|
+ QDF_MAC_ADDR_SIZE, GET_ATTR_OFFSET(btm_info.target_bssid)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
|
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_DISCOVER] = {
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.tx_status)},
|
|
@@ -540,11 +542,11 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
},
|
|
|
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_OFFER] = {
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
|
|
|
},
|
|
@@ -552,7 +554,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DHCP_REQUEST] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
@@ -598,9 +600,9 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(pkt_info.tx_status)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
@@ -612,7 +614,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
|
|
|
sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
|
|
@@ -648,7 +650,7 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
|
|
|
[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_GTK_M2] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE, NLA_U32, sizeof(uint32_t),
|
|
|
GET_ATTR_OFFSET(log_subtype)},
|
|
|
- {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP, NLA_U64, sizeof(uint64_t),
|
|
|
GET_ATTR_OFFSET(timestamp_us)},
|
|
|
{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX, NLA_U8, sizeof(uint8_t),
|
|
|
GET_ATTR_OFFSET(vdev_id)},
|
|
@@ -819,7 +821,8 @@ wlan_hdd_get_converted_tx_status(uint8_t tx_status)
|
|
|
static uint16_t
|
|
|
wlan_hdd_get_connectivity_log_tlv_len(struct wlan_log_record *rec)
|
|
|
{
|
|
|
- uint16_t j, attr_id, log_evt_type, len = 0;
|
|
|
+ uint16_t j, log_evt_type, len = 0;
|
|
|
+ enum qca_wlan_vendor_attr_diag attr_id;
|
|
|
|
|
|
log_evt_type = hdd_connectivity_log_attr_table[rec->log_subtype];
|
|
|
if (log_evt_type >= (QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1))
|
|
@@ -850,11 +853,13 @@ wlan_hdd_get_connectivity_log_tlv_len(struct wlan_log_record *rec)
|
|
|
if (log_evt_type ==
|
|
|
QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_ROAM_SCAN_DONE &&
|
|
|
attr_id == QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_FREQ_LIST) {
|
|
|
- len += NLMSG_HDRLEN +
|
|
|
- (rec->roam_scan.num_scanned_freq *
|
|
|
- sizeof(rec->roam_scan.scan_freq[0]));
|
|
|
+ len += nla_total_size(
|
|
|
+ NLMSG_HDRLEN +
|
|
|
+ (rec->roam_scan.num_scanned_freq *
|
|
|
+ sizeof(rec->roam_scan.scan_freq[0])));
|
|
|
} else {
|
|
|
- len += connectivity_attr_table[log_evt_type][j].attribute_length;
|
|
|
+ len += nla_total_size(connectivity_attr_table[
|
|
|
+ log_evt_type][j].attribute_length);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -881,7 +886,7 @@ wlan_hdd_put_connectivity_logging_data(struct sk_buff *skb,
|
|
|
{
|
|
|
int errno = 0;
|
|
|
struct qdf_mac_addr bssid = {0};
|
|
|
- enum qca_vendor_attr_diag_event_type attribute_id =
|
|
|
+ enum qca_wlan_vendor_attr_diag attribute_id =
|
|
|
attribute->attribute_id;
|
|
|
uint16_t field_offset = attribute->field_offset;
|
|
|
|
|
@@ -897,23 +902,35 @@ wlan_hdd_put_connectivity_logging_data(struct sk_buff *skb,
|
|
|
qdf_is_macaddr_broadcast(&bssid))
|
|
|
break;
|
|
|
|
|
|
- nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
|
|
|
- bssid.bytes);
|
|
|
+ errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
|
|
|
+ bssid.bytes);
|
|
|
break;
|
|
|
case QCA_WLAN_VENDOR_ATTR_DIAG_BSSID_HINT:
|
|
|
if (qdf_is_macaddr_zero(&rec->conn_info.bssid_hint) ||
|
|
|
qdf_is_macaddr_broadcast(&rec->conn_info.bssid_hint))
|
|
|
break;
|
|
|
|
|
|
- nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
|
|
|
- rec->conn_info.bssid_hint.bytes);
|
|
|
+ errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
|
|
|
+ rec->conn_info.bssid_hint.bytes);
|
|
|
+ break;
|
|
|
+ case QCA_WLAN_VENDOR_ATTR_DIAG_BTM_TARGET_BSSID:
|
|
|
+ bssid = ATTR_GET_VALUE(struct qdf_mac_addr, rec, field_offset);
|
|
|
+ if (qdf_is_macaddr_zero(&bssid) ||
|
|
|
+ qdf_is_macaddr_broadcast(&bssid))
|
|
|
+ break;
|
|
|
+
|
|
|
+ errno = nla_put(skb, attribute_id, QDF_MAC_ADDR_SIZE,
|
|
|
+ bssid.bytes);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if (errno)
|
|
|
+ if (errno) {
|
|
|
+ hdd_err_rl("Failed to put attribute_id:%d",
|
|
|
+ attribute->attribute_id);
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
@@ -959,7 +976,7 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
|
|
|
struct wlan_log_record *rec)
|
|
|
{
|
|
|
uint8_t i, val8, attr_val8;
|
|
|
- uint16_t attr_id;
|
|
|
+ enum qca_wlan_vendor_attr_diag attr_id;
|
|
|
enum qca_vendor_attr_diag_event_type evt_type;
|
|
|
struct connectivity_log_attr attr;
|
|
|
QDF_STATUS status;
|
|
@@ -1028,40 +1045,30 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
|
|
|
attr_val8 = wlan_hdd_convert_roam_scan_type(val8);
|
|
|
|
|
|
errno = nla_put_u8(skb, attr.attribute_id, attr_val8);
|
|
|
- if (errno)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
break;
|
|
|
case NLA_U16:
|
|
|
errno = nla_put_u16(skb, attr.attribute_id,
|
|
|
ATTR_GET_VALUE(uint16_t, rec,
|
|
|
attr.field_offset));
|
|
|
- if (errno)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
break;
|
|
|
case NLA_U32:
|
|
|
errno = nla_put_u32(skb, attr.attribute_id,
|
|
|
ATTR_GET_VALUE(uint32_t, rec,
|
|
|
attr.field_offset));
|
|
|
- if (errno)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
break;
|
|
|
case NLA_S32:
|
|
|
errno = nla_put_s32(skb, attr.attribute_id,
|
|
|
ATTR_GET_VALUE(int32_t, rec,
|
|
|
attr.field_offset));
|
|
|
- if (errno)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
break;
|
|
|
case NLA_U64:
|
|
|
errno = wlan_cfg80211_nla_put_u64(
|
|
|
skb, attr.attribute_id,
|
|
|
ATTR_GET_VALUE(uint64_t, rec, attr.field_offset));
|
|
|
- if (errno)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
break;
|
|
|
case NLA_FLAG:
|
|
|
if (ATTR_GET_VALUE(bool, rec, attr.field_offset))
|
|
|
- nla_put_flag(skb, attr.attribute_id);
|
|
|
+ errno = nla_put_flag(skb, attr.attribute_id);
|
|
|
break;
|
|
|
case NLA_BINARY:
|
|
|
status = wlan_hdd_put_connectivity_logging_data(
|
|
@@ -1074,6 +1081,12 @@ wlan_hdd_fill_connectivity_logging_data(struct sk_buff *skb,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (errno) {
|
|
|
+ hdd_err_rl("NLA put failed for attr:%d",
|
|
|
+ attr.attribute_id);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
@@ -1125,8 +1138,11 @@ wlan_hdd_send_connectivity_log_to_user(struct wlan_log_record *rec,
|
|
|
|
|
|
status = wlan_hdd_fill_connectivity_logging_data(vendor_event,
|
|
|
&rec[i]);
|
|
|
- if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ hdd_err_rl("Failed to fill fat idx:%d subtype:%d",
|
|
|
+ i, rec[i].log_subtype);
|
|
|
goto failure;
|
|
|
+ }
|
|
|
|
|
|
nla_nest_end(vendor_event, attr1);
|
|
|
}
|
|
@@ -1138,7 +1154,7 @@ wlan_hdd_send_connectivity_log_to_user(struct wlan_log_record *rec,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
failure:
|
|
|
- hdd_err("NLA fill failed");
|
|
|
+ hdd_err("NLA fill failed num_records:%d", num_records);
|
|
|
kfree_skb(vendor_event);
|
|
|
|
|
|
return QDF_STATUS_E_FAILURE;
|