Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134788
b: refs/heads/master
c: 7fd7644
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Feb 27, 2009
1 parent 4e23e93 commit 244623b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff3a7cb25217bddcefd20e72af08a65481db4096
refs/heads/master: 7fd764455a13f4d9b37c9b908f07d0758f11d3c5
31 changes: 31 additions & 0 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11606,6 +11606,34 @@ static void __devinit tg3_read_mgmtfw_ver(struct tg3 *tp)
}
}

static void __devinit tg3_read_dash_ver(struct tg3 *tp)
{
int vlen;
u32 apedata;

if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) ||
!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
return;

apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG);
if (apedata != APE_SEG_SIG_MAGIC)
return;

apedata = tg3_ape_read32(tp, TG3_APE_FW_STATUS);
if (!(apedata & APE_FW_STATUS_READY))
return;

apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);

vlen = strlen(tp->fw_ver);

snprintf(&tp->fw_ver[vlen], TG3_VER_SIZE - vlen, " DASH v%d.%d.%d.%d",
(apedata & APE_FW_VERSION_MAJMSK) >> APE_FW_VERSION_MAJSFT,
(apedata & APE_FW_VERSION_MINMSK) >> APE_FW_VERSION_MINSFT,
(apedata & APE_FW_VERSION_REVMSK) >> APE_FW_VERSION_REVSFT,
(apedata & APE_FW_VERSION_BLDMSK));
}

static void __devinit tg3_read_fw_ver(struct tg3 *tp)
{
u32 val;
Expand Down Expand Up @@ -13279,6 +13307,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
}

tg3_ape_lock_init(tp);

if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF)
tg3_read_dash_ver(tp);
}

/*
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,14 @@
/* APE shared memory. Accessible through BAR1 */
#define TG3_APE_FW_STATUS 0x400c
#define APE_FW_STATUS_READY 0x00000100
#define TG3_APE_FW_VERSION 0x4018
#define APE_FW_VERSION_MAJMSK 0xff000000
#define APE_FW_VERSION_MAJSFT 24
#define APE_FW_VERSION_MINMSK 0x00ff0000
#define APE_FW_VERSION_MINSFT 16
#define APE_FW_VERSION_REVMSK 0x0000ff00
#define APE_FW_VERSION_REVSFT 8
#define APE_FW_VERSION_BLDMSK 0x000000ff
#define TG3_APE_HOST_SEG_SIG 0x4200
#define APE_HOST_SEG_SIG_MAGIC 0x484f5354
#define TG3_APE_HOST_SEG_LEN 0x4204
Expand Down

0 comments on commit 244623b

Please sign in to comment.