Lines Matching refs:tail
17 fifo->tail = 0; in fm10k_fifo_init()
28 return fifo->tail - fifo->head; in fm10k_fifo_used()
39 return fifo->size + fifo->head - fifo->tail; in fm10k_fifo_unused()
50 return fifo->head == fifo->tail; in fm10k_fifo_empty()
74 return (fifo->tail + offset) & (fifo->size - 1); in fm10k_fifo_tail_offset()
120 fifo->head = fifo->tail; in fm10k_fifo_drop_all()
132 static u16 fm10k_mbx_index_len(struct fm10k_mbx_info *mbx, u16 head, u16 tail) in fm10k_mbx_index_len() argument
134 u16 len = tail - head; in fm10k_mbx_index_len()
137 if (len > tail) in fm10k_mbx_index_len()
153 u16 tail = (mbx->tail + offset + 1) & ((mbx->mbmem_len << 1) - 1); in fm10k_mbx_tail_add() local
156 return (tail > mbx->tail) ? --tail : ++tail; in fm10k_mbx_tail_add()
169 u16 tail = (mbx->tail - offset - 1) & ((mbx->mbmem_len << 1) - 1); in fm10k_mbx_tail_sub() local
172 return (tail < mbx->tail) ? ++tail : --tail; in fm10k_mbx_tail_sub()
216 u32 *tail = mbx->rx.buffer + fm10k_fifo_tail_offset(&mbx->rx, 0); in fm10k_mbx_pushed_tail_len() local
222 return FM10K_TLV_DWORD_LEN(*tail); in fm10k_mbx_pushed_tail_len()
240 u32 *tail = fifo->buffer + end; in fm10k_fifo_write_copy() local
252 memcpy(tail, msg, end << 2); in fm10k_fifo_write_copy()
283 fifo->tail += len; in fm10k_fifo_enqueue()
336 u16 end, len, tail, mask; in fm10k_mbx_write_copy() local
344 tail = fm10k_mbx_tail_sub(mbx, len); in fm10k_mbx_write_copy()
345 if (tail > mask) in fm10k_mbx_write_copy()
346 tail++; in fm10k_mbx_write_copy()
359 tail &= mask; in fm10k_mbx_write_copy()
360 if (!tail) in fm10k_mbx_write_copy()
361 tail++; in fm10k_mbx_write_copy()
366 fm10k_write_reg(hw, mbmem + tail++, *(head++)); in fm10k_mbx_write_copy()
385 u16 mbmem_len, len, ack = fm10k_mbx_index_len(mbx, head, mbx->tail); in fm10k_mbx_pull_head()
398 mbx->tail = fm10k_mbx_tail_add(mbx, len - ack); in fm10k_mbx_pull_head()
428 u32 *tail = fifo->buffer; in fm10k_mbx_read_copy() local
439 tail += end; in fm10k_mbx_read_copy()
442 for (end = fifo->size - end; len; tail = fifo->buffer) { in fm10k_mbx_read_copy()
452 *(tail++) = fm10k_read_reg(hw, mbmem + head++); in fm10k_mbx_read_copy()
473 u16 tail) in fm10k_mbx_push_tail() argument
476 u16 len, seq = fm10k_mbx_index_len(mbx, mbx->head, tail); in fm10k_mbx_push_tail()
505 fifo->tail += len; in fm10k_mbx_push_tail()
619 u16 len = mbx->tail_len - fm10k_mbx_index_len(mbx, head, mbx->tail); in fm10k_mbx_update_local_crc()
720 memmove(fifo->buffer, fifo->buffer + fifo->tail, mbx->pushed << 2); in fm10k_mbx_dequeue_rx()
723 fifo->tail -= fifo->head; in fm10k_mbx_dequeue_rx()
854 FM10K_MSG_HDR_FIELD_SET(mbx->tail, TAIL) | in fm10k_mbx_create_data_hdr()
880 FM10K_MSG_HDR_FIELD_SET(mbx->tail, TAIL) | in fm10k_mbx_create_disconnect_hdr()
902 FM10K_MSG_HDR_FIELD_SET(mbx->tail, HEAD); in fm10k_mbx_create_fake_disconnect_hdr()
952 u16 type, rsvd0, head, tail, size; in fm10k_mbx_validate_msg_hdr() local
957 tail = FM10K_MSG_HDR_FIELD_GET(*hdr, TAIL); in fm10k_mbx_validate_msg_hdr()
967 if (tail != mbx->head) in fm10k_mbx_validate_msg_hdr()
975 if (fm10k_mbx_index_len(mbx, head, mbx->tail) > mbx->tail_len) in fm10k_mbx_validate_msg_hdr()
979 if (!tail || (tail == FM10K_MSG_HDR_MASK(TAIL))) in fm10k_mbx_validate_msg_hdr()
981 if (fm10k_mbx_index_len(mbx, mbx->head, tail) < mbx->mbmem_len) in fm10k_mbx_validate_msg_hdr()
995 if (tail) in fm10k_mbx_validate_msg_hdr()
1067 ack = fm10k_mbx_index_len(mbx, head, mbx->tail); in fm10k_mbx_reset_work()
1085 mbx->rx.tail = 0; in fm10k_mbx_reset_work()
1180 mbx->tail = head; in fm10k_mbx_process_connect()
1198 u16 head, tail; in fm10k_mbx_process_data() local
1203 tail = FM10K_MSG_HDR_FIELD_GET(*hdr, TAIL); in fm10k_mbx_process_data()
1207 mbx->tail = head; in fm10k_mbx_process_data()
1212 err = fm10k_mbx_push_tail(hw, mbx, tail); in fm10k_mbx_process_data()
1267 if (head != mbx->tail) in fm10k_mbx_process_disconnect()
1309 mbx->tail = head; in fm10k_mbx_process_error()
1324 return fm10k_mbx_create_reply(hw, mbx, mbx->tail); in fm10k_mbx_process_error()
1596 mbx->tail = 1; in fm10k_pfvf_mbx_init()
1636 mbx->mbx_hdr = FM10K_MSG_HDR_FIELD_SET(mbx->tail, SM_TAIL) | in fm10k_sm_mbx_create_data_hdr()
1653 mbx->mbx_hdr = FM10K_MSG_HDR_FIELD_SET(mbx->tail, SM_TAIL) | in fm10k_sm_mbx_create_connect_hdr()
1675 mbx->tail = 1; in fm10k_sm_mbx_connect_reset()
1775 u16 tail, head, ver; in fm10k_sm_mbx_validate_fifo_hdr() local
1777 tail = FM10K_MSG_HDR_FIELD_GET(*hdr, SM_TAIL); in fm10k_sm_mbx_validate_fifo_hdr()
1787 if (!tail || tail > FM10K_SM_MBX_FIFO_LEN) in fm10k_sm_mbx_validate_fifo_hdr()
1789 if (mbx->tail < head) in fm10k_sm_mbx_validate_fifo_hdr()
1791 if (tail < mbx->head) in fm10k_sm_mbx_validate_fifo_hdr()
1792 tail += mbx->mbmem_len - 1; in fm10k_sm_mbx_validate_fifo_hdr()
1793 if (fm10k_mbx_index_len(mbx, head, mbx->tail) > mbx->tail_len) in fm10k_sm_mbx_validate_fifo_hdr()
1795 if (fm10k_mbx_index_len(mbx, mbx->head, tail) < mbx->mbmem_len) in fm10k_sm_mbx_validate_fifo_hdr()
1880 u16 tail) in fm10k_sm_mbx_receive() argument
1887 if (tail < mbx->head) in fm10k_sm_mbx_receive()
1888 tail += mbmem_len; in fm10k_sm_mbx_receive()
1891 err = fm10k_mbx_push_tail(hw, mbx, tail); in fm10k_sm_mbx_receive()
1927 if (mbx->tail < head) in fm10k_sm_mbx_transmit()
1943 mbx->tail = fm10k_mbx_tail_sub(mbx, mbx->tail_len - tail_len); in fm10k_sm_mbx_transmit()
1948 if (mbx->tail > mbmem_len) in fm10k_sm_mbx_transmit()
1949 mbx->tail -= mbmem_len; in fm10k_sm_mbx_transmit()
2026 fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail); in fm10k_sm_mbx_process_reset()
2043 u16 head, tail; in fm10k_sm_mbx_process_version_1() local
2047 tail = FM10K_MSG_HDR_FIELD_GET(*hdr, SM_TAIL); in fm10k_sm_mbx_process_version_1()
2062 len = fm10k_sm_mbx_receive(hw, mbx, tail); in fm10k_sm_mbx_process_version_1()