Lines Matching full:ocs
37 #include "ocs.h"
960 ocs_queue_history_init(ocs_t *ocs, ocs_hw_q_hist_t *q_hist) in ocs_queue_history_init() argument
962 q_hist->ocs = ocs; in ocs_queue_history_init()
965 ocs_log_debug(ocs, "q_hist not NULL, skipping init\n"); in ocs_queue_history_init()
969 …q_hist->q_hist = ocs_malloc(ocs, sizeof(*q_hist->q_hist)*OCS_Q_HIST_SIZE, OCS_M_ZERO | OCS_M_NOWAI… in ocs_queue_history_init()
972 ocs_log_err(ocs, "Could not allocate queue history buffer\n"); in ocs_queue_history_init()
974 ocs_lock_init(ocs, &q_hist->q_hist_lock, "queue history lock[%d]", ocs_instance(ocs)); in ocs_queue_history_init()
991 ocs_t *ocs = q_hist->ocs; in ocs_queue_history_free() local
994 ocs_free(ocs, q_hist->q_hist, sizeof(*q_hist->q_hist)*OCS_Q_HIST_SIZE); in ocs_queue_history_free()
1622 static void ocs_textbuf_segment_free(ocs_t *ocs, ocs_textbuf_segment_t *segment);
1680 return (textbuf->ocs != NULL); in ocs_textbuf_initialized()
1684 ocs_textbuf_alloc(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length) in ocs_textbuf_alloc() argument
1688 textbuf->ocs = ocs; in ocs_textbuf_alloc()
1713 segment = ocs_malloc(textbuf->ocs, sizeof(*segment), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_textbuf_segment_alloc()
1715 … segment->buffer = ocs_malloc(textbuf->ocs, textbuf->allocation_length, OCS_M_ZERO | OCS_M_NOWAIT); in ocs_textbuf_segment_alloc()
1728 ocs_textbuf_segment_free(textbuf->ocs, segment); in ocs_textbuf_segment_alloc()
1737 ocs_textbuf_segment_free(ocs_t *ocs, ocs_textbuf_segment_t *segment) in ocs_textbuf_segment_free() argument
1741 ocs_free(ocs, segment->buffer, segment->buffer_length); in ocs_textbuf_segment_free()
1743 ocs_free(ocs, segment, sizeof(*segment)); in ocs_textbuf_segment_free()
1766 ocs_textbuf_init(ocs_t *ocs, ocs_textbuf_t *textbuf, void *buffer, uint32_t length) in ocs_textbuf_init() argument
1773 textbuf->ocs = ocs; in ocs_textbuf_init()
1775 segment = ocs_malloc(ocs, sizeof(*segment), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_textbuf_init()
1789 ocs_textbuf_free(ocs_t *ocs, ocs_textbuf_t *textbuf) in ocs_textbuf_free() argument
1797 ocs_textbuf_segment_free(ocs, segment); in ocs_textbuf_free()
1853 ocs_log_err(textbuf->ocs, "alloc segment failed\n"); in ocs_textbuf_vprintf()
1975 ocs_textbuf_segment_free(textbuf->ocs, segment); in ocs_textbuf_reset()
2212 * C compilers, and OCS SDK API
2302 * @param ocs Pointer to driver structure.
2309 ocs_ramlog_init(ocs_t *ocs, uint32_t buffer_len, uint32_t buffer_count) in ocs_ramlog_init() argument
2315 ramlog = ocs_malloc(ocs, sizeof(*ramlog), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_ramlog_init()
2317 ocs_log_err(ocs, "ocs_malloc ramlog failed\n"); in ocs_ramlog_init()
2323 …ramlog->textbufs = ocs_malloc(ocs, sizeof(*ramlog->textbufs)*buffer_count, OCS_M_ZERO | OCS_M_NOWA… in ocs_ramlog_init()
2325 ocs_log_err(ocs, "ocs_malloc textbufs failed\n"); in ocs_ramlog_init()
2326 ocs_ramlog_free(ocs, ramlog); in ocs_ramlog_init()
2331 rc = ocs_textbuf_alloc(ocs, &ramlog->textbufs[i], buffer_len); in ocs_ramlog_init()
2333 ocs_log_err(ocs, "ocs_textbuf_alloc failed\n"); in ocs_ramlog_init()
2334 ocs_ramlog_free(ocs, ramlog); in ocs_ramlog_init()
2343 ocs_lock_init(ocs, &ramlog->lock, "ramlog_lock[%d]", ocs_instance(ocs)); in ocs_ramlog_init()
2352 * @param ocs Pointer to driver structure.
2359 ocs_ramlog_free(ocs_t *ocs, ocs_ramlog_t *ramlog) in ocs_ramlog_free() argument
2367 ocs_textbuf_free(ocs, &ramlog->textbufs[i]); in ocs_ramlog_free()
2370 ocs_free(ocs, ramlog->textbufs, ramlog->textbuf_count*sizeof(*ramlog->textbufs)); in ocs_ramlog_free()
2373 ocs_free(ocs, ramlog, sizeof(*ramlog)); in ocs_ramlog_free()
2382 * @param ocs Pointer to driver structure.
2391 ocs_ramlog_clear(ocs_t *ocs, ocs_ramlog_t *ramlog, int clear_start_of_day, int clear_recent) in ocs_ramlog_clear() argument
2424 ocs_t *ocs = os; in ocs_ramlog_printf() local
2428 if (ocs == NULL || ocs->ramlog == NULL) { in ocs_ramlog_printf()
2433 res = ocs_ramlog_vprintf(ocs->ramlog, fmt, ap); in ocs_ramlog_printf()