{
struct carl9170_rsp *tmp;
- tmp = &fw.usb.int_buf[fw.usb.int_tail_index++];
+ /* fetch the _oldest_ buffer from the ring */
+ tmp = &fw.usb.int_buf[fw.usb.int_tail_index];
+
+ /* assign a unique sequence for every response/trap */
+ tmp->hdr.seq = fw.usb.int_tail_index;
+
+ fw.usb.int_tail_index++;
+
fw.usb.int_tail_index %= CARL9170_INT_RQ_CACHES;
if (fw.usb.int_pending != CARL9170_INT_RQ_CACHES)
fw.usb.int_pending++;
goto reclaim;
}
+ fw.usb.int_desc->ctrl = AR9170_CTRL_FS_BIT | AR9170_CTRL_LS_BIT;
fw.usb.int_desc->totalLen = tlen;
fw.usb.int_desc->dataSize = tlen;