X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tools%2Fcarlu%2Fsrc%2Fmain.c;h=c1b32778333c897570702dc4166a05b20394d30d;hb=12cc2cc355d1dce3d50c78e0f680b3cda0c73dfe;hp=65bcfbcd4411f336f427402587d0501a0951fbb7;hpb=ddaf4f22a3161d7480d73e03adab1d619784757e;p=carl9170fw.git diff --git a/tools/carlu/src/main.c b/tools/carlu/src/main.c index 65bcfbc..c1b3277 100644 --- a/tools/carlu/src/main.c +++ b/tools/carlu/src/main.c @@ -1,9 +1,9 @@ /* - * carl9170user - userspace testing utility for ar9170 devices + * carlu - userspace testing utility for ar9170 devices * * main program routine * - * Copyright 2009, 2010 Christian Lamparter + * Copyright 2009-2011 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 @@ -161,6 +161,33 @@ out: return err ? EXIT_FAILURE : EXIT_SUCCESS; } +static int carlu_run_random_test(void) +{ + struct carlu *carl = NULL; + int err; + + err = carlu_init(); + if (err) + goto out; + + carl = carlusb_probe(); + if (IS_ERR_OR_NULL(carl)) { + err = PTR_ERR(carl); + goto out; + } + + err = carlu_random_test(carl); + if (err) + goto out_close; + +out_close: + carlusb_close(carl); + +out: + carlu_exit(); + return err ? EXIT_FAILURE : EXIT_SUCCESS; +} + static int carlu_run_loop_test(void) { struct carlu *carl; @@ -236,6 +263,7 @@ static const struct menu_struct menu[] = { MENU_ITEM('p', carlu_probe_all, "probe all possible devices."), MENU_ITEM('t', carlu_run_loop_test, "run tx/rx test."), MENU_ITEM('g', carlu_run_gpio_test, "flash the leds."), + MENU_ITEM('r', carlu_run_random_test, "get random numbers."), }; static int show_help(void)