carlu: put command definitions into separate header
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 15 Oct 2010 21:20:05 +0000 (23:20 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Fri, 15 Oct 2010 21:20:05 +0000 (23:20 +0200)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
tools/carlu/src/carlu.h
tools/carlu/src/cmd.c
tools/carlu/src/cmd.h [new file with mode: 0644]
tools/carlu/src/main.c
tools/carlu/src/test.c
tools/carlu/src/usb.c

index 7101cc8c0d3c7785635ce788f66fc8bd131ab7c4..08fca20f1c1f2f62148c05690dd6f6a5fdda1cec 100644 (file)
@@ -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 */
index e7759dcb563abb3983fa04a707055bb94c3b2d66..d83c107bdae9353f8395ef975d0e1bcfbea91dfb 100644 (file)
@@ -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 (file)
index 0000000..0cbbc15
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * carl9170user - userspace testing utility for ar9170 devices
+ *
+ * register/memory/command access functions
+ *
+ * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
+ *
+ * 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 */
index 4f2058328b6b66655828402024821c89c1104fd5..22adc3e945618192a359af2f268e61d65ab5a5d9 100644 (file)
@@ -38,6 +38,7 @@
 #include "usb.h"
 #include "frame.h"
 #include "test.h"
+#include "cmd.h"
 
 void *carlu_alloc_driver(size_t size)
 {
index 30b3fb336432bfe5e9f6aea693b1c2102617c900..8d3e310a57023689b42a5836ac52efd4bcb4423e 100644 (file)
@@ -37,6 +37,7 @@
 #include "debug.h"
 #include "frame.h"
 #include "usb.h"
+#include "cmd.h"
 
 void debug_test(void)
 {
index 72d08ea6d20295c8a77fb860ec70c10427a002ab..53bcb5244ab2a946ffd312440823dd44a6348751 100644 (file)
@@ -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,                               \