svn commit: r226867 - head/sys/dev/bge
Pyun YongHyeon
yongari at FreeBSD.org
Thu Oct 27 22:10:52 UTC 2011
Author: yongari
Date: Thu Oct 27 22:10:52 2011
New Revision: 226867
URL: http://svn.freebsd.org/changeset/base/226867
Log:
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.
Modified:
head/sys/dev/bge/if_bge.c
head/sys/dev/bge/if_bgereg.h
Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c Thu Oct 27 21:27:37 2011 (r226866)
+++ head/sys/dev/bge/if_bge.c Thu Oct 27 22:10:52 2011 (r226867)
@@ -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);
Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h Thu Oct 27 21:27:37 2011 (r226866)
+++ head/sys/dev/bge/if_bgereg.h Thu Oct 27 22:10:52 2011 (r226867)
@@ -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
More information about the svn-src-head
mailing list