summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sisreg.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-08-22 23:26:51 +0000
committerwpaul <wpaul@FreeBSD.org>2000-08-22 23:26:51 +0000
commit7370888a4b9f4fe3a8fa8f4c0dbc97f2f1b7686f (patch)
treec0ce5da06e079bfeed3a4b5ec2203c09c8792455 /sys/pci/if_sisreg.h
parentdf79e3d3c75226317d3b972133053872de7b6e6c (diff)
downloadFreeBSD-src-7370888a4b9f4fe3a8fa8f4c0dbc97f2f1b7686f.zip
FreeBSD-src-7370888a4b9f4fe3a8fa8f4c0dbc97f2f1b7686f.tar.gz
Fix up the sis driver, largely to improve the NatSemi DP83815 support:
- Modify the driver to poll the link state and positively set the MAC to full or half duplex as needed. Previously, it was possible for the MAC to remain in half duplex even though the PHY had negotiated full duplex with its link partner, which would result in bursty performance. - Program some of the NatSemi's registers as specified by the datasheet. The manual says these are necessary for "optimum perofrmance," though a couple of them are marked as reserved in the register map. *shrug* - Select the TX DMA burst size correctly for 10 and 100mbps modes. Previously I was using 64 bytes in both modes, which worked in 100mbps mode, but resulting in spotty performance in 10mbps. 32 bytes works much better; without this change, the natsemi chip yields piss poor performance at 10mbps. With these fixes, the NatSemi chip finally performs to my satisfaction. I should be merging the support for this controller into -stable shortly. Phew.
Diffstat (limited to 'sys/pci/if_sisreg.h')
-rw-r--r--sys/pci/if_sisreg.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/pci/if_sisreg.h b/sys/pci/if_sisreg.h
index a74dc3b..ee46c92 100644
--- a/sys/pci/if_sisreg.h
+++ b/sys/pci/if_sisreg.h
@@ -84,6 +84,14 @@
#define NS_ANER 0x98
#define NS_ANNPTR 0x9C
+#define NS_PHY_CR 0xE4
+#define NS_PHY_10BTSCR 0xE8
+#define NS_PHY_PAGE 0xCC
+#define NS_PHY_EXTCFG 0xF0
+#define NS_PHY_DSPCFG 0xF4
+#define NS_PHY_SDCFG 0xF8
+#define NS_PHY_TDATA 0xFC
+
#define SIS_CSR_TX_ENABLE 0x00000001
#define SIS_CSR_TX_DISABLE 0x00000002
#define SIS_CSR_RX_ENABLE 0x00000004
@@ -205,9 +213,13 @@
#define SIS_TXDMA_128BYTES 0x00600000
#define SIS_TXDMA_256BYTES 0x00700000
-#define SIS_TXCFG \
+#define SIS_TXCFG_100 \
(SIS_TXDMA_64BYTES|SIS_TXCFG_AUTOPAD|\
- SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1500))
+ SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536))
+
+#define SIS_TXCFG_10 \
+ (SIS_TXDMA_32BYTES|SIS_TXCFG_AUTOPAD|\
+ SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536))
#define SIS_RXCFG_DRAIN_THRESH 0x0000003E /* 8-byte units */
#define SIS_RXCFG_DMABURST 0x00700000
@@ -373,6 +385,7 @@ struct sis_softc {
device_t sis_miibus;
u_int8_t sis_unit;
u_int8_t sis_type;
+ u_int8_t sis_link;
struct sis_list_data *sis_ldata;
struct sis_ring_data sis_cdata;
struct callout_handle sis_stat_ch;
OpenPOWER on IntegriCloud