Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36817
b: refs/heads/master
c: 7a6f436
h: refs/heads/master
i:
  36815: 222b094
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Sep 29, 2006
1 parent 2bc41f4 commit b8f8ea9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 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: 126a336822a6594662f5898f1ddf33e6d048fcc7
refs/heads/master: 7a6f4369449a471a6e5718a87c53ac75a46960ba
54 changes: 33 additions & 21 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4662,14 +4662,43 @@ static void tg3_write_sig_legacy(struct tg3 *tp, int kind)
}
}

static int tg3_poll_fw(struct tg3 *tp)
{
int i;
u32 val;

/* Wait for firmware initialization to complete. */
for (i = 0; i < 100000; i++) {
tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
break;
udelay(10);
}

/* Chip might not be fitted with firmware. Some Sun onboard
* parts are configured like that. So don't signal the timeout
* of the above loop as an error, but do report the lack of
* running firmware once.
*/
if (i >= 100000 &&
!(tp->tg3_flags2 & TG3_FLG2_NO_FWARE_REPORTED)) {
tp->tg3_flags2 |= TG3_FLG2_NO_FWARE_REPORTED;

printk(KERN_INFO PFX "%s: No firmware running.\n",
tp->dev->name);
}

return 0;
}

static void tg3_stop_fw(struct tg3 *);

/* tp->lock is held. */
static int tg3_chip_reset(struct tg3 *tp)
{
u32 val;
void (*write_op)(struct tg3 *, u32, u32);
int i;
int err;

tg3_nvram_lock(tp);

Expand Down Expand Up @@ -4829,26 +4858,9 @@ static int tg3_chip_reset(struct tg3 *tp)
tw32_f(MAC_MODE, 0);
udelay(40);

/* Wait for firmware initialization to complete. */
for (i = 0; i < 100000; i++) {
tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
break;
udelay(10);
}

/* Chip might not be fitted with firmare. Some Sun onboard
* parts are configured like that. So don't signal the timeout
* of the above loop as an error, but do report the lack of
* running firmware once.
*/
if (i >= 100000 &&
!(tp->tg3_flags2 & TG3_FLG2_NO_FWARE_REPORTED)) {
tp->tg3_flags2 |= TG3_FLG2_NO_FWARE_REPORTED;

printk(KERN_INFO PFX "%s: No firmware running.\n",
tp->dev->name);
}
err = tg3_poll_fw(tp);
if (err)
return err;

if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
Expand Down

0 comments on commit b8f8ea9

Please sign in to comment.