Lines Matching defs:roq
495 void __i2400m_roq_init(struct i2400m_roq *roq)
497 roq->ws = 0;
498 skb_queue_head_init(&roq->queue);
503 unsigned __i2400m_roq_index(struct i2400m *i2400m, struct i2400m_roq *roq)
505 return ((unsigned long) roq - (unsigned long) i2400m->rx_roq)
506 / sizeof(*roq);
515 * Note that if @sn < @roq->ws, we still need a positive number; %'s
520 unsigned __i2400m_roq_nsn(struct i2400m_roq *roq, unsigned sn)
523 r = ((int) sn - (int) roq->ws) % 2048;
587 struct i2400m_roq *roq, enum i2400m_ro_type type,
593 int index = __i2400m_roq_index(i2400m, roq);
596 if (roq->log->in - roq->log->out == I2400M_ROQ_LOG_LENGTH)
597 roq->log->out++;
598 cnt_idx = roq->log->in++ % I2400M_ROQ_LOG_LENGTH;
599 e = &roq->log->entry[cnt_idx];
615 void i2400m_roq_log_dump(struct i2400m *i2400m, struct i2400m_roq *roq)
619 int index = __i2400m_roq_index(i2400m, roq);
621 BUG_ON(roq->log->out > roq->log->in);
622 for (cnt = roq->log->out; cnt < roq->log->in; cnt++) {
624 e = &roq->log->entry[cnt_idx];
628 roq->log->in = roq->log->out = 0;
636 * @roq: reorder queue where to add
640 * caller from the @sn and @roq->ws).
655 void __i2400m_roq_queue(struct i2400m *i2400m, struct i2400m_roq *roq,
663 d_fnstart(4, dev, "(i2400m %p roq %p skb %p sn %u nsn %u)\n",
664 i2400m, roq, skb, sn, nsn);
669 d_printf(3, dev, "ERX: roq %p [ws %u] nsn %d sn %u\n",
670 roq, roq->ws, nsn, roq_data->sn);
674 if (skb_queue_empty(&roq->queue)) {
675 d_printf(2, dev, "ERX: roq %p - first one\n", roq);
676 __skb_queue_head(&roq->queue, skb);
680 skb_itr = skb_peek_tail(&roq->queue);
682 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn);
685 d_printf(2, dev, "ERX: roq %p - appended after %p (nsn %d sn %u)\n",
686 roq, skb_itr, nsn_itr, roq_data_itr->sn);
687 __skb_queue_tail(&roq->queue, skb);
696 skb_queue_walk(&roq->queue, skb_itr) {
698 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn);
701 d_printf(2, dev, "ERX: roq %p - queued before %p "
702 "(nsn %d sn %u)\n", roq, skb_itr, nsn_itr,
704 __skb_queue_before(&roq->queue, skb_itr, skb);
711 dev_err(dev, "ERX: roq %p [ws %u] skb %p nsn %d sn %u\n",
712 roq, roq->ws, skb, nsn, roq_data->sn);
713 skb_queue_walk(&roq->queue, skb_itr) {
715 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn);
717 dev_err(dev, "ERX: roq %p skb_itr %p nsn %d sn %u\n",
718 roq, skb_itr, nsn_itr, roq_data_itr->sn);
722 d_fnend(4, dev, "(i2400m %p roq %p skb %p sn %u nsn %d) = void\n",
723 i2400m, roq, skb, sn, nsn);
731 * @roq: Reorder queue
739 unsigned __i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
747 new_nws = __i2400m_roq_nsn(roq, sn);
754 skb_queue_walk_safe(&roq->queue, skb_itr, tmp_itr) {
756 nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn);
759 d_printf(2, dev, "ERX: roq %p - release skb %p "
761 roq, skb_itr, nsn_itr, roq_data_itr->sn,
763 __skb_unlink(skb_itr, &roq->queue);
769 roq->ws = sn;
784 void i2400m_roq_reset(struct i2400m *i2400m, struct i2400m_roq *roq)
790 d_fnstart(2, dev, "(i2400m %p roq %p)\n", i2400m, roq);
791 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_RESET,
792 roq->ws, skb_queue_len(&roq->queue),
794 skb_queue_walk_safe(&roq->queue, skb_itr, tmp_itr) {
796 d_printf(2, dev, "ERX: roq %p - release skb %p (sn %u)\n",
797 roq, skb_itr, roq_data_itr->sn);
798 __skb_unlink(skb_itr, &roq->queue);
801 roq->ws = 0;
802 d_fnend(2, dev, "(i2400m %p roq %p) = void\n", i2400m, roq);
819 void i2400m_roq_queue(struct i2400m *i2400m, struct i2400m_roq *roq,
825 d_fnstart(2, dev, "(i2400m %p roq %p skb %p lbn %u) = void\n",
826 i2400m, roq, skb, lbn);
827 len = skb_queue_len(&roq->queue);
828 nsn = __i2400m_roq_nsn(roq, lbn);
831 nsn, lbn, roq->ws);
832 i2400m_roq_log_dump(i2400m, roq);
835 __i2400m_roq_queue(i2400m, roq, skb, lbn, nsn);
836 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET,
837 roq->ws, len, lbn, nsn, ~0);
839 d_fnend(2, dev, "(i2400m %p roq %p skb %p lbn %u) = void\n",
840 i2400m, roq, skb, lbn);
849 * @roq: Reorder queue
853 void i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
859 d_fnstart(2, dev, "(i2400m %p roq %p sn %u)\n", i2400m, roq, sn);
860 old_ws = roq->ws;
861 len = skb_queue_len(&roq->queue);
862 nsn = __i2400m_roq_update_ws(i2400m, roq, sn);
863 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_WS,
864 old_ws, len, sn, nsn, roq->ws);
865 d_fnstart(2, dev, "(i2400m %p roq %p sn %u) = void\n", i2400m, roq, sn);
882 void i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
888 d_fnstart(2, dev, "(i2400m %p roq %p skb %p sn %u)\n",
889 i2400m, roq, skb, sn);
890 len = skb_queue_len(&roq->queue);
891 nsn = __i2400m_roq_nsn(roq, sn);
898 old_ws = roq->ws;
907 __i2400m_roq_queue(i2400m, roq, skb, sn, nsn);
909 __i2400m_roq_update_ws(i2400m, roq, sn + 1);
910 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS,
911 old_ws, len, sn, nsn, roq->ws);
913 d_fnend(2, dev, "(i2400m %p roq %p skb %p sn %u) = void\n",
914 i2400m, roq, skb, sn);
988 struct i2400m_roq *roq;
1035 roq = &i2400m->rx_roq[ro_cin];
1044 ro_type, ro_cin, roq->ws, ro_sn,
1045 __i2400m_roq_nsn(roq, ro_sn), size);
1049 i2400m_roq_reset(i2400m, roq);
1053 i2400m_roq_queue(i2400m, roq, skb, ro_sn);
1056 i2400m_roq_update_ws(i2400m, roq, ro_sn);
1060 i2400m_roq_queue_update_ws(i2400m, roq, skb, ro_sn);
1339 * Note we allocate the roq queues in one chunk and the actual logging