|
@@ -39,8 +39,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
39
|
39
|
*
|
40
|
40
|
*/
|
41
|
41
|
|
42
|
|
-/** Loopback testing in progress flag */
|
43
|
|
-static int lotest_active;
|
|
42
|
+/** Current loopback test receiver */
|
|
43
|
+static struct net_device *lotest_receiver;
|
44
|
44
|
|
45
|
45
|
/** Loopback testing received packets */
|
46
|
46
|
static LIST_HEAD ( lotest_queue );
|
|
@@ -56,13 +56,13 @@ static LIST_HEAD ( lotest_queue );
|
56
|
56
|
* @ret rc Return status code
|
57
|
57
|
*/
|
58
|
58
|
static int lotest_rx ( struct io_buffer *iobuf,
|
59
|
|
- struct net_device *netdev __unused,
|
|
59
|
+ struct net_device *netdev,
|
60
|
60
|
const void *ll_dest __unused,
|
61
|
61
|
const void *ll_source __unused,
|
62
|
62
|
unsigned int flags __unused ) {
|
63
|
63
|
|
64
|
64
|
/* Add to received packet queue if currently performing a test */
|
65
|
|
- if ( lotest_active ) {
|
|
65
|
+ if ( netdev == lotest_receiver ) {
|
66
|
66
|
list_add_tail ( &iobuf->list, &lotest_queue );
|
67
|
67
|
} else {
|
68
|
68
|
free_iob ( iobuf );
|
|
@@ -223,7 +223,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
|
223
|
223
|
|
224
|
224
|
/* Start loopback test */
|
225
|
225
|
lotest_flush();
|
226
|
|
- lotest_active = 1;
|
|
226
|
+ lotest_receiver = receiver;
|
227
|
227
|
|
228
|
228
|
/* Perform loopback test */
|
229
|
229
|
for ( successes = 0 ; ; successes++ ) {
|
|
@@ -261,7 +261,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
|
261
|
261
|
printf ( "\n");
|
262
|
262
|
|
263
|
263
|
/* Stop loopback testing */
|
264
|
|
- lotest_active = 0;
|
|
264
|
+ lotest_receiver = NULL;
|
265
|
265
|
lotest_flush();
|
266
|
266
|
|
267
|
267
|
/* Dump final statistics */
|