Commit b876382b authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller

amd-xgbe: Move Rx mode configuration into init

Currently a call to configure the Rx mode (promiscuous mode, all
multicast mode, etc.) is made in xgbe_start separate from the xgbe_init
function. This call to set the Rx mode should be part of the xgbe_init
function so that calls to the init function don't have to be preceded
with calls to configure the Rx mode.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dee19e6
...@@ -853,6 +853,22 @@ static int xgbe_set_mac_address(struct xgbe_prv_data *pdata, u8 *addr) ...@@ -853,6 +853,22 @@ static int xgbe_set_mac_address(struct xgbe_prv_data *pdata, u8 *addr)
return 0; return 0;
} }
static int xgbe_config_rx_mode(struct xgbe_prv_data *pdata)
{
struct net_device *netdev = pdata->netdev;
unsigned int pr_mode, am_mode;
pr_mode = ((netdev->flags & IFF_PROMISC) != 0);
am_mode = ((netdev->flags & IFF_ALLMULTI) != 0);
xgbe_set_promiscuous_mode(pdata, pr_mode);
xgbe_set_all_multicast_mode(pdata, am_mode);
xgbe_add_mac_addresses(pdata);
return 0;
}
static int xgbe_read_mmd_regs(struct xgbe_prv_data *pdata, int prtad, static int xgbe_read_mmd_regs(struct xgbe_prv_data *pdata, int prtad,
int mmd_reg) int mmd_reg)
{ {
...@@ -2808,6 +2824,7 @@ static int xgbe_init(struct xgbe_prv_data *pdata) ...@@ -2808,6 +2824,7 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
* Initialize MAC related features * Initialize MAC related features
*/ */
xgbe_config_mac_address(pdata); xgbe_config_mac_address(pdata);
xgbe_config_rx_mode(pdata);
xgbe_config_jumbo_enable(pdata); xgbe_config_jumbo_enable(pdata);
xgbe_config_flow_control(pdata); xgbe_config_flow_control(pdata);
xgbe_config_mac_speed(pdata); xgbe_config_mac_speed(pdata);
...@@ -2827,10 +2844,8 @@ void xgbe_init_function_ptrs_dev(struct xgbe_hw_if *hw_if) ...@@ -2827,10 +2844,8 @@ void xgbe_init_function_ptrs_dev(struct xgbe_hw_if *hw_if)
hw_if->tx_complete = xgbe_tx_complete; hw_if->tx_complete = xgbe_tx_complete;
hw_if->set_promiscuous_mode = xgbe_set_promiscuous_mode;
hw_if->set_all_multicast_mode = xgbe_set_all_multicast_mode;
hw_if->add_mac_addresses = xgbe_add_mac_addresses;
hw_if->set_mac_address = xgbe_set_mac_address; hw_if->set_mac_address = xgbe_set_mac_address;
hw_if->config_rx_mode = xgbe_config_rx_mode;
hw_if->enable_rx_csum = xgbe_enable_rx_csum; hw_if->enable_rx_csum = xgbe_enable_rx_csum;
hw_if->disable_rx_csum = xgbe_disable_rx_csum; hw_if->disable_rx_csum = xgbe_disable_rx_csum;
......
...@@ -129,7 +129,6 @@ ...@@ -129,7 +129,6 @@
static int xgbe_one_poll(struct napi_struct *, int); static int xgbe_one_poll(struct napi_struct *, int);
static int xgbe_all_poll(struct napi_struct *, int); static int xgbe_all_poll(struct napi_struct *, int);
static void xgbe_set_rx_mode(struct net_device *);
static int xgbe_alloc_channels(struct xgbe_prv_data *pdata) static int xgbe_alloc_channels(struct xgbe_prv_data *pdata)
{ {
...@@ -952,8 +951,6 @@ static int xgbe_start(struct xgbe_prv_data *pdata) ...@@ -952,8 +951,6 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
DBGPR("-->xgbe_start\n"); DBGPR("-->xgbe_start\n");
xgbe_set_rx_mode(netdev);
hw_if->init(pdata); hw_if->init(pdata);
phy_start(pdata->phydev); phy_start(pdata->phydev);
...@@ -1533,17 +1530,10 @@ static void xgbe_set_rx_mode(struct net_device *netdev) ...@@ -1533,17 +1530,10 @@ static void xgbe_set_rx_mode(struct net_device *netdev)
{ {
struct xgbe_prv_data *pdata = netdev_priv(netdev); struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct xgbe_hw_if *hw_if = &pdata->hw_if; struct xgbe_hw_if *hw_if = &pdata->hw_if;
unsigned int pr_mode, am_mode;
DBGPR("-->xgbe_set_rx_mode\n"); DBGPR("-->xgbe_set_rx_mode\n");
pr_mode = ((netdev->flags & IFF_PROMISC) != 0); hw_if->config_rx_mode(pdata);
am_mode = ((netdev->flags & IFF_ALLMULTI) != 0);
hw_if->set_promiscuous_mode(pdata, pr_mode);
hw_if->set_all_multicast_mode(pdata, am_mode);
hw_if->add_mac_addresses(pdata);
DBGPR("<--xgbe_set_rx_mode\n"); DBGPR("<--xgbe_set_rx_mode\n");
} }
......
...@@ -495,10 +495,8 @@ struct xgbe_mmc_stats { ...@@ -495,10 +495,8 @@ struct xgbe_mmc_stats {
struct xgbe_hw_if { struct xgbe_hw_if {
int (*tx_complete)(struct xgbe_ring_desc *); int (*tx_complete)(struct xgbe_ring_desc *);
int (*set_promiscuous_mode)(struct xgbe_prv_data *, unsigned int);
int (*set_all_multicast_mode)(struct xgbe_prv_data *, unsigned int);
int (*add_mac_addresses)(struct xgbe_prv_data *);
int (*set_mac_address)(struct xgbe_prv_data *, u8 *addr); int (*set_mac_address)(struct xgbe_prv_data *, u8 *addr);
int (*config_rx_mode)(struct xgbe_prv_data *);
int (*enable_rx_csum)(struct xgbe_prv_data *); int (*enable_rx_csum)(struct xgbe_prv_data *);
int (*disable_rx_csum)(struct xgbe_prv_data *); int (*disable_rx_csum)(struct xgbe_prv_data *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment