summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-10 00:47:42 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-10 00:47:42 +0000
commit0f29ca5cf9885ba0b22db226c73c09478470c097 (patch)
tree9d4ad7a41e0ea557dea625fd2c004ac1ecdc9df5 /tools
parent7eaf5aa39ab4592548baeffaca65f0e490e036b1 (diff)
Add optional warm reset of the device
Diffstat (limited to 'tools')
-rw-r--r--tools/pskey.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/pskey.c b/tools/pskey.c
index 0180be59..0c06e9ef 100644
--- a/tools/pskey.c
+++ b/tools/pskey.c
@@ -141,7 +141,7 @@ static void usage(void)
printf("pskey - Utility for changing CSR persistent storage\n\n");
printf("Usage:\n"
- "\tpskey [-i <dev>] [-t] <key> [value]\n\n");
+ "\tpskey [-i <dev>] [-r] [-t] <key> [value]\n\n");
printf("Keys:\n\t");
for (i = 0; storage[i].pskey; i++) {
@@ -157,6 +157,7 @@ static void usage(void)
static struct option main_options[] = {
{ "device", 1, 0, 'i' },
+ { "reset", 0, 0, 'r' },
{ "transient", 0, 0, 't' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@ -166,9 +167,9 @@ int main(int argc, char *argv[])
{
struct hci_dev_info di;
struct hci_version ver;
- int i, err, dd, opt, dev = 0;
+ int i, err, dd, opt, dev = 0, reset = 0;
- while ((opt=getopt_long(argc, argv, "+i:th", main_options, NULL)) != -1) {
+ while ((opt=getopt_long(argc, argv, "+i:rth", main_options, NULL)) != -1) {
switch (opt) {
case 'i':
dev = hci_devid(optarg);
@@ -178,6 +179,10 @@ int main(int argc, char *argv[])
}
break;
+ case 'r':
+ reset = 1;
+ break;
+
case 't':
transient = 1;
break;
@@ -229,10 +234,14 @@ int main(int argc, char *argv[])
if (strcasecmp(storage[i].str, argv[0]))
continue;
- if (argc > 1)
+ if (argc > 1) {
err = write_pskey(dd, storage[i].pskey,
storage[i].type, argc - 1, argv + 1);
- else
+
+ if (reset)
+ csr_write_varid_valueless(dd, 0x0000,
+ CSR_VARID_WARM_RESET);
+ } else
err = read_pskey(dd, storage[i].pskey, storage[i].type);
hci_close_dev(dd);