X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fsrc%2Fcmd.c;h=e04e8da486b44dfac8eafe62374cb4cd595a6831;hb=55af0ecd51af9b85961eccc3b3e9cc9997b60192;hp=f5bbad86f8e5393083881f3b5c7f5129c9a56e72;hpb=e72388a0aa23da8bc8e24a0cbe9d523c5a9ce294;p=carl9170fw.git diff --git a/carlfw/src/cmd.c b/carlfw/src/cmd.c index f5bbad8..e04e8da 100644 --- a/carlfw/src/cmd.c +++ b/carlfw/src/cmd.c @@ -37,9 +37,12 @@ void handle_cmd(struct carl9170_rsp *resp) 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) { + 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]); @@ -56,17 +59,19 @@ void handle_cmd(struct carl9170_rsp *resp) break; case CARL9170_CMD_SWRST: - resp->hdr.len = 0; + /* + * Command has no payload, so the response + * has no payload either. + * resp->hdr.len = 0; + */ fw.wlan.mac_reset = CARL9170_MAC_RESET_FORCE; break; case CARL9170_CMD_REBOOT: /* - * reboot does not return and generates no response * resp->len = 0; */ - - reboot(); + fw.reboot = 1; break; case CARL9170_CMD_READ_TSF: @@ -103,7 +108,9 @@ void handle_cmd(struct carl9170_rsp *resp) break; case CARL9170_CMD_FREQ_START: - resp->hdr.len = 0; + /* + * resp->hdr.len = 0; + */ rf_notify_set_channel(); break; @@ -116,14 +123,6 @@ void handle_cmd(struct carl9170_rsp *resp) # endif /* CONFIG_CARL9170FW_PSM */ #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIOS */ -#ifdef CONFIG_CARL9170FW_USB_WATCHDOG - case CARL9170_CMD_USB_WD: - resp->hdr.len = 4; - fw.usb.watchdog.state = le32_to_cpu(cmd->watchdog.state); - break; - -#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */ - default: break; }