Author: shurd
Date: Tue Dec 19 18:12:18 2017
New Revision: 326985
URL: https://svnweb.freebsd.org/changeset/base/326985

Log:
  Add byte swapping in bnxt_cfg_async_cr() request
  
  The firmware is always in little endian, use htole*() for all request fields
  larger than one byte.
  
  Submitted by: Bhargava Chenna Marreddy <bhargava.marre...@broadcom.com>
  Sponsored by: Broadcom Limited

Modified:
  head/sys/dev/bnxt/bnxt_hwrm.c

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==============================================================================
--- head/sys/dev/bnxt/bnxt_hwrm.c       Tue Dec 19 17:59:00 2017        
(r326984)
+++ head/sys/dev/bnxt/bnxt_hwrm.c       Tue Dec 19 18:12:18 2017        
(r326985)
@@ -945,9 +945,9 @@ bnxt_cfg_async_cr(struct bnxt_softc *softc)
 
                bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG);
 
-               req.fid = 0xffff;
+               req.fid = htole16(0xffff);
                req.enables = 
htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR);
-               req.async_event_cr = softc->def_cp_ring.ring.phys_id;
+               req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
 
                rc = hwrm_send_message(softc, &req, sizeof(req));
        }
@@ -957,7 +957,7 @@ bnxt_cfg_async_cr(struct bnxt_softc *softc)
                bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG);
 
                req.enables = 
htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR);
-               req.async_event_cr = softc->def_cp_ring.ring.phys_id;
+               req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
 
                rc = hwrm_send_message(softc, &req, sizeof(req));
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to