summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-08-09 18:17:16 +0000
committeradrian <adrian@FreeBSD.org>2014-08-09 18:17:16 +0000
commitaaf7d0bcce577d266e7c241983a11bb2ab22ef24 (patch)
treec23d793de6a46171a90bc10e5e080b9b3b56037a /tools
parent71f6372bdbd4c4ad7ea60d481d3f16b5b814d6ff (diff)
downloadFreeBSD-src-aaf7d0bcce577d266e7c241983a11bb2ab22ef24.zip
FreeBSD-src-aaf7d0bcce577d266e7c241983a11bb2ab22ef24.tar.gz
Update athpoke/athregs to use the modified register read diagnostic API.
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/ath/athpoke/athpoke.c4
-rw-r--r--tools/tools/ath/athregs/dumpregs.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/tools/tools/ath/athpoke/athpoke.c b/tools/tools/ath/athpoke/athpoke.c
index 1749b7b..9f19f47 100644
--- a/tools/tools/ath/athpoke/athpoke.c
+++ b/tools/tools/ath/athpoke/athpoke.c
@@ -123,7 +123,7 @@ static uint32_t
regread(int s, struct ath_diag *atd, uint32_t r)
{
HAL_REGRANGE ra;
- uint32_t v[2];
+ uint32_t v[3];
ra.start = r;
ra.end = 0;
@@ -135,7 +135,7 @@ regread(int s, struct ath_diag *atd, uint32_t r)
atd->ad_id = HAL_DIAG_REGS | ATH_DIAG_IN | ATH_DIAG_DYN;
if (ioctl(s, SIOCGATHDIAG, atd) < 0)
err(1, atd->ad_name);
- return v[1];
+ return v[2];
}
static void
diff --git a/tools/tools/ath/athregs/dumpregs.c b/tools/tools/ath/athregs/dumpregs.c
index 50e8a1e..4a50726 100644
--- a/tools/tools/ath/athregs/dumpregs.c
+++ b/tools/tools/ath/athregs/dumpregs.c
@@ -182,8 +182,9 @@ main(int argc, char *argv[])
dp = (u_int32_t *)atd.ad_out_data;
ep = (u_int32_t *)(atd.ad_out_data + atd.ad_out_size);
while (dp < ep) {
- u_int r = dp[0] >> 16; /* start of range */
- u_int e = dp[0] & 0xffff; /* end of range */
+ u_int r = dp[0]; /* start of range */
+ u_int e = dp[1]; /* end of range */
+ dp++;
dp++;
/* convert offsets to indices */
r >>= 2; e >>= 2;
@@ -611,7 +612,7 @@ ath_hal_setupdiagregs(const HAL_REGRANGE regs[], u_int nr)
space = 0;
for (i = 0; i < nr; i++) {
- u_int n = 2 * sizeof(u_int32_t); /* reg range + first */
+ u_int n = sizeof(HAL_REGRANGE) + sizeof(u_int32_t); /* reg range + first */
if (regs[i].end) {
if (regs[i].end < regs[i].start) {
fprintf(stderr, "%s: bad register range, "
OpenPOWER on IntegriCloud