Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
733a12b9
Commit
733a12b9
authored
Jul 19, 2003
by
Javier Achirica
Committed by
Jeff Garzik
Jul 19, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wireless airo] Don't sleep when the stats are requested.
parent
e6874245
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
drivers/net/wireless/airo.c
drivers/net/wireless/airo.c
+32
-19
No files found.
drivers/net/wireless/airo.c
View file @
733a12b9
...
@@ -1027,6 +1027,7 @@ struct airo_info {
...
@@ -1027,6 +1027,7 @@ struct airo_info {
tdsRssiEntry
*
rssi
;
tdsRssiEntry
*
rssi
;
struct
semaphore
sem
;
struct
semaphore
sem
;
struct
task_struct
*
task
;
struct
task_struct
*
task
;
struct
work_struct
stats_task
;
struct
work_struct
promisc_task
;
struct
work_struct
promisc_task
;
struct
{
struct
{
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -1459,29 +1460,41 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
...
@@ -1459,29 +1460,41 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
return
0
;
return
0
;
}
}
static
void
airo_read_stats
(
struct
airo_info
*
ai
)
{
StatsRid
stats_rid
;
u32
*
vals
=
stats_rid
.
vals
;
if
(
down_trylock
(
&
ai
->
sem
)
==
0
)
{
readStatsRid
(
ai
,
&
stats_rid
,
RID_STATS
,
0
);
up
(
&
ai
->
sem
);
ai
->
stats
.
rx_packets
=
vals
[
43
]
+
vals
[
44
]
+
vals
[
45
];
ai
->
stats
.
tx_packets
=
vals
[
39
]
+
vals
[
40
]
+
vals
[
41
];
ai
->
stats
.
rx_bytes
=
vals
[
92
];
ai
->
stats
.
tx_bytes
=
vals
[
91
];
ai
->
stats
.
rx_errors
=
vals
[
0
]
+
vals
[
2
]
+
vals
[
3
]
+
vals
[
4
];
ai
->
stats
.
tx_errors
=
vals
[
42
]
+
ai
->
stats
.
tx_fifo_errors
;
ai
->
stats
.
multicast
=
vals
[
43
];
ai
->
stats
.
collisions
=
vals
[
89
];
/* detailed rx_errors: */
ai
->
stats
.
rx_length_errors
=
vals
[
3
];
ai
->
stats
.
rx_crc_errors
=
vals
[
4
];
ai
->
stats
.
rx_frame_errors
=
vals
[
2
];
ai
->
stats
.
rx_fifo_errors
=
vals
[
0
];
}
else
{
ai
->
stats_task
.
routine
=
(
void
(
*
)(
void
*
))
airo_read_stats
;
ai
->
stats_task
.
data
=
(
void
*
)
ai
;
schedule_task
(
&
ai
->
stats_task
);
}
}
struct
net_device_stats
*
airo_get_stats
(
struct
net_device
*
dev
)
struct
net_device_stats
*
airo_get_stats
(
struct
net_device
*
dev
)
{
{
struct
airo_info
*
local
=
dev
->
priv
;
struct
airo_info
*
local
=
dev
->
priv
;
StatsRid
stats_rid
;
u32
*
vals
=
stats_rid
.
vals
;
/* Get stats out of the card */
/* Get stats out of the card if available */
readStatsRid
(
local
,
&
stats_rid
,
RID_STATS
,
0
);
airo_read_stats
(
local
);
local
->
stats
.
rx_packets
=
vals
[
43
]
+
vals
[
44
]
+
vals
[
45
];
local
->
stats
.
tx_packets
=
vals
[
39
]
+
vals
[
40
]
+
vals
[
41
];
local
->
stats
.
rx_bytes
=
vals
[
92
];
local
->
stats
.
tx_bytes
=
vals
[
91
];
local
->
stats
.
rx_errors
=
vals
[
0
]
+
vals
[
2
]
+
vals
[
3
]
+
vals
[
4
];
local
->
stats
.
tx_errors
=
vals
[
42
]
+
local
->
stats
.
tx_fifo_errors
;
local
->
stats
.
multicast
=
vals
[
43
];
local
->
stats
.
collisions
=
vals
[
89
];
/* detailed rx_errors: */
local
->
stats
.
rx_length_errors
=
vals
[
3
];
local
->
stats
.
rx_crc_errors
=
vals
[
4
];
local
->
stats
.
rx_frame_errors
=
vals
[
2
];
local
->
stats
.
rx_fifo_errors
=
vals
[
0
];
return
&
local
->
stats
;
return
&
local
->
stats
;
}
}
...
...
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