unsigned int i;
/* copies cmd, len and extra fields */
- resp->hdr.hdr_data = cmd->hdr.hdr_data;
+ resp->hdr.len = cmd->hdr.len;
+ resp->hdr.cmd = cmd->hdr.cmd;
+ resp->hdr.ext = cmd->hdr.ext;
+ resp->hdr.seq |= cmd->hdr.seq;
switch (cmd->hdr.cmd) {
case CARL9170_CMD_RREG:
.miniboot_size = cpu_to_le16(0),
.tx_descs = AR9170_TX_BLOCK_NUMBER,
+ .cmd_bufs = CARL9170_INT_RQ_CACHES,
.rx_max_frame_len = cpu_to_le16(CONFIG_CARL9170FW_RX_FRAME_LEN),
.tx_frag_len = cpu_to_le16(AR9170_BLOCK_SIZE),
.fw_address = cpu_to_le32(AR9170_PRAM_OFFSET),
{
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++;
#define CARL9170FW_OTUS_DESC_SIZE \
(sizeof(struct carl9170fw_otus_desc))
-#define CARL9170FW_USB_DESC_MIN_VER 2
-#define CARL9170FW_USB_DESC_CUR_VER 2
+#define CARL9170FW_USB_DESC_MIN_VER 3
+#define CARL9170FW_USB_DESC_CUR_VER 3
struct carl9170fw_usb_desc {
struct carl9170fw_desc_head head;
__le32 usb_feature_set;
__le16 rx_max_frame_len;
__le16 miniboot_size;
u8 tx_descs;
- u8 free;
+ u8 cmd_bufs;
} __packed;
#define CARL9170FW_USB_DESC_SIZE \
(sizeof(struct carl9170fw_usb_desc))
usb->tx_frag_len, usb->tx_descs);
fprintf(stdout, "\t=> %d Bytes are reserved for the TX queues\n",
usb->tx_frag_len * usb->tx_descs);
+ fprintf(stdout, "\tCommand response buffers:%d\n", usb->cmd_bufs);
fprintf(stdout, "\tMax. RX stream block size:%d Bytes\n",
usb->rx_max_frame_len);
fprintf(stdout, "\tFirmware upload pointer: 0x%x\n",