From ed1de120850da93f916ee00ca8fb07a554cfaad6 Mon Sep 17 00:00:00 2001 From: Karunakar Dasineni Date: Tue, 2 Aug 2016 11:57:59 -0700 Subject: [PATCH] qcacmn: Lithium data path WMI changes WMI changes for rx reorder queue setup. Also enable addba/delba handlers. Change-Id: I360673d7493264d2591ffe3ba2bb5c3afba47f84 --- dp/inc/cdp_txrx_cmn.h | 28 ++++++++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 10 ++++++++++ dp/wifi3.0/dp_internal.h | 8 ++++++++ dp/wifi3.0/dp_main.c | 3 +++ dp/wifi3.0/dp_peer.c | 33 +++++++++++++++------------------ 5 files changed, 64 insertions(+), 18 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index b4aa99bbbc..310dc571f4 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -352,4 +352,32 @@ cdp_soc_detach(ol_txrx_soc_handle soc) return; } +static inline int cdp_addba_requestprocess(ol_txrx_soc_handle soc, + void *peer_handle, uint8_t dialogtoken, uint16_t tid, + uint16_t batimeout, uint16_t buffersize, uint16_t startseqnum) +{ + if (soc->ops->cmn_drv_ops->addba_requestprocess) + return soc->ops->cmn_drv_ops->addba_requestprocess(peer_handle, + dialogtoken, tid, batimeout, buffersize, startseqnum); + return 0; +} + +static inline void cdp_addba_responsesetup(ol_txrx_soc_handle soc, + void *peer_handle, uint8_t tid, uint8_t *dialogtoken, + uint16_t *statuscode, uint16_t *buffersize, uint16_t *batimeout) +{ + if (soc->ops->cmn_drv_ops->addba_responsesetup) + soc->ops->cmn_drv_ops->addba_responsesetup(peer_handle, tid, + dialogtoken, statuscode, buffersize, batimeout); +} + +static inline int cdp_delba_process(ol_txrx_soc_handle soc, + void *peer_handle, int tid, uint16_t reasoncode) +{ + if (soc->ops->cmn_drv_ops->delba_process) + return soc->ops->cmn_drv_ops->delba_process(peer_handle, + tid, reasoncode); + return 0; +} + #endif /* _CDP_TXRX_CMN_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index d77f930bb7..c361174e60 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -170,6 +170,16 @@ struct cdp_cmn_ops { void (*txrx_soc_detach)(void *soc); + int (*addba_requestprocess)(void *peer_handle, uint8_t dialogtoken, + uint16_t tid, uint16_t batimeout, uint16_t buffersize, + uint16_t startseqnum); + + void (*addba_responsesetup)(void *peer_handle, uint8_t tid, + uint8_t *dialogtoken, uint16_t *statuscode, + uint16_t *buffersize, uint16_t *batimeout); + + int (*delba_process)(void *peer_handle, + int tid, uint16_t reasoncode); }; struct cdp_ctrl_ops { diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index 79d44cdf1b..cb8868d59b 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -81,4 +81,12 @@ void dp_local_peer_id_pool_init(struct dp_pdev *pdev); void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer); void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer); #endif +extern int dp_addba_requestprocess_wifi3(void *peer_handle, + uint8_t dialogtoken, uint16_t tid, uint16_t batimeout, + uint16_t buffersize, uint16_t startseqnum); +extern void dp_addba_responsesetup_wifi3(void *peer_handle, uint8_t tid, + uint8_t *dialogtoken, uint16_t *statuscode, + uint16_t *buffersize, uint16_t *batimeout); +extern int dp_delba_process_wifi3(void *peer_handle, + int tid, uint16_t reasoncode); #endif /* #ifndef _DP_INTERNAL_H_ */ diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 7a68dc0c65..a7347ab2a3 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1643,6 +1643,9 @@ static struct cdp_cmn_ops dp_ops_cmn = { .txrx_get_vdev_mac_addr = dp_get_vdev_mac_addr_wifi3, .txrx_get_vdev_from_vdev_id = dp_get_vdev_from_vdev_id_wifi3, .txrx_get_ctrl_pdev_from_vdev = dp_get_ctrl_pdev_from_vdev_wifi3, + .addba_requestprocess = dp_addba_requestprocess_wifi3, + .addba_responsesetup = dp_addba_responsesetup_wifi3, + .delba_process = dp_delba_process_wifi3, /* TODO: Add other functions */ }; diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 8ef32a8a0c..d27cd1ff5b 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -670,6 +670,7 @@ void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer) /* Setup default (non-qos) rx tid queue */ dp_rx_tid_setup_wifi3(peer, DP_NON_QOS_TID, 1, 0); + /* * Set security defaults: no PN check, no security. The target may * send a HTT SEC_IND message to overwrite these defaults. @@ -709,30 +710,30 @@ void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer) * * @peer: Datapath peer handle * @dialogtoken: dialogtoken from ADDBA frame -* @baparamset: BlockAck parameters received in ADDBA frame -* @basequencectrl: BA sequence control received in ADDBA frame +* @tid: TID number +* @startseqnum: Start seq. number received in BA sequence control +* in ADDBA frame * * Return: 0 on success, error code on failure */ -int dp_addba_requestprocess_wifi3(void *peer_handle, uint8_t dialogtoken, - struct ieee80211_ba_parameterset *baparamset, uint16_t batimeout, - struct ieee80211_ba_seqctrl basequencectrl) +int dp_addba_requestprocess_wifi3(void *peer_handle, + uint8_t dialogtoken, uint16_t tid, uint16_t batimeout, + uint16_t buffersize, uint16_t startseqnum) { struct dp_peer *peer = (struct dp_peer *)peer_handle; - uint16_t tid = baparamset->tid; struct dp_rx_tid *rx_tid = &peer->rx_tid[tid]; if ((rx_tid->ba_status == DP_RX_BA_ACTIVE) && (rx_tid->hw_qdesc_vaddr_unaligned != NULL)) rx_tid->ba_status = DP_RX_BA_INACTIVE; - if (dp_rx_tid_setup_wifi3(peer, tid, baparamset->buffersize, - basequencectrl.startseqnum)) { + if (dp_rx_tid_setup_wifi3(peer, tid, buffersize, + startseqnum)) { /* TODO: Should we send addba reject in this case */ return QDF_STATUS_E_FAILURE; } - rx_tid->ba_win_size = baparamset->buffersize; + rx_tid->ba_win_size = buffersize; rx_tid->dialogtoken = dialogtoken; rx_tid->statuscode = QDF_STATUS_SUCCESS; rx_tid->ba_status = DP_RX_BA_ACTIVE; @@ -747,12 +748,12 @@ int dp_addba_requestprocess_wifi3(void *peer_handle, uint8_t dialogtoken, * @tid: TID number * @dialogtoken: output dialogtoken * @statuscode: output dialogtoken -* @baparamset: Ouput structure to populate BA response parameters +* @buffersize: Ouput BA window sizze * @batimeout: Ouput BA timeout */ void dp_addba_responsesetup_wifi3(void *peer_handle, uint8_t tid, uint8_t *dialogtoken, uint16_t *statuscode, - struct ieee80211_ba_parameterset *baparamset, uint16_t *batimeout) + uint16_t *buffersize, uint16_t *batimeout) { struct dp_peer *peer = (struct dp_peer *)peer_handle; struct dp_rx_tid *rx_tid = &peer->rx_tid[tid]; @@ -760,26 +761,22 @@ void dp_addba_responsesetup_wifi3(void *peer_handle, uint8_t tid, /* setup ADDBA response paramters */ *dialogtoken = rx_tid->dialogtoken; *statuscode = rx_tid->statuscode; - baparamset->amsdusupported = IEEE80211_BA_AMSDU_SUPPORTED; - baparamset->bapolicy = IEEE80211_BA_POLICY_IMMEDIATE; - baparamset->tid = rx_tid->ba_win_size; - baparamset->buffersize = rx_tid->ba_win_size; + *buffersize = rx_tid->ba_win_size; *batimeout = 0; } /* * dp_rx_delba_process_wifi3() – Process DELBA from peer * @peer: Datapath peer handle -* @delbaparamset: DELBA parameters received in DELBA frame +* @tid: TID number * @reasoncode: Reason code received in DELBA frame * * Return: 0 on success, error code on failure */ int dp_delba_process_wifi3(void *peer_handle, - struct ieee80211_delba_parameterset *delbaparamset, uint16_t reasoncode) + int tid, uint16_t reasoncode) { struct dp_peer *peer = (struct dp_peer *)peer_handle; - uint16_t tid = (uint16_t)delbaparamset->tid; struct dp_rx_tid *rx_tid = &peer->rx_tid[tid]; if (rx_tid->ba_status != DP_RX_BA_ACTIVE)