carl9170 firmware: add flag for asynchronous commands
authorChristian Lamparter <chunkeey@googlemail.com>
Thu, 29 Jul 2010 16:21:11 +0000 (18:21 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 31 Jul 2010 20:12:40 +0000 (22:12 +0200)
This flag can be used by the application to tell _same_
application that it does not have to wait for the command
response, or it does not need to parse the received
response if the flag is set.

NOTE: The firmware does not care about this flag and
processes any received command in the same way.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
carlfw/src/cmd.c
include/shared/fwcmd.h

index 7652214f476a5d4a0df9298bc80889c626c78e3a..90aa21407ad4a052306da150e57222613c3cc300 100644 (file)
@@ -42,7 +42,7 @@ void handle_cmd(struct carl9170_rsp *resp)
        resp->hdr.ext = cmd->hdr.ext;
        resp->hdr.seq |= cmd->hdr.seq;
 
-       switch (cmd->hdr.cmd) {
+       switch (cmd->hdr.cmd & ~CARL9170_CMD_ASYNC_FLAG) {
        case CARL9170_CMD_RREG:
                for (i = 0; i < (cmd->hdr.len / 4); i++)
                        resp->rreg_res.vals[i] = get(cmd->rreg.regs[i]);
index ec8f81051f83efba7ad05950c0f8ad1f633be9a4..fb5ab3f62639902646cdbe6c770d6529179929ab 100644 (file)
@@ -66,7 +66,17 @@ enum carl9170_cmd_oids {
        CARL9170_CMD_FREQ_START         = 0x23,
        CARL9170_CMD_PSM                = 0x24,
 
+       /* Asychronous command flag */
+       CARL9170_CMD_ASYNC_FLAG         = 0x40,
+       CARL9170_CMD_WREG_ASYNC         = (CARL9170_CMD_WREG |
+                                          CARL9170_CMD_ASYNC_FLAG),
+       CARL9170_CMD_REBOOT_ASYNC       = (CARL9170_CMD_REBOOT |
+                                          CARL9170_CMD_ASYNC_FLAG),
+       CARL9170_CMD_FLUSH_CAB_ASYNC    = (CARL9170_CMD_FLUSH_CAB |
+                                          CARL9170_CMD_ASYNC_FLAG),
+
        /* responses and traps */
+       CARL9170_RSP_FLAG               = 0xc0,
        CARL9170_RSP_PRETBTT            = 0xc0,
        CARL9170_RSP_TXCOMP             = 0xc1,
        CARL9170_RSP_BEACON_CONFIG      = 0xc2,