diff options
Diffstat (limited to 'drivers/net/plip.c')
-rw-r--r-- | drivers/net/plip.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 00487f569cfd..9a2103a69e17 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -94,6 +94,7 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" | |||
94 | #include <linux/fcntl.h> | 94 | #include <linux/fcntl.h> |
95 | #include <linux/interrupt.h> | 95 | #include <linux/interrupt.h> |
96 | #include <linux/string.h> | 96 | #include <linux/string.h> |
97 | #include <linux/slab.h> | ||
97 | #include <linux/if_ether.h> | 98 | #include <linux/if_ether.h> |
98 | #include <linux/in.h> | 99 | #include <linux/in.h> |
99 | #include <linux/errno.h> | 100 | #include <linux/errno.h> |
@@ -372,8 +373,8 @@ plip_bh(struct work_struct *work) | |||
372 | 373 | ||
373 | nl->is_deferred = 0; | 374 | nl->is_deferred = 0; |
374 | f = connection_state_table[nl->connection]; | 375 | f = connection_state_table[nl->connection]; |
375 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK | 376 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK && |
376 | && (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { | 377 | (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { |
377 | nl->is_deferred = 1; | 378 | nl->is_deferred = 1; |
378 | schedule_delayed_work(&nl->deferred, 1); | 379 | schedule_delayed_work(&nl->deferred, 1); |
379 | } | 380 | } |
@@ -416,9 +417,8 @@ plip_bh_timeout_error(struct net_device *dev, struct net_local *nl, | |||
416 | 417 | ||
417 | if (error != ERROR) { /* Timeout */ | 418 | if (error != ERROR) { /* Timeout */ |
418 | nl->timeout_count++; | 419 | nl->timeout_count++; |
419 | if ((error == HS_TIMEOUT | 420 | if ((error == HS_TIMEOUT && nl->timeout_count <= 10) || |
420 | && nl->timeout_count <= 10) | 421 | nl->timeout_count <= 3) { |
421 | || nl->timeout_count <= 3) { | ||
422 | spin_unlock_irq(&nl->lock); | 422 | spin_unlock_irq(&nl->lock); |
423 | /* Try again later */ | 423 | /* Try again later */ |
424 | return TIMEOUT; | 424 | return TIMEOUT; |
@@ -624,8 +624,8 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, | |||
624 | if (plip_receive(nibble_timeout, dev, | 624 | if (plip_receive(nibble_timeout, dev, |
625 | &rcv->nibble, &rcv->length.b.msb)) | 625 | &rcv->nibble, &rcv->length.b.msb)) |
626 | return TIMEOUT; | 626 | return TIMEOUT; |
627 | if (rcv->length.h > dev->mtu + dev->hard_header_len | 627 | if (rcv->length.h > dev->mtu + dev->hard_header_len || |
628 | || rcv->length.h < 8) { | 628 | rcv->length.h < 8) { |
629 | printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); | 629 | printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); |
630 | return ERROR; | 630 | return ERROR; |
631 | } | 631 | } |