aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-07-28 03:11:24 (GMT)
committerJouni Malinen <j@w1.fi>2003-07-28 03:11:24 (GMT)
commitabb687cfd928da33dbdad1865bcd10c9cd24eb67 (patch)
tree48274ae149421d6fac0c3227ccdaa4524a6ed93c
parent60f043a91836b0efc919ae5ff2551657d302e22a (diff)
downloadhostap-history-abb687cfd928da33dbdad1865bcd10c9cd24eb67.zip
hostap-history-abb687cfd928da33dbdad1865bcd10c9cd24eb67.tar.gz
hostap-history-abb687cfd928da33dbdad1865bcd10c9cd24eb67.tar.bz2
Added PDA dumping functionality (hostap_diag -p wlan0).
-rw-r--r--utils/hostap_diag.c108
1 files changed, 106 insertions, 2 deletions
diff --git a/utils/hostap_diag.c b/utils/hostap_diag.c
index 56afd17..ff2b929 100644
--- a/utils/hostap_diag.c
+++ b/utils/hostap_diag.c
@@ -809,13 +809,111 @@ static void diag_show_bbp(const char *dev)
}
+static const char * prism2_pdr_name(int pdr) {
+ switch (pdr) {
+ case 0x0000:
+ return "PDA End Record";
+ case 0x0001:
+ return "Platform name / Manufacturing part number";
+ case 0x0002:
+ return "PDA Version Record";
+ case 0x0003:
+ return "NIC Serial Number";
+ case 0x0005:
+ return "NIC RAM Size";
+ case 0x0006:
+ return "RF Modem Supplier Range";
+ case 0x0007:
+ return "MAC Controller Supplier Range";
+ case 0x0008:
+ return "NIC ID (component ID)";
+ case 0x0101:
+ return "MAC Address";
+ case 0x0103:
+ return "Regulatory Domain List";
+ case 0x0104:
+ return "Allowed Channel Set/Active Channel List";
+ case 0x0105:
+ return "Default Channel";
+ case 0x0107:
+ return "Temperature Type";
+ case 0x0200:
+ return "IFR Setting";
+ case 0x0201:
+ return "RFR Setting";
+ case 0x0202:
+ return "3861 Baseline Register Settings";
+ case 0x0203:
+ return "3861 Shadow Register Settings";
+ case 0x0204:
+ return "3861 IF/RF Register Settings";
+ case 0x0300:
+ return "3861 Channel Calibration Set Point";
+ case 0x0301:
+ return "3861 Channel Calibration Integrator";
+ case 0x0303:
+ return "Scannable/Master Channel List";
+ case 0x0400:
+ return "3842 PRISM II NIC Configuration";
+ case 0x0401:
+ return "PRISM USB Identifier";
+ case 0x0402:
+ return "PRISM PCI Identifier";
+ case 0x0403:
+ return "PRISM PCI Interface Configuration";
+ case 0x0404:
+ return "PRISM PCI PM Configuration";
+ case 0x0406:
+ return "RSSI-to-dBm Conversion Constant";
+ case 0x0409:
+ return "PRISM USB Max Power";
+ case 0x0900:
+ return "3861 Manufacturing Test Channel Set Points";
+ case 0x0901:
+ return "Manufacturing Test Channel Integrators";
+ }
+
+ return "";
+}
+
+
+static void diag_show_pda(const char *dev)
+{
+ char fname[256];
+ struct prism2_pda pda;
+ int i, j;
+
+ printf("\nProduction Data Area (PDA)\n\n");
+
+ snprintf(fname, sizeof(fname), "/proc/net/hostap/%s/pda", dev);
+ if (read_wlan_pda(fname, &pda)) {
+ printf("Could not read wlan PDA. This requires "
+ "PRISM2_DOWNLOAD_SUPPORT definition for the kernel "
+ "driver.\n");
+ return;
+ }
+
+ for (i = 0; i < pda.pdr_count; i++) {
+ printf("PDR 0x%04x len=%i %s\n ",
+ pda.pdrs[i].pdr, pda.pdrs[i].len,
+ prism2_pdr_name(pda.pdrs[i].pdr));
+ for (j = 0; j < pda.pdrs[i].len; j++)
+ printf(" %02x", pda.pdrs[i].data[j]);
+ printf("\n");
+ }
+
+ free(pda.pdrs);
+}
+
+
static void usage(void)
{
- printf("Usage: hostap_diag [-aru] <device>\n"
+ printf("Usage: hostap_diag [-abhpru] <device>\n"
"Options:\n"
" -h show this usage info\n"
" -a show all info\n"
" -b show baseband processor control registers\n"
+ " -p show production data area (PDA)\n"
" -r show known RIDs\n"
" -u show unknown RIDs\n");
@@ -829,10 +927,11 @@ int main(int argc, char *argv[])
int show_known_rids = 0;
int show_unknown_rids = 0;
int show_bbp = 0;
+ int show_pda = 0;
char *dev;
for (;;) {
- c = getopt(argc, argv, "abhru");
+ c = getopt(argc, argv, "abhpru");
if (c < 0)
break;
if (c == 'a') {
@@ -847,6 +946,8 @@ int main(int argc, char *argv[])
show_known_rids = 1;
else if (c == 'u')
show_unknown_rids = 1;
+ else if (c == 'p')
+ show_pda = 1;
else
usage();
}
@@ -868,5 +969,8 @@ int main(int argc, char *argv[])
if (show_bbp)
diag_show_bbp(dev);
+ if (show_pda)
+ diag_show_pda(dev);
+
return 0;
}