summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2021-08-18 22:07:54 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-19 14:05:15 +0300
commit68ca3c923213b908c14a673f6c3ec808664fae1f (patch)
tree2ac8fbd1a1a7abc7e15a858a7ca481541eef026b /drivers/net
parentebb091461a9e146f8afd750cb7eddc5b4c8d47be (diff)
downloadlinux-68ca3c923213b908c14a673f6c3ec808664fae1f.tar.xz
ravb: Add aligned_tx to struct ravb_hw_info
R-Car Gen2 needs a 4byte aligned address for the transmission buffer, whereas R-Car Gen3 doesn't have any such restriction. Add aligned_tx to struct ravb_hw_info to select the driver to choose between aligned and unaligned tx buffers. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/renesas/ravb.h1
-rw-r--r--drivers/net/ethernet/renesas/ravb_main.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
index 6ff0b2626708..4f71e5699ca1 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -990,6 +990,7 @@ enum ravb_chip_id {
struct ravb_hw_info {
enum ravb_chip_id chip_id;
+ unsigned aligned_tx: 1;
};
struct ravb_private {
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index b6554e5e13af..dbccf2cd89b2 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1930,6 +1930,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
static const struct ravb_hw_info ravb_gen2_hw_info = {
.chip_id = RCAR_GEN2,
+ .aligned_tx = 1,
};
static const struct of_device_id ravb_match_table[] = {
@@ -2140,7 +2141,7 @@ static int ravb_probe(struct platform_device *pdev)
ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
ndev->min_mtu = ETH_MIN_MTU;
- priv->num_tx_desc = info->chip_id == RCAR_GEN2 ?
+ priv->num_tx_desc = info->aligned_tx ?
NUM_TX_DESC_GEN2 : NUM_TX_DESC_GEN3;
/* Set function */