Loading drivers/net/ethernet/aquantia/atlantic-fwd/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -46,4 +46,4 @@ atlantic-fwd-$(CONFIG_MACSEC) += atl_macsec.o macsec/macsec_api.o atlantic-fwd-$(CONFIG_AQFWD_QCOM) += atl_qcom.o atlantic-fwd-$(CONFIG_AQFWD_QCOM_IPA) += atl_qcom_ipa.o CFLAGS_atl_trace.o := -I$(src) ccflags-y += -I$(src) drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +2 −52 Original line number Diff line number Diff line Loading @@ -18,13 +18,14 @@ #include <linux/netdevice.h> #include <linux/moduleparam.h> #define ATL_VERSION "1.0.29" #define ATL_VERSION "1.0.30" struct atl_nic; enum atl_fwd_notify; #include "atl_compat.h" #include "atl_hw.h" #include "atl_log.h" #include "atl_ring_desc.h" #include "atl_stats.h" Loading Loading @@ -279,47 +280,6 @@ extern unsigned int atl_tx_clean_budget; extern unsigned int atl_tx_free_low; extern unsigned int atl_tx_free_high; /* Logging conviniency macros. * * atl_dev_xxx are for low-level contexts and implicitly reference * struct atl_hw *hw; * * atl_nic_xxx are for high-level contexts and implicitly reference * struct atl_nic *nic; */ #define atl_dev_dbg(fmt, args...) \ dev_dbg(&hw->pdev->dev, fmt, ## args) #define atl_dev_info(fmt, args...) \ dev_info(&hw->pdev->dev, fmt, ## args) #define atl_dev_warn(fmt, args...) \ dev_warn(&hw->pdev->dev, fmt, ## args) #define atl_dev_err(fmt, args...) \ dev_err(&hw->pdev->dev, fmt, ## args) #define atl_nic_dbg(fmt, args...) \ dev_dbg(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_info(fmt, args...) \ dev_info(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_warn(fmt, args...) \ dev_warn(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_err(fmt, args...) \ dev_err(&nic->hw.pdev->dev, fmt, ## args) #define atl_dev_init_warn(fmt, args...) \ do { \ if (hw) \ atl_dev_warn(fmt, ## args); \ else \ printk(KERN_WARNING "%s: " fmt, atl_driver_name, ##args); \ } while(0) #define atl_dev_init_err(fmt, args...) \ do { \ if (hw) \ atl_dev_warn(fmt, ## args); \ else \ printk(KERN_ERR "%s: " fmt, atl_driver_name, ##args); \ } while(0) #define atl_module_param(_name, _type, _mode) \ module_param_named(_name, atl_ ## _name, _type, _mode) Loading Loading @@ -383,16 +343,6 @@ static inline int atl_fwd_suspend_rings(struct atl_nic *nic) { return 0; } static inline int atl_fwd_resume_rings(struct atl_nic *nic) { return 0; } #endif int atl_get_lpi_timer(struct atl_nic *nic, uint32_t *lpi_delay); int atl_mdio_hwsem_get(struct atl_hw *hw); void atl_mdio_hwsem_put(struct atl_hw *hw); int __atl_mdio_read(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t *val); int atl_mdio_read(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t *val); int __atl_mdio_write(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t val); int atl_mdio_write(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t val); void atl_refresh_rxfs(struct atl_nic *nic); void atl_schedule_work(struct atl_nic *nic); int atl_hwmon_init(struct atl_nic *nic); Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_ethtool.c +26 −10 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <linux/pm_runtime.h> #include "atl_common.h" #include "atl_mdio.h" #include "atl_ring.h" #include "atl_fwdnl.h" Loading Loading @@ -1968,7 +1969,8 @@ static void atl_refresh_rxf_desc(struct atl_nic *nic, desc->update_rxf(nic, idx); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || nic->rxf_vlan.promisc_count); nic->rxf_vlan.promisc_count || !nic->rxf_vlan.vlans_active); } void atl_refresh_rxfs(struct atl_nic *nic) Loading @@ -1979,7 +1981,8 @@ void atl_refresh_rxfs(struct atl_nic *nic) atl_refresh_rxf_desc(nic, desc); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || nic->rxf_vlan.promisc_count); nic->rxf_vlan.promisc_count || !nic->rxf_vlan.vlans_active); } static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx) Loading Loading @@ -2020,7 +2023,8 @@ static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx) kfree(map); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || vlan->promisc_count); vlan->promisc_count || !vlan->vlans_active); return true; } Loading Loading @@ -2206,8 +2210,11 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) if (idx == ATL_VIDX_NONE) { /* VID not found and no unused filters */ vlan->promisc_count++; atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count); if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading @@ -2216,8 +2223,7 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) idx &= ATL_VIDX_MASK; vlan->cmd[idx] = ATL_VLAN_EN | ATL_RXF_ACT_TOHOST | vid; vlan->count++; atl_rxf_update_vlan(nic, idx); return 0; goto update_vlan; } idx &= ATL_VIDX_MASK; Loading @@ -2230,7 +2236,14 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) __func__, vid, idx); vlan->cmd[idx] = ATL_RXF_EN | ATL_RXF_ACT_TOHOST | vid; update_vlan: atl_rxf_update_vlan(nic, idx); if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading @@ -2253,9 +2266,7 @@ int atl_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) if (!(idx & ATL_VIDX_FOUND)) { /* VID not present in filters, decrease promisc count */ vlan->promisc_count--; atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count); return 0; goto update_vlan_promisc; } idx &= ATL_VIDX_MASK; Loading @@ -2271,6 +2282,11 @@ int atl_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) if (!atl_vlan_pull_from_promisc(nic, idx)) atl_rxf_update_vlan(nic, idx); update_vlan_promisc: if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.c +7 −0 Original line number Diff line number Diff line Loading @@ -787,6 +787,13 @@ int atl_fwd_receive_skb(struct net_device *ndev, struct sk_buff *skb) } EXPORT_SYMBOL(atl_fwd_receive_skb); int atl_fwd_napi_receive_skb(struct net_device *ndev, struct sk_buff *skb) { skb->protocol = eth_type_trans(skb, ndev); return netif_receive_skb(skb); } EXPORT_SYMBOL(atl_fwd_napi_receive_skb); int atl_fwd_transmit_skb(struct net_device *ndev, struct sk_buff *skb) { skb->dev = ndev; Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.h +12 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ #include "atl_common.h" /* Each incompatible API change bumps the API version */ #define ATL_FWD_API_VERSION 2 #define ATL_FWD_API_VERSION 3 struct atl_fwd_event; Loading Loading @@ -361,6 +361,17 @@ int atl_fwd_disable_event(struct atl_fwd_event *evt); int atl_fwd_receive_skb(struct net_device *ndev, struct sk_buff *skb); int atl_fwd_transmit_skb(struct net_device *ndev, struct sk_buff *skb); /** * atl_fwd_napi_receive_skb() - post skb to the network stack * * @ndev: network device * @skb: buffer to post * * This function may only be called from softirq context and interrupts * should be enabled. */ int atl_fwd_napi_receive_skb(struct net_device *ndev, struct sk_buff *skb); /** * atl_fwd_register_notifier() - Register notifier for reset of device * Loading Loading
drivers/net/ethernet/aquantia/atlantic-fwd/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -46,4 +46,4 @@ atlantic-fwd-$(CONFIG_MACSEC) += atl_macsec.o macsec/macsec_api.o atlantic-fwd-$(CONFIG_AQFWD_QCOM) += atl_qcom.o atlantic-fwd-$(CONFIG_AQFWD_QCOM_IPA) += atl_qcom_ipa.o CFLAGS_atl_trace.o := -I$(src) ccflags-y += -I$(src)
drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +2 −52 Original line number Diff line number Diff line Loading @@ -18,13 +18,14 @@ #include <linux/netdevice.h> #include <linux/moduleparam.h> #define ATL_VERSION "1.0.29" #define ATL_VERSION "1.0.30" struct atl_nic; enum atl_fwd_notify; #include "atl_compat.h" #include "atl_hw.h" #include "atl_log.h" #include "atl_ring_desc.h" #include "atl_stats.h" Loading Loading @@ -279,47 +280,6 @@ extern unsigned int atl_tx_clean_budget; extern unsigned int atl_tx_free_low; extern unsigned int atl_tx_free_high; /* Logging conviniency macros. * * atl_dev_xxx are for low-level contexts and implicitly reference * struct atl_hw *hw; * * atl_nic_xxx are for high-level contexts and implicitly reference * struct atl_nic *nic; */ #define atl_dev_dbg(fmt, args...) \ dev_dbg(&hw->pdev->dev, fmt, ## args) #define atl_dev_info(fmt, args...) \ dev_info(&hw->pdev->dev, fmt, ## args) #define atl_dev_warn(fmt, args...) \ dev_warn(&hw->pdev->dev, fmt, ## args) #define atl_dev_err(fmt, args...) \ dev_err(&hw->pdev->dev, fmt, ## args) #define atl_nic_dbg(fmt, args...) \ dev_dbg(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_info(fmt, args...) \ dev_info(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_warn(fmt, args...) \ dev_warn(&nic->hw.pdev->dev, fmt, ## args) #define atl_nic_err(fmt, args...) \ dev_err(&nic->hw.pdev->dev, fmt, ## args) #define atl_dev_init_warn(fmt, args...) \ do { \ if (hw) \ atl_dev_warn(fmt, ## args); \ else \ printk(KERN_WARNING "%s: " fmt, atl_driver_name, ##args); \ } while(0) #define atl_dev_init_err(fmt, args...) \ do { \ if (hw) \ atl_dev_warn(fmt, ## args); \ else \ printk(KERN_ERR "%s: " fmt, atl_driver_name, ##args); \ } while(0) #define atl_module_param(_name, _type, _mode) \ module_param_named(_name, atl_ ## _name, _type, _mode) Loading Loading @@ -383,16 +343,6 @@ static inline int atl_fwd_suspend_rings(struct atl_nic *nic) { return 0; } static inline int atl_fwd_resume_rings(struct atl_nic *nic) { return 0; } #endif int atl_get_lpi_timer(struct atl_nic *nic, uint32_t *lpi_delay); int atl_mdio_hwsem_get(struct atl_hw *hw); void atl_mdio_hwsem_put(struct atl_hw *hw); int __atl_mdio_read(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t *val); int atl_mdio_read(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t *val); int __atl_mdio_write(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t val); int atl_mdio_write(struct atl_hw *hw, uint8_t prtad, uint8_t mmd, uint16_t addr, uint16_t val); void atl_refresh_rxfs(struct atl_nic *nic); void atl_schedule_work(struct atl_nic *nic); int atl_hwmon_init(struct atl_nic *nic); Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_ethtool.c +26 −10 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <linux/pm_runtime.h> #include "atl_common.h" #include "atl_mdio.h" #include "atl_ring.h" #include "atl_fwdnl.h" Loading Loading @@ -1968,7 +1969,8 @@ static void atl_refresh_rxf_desc(struct atl_nic *nic, desc->update_rxf(nic, idx); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || nic->rxf_vlan.promisc_count); nic->rxf_vlan.promisc_count || !nic->rxf_vlan.vlans_active); } void atl_refresh_rxfs(struct atl_nic *nic) Loading @@ -1979,7 +1981,8 @@ void atl_refresh_rxfs(struct atl_nic *nic) atl_refresh_rxf_desc(nic, desc); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || nic->rxf_vlan.promisc_count); nic->rxf_vlan.promisc_count || !nic->rxf_vlan.vlans_active); } static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx) Loading Loading @@ -2020,7 +2023,8 @@ static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx) kfree(map); atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || vlan->promisc_count); vlan->promisc_count || !vlan->vlans_active); return true; } Loading Loading @@ -2206,8 +2210,11 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) if (idx == ATL_VIDX_NONE) { /* VID not found and no unused filters */ vlan->promisc_count++; atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count); if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading @@ -2216,8 +2223,7 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) idx &= ATL_VIDX_MASK; vlan->cmd[idx] = ATL_VLAN_EN | ATL_RXF_ACT_TOHOST | vid; vlan->count++; atl_rxf_update_vlan(nic, idx); return 0; goto update_vlan; } idx &= ATL_VIDX_MASK; Loading @@ -2230,7 +2236,14 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) __func__, vid, idx); vlan->cmd[idx] = ATL_RXF_EN | ATL_RXF_ACT_TOHOST | vid; update_vlan: atl_rxf_update_vlan(nic, idx); if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading @@ -2253,9 +2266,7 @@ int atl_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) if (!(idx & ATL_VIDX_FOUND)) { /* VID not present in filters, decrease promisc count */ vlan->promisc_count--; atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count); return 0; goto update_vlan_promisc; } idx &= ATL_VIDX_MASK; Loading @@ -2271,6 +2282,11 @@ int atl_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) if (!atl_vlan_pull_from_promisc(nic, idx)) atl_rxf_update_vlan(nic, idx); update_vlan_promisc: if (pm_runtime_active(&nic->hw.pdev->dev)) atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) || vlan->promisc_count || !vlan->vlans_active); return 0; } Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.c +7 −0 Original line number Diff line number Diff line Loading @@ -787,6 +787,13 @@ int atl_fwd_receive_skb(struct net_device *ndev, struct sk_buff *skb) } EXPORT_SYMBOL(atl_fwd_receive_skb); int atl_fwd_napi_receive_skb(struct net_device *ndev, struct sk_buff *skb) { skb->protocol = eth_type_trans(skb, ndev); return netif_receive_skb(skb); } EXPORT_SYMBOL(atl_fwd_napi_receive_skb); int atl_fwd_transmit_skb(struct net_device *ndev, struct sk_buff *skb) { skb->dev = ndev; Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_fwd.h +12 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ #include "atl_common.h" /* Each incompatible API change bumps the API version */ #define ATL_FWD_API_VERSION 2 #define ATL_FWD_API_VERSION 3 struct atl_fwd_event; Loading Loading @@ -361,6 +361,17 @@ int atl_fwd_disable_event(struct atl_fwd_event *evt); int atl_fwd_receive_skb(struct net_device *ndev, struct sk_buff *skb); int atl_fwd_transmit_skb(struct net_device *ndev, struct sk_buff *skb); /** * atl_fwd_napi_receive_skb() - post skb to the network stack * * @ndev: network device * @skb: buffer to post * * This function may only be called from softirq context and interrupts * should be enabled. */ int atl_fwd_napi_receive_skb(struct net_device *ndev, struct sk_buff *skb); /** * atl_fwd_register_notifier() - Register notifier for reset of device * Loading