Esempio n. 1
0
static int set_ref_nvs(struct nl80211_state *state, struct nl_cb *cb,
			struct nl_msg *msg, int argc, char **argv)
{
	struct wl12xx_common cmn = {
		.arch = UNKNOWN_ARCH,
		.parse_ops = NULL,
		.dual_mode = DUAL_MODE_UNSET,
		.done_fem = NO_FEM_PARSED
	};

	argc -= 2;
	argv += 2;

	if (argc != 1)
		return 1;

	if (read_ini(*argv, &cmn)) {
		fprintf(stderr, "Fail to read ini file\n");
		return 1;
	}

	cfg_nvs_ops(&cmn);

	if (create_nvs_file(&cmn)) {
		fprintf(stderr, "Fail to create reference NVS file\n");
		return 1;
	}
#if 0
	printf("\n\tThe NVS file (%s) is ready\n\tCopy it to %s and "
		"reboot the system\n\n",
		NEW_NVS_NAME, CURRENT_NVS_NAME);
#endif
	return 0;
}
Esempio n. 2
0
static int set_upd_nvs(struct nl80211_state *state, struct nl_cb *cb,
	struct nl_msg *msg, int argc, char **argv)
{
	char *fname = NULL;
	struct wl12xx_common cmn = {
		.arch = UNKNOWN_ARCH,
		.parse_ops = NULL
	};

	argc -= 2;
	argv += 2;

	if (argc < 1)
		return 1;

	if (read_ini(*argv, &cmn)) {
		fprintf(stderr, "Fail to read ini file\n");
		return 1;
	}

	cfg_nvs_ops(&cmn);

	if (argc == 2)
		fname = *++argv;

	if (update_nvs_file(fname, &cmn)) {
		fprintf(stderr, "Fail to update NVS file\n");
		return 1;
	}
#if 0
	printf("\n\tThe updated NVS file (%s) is ready\n\tCopy it to %s and "
		"reboot the system\n\n", NEW_NVS_NAME, CURRENT_NVS_NAME);
#endif
	return 0;
}
Esempio n. 3
0
static int set_ref_nvs(struct nl80211_state *state, struct nl_cb *cb,
			struct nl_msg *msg, int argc, char **argv)
{
	struct wl12xx_common cmn = {
		.arch = UNKNOWN_ARCH,
		.parse_ops = NULL
	};

	argc -= 2;
	argv += 2;

	if (argc < 1 || argc > 2)
		return 1;

	if (read_ini(*argv, &cmn)) {
		fprintf(stderr, "Fail to read ini file\n");
		return 1;
	}
	argv++;
	argc--;

	cfg_nvs_ops(&cmn);

	cmn.nvs_name = get_opt_nvsoutfile(argc, argv);
	if (create_nvs_file(&cmn)) {
		fprintf(stderr, "Fail to create reference NVS file\n");
		return 1;
	}

	printf("%04X", cmn.arch);

	return 0;
}