this patch shows how to reference the doxygen api specification and not
cut and paste it into the asciidoc source.

it does this for just the odp_pktio_open api

Signed-off-by: Mike Holmes <mike.hol...@linaro.org>
---
 doc/users-guide/users-guide-pktio.adoc | 57 +---------------------------------
 include/odp/api/spec/packet_io.h       |  2 ++
 2 files changed, 3 insertions(+), 56 deletions(-)

diff --git a/doc/users-guide/users-guide-pktio.adoc 
b/doc/users-guide/users-guide-pktio.adoc
index 2dd0b15..bfd588d 100644
--- a/doc/users-guide/users-guide-pktio.adoc
+++ b/doc/users-guide/users-guide-pktio.adoc
@@ -30,62 +30,7 @@ or *Closed* via the +odp_pktio_close()+ API to return the 
PktIO to the
 PktIO objects begin life by being _opened_ via the call:
 [source,c]
 -----
-/**
- * Open a packet IO interface
- *
- * An ODP program can open a single packet IO interface per device, attempts
- * to open an already open device will fail, returning ODP_PKTIO_INVALID with
- * errno set. Use odp_pktio_lookup() to obtain a handle to an already open
- * device. Packet IO parameters provide interface level configuration options.
- *
- * Packet input queue configuration must be setup with
- * odp_pktin_queue_config() before odp_pktio_start() is called. When packet
- * input mode is ODP_PKTIN_MODE_DISABLED, odp_pktin_queue_config() call is
- * optional and will ignore all parameters.
- *
- * Packet output queue configuration must be setup with
- * odp_pktout_queue_config() before odp_pktio_start() is called. When packet
- * output mode is ODP_PKTOUT_MODE_DISABLED or ODP_PKTOUT_MODE_TM,
- * odp_pktout_queue_config() call is optional and will ignore all parameters.
- *
- * Packet receive and transmit on the interface is enabled with a call to
- * odp_pktio_start(). If not specified otherwise, any interface level
- * configuration must not be changed when the interface is active (between 
start
- * and stop calls).
- *
- * In summary, a typical pktio interface setup sequence is ...
- *   * odp_pktio_open()
- *   * odp_pktin_queue_config()
- *   * odp_pktout_queue_config()
- *   * odp_pktio_start()
- *
- * ... and tear down sequence is:
- *   * odp_pktio_stop()
- *   * odp_pktio_close()
- *
- * @param name   Packet IO device name
- * @param pool   Default pool from which to allocate storage for packets
- *               received over this interface, must be of type ODP_POOL_PACKET
- * @param param  Packet IO parameters
- *
- * @return Packet IO handle
- * @retval ODP_PKTIO_INVALID on failure
- *
- * @note The device name "loop" is a reserved name for a loopback device used
- *      for testing purposes.
- *
- * @note Packets arriving via this interface assigned to a CoS by the
- *      classifier are received into the pool associated with that CoS. This
- *      will occur either because this pktio is assigned a default CoS via
- *      the odp_pktio_default_cos_set() routine, or because a matching PMR
- *      assigned the packet to a specific CoS. The default pool specified
- *      here is applicable only for those packets that are not assigned to a
- *      more specific CoS.
- *
- * @see odp_pktio_start(), odp_pktio_stop(), odp_pktio_close()
- */
-odp_pktio_t odp_pktio_open(const char *name, odp_pool_t pool,
-                           const odp_pktio_param_t *param);
+include::../../include/odp/api/spec/packet_io.h[tags=odp_pktio_open]
 -----
 +odp_pktio_open()+ takes three arguments: a *name*, which is an
 implementation-defined string that identifies the logical interface to be
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 7dd10cd..c3945f0 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -244,6 +244,7 @@ typedef struct odp_pktio_capability_t {
        odp_pktio_set_op_t set_op;
 } odp_pktio_capability_t;
 
+// Asciidoc  tag::odp_pktio_open[]
 /**
  * Open a packet IO interface
  *
@@ -300,6 +301,7 @@ typedef struct odp_pktio_capability_t {
  */
 odp_pktio_t odp_pktio_open(const char *name, odp_pool_t pool,
                           const odp_pktio_param_t *param);
+// Asciidoc end::odp_pktio_open[]
 
 /**
  * Query packet IO interface capabilities
-- 
2.7.4

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to