Lines Matching defs:q_type

210 #define TW_CLI_Q_INIT(ctlr, q_type)	do {				\
211 (ctlr)->q_stats[q_type].cur_len = 0; \
212 (ctlr)->q_stats[q_type].max_len = 0; \
215 #define TW_CLI_Q_INSERT(ctlr, q_type) do { \
216 struct tw_cli_q_stats *q_stats = &((ctlr)->q_stats[q_type]); \
222 #define TW_CLI_Q_REMOVE(ctlr, q_type) \
223 (ctlr)->q_stats[q_type].cur_len--
235 tw_cli_req_q_init(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
237 TW_CL_Q_INIT(&(ctlr->req_q_head[q_type]));
238 TW_CLI_Q_INIT(ctlr, q_type);
241 /* Insert the given request at the head of the given queue (q_type). */
243 tw_cli_req_q_insert_head(struct tw_cli_req_context *req, TW_UINT8 q_type)
248 TW_CL_Q_INSERT_HEAD(&(ctlr->req_q_head[q_type]), &(req->link));
249 TW_CLI_Q_INSERT(ctlr, q_type);
253 /* Insert the given request at the tail of the given queue (q_type). */
255 tw_cli_req_q_insert_tail(struct tw_cli_req_context *req, TW_UINT8 q_type)
260 TW_CL_Q_INSERT_TAIL(&(ctlr->req_q_head[q_type]), &(req->link));
261 TW_CLI_Q_INSERT(ctlr, q_type);
265 /* Remove and return the request at the head of the given queue (q_type). */
267 tw_cli_req_q_remove_head(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
273 if ((link = TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[q_type]))) !=
277 TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link));
278 TW_CLI_Q_REMOVE(ctlr, q_type);
284 /* Remove the given request from the given queue (q_type). */
286 tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type)
291 TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link));
292 TW_CLI_Q_REMOVE(ctlr, q_type);