+
+/**
+ * dfu_flush() - flush to dfu entity
+ *
+ * This function has to be called after writing the last block to the dfu
+ * entity @de.
+ *
+ * The block sequence number @blk_seq_num is a 16 bit counter that must be
+ * incremented with each call for the same dfu entity @de.
+ *
+ * See function :c:func:`dfu_write`
+ *
+ * @de: dfu entity
+ * @buf: ignored
+ * @size: ignored
+ * @blk_seq_num: block sequence number of last write - ignored
+ * Return: 0 for success, -1 for error
+ */
+int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
+
+/**
+ * dfu_initiated_callback() - weak callback called on DFU transaction start
+ *
+ * It is a callback function called by DFU stack when a DFU transaction is
+ * initiated. This function allows to manage some board specific behavior on
+ * DFU targets.
+ *
+ * @dfu: pointer to the dfu_entity, which should be initialized
+ */
+void dfu_initiated_callback(struct dfu_entity *dfu);
+
+/**
+ * dfu_flush_callback() - weak callback called at the end of the DFU write
+ *
+ * It is a callback function called by DFU stack after DFU manifestation.
+ * This function allows to manage some board specific behavior on DFU targets
+ *
+ * @dfu: pointer to the dfu_entity, which should be flushed
+ */
+void dfu_flush_callback(struct dfu_entity *dfu);
+
+int dfu_transaction_initiate(struct dfu_entity *dfu, bool read);
+void dfu_transaction_cleanup(struct dfu_entity *dfu);
+
+/*
+ * dfu_defer_flush - pointer to store dfu_entity for deferred flashing.
+ * It should be NULL when not used.
+ */
+extern struct dfu_entity *dfu_defer_flush;
+
+/**
+ * dfu_get_defer_flush() - get current value of dfu_defer_flush pointer
+ *
+ * Return: value of the dfu_defer_flush pointer
+ */
+static inline struct dfu_entity *dfu_get_defer_flush(void)
+{
+ return dfu_defer_flush;
+}
+
+/**
+ * dfu_set_defer_flush() - set the dfu_defer_flush pointer
+ *
+ * @dfu: pointer to the dfu_entity, which should be written
+ */
+static inline void dfu_set_defer_flush(struct dfu_entity *dfu)
+{
+ dfu_defer_flush = dfu;
+}
+
+/**
+ * dfu_write_from_mem_addr() - write data from memory to DFU managed medium
+ *
+ * This function adds support for writing data starting from fixed memory
+ * address (like $loadaddr) to dfu managed medium (e.g. NAND, MMC, file system)
+ *
+ * @dfu: dfu entity to which we want to store data
+ * @buf: fixed memory address from where data starts
+ * @size: number of bytes to write
+ *
+ * Return: 0 on success, other value on failure
+ */
+int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size);
+