Browse Source

qcacmn: Add cdp support four address raw mode simulation

Added cdp interface support for raw mode simulation code to support 4 address
frames. This function finds the fourth address of the packet.

Change-Id: Ia684cd4c8ba7be3e52283bda7a84fc612d924a38
CRs-Fixed: 2003389
Venkateswara Swamy Bandaru 8 years ago
parent
commit
45f85569ac
3 changed files with 20 additions and 21 deletions
  1. 1 0
      dp/inc/cdp_txrx_handle.h
  2. 3 2
      dp/inc/cdp_txrx_ops.h
  3. 16 19
      dp/inc/cdp_txrx_raw.h

+ 1 - 0
dp/inc/cdp_txrx_handle.h

@@ -29,5 +29,6 @@
 struct cdp_cfg;
 struct cdp_pdev;
 struct cdp_vdev;
+struct cdp_raw_ast;
 
 #endif

+ 3 - 2
dp/inc/cdp_txrx_ops.h

@@ -471,8 +471,9 @@ struct cdp_wds_ops {
 struct cdp_raw_ops {
 	int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
 
-	int
-		(*rsim_tx_encap)(struct cdp_vdev *vdev, qdf_nbuf_t *pnbuf);
+	void (*rsim_get_astentry)(struct cdp_vdev *vdev,
+				qdf_nbuf_t *pnbuf,
+				struct cdp_raw_ast *raw_ast);
 };
 
 #ifdef CONFIG_WIN

+ 16 - 19
dp/inc/cdp_txrx_raw.h

@@ -42,34 +42,31 @@ static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
 		return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
 	return 0;
 }
-/* Questionable -- should this be in OL AND/OR is this used? */
-/* Called by ol_tx_ll_umac_raw_process() */
+
 /**
- * @brief encap nbuf(s) from Ethernet II format to 802.11 Raw format
- * @details
- *  Note that in the case of IP fragments, the function takes two fragments at a
- *  time and creates an A-MSDU. If it has seen the first of such fragments, it
- *  returns 0 to indicate that it needs to consume one more. In this case, the
- *  caller shouldn't pass the nbuf to lower layers.
- *  The function is simple and doesn't dynamically take decisions on A-MSDU
- *  formation. It can be extended to pack more fragments into an A-MSDU if
- *  required, but in this case there can be greater losses due to the
- *  environment. The objective of the function is only to simulate regular
- *  scatter/gather.
+ * @brief finds the ast entry for the packet
+ * @details: Finds the ast entry i.e 4th address for the packet based on the
+ *               details in the netbuf.
  *
  * @param vdev - the data virtual device object
  * @param pnbuf - pointer to nbuf
+ * @param raw_ast - pointer to fill ast information
  *
  * @return - 0 on success, -1 on error, 1 if more nbufs need to be consumed.
  */
 
-static inline int
-cdp_rsim_tx_encap(ol_txrx_soc_handle soc,
-	struct cdp_vdev *vdev, qdf_nbuf_t *pnbuf)
+static inline void
+cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
+			qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
 {
-	if (soc->ops->raw_ops->rsim_tx_encap)
-		return soc->ops->raw_ops->rsim_tx_encap(vdev, pnbuf);
-	return 0;
+
+	if (!soc || !soc->ops || !soc->ops->raw_ops)
+		return;
+
+	if (soc->ops->raw_ops->rsim_get_astentry)
+		soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
+
+	return;
 }
 
 #endif