Lines Matching refs:roq

497 void __i2400m_roq_init(struct i2400m_roq *roq)  in __i2400m_roq_init()  argument
499 roq->ws = 0; in __i2400m_roq_init()
500 skb_queue_head_init(&roq->queue); in __i2400m_roq_init()
505 unsigned __i2400m_roq_index(struct i2400m *i2400m, struct i2400m_roq *roq) in __i2400m_roq_index() argument
507 return ((unsigned long) roq - (unsigned long) i2400m->rx_roq) in __i2400m_roq_index()
508 / sizeof(*roq); in __i2400m_roq_index()
522 unsigned __i2400m_roq_nsn(struct i2400m_roq *roq, unsigned sn) in __i2400m_roq_nsn() argument
525 r = ((int) sn - (int) roq->ws) % 2048; in __i2400m_roq_nsn()
589 struct i2400m_roq *roq, enum i2400m_ro_type type, in i2400m_roq_log_add() argument
595 int index = __i2400m_roq_index(i2400m, roq); in i2400m_roq_log_add()
598 if (roq->log->in - roq->log->out == I2400M_ROQ_LOG_LENGTH) in i2400m_roq_log_add()
599 roq->log->out++; in i2400m_roq_log_add()
600 cnt_idx = roq->log->in++ % I2400M_ROQ_LOG_LENGTH; in i2400m_roq_log_add()
601 e = &roq->log->entry[cnt_idx]; in i2400m_roq_log_add()
617 void i2400m_roq_log_dump(struct i2400m *i2400m, struct i2400m_roq *roq) in i2400m_roq_log_dump() argument
621 int index = __i2400m_roq_index(i2400m, roq); in i2400m_roq_log_dump()
623 BUG_ON(roq->log->out > roq->log->in); in i2400m_roq_log_dump()
624 for (cnt = roq->log->out; cnt < roq->log->in; cnt++) { in i2400m_roq_log_dump()
626 e = &roq->log->entry[cnt_idx]; in i2400m_roq_log_dump()
630 roq->log->in = roq->log->out = 0; in i2400m_roq_log_dump()
657 void __i2400m_roq_queue(struct i2400m *i2400m, struct i2400m_roq *roq, in __i2400m_roq_queue() argument
666 i2400m, roq, skb, sn, nsn); in __i2400m_roq_queue()
672 roq, roq->ws, nsn, roq_data->sn); in __i2400m_roq_queue()
676 if (skb_queue_empty(&roq->queue)) { in __i2400m_roq_queue()
677 d_printf(2, dev, "ERX: roq %p - first one\n", roq); in __i2400m_roq_queue()
678 __skb_queue_head(&roq->queue, skb); in __i2400m_roq_queue()
682 skb_itr = skb_peek_tail(&roq->queue); in __i2400m_roq_queue()
684 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn); in __i2400m_roq_queue()
688 roq, skb_itr, nsn_itr, roq_data_itr->sn); in __i2400m_roq_queue()
689 __skb_queue_tail(&roq->queue, skb); in __i2400m_roq_queue()
698 skb_queue_walk(&roq->queue, skb_itr) { in __i2400m_roq_queue()
700 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn); in __i2400m_roq_queue()
704 "(nsn %d sn %u)\n", roq, skb_itr, nsn_itr, in __i2400m_roq_queue()
706 __skb_queue_before(&roq->queue, skb_itr, skb); in __i2400m_roq_queue()
714 roq, roq->ws, skb, nsn, roq_data->sn); in __i2400m_roq_queue()
715 skb_queue_walk(&roq->queue, skb_itr) { in __i2400m_roq_queue()
717 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn); in __i2400m_roq_queue()
720 roq, skb_itr, nsn_itr, roq_data_itr->sn); in __i2400m_roq_queue()
725 i2400m, roq, skb, sn, nsn); in __i2400m_roq_queue()
741 unsigned __i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq, in __i2400m_roq_update_ws() argument
749 new_nws = __i2400m_roq_nsn(roq, sn); in __i2400m_roq_update_ws()
756 skb_queue_walk_safe(&roq->queue, skb_itr, tmp_itr) { in __i2400m_roq_update_ws()
758 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn); in __i2400m_roq_update_ws()
763 roq, skb_itr, nsn_itr, roq_data_itr->sn, in __i2400m_roq_update_ws()
765 __skb_unlink(skb_itr, &roq->queue); in __i2400m_roq_update_ws()
771 roq->ws = sn; in __i2400m_roq_update_ws()
786 void i2400m_roq_reset(struct i2400m *i2400m, struct i2400m_roq *roq) in i2400m_roq_reset() argument
792 d_fnstart(2, dev, "(i2400m %p roq %p)\n", i2400m, roq); in i2400m_roq_reset()
793 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_RESET, in i2400m_roq_reset()
794 roq->ws, skb_queue_len(&roq->queue), in i2400m_roq_reset()
796 skb_queue_walk_safe(&roq->queue, skb_itr, tmp_itr) { in i2400m_roq_reset()
799 roq, skb_itr, roq_data_itr->sn); in i2400m_roq_reset()
800 __skb_unlink(skb_itr, &roq->queue); in i2400m_roq_reset()
803 roq->ws = 0; in i2400m_roq_reset()
804 d_fnend(2, dev, "(i2400m %p roq %p) = void\n", i2400m, roq); in i2400m_roq_reset()
821 void i2400m_roq_queue(struct i2400m *i2400m, struct i2400m_roq *roq, in i2400m_roq_queue() argument
828 i2400m, roq, skb, lbn); in i2400m_roq_queue()
829 len = skb_queue_len(&roq->queue); in i2400m_roq_queue()
830 nsn = __i2400m_roq_nsn(roq, lbn); in i2400m_roq_queue()
833 nsn, lbn, roq->ws); in i2400m_roq_queue()
834 i2400m_roq_log_dump(i2400m, roq); in i2400m_roq_queue()
837 __i2400m_roq_queue(i2400m, roq, skb, lbn, nsn); in i2400m_roq_queue()
838 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET, in i2400m_roq_queue()
839 roq->ws, len, lbn, nsn, ~0); in i2400m_roq_queue()
842 i2400m, roq, skb, lbn); in i2400m_roq_queue()
855 void i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq, in i2400m_roq_update_ws() argument
861 d_fnstart(2, dev, "(i2400m %p roq %p sn %u)\n", i2400m, roq, sn); in i2400m_roq_update_ws()
862 old_ws = roq->ws; in i2400m_roq_update_ws()
863 len = skb_queue_len(&roq->queue); in i2400m_roq_update_ws()
864 nsn = __i2400m_roq_update_ws(i2400m, roq, sn); in i2400m_roq_update_ws()
865 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_WS, in i2400m_roq_update_ws()
866 old_ws, len, sn, nsn, roq->ws); in i2400m_roq_update_ws()
867 d_fnstart(2, dev, "(i2400m %p roq %p sn %u) = void\n", i2400m, roq, sn); in i2400m_roq_update_ws()
884 void i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq, in i2400m_roq_queue_update_ws() argument
891 i2400m, roq, skb, sn); in i2400m_roq_queue_update_ws()
892 len = skb_queue_len(&roq->queue); in i2400m_roq_queue_update_ws()
893 nsn = __i2400m_roq_nsn(roq, sn); in i2400m_roq_queue_update_ws()
900 old_ws = roq->ws; in i2400m_roq_queue_update_ws()
909 __i2400m_roq_queue(i2400m, roq, skb, sn, nsn); in i2400m_roq_queue_update_ws()
911 __i2400m_roq_update_ws(i2400m, roq, sn + 1); in i2400m_roq_queue_update_ws()
912 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS, in i2400m_roq_queue_update_ws()
913 old_ws, len, sn, nsn, roq->ws); in i2400m_roq_queue_update_ws()
916 i2400m, roq, skb, sn); in i2400m_roq_queue_update_ws()
990 struct i2400m_roq *roq; in i2400m_rx_edata() local
1037 roq = &i2400m->rx_roq[ro_cin]; in i2400m_rx_edata()
1046 ro_type, ro_cin, roq->ws, ro_sn, in i2400m_rx_edata()
1047 __i2400m_roq_nsn(roq, ro_sn), size); in i2400m_rx_edata()
1051 i2400m_roq_reset(i2400m, roq); in i2400m_rx_edata()
1055 i2400m_roq_queue(i2400m, roq, skb, ro_sn); in i2400m_rx_edata()
1058 i2400m_roq_update_ws(i2400m, roq, ro_sn); in i2400m_rx_edata()
1062 i2400m_roq_queue_update_ws(i2400m, roq, skb, ro_sn); in i2400m_rx_edata()