net: r6040: Non-functional changes
Subsystems (3)
Florian Fainelli
maintainercover net: r6040: Non-functional changes
Hi David, Jakub,
These two patches clean up the r6040 driver a little bit in preparation for adding additional features such as dumping MAC counters and properly dealing with DMA-API mapping.
Thanks
Florian Fainelli (2):
net: r6040: Use logical or for MDIO operations
net: r6040: Use ETH_FCS_LEN
drivers/net/ethernet/rdc/r6040.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1
Florian Fainelli
maintainerPATCH 1/2 net: r6040: Use logical or for MDIO operations
This is not a functional change, but we should be using a logical or to assign the bits we will be writing to the MDIO read and write registers.
--- drivers/net/ethernet/rdc/r6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/rdc/r6040.c +2 -2
@@ -200,7 +200,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)int limit =MAC_DEF_TIMEOUT ;u16 cmd; -iowrite16 (MDIO_READ + reg + (phy_addr <<8 ), ioaddr +MMDIO ); +iowrite16 (MDIO_READ | reg | (phy_addr <<8 ), ioaddr +MMDIO );/* Wait for the read bit to be cleared */ while (limit--) { cmd =ioread16 (ioaddr +MMDIO );
@@ -224,7 +224,7 @@ static int r6040_phy_write(void __iomem *ioaddr,iowrite16 (val, ioaddr +MMWD );/* Write the command to the MDIO bus */ -iowrite16 (MDIO_WRITE + reg + (phy_addr <<8 ), ioaddr +MMDIO ); +iowrite16 (MDIO_WRITE | reg | (phy_addr <<8 ), ioaddr +MMDIO );/* Wait for the write bit to be cleared */ while (limit--) { cmd =ioread16 (ioaddr +MMDIO );
Signature · 1 line
2.25.1
Florian Fainelli
maintainerPATCH 2/2 net: r6040: Use ETH_FCS_LEN
In reply to Florian FainelliInstead of the open coded constant 4.
--- drivers/net/ethernet/rdc/r6040.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/rdc/r6040.c +2 -2
@@ -544,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit) skb_ptr->dev = priv->dev;/* Do not count the CRC */ -skb_put (skb_ptr, descptr->len -4 ); +skb_put (skb_ptr, descptr->len -ETH_FCS_LEN );dma_unmap_single (&priv->pdev->dev,le32_to_cpu (descptr->buf),MAX_BUF_SIZE ,DMA_FROM_DEVICE ); skb_ptr->protocol =eth_type_trans (skb_ptr, priv->dev);
@@ -552,7 +552,7 @@ static int r6040_rx(struct net_device *dev, int limit)/* Send to upper layer */ netif_receive_skb (skb_ptr); dev->stats.rx_packets++; - dev->stats.rx_bytes += descptr->len -4 ; + dev->stats.rx_bytes += descptr->len -ETH_FCS_LEN ;/* put new skb into descriptor */ descptr->skb_ptr = new_skb;
Signature · 1 line
2.25.1
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Sun, 23 May 2021 08:54:09 -0700 you wrote:
Hi David, Jakub,
These two patches clean up the r6040 driver a little bit in preparation for adding additional features such as dumping MAC counters and properly dealing with DMA-API mapping.
Thanks
[...]
Here is the summary with links:
- [net-next,1/2] net: r6040: Use logical or for MDIO operations
https://git.kernel.org/netdev/net-next/c/190e6e291a4c - [net-next,2/2] net: r6040: Use ETH_FCS_LEN https://git.kernel.org/netdev/net-next/c/06666907a38a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html