diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index bd7968dff9..230d51e536 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -127,40 +127,6 @@ cdp_soc_attach_target(ol_txrx_soc_handle soc) } -static inline int -cdp_soc_get_nss_cfg(ol_txrx_soc_handle soc) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->txrx_soc_get_nss_cfg) - return 0; - - return soc->ops->cmn_drv_ops->txrx_soc_get_nss_cfg(soc); -} - -static inline void -cdp_soc_set_nss_cfg(ol_txrx_soc_handle soc, uint32_t config) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->txrx_soc_set_nss_cfg) - return; - - soc->ops->cmn_drv_ops->txrx_soc_set_nss_cfg(soc, config); -} - static inline struct cdp_vdev * cdp_vdev_attach(ol_txrx_soc_handle soc, uint8_t pdev_id, uint8_t *vdev_mac_addr, uint8_t vdev_id, @@ -820,12 +786,13 @@ cdp_set_privacy_filters(ol_txrx_soc_handle soc, uint8_t vdev_id, } static inline int -cdp_set_monitor_filter(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, - struct cdp_monitor_filter *filter_val) +cdp_set_monitor_filter(ol_txrx_soc_handle soc, uint8_t pdev_id, + struct cdp_monitor_filter *filter_val) { if (soc->ops->mon_ops->txrx_set_advance_monitor_filter) - return soc->ops->mon_ops->txrx_set_advance_monitor_filter(pdev, - filter_val); + return soc->ops->mon_ops->txrx_set_advance_monitor_filter(soc, + pdev_id, + filter_val); return 0; } @@ -944,24 +911,6 @@ cdp_peer_unmap_sync_cb_set(ol_txrx_soc_handle soc, unmap_resp_cb); } -static inline int cdp_get_tx_pending(ol_txrx_soc_handle soc, -struct cdp_pdev *pdev) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->txrx_get_tx_pending) - return 0; - - - return soc->ops->cmn_drv_ops->txrx_get_tx_pending(pdev); -} - /* * cdp_data_tx_cb_set(): set the callback for non standard tx * @soc - datapath soc handle @@ -1590,56 +1539,6 @@ static inline void cdp_set_pdev_dscp_tid_map(ol_txrx_soc_handle soc, map_id, tos, tid); } -/** - * cdp_hmmc_tid_override_en(): Function to enable hmmc tid override. - * @soc : soc handle - * @pdev: pdev handle - * @val: hmmc-dscp flag value - * - * Return: void - */ -static inline void cdp_hmmc_tid_override_en(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, bool val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->hmmc_tid_override_en) - return; - - soc->ops->cmn_drv_ops->hmmc_tid_override_en(pdev, val); -} - -/** - * cdp_set_hmmc_tid_val(): Function to set hmmc tid value. - * @soc : soc handle - * @pdev: pdev handle - * @tid: tid value - * - * Return: void - */ -static inline void cdp_set_hmmc_tid_val(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, uint8_t tid) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->set_hmmc_tid_val) - return; - - soc->ops->cmn_drv_ops->set_hmmc_tid_val(pdev, tid); -} - /** * cdp_flush_cache_rx_queue() - flush cache rx queue frame * @@ -2060,89 +1959,6 @@ cdp_tx_send(ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t nbuf) soc->ops->cmn_drv_ops->tx_send(soc, vdev_id, nbuf); } -/* - * cdp_get_pdev_id_frm_pdev() - return pdev_id from pdev - * @soc: opaque soc handle - * @pdev: data path pdev handle - * - * Return: pdev_id - */ -static inline -uint8_t cdp_get_pdev_id_frm_pdev(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev) -{ - if (soc->ops->cmn_drv_ops->txrx_get_pdev_id_frm_pdev) - return soc->ops->cmn_drv_ops->txrx_get_pdev_id_frm_pdev(pdev); - return 0; -} - -/* - * cdp_get_vow_config_frm_pdev() - return carrier_vow_config from pdev - * @soc: opaque soc handle - * @pdev: data path pdev handle - * - * Return: carrier_vow_config - */ -static inline -bool cdp_get_vow_config_frm_pdev(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev) -{ - if (soc->ops->cmn_drv_ops->txrx_get_vow_config_frm_pdev) - return soc->ops->cmn_drv_ops->txrx_get_vow_config_frm_pdev( - pdev); - return 0; -} - -/** - * cdp_pdev_set_chan_noise_floor() - Set channel noise floor to DP layer - * @soc: opaque soc handle - * @pdev: data path pdev handle - * @chan_noise_floor: Channel Noise Floor (in dbM) obtained from control path - * - * Return: None - */ -static inline -void cdp_pdev_set_chan_noise_floor(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, - int16_t chan_noise_floor) -{ - if (soc->ops->cmn_drv_ops->txrx_pdev_set_chan_noise_floor) - return soc->ops->cmn_drv_ops->txrx_pdev_set_chan_noise_floor( - pdev, chan_noise_floor); -} - -/** - * cdp_set_nac() - set nac - * @soc: opaque soc handle - * @vdev_id: id of vdev handle - * @peer_mac: mac of data path peer handle - * - */ -static inline -void cdp_set_nac(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac) -{ - if (soc->ops->cmn_drv_ops->txrx_set_nac) - soc->ops->cmn_drv_ops->txrx_set_nac(soc, vdev_id, peer_mac); -} - -/** - * cdp_set_pdev_tx_capture() - set pdev tx_capture - * @soc: opaque soc handle - * @pdev: data path pdev handle - * @val: value of pdev_tx_capture - * - * Return: status: 0 - Success, non-zero: Failure - */ -static inline -QDF_STATUS cdp_set_pdev_tx_capture(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, int val) -{ - if (soc->ops->cmn_drv_ops->txrx_set_pdev_tx_capture) - return soc->ops->cmn_drv_ops->txrx_set_pdev_tx_capture(pdev, - val); - return QDF_STATUS_SUCCESS; -} - /** * cdp_set_pdev_pcp_tid_map() - set pdev pcp-tid-map * @soc: opaque soc handle @@ -2174,37 +1990,6 @@ QDF_STATUS cdp_set_pdev_pcp_tid_map(ol_txrx_soc_handle soc, pcp, tid); } -/** - * cdp_set_pdev_pcp_tidmap_prty() - set pdev tidmap priority - * @soc: opaque soc handle - * @pdev: data path pdev handle - * @val: priority value - * - * This API is used to configure the tidmap priority for a pdev. - * The tidmap priority decides which mapping, namely DSCP-TID, SVLAN_PCP-TID, - * CVLAN_PCP-TID will be used. - * - * Return: QDF_STATUS_SUCCESS if value set successfully - * QDF_STATUS_E_INVAL false if error - */ -static inline -QDF_STATUS cdp_set_pdev_tidmap_prty(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev_handle, - uint32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - return QDF_STATUS_E_INVAL; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->set_pdev_tidmap_prty) - return QDF_STATUS_E_INVAL; - - return soc->ops->cmn_drv_ops->set_pdev_tidmap_prty(pdev_handle, val); -} - /** * cdp_get_peer_mac_from_peer_id() - get peer mac addr from peer id * @soc: opaque soc handle @@ -2643,70 +2428,6 @@ QDF_STATUS cdp_set_vdev_pcp_tid_map(ol_txrx_soc_handle soc, pcp, tid); } -/** - * cdp_set_vdev_tidmap_tbl_id() - set vdev tidmap table id - * - * @soc: opaque soc handle - * @vdev: data path vdev handle - * @mapid: value of mapid - * - * This API is used to configure the table-id of the tid-mapping for a vdev. - * Table '0' is for using the pdev's pcp-tid mapping and '1' is for using - * the vdev's pcp-tid mapping. - * - * Return: QDF_STATUS_SUCCESS if value set successfully - * QDF_STATUS_E_INVAL false if error - */ -static inline -QDF_STATUS cdp_set_vdev_tidmap_tbl_id(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev_handle, - uint8_t mapid) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - return QDF_STATUS_E_INVAL; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->set_vdev_tidmap_tbl_id) - return QDF_STATUS_E_INVAL; - - return soc->ops->cmn_drv_ops->set_vdev_tidmap_tbl_id(vdev_handle, - mapid); -} - -/** - * cdp_set_vdev_tidmap_prty() - set vdev tidmap priority - * @soc: opaque soc handle - * @vdev: data path vdev handle - * @prio: tidmap priority value - * - * This API is used to configure the tidmap priority for a vdev. - * The tidmap priority decides which mapping, namely DSCP-TID, SVLAN_PCP-TID, - * CVLAN_PCP-TID will be used. - * The vdev tidmap priority will be used only when the tidmap_tbl_id is '1'. - * - * Return: QDF_STATUS_SUCCESS if value set successfully - * QDF_STATUS_E_INVAL false if error - */ -static inline -QDF_STATUS cdp_set_vdev_tidmap_prty(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev_handle, uint8_t prio) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - return QDF_STATUS_E_INVAL; - } - - if (!soc->ops->cmn_drv_ops || - !soc->ops->cmn_drv_ops->set_vdev_tidmap_prty) - return QDF_STATUS_E_INVAL; - - return soc->ops->cmn_drv_ops->set_vdev_tidmap_prty(vdev_handle, prio); -} - /** * cdp_tx_send_exc() - Transmit a frame on a given vdev in exception path * diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index 74f27256fe..f99fd6b5c3 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -77,13 +77,13 @@ void *dp_soc_init_wifi3(struct cdp_soc_t *soc, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id); #else -static inline -struct cdp_soc_t *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - struct hif_opaque_softc *hif_handle, - HTC_HANDLE htc_handle, - qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, - uint16_t device_id) +static inline struct cdp_soc_t * +dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, + struct hif_opaque_softc *hif_handle, + HTC_HANDLE htc_handle, + qdf_device_t qdf_osdev, + struct ol_if_ops *ol_ops, + uint16_t device_id) { return NULL; } @@ -99,10 +99,13 @@ void *dp_soc_init_wifi3(struct cdp_soc_t *soc, } #endif /* QCA_WIFI_QCA8074 */ -static inline ol_txrx_soc_handle cdp_soc_attach( - u_int16_t devid, void *hif_handle, void *psoc, - HTC_HANDLE htc_handle, qdf_device_t qdf_dev, - struct ol_if_ops *dp_ol_if_ops) +static inline +ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, + struct hif_opaque_softc *hif_handle, + struct cdp_ctrl_objmgr_psoc *psoc, + HTC_HANDLE htc_handle, + qdf_device_t qdf_dev, + struct ol_if_ops *dp_ol_if_ops) { switch (devid) { case LITHIUM_DP: /*FIXME Add lithium devide IDs */ diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 575e935702..defcef50c1 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -774,12 +774,12 @@ typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_ * @osif_dev - the virtual device's OS shim object * @list_head - poniter to head of receive packet queue to decap * @list_tail - poniter to tail of receive packet queue to decap - * @peer - Peer handler + * @peer_mac - mac address of peer handler */ typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev, qdf_nbuf_t *list_head, qdf_nbuf_t *list_tail, - struct cdp_peer *peer); + uint8_t *peer_mac); /* ol_txrx_rx_fp - external tx free function to read per packet stats and * free tx buffer externally @@ -997,6 +997,8 @@ enum cdp_peer_param_type { * @CDP_FILTER_MCAST_DATA: filter multicast data * @CDP_FILTER_NO_DATA: filter no data * @CDP_MONITOR_CHANNEL: monitor channel + * @CDP_MONITOR_FREQUENCY: monitor frequency + * @CDP_CONFIG_BSS_COLOR: configure bss color */ enum cdp_pdev_param_type { CDP_CONFIG_DEBUG_SNIFFER, @@ -1024,6 +1026,8 @@ enum cdp_pdev_param_type { CDP_FILTER_MCAST_DATA, CDP_FILTER_NO_DATA, CDP_MONITOR_CHANNEL, + CDP_MONITOR_FREQUENCY, + CDP_CONFIG_BSS_COLOR, }; /* @@ -1069,6 +1073,8 @@ enum cdp_pdev_param_type { * @cdp_pdev_param_chn_noise_flr: set channel noise floor * @cdp_pdev_param_cfg_vow: set/get vow config * @cdp_pdev_param_tidq_override: set/get tid queue override + * @cdp_pdev_param_mon_freq: set monitor frequency + * @cdp_pdev_param_bss_color: configure bss color * @cdp_pdev_param_tidmap_prty: set/get tid map prty * @cdp_pdev_param_tx_pending: get tx pending * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers @@ -1125,7 +1131,9 @@ typedef union cdp_config_param_t { uint8_t cdp_pdev_param_igmpmld_tid; uint8_t cdp_pdev_param_arp_dbg_conf; uint8_t cdp_pdev_param_tidq_override; + uint8_t cdp_pdev_param_bss_color; uint16_t cdp_pdev_param_chn_noise_flr; + qdf_freq_t cdp_pdev_param_mon_freq; int cdp_pdev_param_dbg_snf; int cdp_pdev_param_bpr_enable; int cdp_pdev_param_monitor_chan; diff --git a/dp/inc/cdp_txrx_ctrl.h b/dp/inc/cdp_txrx_ctrl.h index 86c9976136..cf2a599611 100644 --- a/dp/inc/cdp_txrx_ctrl.h +++ b/dp/inc/cdp_txrx_ctrl.h @@ -49,7 +49,7 @@ static inline int cdp_is_target_ar900b /* WIN */ static inline int -cdp_mempools_attach(ol_txrx_soc_handle soc, void *ctrl_pdev) +cdp_mempools_attach(ol_txrx_soc_handle soc) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -62,36 +62,7 @@ cdp_mempools_attach(ol_txrx_soc_handle soc, void *ctrl_pdev) !soc->ops->ctrl_ops->txrx_mempools_attach) return 0; - return soc->ops->ctrl_ops->txrx_mempools_attach(ctrl_pdev); -} - -/** - * @brief set filter neighbour peers - * @details - * This defines interface function to set neighbour peer filtering. - * - * @param soc - the pointer to soc object - * @param pdev - the pointer physical device object - * @param val - the enable/disable value - * @return - int - */ -static inline int -cdp_set_filter_neighbour_peers(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, u_int32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers) - return 0; - - return soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers - (pdev, val); + return soc->ops->ctrl_ops->txrx_mempools_attach(soc); } /** @@ -125,143 +96,6 @@ cdp_update_filter_neighbour_peers(ol_txrx_soc_handle soc, (soc, vdev_id, cmd, macaddr); } -/** - * @brief set the safemode of the device - * @details - * This flag is used to bypass the encrypt and decrypt processes when send and - * receive packets. It works like open AUTH mode, HW will treate all packets - * as non-encrypt frames because no key installed. For rx fragmented frames, - * it bypasses all the rx defragmentaion. - * - * @param vdev - the data virtual device object - * @param val - the safemode state - * @return - void - */ -static inline void -cdp_set_safemode(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, u_int32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_safemode) - return; - - soc->ops->ctrl_ops->txrx_set_safemode(vdev, val); -} -/** - * @brief configure the drop unencrypted frame flag - * @details - * Rx related. When set this flag, all the unencrypted frames - * received over a secure connection will be discarded - * - * @param vdev - the data virtual device object - * @param val - flag - * @return - void - */ -static inline void -cdp_set_drop_unenc(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, u_int32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_drop_unenc) - return; - - soc->ops->ctrl_ops->txrx_set_drop_unenc(vdev, val); -} - - -/** - * @brief set the Tx encapsulation type of the VDEV - * @details - * This will be used to populate the HTT desc packet type field during Tx - * - * @param vdev - the data virtual device object - * @param val - the Tx encap type (htt_cmn_pkt_type) - * @return - void - */ -static inline void -cdp_set_tx_encap_type(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, enum htt_cmn_pkt_type val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_tx_encap_type) - return; - - soc->ops->ctrl_ops->txrx_set_tx_encap_type(vdev, val); -} - -/** - * @brief set the Rx decapsulation type of the VDEV - * @details - * This will be used to configure into firmware and hardware which format to - * decap all Rx packets into, for all peers under the VDEV. - * - * @param vdev - the data virtual device object - * @param val - the Rx decap mode (htt_cmn_pkt_type) - * @return - void - */ -static inline void -cdp_set_vdev_rx_decap_type(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, enum htt_cmn_pkt_type val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type) - return; - - soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type - (vdev, val); -} - -/** - * @brief get the Rx decapsulation type of the VDEV - * - * @param vdev - the data virtual device object - * @return - the Rx decap type (htt_cmn_pkt_type) - */ -static inline enum htt_cmn_pkt_type -cdp_get_vdev_rx_decap_type(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type) - return 0; - - return soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type(vdev); -} - /** * @brief set the Reo Destination ring for the pdev * @details @@ -323,77 +157,34 @@ cdp_get_pdev_reo_dest(ol_txrx_soc_handle soc, uint8_t pdev_id) * updates the peer/node-related parameters within rate-control * context of the peer at association. * - * @param peer - pointer to the node's object + * @param soc - pointer to the soc + * @param vdev_id - id of the pointer to vdev + * @param peer_mac - mac address of the node's object * @authorize - either to authorize or unauthorize peer * - * @return none + * @return QDF_STATUS */ -static inline void -cdp_peer_authorize(ol_txrx_soc_handle soc, - struct cdp_peer *peer, u_int32_t authorize) +static inline QDF_STATUS +cdp_peer_authorize(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac, + u_int32_t authorize) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_peer_authorize) - return; + return QDF_STATUS_E_FAILURE; - soc->ops->ctrl_ops->txrx_peer_authorize - (peer, authorize); -} - -/* Should be ol_txrx_ctrl_api.h */ -static inline void cdp_set_mesh_mode -(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, u_int32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_mesh_mode) - return; - - soc->ops->ctrl_ops->txrx_set_mesh_mode(vdev, val); -} - -/** - * @brief set mesh rx filter - * @details based on the bits enabled in the filter packets has to be dropped. - * - * @param soc - pointer to the soc - * @param vdev - the data virtual device object - * @param val - value to be set - * @return - void - */ -static inline -void cdp_set_mesh_rx_filter(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, uint32_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance:", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_mesh_rx_filter) - return; - - soc->ops->ctrl_ops->txrx_set_mesh_rx_filter(vdev, val); + return soc->ops->ctrl_ops->txrx_peer_authorize + (soc, vdev_id, peer_mac, authorize); } static inline void cdp_tx_flush_buffers -(ol_txrx_soc_handle soc, struct cdp_vdev *vdev) +(ol_txrx_soc_handle soc, uint8_t vdev_id) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -406,65 +197,179 @@ static inline void cdp_tx_flush_buffers !soc->ops->ctrl_ops->tx_flush_buffers) return; - soc->ops->ctrl_ops->tx_flush_buffers(vdev); + soc->ops->ctrl_ops->tx_flush_buffers(soc, vdev_id); } -static inline uint32_t cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, - enum cdp_vdev_param_type type) +static inline QDF_STATUS cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc, + uint8_t vdev_id, + enum cdp_vdev_param_type type, + cdp_config_param_type *val) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return -1; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_get_vdev_param) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: callback not registered:", __func__); - return -1; + return QDF_STATUS_E_FAILURE; } - return soc->ops->ctrl_ops->txrx_get_vdev_param(vdev, type); + return soc->ops->ctrl_ops->txrx_get_vdev_param(soc, vdev_id, + type, val); } -static inline void cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc, - struct cdp_vdev *vdev, enum cdp_vdev_param_type type, - uint32_t val) +static inline QDF_STATUS +cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc, + uint8_t vdev_id, enum cdp_vdev_param_type type, + cdp_config_param_type val) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_set_vdev_param) - return; + return QDF_STATUS_E_FAILURE; - soc->ops->ctrl_ops->txrx_set_vdev_param(vdev, type, val); + return soc->ops->ctrl_ops->txrx_set_vdev_param(soc, vdev_id, + type, val); } -static inline void -cdp_peer_set_nawds(ol_txrx_soc_handle soc, - struct cdp_peer *peer, uint8_t value) +static inline QDF_STATUS +cdp_txrx_set_psoc_param(ol_txrx_soc_handle soc, + enum cdp_psoc_param_type type, + cdp_config_param_type val) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_peer_set_nawds) - return; + !soc->ops->ctrl_ops->txrx_set_psoc_param) + return QDF_STATUS_E_FAILURE; - soc->ops->ctrl_ops->txrx_peer_set_nawds - (peer, value); + return soc->ops->ctrl_ops->txrx_set_psoc_param(soc, type, val); +} + +static inline QDF_STATUS +cdp_txrx_get_psoc_param(ol_txrx_soc_handle soc, + enum cdp_psoc_param_type type, + cdp_config_param_type *val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_get_psoc_param) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_get_psoc_param(soc, type, val); +} + +/** + * cdp_txrx_set_pdev_param() - set pdev parameter + * @soc: opaque soc handle + * @pdev_id: id of data path pdev handle + * @type: param type + * @val: value + * + * Return: status: 0 - Success, non-zero: Failure + */ +static inline QDF_STATUS cdp_txrx_set_pdev_param(ol_txrx_soc_handle soc, + uint8_t pdev_id, + enum cdp_pdev_param_type type, + cdp_config_param_type val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_set_pdev_param) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_set_pdev_param + (soc, pdev_id, type, val); +} + +/** + * cdp_txrx_set_peer_param() - set pdev parameter + * @soc: opaque soc handle + * @vdev_id: id of data path vdev handle + * @peer_mac: peer mac address + * @type: param type + * @val: value + * + * Return: status: 0 - Success, non-zero: Failure + */ +static inline QDF_STATUS cdp_txrx_set_peer_param(ol_txrx_soc_handle soc, + uint8_t vdev_id, + uint8_t *peer_mac, + enum cdp_peer_param_type type, + cdp_config_param_type val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_set_peer_param) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_set_peer_param + (soc, vdev_id, peer_mac, type, val); +} + +/** + * cdp_txrx_get_peer_param() - set pdev parameter + * @soc: opaque soc handle + * @vdev_id: id of data path vdev handle + * @peer_mac: peer mac address + * @type: param type + * @val: address of buffer + * + * Return: status + */ +static inline QDF_STATUS cdp_txrx_get_peer_param(ol_txrx_soc_handle soc, + uint8_t vdev_id, + uint8_t *peer_mac, + enum cdp_peer_param_type type, + cdp_config_param_type *val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_get_peer_param) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_get_peer_param + (soc, vdev_id, peer_mac, type, val); } #ifdef QCA_MULTIPASS_SUPPORT @@ -489,32 +394,32 @@ cdp_peer_set_vlan_id(ol_txrx_soc_handle soc, uint8_t vdev_id, #endif /** - * cdp_txrx_set_pdev_param() - set pdev parameter + * cdp_txrx_get_pdev_param() - get pdev parameter * @soc: opaque soc handle - * @pdev: data path pdev handle + * @pdev_id: id of data path pdev handle * @type: param type - * @val: value of pdev_tx_capture + * @value: address of value buffer * - * Return: status: 0 - Success, non-zero: Failure + * Return: status */ -static inline QDF_STATUS cdp_txrx_set_pdev_param(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, +static inline QDF_STATUS cdp_txrx_get_pdev_param(ol_txrx_soc_handle soc, + uint8_t pdev_id, enum cdp_pdev_param_type type, - uint32_t val) + cdp_config_param_type *value) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return QDF_STATUS_SUCCESS; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->ctrl_ops || - !soc->ops->ctrl_ops->txrx_set_pdev_param) - return QDF_STATUS_SUCCESS; + !soc->ops->ctrl_ops->txrx_get_pdev_param) + return QDF_STATUS_E_FAILURE; - return soc->ops->ctrl_ops->txrx_set_pdev_param - (pdev, type, val); + return soc->ops->ctrl_ops->txrx_get_pdev_param + (soc, pdev_id, type, value); } /** diff --git a/dp/inc/cdp_txrx_host_stats.h b/dp/inc/cdp_txrx_host_stats.h index c1474d1602..d417ec9db6 100644 --- a/dp/inc/cdp_txrx_host_stats.h +++ b/dp/inc/cdp_txrx_host_stats.h @@ -705,29 +705,4 @@ cdp_host_get_radio_stats(ol_txrx_soc_handle soc, return soc->ops->host_stats_ops->txrx_get_radio_stats(soc, pdev_id, buf); } - -/** - * @brief confgure rate stats at soc - * - * @param soc - opaque soc handle - * @param val - capabilities - * @return - QDF_STATUS - */ -static inline QDF_STATUS -cdp_soc_configure_rate_stats(ol_txrx_soc_handle soc, uint8_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return QDF_STATUS_E_FAILURE; - } - - if (!soc->ops->host_stats_ops || - !soc->ops->host_stats_ops->configure_rate_stats) - return QDF_STATUS_E_FAILURE; - - return soc->ops->host_stats_ops->configure_rate_stats(soc, val); -} - #endif /* _CDP_TXRX_HOST_STATS_H_ */ diff --git a/dp/inc/cdp_txrx_me.h b/dp/inc/cdp_txrx_me.h index bc65a855ff..010b4c383a 100644 --- a/dp/inc/cdp_txrx_me.h +++ b/dp/inc/cdp_txrx_me.h @@ -28,67 +28,8 @@ /* TODO: adf need to be replaced with qdf */ #include "cdp_txrx_handle.h" -static inline u_int16_t -cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, u_int16_t buf_count) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->me_ops || - !soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone) - return 0; - - return soc->ops->me_ops-> - tx_desc_alloc_and_mark_for_mcast_clone - (pdev, buf_count); -} - -static inline u_int16_t -cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, u_int16_t buf_count) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->me_ops || - !soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone) - return 0; - - return soc->ops->me_ops-> - tx_desc_free_and_unmark_for_mcast_clone - (pdev, buf_count); -} - -static inline u_int16_t -cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->me_ops || - !soc->ops->me_ops->tx_get_mcast_buf_allocated_marked) - return 0; - - return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked - (pdev); -} - static inline void -cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) +cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, uint8_t pdev_id) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -101,11 +42,11 @@ cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) !soc->ops->me_ops->tx_me_alloc_descriptor) return; - soc->ops->me_ops->tx_me_alloc_descriptor(pdev); + soc->ops->me_ops->tx_me_alloc_descriptor(soc, pdev_id); } static inline void -cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) +cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, uint8_t pdev_id) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -118,12 +59,13 @@ cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) !soc->ops->me_ops->tx_me_free_descriptor) return; - soc->ops->me_ops->tx_me_free_descriptor(pdev); + soc->ops->me_ops->tx_me_free_descriptor(soc, pdev_id); } -static inline uint16_t cdp_tx_me_convert_ucast( - ol_txrx_soc_handle soc, uint8_t vdev_id, - qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt) +static inline uint16_t +cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, uint8_t vdev_id, + qdf_nbuf_t wbuf, u_int8_t newmac[][6], + uint8_t newmaccnt) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -140,32 +82,4 @@ static inline uint16_t cdp_tx_me_convert_ucast( (soc, vdev_id, wbuf, newmac, newmaccnt); } -/* Should be a function pointer in ol_txrx_osif_ops{} */ -/** - * @brief notify mcast frame indication from FW. - * @details - * This notification will be used to convert - * multicast frame to unicast. - * - * @param pdev - handle to the ctrl SW's physical device object - * @param vdev_id - ID of the virtual device received the special data - * @param msdu - the multicast msdu returned by FW for host inspect - */ - -static inline int cdp_mcast_notify(ol_txrx_soc_handle soc, - struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->me_ops || - !soc->ops->me_ops->mcast_notify) - return 0; - - return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu); -} #endif diff --git a/dp/inc/cdp_txrx_mon.h b/dp/inc/cdp_txrx_mon.h index 45fd053cbb..11d327953e 100644 --- a/dp/inc/cdp_txrx_mon.h +++ b/dp/inc/cdp_txrx_mon.h @@ -25,116 +25,9 @@ #ifndef _CDP_TXRX_MON_H_ #define _CDP_TXRX_MON_H_ #include "cdp_txrx_handle.h" -static inline void cdp_monitor_set_filter_ucast_data - (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data) - return; - - soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data - (pdev, val); -} - -static inline void cdp_monitor_set_filter_mcast_data - (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data) - return; - - soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data - (pdev, val); -} - -static inline void cdp_monitor_set_filter_non_data - (ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_set_filter_non_data) - return; - - soc->ops->mon_ops->txrx_monitor_set_filter_non_data - (pdev, val); -} - -static inline bool cdp_monitor_get_filter_ucast_data -(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data) - return 0; - - return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data - (vdev_txrx_handle); -} - -static inline bool cdp_monitor_get_filter_mcast_data -(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data) - return 0; - - return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data - (vdev_txrx_handle); -} - -static inline bool cdp_monitor_get_filter_non_data -(ol_txrx_soc_handle soc, struct cdp_vdev *vdev_txrx_handle) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return 0; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_get_filter_non_data) - return 0; - - return soc->ops->mon_ops->txrx_monitor_get_filter_non_data - (vdev_txrx_handle); -} - -static inline QDF_STATUS cdp_reset_monitor_mode -(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) +static inline QDF_STATUS cdp_reset_monitor_mode(ol_txrx_soc_handle soc, + uint8_t pdev_id) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -147,85 +40,31 @@ static inline QDF_STATUS cdp_reset_monitor_mode !soc->ops->mon_ops->txrx_reset_monitor_mode) return 0; - return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev); -} - -static inline void -cdp_record_monitor_chan_num(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, - int chan_num) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_record_channel) - return; - - soc->ops->mon_ops->txrx_monitor_record_channel(pdev, chan_num); -} - -static inline void -cdp_record_monitor_chan_freq(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, - qdf_freq_t chan_freq) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_monitor_record_frequency) - return; - - soc->ops->mon_ops->txrx_monitor_record_frequency(pdev, chan_freq); + return soc->ops->mon_ops->txrx_reset_monitor_mode(soc, pdev_id); } /** * cdp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture * @soc: Datapath SOC handle - * @pdev: Datapath PDEV handle + * @pdev_id: id of datapath PDEV handle * @nbuf: Management frame buffer */ -static inline void -cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, +static inline QDF_STATUS +cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, uint8_t pdev_id, qdf_nbuf_t nbuf) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance", __func__); QDF_BUG(0); - return; + return QDF_STATUS_E_FAILURE; } if (!soc->ops->mon_ops || !soc->ops->mon_ops->txrx_deliver_tx_mgmt) - return; + return QDF_STATUS_E_FAILURE; - soc->ops->mon_ops->txrx_deliver_tx_mgmt(pdev, nbuf); -} - -static inline void -cdp_set_bsscolor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, - uint8_t bsscolor) -{ - if (!soc || !soc->ops) { - QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, - "%s: Invalid Instance", __func__); - QDF_BUG(0); - return; - } - - if (!soc->ops->mon_ops || - !soc->ops->mon_ops->txrx_set_bsscolor) - return; - - soc->ops->mon_ops->txrx_set_bsscolor(pdev, bsscolor); + return soc->ops->mon_ops->txrx_deliver_tx_mgmt(soc, pdev_id, nbuf); } #ifdef WLAN_FEATURE_PKT_CAPTURE diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 779047b2ce..4e3d4ffa4c 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -171,26 +171,6 @@ struct cdp_cmn_ops { ol_txrx_peer_unmap_sync_cb peer_unmap_sync); - uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev); - bool (*txrx_get_vow_config_frm_pdev)(struct cdp_pdev *pdev); - - void (*txrx_pdev_set_chan_noise_floor)(struct cdp_pdev *pdev, - int16_t chan_noise_floor); - - void - (*txrx_set_nac)(ol_txrx_soc_handle soc, uint8_t vdev_id, - uint8_t *peer_mac); - - /** - * txrx_set_pdev_tx_capture() - callback to set pdev tx_capture - * @soc: opaque soc handle - * @pdev: data path pdev handle - * @val: value of pdev_tx_capture - * - * Return: status: 0 - Success, non-zero: Failure - */ - QDF_STATUS (*txrx_set_pdev_tx_capture)(struct cdp_pdev *pdev, int val); - QDF_STATUS (*txrx_get_peer_mac_from_peer_id) (struct cdp_soc_t *cdp_soc, @@ -257,8 +237,6 @@ struct cdp_cmn_ops { ol_txrx_mgmt_tx_cb ota_ack_cb, void *ctxt); - int (*txrx_get_tx_pending)(struct cdp_pdev *pdev); - /** * ol_txrx_data_tx_cb - Function registered with the data path * that is called when tx frames marked as "no free" are @@ -420,18 +398,12 @@ struct cdp_cmn_ops { uint8_t map_id, uint8_t tos, uint8_t tid); - void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val); - void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid); - QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle, uint8_t vdev_id, struct cdp_txrx_stats_req *req); QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value, enum qdf_stats_verbosity_level level); - void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config); - - int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc); QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle); void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle); @@ -494,13 +466,16 @@ struct cdp_cmn_ops { uint8_t vdev_id, ol_txrx_rx_fp *stack_fn, ol_osif_vdev_handle *osif_vdev); + + void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, + void *ctx); + int (*txrx_classify_update) (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb, enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class); bool (*get_dp_capabilities)(struct cdp_soc_t *soc, enum cdp_capabilities dp_caps); - void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, void *ctx); void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc); QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, @@ -511,13 +486,9 @@ struct cdp_cmn_ops { QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc, uint8_t pdev_id, uint8_t pcp, uint8_t tid); - QDF_STATUS (*set_pdev_tidmap_prty)(struct cdp_pdev *pdev, uint8_t prty); QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t pcp, uint8_t tid); - QDF_STATUS (*set_vdev_tidmap_prty)(struct cdp_vdev *vdev, uint8_t prty); - QDF_STATUS (*set_vdev_tidmap_tbl_id)(struct cdp_vdev *vdev, - uint8_t mapid); #ifdef QCA_MULTIPASS_SUPPORT QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id, uint16_t vlan_id, uint16_t group_key); @@ -531,85 +502,11 @@ struct cdp_cmn_ops { struct cdp_ctrl_ops { int - (*txrx_mempools_attach)(void *ctrl_pdev); - - int - (*txrx_set_filter_neighbour_peers)( - struct cdp_pdev *pdev, - uint32_t val); + (*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc); int (*txrx_update_filter_neighbour_peers)( struct cdp_soc_t *soc, uint8_t vdev_id, uint32_t cmd, uint8_t *macaddr); - /** - * @brief set the safemode of the device - * @details - * This flag is used to bypass the encrypt and decrypt processes when - * send and receive packets. It works like open AUTH mode, HW will - * ctreate all packets as non-encrypt frames because no key installed. - * For rx fragmented frames,it bypasses all the rx defragmentaion. - * - * @param vdev - the data virtual device object - * @param val - the safemode state - * @return - void - */ - - void - (*txrx_set_safemode)( - struct cdp_vdev *vdev, - u_int32_t val); - /** - * @brief configure the drop unencrypted frame flag - * @details - * Rx related. When set this flag, all the unencrypted frames - * received over a secure connection will be discarded - * - * @param vdev - the data virtual device object - * @param val - flag - * @return - void - */ - void - (*txrx_set_drop_unenc)( - struct cdp_vdev *vdev, - u_int32_t val); - - - /** - * @brief set the Tx encapsulation type of the VDEV - * @details - * This will be used to populate the HTT desc packet type field - * during Tx - * @param vdev - the data virtual device object - * @param val - the Tx encap type - * @return - void - */ - void - (*txrx_set_tx_encap_type)( - struct cdp_vdev *vdev, - enum htt_cmn_pkt_type val); - /** - * @brief set the Rx decapsulation type of the VDEV - * @details - * This will be used to configure into firmware and hardware - * which format to decap all Rx packets into, for all peers under - * the VDEV. - * @param vdev - the data virtual device object - * @param val - the Rx decap mode - * @return - void - */ - void - (*txrx_set_vdev_rx_decap_type)( - struct cdp_vdev *vdev, - enum htt_cmn_pkt_type val); - - /** - * @brief get the Rx decapsulation type of the VDEV - * - * @param vdev - the data virtual device object - * @return - the Rx decap type - */ - enum htt_cmn_pkt_type - (*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev); /* Is this similar to ol_txrx_peer_state_update() in MCL */ /** @@ -619,36 +516,28 @@ struct cdp_ctrl_ops { * updates the peer/node-related parameters within rate-control * context of the peer at association. * - * @param peer - pointer to the node's object + * @param soc_hdl - pointer to the soc object + * @param vdev_id - id of the virtual object + * @param peer_mac - mac address of the node's object * @authorize - either to authorize or unauthorize peer * - * @return none + * @return QDF_STATUS */ - void - (*txrx_peer_authorize)(struct cdp_peer *peer, - u_int32_t authorize); + QDF_STATUS + (*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl, + uint8_t vdev_id, + uint8_t *peer_mac, + u_int32_t authorize); - /* Should be ol_txrx_ctrl_api.h */ - void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val); - - /** - * @brief setting mesh rx filter - * @details - * based on the bits enabled in the filter packets has to be dropped. - * - * @param vdev - the data virtual device object - * @param val - value to set - */ - void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val); - - void (*tx_flush_buffers)(struct cdp_vdev *vdev); + void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id); int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl); - void (*txrx_set_vdev_param)(struct cdp_vdev *vdev, - enum cdp_vdev_param_type param, uint32_t val); + QDF_STATUS + (*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id, + enum cdp_vdev_param_type param, + cdp_config_param_type val); - void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value); /** * @brief Set the reo dest ring num of the radio * @details @@ -687,6 +576,9 @@ struct cdp_ctrl_ops { wdi_event_subscribe *event_cb_sub, uint32_t event); + int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id, + uint8_t *peer_mac, uint8_t sec_idx); + QDF_STATUS (*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id, @@ -695,14 +587,31 @@ struct cdp_ctrl_ops { /** * txrx_set_pdev_param() - callback to set pdev parameter * @soc: opaque soc handle - * @pdev: data path pdev handle + * @pdev_id:id of data path pdev handle * @val: value of pdev_tx_capture * * Return: status: 0 - Success, non-zero: Failure */ - QDF_STATUS (*txrx_set_pdev_param)(struct cdp_pdev *pdev, + QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc, + uint8_t pdev_id, enum cdp_pdev_param_type type, - uint32_t val); + cdp_config_param_type val); + + QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc, + uint8_t pdev_id, + enum cdp_pdev_param_type type, + cdp_config_param_type *val); + + QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc, + uint8_t vdev_id, uint8_t *peer_mac, + enum cdp_peer_param_type param, + cdp_config_param_type val); + + QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc, + uint8_t vdev_id, uint8_t *peer_mac, + enum cdp_peer_param_type param, + cdp_config_param_type *val); + void * (*txrx_get_pldev)(struct cdp_pdev *pdev); #ifdef ATH_SUPPORT_NAC_RSSI @@ -722,8 +631,10 @@ struct cdp_ctrl_ops { (*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac, bool is_unicast, uint32_t *key); - uint32_t (*txrx_get_vdev_param)(struct cdp_vdev *vdev, - enum cdp_vdev_param_type param); + QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc, + uint8_t vdev_id, + enum cdp_vdev_param_type param, + cdp_config_param_type *val); int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, uint8_t *macaddr, uint8_t enb_dsb); @@ -761,78 +672,40 @@ struct cdp_ctrl_ops { bool is_rx_pkt_cap_enable, bool is_tx_pkt_cap_enable, uint8_t *peer_mac); #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ + QDF_STATUS + (*txrx_set_psoc_param)(struct cdp_soc_t *soc, + enum cdp_psoc_param_type param, + cdp_config_param_type val); + + QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc, + enum cdp_psoc_param_type type, + cdp_config_param_type *val); }; struct cdp_me_ops { - u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone) - (struct cdp_pdev *pdev, u_int16_t buf_count); + void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc, + uint8_t pdev_id); - u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)( - struct cdp_pdev *pdev, - u_int16_t buf_count); + void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id); - u_int16_t - (*tx_get_mcast_buf_allocated_marked) - (struct cdp_pdev *pdev); - void - (*tx_me_alloc_descriptor)(struct cdp_pdev *pdev); - - void - (*tx_me_free_descriptor)(struct cdp_pdev *pdev); - - uint16_t (*tx_me_convert_ucast)( - ol_txrx_soc_handle soc, uint8_t vdev_id, - qdf_nbuf_t wbuf, u_int8_t newmac[][6], - uint8_t newmaccnt); - /* Should be a function pointer in ol_txrx_osif_ops{} */ - /** - * @brief notify mcast frame indication from FW. - * @details - * This notification will be used to convert - * multicast frame to unicast. - * - * @param pdev - handle to the ctrl SW's physical device object - * @param vdev_id - ID of the virtual device received the special data - * @param msdu - the multicast msdu returned by FW for host inspect - */ - - int (*mcast_notify)(struct cdp_pdev *pdev, - u_int8_t vdev_id, qdf_nbuf_t msdu); + uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id, + qdf_nbuf_t wbuf, u_int8_t newmac[][6], + uint8_t newmaccnt); }; struct cdp_mon_ops { - void (*txrx_monitor_set_filter_ucast_data) - (struct cdp_pdev *, u_int8_t val); - void (*txrx_monitor_set_filter_mcast_data) - (struct cdp_pdev *, u_int8_t val); - void (*txrx_monitor_set_filter_non_data) - (struct cdp_pdev *, u_int8_t val); + QDF_STATUS (*txrx_reset_monitor_mode)(ol_txrx_soc_handle soc, + uint8_t pdev_id); - bool (*txrx_monitor_get_filter_ucast_data) - (struct cdp_vdev *vdev_txrx_handle); - bool (*txrx_monitor_get_filter_mcast_data) - (struct cdp_vdev *vdev_txrx_handle); - bool (*txrx_monitor_get_filter_non_data) - (struct cdp_vdev *vdev_txrx_handle); - QDF_STATUS (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev); + QDF_STATUS (*txrx_deliver_tx_mgmt) + (struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf); /* HK advance monitor filter support */ QDF_STATUS (*txrx_set_advance_monitor_filter) - (struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val); - - void (*txrx_monitor_record_channel) - (struct cdp_pdev *pdev, int val); - - void (*txrx_monitor_record_frequency) - (struct cdp_pdev *pdev, qdf_freq_t val); - - void (*txrx_deliver_tx_mgmt) - (struct cdp_pdev *pdev, qdf_nbuf_t nbuf); - - void (*txrx_set_bsscolor) - (struct cdp_pdev *pdev, uint8_t bsscolor); + (struct cdp_soc_t *soc_hdl, uint8_t pdev_id, + struct cdp_monitor_filter *filter_val); }; #ifdef WLAN_FEATURE_PKT_CAPTURE @@ -983,9 +856,6 @@ struct cdp_host_stats_ops { (*txrx_get_ratekbps)(int preamb, int mcs, int htflag, int gintval); - QDF_STATUS - (*configure_rate_stats)(struct cdp_soc_t *soc, uint8_t val); - QDF_STATUS (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac, void *stats, diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index d3a547adf3..a73cef3684 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -1012,6 +1012,13 @@ void dp_rx_tid_stats_cb(struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status); void dp_rx_bar_stats_cb(struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status); +uint16_t dp_tx_me_send_convert_ucast(struct cdp_soc_t *soc, uint8_t vdev_id, + qdf_nbuf_t nbuf, + uint8_t newmac[][QDF_MAC_ADDR_SIZE], + uint8_t new_mac_cnt); +void dp_tx_me_alloc_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id); + +void dp_tx_me_free_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id); QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev, uint32_t stats_type_upload_mask, uint32_t config_param_0, uint32_t config_param_1, uint32_t config_param_2, diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 0ee6218325..c28a0b6f06 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -107,7 +107,7 @@ QDF_COMPILE_TIME_ASSERT(wlan_cfg_num_int_ctxs, * Return: QDF_STATUS */ static QDF_STATUS -dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint8_t val) +dp_config_enh_rx_capture(struct dp_pdev *pdev_handle, uint8_t val) { return QDF_STATUS_E_INVAL; } @@ -124,7 +124,7 @@ dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint8_t val) * Return: QDF_STATUS */ static QDF_STATUS -dp_config_enh_tx_capture(struct cdp_pdev *pdev_handle, uint8_t val) +dp_config_enh_tx_capture(struct dp_pdev *pdev_handle, uint8_t val) { return QDF_STATUS_E_INVAL; } @@ -4872,55 +4872,6 @@ dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc) return QDF_STATUS_SUCCESS; } -/* - * dp_soc_get_nss_cfg_wifi3() - SOC get nss config - * @txrx_soc: Datapath SOC handle - */ -static int dp_soc_get_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc) -{ - struct dp_soc *dsoc = (struct dp_soc *)cdp_soc; - return wlan_cfg_get_dp_soc_nss_cfg(dsoc->wlan_cfg_ctx); -} - -/* - * dp_soc_set_nss_cfg_wifi3() - SOC set nss config - * @txrx_soc: Datapath SOC handle - * @nss_cfg: nss config - */ -static void dp_soc_set_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc, int config) -{ - struct dp_soc *dsoc = (struct dp_soc *)cdp_soc; - struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = dsoc->wlan_cfg_ctx; - - wlan_cfg_set_dp_soc_nss_cfg(wlan_cfg_ctx, config); - - /* - * TODO: masked out based on the per offloaded radio - */ - switch (config) { - case dp_nss_cfg_default: - break; - case dp_nss_cfg_first_radio: - /* - * This configuration is valid for single band radio which - * is also NSS offload. - */ - case dp_nss_cfg_dbdc: - case dp_nss_cfg_dbtc: - wlan_cfg_set_num_tx_desc_pool(wlan_cfg_ctx, 0); - wlan_cfg_set_num_tx_ext_desc_pool(wlan_cfg_ctx, 0); - wlan_cfg_set_num_tx_desc(wlan_cfg_ctx, 0); - wlan_cfg_set_num_tx_ext_desc(wlan_cfg_ctx, 0); - break; - default: - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "Invalid offload config %d", config); - } - - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, - FL("nss-wifi<0> nss config is enabled")); -} - /* * dp_vdev_attach_wifi3() - attach txrx vdev * @txrx_pdev: Datapath PDEV handle @@ -5249,6 +5200,8 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc, */ if (!hif_is_target_ready(HIF_GET_SOFTC(soc->hif_handle))) dp_vdev_flush_peers((struct cdp_vdev *)vdev, false); + else if (hif_get_target_status(soc->hif_handle) == TARGET_STATUS_RESET) + dp_vdev_flush_peers((struct cdp_vdev *)vdev, true); /* * Use peer_ref_mutex while accessing peer_list, in case @@ -5881,34 +5834,6 @@ static QDF_STATUS dp_cp_peer_del_resp_handler(struct cdp_soc_t *soc_hdl, return QDF_STATUS_SUCCESS; } -/* - * dp_set_vdev_tx_encap_type() - set the encap type of the vdev - * @vdev_handle: virtual device object - * @htt_pkt_type: type of pkt - * - * Return: void - */ -static void dp_set_vdev_tx_encap_type(struct cdp_vdev *vdev_handle, - enum htt_cmn_pkt_type val) -{ - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - vdev->tx_encap_type = val; -} - -/* - * dp_set_vdev_rx_decap_type() - set the decap type of the vdev - * @vdev_handle: virtual device object - * @htt_pkt_type: type of pkt - * - * Return: void - */ -static void dp_set_vdev_rx_decap_type(struct cdp_vdev *vdev_handle, - enum htt_cmn_pkt_type val) -{ - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - vdev->rx_decap_type = val; -} - /* * dp_set_ba_aging_timeout() - set ba aging timeout per AC * @txrx_soc: cdp soc handle @@ -5986,17 +5911,15 @@ dp_get_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id) } /* - * dp_set_filter_neighbour_peers() - set filter neighbour peers for smart mesh + * dp_set_filter_neigh_peers() - set filter neighbour peers for smart mesh * @pdev_handle: device object * @val: value to be set * * Return: void */ -static int dp_set_filter_neighbour_peers(struct cdp_pdev *pdev_handle, - uint32_t val) +static int dp_set_filter_neigh_peers(struct dp_pdev *pdev, + bool val) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - /* Enable/Disable smart mesh filtering. This flag will be checked * during rx processing to check if packets are from NAC clients. */ @@ -6126,21 +6049,36 @@ fail: /* * dp_peer_authorize() - authorize txrx peer - * @peer_handle: Datapath peer handle + * @soc: soc handle + * @vdev_id: id of dp handle + * @peer_mac: mac of datapath PEER handle * @authorize * */ -static void dp_peer_authorize(struct cdp_peer *peer_handle, uint32_t authorize) +static QDF_STATUS +dp_peer_authorize(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint8_t *peer_mac, uint32_t authorize) { - struct dp_peer *peer = (struct dp_peer *)peer_handle; - struct dp_soc *soc; + QDF_STATUS status = QDF_STATUS_SUCCESS; + struct dp_soc *soc = (struct dp_soc *)soc_hdl; + struct dp_peer *peer = dp_peer_find_hash_find(soc, + peer_mac, + 0, vdev_id); - if (peer) { - soc = peer->vdev->pdev->soc; + if (!peer || peer->delete_in_progress) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, + "%s: Peer is NULL!\n", __func__); + status = QDF_STATUS_E_FAILURE; + } else { qdf_spin_lock_bh(&soc->peer_ref_mutex); peer->authorize = authorize ? 1 : 0; qdf_spin_unlock_bh(&soc->peer_ref_mutex); } + + if (peer) + dp_peer_unref_delete(peer); + + return status; } /* @@ -6603,21 +6541,23 @@ dp_pdev_disable_mcopy_code(struct dp_pdev *pdev) /** * dp_reset_monitor_mode() - Disable monitor mode - * @pdev_handle: Datapath PDEV handle + * @soc_hdl: Datapath soc handle + * @pdev_id: id of datapath PDEV handle * * Return: QDF_STATUS */ -QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle) +QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + struct dp_soc *soc = (struct dp_soc *)soc_hdl; struct htt_rx_ring_tlv_filter htt_tlv_filter; - struct dp_soc *soc = pdev->soc; - uint8_t pdev_id; int mac_id; QDF_STATUS status = QDF_STATUS_SUCCESS; + struct dp_pdev *pdev = + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc, + pdev_id); - pdev_id = pdev->pdev_id; - soc = pdev->soc; + if (!pdev) + return QDF_STATUS_E_FAILURE; qdf_spin_lock_bh(&pdev->mon_lock); @@ -6657,39 +6597,13 @@ QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle) return QDF_STATUS_SUCCESS; } -/** - * dp_set_nac() - set peer_nac - * @soc: soc handle - * @vdev_id: id of dp handle - * @peer_mac: mac of datapath PEER handle - * - * Return: void - */ -static void dp_set_nac(struct cdp_soc_t *soc, uint8_t vdev_id, - uint8_t *peer_mac) -{ - struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc, - peer_mac, 0, vdev_id); - - if (!peer || peer->delete_in_progress) - goto fail; - - peer->nac = 1; - -fail: - if (peer) - dp_peer_unref_delete(peer); - - return; -} - /** * dp_get_tx_pending() - read pending tx * @pdev_handle: Datapath PDEV handle * * Return: outstanding tx */ -static int dp_get_tx_pending(struct cdp_pdev *pdev_handle) +static uint32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle) { struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; @@ -6940,27 +6854,34 @@ static QDF_STATUS dp_vdev_set_monitor_mode(struct cdp_soc_t *soc, /** * dp_pdev_set_advance_monitor_filter() - Set DP PDEV monitor filter - * @pdev_handle: Datapath PDEV handle + * @soc: soc handle + * @pdev_id: id of Datapath PDEV handle * @filter_val: Flag to select Filter for monitor mode * Return: 0 on success, not 0 on failure */ static QDF_STATUS -dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, +dp_pdev_set_advance_monitor_filter(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, struct cdp_monitor_filter *filter_val) { /* Many monitor VAPs can exists in a system but only one can be up at * anytime */ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - struct dp_vdev *vdev = pdev->monitor_vdev; + struct dp_soc *soc = (struct dp_soc *)soc_hdl; + struct dp_vdev *vdev; struct htt_rx_ring_tlv_filter htt_tlv_filter; - struct dp_soc *soc; - uint8_t pdev_id; int mac_id; QDF_STATUS status = QDF_STATUS_SUCCESS; + struct dp_pdev *pdev = + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc, + pdev_id); - pdev_id = pdev->pdev_id; - soc = pdev->soc; + if (!pdev) + return QDF_STATUS_E_FAILURE; + + vdev = pdev->monitor_vdev; + + if (!vdev) + return QDF_STATUS_E_FAILURE; QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, "pdev=%pK, pdev_id=%d, soc=%pK vdev=%pK", @@ -7107,116 +7028,47 @@ dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, return QDF_STATUS_SUCCESS; } -/** - * dp_pdev_set_monitor_channel() - set monitor channel num in pdev - * @pdev_handle: Datapath PDEV handle - * - * Return: None - */ -static -void dp_pdev_set_monitor_channel(struct cdp_pdev *pdev_handle, int chan_num) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - pdev->mon_chan_num = chan_num; -} - -/** - * dp_pdev_set_monitor_frequency() - set monitor frequency in pdev - * @pdev_handle: Datapath PDEV handle - * @chan_freq: Channel frequency - * - * Return: None - */ -static -void dp_pdev_set_monitor_frequency(struct cdp_pdev *pdev_handle, qdf_freq_t chan_freq) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - pdev->mon_chan_freq = chan_freq; -} - /** * dp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture - * @pdev_handle: Datapath PDEV handle + * @cdp_soc : data path soc handle + * @pdev_id : pdev_id * @nbuf: Management frame buffer */ -static void -dp_deliver_tx_mgmt(struct cdp_pdev *pdev_handle, qdf_nbuf_t nbuf) +static QDF_STATUS +dp_deliver_tx_mgmt(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + struct dp_pdev *pdev = + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)cdp_soc, + pdev_id); + + if (!pdev) + return QDF_STATUS_E_FAILURE; dp_deliver_mgmt_frm(pdev, nbuf); + + return QDF_STATUS_SUCCESS; } /** * dp_set_bsscolor() - sets bsscolor for tx capture - * @pdev_handle: Datapath PDEV handle + * @pdev: Datapath PDEV handle * @bsscolor: new bsscolor */ static void -dp_mon_set_bsscolor(struct cdp_pdev *pdev_handle, uint8_t bsscolor) +dp_mon_set_bsscolor(struct dp_pdev *pdev, uint8_t bsscolor) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - pdev->rx_mon_recv_status.bsscolor = bsscolor; } /** - * dp_get_pdev_id_frm_pdev() - get pdev_id - * @pdev_handle: Datapath PDEV handle - * - * Return: pdev_id - */ -static -uint8_t dp_get_pdev_id_frm_pdev(struct cdp_pdev *pdev_handle) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - return pdev->pdev_id; -} - -/** - * dp_get_delay_stats_flag() - get delay stats flag - * @pdev_handle: Datapath PDEV handle - * - * Return: 0 if flag is disabled else 1 - */ -static -bool dp_get_delay_stats_flag(struct cdp_pdev *pdev_handle) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - return pdev->delay_stats_flag; -} - -/** - * dp_pdev_set_chan_noise_floor() - set channel noise floor - * @pdev_handle: Datapath PDEV handle - * @chan_noise_floor: Channel Noise Floor - * - * Return: void - */ -static -void dp_pdev_set_chan_noise_floor(struct cdp_pdev *pdev_handle, - int16_t chan_noise_floor) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - pdev->chan_noise_floor = chan_noise_floor; -} - -/** - * dp_vdev_get_filter_ucast_data() - get DP VDEV monitor ucast filter - * @vdev_handle: Datapath VDEV handle + * dp_pdev_get_filter_ucast_data() - get DP PDEV monitor ucast filter + * @soc : data path soc handle + * @pdev_id : pdev_id * Return: true on ucast filter flag set */ -static bool dp_vdev_get_filter_ucast_data(struct cdp_vdev *vdev_handle) +static bool dp_pdev_get_filter_ucast_data(struct cdp_pdev *pdev_handle) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - struct dp_pdev *pdev; - - pdev = vdev->pdev; + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; if ((pdev->fp_data_filter & FILTER_DATA_UCAST) || (pdev->mo_data_filter & FILTER_DATA_UCAST)) @@ -7226,16 +7078,13 @@ static bool dp_vdev_get_filter_ucast_data(struct cdp_vdev *vdev_handle) } /** - * dp_vdev_get_filter_mcast_data() - get DP VDEV monitor mcast filter - * @vdev_handle: Datapath VDEV handle + * dp_pdev_get_filter_mcast_data() - get DP PDEV monitor mcast filter + * @pdev_handle: Datapath PDEV handle * Return: true on mcast filter flag set */ -static bool dp_vdev_get_filter_mcast_data(struct cdp_vdev *vdev_handle) +static bool dp_pdev_get_filter_mcast_data(struct cdp_pdev *pdev_handle) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - struct dp_pdev *pdev; - - pdev = vdev->pdev; + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; if ((pdev->fp_data_filter & FILTER_DATA_MCAST) || (pdev->mo_data_filter & FILTER_DATA_MCAST)) @@ -7245,16 +7094,13 @@ static bool dp_vdev_get_filter_mcast_data(struct cdp_vdev *vdev_handle) } /** - * dp_vdev_get_filter_non_data() - get DP VDEV monitor non_data filter - * @vdev_handle: Datapath VDEV handle + * dp_pdev_get_filter_non_data() - get DP PDEV monitor non_data filter + * @pdev_handle: Datapath PDEV handle * Return: true on non data filter flag set */ -static bool dp_vdev_get_filter_non_data(struct cdp_vdev *vdev_handle) +static bool dp_pdev_get_filter_non_data(struct cdp_pdev *pdev_handle) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - struct dp_pdev *pdev; - - pdev = vdev->pdev; + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; if ((pdev->fp_mgmt_filter & FILTER_MGMT_ALL) || (pdev->mo_mgmt_filter & FILTER_MGMT_ALL)) { @@ -7970,13 +7816,13 @@ dp_pdev_tid_stats_osif_drop(struct dp_pdev *pdev, uint32_t val) * Return: 0 for success. nonzero for failure. */ static QDF_STATUS -dp_config_debug_sniffer(struct cdp_pdev *pdev_handle, int val) +dp_config_debug_sniffer(struct dp_pdev *pdev, int val) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; QDF_STATUS status = QDF_STATUS_SUCCESS; if (pdev->mcopy_mode) - dp_reset_monitor_mode(pdev_handle); + dp_reset_monitor_mode((struct cdp_soc_t *)(pdev->soc), + pdev->pdev_id); switch (val) { case 0: @@ -8215,43 +8061,201 @@ dp_get_htt_stats(struct cdp_soc_t *soc, uint8_t pdev_id, void *data, return QDF_STATUS_SUCCESS; } +/** + * dp_set_pdev_tidmap_prty_wifi3(): update tidmap priority in pdev + * @pdev: DP_PDEV handle + * @prio: tidmap priority value passed by the user + * + * Return: QDF_STATUS_SUCCESS on success + */ +static QDF_STATUS dp_set_pdev_tidmap_prty_wifi3(struct dp_pdev *pdev, + uint8_t prio) +{ + struct dp_soc *soc = pdev->soc; + + soc->tidmap_prty = prio; + + hal_tx_set_tidmap_prty(soc->hal_soc, prio); + return QDF_STATUS_SUCCESS; +} + /* - * dp_set_pdev_param: function to set parameters in pdev - * @pdev_handle: DP pdev handle + * dp_get_peer_param: function to get parameters in peer + * @cdp_soc: DP soc handle + * @vdev_id: id of vdev handle + * @peer_mac: peer mac address + * @param: parameter type to be set + * @val : address of buffer + * + * Return: val + */ +static QDF_STATUS dp_get_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, + uint8_t *peer_mac, + enum cdp_peer_param_type param, + cdp_config_param_type *val) +{ + return QDF_STATUS_SUCCESS; +} + +/* + * dp_set_peer_param: function to set parameters in peer + * @cdp_soc: DP soc handle + * @vdev_id: id of vdev handle + * @peer_mac: peer mac address * @param: parameter type to be set * @val: value of parameter to be set * * Return: 0 for success. nonzero for failure. */ -static QDF_STATUS dp_set_pdev_param(struct cdp_pdev *pdev_handle, - enum cdp_pdev_param_type param, - uint32_t val) +static QDF_STATUS dp_set_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, + uint8_t *peer_mac, + enum cdp_peer_param_type param, + cdp_config_param_type val) { - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)cdp_soc, + peer_mac, 0, vdev_id); + + if (!peer || peer->delete_in_progress) + goto fail; + switch (param) { + case CDP_CONFIG_NAWDS: + peer->nawds_enabled = val.cdp_peer_param_nawds; + break; + case CDP_CONFIG_NAC: + peer->nac = !!(val.cdp_peer_param_nac); + break; + default: + break; + } + +fail: + if (peer) + dp_peer_unref_delete(peer); + + return QDF_STATUS_SUCCESS; +} + +/* + * dp_get_pdev_param: function to get parameters from pdev + * @cdp_soc: DP soc handle + * @pdev_id: id of pdev handle + * @param: parameter type to be get + * @value : buffer for value + * + * Return: status + */ +static QDF_STATUS dp_get_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, + enum cdp_pdev_param_type param, + cdp_config_param_type *val) +{ + struct cdp_pdev *pdev = (struct cdp_pdev *) + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)cdp_soc, + pdev_id); + if (!pdev) + return QDF_STATUS_E_FAILURE; + + switch (param) { + case CDP_CONFIG_VOW: + val->cdp_pdev_param_cfg_vow = + ((struct dp_pdev *)pdev)->delay_stats_flag; + break; + case CDP_TX_PENDING: + val->cdp_pdev_param_tx_pending = dp_get_tx_pending(pdev); + break; + case CDP_FILTER_MCAST_DATA: + val->cdp_pdev_param_fltr_mcast = + dp_pdev_get_filter_mcast_data(pdev); + break; + case CDP_FILTER_NO_DATA: + val->cdp_pdev_param_fltr_none = + dp_pdev_get_filter_non_data(pdev); + break; + case CDP_FILTER_UCAST_DATA: + val->cdp_pdev_param_fltr_ucast = + dp_pdev_get_filter_ucast_data(pdev); + break; + default: + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + +/* + * dp_set_pdev_param: function to set parameters in pdev + * @cdp_soc: DP soc handle + * @pdev_id: id of pdev handle + * @param: parameter type to be set + * @val: value of parameter to be set + * + * Return: 0 for success. nonzero for failure. + */ +static QDF_STATUS dp_set_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, + enum cdp_pdev_param_type param, + cdp_config_param_type val) +{ + struct dp_pdev *pdev = + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)cdp_soc, + pdev_id); + if (!pdev) + return QDF_STATUS_E_FAILURE; + + switch (param) { + case CDP_CONFIG_TX_CAPTURE: + return dp_config_debug_sniffer(pdev, + val.cdp_pdev_param_tx_capture); case CDP_CONFIG_DEBUG_SNIFFER: - return dp_config_debug_sniffer(pdev_handle, val); + return dp_config_debug_sniffer(pdev, + val.cdp_pdev_param_dbg_snf); case CDP_CONFIG_BPR_ENABLE: - return dp_set_bpr_enable(pdev, val); + return dp_set_bpr_enable(pdev, val.cdp_pdev_param_bpr_enable); case CDP_CONFIG_PRIMARY_RADIO: - pdev->is_primary = val; + pdev->is_primary = val.cdp_pdev_param_primary_radio; break; case CDP_CONFIG_CAPTURE_LATENCY: - if (val == 1) - pdev->latency_capture_enable = true; - else - pdev->latency_capture_enable = false; + pdev->latency_capture_enable = val.cdp_pdev_param_cptr_latcy; break; case CDP_INGRESS_STATS: - dp_pdev_tid_stats_ingress_inc(pdev, val); + dp_pdev_tid_stats_ingress_inc(pdev, + val.cdp_pdev_param_ingrs_stats); break; case CDP_OSIF_DROP: - dp_pdev_tid_stats_osif_drop(pdev, val); + dp_pdev_tid_stats_osif_drop(pdev, + val.cdp_pdev_param_osif_drop); break; case CDP_CONFIG_ENH_RX_CAPTURE: - return dp_config_enh_rx_capture(pdev_handle, val); - case CDP_CONFIG_TX_CAPTURE: - return dp_config_enh_tx_capture(pdev_handle, val); + return dp_config_enh_rx_capture(pdev, + val.cdp_pdev_param_en_rx_cap); + case CDP_CONFIG_ENH_TX_CAPTURE: + return dp_config_enh_tx_capture(pdev, + val.cdp_pdev_param_en_tx_cap); + case CDP_CONFIG_HMMC_TID_OVERRIDE: + pdev->hmmc_tid_override_en = val.cdp_pdev_param_hmmc_tid_ovrd; + break; + case CDP_CONFIG_HMMC_TID_VALUE: + pdev->hmmc_tid = val.cdp_pdev_param_hmmc_tid; + break; + case CDP_CHAN_NOISE_FLOOR: + pdev->chan_noise_floor = val.cdp_pdev_param_chn_noise_flr; + break; + case CDP_TIDMAP_PRTY: + dp_set_pdev_tidmap_prty_wifi3(pdev, + val.cdp_pdev_param_tidmap_prty); + break; + case CDP_FILTER_NEIGH_PEERS: + dp_set_filter_neigh_peers(pdev, + val.cdp_pdev_param_fltr_neigh_peers); + break; + case CDP_MONITOR_CHANNEL: + pdev->mon_chan_num = val.cdp_pdev_param_monitor_chan; + break; + case CDP_MONITOR_FREQUENCY: + pdev->mon_chan_freq = val.cdp_pdev_param_mon_freq; + break; + case CDP_CONFIG_BSS_COLOR: + dp_mon_set_bsscolor(pdev, val.cdp_pdev_param_bss_color); + break; default: return QDF_STATUS_E_INVAL; } @@ -8260,141 +8264,251 @@ static QDF_STATUS dp_set_pdev_param(struct cdp_pdev *pdev_handle, /* * dp_calculate_delay_stats: function to get rx delay stats - * @vdev_handle: DP vdev handle + * @cdp_soc: DP soc handle + * @vdev_id: id of DP vdev handle * @nbuf: skb * - * Return: void + * Return: QDF_STATUS */ -static void dp_calculate_delay_stats(struct cdp_vdev *vdev_handle, - qdf_nbuf_t nbuf) +static QDF_STATUS +dp_calculate_delay_stats(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, + qdf_nbuf_t nbuf) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; + struct dp_vdev *vdev = + dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)cdp_soc, + vdev_id); + if (vdev) { + dp_rx_compute_delay(vdev, nbuf); + return QDF_STATUS_E_FAILURE; + } - dp_rx_compute_delay(vdev, nbuf); + return QDF_STATUS_SUCCESS; } /* * dp_get_vdev_param: function to get parameters from vdev + * @cdp_soc : DP soc handle + * @vdev_id: id of DP vdev handle * @param: parameter type to get value + * @val: buffer address * - * return: void + * return: status */ -static uint32_t dp_get_vdev_param(struct cdp_vdev *vdev_handle, - enum cdp_vdev_param_type param) +static QDF_STATUS dp_get_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, + enum cdp_vdev_param_type param, + cdp_config_param_type *val) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - uint32_t val; + struct dp_vdev *vdev = + dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)cdp_soc, + vdev_id); + if (!vdev) + return QDF_STATUS_E_FAILURE; switch (param) { case CDP_ENABLE_WDS: - val = vdev->wds_enabled; + val->cdp_vdev_param_wds = vdev->wds_enabled; break; case CDP_ENABLE_MEC: - val = vdev->mec_enabled; + val->cdp_vdev_param_mec = vdev->mec_enabled; break; case CDP_ENABLE_DA_WAR: - val = vdev->pdev->soc->da_war_enabled; + val->cdp_vdev_param_da_war = vdev->pdev->soc->da_war_enabled; break; default: QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "param value %d is wrong\n", param); - val = -1; - break; + return QDF_STATUS_E_FAILURE; } - return val; + return QDF_STATUS_SUCCESS; } /* * dp_set_vdev_param: function to set parameters in vdev - * @param: parameter type to be set - * @val: value of parameter to be set + * @cdp_soc : DP soc handle + * @vdev_id: id of DP vdev handle + * @param: parameter type to get value + * @val: value * - * return: void + * return: QDF_STATUS */ -static void dp_set_vdev_param(struct cdp_vdev *vdev_handle, - enum cdp_vdev_param_type param, uint32_t val) +static QDF_STATUS +dp_set_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, + enum cdp_vdev_param_type param, cdp_config_param_type val) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; + struct dp_soc *dsoc = (struct dp_soc *)cdp_soc; + struct dp_vdev *vdev = + dp_get_vdev_from_soc_vdev_id_wifi3(dsoc, vdev_id); + uint32_t var = 0; + + if (!vdev) + return QDF_STATUS_E_FAILURE; + switch (param) { case CDP_ENABLE_WDS: QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "wds_enable %d for vdev(%pK) id(%d)\n", - val, vdev, vdev->vdev_id); - vdev->wds_enabled = val; + val.cdp_vdev_param_wds, vdev, vdev->vdev_id); + vdev->wds_enabled = val.cdp_vdev_param_wds; break; case CDP_ENABLE_MEC: QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "mec_enable %d for vdev(%pK) id(%d)\n", - val, vdev, vdev->vdev_id); - vdev->mec_enabled = val; + val.cdp_vdev_param_mec, vdev, vdev->vdev_id); + vdev->mec_enabled = val.cdp_vdev_param_mec; break; case CDP_ENABLE_DA_WAR: QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "da_war_enable %d for vdev(%pK) id(%d)\n", - val, vdev, vdev->vdev_id); - vdev->pdev->soc->da_war_enabled = val; + val.cdp_vdev_param_da_war, vdev, vdev->vdev_id); + vdev->pdev->soc->da_war_enabled = val.cdp_vdev_param_da_war; dp_wds_flush_ast_table_wifi3(((struct cdp_soc_t *) vdev->pdev->soc)); break; case CDP_ENABLE_NAWDS: - vdev->nawds_enabled = val; + vdev->nawds_enabled = val.cdp_vdev_param_nawds; break; case CDP_ENABLE_MCAST_EN: - vdev->mcast_enhancement_en = val; + vdev->mcast_enhancement_en = val.cdp_vdev_param_mcast_en; break; case CDP_ENABLE_PROXYSTA: - vdev->proxysta_vdev = val; + vdev->proxysta_vdev = val.cdp_vdev_param_proxysta; break; case CDP_UPDATE_TDLS_FLAGS: - vdev->tdls_link_connected = val; + vdev->tdls_link_connected = val.cdp_vdev_param_tdls_flags; break; case CDP_CFG_WDS_AGING_TIMER: - if (val == 0) + var = val.cdp_vdev_param_aging_tmr; + if (!var) qdf_timer_stop(&vdev->pdev->soc->ast_aging_timer); - else if (val != vdev->wds_aging_timer_val) - qdf_timer_mod(&vdev->pdev->soc->ast_aging_timer, val); + else if (var != vdev->wds_aging_timer_val) + qdf_timer_mod(&vdev->pdev->soc->ast_aging_timer, var); - vdev->wds_aging_timer_val = val; + vdev->wds_aging_timer_val = var; break; case CDP_ENABLE_AP_BRIDGE: if (wlan_op_mode_sta != vdev->opmode) - vdev->ap_bridge_enabled = val; + vdev->ap_bridge_enabled = val.cdp_vdev_param_ap_brdg_en; else vdev->ap_bridge_enabled = false; break; case CDP_ENABLE_CIPHER: - vdev->sec_type = val; + vdev->sec_type = val.cdp_vdev_param_cipher_en; break; case CDP_ENABLE_QWRAP_ISOLATION: - vdev->isolation_vdev = val; + vdev->isolation_vdev = val.cdp_vdev_param_qwrap_isolation; break; case CDP_UPDATE_MULTIPASS: - vdev->multipass_en = val; + vdev->multipass_en = val.cdp_vdev_param_update_multipass; break; + case CDP_TX_ENCAP_TYPE: + vdev->tx_encap_type = val.cdp_vdev_param_tx_encap; + break; + case CDP_RX_DECAP_TYPE: + vdev->rx_decap_type = val.cdp_vdev_param_rx_decap; + break; + case CDP_TID_VDEV_PRTY: + vdev->tidmap_prty = val.cdp_vdev_param_tidmap_prty; + break; + case CDP_TIDMAP_TBL_ID: + vdev->tidmap_tbl_id = val.cdp_vdev_param_tidmap_tbl_id; + break; +#ifdef MESH_MODE_SUPPORT + case CDP_MESH_RX_FILTER: + dp_peer_set_mesh_rx_filter((struct cdp_vdev *)vdev, + val.cdp_vdev_param_mesh_rx_filter); + break; + case CDP_MESH_MODE: + dp_peer_set_mesh_mode((struct cdp_vdev *)vdev, + val.cdp_vdev_param_mesh_mode); + break; +#endif default: break; } - dp_tx_vdev_update_search_flags(vdev); + dp_tx_vdev_update_search_flags((struct dp_vdev *)vdev); + + return QDF_STATUS_SUCCESS; } -/** - * dp_peer_set_nawds: set nawds bit in peer - * @peer_handle: pointer to peer - * @value: enable/disable nawds +/* + * dp_set_psoc_param: function to set parameters in psoc + * @cdp_soc : DP soc handle + * @param: parameter type to be set + * @val: value of parameter to be set * - * return: void + * return: QDF_STATUS */ -static void dp_peer_set_nawds(struct cdp_peer *peer_handle, uint8_t value) +static QDF_STATUS +dp_set_psoc_param(struct cdp_soc_t *cdp_soc, + enum cdp_psoc_param_type param, cdp_config_param_type val) { - struct dp_peer *peer = (struct dp_peer *)peer_handle; - peer->nawds_enabled = value; + struct dp_soc *soc = (struct dp_soc *)cdp_soc; + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = soc->wlan_cfg_ctx; + + switch (param) { + case CDP_ENABLE_RATE_STATS: + soc->wlanstats_enabled = val.cdp_psoc_param_en_rate_stats; + break; + case CDP_SET_NSS_CFG: + wlan_cfg_set_dp_soc_nss_cfg(wlan_cfg_ctx, + val.cdp_psoc_param_en_nss_cfg); + /* + * TODO: masked out based on the per offloaded radio + */ + switch (val.cdp_psoc_param_en_nss_cfg) { + case dp_nss_cfg_default: + break; + case dp_nss_cfg_first_radio: + /* + * This configuration is valid for single band radio which + * is also NSS offload. + */ + case dp_nss_cfg_dbdc: + case dp_nss_cfg_dbtc: + wlan_cfg_set_num_tx_desc_pool(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_ext_desc_pool(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_desc(wlan_cfg_ctx, 0); + wlan_cfg_set_num_tx_ext_desc(wlan_cfg_ctx, 0); + break; + default: + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + "Invalid offload config %d", + val.cdp_psoc_param_en_nss_cfg); + } + + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, + FL("nss-wifi<0> nss config is enabled")); + break; + + default: + break; + } + + return QDF_STATUS_SUCCESS; +} + +/* + * dp_get_psoc_param: function to get parameters in soc + * @cdp_soc : DP soc handle + * @param: parameter type to be set + * @val: address of buffer + * + * return: status + */ +static QDF_STATUS dp_get_psoc_param(struct cdp_soc_t *cdp_soc, + enum cdp_psoc_param_type param, + cdp_config_param_type *val) +{ + return QDF_STATUS_SUCCESS; } /** * dp_peer_update_pkt_capture_params: Set Rx & Tx Capture flags for a peer + * @soc: DP_SOC handle + * @pdev_id: id of DP_PDEV handle * @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode * @is_tx_pkt_cap_enable: enable/disable Tx packet capture in monitor mode * @peer_mac: MAC address for which the above need to be enabled/disabled @@ -8402,25 +8516,30 @@ static void dp_peer_set_nawds(struct cdp_peer *peer_handle, uint8_t value) * Return: Success if Rx & Tx capture is enabled for peer, false otherwise */ QDF_STATUS -dp_peer_update_pkt_capture_params(struct cdp_pdev *pdev, +dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc, + uint8_t pdev_id, bool is_rx_pkt_cap_enable, bool is_tx_pkt_cap_enable, uint8_t *peer_mac) { struct dp_peer *peer; + struct dp_pdev *pdev = + dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc, + pdev_id); - peer = (struct dp_peer *)dp_find_peer_by_addr(pdev, - peer_mac); + if (!pdev) + return QDF_STATUS_E_FAILURE; + peer = (struct dp_peer *)dp_find_peer_by_addr((struct cdp_pdev *)pdev, + peer_mac); if (!peer) { dp_err("Invalid Peer"); return QDF_STATUS_E_FAILURE; } - dp_peer_set_rx_capture_enabled((struct cdp_peer *)peer, - is_rx_pkt_cap_enable); - dp_peer_set_tx_capture_enabled((struct cdp_peer *)peer, - is_tx_pkt_cap_enable); + dp_peer_set_rx_capture_enabled(peer, is_rx_pkt_cap_enable); + dp_peer_set_tx_capture_enabled(peer, is_tx_pkt_cap_enable); + return QDF_STATUS_SUCCESS; } @@ -8751,36 +8870,6 @@ dp_set_pdev_dscp_tid_map_wifi3(struct cdp_soc_t *soc_handle, return QDF_STATUS_SUCCESS; } -/** - * dp_hmmc_tid_override_en_wifi3(): Function to enable hmmc tid override. - * @pdev_handle: pdev handle - * @val: hmmc-dscp flag value - * - * Return: void - */ -static void dp_hmmc_tid_override_en_wifi3(struct cdp_pdev *pdev_handle, - bool val) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - pdev->hmmc_tid_override_en = val; -} - -/** - * dp_set_hmmc_tid_val_wifi3(): Function to set hmmc tid value. - * @pdev_handle: pdev handle - * @tid: tid value - * - * Return: void - */ -static void dp_set_hmmc_tid_val_wifi3(struct cdp_pdev *pdev_handle, - uint8_t tid) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - - pdev->hmmc_tid = tid; -} - /** * dp_fw_stats_process(): Process TxRX FW stats request * @vdev_handle: DP VDEV handle @@ -9385,18 +9474,29 @@ fail: #ifdef ATH_SUPPORT_NAC_RSSI /** * dp_vdev_get_neighbour_rssi(): Store RSSI for configured NAC - * @vdev_hdl: DP vdev handle + * @soc_hdl: DP soc handle + * @vdev_id: id of DP vdev handle + * @mac_addr: neighbour mac * @rssi: rssi value * * Return: 0 for success. nonzero for failure. */ -static QDF_STATUS dp_vdev_get_neighbour_rssi(struct cdp_vdev *vdev_hdl, - char *mac_addr, uint8_t *rssi) { - struct dp_vdev *vdev = (struct dp_vdev *)vdev_hdl; - struct dp_pdev *pdev = vdev->pdev; +static QDF_STATUS dp_vdev_get_neighbour_rssi(struct cdp_soc_t *soc, + uint8_t vdev_id, + char *mac_addr, + uint8_t *rssi) +{ + struct dp_vdev *vdev = + dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc, + vdev_id); + struct dp_pdev *pdev; struct dp_neighbour_peer *peer = NULL; QDF_STATUS status = QDF_STATUS_E_FAILURE; + if (!vdev) + return status; + + pdev = vdev->pdev; *rssi = 0; qdf_spin_lock_bh(&pdev->neighbour_peer_mutex); TAILQ_FOREACH(peer, &pdev->neighbour_peers_list, @@ -9585,16 +9685,6 @@ static QDF_STATUS dp_peer_map_attach_wifi3(struct cdp_soc_t *soc_hdl, return QDF_STATUS_SUCCESS; } -static QDF_STATUS dp_set_rate_stats_cap(struct cdp_soc_t *soc_hdl, - uint8_t val) -{ - struct dp_soc *soc = (struct dp_soc *)soc_hdl; - - soc->wlanstats_enabled = val; - - return QDF_STATUS_SUCCESS; -} - static void dp_soc_set_rate_stats_ctx(struct cdp_soc_t *soc_handle, void *stats_ctx) { @@ -9813,25 +9903,6 @@ static QDF_STATUS dp_set_pdev_pcp_tid_map_wifi3(ol_txrx_soc_handle psoc, return QDF_STATUS_SUCCESS; } -/** - * dp_set_pdev_tidmap_prty_wifi3(): update tidmap priority in pdev - * @vdev: DP_PDEV handle - * @prio: tidmap priority value passed by the user - * - * Return: QDF_STATUS_SUCCESS on success - */ -static QDF_STATUS dp_set_pdev_tidmap_prty_wifi3(struct cdp_pdev *pdev_handle, - uint8_t prio) -{ - struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; - struct dp_soc *soc = pdev->soc; - - soc->tidmap_prty = prio; - - hal_tx_set_tidmap_prty(soc->hal_soc, prio); - return QDF_STATUS_SUCCESS; -} - /** * dp_set_vdev_pcp_tid_map_wifi3(): update pcp tid map in vdev * @soc: DP soc handle @@ -9857,40 +9928,6 @@ static QDF_STATUS dp_set_vdev_pcp_tid_map_wifi3(struct cdp_soc_t *soc, return QDF_STATUS_SUCCESS; } -/** - * dp_set_vdev_tidmap_tbl_id_wifi3(): update tidmapi tbl id in vdev - * @vdev: DP_VDEV handle - * @mapid: map_id value passed by the user - * - * Return: QDF_STATUS_SUCCESS on success - */ -static QDF_STATUS dp_set_vdev_tidmap_tbl_id_wifi3(struct cdp_vdev *vdev_handle, - uint8_t mapid) -{ - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - - vdev->tidmap_tbl_id = mapid; - - return QDF_STATUS_SUCCESS; -} - -/** - * dp_set_vdev_tidmap_prty_wifi3(): update tidmap priority in vdev - * @vdev: DP_VDEV handle - * @prio: tidmap priority value passed by the user - * - * Return: QDF_STATUS_SUCCESS on success - */ -static QDF_STATUS dp_set_vdev_tidmap_prty_wifi3(struct cdp_vdev *vdev_handle, - uint8_t prio) -{ - struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle; - - vdev->tidmap_prty = prio; - - return QDF_STATUS_SUCCESS; -} - static struct cdp_cmn_ops dp_ops_cmn = { .txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3, @@ -9934,21 +9971,11 @@ static struct cdp_cmn_ops dp_ops_cmn = { /* TODO: get API's for dscp-tid need to be added*/ .set_vdev_dscp_tid_map = dp_set_vdev_dscp_tid_map_wifi3, .set_pdev_dscp_tid_map = dp_set_pdev_dscp_tid_map_wifi3, - .hmmc_tid_override_en = dp_hmmc_tid_override_en_wifi3, - .set_hmmc_tid_val = dp_set_hmmc_tid_val_wifi3, .txrx_get_total_per = dp_get_total_per, .txrx_stats_request = dp_txrx_stats_request, .txrx_set_monitor_mode = dp_vdev_set_monitor_mode, - .txrx_get_pdev_id_frm_pdev = dp_get_pdev_id_frm_pdev, - .txrx_get_vow_config_frm_pdev = dp_get_delay_stats_flag, - .txrx_pdev_set_chan_noise_floor = dp_pdev_set_chan_noise_floor, - .txrx_set_nac = dp_set_nac, - .txrx_get_tx_pending = dp_get_tx_pending, - .txrx_set_pdev_tx_capture = dp_config_debug_sniffer, .txrx_get_peer_mac_from_peer_id = dp_get_peer_mac_from_peer_id, .display_stats = dp_txrx_dump_stats, - .txrx_soc_set_nss_cfg = dp_soc_set_nss_cfg_wifi3, - .txrx_soc_get_nss_cfg = dp_soc_get_nss_cfg_wifi3, .txrx_intr_attach = dp_soc_interrupt_attach_wrapper, .txrx_intr_detach = dp_soc_interrupt_detach, .set_pn_check = dp_set_pn_check_wifi3, @@ -9981,42 +10008,35 @@ static struct cdp_cmn_ops dp_ops_cmn = { .txrx_flush_rate_stats_request = dp_flush_rate_stats_req, .set_pdev_pcp_tid_map = dp_set_pdev_pcp_tid_map_wifi3, - .set_pdev_tidmap_prty = dp_set_pdev_tidmap_prty_wifi3, .set_vdev_pcp_tid_map = dp_set_vdev_pcp_tid_map_wifi3, - .set_vdev_tidmap_prty = dp_set_vdev_tidmap_prty_wifi3, - .set_vdev_tidmap_tbl_id = dp_set_vdev_tidmap_tbl_id_wifi3, .txrx_cp_peer_del_response = dp_cp_peer_del_resp_handler, #ifdef QCA_MULTIPASS_SUPPORT .set_vlan_groupkey = dp_set_vlan_groupkey, #endif .get_peer_mac_list = dp_get_peer_mac_list, - .tx_send_exc = __dp_tx_send_exception, + .tx_send_exc = dp_tx_send_exception, }; static struct cdp_ctrl_ops dp_ops_ctrl = { .txrx_peer_authorize = dp_peer_authorize, - .txrx_set_vdev_rx_decap_type = dp_set_vdev_rx_decap_type, - .txrx_set_tx_encap_type = dp_set_vdev_tx_encap_type, -#ifdef MESH_MODE_SUPPORT - .txrx_set_mesh_mode = dp_peer_set_mesh_mode, - .txrx_set_mesh_rx_filter = dp_peer_set_mesh_rx_filter, -#endif .txrx_set_vdev_param = dp_set_vdev_param, - .txrx_peer_set_nawds = dp_peer_set_nawds, + .txrx_set_psoc_param = dp_set_psoc_param, + .txrx_get_psoc_param = dp_get_psoc_param, .txrx_set_pdev_reo_dest = dp_set_pdev_reo_dest, .txrx_get_pdev_reo_dest = dp_get_pdev_reo_dest, - .txrx_set_filter_neighbour_peers = dp_set_filter_neighbour_peers, .txrx_update_filter_neighbour_peers = dp_update_filter_neighbour_peers, .txrx_get_sec_type = dp_get_sec_type, - /* TODO: Add other functions */ .txrx_wdi_event_sub = dp_wdi_event_sub, .txrx_wdi_event_unsub = dp_wdi_event_unsub, #ifdef WDI_EVENT_ENABLE .txrx_get_pldev = dp_get_pldev, #endif .txrx_set_pdev_param = dp_set_pdev_param, + .txrx_get_pdev_param = dp_get_pdev_param, + .txrx_set_peer_param = dp_set_peer_param, + .txrx_get_peer_param = dp_get_peer_param, #ifdef ATH_SUPPORT_NAC_RSSI .txrx_vdev_config_for_nac_rssi = dp_config_for_nac_rssi, .txrx_vdev_get_neighbour_rssi = dp_vdev_get_neighbour_rssi, @@ -10054,19 +10074,10 @@ static struct cdp_me_ops dp_ops_me = { }; static struct cdp_mon_ops dp_ops_mon = { - .txrx_monitor_set_filter_ucast_data = NULL, - .txrx_monitor_set_filter_mcast_data = NULL, - .txrx_monitor_set_filter_non_data = NULL, - .txrx_monitor_get_filter_ucast_data = dp_vdev_get_filter_ucast_data, - .txrx_monitor_get_filter_mcast_data = dp_vdev_get_filter_mcast_data, - .txrx_monitor_get_filter_non_data = dp_vdev_get_filter_non_data, .txrx_reset_monitor_mode = dp_reset_monitor_mode, /* Added support for HK advance filter */ .txrx_set_advance_monitor_filter = dp_pdev_set_advance_monitor_filter, - .txrx_monitor_record_channel = dp_pdev_set_monitor_channel, - .txrx_monitor_record_frequency = dp_pdev_set_monitor_frequency, .txrx_deliver_tx_mgmt = dp_deliver_tx_mgmt, - .txrx_set_bsscolor = dp_mon_set_bsscolor, }; static struct cdp_host_stats_ops dp_ops_host_stats = { @@ -10081,7 +10092,6 @@ static struct cdp_host_stats_ops dp_ops_host_stats = { .txrx_reset_peer_stats = dp_txrx_reset_peer_stats, .txrx_get_pdev_stats = dp_txrx_get_pdev_stats, .txrx_get_ratekbps = dp_txrx_get_ratekbps, - .configure_rate_stats = dp_set_rate_stats_cap, .txrx_update_vdev_stats = dp_txrx_update_vdev_host_stats, /* TODO */ }; @@ -10750,8 +10760,8 @@ dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, * Return: DP SOC handle on success, NULL on failure */ static struct dp_soc * -dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_handle, - qdf_device_t qdf_osdev, +dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, + HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id) { int int_ctx; @@ -10810,12 +10820,11 @@ fail0: * * Return: DP SOC handle on success, NULL on failure */ -void *dp_soc_init(struct dp_soc *dpsoc, HTC_HANDLE htc_handle, +void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle, struct hif_opaque_softc *hif_handle) { int target_type; - struct dp_soc *soc = (struct dp_soc *)dpsoc; - struct htt_soc *htt_soc = soc->htt_handle; + struct htt_soc *htt_soc = (struct htt_soc *)soc->htt_handle; htt_set_htc_handle(htt_soc, htc_handle); soc->hif_handle = hif_handle; @@ -10937,7 +10946,7 @@ void *dp_soc_init(struct dp_soc *dpsoc, HTC_HANDLE htc_handle, /** * dp_soc_init_wifi3() - Initialize txrx SOC - * @dp_soc: Opaque DP SOC handle + * @soc: Opaque DP SOC handle * @ctrl_psoc: Opaque SOC handle from control plane(Unused) * @hif_handle: Opaque HIF handle * @htc_handle: Opaque HTC handle diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 86e3d79a26..9a1556b7e1 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -3427,39 +3427,6 @@ void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer) } #endif -/** - * dp_get_peer_mac_addr_frm_id(): get mac address of the peer - * @soc_handle: DP SOC handle - * @peer_id:peer_id of the peer - * - * return: vdev_id of the vap - */ -uint8_t dp_get_peer_mac_addr_frm_id(struct cdp_soc_t *soc_handle, - uint16_t peer_id, uint8_t *peer_mac) -{ - struct dp_soc *soc = (struct dp_soc *)soc_handle; - struct dp_peer *peer; - uint8_t vdev_id; - - peer = dp_peer_find_by_id(soc, peer_id); - - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, - "soc %pK peer_id %d", soc, peer_id); - - if (!peer) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "peer not found "); - return CDP_INVALID_VDEV_ID; - } - - qdf_mem_copy(peer_mac, peer->mac_addr.raw, 6); - vdev_id = peer->vdev->vdev_id; - - dp_peer_unref_del_find_by_id(peer); - - return vdev_id; -} - /** * dp_peer_rxtid_stats: Retried Rx TID (REO queue) stats from HW * @peer: DP peer handle diff --git a/dp/wifi3.0/dp_peer.h b/dp/wifi3.0/dp_peer.h index 16e3f2e1d4..e8ed82d05c 100644 --- a/dp/wifi3.0/dp_peer.h +++ b/dp/wifi3.0/dp_peer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2020 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 @@ -179,6 +179,7 @@ dp_peer_update_inactive_time(struct dp_pdev *pdev, uint32_t tag_type, /** * dp_peer_set_vlan_id: set vlan_id for this peer * @cdp_soc: soc handle + * @vdev_id: id of vdev object * @peer_mac: mac address * @vlan_id: vlan id for peer * @@ -186,16 +187,16 @@ dp_peer_update_inactive_time(struct dp_pdev *pdev, uint32_t tag_type, */ static inline void dp_peer_set_vlan_id(struct cdp_soc_t *cdp_soc, - struct cdp_vdev *vdev_handle, uint8_t *peer_mac, + uint8_t vdev_id, uint8_t *peer_mac, uint16_t vlan_id) { } /** * dp_set_vlan_groupkey: set vlan map for vdev - * @cdp_soc: soc handle - * @vdev_id: vdev_id - * @vlan_id: vlan_id of peer + * @soc: pointer to soc + * @vdev_id: id of vdev handle + * @vlan_id: vlan_id * @group_key: group key for vlan * * return: set success/failure @@ -230,7 +231,7 @@ void dp_peer_multipass_list_remove(struct dp_peer *peer) } #else void dp_peer_set_vlan_id(struct cdp_soc_t *cdp_soc, - struct cdp_vdev *vdev_handle, uint8_t *peer_mac, + uint8_t vdev_id, uint8_t *peer_mac, uint16_t vlan_id); QDF_STATUS dp_set_vlan_groupkey(struct cdp_soc_t *soc, uint8_t vdev_id, uint16_t vlan_id, uint16_t group_key); @@ -240,6 +241,8 @@ void dp_peer_multipass_list_remove(struct dp_peer *peer); /** * dp_peer_update_pkt_capture_params: Set Rx & Tx Capture flags for a peer + * @soc: DP SOC handle + * @pdev_id: id of DP pdev handle * @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode * @is_tx_pkt_cap_enable: enable/disable Tx packet capture in monitor mode * @peer_mac: MAC address for which the above need to be enabled/disabled @@ -247,7 +250,8 @@ void dp_peer_multipass_list_remove(struct dp_peer *peer); * Return: Success if Rx & Tx capture is enabled for peer, false otherwise */ QDF_STATUS -dp_peer_update_pkt_capture_params(struct cdp_pdev *pdev, +dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc, + uint8_t pdev_id, bool is_rx_pkt_cap_enable, bool is_tx_pkt_cap_enable, uint8_t *peer_mac); diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 14b60d978f..6b351a24e3 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -313,7 +313,7 @@ dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list, } vdev->osif_rsim_rx_decap(vdev->osif_vdev, &deliver_list_head, - &deliver_list_tail, (struct cdp_peer*) peer); + &deliver_list_tail, peer->mac_addr.raw); vdev->osif_rx(vdev->osif_vdev, deliver_list_head); } @@ -1323,7 +1323,7 @@ static inline void dp_rx_deliver_to_stack(struct dp_vdev *vdev, if (qdf_unlikely(vdev->rx_decap_type == htt_cmn_pkt_type_raw) || (vdev->rx_decap_type == htt_cmn_pkt_type_native_wifi)) { vdev->osif_rsim_rx_decap(vdev->osif_vdev, &nbuf_head, - &nbuf_tail, (struct cdp_peer *) peer); + &nbuf_tail, peer->mac_addr.raw); } vdev->osif_rx(vdev->osif_vdev, nbuf_head); diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index 0c4930e6e6..56c8d24d6f 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -1100,7 +1100,7 @@ bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf, #ifndef WLAN_RX_PKT_CAPTURE_ENH static inline -void dp_peer_set_rx_capture_enabled(struct cdp_peer *peer_handle, bool value) +void dp_peer_set_rx_capture_enabled(struct dp_peer *peer_handle, bool value) { } #endif diff --git a/dp/wifi3.0/dp_rx_mon.h b/dp/wifi3.0/dp_rx_mon.h index c47898d828..f6b6315618 100644 --- a/dp/wifi3.0/dp_rx_mon.h +++ b/dp/wifi3.0/dp_rx_mon.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2020 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 @@ -45,7 +45,7 @@ QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id); * * Return: QDF_STATUS */ -QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle); +QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); /** * dp_pdev_configure_monitor_rings() - configure monitor rings diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 736728e881..5fe16a0491 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -2049,30 +2049,6 @@ static bool dp_check_exc_metadata(struct cdp_tx_exception_metadata *tx_exc) return true; } -/** - * __dp_tx_send_exception: Wrapper API for dp_tx_send_exception. - * @soc: DP soc handle - * @vdev_id: id of DP vdev handle - * @tx_exc_metadata: Handle that holds exception path meta data - * - * Return: NULL on success, - * nbuf when it fails to send - */ -qdf_nbuf_t -__dp_tx_send_exception(ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t nbuf, - struct cdp_tx_exception_metadata *tx_exc_metadata) -{ - struct dp_vdev *vdev = - dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc, - vdev_id); - - if (!vdev) - return nbuf; - - return dp_tx_send_exception((struct cdp_vdev *)vdev, nbuf, - tx_exc_metadata); -} - /** * dp_tx_send_exception() - Transmit a frame on a given VAP in exception path * @soc: DP soc handle @@ -2091,10 +2067,10 @@ dp_tx_send_exception(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf, struct cdp_tx_exception_metadata *tx_exc_metadata) { qdf_ether_header_t *eh = NULL; + struct dp_tx_msdu_info_s msdu_info; struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc, vdev_id); - struct dp_tx_msdu_info_s msdu_info; if (qdf_unlikely(!vdev)) goto fail; diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h index dc4e013992..42148b5b9f 100644 --- a/dp/wifi3.0/dp_tx.h +++ b/dp/wifi3.0/dp_tx.h @@ -187,11 +187,8 @@ QDF_STATUS dp_tx_pdev_attach(struct dp_pdev *pdev); qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf); -qdf_nbuf_t -__dp_tx_send_exception(ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t nbuf, - struct cdp_tx_exception_metadata *tx_exc_metadata); - -qdf_nbuf_t dp_tx_send_exception(struct cdp_vdev *data_vdev, qdf_nbuf_t nbuf, +qdf_nbuf_t dp_tx_send_exception(struct cdp_soc_t *soc, uint8_t vdev_id, + qdf_nbuf_t nbuf, struct cdp_tx_exception_metadata *tx_exc); qdf_nbuf_t dp_tx_send_mesh(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf); @@ -360,7 +357,7 @@ static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc) #ifndef WLAN_TX_PKT_CAPTURE_ENH static inline -void dp_peer_set_tx_capture_enabled(struct cdp_peer *peer_handle, bool value) +void dp_peer_set_tx_capture_enabled(struct dp_peer *peer_handle, bool value) { } #endif diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 51f597024b..c30cd72772 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1915,7 +1915,7 @@ struct dp_vdev { struct dp_tx_desc_pool_s *pool; #endif /* AP BRIDGE enabled */ - uint32_t ap_bridge_enabled; + bool ap_bridge_enabled; enum cdp_sec_type sec_type;