eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / tf_core / tf_session.h
index e2cebd2..c1d7f70 100644 (file)
@@ -59,7 +59,7 @@
  * tf_session_info.
  */
 struct tf_session {
-       /** TrueFlow Version. Used to control the structure layout
+       /** TruFlow Version. Used to control the structure layout
         * when sharing sessions. No guarantee that a secondary
         * process would come from the same version of an executable.
         */
@@ -156,14 +156,20 @@ struct tf_session {
        void *em_db_handle;
 
        /**
-        * the pointer to the parent bp struct
+        * EM allocator for session
         */
-       void *bp;
+       void *em_pool[TF_DIR_MAX];
 
+#ifdef TF_TCAM_SHARED
        /**
-        * EM allocator for session
+        * tcam db reference for the session
         */
-       void *em_pool[TF_DIR_MAX];
+       void *tcam_shared_db_handle;
+#endif /* TF_TCAM_SHARED */
+       /**
+        * SRAM db reference for the session
+        */
+       void *sram_handle;
 };
 
 /**
@@ -260,6 +266,26 @@ struct tf_session_close_session_parms {
  * @ref tf_session_get_fw_session_id
  *
  * @ref tf_session_get_session_id
+ *
+ * @ref tf_session_is_shared_session_creator
+ *
+ * @ref tf_session_get_db
+ *
+ * @ref tf_session_set_db
+ *
+ * @ref tf_session_get_bp
+ *
+ * @ref tf_session_is_shared_session
+ *
+ * #define TF_SHARED
+ * @ref tf_session_get_tcam_shared_db
+ *
+ * @ref tf_session_set_tcam_shared_db
+ * #endif
+ *
+ * @ref tf_session_get_sram_db
+ *
+ * @ref tf_session_set_sram_db
  */
 
 /**
@@ -417,11 +443,11 @@ tf_session_find_session_client_by_fid(struct tf_session *tfs,
 /**
  * Looks up the device information from the TF Session.
  *
- * [in] tfp
- *   Pointer to TF handle
+ * [in] tfs
+ *   Pointer to session handle
  *
  * [out] tfd
- *   Pointer pointer to the device
+ *   Pointer to the device
  *
  * Returns
  *   - (0) if successful.
@@ -430,6 +456,26 @@ tf_session_find_session_client_by_fid(struct tf_session *tfs,
 int tf_session_get_device(struct tf_session *tfs,
                          struct tf_dev_info **tfd);
 
+/**
+ * Returns the session and the device from the tfp.
+ *
+ * [in] tfp
+ *   Pointer to TF handle
+ *
+ * [out] tfs
+ *   Pointer to the session
+ *
+ * [out] tfd
+ *   Pointer to the device
+
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_session_get(struct tf *tfp,
+                  struct tf_session **tfs,
+                  struct tf_dev_info **tfd);
+
 /**
  * Looks up the FW Session id the requested TF handle.
  *
@@ -567,8 +613,57 @@ tf_session_is_shared_session_creator(struct tf_session *tfs)
  *   - the pointer to the parent bnxt struct
  */
 static inline struct bnxt*
-tf_session_get_bp(struct tf_session *tfs)
+tf_session_get_bp(struct tf *tfp)
 {
-       return tfs->bp;
+       return tfp->bp;
 }
+
+/**
+ * Set the pointer to the tcam shared database
+ *
+ * [in] session, pointer to the session
+ *
+ * Returns:
+ *   - the pointer to the parent bnxt struct
+ */
+int
+tf_session_set_tcam_shared_db(struct tf *tfp,
+                             void *tcam_shared_db_handle);
+
+/**
+ * Get the pointer to the tcam shared database
+ *
+ * [in] session, pointer to the session
+ *
+ * Returns:
+ *   - the pointer to the parent bnxt struct
+ */
+int
+tf_session_get_tcam_shared_db(struct tf *tfp,
+                             void **tcam_shared_db_handle);
+
+/**
+ * Set the pointer to the SRAM database
+ *
+ * [in] session, pointer to the session
+ *
+ * Returns:
+ *   - the pointer to the parent bnxt struct
+ */
+int
+tf_session_set_sram_db(struct tf *tfp,
+                      void *sram_handle);
+
+/**
+ * Get the pointer to the SRAM database
+ *
+ * [in] session, pointer to the session
+ *
+ * Returns:
+ *   - the pointer to the parent bnxt struct
+ */
+int
+tf_session_get_sram_db(struct tf *tfp,
+                      void **sram_handle);
+
 #endif /* _TF_SESSION_H_ */