Skip to content

Commit 5677629

Browse files
Veerasenareddy Burrudavem330
authored andcommitted
liquidio: Add support for liquidio 10GBase-T NIC
Added ethtool changes to show port type as TP (Twisted Pair) for 10GBASE-T ports. Same driver and firmware works for liquidio NIC with SFP+ ports or TP ports. Signed-off-by: Veerasenareddy Burru <veerasenareddy.burru@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 59655a5 commit 5677629

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

drivers/net/ethernet/cavium/liquidio/lio_ethtool.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,16 @@ static int lio_get_link_ksettings(struct net_device *netdev,
232232

233233
linfo = &lio->linfo;
234234

235-
if (linfo->link.s.if_mode == INTERFACE_MODE_XAUI ||
236-
linfo->link.s.if_mode == INTERFACE_MODE_RXAUI ||
237-
linfo->link.s.if_mode == INTERFACE_MODE_XLAUI ||
238-
linfo->link.s.if_mode == INTERFACE_MODE_XFI) {
235+
switch (linfo->link.s.phy_type) {
236+
case LIO_PHY_PORT_TP:
237+
ecmd->base.port = PORT_TP;
238+
supported = (SUPPORTED_10000baseT_Full |
239+
SUPPORTED_TP | SUPPORTED_Pause);
240+
advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Pause);
241+
ecmd->base.autoneg = AUTONEG_DISABLE;
242+
break;
243+
244+
case LIO_PHY_PORT_FIBRE:
239245
ecmd->base.port = PORT_FIBRE;
240246

241247
if (linfo->link.s.speed == SPEED_10000) {
@@ -245,12 +251,18 @@ static int lio_get_link_ksettings(struct net_device *netdev,
245251

246252
supported |= SUPPORTED_FIBRE | SUPPORTED_Pause;
247253
advertising |= ADVERTISED_Pause;
254+
ecmd->base.autoneg = AUTONEG_DISABLE;
255+
break;
256+
}
257+
258+
if (linfo->link.s.if_mode == INTERFACE_MODE_XAUI ||
259+
linfo->link.s.if_mode == INTERFACE_MODE_RXAUI ||
260+
linfo->link.s.if_mode == INTERFACE_MODE_XLAUI ||
261+
linfo->link.s.if_mode == INTERFACE_MODE_XFI) {
248262
ethtool_convert_legacy_u32_to_link_mode(
249263
ecmd->link_modes.supported, supported);
250264
ethtool_convert_legacy_u32_to_link_mode(
251265
ecmd->link_modes.advertising, advertising);
252-
ecmd->base.autoneg = AUTONEG_DISABLE;
253-
254266
} else {
255267
dev_err(&oct->pci_dev->dev, "Unknown link interface reported %d\n",
256268
linfo->link.s.if_mode);

drivers/net/ethernet/cavium/liquidio/liquidio_common.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,11 @@ union oct_link_status {
676676
u64 if_mode:5;
677677
u64 pause:1;
678678
u64 flashing:1;
679-
u64 reserved:15;
679+
u64 phy_type:5;
680+
u64 reserved:10;
680681
#else
681-
u64 reserved:15;
682+
u64 reserved:10;
683+
u64 phy_type:5;
682684
u64 flashing:1;
683685
u64 pause:1;
684686
u64 if_mode:5;
@@ -691,6 +693,12 @@ union oct_link_status {
691693
} s;
692694
};
693695

696+
enum lio_phy_type {
697+
LIO_PHY_PORT_TP = 0x0,
698+
LIO_PHY_PORT_FIBRE = 0x1,
699+
LIO_PHY_PORT_UNKNOWN,
700+
};
701+
694702
/** The txpciq info passed to host from the firmware */
695703

696704
union oct_txpciq {

0 commit comments

Comments
 (0)