diff options
-rw-r--r-- | drivers/net/tg3.c | 22 | ||||
-rw-r--r-- | drivers/net/tg3.h | 9 |
2 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 38f1b19b776b..fc9706c8e3c6 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -6596,6 +6596,10 @@ static void tg3_ape_send_event(struct tg3 *tp, u32 event) | |||
6596 | int i; | 6596 | int i; |
6597 | u32 apedata; | 6597 | u32 apedata; |
6598 | 6598 | ||
6599 | /* NCSI does not support APE events */ | ||
6600 | if (tp->tg3_flags3 & TG3_FLG3_APE_HAS_NCSI) | ||
6601 | return; | ||
6602 | |||
6599 | apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG); | 6603 | apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG); |
6600 | if (apedata != APE_SEG_SIG_MAGIC) | 6604 | if (apedata != APE_SEG_SIG_MAGIC) |
6601 | return; | 6605 | return; |
@@ -6647,6 +6651,8 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind) | |||
6647 | APE_HOST_DRIVER_ID_MAGIC(TG3_MAJ_NUM, TG3_MIN_NUM)); | 6651 | APE_HOST_DRIVER_ID_MAGIC(TG3_MAJ_NUM, TG3_MIN_NUM)); |
6648 | tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR, | 6652 | tg3_ape_write32(tp, TG3_APE_HOST_BEHAVIOR, |
6649 | APE_HOST_BEHAV_NO_PHYLOCK); | 6653 | APE_HOST_BEHAV_NO_PHYLOCK); |
6654 | tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE, | ||
6655 | TG3_APE_HOST_DRVR_STATE_START); | ||
6650 | 6656 | ||
6651 | event = APE_EVENT_STATUS_STATE_START; | 6657 | event = APE_EVENT_STATUS_STATE_START; |
6652 | break; | 6658 | break; |
@@ -6658,6 +6664,16 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind) | |||
6658 | */ | 6664 | */ |
6659 | tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0); | 6665 | tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0); |
6660 | 6666 | ||
6667 | if (device_may_wakeup(&tp->pdev->dev) && | ||
6668 | (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) { | ||
6669 | tg3_ape_write32(tp, TG3_APE_HOST_WOL_SPEED, | ||
6670 | TG3_APE_HOST_WOL_SPEED_AUTO); | ||
6671 | apedata = TG3_APE_HOST_DRVR_STATE_WOL; | ||
6672 | } else | ||
6673 | apedata = TG3_APE_HOST_DRVR_STATE_UNLOAD; | ||
6674 | |||
6675 | tg3_ape_write32(tp, TG3_APE_HOST_DRVR_STATE, apedata); | ||
6676 | |||
6661 | event = APE_EVENT_STATUS_STATE_UNLOAD; | 6677 | event = APE_EVENT_STATUS_STATE_UNLOAD; |
6662 | break; | 6678 | break; |
6663 | case RESET_KIND_SUSPEND: | 6679 | case RESET_KIND_SUSPEND: |
@@ -12739,10 +12755,12 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp) | |||
12739 | 12755 | ||
12740 | apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION); | 12756 | apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION); |
12741 | 12757 | ||
12742 | if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI) | 12758 | if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI) { |
12759 | tp->tg3_flags3 |= TG3_FLG3_APE_HAS_NCSI; | ||
12743 | fwtype = "NCSI"; | 12760 | fwtype = "NCSI"; |
12744 | else | 12761 | } else { |
12745 | fwtype = "DASH"; | 12762 | fwtype = "DASH"; |
12763 | } | ||
12746 | 12764 | ||
12747 | vlen = strlen(tp->fw_ver); | 12765 | vlen = strlen(tp->fw_ver); |
12748 | 12766 | ||
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 783cd77b6165..5cd0653d6caf 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2180,7 +2180,7 @@ | |||
2180 | #define TG3_APE_HOST_SEG_SIG 0x4200 | 2180 | #define TG3_APE_HOST_SEG_SIG 0x4200 |
2181 | #define APE_HOST_SEG_SIG_MAGIC 0x484f5354 | 2181 | #define APE_HOST_SEG_SIG_MAGIC 0x484f5354 |
2182 | #define TG3_APE_HOST_SEG_LEN 0x4204 | 2182 | #define TG3_APE_HOST_SEG_LEN 0x4204 |
2183 | #define APE_HOST_SEG_LEN_MAGIC 0x0000001c | 2183 | #define APE_HOST_SEG_LEN_MAGIC 0x00000020 |
2184 | #define TG3_APE_HOST_INIT_COUNT 0x4208 | 2184 | #define TG3_APE_HOST_INIT_COUNT 0x4208 |
2185 | #define TG3_APE_HOST_DRIVER_ID 0x420c | 2185 | #define TG3_APE_HOST_DRIVER_ID 0x420c |
2186 | #define APE_HOST_DRIVER_ID_LINUX 0xf0000000 | 2186 | #define APE_HOST_DRIVER_ID_LINUX 0xf0000000 |
@@ -2192,6 +2192,12 @@ | |||
2192 | #define APE_HOST_HEARTBEAT_INT_DISABLE 0 | 2192 | #define APE_HOST_HEARTBEAT_INT_DISABLE 0 |
2193 | #define APE_HOST_HEARTBEAT_INT_5SEC 5000 | 2193 | #define APE_HOST_HEARTBEAT_INT_5SEC 5000 |
2194 | #define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218 | 2194 | #define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218 |
2195 | #define TG3_APE_HOST_DRVR_STATE 0x421c | ||
2196 | #define TG3_APE_HOST_DRVR_STATE_START 0x00000001 | ||
2197 | #define TG3_APE_HOST_DRVR_STATE_UNLOAD 0x00000002 | ||
2198 | #define TG3_APE_HOST_DRVR_STATE_WOL 0x00000003 | ||
2199 | #define TG3_APE_HOST_WOL_SPEED 0x4224 | ||
2200 | #define TG3_APE_HOST_WOL_SPEED_AUTO 0x00008000 | ||
2195 | 2201 | ||
2196 | #define TG3_APE_EVENT_STATUS 0x4300 | 2202 | #define TG3_APE_EVENT_STATUS 0x4300 |
2197 | 2203 | ||
@@ -2854,6 +2860,7 @@ struct tg3 { | |||
2854 | #define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000 | 2860 | #define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000 |
2855 | #define TG3_FLG3_L1PLLPD_EN 0x00800000 | 2861 | #define TG3_FLG3_L1PLLPD_EN 0x00800000 |
2856 | #define TG3_FLG3_5717_PLUS 0x01000000 | 2862 | #define TG3_FLG3_5717_PLUS 0x01000000 |
2863 | #define TG3_FLG3_APE_HAS_NCSI 0x02000000 | ||
2857 | 2864 | ||
2858 | struct timer_list timer; | 2865 | struct timer_list timer; |
2859 | u16 timer_counter; | 2866 | u16 timer_counter; |