diff options
author | Bill Paul <wpaul@FreeBSD.org> | 1999-07-27 13:54:15 +0000 |
---|---|---|
committer | Bill Paul <wpaul@FreeBSD.org> | 1999-07-27 13:54:15 +0000 |
commit | 070f62142c92333f969dbe2e3e800577aacd4001 (patch) | |
tree | c6a8602d0623dc7a25640ebf2ec9d4eadb728044 /sys/pci | |
parent | 8d14e328f9eb4652aad43a87a19b7405a48ced14 (diff) | |
download | src-test2-070f62142c92333f969dbe2e3e800577aacd4001.tar.gz src-test2-070f62142c92333f969dbe2e3e800577aacd4001.zip |
Notes
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_ti.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 8d3ae6d26c07..76bb8dfaea22 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_ti.c,v 1.12 1999/07/23 18:46:24 wpaul Exp $ + * $Id: if_ti.c,v 1.13 1999/07/25 06:46:19 peter Exp $ */ /* @@ -131,7 +131,7 @@ #if !defined(lint) static const char rcsid[] = - "$Id: if_ti.c,v 1.12 1999/07/23 18:46:24 wpaul Exp $"; + "$Id: if_ti.c,v 1.13 1999/07/25 06:46:19 peter Exp $"; #endif /* @@ -382,7 +382,7 @@ static void ti_mem(sc, addr, len, buf) segptr = addr; cnt = len; - ti_winbase = (caddr_t)(sc->ti_bhandle + TI_WINDOW); + ti_winbase = (caddr_t)(sc->ti_vhandle + TI_WINDOW); ptr = buf; while(cnt) { @@ -1376,7 +1376,7 @@ static int ti_gibinit(sc) rcb = &sc->ti_rdata->ti_info.ti_cmd_rcb; sc->ti_rdata->ti_cmd_ring = - (struct ti_cmd_desc *)(sc->ti_bhandle + TI_GCR_CMDRING); + (struct ti_cmd_desc *)(sc->ti_vhandle + TI_GCR_CMDRING); TI_HOSTADDR(rcb->ti_hostaddr) = TI_GCR_NIC_ADDR(TI_GCR_CMDRING); rcb->ti_flags = 0; rcb->ti_max_len = 0; @@ -1463,7 +1463,7 @@ static int ti_gibinit(sc) CSR_WRITE_4(sc, TI_WINBASE, TI_TX_RING_BASE); if (sc->ti_hwrev == TI_HWREV_TIGON) { sc->ti_rdata->ti_tx_ring_nic = - (struct ti_tx_desc *)(sc->ti_bhandle + TI_WINDOW); + (struct ti_tx_desc *)(sc->ti_vhandle + TI_WINDOW); } bzero((char *)sc->ti_rdata->ti_tx_ring, TI_TX_RING_CNT * sizeof(struct ti_tx_desc)); @@ -1570,9 +1570,27 @@ static int ti_attach(dev) sc->ti_btag = rman_get_bustag(sc->ti_res); sc->ti_bhandle = rman_get_bushandle(sc->ti_res); + sc->ti_vhandle = (vm_offset_t)rman_get_virtual(sc->ti_res); + + /* + * XXX FIXME: rman_get_virtual() on the alpha is currently + * broken and returns a physical address instead of a kernel + * virtual address. Consequently, we need to do a little + * extra mangling of the vhandle on the alpha. This should + * eventually be fixed! The whole idea here is to get rid + * of platform dependencies. + */ +#ifdef __alpha__ + if (pci_cvt_to_bwx(sc->ti_vhandle)) + sc->ti_vhandle = pci_cvt_to_bwx(sc->ti_vhandle); + else + sc->ti_vhandle = pci_cvt_to_dense(sc->ti_vhandle); + sc->ti_vhandle = ALPHA_PHYS_TO_K0SEG(sc->ti_vhandle); +#endif /* Allocate interrupt */ rid = 0; + sc->ti_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); |