qcacmn: Add diag API to report EVENT_WLAN_BRINGUP_STATUS

Implement API to report DIAG event EVENT_WLAN_BRINGUP_STATUS
to user-space.

Change-Id: Id344fc62b511de71da990aa37a2bca710ff8afda
CRs-Fixed: 2922103
This commit is contained in:
Lin Bai
2021-03-31 11:48:10 +08:00
committed by Madan Koyyalamudi
父節點 8c88323efe
當前提交 c672a940aa
共有 4 個文件被更改,包括 74 次插入5 次删除

查看文件

@@ -237,6 +237,35 @@ enum mgmt_bss_type {
MAX_PERSONA = 0xff,
};
/**
* enum wlan_bringup_status: driver/device status
*
* @WLAN_STATUS_DISABLED: WLAN Disabled
* @WLAN_STATUS_ENABLED: WLAN Enabled
* @WLAN_STATUS_RESET_FAIL: Reset Fail
* @WLAN_STATUS_RESET_SUCCESS: Reset Success
* @WLAN_STATUS_DEVICE_REMOVED: Device Removed
* @WLAN_STATUS_DEVICE_INSERTED: Devide Inserted
* @WLAN_STATUS_DRIVER_UNLOADED: Driver Unloaded
* @WLAN_STATUS_DRIVER_LOADED: Driver Loaded
* @WLAN_STATUS_BUS_EXCEPTION: bus/link exception
* @WLAN_STATUS_DEVICE_TEMPERATURE_HIGH: chip temperature high
*/
enum wlan_bringup_status {
WLAN_STATUS_DISABLED = 0,
WLAN_STATUS_ENABLED = 1,
WLAN_STATUS_RESET_FAIL = 2,
WLAN_STATUS_RESET_SUCCESS = 3,
WLAN_STATUS_DEVICE_REMOVED = 4,
WLAN_STATUS_DEVICE_INSERTED = 5,
WLAN_STATUS_DRIVER_UNLOADED = 6,
WLAN_STATUS_DRIVER_LOADED = 7,
WLAN_STATUS_BUS_EXCEPTION = 8,
WLAN_STATUS_DEVICE_TEMPERATURE_HIGH = 9,
WLAN_STATUS_MAX = 0xffff,
};
/*-------------------------------------------------------------------------
Event ID: EVENT_WLAN_SECURITY
------------------------------------------------------------------------*/
@@ -429,9 +458,18 @@ typedef struct {
/*-------------------------------------------------------------------------
Event ID: EVENT_WLAN_BRINGUP_STATUS
------------------------------------------------------------------------*/
/**
* struct host_event_wlan_bringup_status_payload_type - Structure holding the
* device/driver status info
*
* @wlan_status: status code as defined by enum wlan_bringup_status
* @driver_version: version of WLAN driver
*
* This structure will hold WLAN device basic status and driver version
*/
typedef struct {
uint16_t wlanStatus;
char driverVersion[10];
uint16_t wlan_status;
char driver_version[10];
} host_event_wlan_bringup_status_payload_type;
/*-------------------------------------------------------------------------

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2019,2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -384,6 +384,8 @@ typedef enum {
* 5 - Devide Inserted
* 6 - Driver Unloaded
* 7 - Driver Loaded
* 8 - bus/link down
* 9 - chip temperature high
*
* driverVersion: offset: 2 length: 10
*

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -389,4 +389,19 @@ void host_log_acs_best_chan(uint16_t chan, uint16_t weight)
EVENT_WLAN_ACS_BEST_CHANNEL);
}
void host_log_device_status(uint16_t status_code)
{
WLAN_HOST_DIAG_EVENT_DEF(driver_status,
host_event_wlan_bringup_status_payload_type);
driver_status.wlan_status = status_code;
/* driver version not used yet, fill properly if need later */
qdf_mem_zero(driver_status.driver_version,
sizeof(driver_status.driver_version));
WLAN_HOST_DIAG_EVENT_REPORT(&driver_status,
EVENT_WLAN_BRINGUP_STATUS);
}
#endif

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2019, 2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -233,6 +233,16 @@ void host_log_acs_chan_spect_weight(uint16_t chan, uint16_t weight,
*/
void host_log_acs_best_chan(uint16_t chan, uint16_t weight);
/**
* host_log_device_status() - device status indication
* @status_code: status code from enum wlan_bringup_status
*
* Indicates device status
*
* Return: None
*/
void host_log_device_status(uint16_t status_code);
#else
static inline void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause)
{
@@ -264,6 +274,10 @@ static inline void host_log_acs_chan_spect_weight(uint16_t chan,
static inline void host_log_acs_best_chan(uint16_t chan, uint32_t weight)
{
}
static inline void host_log_device_status(uint16_t status_code)
{
}
#endif /* FEATURE_WLAN_DIAG_SUPPORT */
#ifdef __cplusplus
}