Go to the documentation of this file.
28 #ifndef _CRYSTALHD_MISC_H_
29 #define _CRYSTALHD_MISC_H_
33 #include <linux/module.h>
34 #include <linux/kernel.h>
35 #include <linux/errno.h>
36 #include <linux/string.h>
39 #include <linux/sched.h>
50 #define BC_LINK_ELEM_POOL_SZ ((BC_TX_LIST_CNT * 2) + BC_RX_LIST_CNT + 2 + 4)
53 #define CHD_IODATA_POOL_SZ (BC_IOCTL_DATA_POOL_SIZE * BC_LINK_MAX_OPENS)
56 #define BC_LINK_SG_POOL_SZ (BC_TX_LIST_CNT + BC_RX_LIST_CNT)
95 #define BC_LINK_DIOQ_SIG (0x09223280)
141 #define crystalhd_create_event(_ev) init_waitqueue_head(_ev)
142 #define crystalhd_set_event(_ev) wake_up_interruptible(_ev)
143 #define crystalhd_wait_on_event(ev, condition, timeout, ret, nosig) \
145 DECLARE_WAITQUEUE(entry, current); \
146 unsigned long end = jiffies + ((timeout * HZ) / 1000); \
148 add_wait_queue(ev, &entry); \
150 __set_current_state(TASK_INTERRUPTIBLE); \
154 if (time_after_eq(jiffies, end)) { \
158 schedule_timeout((HZ / 100 > 1) ? HZ / 100 : 1); \
159 if (!nosig && signal_pending(current)) { \
164 __set_current_state(TASK_RUNNING); \
165 remove_wait_queue(ev, &entry); \
175 #define crystalhd_get_sgle_paddr(_dio, _ix) (cpu_to_le64(sg_dma_address(&_dio->sg[_ix])))
176 #define crystalhd_get_sgle_len(_dio, _ix) (cpu_to_le32(sg_dma_len(&_dio->sg[_ix])))
186 #define crystalhd_dioq_count(_ioq) ((_ioq) ? _ioq->count : 0)
207 #define BCMLOG(trace, fmt, args...) \
209 if (g_linklog_level & trace) \
210 printk(fmt, ##args); \
214 #define BCMLOG_ERR(fmt, args...) \
216 if (g_linklog_level & BCMLOG_ERROR) \
217 printk(KERN_ERR "*ERR*:%s:%d: "fmt, \
218 __FILE__, __LINE__, ##args); \