123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- /*
- * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
- #ifndef _WLAN_SPECTRAL_UTILS_API_H_
- #define _WLAN_SPECTRAL_UTILS_API_H_
- #ifdef WLAN_CONV_SPECTRAL_ENABLE
- #include <wlan_objmgr_cmn.h>
- #include <wlan_lmac_if_def.h>
- /* Forward declaration */
- struct direct_buf_rx_data;
- struct spectral_wmi_ops;
- struct spectral_tgt_ops;
- /**
- * wlan_spectral_is_feature_disabled_pdev() - Check if spectral feature
- * is disabled for a given pdev
- * @pdev: pointer to pdev
- *
- * Return : true if spectral is disabled, else false.
- */
- bool wlan_spectral_is_feature_disabled_pdev(struct wlan_objmgr_pdev *pdev);
- /**
- * wlan_spectral_is_feature_disabled_ini() - Check if spectral feature
- * is disabled in INI
- * @psoc: pointer to psoc
- *
- * Return : true if spectral is disabled, else false.
- */
- bool wlan_spectral_is_feature_disabled_ini(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_is_feature_disabled_psoc() - Check if spectral feature
- * is disabled for a given psoc
- * @psoc: pointer to psoc
- *
- * Return : true if spectral is disabled, else false.
- */
- bool wlan_spectral_is_feature_disabled_psoc(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_is_mode_disabled_pdev() - Check if a given spectral mode
- * is disabled for a given pdev
- * @pdev: pointer to pdev
- * @smode: spectral scan mode
- *
- * Return : true if spectral mode is disabled, else false.
- */
- bool wlan_spectral_is_mode_disabled_pdev(struct wlan_objmgr_pdev *pdev,
- enum spectral_scan_mode smode);
- /**
- * wlan_spectral_init() - API to init spectral component
- *
- * This API is invoked from dispatcher init during all component init.
- * This API will register all required handlers for pdev and peer object
- * create/delete notification.
- *
- * Return: SUCCESS,
- * Failure
- */
- QDF_STATUS wlan_spectral_init(void);
- /**
- * wlan_spectral_deinit() - API to deinit spectral component
- *
- * This API is invoked from dispatcher deinit during all component deinit.
- * This API will unregister all registered handlers for pdev and peer object
- * create/delete notification.
- *
- * Return: SUCCESS,
- * Failure
- */
- QDF_STATUS wlan_spectral_deinit(void);
- /**
- * wlan_lmac_if_sptrl_register_rx_ops() - Register lmac interface Rx operations
- * @rx_ops: Pointer to lmac interface Rx operations structure
- *
- * API to register spectral related lmac interface Rx operations
- *
- * Return: None
- */
- void
- wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
- /**
- * wlan_register_spectral_wmi_ops() - Register Spectral WMI operations
- * @psoc: Pointer to psoc object
- * @wmi_ops: pointer to the structure holding the Spectral WMI
- * operations
- *
- * API to register Spectral WMI operations
- *
- * Return: QDF_STATUS
- */
- QDF_STATUS
- wlan_register_spectral_wmi_ops(struct wlan_objmgr_psoc *psoc,
- struct spectral_wmi_ops *wmi_ops);
- /**
- * wlan_register_spectral_tgt_ops() - Register Spectral target operations
- * @psoc: Pointer to psoc object
- * @tgt_ops: pointer to the structure holding the Spectral target
- * operations
- *
- * API to register Spectral target operations
- *
- * Return: QDF_STATUS
- */
- QDF_STATUS
- wlan_register_spectral_tgt_ops(struct wlan_objmgr_psoc *psoc,
- struct spectral_tgt_ops *tgt_ops);
- /**
- * struct spectral_legacy_cbacks - Spectral legacy callbacks
- * @vdev_get_chan_freq: Get channel frequency
- * @vdev_get_chan_freq_seg2: Get secondary 80 center frequency
- * @vdev_get_ch_width: Get channel width
- * @vdev_get_sec20chan_freq_mhz: Get secondary 20 frequency
- */
- struct spectral_legacy_cbacks {
- int16_t (*vdev_get_chan_freq)(struct wlan_objmgr_vdev *vdev);
- int16_t (*vdev_get_chan_freq_seg2)(struct wlan_objmgr_vdev *vdev);
- enum phy_ch_width (*vdev_get_ch_width)(struct wlan_objmgr_vdev *vdev);
- int (*vdev_get_sec20chan_freq_mhz)(struct wlan_objmgr_vdev *vdev,
- uint16_t *sec20chan_freq);
- };
- /**
- * spectral_vdev_get_chan_freq() - Get vdev channel frequency
- * @vdev: vdev object
- *
- * Return: vdev operating frequency
- */
- int16_t spectral_vdev_get_chan_freq(struct wlan_objmgr_vdev *vdev);
- /**
- * spectral_vdev_get_chan_freq_seg2() - Get vdev's secondary 80 center frequency
- * @vdev: vdev object
- *
- * Return: vdev secondary 80 center frequency
- */
- int16_t spectral_vdev_get_chan_freq_seg2(struct wlan_objmgr_vdev *vdev);
- /**
- * spectral_vdev_get_sec20chan_freq_mhz() - Get vdev secondary channel frequency
- * @vdev: vdev object
- * @sec20chan_freq: secondary channel frequency
- *
- * Return: secondary channel freq
- */
- int spectral_vdev_get_sec20chan_freq_mhz(struct wlan_objmgr_vdev *vdev,
- uint16_t *sec20chan_freq);
- /**
- * spectral_register_legacy_cb() - Register spectral legacy callbacks
- * commands on spectral parameters
- * @psoc: the physical device object
- * @legacy_cbacks: Reference to struct spectral_legacy_cbacks from which
- * function pointers need to be copied
- *
- * API to register spectral related legacy callbacks
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS spectral_register_legacy_cb(
- struct wlan_objmgr_psoc *psoc,
- struct spectral_legacy_cbacks *legacy_cbacks);
- /**
- * spectral_vdev_get_ch_width() - Get the channel bandwidth
- * @vdev: Pointer to vdev
- *
- * API to get the channel bandwidth of a given vdev
- *
- * Return: Enumeration corresponding to the channel bandwidth
- */
- enum phy_ch_width
- spectral_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev);
- /**
- * spectral_pdev_open() - Spectral pdev open handler
- * @pdev: pointer to pdev object
- *
- * API to execute operations on pdev open
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS spectral_pdev_open(struct wlan_objmgr_pdev *pdev);
- /**
- * wlan_spectral_psoc_open() - Spectral psoc open handler
- * @psoc: pointer to psoc object
- *
- * API to execute operations on psoc open
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_psoc_open(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_psoc_close() - Spectral psoc close handler
- * @psoc: pointer to psoc object
- *
- * API to execute operations on psoc close
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_psoc_close(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_psoc_enable() - Spectral psoc enable handler
- * @psoc: pointer to psoc object
- *
- * API to execute operations on psoc enable
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_psoc_enable(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_psoc_disable() - Spectral psoc disable handler
- * @psoc: pointer to psoc object
- *
- * API to execute operations on psoc disable
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_psoc_disable(struct wlan_objmgr_psoc *psoc);
- /**
- * spectral_register_dbr() - register Spectral event handler with DDMA
- * @pdev: pointer to pdev object
- *
- * API to register event handler with Direct DMA
- *
- * Return: QDF_STATUS_SUCCESS upon successful registration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS spectral_register_dbr(struct wlan_objmgr_pdev *pdev);
- /**
- * spectral_unregister_dbr() - unregister Spectral event handler with DDMA
- * @pdev: pointer to pdev object
- *
- * API to unregister event handler with Direct DMA
- *
- * Return: QDF_STATUS_SUCCESS upon successful unregistration,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS spectral_unregister_dbr(struct wlan_objmgr_pdev *pdev);
- /**
- * wlan_spectral_init_pdev_feature_caps() - API to initialize
- * spectral pdev feature caps
- * @pdev: pointer to pdev object
- *
- * API to initialize Spectral feature caps for a given pdev.
- *
- * Return: QDF_STATUS_SUCCESS upon successful initialization,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_init_pdev_feature_caps(struct wlan_objmgr_pdev *pdev);
- /**
- * wlan_spectral_init_psoc_feature_cap() - API to initialize
- * spectral psoc feature caps
- * @psoc: pointer to psoc object
- *
- * API to initialize Spectral feature caps for a given psoc.
- *
- * Return: QDF_STATUS_SUCCESS upon successful initialization,
- * QDF_STATUS_E_FAILURE upon failure
- */
- QDF_STATUS wlan_spectral_init_psoc_feature_cap(struct wlan_objmgr_psoc *psoc);
- /**
- * wlan_spectral_pdev_get_lmac_if_txops() - API to get pointer
- * to Spectral txops structure
- * @pdev: pointer to pdev object
- *
- * API to get pointer to Spectral txops structure
- *
- * Return: Pointer to Spectral txops structure, NULL in case of
- * error.
- */
- struct wlan_lmac_if_sptrl_tx_ops *
- wlan_spectral_pdev_get_lmac_if_txops(struct wlan_objmgr_pdev *pdev);
- #ifdef DIRECT_BUF_RX_ENABLE
- /**
- * spectral_dbr_event_handler() - Spectral dbr event handler
- * @pdev: pointer to pdev object
- * @payload: dbr event buffer
- *
- * API to handle spectral dbr event
- *
- * Return: true to release buf
- */
- bool spectral_dbr_event_handler(struct wlan_objmgr_pdev *pdev,
- struct direct_buf_rx_data *payload);
- #endif
- #endif /* WLAN_CONV_SPECTRAL_ENABLE */
- #endif /* _WLAN_SPECTRAL_UTILS_API_H_*/
|