mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-21 21:54:52 -04:00
fbnic: Pass fbnic_dev instead of netdev to __fbnic_set/clear_rx_mode
To make the __fbnic_set_rx_mode and __fbnic_clear_rx_mode calls usable by more points in the code we can make to that they expect a fbnic_dev pointer instead of a netdev pointer. Signed-off-by: Alexander Duyck <alexanderduyck@fb.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/175623749436.2246365.6068665520216196789.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
cf79bd4495
commit
284a67d59f
@@ -179,11 +179,10 @@ static int fbnic_mc_unsync(struct net_device *netdev, const unsigned char *addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __fbnic_set_rx_mode(struct net_device *netdev)
|
||||
void __fbnic_set_rx_mode(struct fbnic_dev *fbd)
|
||||
{
|
||||
struct fbnic_net *fbn = netdev_priv(netdev);
|
||||
bool uc_promisc = false, mc_promisc = false;
|
||||
struct fbnic_dev *fbd = fbn->fbd;
|
||||
struct net_device *netdev = fbd->netdev;
|
||||
struct fbnic_mac_addr *mac_addr;
|
||||
int err;
|
||||
|
||||
@@ -237,9 +236,12 @@ void __fbnic_set_rx_mode(struct net_device *netdev)
|
||||
|
||||
static void fbnic_set_rx_mode(struct net_device *netdev)
|
||||
{
|
||||
struct fbnic_net *fbn = netdev_priv(netdev);
|
||||
struct fbnic_dev *fbd = fbn->fbd;
|
||||
|
||||
/* No need to update the hardware if we are not running */
|
||||
if (netif_running(netdev))
|
||||
__fbnic_set_rx_mode(netdev);
|
||||
__fbnic_set_rx_mode(fbd);
|
||||
}
|
||||
|
||||
static int fbnic_set_mac(struct net_device *netdev, void *p)
|
||||
@@ -256,10 +258,9 @@ static int fbnic_set_mac(struct net_device *netdev, void *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fbnic_clear_rx_mode(struct net_device *netdev)
|
||||
void fbnic_clear_rx_mode(struct fbnic_dev *fbd)
|
||||
{
|
||||
struct fbnic_net *fbn = netdev_priv(netdev);
|
||||
struct fbnic_dev *fbd = fbn->fbd;
|
||||
struct net_device *netdev = fbd->netdev;
|
||||
int idx;
|
||||
|
||||
for (idx = ARRAY_SIZE(fbd->mac_addr); idx--;) {
|
||||
|
||||
@@ -94,8 +94,8 @@ void fbnic_time_init(struct fbnic_net *fbn);
|
||||
int fbnic_time_start(struct fbnic_net *fbn);
|
||||
void fbnic_time_stop(struct fbnic_net *fbn);
|
||||
|
||||
void __fbnic_set_rx_mode(struct net_device *netdev);
|
||||
void fbnic_clear_rx_mode(struct net_device *netdev);
|
||||
void __fbnic_set_rx_mode(struct fbnic_dev *fbd);
|
||||
void fbnic_clear_rx_mode(struct fbnic_dev *fbd);
|
||||
|
||||
void fbnic_phylink_get_pauseparam(struct net_device *netdev,
|
||||
struct ethtool_pauseparam *pause);
|
||||
|
||||
@@ -137,7 +137,7 @@ void fbnic_up(struct fbnic_net *fbn)
|
||||
|
||||
fbnic_rss_reinit_hw(fbn->fbd, fbn);
|
||||
|
||||
__fbnic_set_rx_mode(fbn->netdev);
|
||||
__fbnic_set_rx_mode(fbn->fbd);
|
||||
|
||||
/* Enable Tx/Rx processing */
|
||||
fbnic_napi_enable(fbn);
|
||||
@@ -154,7 +154,7 @@ void fbnic_down_noidle(struct fbnic_net *fbn)
|
||||
fbnic_napi_disable(fbn);
|
||||
netif_tx_disable(fbn->netdev);
|
||||
|
||||
fbnic_clear_rx_mode(fbn->netdev);
|
||||
fbnic_clear_rx_mode(fbn->fbd);
|
||||
fbnic_clear_rules(fbn->fbd);
|
||||
fbnic_rss_disable_hw(fbn->fbd);
|
||||
fbnic_disable(fbn);
|
||||
|
||||
Reference in New Issue
Block a user