diff options
Diffstat (limited to 'drivers/net')
21 files changed, 206 insertions, 127 deletions
| diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c index 64e664f5adcc..87c134bcd48d 100644 --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c @@ -861,7 +861,6 @@ static int rcar_can_resume(struct device *dev)  {  	struct net_device *ndev = dev_get_drvdata(dev);  	struct rcar_can_priv *priv = netdev_priv(ndev); -	u16 ctlr;  	int err;  	if (!netif_running(ndev)) @@ -873,12 +872,7 @@ static int rcar_can_resume(struct device *dev)  		return err;  	} -	ctlr = readw(&priv->regs->ctlr); -	ctlr &= ~RCAR_CAN_CTLR_SLPM; -	writew(ctlr, &priv->regs->ctlr); -	ctlr &= ~RCAR_CAN_CTLR_CANM; -	writew(ctlr, &priv->regs->ctlr); -	priv->can.state = CAN_STATE_ERROR_ACTIVE; +	rcar_can_start(ndev);  	netif_device_attach(ndev);  	netif_start_queue(ndev); diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 81baec8eb1e5..a25a3ca62c12 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -690,14 +690,6 @@ static void xcan_write_frame(struct net_device *ndev, struct sk_buff *skb,  		dlc |= XCAN_DLCR_EDL_MASK;  	} -	if (!(priv->devtype.flags & XCAN_FLAG_TX_MAILBOXES) && -	    (priv->devtype.flags & XCAN_FLAG_TXFEMP)) -		can_put_echo_skb(skb, ndev, priv->tx_head % priv->tx_max, 0); -	else -		can_put_echo_skb(skb, ndev, 0, 0); - -	priv->tx_head++; -  	priv->write_reg(priv, XCAN_FRAME_ID_OFFSET(frame_offset), id);  	/* If the CAN frame is RTR frame this write triggers transmission  	 * (not on CAN FD) @@ -730,6 +722,14 @@ static void xcan_write_frame(struct net_device *ndev, struct sk_buff *skb,  					data[1]);  		}  	} + +	if (!(priv->devtype.flags & XCAN_FLAG_TX_MAILBOXES) && +	    (priv->devtype.flags & XCAN_FLAG_TXFEMP)) +		can_put_echo_skb(skb, ndev, priv->tx_head % priv->tx_max, 0); +	else +		can_put_echo_skb(skb, ndev, 0, 0); + +	priv->tx_head++;  }  /** diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 829b1f087e9e..2f846381d5a7 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1273,9 +1273,15 @@ static int b53_setup(struct dsa_switch *ds)  	 */  	ds->untag_vlan_aware_bridge_pvid = true; -	/* Ageing time is set in seconds */ -	ds->ageing_time_min = 1 * 1000; -	ds->ageing_time_max = AGE_TIME_MAX * 1000; +	if (dev->chip_id == BCM53101_DEVICE_ID) { +		/* BCM53101 uses 0.5 second increments */ +		ds->ageing_time_min = 1 * 500; +		ds->ageing_time_max = AGE_TIME_MAX * 500; +	} else { +		/* Everything else uses 1 second increments */ +		ds->ageing_time_min = 1 * 1000; +		ds->ageing_time_max = AGE_TIME_MAX * 1000; +	}  	ret = b53_reset_switch(dev);  	if (ret) { @@ -2559,7 +2565,10 @@ int b53_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)  	else  		reg = B53_AGING_TIME_CONTROL; -	atc = DIV_ROUND_CLOSEST(msecs, 1000); +	if (dev->chip_id == BCM53101_DEVICE_ID) +		atc = DIV_ROUND_CLOSEST(msecs, 500); +	else +		atc = DIV_ROUND_CLOSEST(msecs, 1000);  	if (!is5325(dev) && !is5365(dev))  		atc |= AGE_CHANGE; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 1383918f8a3f..adf1f2bbcbb1 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2363,7 +2363,8 @@ static void fec_enet_phy_reset_after_clk_enable(struct net_device *ndev)  		 */  		phy_dev = of_phy_find_device(fep->phy_node);  		phy_reset_after_clk_enable(phy_dev); -		put_device(&phy_dev->mdio.dev); +		if (phy_dev) +			put_device(&phy_dev->mdio.dev);  	}  } diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 76d872b91a38..cc02a85ad42b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1561,6 +1561,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);  struct i40e_aq_set_mac_config {  	__le16	max_frame_size;  	u8	params; +#define I40E_AQ_SET_MAC_CONFIG_CRC_EN	BIT(2)  	u8	tx_timer_priority; /* bitmap */  	__le16	tx_timer_value;  	__le16	fc_refresh_threshold; diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 270e7e8cf9cf..59f5c1e810eb 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1190,6 +1190,40 @@ int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,  }  /** + * i40e_aq_set_mac_config - Configure MAC settings + * @hw: pointer to the hw struct + * @max_frame_size: Maximum Frame Size to be supported by the port + * @cmd_details: pointer to command details structure or NULL + * + * Set MAC configuration (0x0603). Note that max_frame_size must be greater + * than zero. + * + * Return: 0 on success, or a negative error code on failure. + */ +int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size, +			   struct i40e_asq_cmd_details *cmd_details) +{ +	struct i40e_aq_set_mac_config *cmd; +	struct libie_aq_desc desc; + +	cmd = libie_aq_raw(&desc); + +	if (max_frame_size == 0) +		return -EINVAL; + +	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_mac_config); + +	cmd->max_frame_size = cpu_to_le16(max_frame_size); +	cmd->params = I40E_AQ_SET_MAC_CONFIG_CRC_EN; + +#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD	0x7FFF +	cmd->fc_refresh_threshold = +		cpu_to_le16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD); + +	return i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); +} + +/**   * i40e_aq_clear_pxe_mode   * @hw: pointer to the hw struct   * @cmd_details: pointer to command details structure or NULL diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index b83f823e4917..b14019d44b58 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -4156,7 +4156,7 @@ free_queue_irqs:  		irq_num = pf->msix_entries[base + vector].vector;  		irq_set_affinity_notifier(irq_num, NULL);  		irq_update_affinity_hint(irq_num, NULL); -		free_irq(irq_num, &vsi->q_vectors[vector]); +		free_irq(irq_num, vsi->q_vectors[vector]);  	}  	return err;  } @@ -16045,13 +16045,17 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  		dev_dbg(&pf->pdev->dev, "get supported phy types ret =  %pe last_status =  %s\n",  			ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status)); -	/* make sure the MFS hasn't been set lower than the default */  #define MAX_FRAME_SIZE_DEFAULT 0x2600 -	val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK, -			rd32(&pf->hw, I40E_PRTGL_SAH)); -	if (val < MAX_FRAME_SIZE_DEFAULT) -		dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n", -			 pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT); + +	err = i40e_aq_set_mac_config(hw, MAX_FRAME_SIZE_DEFAULT, NULL); +	if (err) +		dev_warn(&pdev->dev, "set mac config ret = %pe last_status = %s\n", +			 ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status)); + +	/* Make sure the MFS is set to the expected value */ +	val = rd32(hw, I40E_PRTGL_SAH); +	FIELD_MODIFY(I40E_PRTGL_SAH_MFS_MASK, &val, MAX_FRAME_SIZE_DEFAULT); +	wr32(hw, I40E_PRTGL_SAH, val);  	/* Add a filter to drop all Flow control frames from any VSI from being  	 * transmitted. By doing so we stop a malicious VF from sending out diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h index aef5de53ce3b..26bb7bffe361 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h @@ -98,6 +98,8 @@ int i40e_aq_set_mac_loopback(struct i40e_hw *hw,  			     struct i40e_asq_cmd_details *cmd_details);  int i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,  			     struct i40e_asq_cmd_details *cmd_details); +int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size, +			   struct i40e_asq_cmd_details *cmd_details);  int i40e_aq_clear_pxe_mode(struct i40e_hw *hw,  			   struct i40e_asq_cmd_details *cmd_details);  int i40e_aq_set_link_restart_an(struct i40e_hw *hw, diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 51d5cb6599ed..f8a208c84f15 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev,  	} else {  		dev_info(&adapter->pdev->dev, "online testing starting\n"); -		/* PHY is powered down when interface is down */ -		if (if_running && igb_link_test(adapter, &data[TEST_LINK])) +		if (igb_link_test(adapter, &data[TEST_LINK]))  			eth_test->flags |= ETH_TEST_FL_FAILED; -		else -			data[TEST_LINK] = 0;  		/* Online tests aren't run; pass by default */  		data[TEST_REG] = 0; diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 5e63d7f6a568..85f9589cc568 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -4452,8 +4452,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)  	if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))  		xdp_rxq_info_unreg(&rx_ring->xdp_rxq);  	res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev, -			       rx_ring->queue_index, -			       rx_ring->q_vector->napi.napi_id); +			       rx_ring->queue_index, 0);  	if (res < 0) {  		dev_err(dev, "Failed to register xdp_rxq index %u\n",  			rx_ring->queue_index); diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index dadce6009791..e42d0fdefee1 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -654,7 +654,7 @@ static void icssg_prueth_hsr_fdb_add_del(struct prueth_emac *emac,  static int icssg_prueth_hsr_add_mcast(struct net_device *ndev, const u8 *addr)  { -	struct net_device *real_dev; +	struct net_device *real_dev, *port_dev;  	struct prueth_emac *emac;  	u8 vlan_id, i; @@ -663,11 +663,15 @@ static int icssg_prueth_hsr_add_mcast(struct net_device *ndev, const u8 *addr)  	if (is_hsr_master(real_dev)) {  		for (i = HSR_PT_SLAVE_A; i < HSR_PT_INTERLINK; i++) { -			emac = netdev_priv(hsr_get_port_ndev(real_dev, i)); -			if (!emac) +			port_dev = hsr_get_port_ndev(real_dev, i); +			emac = netdev_priv(port_dev); +			if (!emac) { +				dev_put(port_dev);  				return -EINVAL; +			}  			icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id,  						     true); +			dev_put(port_dev);  		}  	} else {  		emac = netdev_priv(real_dev); @@ -679,7 +683,7 @@ static int icssg_prueth_hsr_add_mcast(struct net_device *ndev, const u8 *addr)  static int icssg_prueth_hsr_del_mcast(struct net_device *ndev, const u8 *addr)  { -	struct net_device *real_dev; +	struct net_device *real_dev, *port_dev;  	struct prueth_emac *emac;  	u8 vlan_id, i; @@ -688,11 +692,15 @@ static int icssg_prueth_hsr_del_mcast(struct net_device *ndev, const u8 *addr)  	if (is_hsr_master(real_dev)) {  		for (i = HSR_PT_SLAVE_A; i < HSR_PT_INTERLINK; i++) { -			emac = netdev_priv(hsr_get_port_ndev(real_dev, i)); -			if (!emac) +			port_dev = hsr_get_port_ndev(real_dev, i); +			emac = netdev_priv(port_dev); +			if (!emac) { +				dev_put(port_dev);  				return -EINVAL; +			}  			icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id,  						     false); +			dev_put(port_dev);  		}  	} else {  		emac = netdev_priv(real_dev); diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c index bcd07a715752..5cb353a97d6d 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c @@ -2078,10 +2078,6 @@ static void wx_setup_mrqc(struct wx *wx)  {  	u32 rss_field = 0; -	/* VT, and RSS do not coexist at the same time */ -	if (test_bit(WX_FLAG_VMDQ_ENABLED, wx->flags)) -		return; -  	/* Disable indicating checksum in descriptor, enables RSS hash */  	wr32m(wx, WX_PSR_CTL, WX_PSR_CTL_PCSD, WX_PSR_CTL_PCSD); diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 0b21818e4925..5200fd5a10e5 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -4211,6 +4211,7 @@ static int macsec_newlink(struct net_device *dev,  	if (err < 0)  		goto del_dev; +	netdev_update_features(dev);  	netif_stacked_transfer_operstate(real_dev, dev);  	linkwatch_fire_event(dev); diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index a7fb1d7cae94..0e7dcdb0a666 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -361,7 +361,7 @@ config NXP_TJA11XX_PHY  	tristate "NXP TJA11xx PHYs support"  	depends on HWMON  	help -	  Currently supports the NXP TJA1100 and TJA1101 PHY. +	  Currently supports the NXP TJA1100, TJA1101 and TJA1102 PHYs.  config NCN26000_PHY  	tristate "Onsemi 10BASE-T1S Ethernet PHY" diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 13df28445f02..c02da57a4da5 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1065,23 +1065,19 @@ EXPORT_SYMBOL_GPL(phy_inband_caps);   */  int phy_config_inband(struct phy_device *phydev, unsigned int modes)  { -	int err; +	lockdep_assert_held(&phydev->lock);  	if (!!(modes & LINK_INBAND_DISABLE) +  	    !!(modes & LINK_INBAND_ENABLE) +  	    !!(modes & LINK_INBAND_BYPASS) != 1)  		return -EINVAL; -	mutex_lock(&phydev->lock);  	if (!phydev->drv) -		err = -EIO; +		return -EIO;  	else if (!phydev->drv->config_inband) -		err = -EOPNOTSUPP; -	else -		err = phydev->drv->config_inband(phydev, modes); -	mutex_unlock(&phydev->lock); +		return -EOPNOTSUPP; -	return err; +	return phydev->drv->config_inband(phydev, modes);  }  EXPORT_SYMBOL(phy_config_inband); diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 7556aa3dd7ee..c82c1997147b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -287,8 +287,7 @@ static bool phy_uses_state_machine(struct phy_device *phydev)  	if (phydev->phy_link_change == phy_link_change)  		return phydev->attached_dev && phydev->adjust_link; -	/* phydev->phy_link_change is implicitly phylink_phy_change() */ -	return true; +	return !!phydev->phy_link_change;  }  static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) @@ -1864,6 +1863,8 @@ void phy_detach(struct phy_device *phydev)  		phydev->attached_dev = NULL;  		phy_link_topo_del_phy(dev, phydev);  	} + +	phydev->phy_link_change = NULL;  	phydev->phylink = NULL;  	if (!phydev->is_on_sfp_module) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index c7cb95aa8007..1988b7d2089a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -67,6 +67,8 @@ struct phylink {  	struct timer_list link_poll;  	struct mutex state_mutex; +	/* Serialize updates to pl->phydev with phylink_resolve() */ +	struct mutex phydev_mutex;  	struct phylink_link_state phy_state;  	unsigned int phy_ib_mode;  	struct work_struct resolve; @@ -1432,6 +1434,7 @@ static void phylink_get_fixed_state(struct phylink *pl,  static void phylink_mac_initial_config(struct phylink *pl, bool force_restart)  {  	struct phylink_link_state link_state; +	struct phy_device *phy = pl->phydev;  	switch (pl->req_link_an_mode) {  	case MLO_AN_PHY: @@ -1455,7 +1458,11 @@ static void phylink_mac_initial_config(struct phylink *pl, bool force_restart)  	link_state.link = false;  	phylink_apply_manual_flow(pl, &link_state); +	if (phy) +		mutex_lock(&phy->lock);  	phylink_major_config(pl, force_restart, &link_state); +	if (phy) +		mutex_unlock(&phy->lock);  }  static const char *phylink_pause_to_str(int pause) @@ -1591,8 +1598,13 @@ static void phylink_resolve(struct work_struct *w)  	struct phylink_link_state link_state;  	bool mac_config = false;  	bool retrigger = false; +	struct phy_device *phy;  	bool cur_link_state; +	mutex_lock(&pl->phydev_mutex); +	phy = pl->phydev; +	if (phy) +		mutex_lock(&phy->lock);  	mutex_lock(&pl->state_mutex);  	cur_link_state = phylink_link_is_up(pl); @@ -1626,11 +1638,11 @@ static void phylink_resolve(struct work_struct *w)  		/* If we have a phy, the "up" state is the union of both the  		 * PHY and the MAC  		 */ -		if (pl->phydev) +		if (phy)  			link_state.link &= pl->phy_state.link;  		/* Only update if the PHY link is up */ -		if (pl->phydev && pl->phy_state.link) { +		if (phy && pl->phy_state.link) {  			/* If the interface has changed, force a link down  			 * event if the link isn't already down, and re-resolve.  			 */ @@ -1694,6 +1706,9 @@ static void phylink_resolve(struct work_struct *w)  		queue_work(system_power_efficient_wq, &pl->resolve);  	}  	mutex_unlock(&pl->state_mutex); +	if (phy) +		mutex_unlock(&phy->lock); +	mutex_unlock(&pl->phydev_mutex);  }  static void phylink_run_resolve(struct phylink *pl) @@ -1829,6 +1844,7 @@ struct phylink *phylink_create(struct phylink_config *config,  	if (!pl)  		return ERR_PTR(-ENOMEM); +	mutex_init(&pl->phydev_mutex);  	mutex_init(&pl->state_mutex);  	INIT_WORK(&pl->resolve, phylink_resolve); @@ -2089,6 +2105,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,  		     dev_name(&phy->mdio.dev), phy->drv->name, irq_str);  	kfree(irq_str); +	mutex_lock(&pl->phydev_mutex);  	mutex_lock(&phy->lock);  	mutex_lock(&pl->state_mutex);  	pl->phydev = phy; @@ -2134,6 +2151,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,  	mutex_unlock(&pl->state_mutex);  	mutex_unlock(&phy->lock); +	mutex_unlock(&pl->phydev_mutex);  	phylink_dbg(pl,  		    "phy: %s setting supported %*pb advertising %*pb\n", @@ -2312,6 +2330,7 @@ void phylink_disconnect_phy(struct phylink *pl)  	ASSERT_RTNL(); +	mutex_lock(&pl->phydev_mutex);  	phy = pl->phydev;  	if (phy) {  		mutex_lock(&phy->lock); @@ -2321,8 +2340,11 @@ void phylink_disconnect_phy(struct phylink *pl)  		pl->mac_tx_clk_stop = false;  		mutex_unlock(&pl->state_mutex);  		mutex_unlock(&phy->lock); -		flush_work(&pl->resolve); +	} +	mutex_unlock(&pl->phydev_mutex); +	if (phy) { +		flush_work(&pl->resolve);  		phy_disconnect(phy);  	}  } diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index bd1ec3b2c084..3a3965b79942 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4078,12 +4078,68 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,  	return ret;  } +static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) +{ +	struct ath12k *ar = arvif->ar; +	struct ieee80211_vif *vif = arvif->ahvif->vif; +	struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; +	enum wmi_sta_powersave_param param; +	struct ieee80211_bss_conf *info; +	enum wmi_sta_ps_mode psmode; +	int ret; +	int timeout; +	bool enable_ps; + +	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + +	if (vif->type != NL80211_IFTYPE_STATION) +		return; + +	enable_ps = arvif->ahvif->ps; +	if (enable_ps) { +		psmode = WMI_STA_PS_MODE_ENABLED; +		param = WMI_STA_PS_PARAM_INACTIVITY_TIME; + +		timeout = conf->dynamic_ps_timeout; +		if (timeout == 0) { +			info = ath12k_mac_get_link_bss_conf(arvif); +			if (!info) { +				ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", +					    vif->addr, arvif->link_id); +				return; +			} + +			/* firmware doesn't like 0 */ +			timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000; +		} + +		ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, +						  timeout); +		if (ret) { +			ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", +				    arvif->vdev_id, ret); +			return; +		} +	} else { +		psmode = WMI_STA_PS_MODE_DISABLED; +	} + +	ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", +		   arvif->vdev_id, psmode ? "enable" : "disable"); + +	ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); +	if (ret) +		ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", +			    psmode, arvif->vdev_id, ret); +} +  static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,  					  struct ieee80211_vif *vif,  					  u64 changed)  {  	struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);  	unsigned long links = ahvif->links_map; +	struct ieee80211_vif_cfg *vif_cfg;  	struct ieee80211_bss_conf *info;  	struct ath12k_link_vif *arvif;  	struct ieee80211_sta *sta; @@ -4147,61 +4203,24 @@ static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,  			}  		}  	} -} - -static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) -{ -	struct ath12k *ar = arvif->ar; -	struct ieee80211_vif *vif = arvif->ahvif->vif; -	struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; -	enum wmi_sta_powersave_param param; -	struct ieee80211_bss_conf *info; -	enum wmi_sta_ps_mode psmode; -	int ret; -	int timeout; -	bool enable_ps; -	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); +	if (changed & BSS_CHANGED_PS) { +		links = ahvif->links_map; +		vif_cfg = &vif->cfg; -	if (vif->type != NL80211_IFTYPE_STATION) -		return; +		for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) { +			arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); +			if (!arvif || !arvif->ar) +				continue; -	enable_ps = arvif->ahvif->ps; -	if (enable_ps) { -		psmode = WMI_STA_PS_MODE_ENABLED; -		param = WMI_STA_PS_PARAM_INACTIVITY_TIME; +			ar = arvif->ar; -		timeout = conf->dynamic_ps_timeout; -		if (timeout == 0) { -			info = ath12k_mac_get_link_bss_conf(arvif); -			if (!info) { -				ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", -					    vif->addr, arvif->link_id); -				return; +			if (ar->ab->hw_params->supports_sta_ps) { +				ahvif->ps = vif_cfg->ps; +				ath12k_mac_vif_setup_ps(arvif);  			} - -			/* firmware doesn't like 0 */ -			timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;  		} - -		ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, -						  timeout); -		if (ret) { -			ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", -				    arvif->vdev_id, ret); -			return; -		} -	} else { -		psmode = WMI_STA_PS_MODE_DISABLED;  	} - -	ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", -		   arvif->vdev_id, psmode ? "enable" : "disable"); - -	ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); -	if (ret) -		ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", -			    psmode, arvif->vdev_id, ret);  }  static bool ath12k_mac_supports_tpc(struct ath12k *ar, struct ath12k_vif *ahvif, @@ -4223,7 +4242,6 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,  {  	struct ath12k_vif *ahvif = arvif->ahvif;  	struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); -	struct ieee80211_vif_cfg *vif_cfg = &vif->cfg;  	struct cfg80211_chan_def def;  	u32 param_id, param_value;  	enum nl80211_band band; @@ -4510,12 +4528,6 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,  	}  	ath12k_mac_fils_discovery(arvif, info); - -	if (changed & BSS_CHANGED_PS && -	    ar->ab->hw_params->supports_sta_ps) { -		ahvif->ps = vif_cfg->ps; -		ath12k_mac_vif_setup_ps(arvif); -	}  }  static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif, diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 742ffeb48bce..29dadedefdd2 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -843,7 +843,7 @@ int ath12k_wmi_mgmt_send(struct ath12k_link_vif *arvif, u32 buf_id,  	cmd->tx_params_valid = 0;  	frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); -	frame_tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, buf_len); +	frame_tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, buf_len_aligned);  	memcpy(frame_tlv->value, frame->data, buf_len); diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index f9e2095d6490..7e56e4ff7642 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -124,13 +124,13 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {  	{IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_mac_cfg)},/* low 5GHz active */  	{IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_mac_cfg)},/* high 5GHz active */ -/* 6x30 Series */ -	{IWL_PCI_DEVICE(0x008A, 0x5305, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x008A, 0x5307, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x008A, 0x5325, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x008A, 0x5327, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x008B, 0x5315, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x008B, 0x5317, iwl1000_mac_cfg)}, +/* 1030/6x30 Series */ +	{IWL_PCI_DEVICE(0x008A, 0x5305, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x008A, 0x5307, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x008A, 0x5325, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x008A, 0x5327, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x008B, 0x5315, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x008B, 0x5317, iwl6030_mac_cfg)},  	{IWL_PCI_DEVICE(0x0090, 0x5211, iwl6030_mac_cfg)},  	{IWL_PCI_DEVICE(0x0090, 0x5215, iwl6030_mac_cfg)},  	{IWL_PCI_DEVICE(0x0090, 0x5216, iwl6030_mac_cfg)}, @@ -181,12 +181,12 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {  	{IWL_PCI_DEVICE(0x08AE, 0x1027, iwl1000_mac_cfg)},  /* 130 Series WiFi */ -	{IWL_PCI_DEVICE(0x0896, 0x5005, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x0896, 0x5007, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x0897, 0x5015, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x0897, 0x5017, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x0896, 0x5025, iwl1000_mac_cfg)}, -	{IWL_PCI_DEVICE(0x0896, 0x5027, iwl1000_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0896, 0x5005, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0896, 0x5007, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0897, 0x5015, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0897, 0x5017, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0896, 0x5025, iwl6030_mac_cfg)}, +	{IWL_PCI_DEVICE(0x0896, 0x5027, iwl6030_mac_cfg)},  /* 2x00 Series */  	{IWL_PCI_DEVICE(0x0890, 0x4022, iwl2000_mac_cfg)}, diff --git a/drivers/net/wireless/virtual/virt_wifi.c b/drivers/net/wireless/virtual/virt_wifi.c index 1fffeff2190c..4eae89376feb 100644 --- a/drivers/net/wireless/virtual/virt_wifi.c +++ b/drivers/net/wireless/virtual/virt_wifi.c @@ -277,7 +277,9 @@ static void virt_wifi_connect_complete(struct work_struct *work)  		priv->is_connected = true;  	/* Schedules an event that acquires the rtnl lock. */ -	cfg80211_connect_result(priv->upperdev, requested_bss, NULL, 0, NULL, 0, +	cfg80211_connect_result(priv->upperdev, +				priv->is_connected ? fake_router_bssid : NULL, +				NULL, 0, NULL, 0,  				status, GFP_KERNEL);  	netif_carrier_on(priv->upperdev);  } | 
