carl9170 firmware: update copyright boilerplate
[carl9170fw.git] / tools / carlu / src / test.c
index 148f89a0540556d32c4549db065da251f5121246..daf88c61a251380d2aaf8b9ce827297e18854329 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * carl9170user - userspace testing utility for ar9170 devices
+ * carlu - userspace testing utility for ar9170 devices
  *
  * Various tests
  *
- * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
+ * Copyright 2009-2011 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
@@ -220,3 +220,18 @@ int carlu_gpio_test(struct carlu *ar)
        CHK(carlu_cmd_read_mem(ar, AR9170_GPIO_REG_PORT_DATA, &gpio));
        info("GPIO state:%x\n", gpio);
 }
+
+int carlu_random_test(struct carlu *ar)
+{
+       uint32_t buf[4096];
+       int err, i;
+
+       err = carlu_cmd_mem_watch(ar, AR9170_RAND_REG_NUM, sizeof(buf), buf);
+       if (err)
+               return err;
+
+       for (i = 0; i < ARRAY_SIZE(buf); i++)
+               info("%.2x %.2x ", buf[i] & 0xff, buf[i] >> 8);
+
+       info("\n");
+}