Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
25697198
Commit
25697198
authored
Mar 06, 2013
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_pstats: huge cleanup after suggestions by Alessandro and checkpatch
parent
1ad8be29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
152 deletions
+151
-152
wr_pstats.c
kernel/wr_pstats/wr_pstats.c
+138
-132
wr_pstats.h
kernel/wr_pstats/wr_pstats.h
+13
-20
No files found.
kernel/wr_pstats/wr_pstats.c
View file @
25697198
This diff is collapsed.
Click to expand it.
kernel/wr_pstats/wr_pstats.h
View file @
25697198
#ifndef __WR_PSTATS_H__
#define __WR_PSTATS_H__
#define NPORTS 18
/* how many eth ports are in the switch */
#define CNT_PP 17
/* how many counters per port */
#define ADR_PP ((CNT_PP+3)/4)
/* how many address words are there per counter
* (each of them stores the state of 4 counters) */
#define CNT_LSB 16
/*how many bits are stored in hw*/
#define CNT_LSB_MSK 0x0000ffff
#define CNT_MSB_MSK 0xffff0000
#define IRQS_BUFSZ 16
/*General VIC IRQ stuff*/
#define FPGA_BASE_PSTATS 0x10057000
#define WR_PSTATS_IRQ 3
#define WRVIC_BASE_IRQ (NR_AIC_IRQS + (5 * 32))
#define MSK_ALLPORTS 0xffffffff
//#define MSK_8PORTS 0xff
//#define MSK_18PORTS 0x3ffff
//#define MSK_PORTS(port) (2^(port) - 1)
/*****/
static
int
pstats_rd_cntrs
(
uint8_t
port
);
#define PSTATS_NPORTS 18
/* how many eth ports are in the switch */
#define PSTATS_CNT_PP 17
/* how many counters per port */
#define PSTATS_ADR_PP ((PSTATS_CNT_PP+3)/4)
/* how many address words are
* there per counter (each of
* them stores the state of 4
* counters) */
#define PSTATS_MSB_SHIFT 16
/*how many bits are stored in hw*/
#define PSTATS_LSB_MSK 0x0000ffff
#define PSTATS_MSB_MSK 0xffff0000
#define PSTATS_ALL_MSK 0xffffffff
const
uint8_t
portnums
[
18
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
};
const
char
*
portnames
[
18
]
=
{
"port0"
,
"port1"
,
"port2"
,
"port3"
,
"port4"
,
"port5"
,
"port6"
,
"port7"
,
"port8"
,
"port9"
,
"port10"
,
"port11"
,
"port12"
,
"port13"
,
"port14"
,
"port15"
,
"port16"
,
"port17"
};
#define PSTATS_IRQBUFSZ 16
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment