drivers/wireless/ieee80211/bcmf_core.c: There were two functions that have a address issue. In bcmf_read_sbreg and bcmf_write_sbreg, SBSDIO_SB_OFT_ADDR_MASK should be used before map address space. Noted by Shao Li in Bitbucket issue #126.

This commit is contained in:
Gregory Nutt 2018-10-25 06:52:02 -06:00
parent ba95cfe067
commit bde9b10b1d
1 changed files with 6 additions and 4 deletions

View File

@ -327,6 +327,8 @@ int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
return ret;
}
address &= SBSDIO_SB_OFT_ADDR_MASK;
/* Map to 32-bit access if len == 4 */
if (len == 4)
@ -334,8 +336,7 @@ int bcmf_read_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
address |= SBSDIO_SB_ACCESS_2_4B_FLAG;
}
return bcmf_transfer_bytes(sbus, false, 1,
address & SBSDIO_SB_OFT_ADDR_MASK, reg, len);
return bcmf_transfer_bytes(sbus, false, 1, address, reg, len);
}
/****************************************************************************
@ -352,6 +353,8 @@ int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
return ret;
}
address &= SBSDIO_SB_OFT_ADDR_MASK;
/* Map to 32-bit access if len == 4 */
if (len == 4)
@ -359,8 +362,7 @@ int bcmf_write_sbreg(FAR struct bcmf_sdio_dev_s *sbus, uint32_t address,
address |= SBSDIO_SB_ACCESS_2_4B_FLAG;
}
return bcmf_transfer_bytes(sbus, true, 1, address & SBSDIO_SB_OFT_ADDR_MASK,
reg, len);
return bcmf_transfer_bytes(sbus, true, 1, address, reg, len);
}
/****************************************************************************