Lines Matching refs:ptl
335 ptl_info(packet->ptl, "packet error injection: dropping ACK packet %p\n", in __ssh_ptl_should_drop_ack_packet()
347 ptl_info(packet->ptl, "packet error injection: dropping NAK packet %p\n", in __ssh_ptl_should_drop_nak_packet()
359 ptl_info(packet->ptl, in __ssh_ptl_should_drop_dsq_packet()
387 static int ssh_ptl_write_buf(struct ssh_ptl *ptl, struct ssh_packet *packet, in ssh_ptl_write_buf() argument
395 ptl_info(packet->ptl, in ssh_ptl_write_buf()
402 return serdev_device_write_buf(ptl->serdev, buf, count); in ssh_ptl_write_buf()
419 ptl_info(packet->ptl, in ssh_ptl_tx_inject_invalid_data()
431 static void ssh_ptl_rx_inject_invalid_syn(struct ssh_ptl *ptl, in ssh_ptl_rx_inject_invalid_syn() argument
448 static void ssh_ptl_rx_inject_invalid_data(struct ssh_ptl *ptl, in ssh_ptl_rx_inject_invalid_data() argument
486 static inline int ssh_ptl_write_buf(struct ssh_ptl *ptl, in ssh_ptl_write_buf() argument
491 return serdev_device_write_buf(ptl->serdev, buf, count); in ssh_ptl_write_buf()
498 static inline void ssh_ptl_rx_inject_invalid_syn(struct ssh_ptl *ptl, in ssh_ptl_rx_inject_invalid_syn() argument
503 static inline void ssh_ptl_rx_inject_invalid_data(struct ssh_ptl *ptl, in ssh_ptl_rx_inject_invalid_data() argument
516 ptl_dbg_cond(p->ptl, "ptl: releasing packet %p\n", p); in __ssh_ptl_packet_release()
577 packet->ptl = NULL; in ssh_packet_init()
663 static void ssh_ptl_timeout_reaper_mod(struct ssh_ptl *ptl, ktime_t now, in ssh_ptl_timeout_reaper_mod() argument
669 spin_lock(&ptl->rtx_timeout.lock); in ssh_ptl_timeout_reaper_mod()
672 if (ktime_before(aexp, ptl->rtx_timeout.expires)) { in ssh_ptl_timeout_reaper_mod()
673 ptl->rtx_timeout.expires = expires; in ssh_ptl_timeout_reaper_mod()
674 mod_delayed_work(system_wq, &ptl->rtx_timeout.reaper, delta); in ssh_ptl_timeout_reaper_mod()
677 spin_unlock(&ptl->rtx_timeout.lock); in ssh_ptl_timeout_reaper_mod()
686 lockdep_assert_held(&p->ptl->queue.lock); in ssh_packet_next_try()
702 lockdep_assert_held(&p->ptl->queue.lock); in __ssh_ptl_queue_find_entrypoint()
718 list_for_each(head, &p->ptl->queue.head) { in __ssh_ptl_queue_find_entrypoint()
725 list_for_each_prev(head, &p->ptl->queue.head) { in __ssh_ptl_queue_find_entrypoint()
741 struct ssh_ptl *ptl = packet->ptl; in __ssh_ptl_queue_push() local
744 lockdep_assert_held(&ptl->queue.lock); in __ssh_ptl_queue_push()
746 if (test_bit(SSH_PTL_SF_SHUTDOWN_BIT, &ptl->state)) in __ssh_ptl_queue_push()
767 spin_lock(&packet->ptl->queue.lock); in ssh_ptl_queue_push()
769 spin_unlock(&packet->ptl->queue.lock); in ssh_ptl_queue_push()
776 struct ssh_ptl *ptl = packet->ptl; in ssh_ptl_queue_remove() local
778 spin_lock(&ptl->queue.lock); in ssh_ptl_queue_remove()
781 spin_unlock(&ptl->queue.lock); in ssh_ptl_queue_remove()
787 spin_unlock(&ptl->queue.lock); in ssh_ptl_queue_remove()
793 struct ssh_ptl *ptl = p->ptl; in ssh_ptl_pending_push() local
795 const ktime_t timeout = ptl->rtx_timeout.timeout; in ssh_ptl_pending_push()
804 spin_lock(&ptl->pending.lock); in ssh_ptl_pending_push()
808 spin_unlock(&ptl->pending.lock); in ssh_ptl_pending_push()
821 atomic_inc(&ptl->pending.count); in ssh_ptl_pending_push()
822 list_add_tail(&ssh_packet_get(p)->pending_node, &ptl->pending.head); in ssh_ptl_pending_push()
825 spin_unlock(&ptl->pending.lock); in ssh_ptl_pending_push()
828 ssh_ptl_timeout_reaper_mod(ptl, timestamp, timestamp + timeout); in ssh_ptl_pending_push()
833 struct ssh_ptl *ptl = packet->ptl; in ssh_ptl_pending_remove() local
835 spin_lock(&ptl->pending.lock); in ssh_ptl_pending_remove()
838 spin_unlock(&ptl->pending.lock); in ssh_ptl_pending_remove()
843 atomic_dec(&ptl->pending.count); in ssh_ptl_pending_remove()
845 spin_unlock(&ptl->pending.lock); in ssh_ptl_pending_remove()
853 struct ssh_ptl *ptl = READ_ONCE(p->ptl); in __ssh_ptl_complete() local
856 ptl_dbg_cond(ptl, "ptl: completing packet %p (status: %d)\n", p, status); in __ssh_ptl_complete()
885 struct ssh_ptl *ptl = packet->ptl; in ssh_ptl_tx_can_process() local
888 return !atomic_read(&ptl->pending.count); in ssh_ptl_tx_can_process()
899 return atomic_read(&ptl->pending.count) < SSH_PTL_MAX_PENDING; in ssh_ptl_tx_can_process()
902 static struct ssh_packet *ssh_ptl_tx_pop(struct ssh_ptl *ptl) in ssh_ptl_tx_pop() argument
907 spin_lock(&ptl->queue.lock); in ssh_ptl_tx_pop()
908 list_for_each_entry_safe(p, n, &ptl->queue.head, queue_node) { in ssh_ptl_tx_pop()
950 spin_unlock(&ptl->queue.lock); in ssh_ptl_tx_pop()
955 static struct ssh_packet *ssh_ptl_tx_next(struct ssh_ptl *ptl) in ssh_ptl_tx_next() argument
959 p = ssh_ptl_tx_pop(ptl); in ssh_ptl_tx_next()
964 ptl_dbg(ptl, "ptl: transmitting sequenced packet %p\n", p); in ssh_ptl_tx_next()
967 ptl_dbg(ptl, "ptl: transmitting non-sequenced packet %p\n", p); in ssh_ptl_tx_next()
975 struct ssh_ptl *ptl = packet->ptl; in ssh_ptl_tx_compl_success() local
977 ptl_dbg(ptl, "ptl: successfully transmitted packet %p\n", packet); in ssh_ptl_tx_compl_success()
995 wake_up_all(&ptl->tx.packet_wq); in ssh_ptl_tx_compl_success()
1006 ptl_err(packet->ptl, "ptl: transmission error: %d\n", status); in ssh_ptl_tx_compl_error()
1007 ptl_dbg(packet->ptl, "ptl: failed to transmit packet: %p\n", packet); in ssh_ptl_tx_compl_error()
1015 wake_up_all(&packet->ptl->tx.packet_wq); in ssh_ptl_tx_compl_error()
1018 static long ssh_ptl_tx_wait_packet(struct ssh_ptl *ptl) in ssh_ptl_tx_wait_packet() argument
1022 status = wait_for_completion_interruptible(&ptl->tx.thread_cplt_pkt); in ssh_ptl_tx_wait_packet()
1023 reinit_completion(&ptl->tx.thread_cplt_pkt); in ssh_ptl_tx_wait_packet()
1034 static long ssh_ptl_tx_wait_transfer(struct ssh_ptl *ptl, long timeout) in ssh_ptl_tx_wait_transfer() argument
1038 status = wait_for_completion_interruptible_timeout(&ptl->tx.thread_cplt_tx, in ssh_ptl_tx_wait_transfer()
1040 reinit_completion(&ptl->tx.thread_cplt_tx); in ssh_ptl_tx_wait_transfer()
1051 static int ssh_ptl_tx_packet(struct ssh_ptl *ptl, struct ssh_packet *packet) in ssh_ptl_tx_packet() argument
1067 ptl_dbg(ptl, "tx: sending data (length: %zu)\n", packet->data.len); in ssh_ptl_tx_packet()
1078 status = ssh_ptl_write_buf(ptl, packet, buf, len); in ssh_ptl_tx_packet()
1087 timeout = ssh_ptl_tx_wait_transfer(ptl, timeout); in ssh_ptl_tx_packet()
1088 if (kthread_should_stop() || !atomic_read(&ptl->tx.running)) in ssh_ptl_tx_packet()
1101 struct ssh_ptl *ptl = data; in ssh_ptl_tx_threadfn() local
1103 while (!kthread_should_stop() && atomic_read(&ptl->tx.running)) { in ssh_ptl_tx_threadfn()
1108 packet = ssh_ptl_tx_next(ptl); in ssh_ptl_tx_threadfn()
1112 ssh_ptl_tx_wait_packet(ptl); in ssh_ptl_tx_threadfn()
1117 status = ssh_ptl_tx_packet(ptl, packet); in ssh_ptl_tx_threadfn()
1138 static void ssh_ptl_tx_wakeup_packet(struct ssh_ptl *ptl) in ssh_ptl_tx_wakeup_packet() argument
1140 if (test_bit(SSH_PTL_SF_SHUTDOWN_BIT, &ptl->state)) in ssh_ptl_tx_wakeup_packet()
1143 complete(&ptl->tx.thread_cplt_pkt); in ssh_ptl_tx_wakeup_packet()
1152 int ssh_ptl_tx_start(struct ssh_ptl *ptl) in ssh_ptl_tx_start() argument
1154 atomic_set_release(&ptl->tx.running, 1); in ssh_ptl_tx_start()
1156 ptl->tx.thread = kthread_run(ssh_ptl_tx_threadfn, ptl, "ssam_serial_hub-tx"); in ssh_ptl_tx_start()
1157 if (IS_ERR(ptl->tx.thread)) in ssh_ptl_tx_start()
1158 return PTR_ERR(ptl->tx.thread); in ssh_ptl_tx_start()
1169 int ssh_ptl_tx_stop(struct ssh_ptl *ptl) in ssh_ptl_tx_stop() argument
1173 if (!IS_ERR_OR_NULL(ptl->tx.thread)) { in ssh_ptl_tx_stop()
1175 atomic_set_release(&ptl->tx.running, 0); in ssh_ptl_tx_stop()
1182 complete(&ptl->tx.thread_cplt_pkt); in ssh_ptl_tx_stop()
1183 complete(&ptl->tx.thread_cplt_tx); in ssh_ptl_tx_stop()
1186 status = kthread_stop(ptl->tx.thread); in ssh_ptl_tx_stop()
1187 ptl->tx.thread = NULL; in ssh_ptl_tx_stop()
1193 static struct ssh_packet *ssh_ptl_ack_pop(struct ssh_ptl *ptl, u8 seq_id) in ssh_ptl_ack_pop() argument
1198 spin_lock(&ptl->pending.lock); in ssh_ptl_ack_pop()
1199 list_for_each_entry_safe(p, n, &ptl->pending.head, pending_node) { in ssh_ptl_ack_pop()
1226 atomic_dec(&ptl->pending.count); in ssh_ptl_ack_pop()
1232 spin_unlock(&ptl->pending.lock); in ssh_ptl_ack_pop()
1239 wait_event(packet->ptl->tx.packet_wq, in ssh_ptl_wait_until_transmitted()
1244 static void ssh_ptl_acknowledge(struct ssh_ptl *ptl, u8 seq) in ssh_ptl_acknowledge() argument
1248 p = ssh_ptl_ack_pop(ptl, seq); in ssh_ptl_acknowledge()
1255 ptl_warn(ptl, "ptl: received ACK for non-pending packet\n"); in ssh_ptl_acknowledge()
1266 ptl_dbg(ptl, "ptl: received ACK for packet %p\n", p); in ssh_ptl_acknowledge()
1286 ptl_err(ptl, "ptl: received ACK before packet had been fully transmitted\n"); in ssh_ptl_acknowledge()
1295 if (atomic_read(&ptl->pending.count) < SSH_PTL_MAX_PENDING) in ssh_ptl_acknowledge()
1296 ssh_ptl_tx_wakeup_packet(ptl); in ssh_ptl_acknowledge()
1312 int ssh_ptl_submit(struct ssh_ptl *ptl, struct ssh_packet *p) in ssh_ptl_submit() argument
1334 ptl_old = READ_ONCE(p->ptl); in ssh_ptl_submit()
1336 WRITE_ONCE(p->ptl, ptl); in ssh_ptl_submit()
1337 else if (WARN_ON(ptl_old != ptl)) in ssh_ptl_submit()
1345 (atomic_read(&ptl->pending.count) < SSH_PTL_MAX_PENDING)) in ssh_ptl_submit()
1346 ssh_ptl_tx_wakeup_packet(ptl); in ssh_ptl_submit()
1368 lockdep_assert_held(&packet->ptl->pending.lock); in __ssh_ptl_resubmit()
1372 spin_lock(&packet->ptl->queue.lock); in __ssh_ptl_resubmit()
1377 spin_unlock(&packet->ptl->queue.lock); in __ssh_ptl_resubmit()
1388 spin_unlock(&packet->ptl->queue.lock); in __ssh_ptl_resubmit()
1394 spin_unlock(&packet->ptl->queue.lock); in __ssh_ptl_resubmit()
1398 static void ssh_ptl_resubmit_pending(struct ssh_ptl *ptl) in ssh_ptl_resubmit_pending() argument
1414 spin_lock(&ptl->pending.lock); in ssh_ptl_resubmit_pending()
1417 list_for_each_entry(p, &ptl->pending.head, pending_node) { in ssh_ptl_resubmit_pending()
1427 spin_unlock(&ptl->pending.lock); in ssh_ptl_resubmit_pending()
1430 ssh_ptl_tx_wakeup_packet(ptl); in ssh_ptl_resubmit_pending()
1478 if (READ_ONCE(p->ptl)) { in ssh_ptl_cancel()
1481 if (atomic_read(&p->ptl->pending.count) < SSH_PTL_MAX_PENDING) in ssh_ptl_cancel()
1482 ssh_ptl_tx_wakeup_packet(p->ptl); in ssh_ptl_cancel()
1492 lockdep_assert_held(&p->ptl->pending.lock); in ssh_packet_get_expiration()
1502 struct ssh_ptl *ptl = to_ssh_ptl(work, rtx_timeout.reaper.work); in ssh_ptl_timeout_reap() local
1506 ktime_t timeout = ptl->rtx_timeout.timeout; in ssh_ptl_timeout_reap()
1511 trace_ssam_ptl_timeout_reap(atomic_read(&ptl->pending.count)); in ssh_ptl_timeout_reap()
1517 spin_lock(&ptl->rtx_timeout.lock); in ssh_ptl_timeout_reap()
1518 ptl->rtx_timeout.expires = KTIME_MAX; in ssh_ptl_timeout_reap()
1519 spin_unlock(&ptl->rtx_timeout.lock); in ssh_ptl_timeout_reap()
1521 spin_lock(&ptl->pending.lock); in ssh_ptl_timeout_reap()
1523 list_for_each_entry_safe(p, n, &ptl->pending.head, pending_node) { in ssh_ptl_timeout_reap()
1569 atomic_dec(&ptl->pending.count); in ssh_ptl_timeout_reap()
1573 spin_unlock(&ptl->pending.lock); in ssh_ptl_timeout_reap()
1593 ssh_ptl_timeout_reaper_mod(ptl, now, next); in ssh_ptl_timeout_reap()
1596 ssh_ptl_tx_wakeup_packet(ptl); in ssh_ptl_timeout_reap()
1599 static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, const struct ssh_frame *frame) in ssh_ptl_rx_retransmit_check() argument
1623 for (i = 0; i < ARRAY_SIZE(ptl->rx.blocked.seqs); i++) { in ssh_ptl_rx_retransmit_check()
1624 if (likely(ptl->rx.blocked.seqs[i] != frame->seq)) in ssh_ptl_rx_retransmit_check()
1627 ptl_dbg(ptl, "ptl: ignoring repeated data packet\n"); in ssh_ptl_rx_retransmit_check()
1632 ptl->rx.blocked.seqs[ptl->rx.blocked.offset] = frame->seq; in ssh_ptl_rx_retransmit_check()
1633 ptl->rx.blocked.offset = (ptl->rx.blocked.offset + 1) in ssh_ptl_rx_retransmit_check()
1634 % ARRAY_SIZE(ptl->rx.blocked.seqs); in ssh_ptl_rx_retransmit_check()
1639 static void ssh_ptl_rx_dataframe(struct ssh_ptl *ptl, in ssh_ptl_rx_dataframe() argument
1643 if (ssh_ptl_rx_retransmit_check(ptl, frame)) in ssh_ptl_rx_dataframe()
1646 ptl->ops.data_received(ptl, payload); in ssh_ptl_rx_dataframe()
1649 static void ssh_ptl_send_ack(struct ssh_ptl *ptl, u8 seq) in ssh_ptl_send_ack() argument
1658 ptl_err(ptl, "ptl: failed to allocate ACK packet\n"); in ssh_ptl_send_ack()
1669 ssh_ptl_submit(ptl, packet); in ssh_ptl_send_ack()
1673 static void ssh_ptl_send_nak(struct ssh_ptl *ptl) in ssh_ptl_send_nak() argument
1682 ptl_err(ptl, "ptl: failed to allocate NAK packet\n"); in ssh_ptl_send_nak()
1693 ssh_ptl_submit(ptl, packet); in ssh_ptl_send_nak()
1697 static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source) in ssh_ptl_rx_eval() argument
1706 ssh_ptl_rx_inject_invalid_syn(ptl, source); in ssh_ptl_rx_eval()
1729 ptl_warn(ptl, "rx: parser: invalid start of frame, skipping\n"); in ssh_ptl_rx_eval()
1749 ssh_ptl_send_nak(ptl); in ssh_ptl_rx_eval()
1756 ssh_ptl_rx_inject_invalid_data(ptl, &aligned); in ssh_ptl_rx_eval()
1759 status = sshp_parse_frame(&ptl->serdev->dev, &aligned, &frame, &payload, in ssh_ptl_rx_eval()
1770 ssh_ptl_acknowledge(ptl, frame->seq); in ssh_ptl_rx_eval()
1774 ssh_ptl_resubmit_pending(ptl); in ssh_ptl_rx_eval()
1778 ssh_ptl_send_ack(ptl, frame->seq); in ssh_ptl_rx_eval()
1782 ssh_ptl_rx_dataframe(ptl, frame, &payload); in ssh_ptl_rx_eval()
1786 ptl_warn(ptl, "ptl: received frame with unknown type %#04x\n", in ssh_ptl_rx_eval()
1796 struct ssh_ptl *ptl = data; in ssh_ptl_rx_threadfn() local
1803 wait_event_interruptible(ptl->rx.wq, in ssh_ptl_rx_threadfn()
1804 !kfifo_is_empty(&ptl->rx.fifo) || in ssh_ptl_rx_threadfn()
1810 n = sshp_buf_read_from_fifo(&ptl->rx.buf, &ptl->rx.fifo); in ssh_ptl_rx_threadfn()
1812 ptl_dbg(ptl, "rx: received data (size: %zu)\n", n); in ssh_ptl_rx_threadfn()
1814 ptl->rx.buf.ptr + ptl->rx.buf.len - n, in ssh_ptl_rx_threadfn()
1818 while (offs < ptl->rx.buf.len) { in ssh_ptl_rx_threadfn()
1819 sshp_buf_span_from(&ptl->rx.buf, offs, &span); in ssh_ptl_rx_threadfn()
1820 n = ssh_ptl_rx_eval(ptl, &span); in ssh_ptl_rx_threadfn()
1828 sshp_buf_drop(&ptl->rx.buf, offs); in ssh_ptl_rx_threadfn()
1834 static void ssh_ptl_rx_wakeup(struct ssh_ptl *ptl) in ssh_ptl_rx_wakeup() argument
1836 wake_up(&ptl->rx.wq); in ssh_ptl_rx_wakeup()
1845 int ssh_ptl_rx_start(struct ssh_ptl *ptl) in ssh_ptl_rx_start() argument
1847 if (ptl->rx.thread) in ssh_ptl_rx_start()
1850 ptl->rx.thread = kthread_run(ssh_ptl_rx_threadfn, ptl, in ssh_ptl_rx_start()
1852 if (IS_ERR(ptl->rx.thread)) in ssh_ptl_rx_start()
1853 return PTR_ERR(ptl->rx.thread); in ssh_ptl_rx_start()
1864 int ssh_ptl_rx_stop(struct ssh_ptl *ptl) in ssh_ptl_rx_stop() argument
1868 if (ptl->rx.thread) { in ssh_ptl_rx_stop()
1869 status = kthread_stop(ptl->rx.thread); in ssh_ptl_rx_stop()
1870 ptl->rx.thread = NULL; in ssh_ptl_rx_stop()
1890 ssize_t ssh_ptl_rx_rcvbuf(struct ssh_ptl *ptl, const u8 *buf, size_t n) in ssh_ptl_rx_rcvbuf() argument
1894 if (test_bit(SSH_PTL_SF_SHUTDOWN_BIT, &ptl->state)) in ssh_ptl_rx_rcvbuf()
1897 used = kfifo_in(&ptl->rx.fifo, buf, n); in ssh_ptl_rx_rcvbuf()
1899 ssh_ptl_rx_wakeup(ptl); in ssh_ptl_rx_rcvbuf()
1917 void ssh_ptl_shutdown(struct ssh_ptl *ptl) in ssh_ptl_shutdown() argument
1925 set_bit(SSH_PTL_SF_SHUTDOWN_BIT, &ptl->state); in ssh_ptl_shutdown()
1936 status = ssh_ptl_rx_stop(ptl); in ssh_ptl_shutdown()
1938 ptl_err(ptl, "ptl: failed to stop receiver thread\n"); in ssh_ptl_shutdown()
1940 status = ssh_ptl_tx_stop(ptl); in ssh_ptl_shutdown()
1942 ptl_err(ptl, "ptl: failed to stop transmitter thread\n"); in ssh_ptl_shutdown()
1944 cancel_delayed_work_sync(&ptl->rtx_timeout.reaper); in ssh_ptl_shutdown()
1967 spin_lock(&ptl->queue.lock); in ssh_ptl_shutdown()
1968 list_for_each_entry_safe(p, n, &ptl->queue.head, queue_node) { in ssh_ptl_shutdown()
1976 spin_unlock(&ptl->queue.lock); in ssh_ptl_shutdown()
1979 spin_lock(&ptl->pending.lock); in ssh_ptl_shutdown()
1980 list_for_each_entry_safe(p, n, &ptl->pending.head, pending_node) { in ssh_ptl_shutdown()
1988 atomic_set(&ptl->pending.count, 0); in ssh_ptl_shutdown()
1989 spin_unlock(&ptl->pending.lock); in ssh_ptl_shutdown()
2026 int ssh_ptl_init(struct ssh_ptl *ptl, struct serdev_device *serdev, in ssh_ptl_init() argument
2031 ptl->serdev = serdev; in ssh_ptl_init()
2032 ptl->state = 0; in ssh_ptl_init()
2034 spin_lock_init(&ptl->queue.lock); in ssh_ptl_init()
2035 INIT_LIST_HEAD(&ptl->queue.head); in ssh_ptl_init()
2037 spin_lock_init(&ptl->pending.lock); in ssh_ptl_init()
2038 INIT_LIST_HEAD(&ptl->pending.head); in ssh_ptl_init()
2039 atomic_set_release(&ptl->pending.count, 0); in ssh_ptl_init()
2041 ptl->tx.thread = NULL; in ssh_ptl_init()
2042 atomic_set(&ptl->tx.running, 0); in ssh_ptl_init()
2043 init_completion(&ptl->tx.thread_cplt_pkt); in ssh_ptl_init()
2044 init_completion(&ptl->tx.thread_cplt_tx); in ssh_ptl_init()
2045 init_waitqueue_head(&ptl->tx.packet_wq); in ssh_ptl_init()
2047 ptl->rx.thread = NULL; in ssh_ptl_init()
2048 init_waitqueue_head(&ptl->rx.wq); in ssh_ptl_init()
2050 spin_lock_init(&ptl->rtx_timeout.lock); in ssh_ptl_init()
2051 ptl->rtx_timeout.timeout = SSH_PTL_PACKET_TIMEOUT; in ssh_ptl_init()
2052 ptl->rtx_timeout.expires = KTIME_MAX; in ssh_ptl_init()
2053 INIT_DELAYED_WORK(&ptl->rtx_timeout.reaper, ssh_ptl_timeout_reap); in ssh_ptl_init()
2055 ptl->ops = *ops; in ssh_ptl_init()
2058 for (i = 0; i < ARRAY_SIZE(ptl->rx.blocked.seqs); i++) in ssh_ptl_init()
2059 ptl->rx.blocked.seqs[i] = U16_MAX; in ssh_ptl_init()
2060 ptl->rx.blocked.offset = 0; in ssh_ptl_init()
2062 status = kfifo_alloc(&ptl->rx.fifo, SSH_PTL_RX_FIFO_LEN, GFP_KERNEL); in ssh_ptl_init()
2066 status = sshp_buf_alloc(&ptl->rx.buf, SSH_PTL_RX_BUF_LEN, GFP_KERNEL); in ssh_ptl_init()
2068 kfifo_free(&ptl->rx.fifo); in ssh_ptl_init()
2082 void ssh_ptl_destroy(struct ssh_ptl *ptl) in ssh_ptl_destroy() argument
2084 kfifo_free(&ptl->rx.fifo); in ssh_ptl_destroy()
2085 sshp_buf_free(&ptl->rx.buf); in ssh_ptl_destroy()