Commit bf543eb7 authored by Adam Wujek's avatar Adam Wujek 💬

kernel/wr_pstats: change name portX to wrportX+1

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 13f94d9e
......@@ -43,9 +43,10 @@ static unsigned int firmware_adr_pp; /* number of words with counters */
static unsigned int firmware_cpw; /* number of counters per word */
module_param(pstats_nports, int, S_IRUGO);
const char *portnames[] = {"port0", "port1", "port2", "port3", "port4",
"port5", "port6", "port7", "port8", "port9", "port10", "port11",
"port12", "port13", "port14", "port15", "port16", "port17"};
const char *portnames[] = {"wrport1", "wrport2", "wrport3", "wrport4",
"wrport5", "wrport6", "wrport7", "wrport8", "wrport9", "wrport10",
"wrport11", "wrport12", "wrport13", "wrport14", "wrport15", "wrport16",
"wrport17", "wrport18"};
static struct pstats_version_description pstats_desc[] = {
[0] = {
......
......@@ -96,7 +96,8 @@ static void parse_sysfs(int init)
if (init == 1) {
for(port=0; port<use_ports; ++port) {
sprintf(filename, "/proc/sys/pstats/port%u", port);
sprintf(filename, "/proc/sys/pstats/wrport%u",
port + 1);
file = fopen(filename, "r");
for(cntr=0; cntr<CNT_PP; ++cntr) {
fscanf(file, "%" SCNu32, &tmp1);
......@@ -110,13 +111,15 @@ static void parse_sysfs(int init)
else {
for(port=0; port<use_ports; ++port) {
sprintf(filename, "/proc/sys/pstats/port%u", port);
sprintf(filename, "/proc/sys/pstats/wrport%u",
port + 1);
file = fopen(filename, "r");
for(cntr=0; cntr<CNT_PP; ++cntr) {
fscanf(file, "%" SCNu32, &tmp1);
fscanf(file, "%" SCNu32, &tmp2);
val = (((uint64_t) tmp2) << 32) | tmp1;
cnt_pp[port][cntr].cnt = val - cnt_pp[port][cntr].init;
cnt_pp[port][cntr].cnt =
val - cnt_pp[port][cntr].init;
}
fclose(file);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment