aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ste/if_stereg.h
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2009-12-22 23:57:10 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2009-12-22 23:57:10 +0000
commit81598b3e5e55fd6e3737ad1a3d4508f2b157b511 (patch)
tree21d87d6402565b66b871cf19520d4fcde0559e0f /sys/dev/ste/if_stereg.h
parent536fb65904e6a82087776b5708b4a8ca056fff07 (diff)
downloadsrc-81598b3e5e55fd6e3737ad1a3d4508f2b157b511.tar.gz
src-81598b3e5e55fd6e3737ad1a3d4508f2b157b511.zip
Reimplement Tx status error handler as recommended by datasheet.
If ste(4) encounter TX underrun or excessive collisions the TX MAC of controller is stalled so driver should wake it up again. TX underrun requires increasing TX threshold value to minimize further TX underruns. Previously ste(4) used to reset controller to recover from TX underrun, excessive collision and reclaiming error. However datasheet says only TX underrun requires resetting entire controller. So implement ste_restart_tx() that restarts TX MAC and do not perform full reset except TX underrun case. Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read STE_TX_STATUS register. This way ste(4) will also read frame id value and we can write the same value back to STE_TX_FRAMEID register instead of overwriting it to 0. The datasheet was wrong in write back of STE_TX_STATUS so add some comments why we do so. Also always invoke ste_txeoc() after ste_txeof() in ste_poll as without reading TX status register can stall TX MAC.
Notes
Notes: svn path=/head/; revision=200884
Diffstat (limited to 'sys/dev/ste/if_stereg.h')
-rw-r--r--sys/dev/ste/if_stereg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/ste/if_stereg.h b/sys/dev/ste/if_stereg.h
index c0adcad7f21c..4ec1920f4cf2 100644
--- a/sys/dev/ste/if_stereg.h
+++ b/sys/dev/ste/if_stereg.h
@@ -253,6 +253,11 @@
#define STE_TXSTATUS_TXINTR_REQ 0x40
#define STE_TXSTATUS_TXDONE 0x80
+#define STE_ERR_BITS "\20" \
+ "\2RECLAIM\3STSOFLOW" \
+ "\4EXCESSCOLLS\5UNDERRUN" \
+ "\6INTREQ\7DONE"
+
#define STE_ISRACK_INTLATCH 0x0001
#define STE_ISRACK_HOSTERR 0x0002
#define STE_ISRACK_TX_DONE 0x0004