brcmfmac: analyze descriptors of current component only
authorRafał Miłecki <zajec5@gmail.com>
Tue, 26 Jan 2016 16:57:01 +0000 (17:57 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 6 Feb 2016 11:52:47 +0000 (13:52 +0200)
commita4f4abd037c1f8c6a834c95a46a2514d4b350888
tree5bcac67d6a817dde42078eeea516dde69ff94524
parent515b399c9a204da70d54916d23c1748ff7083fb8
brcmfmac: analyze descriptors of current component only

So far we were looking for address descriptors without a check for
crossing current component border. In case of dealing with unsupported
descriptor or descriptor missing at all the code would incorrectly get
data from another component.

Consider this binary-described component from BCM4366 EROM:
4bf83b01 TAG==CI CID==0x83b
20080201 TAG==CI PORTS==0+1 WRAPPERS==0+1
18400035 TAG==ADDR SZ_SZD TYPE_SLAVE
00050000
18107085 TAG==ADDR SZ_4K TYPE_SWRAP

Driver was assigning invalid base address to this core:
brcmfmac:  [6 ] core 0x83b:32 base 0x18109000 wrap 0x18107000
which came from totally different component defined in EROM:
43b36701 TAG==CI CID==0x367
00000201 TAG==CI PORTS==0+1 WRAPPERS==0+0
18109005 TAG==ADDR SZ_4K TYPE_SLAVE

This change will also allow us to support components without wrapper
address in the future.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c