summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sisreg.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2001-08-15 17:38:43 +0000
committerwpaul <wpaul@FreeBSD.org>2001-08-15 17:38:43 +0000
commit3420b9251b1fde96009222c3335489d8f34edcee (patch)
treed02c2e7dcb5460927414e17349bd92e6b0abbd0a /sys/pci/if_sisreg.h
parentbf74860be15599f1e7ef46c085c1c5d2b291c23d (diff)
downloadFreeBSD-src-3420b9251b1fde96009222c3335489d8f34edcee.zip
FreeBSD-src-3420b9251b1fde96009222c3335489d8f34edcee.tar.gz
Convert the if_sis and if_rl drivers to use the bus_dma API instead of
calling vtophys() and contigmalloc()/contigfree() directly. Hopefully, I have shaken out all of the problems with busdma on the alpha now. (Everything seems to work as expected.) Also, change the max RX DMA limit to 1024 bytes instead of "unlimited," as the latter seems not to work correctly on the alpha that I tested. (At 100Mbps, all attempts to receive frames yield RX errors.)
Diffstat (limited to 'sys/pci/if_sisreg.h')
-rw-r--r--sys/pci/if_sisreg.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/pci/if_sisreg.h b/sys/pci/if_sisreg.h
index 10cc02f..21cb22a 100644
--- a/sys/pci/if_sisreg.h
+++ b/sys/pci/if_sisreg.h
@@ -294,6 +294,7 @@ struct sis_desc {
/* Driver software section */
struct mbuf *sis_mbuf;
struct sis_desc *sis_nextdesc;
+ bus_dmamap_t sis_map;
};
#define SIS_CMDSTS_BUFLEN 0x00000FFF
@@ -336,9 +337,20 @@ struct sis_desc {
#define SIS_RX_LIST_CNT 64
#define SIS_TX_LIST_CNT 128
+#define SIS_RX_LIST_SZ SIS_RX_LIST_CNT * sizeof(struct sis_desc)
+#define SIS_TX_LIST_SZ SIS_TX_LIST_CNT * sizeof(struct sis_desc)
+
struct sis_list_data {
+#ifdef foo
struct sis_desc sis_rx_list[SIS_RX_LIST_CNT];
struct sis_desc sis_tx_list[SIS_TX_LIST_CNT];
+#endif
+ struct sis_desc *sis_rx_list;
+ struct sis_desc *sis_tx_list;
+ bus_dma_tag_t sis_rx_tag;
+ bus_dmamap_t sis_rx_dmamap;
+ bus_dma_tag_t sis_tx_tag;
+ bus_dmamap_t sis_tx_dmamap;
};
struct sis_ring_data {
@@ -346,6 +358,8 @@ struct sis_ring_data {
int sis_tx_prod;
int sis_tx_cons;
int sis_tx_cnt;
+ u_int32_t sis_rx_paddr;
+ u_int32_t sis_tx_paddr;
};
@@ -398,7 +412,9 @@ struct sis_softc {
u_int8_t sis_unit;
u_int8_t sis_type;
u_int8_t sis_link;
- struct sis_list_data *sis_ldata;
+ struct sis_list_data sis_ldata;
+ bus_dma_tag_t sis_parent_tag;
+ bus_dma_tag_t sis_tag;
struct sis_ring_data sis_cdata;
struct callout_handle sis_stat_ch;
struct mtx sis_mtx;
@@ -458,8 +474,3 @@ struct sis_softc {
#define SIS_PSTATE_D3 0x0003
#define SIS_PME_EN 0x0010
#define SIS_PME_STATUS 0x8000
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)va)
-#endif
OpenPOWER on IntegriCloud