Skip to content

Commit

Permalink
net: stmmac: replace the vlan_fail_q_en field with a flag
Browse files Browse the repository at this point in the history
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230710090001.303225-8-brgl@bgdev.pl
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Bartosz Golaszewski authored and Jakub Kicinski committed Jul 14, 2023
1 parent efe9257 commit fc02152
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
/* Set the maxmtu to a default of JUMBO_LEN */
plat->maxmtu = JUMBO_LEN;

plat->vlan_fail_q_en = true;
plat->flags |= STMMAC_FLAG_VLAN_FAIL_Q_EN;

/* Use the last Rx queue */
plat->vlan_fail_q = plat->rx_queues_to_use - 1;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6923,7 +6923,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
if (priv->dma_cap.tsoen)
dev_info(priv->device, "TSO supported\n");

priv->hw->vlan_fail_q_en = priv->plat->vlan_fail_q_en;
priv->hw->vlan_fail_q_en =
(priv->plat->flags & STMMAC_FLAG_VLAN_FAIL_Q_EN);
priv->hw->vlan_fail_q = priv->plat->vlan_fail_q;

/* Run HW quirks, if any */
Expand Down
2 changes: 1 addition & 1 deletion include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ struct dwmac4_addrs {
#define STMMAC_FLAG_HAS_SUN8I BIT(3)
#define STMMAC_FLAG_TSO_EN BIT(4)
#define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5)
#define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6)

struct plat_stmmacenet_data {
int bus_id;
Expand Down Expand Up @@ -278,7 +279,6 @@ struct plat_stmmacenet_data {
bool en_tx_lpi_clockgating;
bool rx_clk_runs_in_lpi;
int has_xgmac;
bool vlan_fail_q_en;
u8 vlan_fail_q;
unsigned int eee_usecs_rate;
struct pci_dev *pdev;
Expand Down

0 comments on commit fc02152

Please sign in to comment.