From: Christian Lamparter Date: Fri, 15 Oct 2010 21:20:05 +0000 (+0200) Subject: carlu: put command definitions into separate header X-Git-Tag: 1.9.1~15 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=13859edfa20c4b84b575f8e872636fd8cdd81d7f;p=carl9170fw.git carlu: put command definitions into separate header Signed-off-by: Christian Lamparter --- diff --git a/tools/carlu/src/carlu.h b/tools/carlu/src/carlu.h index 7101cc8..08fca20 100644 --- a/tools/carlu/src/carlu.h +++ b/tools/carlu/src/carlu.h @@ -113,13 +113,4 @@ void carlu_handle_command(struct carlu *ar, void *buf, size_t len); struct frame *carlu_alloc_frame(struct carlu *ar, unsigned int size); void carlu_free_frame(struct carlu *ar, struct frame *frame); - -int carlu_cmd_echo(struct carlu *ar, const uint32_t message); -int carlu_cmd_reboot(struct carlu *ar); -int carlu_cmd_read_eeprom(struct carlu *ar); -int carlu_cmd_mem_dump(struct carlu *ar, const uint32_t start, - const unsigned int len, void *_buf); -int carlu_cmd_write_mem(struct carlu *ar, const uint32_t addr, - const uint32_t val); - #endif /* __CARL9170USER_H */ diff --git a/tools/carlu/src/cmd.c b/tools/carlu/src/cmd.c index e7759dc..d83c107 100644 --- a/tools/carlu/src/cmd.c +++ b/tools/carlu/src/cmd.c @@ -40,6 +40,7 @@ #include "debug.h" #include "fwcmd.h" #include "eeprom.h" +#include "cmd.h" int carlu_cmd_echo(struct carlu *ar, const uint32_t message) { diff --git a/tools/carlu/src/cmd.h b/tools/carlu/src/cmd.h new file mode 100644 index 0000000..0cbbc15 --- /dev/null +++ b/tools/carlu/src/cmd.h @@ -0,0 +1,38 @@ +/* + * carl9170user - userspace testing utility for ar9170 devices + * + * register/memory/command access functions + * + * Copyright 2009, 2010 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __CARL9170USER_CMD_H +#define __CARL9170USER_CMD_H + +#include "carlu.h" + +int carlu_cmd_echo(struct carlu *ar, const uint32_t message); +int carlu_cmd_reboot(struct carlu *ar); +int carlu_cmd_read_eeprom(struct carlu *ar); +int carlu_cmd_mem_dump(struct carlu *ar, const uint32_t start, + const unsigned int len, void *_buf); +int carlu_cmd_write_mem(struct carlu *ar, const uint32_t addr, + const uint32_t val); + +struct carl9170_cmd *carlu_cmd_buf(struct carlu *ar, + const enum carl9170_cmd_oids cmd, const unsigned int len); +#endif /* __CARL9170USER_CMD_H */ diff --git a/tools/carlu/src/main.c b/tools/carlu/src/main.c index 4f20583..22adc3e 100644 --- a/tools/carlu/src/main.c +++ b/tools/carlu/src/main.c @@ -38,6 +38,7 @@ #include "usb.h" #include "frame.h" #include "test.h" +#include "cmd.h" void *carlu_alloc_driver(size_t size) { diff --git a/tools/carlu/src/test.c b/tools/carlu/src/test.c index 30b3fb3..8d3e310 100644 --- a/tools/carlu/src/test.c +++ b/tools/carlu/src/test.c @@ -37,6 +37,7 @@ #include "debug.h" #include "frame.h" #include "usb.h" +#include "cmd.h" void debug_test(void) { diff --git a/tools/carlu/src/usb.c b/tools/carlu/src/usb.c index 72d08ea..53bcb52 100644 --- a/tools/carlu/src/usb.c +++ b/tools/carlu/src/usb.c @@ -35,6 +35,7 @@ #include "usb.h" #include "debug.h" #include "list.h" +#include "cmd.h" #define ADD_DEV(_vid, _pid, _vs, _ps) { \ .idVendor = _vid, \