mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: thunderx: acpi: fix LMAC initialization
While probing BGX we requesting appropriate QLM for it's configuration and get LMAC count by that request. Then, while reading configured MAC values from SSDT table we need to save them in proper mapping: BGX[i]->lmac[j].mac = <MAC value> to later provide for initialization stuff. In order to fill such mapping properly we need to add lmac index to be used while acpi initialization since at this moment bgx->lmac_count already contains actual value. Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8a430ed50b
commit
7aa4865506
1 changed files with 6 additions and 5 deletions
|
@ -47,8 +47,9 @@ struct lmac {
|
||||||
struct bgx {
|
struct bgx {
|
||||||
u8 bgx_id;
|
u8 bgx_id;
|
||||||
struct lmac lmac[MAX_LMAC_PER_BGX];
|
struct lmac lmac[MAX_LMAC_PER_BGX];
|
||||||
int lmac_count;
|
u8 lmac_count;
|
||||||
u8 max_lmac;
|
u8 max_lmac;
|
||||||
|
u8 acpi_lmac_idx;
|
||||||
void __iomem *reg_base;
|
void __iomem *reg_base;
|
||||||
struct pci_dev *pdev;
|
struct pci_dev *pdev;
|
||||||
bool is_dlm;
|
bool is_dlm;
|
||||||
|
@ -1143,13 +1144,13 @@ static acpi_status bgx_acpi_register_phy(acpi_handle handle,
|
||||||
if (acpi_bus_get_device(handle, &adev))
|
if (acpi_bus_get_device(handle, &adev))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
acpi_get_mac_address(dev, adev, bgx->lmac[bgx->lmac_count].mac);
|
acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac);
|
||||||
|
|
||||||
SET_NETDEV_DEV(&bgx->lmac[bgx->lmac_count].netdev, dev);
|
SET_NETDEV_DEV(&bgx->lmac[bgx->acpi_lmac_idx].netdev, dev);
|
||||||
|
|
||||||
bgx->lmac[bgx->lmac_count].lmacid = bgx->lmac_count;
|
bgx->lmac[bgx->acpi_lmac_idx].lmacid = bgx->acpi_lmac_idx;
|
||||||
|
bgx->acpi_lmac_idx++; /* move to next LMAC */
|
||||||
out:
|
out:
|
||||||
bgx->lmac_count++;
|
|
||||||
return AE_OK;
|
return AE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue