summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgbe/t4_sge.c
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2012-08-16 18:31:50 +0000
committernp <np@FreeBSD.org>2012-08-16 18:31:50 +0000
commitc7341dcaf2fa694c9d87bebc6ca147bd08145dd4 (patch)
treec9303f00f31090d659e2981c310593863697bd6a /sys/dev/cxgbe/t4_sge.c
parent05949946d9fee4725e201f8b2d233420c2c74983 (diff)
downloadFreeBSD-src-c7341dcaf2fa694c9d87bebc6ca147bd08145dd4.zip
FreeBSD-src-c7341dcaf2fa694c9d87bebc6ca147bd08145dd4.tar.gz
Allow for a different handler for each type of firmware message.
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/cxgbe/t4_sge.c')
-rw-r--r--sys/dev/cxgbe/t4_sge.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 09e5518..8e0daac 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -185,7 +185,7 @@ static void write_eqflush_wr(struct sge_eq *);
static __be64 get_flit(bus_dma_segment_t *, int, int);
static int handle_sge_egr_update(struct sge_iq *, const struct rss_header *,
struct mbuf *);
-static int handle_fw_rpl(struct sge_iq *, const struct rss_header *,
+static int handle_fw_msg(struct sge_iq *, const struct rss_header *,
struct mbuf *);
static int sysctl_uint16(SYSCTL_HANDLER_ARGS);
@@ -361,11 +361,13 @@ t4_sge_init(struct adapter *sc)
sc->sge.timer_val[4] = G_TIMERVALUE4(v) / core_ticks_per_usec(sc);
sc->sge.timer_val[5] = G_TIMERVALUE5(v) / core_ticks_per_usec(sc);
- t4_register_cpl_handler(sc, CPL_FW4_MSG, handle_fw_rpl);
- t4_register_cpl_handler(sc, CPL_FW6_MSG, handle_fw_rpl);
+ t4_register_cpl_handler(sc, CPL_FW4_MSG, handle_fw_msg);
+ t4_register_cpl_handler(sc, CPL_FW6_MSG, handle_fw_msg);
t4_register_cpl_handler(sc, CPL_SGE_EGR_UPDATE, handle_sge_egr_update);
t4_register_cpl_handler(sc, CPL_RX_PKT, t4_eth_rx);
+ t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl);
+
return (rc);
}
@@ -3520,17 +3522,15 @@ handle_sge_egr_update(struct sge_iq *iq, const struct rss_header *rss,
}
static int
-handle_fw_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
+handle_fw_msg(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
{
+ struct adapter *sc = iq->adapter;
const struct cpl_fw6_msg *cpl = (const void *)(rss + 1);
KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__,
rss->opcode));
- if (cpl->type == FW6_TYPE_CMD_RPL)
- t4_handle_fw_rpl(iq->adapter, cpl->data);
-
- return (0);
+ return (sc->fw_msg_handler[cpl->type](sc, &cpl->data[0]));
}
static int
OpenPOWER on IntegriCloud