aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/tg3.h
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-07-16 12:24:02 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 02:10:30 -0400
commitaed93e0bf493535c25c27270001226bb1dd379b2 (patch)
treeac90051c0b2f86ad78b67a6c33e8620f2c845d30 /drivers/net/ethernet/broadcom/tg3.h
parentcf8d55ae08459d6412779559fb1e88252db86c9d (diff)
tg3: Add hwmon support for temperature
Some tg3 devices have management firmware that can export sensor data. Export temperature sensor reading via hwmon sysfs. [hwmon interface suggested by Ben Hutchings <bhutchings@solarflare.com>] Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.h')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index f8a0d9c0e990..a1b75cd67b9d 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2676,6 +2676,40 @@ struct tg3_hw_stats {
2676 u8 __reserved4[0xb00-0x9c8]; 2676 u8 __reserved4[0xb00-0x9c8];
2677}; 2677};
2678 2678
2679#define TG3_SD_NUM_RECS 3
2680#define TG3_OCIR_LEN (sizeof(struct tg3_ocir))
2681#define TG3_OCIR_SIG_MAGIC 0x5253434f
2682#define TG3_OCIR_FLAG_ACTIVE 0x00000001
2683
2684#define TG3_TEMP_CAUTION_OFFSET 0xc8
2685#define TG3_TEMP_MAX_OFFSET 0xcc
2686#define TG3_TEMP_SENSOR_OFFSET 0xd4
2687
2688
2689struct tg3_ocir {
2690 u32 signature;
2691 u16 version_flags;
2692 u16 refresh_int;
2693 u32 refresh_tmr;
2694 u32 update_tmr;
2695 u32 dst_base_addr;
2696 u16 src_hdr_offset;
2697 u16 src_hdr_length;
2698 u16 src_data_offset;
2699 u16 src_data_length;
2700 u16 dst_hdr_offset;
2701 u16 dst_data_offset;
2702 u16 dst_reg_upd_offset;
2703 u16 dst_sem_offset;
2704 u32 reserved1[2];
2705 u32 port0_flags;
2706 u32 port1_flags;
2707 u32 port2_flags;
2708 u32 port3_flags;
2709 u32 reserved2[1];
2710};
2711
2712
2679/* 'mapping' is superfluous as the chip does not write into 2713/* 'mapping' is superfluous as the chip does not write into
2680 * the tx/rx post rings so we could just fetch it from there. 2714 * the tx/rx post rings so we could just fetch it from there.
2681 * But the cache behavior is better how we are doing it now. 2715 * But the cache behavior is better how we are doing it now.
@@ -3211,6 +3245,10 @@ struct tg3 {
3211 const char *fw_needed; 3245 const char *fw_needed;
3212 const struct firmware *fw; 3246 const struct firmware *fw;
3213 u32 fw_len; /* includes BSS */ 3247 u32 fw_len; /* includes BSS */
3248
3249#if IS_ENABLED(CONFIG_HWMON)
3250 struct device *hwmon_dev;
3251#endif
3214}; 3252};
3215 3253
3216#endif /* !(_T3_H) */ 3254#endif /* !(_T3_H) */