Go to the documentation of this file.
57 static inline int carl9170_flush_cab(
struct ar9170 *
ar,
58 const unsigned int vif_id)
63 static inline int carl9170_rx_filter(
struct ar9170 *
ar,
64 const unsigned int _rx_filter)
69 sizeof(rx_filter), (
u8 *)&rx_filter,
82 #define carl9170_regwrite_begin(ar) \
84 int __nreg = 0, __err = 0; \
85 struct ar9170 *__ar = ar;
87 #define carl9170_regwrite(r, v) do { \
88 __ar->cmd_buf[2 * __nreg + 1] = cpu_to_le32(r); \
89 __ar->cmd_buf[2 * __nreg + 2] = cpu_to_le32(v); \
91 if ((__nreg >= PAYLOAD_MAX / 2)) { \
92 if (IS_ACCEPTING_CMD(__ar)) \
93 __err = carl9170_exec_cmd(__ar, \
94 CARL9170_CMD_WREG, 8 * __nreg, \
95 (u8 *) &__ar->cmd_buf[1], 0, NULL); \
97 goto __regwrite_out; \
101 goto __regwrite_out; \
105 #define carl9170_regwrite_finish() \
107 if (__err == 0 && __nreg) { \
108 if (IS_ACCEPTING_CMD(__ar)) \
109 __err = carl9170_exec_cmd(__ar, \
110 CARL9170_CMD_WREG, 8 * __nreg, \
111 (u8 *) &__ar->cmd_buf[1], 0, NULL); \
115 #define carl9170_regwrite_result() \
120 #define carl9170_async_regwrite_get_buf() \
123 __cmd = carl9170_cmd_buf(__carl, CARL9170_CMD_WREG_ASYNC, \
124 CARL9170_MAX_CMD_PAYLOAD_LEN); \
125 if (__cmd == NULL) { \
127 goto __async_regwrite_out; \
131 #define carl9170_async_regwrite_begin(carl) \
133 struct ar9170 *__carl = carl; \
134 struct carl9170_cmd *__cmd; \
135 unsigned int __nreg; \
137 carl9170_async_regwrite_get_buf(); \
139 #define carl9170_async_regwrite_flush() \
141 if (__cmd == NULL || __nreg == 0) \
144 if (IS_ACCEPTING_CMD(__carl) && __nreg) { \
145 __cmd->hdr.len = 8 * __nreg; \
146 __err = __carl9170_exec_cmd(__carl, __cmd, true); \
150 goto __async_regwrite_out; \
153 #define carl9170_async_regwrite(r, v) do { \
155 carl9170_async_regwrite_get_buf(); \
156 __cmd->wreg.regs[__nreg].addr = cpu_to_le32(r); \
157 __cmd->wreg.regs[__nreg].val = cpu_to_le32(v); \
159 if ((__nreg >= PAYLOAD_MAX / 2)) \
160 carl9170_async_regwrite_flush(); \
163 #define carl9170_async_regwrite_finish() do { \
164 __async_regwrite_out: \
165 if (__cmd != NULL && __err == 0) \
166 carl9170_async_regwrite_flush(); \
170 #define carl9170_async_regwrite_result() \