qcacmn: Modify vendor command handler to accept vdev
The Spectral module uses the first vdev of a pdev for scanning. For MCL platforms all the vdevs are associated with a single pdev and this may cause a mismatch between the vdev intended by user and the vdev used by driver. To avoid this MCL platforms pass a reference to vdev on which Spectral scan is triggered. WIN platforms can continue to use the old approach of using the first vdev of a pdev by passing NULL for vdev to vendor command handlers. CRS-Fixed: 2725777 Change-Id: I1a7278bdcbcc2b706aa292b33c17546190dac082
This commit is contained in:

committed by
snandini

parent
b43c68dedf
commit
6c76bce586
@@ -52,9 +52,9 @@ extern const struct nla_policy
|
|||||||
*
|
*
|
||||||
* Return: 0 on success, negative value on failure
|
* Return: 0 on success, negative value on failure
|
||||||
*/
|
*/
|
||||||
void wlan_cfg80211_register_spectral_cmd_handler(struct wlan_objmgr_pdev *pdev,
|
void wlan_cfg80211_register_spectral_cmd_handler(
|
||||||
int idx,
|
struct wlan_objmgr_pdev *pdev,
|
||||||
void *handler);
|
struct spectral_cfg80211_vendor_cmd_handlers *handlers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_cfg80211_spectral_scan_config_and_start() - Start spectral scan
|
* wlan_cfg80211_spectral_scan_config_and_start() - Start spectral scan
|
||||||
|
@@ -83,30 +83,22 @@ spectral_get_vdev(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
|||||||
static void
|
static void
|
||||||
spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
|
spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
|
||||||
{
|
{
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
struct spectral_cfg80211_vendor_cmd_handlers handlers = {0};
|
||||||
pdev,
|
|
||||||
SPECTRAL_SCAN_START_HANDLER_IDX,
|
handlers.wlan_cfg80211_spectral_scan_start =
|
||||||
wlan_cfg80211_spectral_scan_config_and_start);
|
wlan_cfg80211_spectral_scan_config_and_start;
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
handlers.wlan_cfg80211_spectral_scan_stop =
|
||||||
pdev,
|
wlan_cfg80211_spectral_scan_stop;
|
||||||
SPECTRAL_SCAN_STOP_HANDLER_IDX,
|
handlers.wlan_cfg80211_spectral_scan_get_config =
|
||||||
wlan_cfg80211_spectral_scan_stop);
|
wlan_cfg80211_spectral_scan_get_config;
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
handlers.wlan_cfg80211_spectral_scan_get_diag_stats =
|
||||||
pdev,
|
wlan_cfg80211_spectral_scan_get_diag_stats;
|
||||||
SPECTRAL_SCAN_GET_CONFIG_HANDLER_IDX,
|
handlers.wlan_cfg80211_spectral_scan_get_cap =
|
||||||
wlan_cfg80211_spectral_scan_get_config);
|
wlan_cfg80211_spectral_scan_get_cap;
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
handlers.wlan_cfg80211_spectral_scan_get_status =
|
||||||
pdev,
|
wlan_cfg80211_spectral_scan_get_status;
|
||||||
SPECTRAL_SCAN_GET_DIAG_STATS_HANDLER_IDX,
|
|
||||||
wlan_cfg80211_spectral_scan_get_diag_stats);
|
wlan_cfg80211_register_spectral_cmd_handler(pdev, &handlers);
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
|
||||||
pdev,
|
|
||||||
SPECTRAL_SCAN_GET_CAP_HANDLER_IDX,
|
|
||||||
wlan_cfg80211_spectral_scan_get_cap);
|
|
||||||
wlan_cfg80211_register_spectral_cmd_handler(
|
|
||||||
pdev,
|
|
||||||
SPECTRAL_SCAN_GET_STATUS_HANDLER_IDX,
|
|
||||||
wlan_cfg80211_spectral_scan_get_status);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void
|
static void
|
||||||
|
@@ -161,31 +161,6 @@ enum spectral_msg_type {
|
|||||||
SPECTRAL_MSG_TYPE_MAX,
|
SPECTRAL_MSG_TYPE_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* enum wlan_cfg80211_spectral_vendorcmd_handler_idx - Indices to cfg80211
|
|
||||||
* spectral vendor command handlers
|
|
||||||
* @SPECTRAL_SCAN_START_HANDLER_IDX: Index to SPECTRAL_SCAN_START handler
|
|
||||||
* @SPECTRAL_SCAN_STOP_HANDLER_IDX: Index to SPECTRAL_SCAN_STOP handler
|
|
||||||
* @SPECTRAL_SCAN_GET_CONFIG_HANDLER_IDX: Index to SPECTRAL_SCAN_GET_CONFIG
|
|
||||||
* handler
|
|
||||||
* @SPECTRAL_SCAN_GET_DIAG_STATS_HANDLER_IDX: Index to
|
|
||||||
* SPECTRAL_SCAN_GET_DIAG_STATS handler
|
|
||||||
* @SPECTRAL_SCAN_GET_CAP_HANDLER_IDX: Index to SPECTRAL_SCAN_GET_CAP handler
|
|
||||||
* @SPECTRAL_SCAN_GET_STATUS_HANDLER_IDX: Index to SPECTRAL_SCAN_GET_STATUS
|
|
||||||
* handler
|
|
||||||
* @SPECTRAL_SCAN_VENDOR_CMD_HANDLER_MAX: Number of cfg80211 spectral
|
|
||||||
* vendor command handlers supported
|
|
||||||
*/
|
|
||||||
enum wlan_cfg80211_spectral_vendorcmd_handler_idx {
|
|
||||||
SPECTRAL_SCAN_START_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_STOP_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_GET_CONFIG_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_GET_DIAG_STATS_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_GET_CAP_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_GET_STATUS_HANDLER_IDX,
|
|
||||||
SPECTRAL_SCAN_VENDOR_CMD_HANDLER_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum spectral_debug - Spectral debug level
|
* enum spectral_debug - Spectral debug level
|
||||||
* @DEBUG_SPECTRAL: Minimal SPECTRAL debug
|
* @DEBUG_SPECTRAL: Minimal SPECTRAL debug
|
||||||
@@ -242,6 +217,55 @@ enum spectral_dma_debug {
|
|||||||
SPECTRAL_DMA_BUFFER_DEBUG,
|
SPECTRAL_DMA_BUFFER_DEBUG,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct wiphy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct spectral_cfg80211_vendor_cmd_handlers - Spectral vendor command
|
||||||
|
* handlers
|
||||||
|
* @wlan_cfg80211_spectral_scan_start: start scan handler
|
||||||
|
* @wlan_cfg80211_spectral_scan_stop: stop scan handler
|
||||||
|
* @wlan_cfg80211_spectral_scan_get_config: get config handler
|
||||||
|
* @wlan_cfg80211_spectral_scan_get_diag_stats: get diag stats handler
|
||||||
|
* @wlan_cfg80211_spectral_scan_get_cap: get capability handler
|
||||||
|
* @wlan_cfg80211_spectral_scan_get_status: get status handler
|
||||||
|
*/
|
||||||
|
struct spectral_cfg80211_vendor_cmd_handlers {
|
||||||
|
int (*wlan_cfg80211_spectral_scan_start)(struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
int (*wlan_cfg80211_spectral_scan_stop)(struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
int (*wlan_cfg80211_spectral_scan_get_config)(
|
||||||
|
struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
int (*wlan_cfg80211_spectral_scan_get_diag_stats)(
|
||||||
|
struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
int (*wlan_cfg80211_spectral_scan_get_cap)(
|
||||||
|
struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
int (*wlan_cfg80211_spectral_scan_get_status)(
|
||||||
|
struct wiphy *wiphy,
|
||||||
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct wlan_objmgr_vdev *vdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct spectral_cp_param - Spectral control path data structure which
|
* struct spectral_cp_param - Spectral control path data structure which
|
||||||
* contains parameter and its value
|
* contains parameter and its value
|
||||||
|
Reference in New Issue
Block a user