aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnxt/bnxt_cpr.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-08 14:07:29 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-12 15:41:56 +0100
commit3d9b72106bd664b1267533e7278ff817f942e3c6 (patch)
tree52a6964f40e029d55d73bc18208971eff2297891 /drivers/net/bnxt/bnxt_cpr.c
parenta83862b166241910d0474f801cb2e6afa4c6875b (diff)
Imported Upstream version 16.11
Change-Id: I1944c65ddc88a9ad70f8c0eb6731552b84fbcb77 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_cpr.c')
-rw-r--r--drivers/net/bnxt/bnxt_cpr.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 60c277a1..3aedcb8d 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -42,28 +42,23 @@
/*
* Async event handling
*/
-void bnxt_handle_async_event(struct bnxt *bp __rte_unused,
+void bnxt_handle_async_event(struct bnxt *bp,
struct cmpl_base *cmp)
{
struct hwrm_async_event_cmpl *async_cmp =
(struct hwrm_async_event_cmpl *)cmp;
+ uint16_t event_id = rte_le_to_cpu_16(async_cmp->event_id);
/* TODO: HWRM async events are not defined yet */
/* Needs to handle: link events, error events, etc. */
- switch (async_cmp->event_id) {
- case 0:
- /* Assume LINK_CHANGE == 0 */
- RTE_LOG(INFO, PMD, "Link change event\n");
-
- /* Can just prompt the update_op routine to do a qcfg
- * instead of doing the actual qcfg
- */
- break;
- case 1:
+ switch (event_id) {
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:
+ bnxt_link_update_op(bp->eth_dev, 0);
break;
default:
- RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n",
- async_cmp->event_id);
+ RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n", event_id);
break;
}
}
@@ -124,6 +119,9 @@ void bnxt_free_def_cp_ring(struct bnxt *bp)
{
struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
+ if (cpr == NULL)
+ return;
+
bnxt_free_ring(cpr->cp_ring_struct);
rte_free(cpr->cp_ring_struct);
rte_free(cpr);