X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tools%2Fcarlu%2Fsrc%2Ftx.c;h=ec97502038f0e5a3c8c68f1c35ae6c2e901d95ce;hb=2410b6d77a15fc53d2e5ccffd0a1deff96676cab;hp=55d2677857908c90e5102c43aa2fdcdb659c45ec;hpb=0629466a3ee72bd525639a57af25a0a56e26101f;p=carl9170fw.git diff --git a/tools/carlu/src/tx.c b/tools/carlu/src/tx.c index 55d2677..ec97502 100644 --- a/tools/carlu/src/tx.c +++ b/tools/carlu/src/tx.c @@ -1,9 +1,9 @@ /* - * carl9170user - userspace testing utility for ar9170 devices + * carlu - userspace testing utility for ar9170 devices * * xmit - related functions * - * Copyright 2009, 2010 Christian Lamparter + * Copyright 2009-2011 Christian Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,21 +137,25 @@ static void carlu_tx_fb_cb(struct carlu *ar, void carlu_tx_feedback(struct carlu *ar, struct carl9170_rsp *cmd) { - unsigned int i, n, k; + unsigned int i, n, k, q; struct frame *frame; struct carlu_tx_info *tx_info; n = cmd->hdr.ext; for (i = 0; i < n; i++) { - frame = carlu_find_frame(ar, cmd->tx_status[i].queue, - cmd->tx_status[i].cookie); + q = (cmd->_tx_status[i].info >> CARL9170_TX_STATUS_QUEUE_S) & + CARL9170_TX_STATUS_QUEUE; + frame = carlu_find_frame(ar, q, cmd->_tx_status[i].cookie); if (frame) { carlu_free_dev_mem(ar, frame); tx_info = get_tx_info(frame); - k = cmd->tx_status[i].rix; - tx_info->rates[k].cnt = cmd->tx_status[i].tries; + k = (cmd->_tx_status[i].info >> CARL9170_TX_STATUS_RIX) + & CARL9170_TX_STATUS_RIX_S; + tx_info->rates[k].cnt = (cmd->_tx_status[i].info >> + CARL9170_TX_STATUS_TRIES_S) & + CARL9170_TX_STATUS_TRIES; for (k++; k < CARL9170_TX_MAX_RATES; k++) { tx_info->rates[k].rix = -1; tx_info->rates[k].cnt = -1; @@ -160,7 +164,7 @@ void carlu_tx_feedback(struct carlu *ar, carlu_tx_fb_cb(ar, frame); } else { err("Found no frame for cookie %d.\n", - cmd->tx_status[i].cookie); + cmd->_tx_status[i].cookie); } } } @@ -184,7 +188,7 @@ int carlu_tx(struct carlu *ar, struct frame *frame) txp->s.len = cpu_to_le16(frame->len); - queue = ar9170_qmap[frame->queue % ARRAY_SIZE(ar9170_qmap)]; + queue = (frame->queue % __AR9170_NUM_TXQ); SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, txp->s.misc, queue);