summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-03 00:23:26 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-03 00:23:26 +0000
commitba7b89ef08bec24c730a8ef5fc5f9f59ce889abc (patch)
treec9e9b328ee416e7764ecb3cb5c066f6259148cf2 /sys/dev
parent9e53ede7d1673f0284e899e0851f45ffb5156186 (diff)
s/OCE_DMAPTR/OCE_MEM_KVA/ and don't require a type
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_oce.c18
-rw-r--r--sys/dev/pci/if_ocevar.h14
2 files changed, 13 insertions, 19 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index 2e2052d9945..9ed8c48544d 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.39 2012/11/03 00:05:41 brynet Exp $ */
+/* $OpenBSD: if_oce.c,v 1.40 2012/11/03 00:23:25 mikeb Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -1957,9 +1957,9 @@ oce_create_eq(struct oce_softc *sc)
eq->id = -1;
eq->sc = sc;
- eq->cfg.q_len = EQ_LEN_1024; /* length of event queue */
- eq->cfg.item_size = EQE_SIZE_4; /* size of a queue item */
- eq->cfg.cur_eqd = OCE_DEFAULT_EQD; /* event queue delay */
+ eq->cfg.q_len = EQ_LEN_1024; /* length of event queue */
+ eq->cfg.item_size = EQE_SIZE_4; /* size of a queue item */
+ eq->cfg.eqd = OCE_DEFAULT_EQD; /* event queue delay */
if (oce_new_eq(sc, eq)) {
oce_destroy_ring(sc, eq->ring);
@@ -2525,7 +2525,7 @@ out:
int
oce_mbox_init(struct oce_softc *sc)
{
- struct oce_bmbx *bmbx = OCE_DMAPTR(&sc->bsmbx, struct oce_bmbx);
+ struct oce_bmbx *bmbx = OCE_MEM_KVA(&sc->bsmbx);
uint8_t *ptr = (uint8_t *)&bmbx->mbx;
if (!ISSET(sc->flags, OCE_F_MBOX_ENDIAN_RQD))
@@ -2548,7 +2548,7 @@ int
oce_cmd(struct oce_softc *sc, int subsys, int opcode, int version,
void *payload, int length)
{
- struct oce_bmbx *bmbx = OCE_DMAPTR(&sc->bsmbx, struct oce_bmbx);
+ struct oce_bmbx *bmbx = OCE_MEM_KVA(&sc->bsmbx);
struct oce_mbx *mbx = &bmbx->mbx;
struct oce_dma_mem sgl;
struct mbx_hdr *hdr;
@@ -2558,7 +2558,7 @@ oce_cmd(struct oce_softc *sc, int subsys, int opcode, int version,
if (length > OCE_MBX_PAYLOAD) {
if (oce_dma_alloc(sc, length, &sgl))
return (-1);
- epayload = OCE_DMAPTR(&sgl, char);
+ epayload = OCE_MEM_KVA(&sgl);
}
oce_dma_sync(&sc->bsmbx, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -2573,7 +2573,7 @@ oce_cmd(struct oce_softc *sc, int subsys, int opcode, int version,
bcopy(payload, epayload, length);
mbx->payload.u0.u1.sgl[0].paddr = sgl.paddr;
mbx->payload.u0.u1.sgl[0].length = length;
- hdr = OCE_DMAPTR(&sgl, struct mbx_hdr);
+ hdr = OCE_MEM_KVA(&sgl);
} else {
mbx->u0.s.embedded = 1;
bcopy(payload, &mbx->payload, length);
@@ -3102,7 +3102,7 @@ oce_new_eq(struct oce_softc *sc, struct oce_eq *eq)
cmd.params.req.ctx.size = (eq->cfg.item_size == 4) ? 0 : 1;
cmd.params.req.ctx.count = ilog2(eq->cfg.q_len / 256);
cmd.params.req.ctx.armed = 0;
- cmd.params.req.ctx.delay_mult = htole32(eq->cfg.cur_eqd);
+ cmd.params.req.ctx.delay_mult = htole32(eq->cfg.eqd);
err = oce_cmd(sc, SUBSYS_COMMON, OPCODE_COMMON_CREATE_EQ,
OCE_MBX_VER_V0, &cmd, sizeof(cmd));
diff --git a/sys/dev/pci/if_ocevar.h b/sys/dev/pci/if_ocevar.h
index 1621f0537bb..485f400aebf 100644
--- a/sys/dev/pci/if_ocevar.h
+++ b/sys/dev/pci/if_ocevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ocevar.h,v 1.4 2012/11/02 23:34:57 mikeb Exp $ */
+/* $OpenBSD: if_ocevar.h,v 1.5 2012/11/03 00:23:25 mikeb Exp $ */
/*-
* Copyright (C) 2012 Emulex
@@ -121,9 +121,9 @@ enum {
#define RING_NUM_FREE(_r) ((_r)->nitems - (_r)->nused)
-#define OCE_DMAPTR(_o, _t) ((_t *)(_o)->vaddr)
+#define OCE_MEM_KVA(_m) ((void *)((_m)->vaddr))
-#define OCE_RING_FOREACH(_r, _v, _c) \
+#define OCE_RING_FOREACH(_r, _v, _c) \
for ((_v) = oce_ring_first(_r); _c; (_v) = oce_ring_next(_r))
struct oce_packet_desc {
@@ -194,10 +194,7 @@ enum qtype {
struct eq_config {
enum eq_len q_len;
enum eqe_size item_size;
- int q_vector_num;
- int min_eqd;
- int max_eqd;
- int cur_eqd;
+ int eqd;
};
struct oce_eq {
@@ -360,9 +357,6 @@ struct oce_softc {
uint32_t port_id;
uint32_t function_mode;
- uint32_t function_caps;
- uint32_t max_tx_rings;
- uint32_t max_rx_rings;
struct oce_wq * wq[OCE_MAX_WQ]; /* TX work queues */
struct oce_rq * rq[OCE_MAX_RQ]; /* RX work queues */