Broadcom Sonics Silicon Backplane bus SPROM data modification tool
- Copyright (c) 2006-2007 Michael Buesch <mb@bu3sch.de>
+ Copyright (c) 2006-2008 Michael Buesch <mb@bu3sch.de>
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
sprom[SPROM_BOARDREV + 1] |= (1 << 5);
break;
case VALUE_ANTGA:
- sprom[SPROM_ANTENNA_GAIN + 0] = (v & 0xFF);
+ if (sprom_rev != 4)
+ sprom[SPROM_ANTENNA_GAIN + 1] = (v & 0xFF);
+ else
+ sprom[SPROM4_ANTENNA_GAIN + 1] = (v & 0xFF);
break;
case VALUE_ANTGBG:
- sprom[SPROM_ANTENNA_GAIN + 1] = (v & 0xFF);
+ if (sprom_rev != 4)
+ sprom[SPROM_ANTENNA_GAIN] = (v & 0xFF);
+ else
+ sprom[SPROM4_ANTENNA_GAIN] = (v & 0xFF);
break;
case VALUE_PA0B0:
sprom[SPROM_PA0B0 + 0] = (v & 0x00FF);
case VALUE_ANTGA:
if (sprom_rev != 4) {
desc = "A PHY antenna gain";
- offset = SPROM_ANTENNA_GAIN + 1;
+ offset = SPROM_ANTENNA_GAIN;
} else {
desc = "Antenna 1 Gain";
offset = SPROM4_ANTENNA_GAIN;
static void print_banner(int forceprint)
{
- const char *str = "Broadcom-SSB SPROM data modification tool version " VERSION "\n";
+ const char *str = "Broadcom-SSB SPROM data modification tool.\n"
+ "\n"
+ "Copyright (C) Michael Buesch\n"
+ "Licensed under the GNU/GPL version 2 or later\n"
+ "\n"
+ "DO NOT USE THIS TOOL. YOU WILL BRICK YOUR DEVICE.\n";
if (forceprint)
prdata(str);
else
}
if (strcmp(arg, template) == 0) {
if (param) {
- /* Skip the parameter on the next iteration. */
- (*pos)++;
if (*param == 0) {
prerror("%s needs a parameter\n", arg);
return ARG_ERROR;
}
+ /* Skip the parameter on the next iteration. */
+ (*pos)++;
}
return ARG_MATCH;
}
if (err)
goto error;
} else {
- prerror("Unrecognized argument: %s\n", argv[i]);
+ if (!parse_err)
+ prerror("Unrecognized argument: %s\n", argv[i]);
goto out_usage;
}
if (parse_err)