summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xlreg.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-09-20 00:24:11 +0000
committerwpaul <wpaul@FreeBSD.org>1999-09-20 00:24:11 +0000
commitb895b5437522f0b73e31c715714e989f86b9a039 (patch)
tree1c3feef061d8874ad8ddf9c8cec67e20fed5b0b2 /sys/pci/if_xlreg.h
parentacbf246f5fb72c851b709d310e3def4bae13f8b9 (diff)
downloadFreeBSD-src-b895b5437522f0b73e31c715714e989f86b9a039.zip
FreeBSD-src-b895b5437522f0b73e31c715714e989f86b9a039.tar.gz
Add an alternate transmit strategy for 3c90xB adapters based on the transmit
strategy used in the 3Com Linux driver. The new strategy is to use transmit descriptor polling -- that is, the NIC polls the descriptors to see when new packets are available for transmission. The advantage to the new scheme is that no register accesses are needed in the transmit routine. The old scheme requires several register accesses to stall the TX engine, update the TX DMA list pointer register, then unstall the TX engine. Hopefully the new scheme will provide improved transmit performance with less CPU overhead. This only affects the 3c90xB or 3c90xC cards, not the 3c90x cards. This means the original 3c900 and 3c905 cards are unaffected. Newer cards include the 3c900B series, the 3c905B, 3c980, 3c980B, 3c905C and 3c905C, and the 3cSOHO100-TX OfficeConnect.
Diffstat (limited to 'sys/pci/if_xlreg.h')
-rw-r--r--sys/pci/if_xlreg.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h
index 9497e39..c504ccc 100644
--- a/sys/pci/if_xlreg.h
+++ b/sys/pci/if_xlreg.h
@@ -92,9 +92,11 @@
#define XL_TX_FREE 0x1C
#define XL_DMACTL 0x20
#define XL_DOWNLIST_PTR 0x24
+#define XL_DOWN_POLL 0x2D /* 3c90xB only */
#define XL_TX_FREETHRESH 0x2F
#define XL_UPLIST_PTR 0x38
#define XL_UPLIST_STATUS 0x30
+#define XL_UP_POLL 0x3D /* 3c90xB only */
#define XL_PKTSTAT_UP_STALLED 0x00002000
#define XL_PKTSTAT_UP_ERROR 0x00004000
@@ -440,6 +442,8 @@ struct xl_list_onefrag {
#define XL_RX_LIST_CNT 128
#define XL_TX_LIST_CNT 256
#define XL_MIN_FRAMELEN 60
+#define ETHER_ALIGN 2
+#define XL_INC(x, y) (x) = (x + 1) % y
struct xl_list_data {
struct xl_list_onefrag xl_rx_list[XL_RX_LIST_CNT];
@@ -451,6 +455,8 @@ struct xl_chain {
struct xl_list *xl_ptr;
struct mbuf *xl_mbuf;
struct xl_chain *xl_next;
+ struct xl_chain *xl_prev;
+ u_int32_t xl_phys;
};
struct xl_chain_onefrag {
@@ -465,9 +471,15 @@ struct xl_chain_data {
struct xl_chain_onefrag *xl_rx_head;
+ /* 3c90x "boomerang" queuing stuff */
struct xl_chain *xl_tx_head;
struct xl_chain *xl_tx_tail;
struct xl_chain *xl_tx_free;
+
+ /* 3c90xB "cyclone/hurricane/tornado" stuff */
+ int xl_tx_prod;
+ int xl_tx_cons;
+ int xl_tx_cnt;
};
#define XL_RXSTAT_LENMASK 0x00001FFF
@@ -495,11 +507,12 @@ struct xl_chain_data {
#define XL_TXSTAT_IPCKSUM 0x02000000 /* 3c905B only */
#define XL_TXSTAT_TCPCKSUM 0x04000000 /* 3c905B only */
#define XL_TXSTAT_UDPCKSUM 0x08000000 /* 3c905B only */
+#define XL_TXSTAT_RND_DEFEAT 0x10000000 /* 3c905B only */
+#define XL_TXSTAT_EMPTY 0x20000000 /* 3c905B only */
#define XL_TXSTAT_DL_INTR 0x80000000
#define XL_CAPABILITY_BM 0x20
-
struct xl_type {
u_int16_t xl_vid;
u_int16_t xl_did;
@@ -528,6 +541,9 @@ struct xl_mii_frame {
* take advantage of, namely the multicast hash filter. With older
* chips, you only have the option of turning on reception of all
* multicast frames, which is kind of lame.
+ *
+ * We also use this to decide on a transmit strategy. For the 3c90xB
+ * cards, we can use polled descriptor mode, which reduces CPU overhead.
*/
#define XL_TYPE_905B 1
#define XL_TYPE_90X 2
@@ -549,7 +565,6 @@ struct xl_softc {
u_int16_t xl_caps;
u_int8_t xl_stats_no_timeout;
u_int16_t xl_tx_thresh;
- caddr_t xl_ldata_ptr;
struct xl_list_data *xl_ldata;
struct xl_chain_data xl_cdata;
struct callout_handle xl_stat_ch;
OpenPOWER on IntegriCloud