qcacld-3.0: Featurize partial reorder properly
Avoid compiling ol_rx_reorder.c and ol_rx_reorder_timeout.c
for low latency and only compile for high latency
data path.
Change-Id: I1f3819fa093766abba87e5dc6dc44e6d2188740b
CRs-Fixed: 2506005
diff --git a/Kbuild b/Kbuild
index ac45632..bf970b3 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1248,13 +1248,16 @@
$(TXRX_DIR)/ol_rx_defrag.o \
$(TXRX_DIR)/ol_tx_desc.o \
$(TXRX_DIR)/ol_tx.o \
- $(TXRX_DIR)/ol_rx_reorder_timeout.o \
- $(TXRX_DIR)/ol_rx_reorder.o \
$(TXRX_DIR)/ol_rx_pn.o \
$(TXRX_DIR)/ol_txrx_peer_find.o \
$(TXRX_DIR)/ol_txrx_encap.o \
$(TXRX_DIR)/ol_tx_send.o
+ifeq ($(CONFIG_HL_DP_SUPPORT), y)
+TXRX_OBJS += $(TXRX_DIR)/ol_rx_reorder_timeout.o
+TXRX_OBJS += $(TXRX_DIR)/ol_rx_reorder.o
+endif
+
ifeq ($(CONFIG_WDI_EVENT_ENABLE), y)
TXRX_OBJS += $(TXRX_DIR)/ol_txrx_event.o
endif
diff --git a/core/dp/ol/inc/ol_txrx_htt_api.h b/core/dp/ol/inc/ol_txrx_htt_api.h
index 9bc38bd..389152c 100644
--- a/core/dp/ol/inc/ol_txrx_htt_api.h
+++ b/core/dp/ol/inc/ol_txrx_htt_api.h
@@ -340,6 +340,130 @@
*/
void ol_tx_target_credit_update(struct ol_txrx_pdev_t *pdev, int credit_delta);
+enum htt_rx_flush_action {
+ htt_rx_flush_release,
+ htt_rx_flush_discard,
+};
+
+#ifdef WLAN_PARTIAL_REORDER_OFFLOAD
+/**
+ * @brief Process a rx reorder flush message sent by the target.
+ * @details
+ * The target's rx reorder logic can send a flush indication to the
+ * host's rx reorder buffering either as a flush IE within a rx
+ * indication message, or as a standalone rx reorder flush message.
+ * This ol_rx_flush_handler function processes the standalone rx
+ * reorder flush message from the target.
+ * The flush message specifies a range of sequence numbers whose
+ * rx frames are flushed.
+ * Some sequence numbers within the specified range may not have
+ * rx frames; the host needs to check for each sequence number in
+ * the specified range whether there are rx frames held for that
+ * sequence number.
+ *
+ * @param pdev - data physical device handle
+ * (registered with HTT as a context pointer during attach time)
+ * @param peer_id - which peer's rx data is being flushed
+ * @param tid - which traffic ID within the peer has the rx data being flushed
+ * @param seq_num_start - Which sequence number within the rx reordering
+ * buffer the flushing should start with.
+ * This is the LSBs of the 802.11 sequence number.
+ * This sequence number is masked with the rounded-to-power-of-two
+ * window size to generate a reorder buffer index.
+ * The flush includes this initial sequence number.
+ * @param seq_num_end - Which sequence number within the rx reordering
+ * buffer the flushing should stop at.
+ * This is the LSBs of the 802.11 sequence number.
+ * This sequence number is masked with the rounded-to-power-of-two
+ * window size to generate a reorder buffer index.
+ * The flush excludes this final sequence number.
+ * @param action - whether to release or discard the rx frames
+ */
+void
+ol_rx_flush_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint16_t seq_num_start,
+ uint16_t seq_num_end, enum htt_rx_flush_action action);
+
+/**
+ * @brief Process a rx pn indication message
+ * @details
+ * When the peer is configured to get PN checking done in target,
+ * the target instead of sending reorder flush/release messages
+ * sends PN indication messages which contain the start and end
+ * sequence numbers to be flushed/released along with the sequence
+ * numbers of MPDUs that failed the PN check in target.
+ *
+ * @param pdev - data physical device handle
+ * (registered with HTT as a context pointer during attach time)
+ * @param peer_id - which peer's rx data is being flushed
+ * @param tid - which traffic ID within the peer
+ * @param seq_num_start - Which sequence number within the rx reordering
+ * buffer to start with.
+ * This is the LSBs of the 802.11 sequence number.
+ * This sequence number is masked with the rounded-to-power-of-two
+ * window size to generate a reorder buffer index.
+ * This is the initial sequence number.
+ * @param seq_num_end - Which sequence number within the rx reordering
+ * buffer to stop at.
+ * This is the LSBs of the 802.11 sequence number.
+ * This sequence number is masked with the rounded-to-power-of-two
+ * window size to generate a reorder buffer index.
+ * The processing stops right before this sequence number
+ * @param pn_ie_cnt - Indicates the number of PN information elements.
+ * @param pn_ie - Pointer to the array of PN information elements. Each
+ * PN information element contains the LSBs of the 802.11 sequence number
+ * of the MPDU that failed the PN checking in target.
+ */
+void
+ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint16_t seq_num_start,
+ uint16_t seq_num_end, uint8_t pn_ie_cnt, uint8_t *pn_ie);
+
+/**
+ * @brief Process an ADDBA message sent by the target.
+ * @details
+ * When the target notifies the host of an ADDBA event for a specified
+ * peer-TID, the host will set up the rx reordering state for the peer-TID.
+ * Specifically, the host will create a rx reordering array whose length
+ * is based on the window size specified in the ADDBA.
+ *
+ * @param pdev - data physical device handle
+ * (registered with HTT as a context pointer during attach time)
+ * @param peer_id - which peer the ADDBA event is for
+ * @param tid - which traffic ID within the peer the ADDBA event is for
+ * @param win_sz - how many sequence numbers are in the ARQ block ack window
+ * set up by the ADDBA event
+ * @param start_seq_num - the initial value of the sequence number during the
+ * block ack agreement, as specified by the ADDBA request.
+ * @param failed - indicate whether the target's ADDBA setup succeeded:
+ * 0 -> success, 1 -> fail
+ */
+void
+ol_rx_addba_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint8_t win_sz, uint16_t start_seq_num, uint8_t failed);
+
+/**
+ * @brief Process a DELBA message sent by the target.
+ * @details
+ * When the target notifies the host of a DELBA event for a specified
+ * peer-TID, the host will clean up the rx reordering state for the peer-TID.
+ * Specifically, the host will remove the rx reordering array, and will
+ * set the reorder window size to be 1 (stop and go ARQ).
+ *
+ * @param pdev - data physical device handle
+ * (registered with HTT as a context pointer during attach time)
+ * @param peer_id - which peer the ADDBA event is for
+ * @param tid - which traffic ID within the peer the ADDBA event is for
+ */
+void
+ol_rx_delba_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id, uint8_t tid);
+
/**
* @brief Process an rx indication message sent by the target.
* @details
@@ -367,7 +491,6 @@
* @param num_mpdu_ranges - how many ranges of MPDUs does the message describe.
* Each MPDU within the range has the same rx status.
*/
-#ifdef WLAN_PARTIAL_REORDER_OFFLOAD
void
ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
qdf_nbuf_t rx_ind_msg,
@@ -379,6 +502,37 @@
uint16_t peer_id, uint8_t tid, int num_mpdu_ranges)
{
}
+
+static inline void
+ol_rx_addba_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint8_t win_sz, uint16_t start_seq_num, uint8_t failed)
+{
+}
+
+static inline void
+ol_rx_delba_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id, uint8_t tid)
+{
+}
+
+static inline void
+ol_rx_flush_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint16_t seq_num_start,
+ uint16_t seq_num_end, enum htt_rx_flush_action action)
+{
+}
+
+static inline void
+ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
+ uint16_t peer_id,
+ uint8_t tid,
+ uint16_t seq_num_start,
+ uint16_t seq_num_end, uint8_t pn_ie_cnt, uint8_t *pn_ie)
+{
+}
#endif
/**
@@ -507,129 +661,6 @@
int is_unicast, uint32_t *michael_key, uint32_t *rx_pn);
/**
- * @brief Process an ADDBA message sent by the target.
- * @details
- * When the target notifies the host of an ADDBA event for a specified
- * peer-TID, the host will set up the rx reordering state for the peer-TID.
- * Specifically, the host will create a rx reordering array whose length
- * is based on the window size specified in the ADDBA.
- *
- * @param pdev - data physical device handle
- * (registered with HTT as a context pointer during attach time)
- * @param peer_id - which peer the ADDBA event is for
- * @param tid - which traffic ID within the peer the ADDBA event is for
- * @param win_sz - how many sequence numbers are in the ARQ block ack window
- * set up by the ADDBA event
- * @param start_seq_num - the initial value of the sequence number during the
- * block ack agreement, as specified by the ADDBA request.
- * @param failed - indicate whether the target's ADDBA setup succeeded:
- * 0 -> success, 1 -> fail
- */
-void
-ol_rx_addba_handler(ol_txrx_pdev_handle pdev,
- uint16_t peer_id,
- uint8_t tid,
- uint8_t win_sz, uint16_t start_seq_num, uint8_t failed);
-
-/**
- * @brief Process a DELBA message sent by the target.
- * @details
- * When the target notifies the host of a DELBA event for a specified
- * peer-TID, the host will clean up the rx reordering state for the peer-TID.
- * Specifically, the host will remove the rx reordering array, and will
- * set the reorder window size to be 1 (stop and go ARQ).
- *
- * @param pdev - data physical device handle
- * (registered with HTT as a context pointer during attach time)
- * @param peer_id - which peer the ADDBA event is for
- * @param tid - which traffic ID within the peer the ADDBA event is for
- */
-void
-ol_rx_delba_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id, uint8_t tid);
-
-enum htt_rx_flush_action {
- htt_rx_flush_release,
- htt_rx_flush_discard,
-};
-
-/**
- * @brief Process a rx reorder flush message sent by the target.
- * @details
- * The target's rx reorder logic can send a flush indication to the
- * host's rx reorder buffering either as a flush IE within a rx
- * indication message, or as a standalone rx reorder flush message.
- * This ol_rx_flush_handler function processes the standalone rx
- * reorder flush message from the target.
- * The flush message specifies a range of sequence numbers whose
- * rx frames are flushed.
- * Some sequence numbers within the specified range may not have
- * rx frames; the host needs to check for each sequence number in
- * the specified range whether there are rx frames held for that
- * sequence number.
- *
- * @param pdev - data physical device handle
- * (registered with HTT as a context pointer during attach time)
- * @param peer_id - which peer's rx data is being flushed
- * @param tid - which traffic ID within the peer has the rx data being flushed
- * @param seq_num_start - Which sequence number within the rx reordering
- * buffer the flushing should start with.
- * This is the LSBs of the 802.11 sequence number.
- * This sequence number is masked with the rounded-to-power-of-two
- * window size to generate a reorder buffer index.
- * The flush includes this initial sequence number.
- * @param seq_num_end - Which sequence number within the rx reordering
- * buffer the flushing should stop at.
- * This is the LSBs of the 802.11 sequence number.
- * This sequence number is masked with the rounded-to-power-of-two
- * window size to generate a reorder buffer index.
- * The flush excludes this final sequence number.
- * @param action - whether to release or discard the rx frames
- */
-void
-ol_rx_flush_handler(ol_txrx_pdev_handle pdev,
- uint16_t peer_id,
- uint8_t tid,
- uint16_t seq_num_start,
- uint16_t seq_num_end, enum htt_rx_flush_action action);
-
-/**
- * @brief Process a rx pn indication message
- * @details
- * When the peer is configured to get PN checking done in target,
- * the target instead of sending reorder flush/release messages
- * sends PN indication messages which contain the start and end
- * sequence numbers to be flushed/released along with the sequence
- * numbers of MPDUs that failed the PN check in target.
- *
- * @param pdev - data physical device handle
- * (registered with HTT as a context pointer during attach time)
- * @param peer_id - which peer's rx data is being flushed
- * @param tid - which traffic ID within the peer
- * @param seq_num_start - Which sequence number within the rx reordering
- * buffer to start with.
- * This is the LSBs of the 802.11 sequence number.
- * This sequence number is masked with the rounded-to-power-of-two
- * window size to generate a reorder buffer index.
- * This is the initial sequence number.
- * @param seq_num_end - Which sequence number within the rx reordering
- * buffer to stop at.
- * This is the LSBs of the 802.11 sequence number.
- * This sequence number is masked with the rounded-to-power-of-two
- * window size to generate a reorder buffer index.
- * The processing stops right before this sequence number
- * @param pn_ie_cnt - Indicates the number of PN information elements.
- * @param pn_ie - Pointer to the array of PN information elements. Each
- * PN information element contains the LSBs of the 802.11 sequence number
- * of the MPDU that failed the PN checking in target.
- */
-void
-ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
- uint16_t peer_id,
- uint8_t tid,
- uint16_t seq_num_start,
- uint16_t seq_num_end, uint8_t pn_ie_cnt, uint8_t *pn_ie);
-
-/**
* @brief Process a stats message sent by the target.
* @details
* The host can request target for stats.
diff --git a/core/dp/txrx/ol_rx_reorder.h b/core/dp/txrx/ol_rx_reorder.h
index fa64010..c4dbc0d 100644
--- a/core/dp/txrx/ol_rx_reorder.h
+++ b/core/dp/txrx/ol_rx_reorder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2014-2017, 2019 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
@@ -58,11 +58,25 @@
ol_rx_reorder_first_hole(struct ol_txrx_peer_t *peer,
unsigned int tid, unsigned int *idx_end);
+#ifdef WLAN_PARTIAL_REORDER_OFFLOAD
void
ol_rx_reorder_peer_cleanup(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer);
void ol_rx_reorder_init(struct ol_rx_reorder_t *rx_reorder, uint8_t tid);
+#else
+static inline void
+ol_rx_reorder_peer_cleanup(struct ol_txrx_vdev_t *vdev,
+ struct ol_txrx_peer_t *peer)
+{
+}
+
+static inline void
+ol_rx_reorder_init(struct ol_rx_reorder_t *rx_reorder, uint8_t tid)
+{
+}
+#endif
+
enum htt_rx_status
ol_rx_seq_num_check(struct ol_txrx_pdev_t *pdev,