iwx: Re-activate the 32-bit boundary cross check on 64-bit architectures
__SIZEOF_*__ is in bytes, not in bits...
Reported by: brooks
Fixes: 35da55c28d ("iwx: Fix 32-bit compilation")
MFC after: 1 minute
MFC to: stable/15
Sponsored by: The FreeBSD Foundation
This commit is contained in:
@@ -5819,7 +5819,7 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
|
||||
desc->tbs[0].tb_len = htole16(IWX_FIRST_TB_SIZE);
|
||||
paddr = htole64(data->cmd_paddr);
|
||||
memcpy(&desc->tbs[0].addr, &paddr, sizeof(paddr));
|
||||
#if __SIZEOF_SIZE_T__ > 32
|
||||
#if __SIZEOF_SIZE_T__ > 4
|
||||
if (data->cmd_paddr >> 32 != (data->cmd_paddr +
|
||||
le32toh(desc->tbs[0].tb_len)) >> 32)
|
||||
DPRINTF(("%s: TB0 crosses 32bit boundary\n", __func__));
|
||||
@@ -5829,7 +5829,7 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
|
||||
paddr = htole64(data->cmd_paddr + IWX_FIRST_TB_SIZE);
|
||||
memcpy(&desc->tbs[1].addr, &paddr, sizeof(paddr));
|
||||
|
||||
#if __SIZEOF_SIZE_T__ > 32
|
||||
#if __SIZEOF_SIZE_T__ > 4
|
||||
if (data->cmd_paddr >> 32 != (data->cmd_paddr +
|
||||
le32toh(desc->tbs[1].tb_len)) >> 32)
|
||||
DPRINTF(("%s: TB1 crosses 32bit boundary\n", __func__));
|
||||
@@ -5841,7 +5841,7 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
|
||||
desc->tbs[i + 2].tb_len = htole16(seg->ds_len);
|
||||
paddr = htole64(seg->ds_addr);
|
||||
memcpy(&desc->tbs[i + 2].addr, &paddr, sizeof(paddr));
|
||||
#if __SIZEOF_SIZE_T__ > 32
|
||||
#if __SIZEOF_SIZE_T__ > 4
|
||||
if (data->cmd_paddr >> 32 != (data->cmd_paddr +
|
||||
le32toh(desc->tbs[i + 2].tb_len)) >> 32)
|
||||
DPRINTF(("%s: TB%d crosses 32bit boundary\n", __func__,
|
||||
|
||||
Reference in New Issue
Block a user