summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2011-10-27 22:10:52 +0000
committeryongari <yongari@FreeBSD.org>2011-10-27 22:10:52 +0000
commitb3186665e68755eb55f08c6a04fb0ac3e5feaffb (patch)
tree099485a340a1f0366d421fbcc94f110ecb0b742c
parent6aafd5d8529d62bb46fdca61fc6ec8da22566eb9 (diff)
downloadFreeBSD-src-b3186665e68755eb55f08c6a04fb0ac3e5feaffb.zip
FreeBSD-src-b3186665e68755eb55f08c6a04fb0ac3e5feaffb.tar.gz
Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2 seconds. BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data. This data contains timeout value in seconds until the next BGE_FW_CMD_DRV_ALIVE command. Broadcom recommends driver set the value 3 times longer than the interval that it sends BGE_FW_CMD_DRV_ALIVE. Currently bge(4) uses 3 seconds so probably we have to increase it in future and use different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3). No functional changes.
-rw-r--r--sys/dev/bge/if_bge.c3
-rw-r--r--sys/dev/bge/if_bgereg.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 77b4a69..a6dfbaa 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -4110,7 +4110,8 @@ bge_asf_driver_up(struct bge_softc *sc)
bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB,
BGE_FW_CMD_DRV_ALIVE);
bge_writemem_ind(sc, BGE_SRAM_FW_CMD_LEN_MB, 4);
- bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, 3);
+ bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB,
+ BGE_FW_HB_TIMEOUT_SEC);
CSR_WRITE_4(sc, BGE_RX_CPU_EVENT,
CSR_READ_4(sc, BGE_RX_CPU_EVENT) |
BGE_RX_CPU_DRV_EVENT);
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index c46ba3e..f6d94ac 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -100,6 +100,8 @@
#define BGE_FW_CMD_DRV_ALIVE2 0x0000000D
#define BGE_FW_CMD_DRV_ALIVE3 0x0000000E
+#define BGE_FW_HB_TIMEOUT_SEC 3
+
#define BGE_FW_DRV_STATE_START 0x00000001
#define BGE_FW_DRV_STATE_START_DONE 0x80000001
#define BGE_FW_DRV_STATE_UNLOAD 0x00000002
OpenPOWER on IntegriCloud