Lines Matching refs:q_sz

295 					u32 q_sz)  in iwl_mei_write_cyclic_buf()  argument
302 if (rd > q_sz || wr > q_sz) { in iwl_mei_write_cyclic_buf()
308 room_in_buf = wr >= rd ? q_sz - wr + rd : rd - wr; in iwl_mei_write_cyclic_buf()
317 if (wr + tx_sz <= q_sz) { in iwl_mei_write_cyclic_buf()
320 memcpy(q_head + wr, hdr, q_sz - wr); in iwl_mei_write_cyclic_buf()
321 memcpy(q_head, (const u8 *)hdr + q_sz - wr, tx_sz - (q_sz - wr)); in iwl_mei_write_cyclic_buf()
324 WRITE_ONCE(notif_q->wr_ptr, cpu_to_le32((wr + tx_sz) % q_sz)); in iwl_mei_write_cyclic_buf()
396 u32 q_sz; in iwl_mei_send_sap_msg_payload() local
419 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_HOST_TO_ME][SAP_QUEUE_IDX_NOTIF]; in iwl_mei_send_sap_msg_payload()
420 ret = iwl_mei_write_cyclic_buf(q_head, notif_q, q_head, hdr, q_sz); in iwl_mei_send_sap_msg_payload()
438 u32 q_sz; in iwl_mei_add_data_to_ring() local
470 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_HOST_TO_ME][SAP_QUEUE_IDX_DATA]; in iwl_mei_add_data_to_ring()
478 if (rd > q_sz || wr > q_sz) { in iwl_mei_add_data_to_ring()
484 room_in_buf = wr >= rd ? q_sz - wr + rd : rd - wr; in iwl_mei_add_data_to_ring()
518 if (wr + tx_sz <= q_sz) { in iwl_mei_add_data_to_ring()
521 skb_copy_bits(skb, 0, q_head + wr, q_sz - wr); in iwl_mei_add_data_to_ring()
522 skb_copy_bits(skb, q_sz - wr, q_head, tx_sz - (q_sz - wr)); in iwl_mei_add_data_to_ring()
525 WRITE_ONCE(notif_q->wr_ptr, cpu_to_le32((wr + tx_sz) % q_sz)); in iwl_mei_add_data_to_ring()
978 static void iwl_mei_read_from_q(const u8 *q_head, u32 q_sz, in iwl_mei_read_from_q() argument
985 if (rd + len <= q_sz) { in iwl_mei_read_from_q()
989 memcpy(buf, q_head + rd, q_sz - rd); in iwl_mei_read_from_q()
990 memcpy(buf + q_sz - rd, q_head, len - (q_sz - rd)); in iwl_mei_read_from_q()
991 rd = len - (q_sz - rd); in iwl_mei_read_from_q()
1002 const u8 *q_head, u32 q_sz, in iwl_mei_handle_sap_data() argument
1020 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, &hdr, sizeof(hdr)); in iwl_mei_handle_sap_data()
1053 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, in iwl_mei_handle_sap_data()
1062 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, data, len); in iwl_mei_handle_sap_data()
1076 const u8 *q_head, u32 q_sz, in iwl_mei_handle_sap_rx_cmd() argument
1090 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, hdr, sizeof(*hdr)); in iwl_mei_handle_sap_rx_cmd()
1097 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, hdr + 1, len); in iwl_mei_handle_sap_rx_cmd()
1116 u32 q_sz) in iwl_mei_handle_sap_rx() argument
1122 if (rd > q_sz || wr > q_sz) { in iwl_mei_handle_sap_rx()
1131 valid_rx_sz = wr > rd ? wr - rd : q_sz - rd + wr; in iwl_mei_handle_sap_rx()
1134 iwl_mei_handle_sap_data(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1137 iwl_mei_handle_sap_rx_cmd(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1151 u32 q_sz; in iwl_mei_handle_check_shared_area() local
1159 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_ME_TO_HOST][SAP_QUEUE_IDX_NOTIF]; in iwl_mei_handle_check_shared_area()
1166 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, NULL, q_sz); in iwl_mei_handle_check_shared_area()
1172 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_ME_TO_HOST][SAP_QUEUE_IDX_DATA]; in iwl_mei_handle_check_shared_area()
1176 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, &tx_skbs, q_sz); in iwl_mei_handle_check_shared_area()