Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211113
b: refs/heads/master
c: ca9a783
h: refs/heads/master
i:
  211111: 4c59d9d
v: v3
  • Loading branch information
Ondrej Zary authored and David S. Miller committed Sep 26, 2010
1 parent 5422325 commit 375e711
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0255a02351b00ca55f4eb2588d05a5db9dd1a58
refs/heads/master: ca9a783575d2affed30ef27a3427a7705527ddac
23 changes: 21 additions & 2 deletions trunk/drivers/net/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ enum {
NWayState = (1 << 14) | (1 << 13) | (1 << 12),
NWayRestart = (1 << 12),
NonselPortActive = (1 << 9),
SelPortActive = (1 << 8),
LinkFailStatus = (1 << 2),
NetCxnErr = (1 << 1),
};
Expand Down Expand Up @@ -1066,6 +1067,9 @@ static void de21041_media_timer (unsigned long data)
unsigned int carrier;
unsigned long flags;

/* clear port active bits */
dw32(SIAStatus, NonselPortActive | SelPortActive);

carrier = (status & NetCxnErr) ? 0 : 1;

if (carrier) {
Expand Down Expand Up @@ -1160,14 +1164,29 @@ static void de21041_media_timer (unsigned long data)
static void de_media_interrupt (struct de_private *de, u32 status)
{
if (status & LinkPass) {
/* Ignore if current media is AUI or BNC and we can't use TP */
if ((de->media_type == DE_MEDIA_AUI ||
de->media_type == DE_MEDIA_BNC) &&
(de->media_lock ||
!de_ok_to_advertise(de, DE_MEDIA_TP_AUTO)))
return;
/* If current media is not TP, change it to TP */
if ((de->media_type == DE_MEDIA_AUI ||
de->media_type == DE_MEDIA_BNC)) {
de->media_type = DE_MEDIA_TP_AUTO;
de_stop_rxtx(de);
de_set_media(de);
de_start_rxtx(de);
}
de_link_up(de);
mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK);
return;
}

BUG_ON(!(status & LinkFail));

if (netif_carrier_ok(de->dev)) {
/* Mark the link as down only if current media is TP */
if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI &&
de->media_type != DE_MEDIA_BNC) {
de_link_down(de);
mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);
}
Expand Down

0 comments on commit 375e711

Please sign in to comment.