Merge branch 'renesas-eth-fixes'
Sergei Shtylyov says: ==================== Fix some dubious code in the Renesas Ethernet drivers Here's a set of 2 patches against DaveM's 'net.git' repo. While initializing EMAC the code tries to respect the duplex mode both programmed into ECMR and stored in its own private data -- this just can't be right. [1/2] ravb: stop reading ECMR in ravb_emac_init() [2/2] sh_eth: stop reading ECMR in sh_eth_dev_init() ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
366f293111
@ -338,16 +338,13 @@ error:
|
|||||||
static void ravb_emac_init(struct net_device *ndev)
|
static void ravb_emac_init(struct net_device *ndev)
|
||||||
{
|
{
|
||||||
struct ravb_private *priv = netdev_priv(ndev);
|
struct ravb_private *priv = netdev_priv(ndev);
|
||||||
u32 ecmr;
|
|
||||||
|
|
||||||
/* Receive frame limit set register */
|
/* Receive frame limit set register */
|
||||||
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
|
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
|
||||||
|
|
||||||
/* PAUSE prohibition */
|
/* PAUSE prohibition */
|
||||||
ecmr = ravb_read(ndev, ECMR);
|
ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
|
||||||
ecmr &= ECMR_DM;
|
ECMR_TE | ECMR_RE, ECMR);
|
||||||
ecmr |= ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
|
|
||||||
ravb_write(ndev, ecmr, ECMR);
|
|
||||||
|
|
||||||
ravb_set_rate(ndev);
|
ravb_set_rate(ndev);
|
||||||
|
|
||||||
|
@ -1289,7 +1289,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct sh_eth_private *mdp = netdev_priv(ndev);
|
struct sh_eth_private *mdp = netdev_priv(ndev);
|
||||||
u32 val;
|
|
||||||
|
|
||||||
/* Soft Reset */
|
/* Soft Reset */
|
||||||
ret = sh_eth_reset(ndev);
|
ret = sh_eth_reset(ndev);
|
||||||
@ -1342,10 +1341,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* PAUSE Prohibition */
|
/* PAUSE Prohibition */
|
||||||
val = (sh_eth_read(ndev, ECMR) & ECMR_DM) |
|
sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) |
|
||||||
ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
|
ECMR_TE | ECMR_RE, ECMR);
|
||||||
|
|
||||||
sh_eth_write(ndev, val, ECMR);
|
|
||||||
|
|
||||||
if (mdp->cd->set_rate)
|
if (mdp->cd->set_rate)
|
||||||
mdp->cd->set_rate(ndev);
|
mdp->cd->set_rate(ndev);
|
||||||
|
Loading…
Reference in New Issue
Block a user