2 * Copyright (c) 2017 Broadcom. All rights reserved.
3 * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
15 * 3. Neither the name of the copyright holder nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
36 * Implementation of common BSD OS abstraction functions
41 static MALLOC_DEFINE(M_OCS, "OCS", "OneCore Storage data");
43 #include <dev/pci/pcireg.h>
44 #include <dev/pci/pcivar.h>
46 #include <machine/bus.h>
48 timeout_t __ocs_callout;
51 ocs_config_read32(ocs_os_handle_t os, uint32_t reg)
53 return pci_read_config(os->dev, reg, 4);
57 ocs_config_read16(ocs_os_handle_t os, uint32_t reg)
59 return pci_read_config(os->dev, reg, 2);
63 ocs_config_read8(ocs_os_handle_t os, uint32_t reg)
65 return pci_read_config(os->dev, reg, 1);
69 ocs_config_write8(ocs_os_handle_t os, uint32_t reg, uint8_t val)
71 return pci_write_config(os->dev, reg, val, 1);
75 ocs_config_write16(ocs_os_handle_t os, uint32_t reg, uint16_t val)
77 return pci_write_config(os->dev, reg, val, 2);
81 ocs_config_write32(ocs_os_handle_t os, uint32_t reg, uint32_t val)
83 return pci_write_config(os->dev, reg, val, 4);
88 * @brief Read a 32bit PCI register
90 * The SLI documentation uses the term "register set" to describe one or more
91 * PCI BARs which form a logical address. For example, a 64-bit address uses
92 * two BARs, and thus constitute a register set.
94 * @param ocs Pointer to the driver's context
95 * @param rset Register Set to use
96 * @param off Offset from the base address of the Register Set
98 * @return register value
101 ocs_reg_read32(ocs_t *ocs, uint32_t rset, uint32_t off)
103 ocs_pci_reg_t *reg = NULL;
105 reg = &ocs->reg[rset];
107 return bus_space_read_4(reg->btag, reg->bhandle, off);
112 * @brief Read a 16bit PCI register
114 * The SLI documentation uses the term "register set" to describe one or more
115 * PCI BARs which form a logical address. For example, a 64-bit address uses
116 * two BARs, and thus constitute a register set.
118 * @param ocs Pointer to the driver's context
119 * @param rset Register Set to use
120 * @param off Offset from the base address of the Register Set
122 * @return register value
125 ocs_reg_read16(ocs_t *ocs, uint32_t rset, uint32_t off)
127 ocs_pci_reg_t *reg = NULL;
129 reg = &ocs->reg[rset];
131 return bus_space_read_2(reg->btag, reg->bhandle, off);
136 * @brief Read a 8bit PCI register
138 * The SLI documentation uses the term "register set" to describe one or more
139 * PCI BARs which form a logical address. For example, a 64-bit address uses
140 * two BARs, and thus constitute a register set.
142 * @param ocs Pointer to the driver's context
143 * @param rset Register Set to use
144 * @param off Offset from the base address of the Register Set
146 * @return register value
149 ocs_reg_read8(ocs_t *ocs, uint32_t rset, uint32_t off)
151 ocs_pci_reg_t *reg = NULL;
153 reg = &ocs->reg[rset];
155 return bus_space_read_1(reg->btag, reg->bhandle, off);
160 * @brief Write a 32bit PCI register
162 * The SLI documentation uses the term "register set" to describe one or more
163 * PCI BARs which form a logical address. For example, a 64-bit address uses
164 * two BARs, and thus constitute a register set.
166 * @param ocs Pointer to the driver's context
167 * @param rset Register Set to use
168 * @param off Offset from the base address of the Register Set
169 * @param val Value to write
174 ocs_reg_write32(ocs_t *ocs, uint32_t rset, uint32_t off, uint32_t val)
176 ocs_pci_reg_t *reg = NULL;
178 reg = &ocs->reg[rset];
180 return bus_space_write_4(reg->btag, reg->bhandle, off, val);
185 * @brief Write a 16-bit PCI register
187 * The SLI documentation uses the term "register set" to describe one or more
188 * PCI BARs which form a logical address. For example, a 64-bit address uses
189 * two BARs, and thus constitute a register set.
191 * @param ocs Pointer to the driver's context
192 * @param rset Register Set to use
193 * @param off Offset from the base address of the Register Set
194 * @param val Value to write
199 ocs_reg_write16(ocs_t *ocs, uint32_t rset, uint32_t off, uint16_t val)
201 ocs_pci_reg_t *reg = NULL;
203 reg = &ocs->reg[rset];
205 return bus_space_write_2(reg->btag, reg->bhandle, off, val);
210 * @brief Write a 8-bit PCI register
212 * The SLI documentation uses the term "register set" to describe one or more
213 * PCI BARs which form a logical address. For example, a 64-bit address uses
214 * two BARs, and thus constitute a register set.
216 * @param ocs Pointer to the driver's context
217 * @param rset Register Set to use
218 * @param off Offset from the base address of the Register Set
219 * @param val Value to write
224 ocs_reg_write8(ocs_t *ocs, uint32_t rset, uint32_t off, uint8_t val)
226 ocs_pci_reg_t *reg = NULL;
228 reg = &ocs->reg[rset];
230 return bus_space_write_1(reg->btag, reg->bhandle, off, val);
235 * @brief Allocate host memory
237 * @param os OS handle
238 * @param size number of bytes to allocate
239 * @param flags additional options
241 * @return pointer to allocated memory, NULL otherwise
244 ocs_malloc(ocs_os_handle_t os, size_t size, int32_t flags)
246 if ((flags & OCS_M_NOWAIT) == 0) {
250 #ifndef OCS_DEBUG_MEMORY
251 return malloc(size, M_OCS, flags);
255 void *addr = malloc(size, M_OCS, flags);
257 linker_ddb_search_symbol_name(__builtin_return_address(1), nameb, sizeof(nameb), &offset);
258 printf("A: %p %ld @ %s+%#lx\n", addr, size, nameb, offset);
266 * @brief Free host memory
268 * @param os OS handle
269 * @param addr pointer to memory
270 * @param size bytes to free
272 * @note size ignored in BSD
275 ocs_free(ocs_os_handle_t os, void *addr, size_t size)
277 #ifndef OCS_DEBUG_MEMORY
280 printf("F: %p %ld\n", addr, size);
286 * @brief Callback function provided to bus_dmamap_load
288 * Function loads the physical / bus address into the DMA descriptor. The caller
289 * can detect a mapping failure if a descriptor's phys element is zero.
291 * @param arg Argument provided to bus_dmamap_load is a ocs_dma_t
292 * @param seg Array of DMA segment(s), each describing segment's address and length
293 * @param nseg Number of elements in array
294 * @param error Indicates success (0) or failure of mapping
297 ocs_dma_load(void *arg, bus_dma_segment_t *seg, int nseg, int error)
299 ocs_dma_t *dma = arg;
302 printf("%s: error=%d\n", __func__, error);
305 dma->phys = seg->ds_addr;
311 * @brief Free a DMA capable block of memory
313 * @param os Device abstraction
314 * @param dma DMA descriptor for memory to be freed
316 * @return 0 if memory is de-allocated, -1 otherwise
319 ocs_dma_free(ocs_os_handle_t os, ocs_dma_t *dma)
321 struct ocs_softc *ocs = os;
324 device_printf(ocs->dev, "%s: bad parameter(s) dma=%p\n", __func__, dma);
328 if (dma->size == 0) {
333 bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_POSTREAD |
334 BUS_DMASYNC_POSTWRITE);
335 bus_dmamap_unload(dma->tag, dma->map);
339 bus_dmamem_free(dma->tag, dma->virt, dma->map);
340 bus_dmamap_destroy(dma->tag, dma->map);
342 bus_dma_tag_destroy(dma->tag);
344 bzero(dma, sizeof(ocs_dma_t));
351 * @brief Allocate a DMA capable block of memory
353 * @param os Device abstraction
354 * @param dma DMA descriptor containing results of memory allocation
355 * @param size Size in bytes of desired allocation
356 * @param align Alignment in bytes
358 * @return 0 on success, ENOMEM otherwise
361 ocs_dma_alloc(ocs_os_handle_t os, ocs_dma_t *dma, size_t size, size_t align)
363 struct ocs_softc *ocs = os;
366 device_printf(ocs->dev, "%s bad parameter(s) dma=%p size=%zd\n",
367 __func__, dma, size);
371 bzero(dma, sizeof(ocs_dma_t));
373 /* create a "tag" that describes the desired memory allocation */
374 if (bus_dma_tag_create(ocs->dmat, align, 0, BUS_SPACE_MAXADDR,
375 BUS_SPACE_MAXADDR, NULL, NULL,
376 size, 1, size, 0, NULL, NULL, &dma->tag)) {
377 device_printf(ocs->dev, "DMA tag allocation failed\n");
383 /* allocate the memory */
384 if (bus_dmamem_alloc(dma->tag, &dma->virt, BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
386 device_printf(ocs->dev, "DMA memory allocation failed s=%zd a=%zd\n", size, align);
387 ocs_dma_free(ocs, dma);
391 dma->alloc = dma->virt;
393 /* map virtual address to device visible address */
394 if (bus_dmamap_load(dma->tag, dma->map, dma->virt, dma->size, ocs_dma_load,
396 device_printf(ocs->dev, "DMA memory load failed\n");
397 ocs_dma_free(ocs, dma);
401 /* if the DMA map load callback fails, it sets the physical address to zero */
402 if (0 == dma->phys) {
403 device_printf(ocs->dev, "ocs_dma_load failed\n");
404 ocs_dma_free(ocs, dma);
413 * @brief Synchronize the DMA buffer memory
415 * Ensures memory coherency between the CPU and device
417 * @param dma DMA descriptor of memory to synchronize
418 * @param flags Describes direction of synchronization
419 * See BUS_DMA(9) for details
420 * - BUS_DMASYNC_PREWRITE
421 * - BUS_DMASYNC_POSTREAD
424 ocs_dma_sync(ocs_dma_t *dma, uint32_t flags)
426 bus_dmamap_sync(dma->tag, dma->map, flags);
430 ocs_dma_copy_in(ocs_dma_t *dma, void *buffer, uint32_t buffer_length)
436 if (buffer_length == 0)
438 if (buffer_length > dma->size)
439 buffer_length = dma->size;
440 ocs_memcpy(dma->virt, buffer, buffer_length);
441 dma->len = buffer_length;
442 return buffer_length;
446 ocs_dma_copy_out(ocs_dma_t *dma, void *buffer, uint32_t buffer_length)
452 if (buffer_length == 0)
454 if (buffer_length > dma->len)
455 buffer_length = dma->len;
456 ocs_memcpy(buffer, dma->virt, buffer_length);
457 return buffer_length;
462 * @brief Initialize a lock
464 * @param lock lock to initialize
465 * @param name string identifier for the lock
468 ocs_lock_init(void *os, ocs_lock_t *lock, const char *name, ...)
473 ocs_vsnprintf(lock->name, MAX_LOCK_DESC_LEN, name, ap);
476 mtx_init(&lock->lock, lock->name, NULL, MTX_DEF);
480 * @brief Allocate a bit map
482 * For BSD, this is a simple character string
484 * @param n_bits number of bits in bit map
486 * @return pointer to the bit map, NULL on error
489 ocs_bitmap_alloc(uint32_t n_bits)
492 return malloc(bitstr_size(n_bits), M_OCS, M_ZERO | M_NOWAIT);
496 * @brief Free a bit map
498 * @param bitmap pointer to previously allocated bit map
501 ocs_bitmap_free(ocs_bitmap_t *bitmap)
508 * @brief find next unset bit and set it
510 * @param bitmap bit map to search
511 * @param n_bits number of bits in map
513 * @return bit position or -1 if map is full
516 ocs_bitmap_find(ocs_bitmap_t *bitmap, uint32_t n_bits)
518 int32_t position = -1;
520 bit_ffc(bitmap, n_bits, &position);
522 if (-1 != position) {
523 bit_set(bitmap, position);
530 * @brief search for next (un)set bit
532 * @param bitmap bit map to search
533 * @param set search for a set or unset bit
534 * @param n_bits number of bits in map
536 * @return bit position or -1
539 ocs_bitmap_search(ocs_bitmap_t *bitmap, uint8_t set, uint32_t n_bits)
548 bit_ffs(bitmap, n_bits, &position);
550 bit_ffc(bitmap, n_bits, &position);
557 * @brief clear the specified bit
559 * @param bitmap pointer to bit map
560 * @param bit bit number to clear
563 ocs_bitmap_clear(ocs_bitmap_t *bitmap, uint32_t bit)
565 bit_clear(bitmap, bit);
568 void _ocs_log(ocs_t *ocs, const char *func_name, int line, const char *fmt, ...)
576 /* TODO: Add Current PID info here. */
578 p += snprintf(p, sizeof(buf) - (p - buf), "%s: ", DRV_NAME);
579 p += snprintf(p, sizeof(buf) - (p - buf), "%s:", func_name);
580 p += snprintf(p, sizeof(buf) - (p - buf), "%i:", line);
581 p += snprintf(p, sizeof(buf) - (p - buf), "%s:", (ocs != NULL) ? device_get_nameunit(ocs->dev) : "");
582 p += vsnprintf(p, sizeof(buf) - (p - buf), fmt, ap);
590 * @brief Common thread call function
592 * This is the common function called whenever a thread instantiated by ocs_thread_create() is started.
593 * It captures the return value from the actual thread function and stashes it in the thread object, to
594 * be later retrieved by ocs_thread_get_retval(), and calls kthread_exit(), the proscribed method to terminate
597 * @param arg a pointer to the thread object
603 ocs_thread_call_fctn(void *arg)
605 ocs_thread_t *thread = arg;
606 thread->retval = (*thread->fctn)(thread->arg);
607 ocs_free(NULL, thread->name, ocs_strlen(thread->name+1));
612 * @brief Create a kernel thread
614 * Creates a kernel thread and optionally starts it. If the thread is not immediately
615 * started, ocs_thread_start() should be called at some later point.
617 * @param os OS handle
618 * @param thread pointer to thread object
619 * @param fctn function for thread to be begin executing
620 * @param name text name to identify thread
621 * @param arg application specific argument passed to thread function
622 * @param start start option, OCS_THREAD_RUN will start the thread immediately,
623 * OCS_THREAD_CREATE will create but not start the thread
625 * @return returns 0 for success, a negative error code value for failure.
629 ocs_thread_create(ocs_os_handle_t os, ocs_thread_t *thread, ocs_thread_fctn fctn, const char *name, void *arg, ocs_thread_start_e start)
633 ocs_memset(thread, 0, sizeof(*thread));
636 thread->name = ocs_strdup(name);
637 if (thread->name == NULL) {
638 thread->name = "unknown";
642 ocs_atomic_set(&thread->terminate, 0);
644 rc = kthread_add(ocs_thread_call_fctn, thread, NULL, &thread->tcb, (start == OCS_THREAD_CREATE) ? RFSTOPPED : 0,
645 OCS_THREAD_DEFAULT_STACK_SIZE_PAGES, "%s", name);
651 * @brief Start a thread
653 * Starts a thread that was created with OCS_THREAD_CREATE rather than OCS_THREAD_RUN
655 * @param thread pointer to thread object
657 * @return returns 0 for success, a negative error code value for failure.
660 int32_t ocs_thread_start(ocs_thread_t *thread)
662 sched_add(thread->tcb, SRQ_BORING);
667 * @brief return thread argument
669 * Returns a pointer to the thread's application specific argument
671 * @param mythread pointer to the thread object
673 * @return pointer to application specific argument
676 void *ocs_thread_get_arg(ocs_thread_t *mythread)
678 return mythread->arg;
682 * @brief Request thread stop
684 * A stop request is made to the thread. This is a voluntary call, the thread needs
685 * to periodically query its terminate request using ocs_thread_terminate_requested()
687 * @param thread pointer to thread object
689 * @return returns 0 for success, a negative error code value for failure.
693 ocs_thread_terminate(ocs_thread_t *thread)
695 ocs_atomic_set(&thread->terminate, 1);
700 * @brief See if a terminate request has been made
702 * Check to see if a stop request has been made to the current thread. This
703 * function would be used by a thread to see if it should terminate.
705 * @return returns non-zero if a stop has been requested
708 int32_t ocs_thread_terminate_requested(ocs_thread_t *thread)
710 return ocs_atomic_read(&thread->terminate);
714 * @brief Retrieve threads return value
716 * After a thread has terminated, it's return value may be retrieved with this function.
718 * @param thread pointer to thread object
720 * @return return value from thread function
724 ocs_thread_get_retval(ocs_thread_t *thread)
726 return thread->retval;
730 * @brief Request that the currently running thread yield
732 * The currently running thread yields to the scheduler
734 * @param thread pointer to thread (ignored)
740 ocs_thread_yield(ocs_thread_t *thread) {
741 pause("thread yield", 1);
745 ocs_thread_self(void)
747 ocs_printf(">>> %s not implemented\n", __func__);
752 ocs_thread_setcpu(ocs_thread_t *thread, uint32_t cpu)
754 ocs_printf(">>> %s not implemented\n", __func__);
759 ocs_thread_getcpu(void)
765 ocs_sem_init(ocs_sem_t *sem, int val, const char *name, ...)
770 ocs_vsnprintf(sem->name, sizeof(sem->name), name, ap);
773 sema_init(&sem->sem, val, sem->name);
779 * @brief Copy user arguments in to kernel space for an ioctl
781 * This function is called at the beginning of an ioctl function
782 * to copy the ioctl argument from user space to kernel space.
784 * BSD handles this for us - arg is already in kernel space,
785 * so we just return it.
787 * @param os OS handle
788 * @param arg The argument passed to the ioctl function
789 * @param size The size of the structure pointed to by arg
791 * @return A pointer to a kernel space copy of the argument on
792 * success; NULL on failure
794 void *ocs_ioctl_preprocess(ocs_os_handle_t os, void *arg, size_t size)
801 * @brief Copy results of an ioctl back to user space
803 * This function is called at the end of ioctl processing to
804 * copy the argument back to user space.
806 * BSD handles this for us.
808 * @param os OS handle
809 * @param arg The argument passed to the ioctl function
810 * @param kern_ptr A pointer to the kernel space copy of the
812 * @param size The size of the structure pointed to by arg.
816 int32_t ocs_ioctl_postprocess(ocs_os_handle_t os, void *arg, void *kern_ptr, size_t size)
823 * @brief Free memory allocated by ocs_ioctl_preprocess
825 * This function is called in the event of an error in ioctl
826 * processing. For operating environments where ocs_ioctlpreprocess
827 * allocates memory, this call frees the memory without copying
828 * results back to user space.
830 * For BSD, because no memory was allocated in ocs_ioctl_preprocess,
831 * nothing needs to be done here.
833 * @param os OS handle
834 * @param kern_ptr A pointer to the kernel space copy of the
836 * @param size The size of the structure pointed to by arg.
838 * @return Returns nothing.
840 void ocs_ioctl_free(ocs_os_handle_t os, void *kern_ptr, size_t size)
845 void ocs_intr_disable(ocs_os_handle_t os)
849 void ocs_intr_enable(ocs_os_handle_t os)
853 void ocs_print_stack(void)
866 panic(">>> abort/panic\n");
870 ocs_pci_model(uint16_t vendor, uint16_t device)
873 case PCI_PRODUCT_EMULEX_OCE16002: return "OCE16002";
874 case PCI_PRODUCT_EMULEX_OCE1600_VF: return "OCE1600_VF";
875 case PCI_PRODUCT_EMULEX_OCE50102: return "OCE50102";
876 case PCI_PRODUCT_EMULEX_OCE50102_VF: return "OCE50102_VR";
885 ocs_get_bus_dev_func(ocs_t *ocs, uint8_t* bus, uint8_t* dev, uint8_t* func)
887 *bus = pci_get_bus(ocs->dev);
888 *dev = pci_get_slot(ocs->dev);
889 *func= pci_get_function(ocs->dev);
894 * @brief return CPU information
896 * This function populates the ocs_cpuinfo_t buffer with CPU information
898 * @param cpuinfo pointer to ocs_cpuinfo_t buffer
900 * @return returns 0 for success, a negative error code value for failure.
904 ocs_get_cpuinfo(ocs_cpuinfo_t *cpuinfo)
906 cpuinfo->num_cpus = mp_ncpus;
911 ocs_get_num_cpus(void)
913 static ocs_cpuinfo_t cpuinfo;
915 if (cpuinfo.num_cpus == 0) {
916 ocs_get_cpuinfo(&cpuinfo);
918 return cpuinfo.num_cpus;
923 __ocs_callout(void *t)
925 ocs_timer_t *timer = t;
927 if (callout_pending(&timer->callout)) {
928 /* Callout was reset */
932 if (!callout_active(&timer->callout)) {
933 /* Callout was stopped */
937 callout_deactivate(&timer->callout);
940 timer->func(timer->data);
945 ocs_setup_timer(ocs_os_handle_t os, ocs_timer_t *timer, void(*func)(void *arg), void *data, uint32_t timeout_ms)
951 ocs_log_err(NULL, "bad parameter\n");
955 if (!mtx_initialized(&timer->lock)) {
956 mtx_init(&timer->lock, "ocs_timer", NULL, MTX_DEF);
959 callout_init_mtx(&timer->callout, &timer->lock, 0);
964 tv.tv_sec = timeout_ms / 1000;
965 tv.tv_usec = (timeout_ms % 1000) * 1000;
973 mtx_lock(&timer->lock);
974 callout_reset(&timer->callout, hz, __ocs_callout, timer);
975 mtx_unlock(&timer->lock);
981 ocs_mod_timer(ocs_timer_t *timer, uint32_t timeout_ms)
987 ocs_log_err(NULL, "bad parameter\n");
991 tv.tv_sec = timeout_ms / 1000;
992 tv.tv_usec = (timeout_ms % 1000) * 1000;
1000 mtx_lock(&timer->lock);
1001 callout_reset(&timer->callout, hz, __ocs_callout, timer);
1002 mtx_unlock(&timer->lock);
1008 ocs_timer_pending(ocs_timer_t *timer)
1010 return callout_active(&timer->callout);
1014 ocs_del_timer(ocs_timer_t *timer)
1017 mtx_lock(&timer->lock);
1018 callout_stop(&timer->callout);
1019 mtx_unlock(&timer->lock);
1025 ocs_strdup(const char *s)
1027 uint32_t l = strlen(s);
1030 d = ocs_malloc(NULL, l+1, OCS_M_NOWAIT);
1038 _ocs_assert(const char *cond, const char *filename, int linenum)
1040 const char *fn = strrchr(__FILE__, '/');
1042 ocs_log_err(NULL, "%s(%d) assertion (%s) failed\n", (fn ? fn + 1 : filename), linenum, cond);
1044 ocs_save_ddump_all(OCS_DDUMP_FLAGS_WQES|OCS_DDUMP_FLAGS_CQES|OCS_DDUMP_FLAGS_MQES, -1, TRUE);