if (!is_valid_ether_addr(ndev->dev_addr))
eth_hw_addr_random(ndev);
+ if (lp->axienet_config->mactype != XAXIENET_1G &&
+ lp->axienet_config->mactype != XAXIENET_2_5G)
+ return;
+
/* Set up unicast MAC address filter set its mac address */
axienet_iow(lp, XAE_UAW0_OFFSET,
(ndev->dev_addr[0]) |
u32 reg, af0reg, af1reg;
struct axienet_local *lp = netdev_priv(ndev);
- if (lp->eth_hasnobuf)
+ if ((lp->axienet_config->mactype != XAXIENET_1G) || lp->eth_hasnobuf)
return;
if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) ||
return NETDEV_TX_BUSY;
}
- if (skb->ip_summed == CHECKSUM_PARTIAL && !lp->eth_hasnobuf) {
+ if (skb->ip_summed == CHECKSUM_PARTIAL && !lp->eth_hasnobuf &&
+ (lp->axienet_config->mactype == XAXIENET_1G)) {
if (lp->features & XAE_FEATURE_FULL_TX_CSUM) {
/* Tx Full Checksum Offload Enabled */
cur_p->app0 |= 2;
cur_p->app1 = (csum_start_off << 16) | csum_index_off;
}
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY &&
- !lp->eth_hasnobuf) {
+ !lp->eth_hasnobuf &&
+ (lp->axienet_config->mactype == XAXIENET_1G)) {
cur_p->app0 |= 2; /* Tx Full Checksum Offload Enabled */
}
tail_p = lp->rx_bd_p + sizeof(*lp->rx_bd_v) * lp->rx_bd_ci;
skb = (struct sk_buff *) (cur_p->sw_id_offset);
- if (lp->eth_hasnobuf)
+ if (lp->eth_hasnobuf ||
+ (lp->axienet_config->mactype != XAXIENET_1G))
length = cur_p->status & XAXIDMA_BD_STS_ACTUAL_LEN_MASK;
else
length = cur_p->app4 & 0x0000FFFF;
/* if we're doing Rx csum offload, set it up */
if (lp->features & XAE_FEATURE_FULL_RX_CSUM &&
+ (lp->axienet_config->mactype == XAXIENET_1G) &&
!lp->eth_hasnobuf) {
csumstatus = (cur_p->app2 &
XAE_FULL_CSUM_STATUS_MASK) >> 3;
}
} else if ((lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) != 0 &&
skb->protocol == htons(ETH_P_IP) &&
- skb->len > 64 && !lp->eth_hasnobuf) {
+ skb->len > 64 && !lp->eth_hasnobuf &&
+ (lp->axienet_config->mactype == XAXIENET_1G)) {
skb->csum = be32_to_cpu(cur_p->app3 & 0xFFFF);
skb->ip_summed = CHECKSUM_COMPLETE;
}
phydev = of_phy_connect(lp->ndev, lp->phy_node,
axienet_adjust_link, 0,
PHY_INTERFACE_MODE_RGMII_ID);
- } else {
+ } else if ((lp->axienet_config->mactype == XAXIENET_1G) ||
+ (lp->axienet_config->mactype == XAXIENET_2_5G)) {
phydev = of_phy_connect(lp->ndev, lp->phy_node,
axienet_adjust_link, lp->phy_flags,
lp->phy_interface);
.setoptions = axienet_setoptions,
};
+static const struct axienet_config axienet_10g_config = {
+ .mactype = XAXIENET_LEGACY_10G,
+ .setoptions = axienet_setoptions,
+};
+
/* Match table for of_platform binding */
static const struct of_device_id axienet_of_match[] = {
{ .compatible = "xlnx,axi-ethernet-1.00.a", .data = &axienet_1g_config},
{ .compatible = "xlnx,axi-ethernet-2.01.a", .data = &axienet_1g_config},
{ .compatible = "xlnx,axi-2_5-gig-ethernet-1.0",
.data = &axienet_2_5g_config},
+ { .compatible = "xlnx,ten-gig-eth-mac", .data = &axienet_10g_config},
{},
};