Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222052
b: refs/heads/master
c: 19c0ef6
h: refs/heads/master
v: v3
  • Loading branch information
Ken Kawasaki authored and David S. Miller committed Nov 12, 2010
1 parent e972987 commit 541a0e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 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: 2de795707294972f6c34bae9de713e502c431296
refs/heads/master: 19c0ef6b36a67fc579c77bb9b4da00e084fdb667
30 changes: 20 additions & 10 deletions trunk/drivers/net/pcmcia/axnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id);

typedef struct axnet_dev_t {
struct pcmcia_device *p_dev;
caddr_t base;
struct timer_list watchdog;
int stale, fast_poll;
u_short link_status;
u_char duplex_flag;
int phy_id;
int flags;
caddr_t base;
struct timer_list watchdog;
int stale, fast_poll;
u_short link_status;
u_char duplex_flag;
int phy_id;
int flags;
int active_low;
} axnet_dev_t;

static inline axnet_dev_t *PRIV(struct net_device *dev)
Expand Down Expand Up @@ -322,22 +323,27 @@ static int axnet_config(struct pcmcia_device *link)
if (info->flags & IS_AX88790)
outb(0x10, dev->base_addr + AXNET_GPIO); /* select Internal PHY */

info->active_low = 0;

for (i = 0; i < 32; i++) {
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
if (j == j2) continue;
if ((j != 0) && (j != 0xffff)) break;
}

/* Maybe PHY is in power down mode. (PPD_SET = 1)
Bit 2 of CCSR is active low. */
if (i == 32) {
/* Maybe PHY is in power down mode. (PPD_SET = 1)
Bit 2 of CCSR is active low. */
pcmcia_write_config_byte(link, CISREG_CCSR, 0x04);
for (i = 0; i < 32; i++) {
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
if (j == j2) continue;
if ((j != 0) && (j != 0xffff)) break;
if ((j != 0) && (j != 0xffff)) {
info->active_low = 1;
break;
}
}
}

Expand Down Expand Up @@ -383,8 +389,12 @@ static int axnet_suspend(struct pcmcia_device *link)
static int axnet_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
axnet_dev_t *info = PRIV(dev);

if (link->open) {
if (info->active_low == 1)
pcmcia_write_config_byte(link, CISREG_CCSR, 0x04);

axnet_reset_8390(dev);
AX88190_init(dev, 1);
netif_device_attach(dev);
Expand Down

0 comments on commit 541a0e3

Please sign in to comment.