Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/pci Additional pullup for ticket #1072:
details: https://anonhg.NetBSD.org/src/rev/bbc57cf3b2b2
branches: netbsd-8
changeset: 445546:bbc57cf3b2b2
user: martin <martin%NetBSD.org@localhost>
date: Fri Nov 02 07:55:06 2018 +0000
description:
Additional pullup for ticket #1072:
sys/dev/pci/if_bwfm_pci.c 1.5
Make this compilable with 32bit paddr_t.
diffstat:
sys/dev/pci/if_bwfm_pci.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diffs (90 lines):
diff -r 55452b99c6f5 -r bbc57cf3b2b2 sys/dev/pci/if_bwfm_pci.c
--- a/sys/dev/pci/if_bwfm_pci.c Thu Nov 01 07:54:18 2018 +0000
+++ b/sys/dev/pci/if_bwfm_pci.c Fri Nov 02 07:55:06 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_pci.c,v 1.4.2.2 2018/10/31 09:23:00 martin Exp $ */
+/* $NetBSD: if_bwfm_pci.c,v 1.4.2.3 2018/11/02 07:55:06 martin Exp $ */
/* $OpenBSD: if_bwfm_pci.c,v 1.18 2018/02/08 05:00:38 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
@@ -199,7 +199,7 @@
#define BWFM_PCI_DMA_MAP(_bdm) ((_bdm)->bdm_map)
#define BWFM_PCI_DMA_LEN(_bdm) ((_bdm)->bdm_size)
-#define BWFM_PCI_DMA_DVA(_bdm) ((_bdm)->bdm_map->dm_segs[0].ds_addr)
+#define BWFM_PCI_DMA_DVA(_bdm) (uint64_t)((_bdm)->bdm_map->dm_segs[0].ds_addr)
#define BWFM_PCI_DMA_KVA(_bdm) ((_bdm)->bdm_kva)
static u_int if_rxr_get(struct if_rxring *rxr, unsigned int max);
@@ -1006,6 +1006,7 @@
uint32_t pktid;
paddr_t paddr;
int s, slots;
+ uint64_t devaddr;
s = splnet();
for (slots = if_rxr_get(rxring, 8); slots > 0; slots--) {
@@ -1025,12 +1026,13 @@
m_freem(m);
break;
}
+ devaddr = paddr;
memset(req, 0, sizeof(*req));
req->msg.msgtype = msgtype;
req->msg.request_id = htole32(pktid);
req->host_buf_len = htole16(MSGBUF_MAX_PKT_SIZE);
- req->host_buf_addr.high_addr = htole32(paddr >> 32);
- req->host_buf_addr.low_addr = htole32(paddr & 0xffffffff);
+ req->host_buf_addr.high_addr = htole32(devaddr >> 32);
+ req->host_buf_addr.low_addr = htole32(devaddr & 0xffffffff);
bwfm_pci_ring_write_commit(sc, &sc->sc_ctrl_submit);
}
if_rxr_put(rxring, slots);
@@ -1045,6 +1047,7 @@
uint32_t pktid;
paddr_t paddr;
int s, slots;
+ uint64_t devaddr;
s = splnet();
for (slots = if_rxr_get(&sc->sc_rxbuf_ring, sc->sc_max_rxbufpost);
@@ -1065,12 +1068,13 @@
m_freem(m);
break;
}
+ devaddr = paddr;
memset(req, 0, sizeof(*req));
req->msg.msgtype = MSGBUF_TYPE_RXBUF_POST;
req->msg.request_id = htole32(pktid);
req->data_buf_len = htole16(MSGBUF_MAX_PKT_SIZE);
- req->data_buf_addr.high_addr = htole32(paddr >> 32);
- req->data_buf_addr.low_addr = htole32(paddr & 0xffffffff);
+ req->data_buf_addr.high_addr = htole32(devaddr >> 32);
+ req->data_buf_addr.low_addr = htole32(devaddr & 0xffffffff);
bwfm_pci_ring_write_commit(sc, &sc->sc_rxpost_submit);
}
if_rxr_put(&sc->sc_rxbuf_ring, slots);
@@ -1898,6 +1902,7 @@
struct msgbuf_tx_msghdr *tx;
uint32_t pktid;
paddr_t paddr;
+ uint64_t devaddr;
struct ether_header *eh;
int flowid, ret, ac;
@@ -1952,12 +1957,12 @@
bwfm_pci_ring_write_cancel(sc, ring, 1);
return ret;
}
- paddr += ETHER_HDR_LEN;
+ devaddr = paddr + ETHER_HDR_LEN;
tx->msg.request_id = htole32(pktid);
tx->data_len = htole16((*mp)->m_len - ETHER_HDR_LEN);
- tx->data_buf_addr.high_addr = htole32(paddr >> 32);
- tx->data_buf_addr.low_addr = htole32(paddr & 0xffffffff);
+ tx->data_buf_addr.high_addr = htole32(devaddr >> 32);
+ tx->data_buf_addr.low_addr = htole32(devaddr & 0xffffffff);
bwfm_pci_ring_write_commit(sc, ring);
return 0;
Home |
Main Index |
Thread Index |
Old Index