Skip to content

Commit

Permalink
ethernet: stmmac: Add property to disable VLAN hw filter
Browse files Browse the repository at this point in the history
Since adding VLAN in promisc mode not supported, which makes unable to
setup bridge, add a configurable option to disable it.

Signed-off-by: jensen <jensenhuang@friendlyarm.com>
  • Loading branch information
911gt3 committed Nov 21, 2022
1 parent 76bd902 commit 54ad65e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5111,7 +5111,7 @@ int stmmac_dvr_probe(struct device *device,
#ifdef STMMAC_VLAN_TAG_USED
/* Both mac100 and gmac support receive VLAN tag detection */
ndev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX;
if (priv->dma_cap.vlhash) {
if (priv->plat->vlhash_en && priv->dma_cap.vlhash) {
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
"force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n");
}

/* To disable VLAN tag filter */
plat->vlhash_en = !of_property_read_bool(np, "snps,no-vlhash");

of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed);

plat->axi = stmmac_axi_setup(pdev);
Expand Down
1 change: 1 addition & 0 deletions include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct plat_stmmacenet_data {
bool en_tx_lpi_clockgating;
int has_xgmac;
bool vlan_fail_q_en;
bool vlhash_en;
u8 vlan_fail_q;
unsigned int eee_usecs_rate;
};
Expand Down

0 comments on commit 54ad65e

Please sign in to comment.