carlu: move from private carl9170_tx_status to public _carl9170_tx_status
authorChristian Lamparter <chunkeey@googlemail.com>
Tue, 19 Oct 2010 18:38:50 +0000 (20:38 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Tue, 19 Oct 2010 18:38:50 +0000 (20:38 +0200)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
tools/carlu/src/test.c
tools/carlu/src/tx.c

index d31060d870b5fd5616a28c2065b68cbe89faaca1..148f89a0540556d32c4549db065da251f5121246 100644 (file)
@@ -83,12 +83,9 @@ static int carlu_loopback_cmd(struct carlu *ar __unused,
                dbg("received tx feedback (%d).\n", n);
 
                for (i = 0; i < n; i++) {
-                       dbg("cookie:%x success:%d rix:%d tries:%d queue:%d\n",
-                               cmd->tx_status[i].cookie,
-                               cmd->tx_status[i].success,
-                               cmd->tx_status[i].rix,
-                               cmd->tx_status[i].tries,
-                               cmd->tx_status[i].queue);
+                       dbg("cookie:%x info:%x\n",
+                               cmd->_tx_status[i].cookie,
+                               cmd->_tx_status[i].info);
                }
                return -1;
 
@@ -201,7 +198,7 @@ int carlu_gpio_test(struct carlu *ar)
 #define CHK(cmd)                               \
        do {                                    \
                int __err;                      \
-               if (__err = cmd)                \
+               if ((__err = cmd))              \
                        return __err;           \
        } while (0)
 
index 55d2677857908c90e5102c43aa2fdcdb659c45ec..ea3e81fe1e777f85d6dc995702fa085cb9547c16 100644 (file)
@@ -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);
                }
        }
 }