Lines Matching refs:q_sz
335 u32 q_sz) in iwl_mei_write_cyclic_buf() argument
342 if (rd > q_sz || wr > q_sz) { in iwl_mei_write_cyclic_buf()
348 room_in_buf = wr >= rd ? q_sz - wr + rd : rd - wr; in iwl_mei_write_cyclic_buf()
357 if (wr + tx_sz <= q_sz) { in iwl_mei_write_cyclic_buf()
360 memcpy(q_head + wr, hdr, q_sz - wr); in iwl_mei_write_cyclic_buf()
361 memcpy(q_head, (const u8 *)hdr + q_sz - wr, tx_sz - (q_sz - wr)); in iwl_mei_write_cyclic_buf()
364 WRITE_ONCE(notif_q->wr_ptr, cpu_to_le32((wr + tx_sz) % q_sz)); in iwl_mei_write_cyclic_buf()
436 u32 q_sz; in iwl_mei_send_sap_msg_payload() local
459 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_HOST_TO_ME][SAP_QUEUE_IDX_NOTIF]; in iwl_mei_send_sap_msg_payload()
460 ret = iwl_mei_write_cyclic_buf(q_head, notif_q, q_head, hdr, q_sz); in iwl_mei_send_sap_msg_payload()
478 u32 q_sz; in iwl_mei_add_data_to_ring() local
510 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_HOST_TO_ME][SAP_QUEUE_IDX_DATA]; in iwl_mei_add_data_to_ring()
518 if (rd > q_sz || wr > q_sz) { in iwl_mei_add_data_to_ring()
524 room_in_buf = wr >= rd ? q_sz - wr + rd : rd - wr; in iwl_mei_add_data_to_ring()
558 if (wr + tx_sz <= q_sz) { in iwl_mei_add_data_to_ring()
561 skb_copy_bits(skb, 0, q_head + wr, q_sz - wr); in iwl_mei_add_data_to_ring()
562 skb_copy_bits(skb, q_sz - wr, q_head, tx_sz - (q_sz - wr)); in iwl_mei_add_data_to_ring()
565 WRITE_ONCE(notif_q->wr_ptr, cpu_to_le32((wr + tx_sz) % q_sz)); in iwl_mei_add_data_to_ring()
1035 static void iwl_mei_read_from_q(const u8 *q_head, u32 q_sz, in iwl_mei_read_from_q() argument
1042 if (rd + len <= q_sz) { in iwl_mei_read_from_q()
1046 memcpy(buf, q_head + rd, q_sz - rd); in iwl_mei_read_from_q()
1047 memcpy(buf + q_sz - rd, q_head, len - (q_sz - rd)); in iwl_mei_read_from_q()
1048 rd = len - (q_sz - rd); in iwl_mei_read_from_q()
1059 const u8 *q_head, u32 q_sz, in iwl_mei_handle_sap_data() argument
1077 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, &hdr, sizeof(hdr)); in iwl_mei_handle_sap_data()
1110 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, in iwl_mei_handle_sap_data()
1119 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, data, len); in iwl_mei_handle_sap_data()
1133 const u8 *q_head, u32 q_sz, in iwl_mei_handle_sap_rx_cmd() argument
1147 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, hdr, sizeof(*hdr)); in iwl_mei_handle_sap_rx_cmd()
1154 iwl_mei_read_from_q(q_head, q_sz, &rd, wr, hdr + 1, len); in iwl_mei_handle_sap_rx_cmd()
1173 u32 q_sz) in iwl_mei_handle_sap_rx() argument
1179 if (rd > q_sz || wr > q_sz) { in iwl_mei_handle_sap_rx()
1188 valid_rx_sz = wr > rd ? wr - rd : q_sz - rd + wr; in iwl_mei_handle_sap_rx()
1191 iwl_mei_handle_sap_data(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1194 iwl_mei_handle_sap_rx_cmd(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1208 u32 q_sz; in iwl_mei_handle_check_shared_area() local
1216 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_ME_TO_HOST][SAP_QUEUE_IDX_NOTIF]; in iwl_mei_handle_check_shared_area()
1223 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, NULL, q_sz); in iwl_mei_handle_check_shared_area()
1229 q_sz = mei->shared_mem.q_size[SAP_DIRECTION_ME_TO_HOST][SAP_QUEUE_IDX_DATA]; in iwl_mei_handle_check_shared_area()
1233 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, &tx_skbs, q_sz); in iwl_mei_handle_check_shared_area()