Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214525
b: refs/heads/master
c: dc6d074
h: refs/heads/master
i:
  214523: 4c3a7fc
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Sep 15, 2010
1 parent f36ec91 commit f8c843a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 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: f0392d24485e4c144d2741a5424f069b8b5f30e7
refs/heads/master: dc6d074457f1551f9357f773a4eda09a3d5ef150
22 changes: 20 additions & 2 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6596,6 +6596,10 @@ static void tg3_ape_send_event(struct tg3 *tp, u32 event)
int i;
u32 apedata;

/* NCSI does not support APE events */
if (tp->tg3_flags3 & TG3_FLG3_APE_HAS_NCSI)
return;

apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG);
if (apedata != APE_SEG_SIG_MAGIC)
return;
Expand Down Expand Up @@ -6647,6 +6651,8 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
APE_HOST_DRIVER_ID_MAGIC(TG3_MAJ_NUM, TG3_MIN_NUM));
tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR,
APE_HOST_BEHAV_NO_PHYLOCK);
tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE,
TG3_APE_HOST_DRVR_STATE_START);

event = APE_EVENT_STATUS_STATE_START;
break;
Expand All @@ -6658,6 +6664,16 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
*/
tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);

if (device_may_wakeup(&tp->pdev->dev) &&
(tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) {
tg3_ape_write32(tp, TG3_APE_HOST_WOL_SPEED,
TG3_APE_HOST_WOL_SPEED_AUTO);
apedata = TG3_APE_HOST_DRVR_STATE_WOL;
} else
apedata = TG3_APE_HOST_DRVR_STATE_UNLOAD;

tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE, apedata);

event = APE_EVENT_STATUS_STATE_UNLOAD;
break;
case RESET_KIND_SUSPEND:
Expand Down Expand Up @@ -12739,10 +12755,12 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)

apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);

if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI)
if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI) {
tp->tg3_flags3 |= TG3_FLG3_APE_HAS_NCSI;
fwtype = "NCSI";
else
} else {
fwtype = "DASH";
}

vlen = strlen(tp->fw_ver);

Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,7 @@
#define TG3_APE_HOST_SEG_SIG 0x4200
#define APE_HOST_SEG_SIG_MAGIC 0x484f5354
#define TG3_APE_HOST_SEG_LEN 0x4204
#define APE_HOST_SEG_LEN_MAGIC 0x0000001c
#define APE_HOST_SEG_LEN_MAGIC 0x00000020
#define TG3_APE_HOST_INIT_COUNT 0x4208
#define TG3_APE_HOST_DRIVER_ID 0x420c
#define APE_HOST_DRIVER_ID_LINUX 0xf0000000
Expand All @@ -2192,6 +2192,12 @@
#define APE_HOST_HEARTBEAT_INT_DISABLE 0
#define APE_HOST_HEARTBEAT_INT_5SEC 5000
#define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218
#define TG3_APE_HOST_DRVR_STATE 0x421c
#define TG3_APE_HOST_DRVR_STATE_START 0x00000001
#define TG3_APE_HOST_DRVR_STATE_UNLOAD 0x00000002
#define TG3_APE_HOST_DRVR_STATE_WOL 0x00000003
#define TG3_APE_HOST_WOL_SPEED 0x4224
#define TG3_APE_HOST_WOL_SPEED_AUTO 0x00008000

#define TG3_APE_EVENT_STATUS 0x4300

Expand Down Expand Up @@ -2854,6 +2860,7 @@ struct tg3 {
#define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
#define TG3_FLG3_L1PLLPD_EN 0x00800000
#define TG3_FLG3_5717_PLUS 0x01000000
#define TG3_FLG3_APE_HAS_NCSI 0x02000000

struct timer_list timer;
u16 timer_counter;
Expand Down

0 comments on commit f8c843a

Please sign in to comment.