diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index c1db0c7eebb..58bc32c0417 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: February 7, 2017
+Last Updated: May 20, 2017
@@ -178,6 +178,14 @@ 4.11.2 LED Definitionsdrivers/syslog and drivers/wireless.
+This objectives of this feature are:
+
+CONFIG_MM_IOB
+ CONFIG_IOB_NBUFFERS
+ CONFIG_NET_TCP_WRITE_BUFFERS nor CONFIG_NET_TCP_READAHEAD), 24 if only write buffering is enabled, and 36 if both read-ahead and write buffering are enabled.
+
+ CONFIG_IOB_BUFSIZE
+ CONFIG_IOB_NCHAINS
+ CONFIG_NET_TCP_READAHEAD && !CONFIG_NET_UDP_READAHEAD or eight if either is enabled.
+
+ CONFIG_IOB_THROTTLE
+ CONFIG_IOB_DEBUG
+ CONFIG_DEBUG_FEATURES) with IOBs are being used to syslog buffering logic (CONFIG_SYSLOG_BUFFER).
+
+ This structure epresents one I/O buffer. A packet is contained by one or more I/O buffers in a chain. The io_pktlen is only valid for the I/O buffer at the head of the chain.
+
+struct iob_s
+{
+ /* Singly-link list support */
+
+ FAR struct iob_s *io_flink;
+
+ /* Payload */
+
+#if CONFIG_IOB_BUFSIZE < 256
+ uint8_t io_len; /* Length of the data in the entry */
+ uint8_t io_offset; /* Data begins at this offset */
+#else
+ uint16_t io_len; /* Length of the data in the entry */
+ uint16_t io_offset; /* Data begins at this offset */
+#endif
+ uint16_t io_pktlen; /* Total length of the packet */
+
+ uint8_t io_data[CONFIG_IOB_BUFSIZE];
+};
+
+
++ This container structure supports queuing of I/O buffer chains. This structure is intended only for internal use by the IOB module. +
+ +
+#if CONFIG_IOB_NCHAINS > 0
+struct iob_qentry_s
+{
+ /* Singly-link list support */
+
+ FAR struct iob_qentry_s *qe_flink;
+
+ /* Payload -- Head of the I/O buffer chain */
+
+ FAR struct iob_s *qe_head;
+};
+#endif /* CONFIG_IOB_NCHAINS > 0 */
+
+
++ The I/O buffer queue head structure. +
+ +
+#if CONFIG_IOB_NCHAINS > 0
+struct iob_queue_s
+{
+ /* Head of the I/O buffer chain list */
+
+ FAR struct iob_qentry_s *qh_head;
+ FAR struct iob_qentry_s *qh_tail;
+};
+#endif /* CONFIG_IOB_NCHAINS > 0 */
+
+
+iob_initialize()iob_alloc()iob_tryalloc()iob_free()iob_free_chain()iob_add_queue()iob_tryadd_queue()iob_remove_queue()iob_peek_queue()iob_free_queue()iob_copyin()iob_trycopyin()iob_copyout()iob_clone()iob_concat()iob_trimhead()iob_trimhead_queue()iob_trimtail()iob_pack()iob_contig()iob_dump()iob_initialize()Function Prototype: +
+#include <nuttx/mm/iob.h> +void iob_initialize(void); ++ +
Description. + Set up the I/O buffers for normal operations. +
+ +iob_alloc()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_alloc(bool throttled); ++ +
Description. + Allocate an I/O buffer by taking the buffer at the head of the free list. +
+ +iob_tryalloc()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_tryalloc(bool throttled); ++ +
Description. + Try to allocate an I/O buffer by taking the buffer at the head of the free list without waiting for a buffer to become free. +
+ +iob_free()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_free(FAR struct iob_s *iob); ++ +
Description. + Free the I/O buffer at the head of a buffer chain returning it to the free list. The link to the next I/O buffer in the chain is return. +
+ +iob_free_chain()Function Prototype: +
+#include <nuttx/mm/iob.h> +void iob_free_chain(FAR struct iob_s *iob); ++ +
Description. + Free an entire buffer chain, starting at the beginning of the I/O buffer chain +
+ +iob_add_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +int iob_add_queue(FAR struct iob_s *iob, FAR struct iob_queue_s *iobq); +#endif /* CONFIG_IOB_NCHAINS > 0 */ ++ +
Description. + Add one I/O buffer chain to the end of a queue. May fail due to lack of resources. +
+ +iob_tryadd_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +int iob_tryadd_queue(FAR struct iob_s *iob, FAR struct iob_queue_s *iobq); +#endif /* CONFIG_IOB_NCHAINS > 0 */ ++ +
Description. + Add one I/O buffer chain to the end of a queue without waiting for resources to become free. +
+ +iob_remove_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +FAR struct iob_s *iob_remove_queue(FAR struct iob_queue_s *iobq); +#endif /* CONFIG_IOB_NCHAINS > 0 */ ++ +
Description. + Remove and return one I/O buffer chain from the head of a queue. +
+ +Returned Value. + Returns a reference to the I/O buffer chain at the head of the queue. +
+ +iob_peek_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +FAR struct iob_s *iob_peek_queue(FAR struct iob_queue_s *iobq); +#endif ++ +
Description. + Return a reference to the I/O buffer chain at the head of a queue. This is similar to iob_remove_queue except that the I/O buffer chain is in place at the head of the queue. The I/O buffer chain may safely be modified by the caller but must be removed from the queue before it can be freed. +
+ +Returned Value. + Returns a reference to the I/O buffer chain at the head of the queue. +
+ +iob_free_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +void iob_free_queue(FAR struct iob_queue_s *qhead); +#endif /* CONFIG_IOB_NCHAINS > 0 */ ++ +
Description. + Free an entire queue of I/O buffer chains. +
+ +iob_copyin()Function Prototype: +
+#include <nuttx/mm/iob.h> +int iob_copyin(FAR struct iob_s *iob, FAR const uint8_t *src, + unsigned int len, unsigned int offset, bool throttled); ++ +
Description.
+ Copy data len bytes from a user buffer into the I/O buffer chain, starting at offset, extending the chain as necessary.
+
iob_trycopyin()Function Prototype: +
+#include <nuttx/mm/iob.h> +int iob_trycopyin(FAR struct iob_s *iob, FAR const uint8_t *src, + unsigned int len, unsigned int offset, bool throttled); ++ +
Description.
+ Copy data len bytes from a user buffer into the I/O buffer chain, starting at offset, extending the chain as necessary BUT without waiting if buffers are not available.
+
iob_copyout()Function Prototype: +
+#include <nuttx/mm/iob.h> +int iob_copyout(FAR uint8_t *dest, FAR const struct iob_s *iob, + unsigned int len, unsigned int offset); ++ +
Description.
+ Copy data len bytes of data into the user buffer starting at offset in the I/O buffer, returning that actual number of bytes copied out.
+
iob_clone()Function Prototype: +
+#include <nuttx/mm/iob.h> +int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2, bool throttled); ++ +
Description.
+ Duplicate (and pack) the data in iob1 in iob2. iob2 must be empty.
+
iob_concat()Function Prototype: +
+#include <nuttx/mm/iob.h> +void iob_concat(FAR struct iob_s *iob1, FAR struct iob_s *iob2); ++ +
Description. + Concatenate iob_s chain iob2 to iob1. +
+ +iob_trimhead()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_trimhead(FAR struct iob_s *iob, unsigned int trimlen); ++ +
Description. + Remove bytes from the beginning of an I/O chain. Emptied I/O buffers are freed and, hence, the beginning of the chain may change. +
+ +iob_trimhead_queue()Function Prototype: +
+#include <nuttx/mm/iob.h> +#if CONFIG_IOB_NCHAINS > 0 +FAR struct iob_s *iob_trimhead_queue(FAR struct iob_queue_s *qhead, + unsigned int trimlen); +#endif ++ +
Description. + Remove bytes from the beginning of an I/O chain at the head of the queue. Emptied I/O buffers are freed and, hence, the head of the queue may change. +
++ This function is just a wrapper around iob_trimhead() that assures that the iob at the head of queue is modified with the trimming operations. +
+ +Returned Value. + The new iob at the head of the queue is returned. +
+ +iob_trimtail()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_trimtail(FAR struct iob_s *iob, unsigned int trimlen); ++ +
Description. + Remove bytes from the end of an I/O chain. Emptied I/O buffers are freed NULL will be returned in the special case where the entry I/O buffer chain is freed. +
+ +iob_pack()Function Prototype: +
+#include <nuttx/mm/iob.h> +FAR struct iob_s *iob_pack(FAR struct iob_s *iob); ++ +
Description. + Pack all data in the I/O buffer chain so that the data offset is zero and all but the final buffer in the chain are filled. Any emptied buffers at the end of the chain are freed. +
+ +iob_contig()Function Prototype: +
+#include <nuttx/mm/iob.h> +int iob_contig(FAR struct iob_s *iob, unsigned int len); ++ +
Description.
+ Ensure that there is len bytes of contiguous space at the beginning of the I/O buffer chain starting at iob.
+
iob_dump()Function Prototype: +
+#include <nuttx/mm/iob.h> +#ifdef CONFIG_DEBUG_FEATURES +void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len, + unsigned int offset); +#endif ++ +
Description. + Dump the contents of a I/O buffer chain +
+| diff --git a/mm/iob/Kconfig b/mm/iob/Kconfig index 0790961a794..b64f90e3ce8 100644 --- a/mm/iob/Kconfig +++ b/mm/iob/Kconfig @@ -51,7 +51,6 @@ config IOB_THROTTLE int "I/O buffer throttle value" default 0 if !NET_TCP_WRITE_BUFFERS || !NET_TCP_READAHEAD default 8 if NET_TCP_WRITE_BUFFERS && NET_TCP_READAHEAD - depends on NET_TCP_WRITE_BUFFERS && NET_TCP_READAHEAD ---help--- TCP write buffering and read-ahead buffer use the same pool of free I/O buffers. In order to prevent uncontrolled incoming TCP packets @@ -70,7 +69,7 @@ config IOB_DEBUG if you are debugging the I/O buffer logic and do not want to get overloaded with other un-related debug output. - NOTE that this selection is not avaiable with IOBs are being used + NOTE that this selection is not available if IOBs are being used to syslog buffering logic (CONFIG_SYSLOG_BUFFER=y)! endif # MM_IOB |