summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
diff options
context:
space:
mode:
authorGatis Peisenieks <gatis@mikrotik.com>2021-05-13 14:43:22 +0300
committerDavid S. Miller <davem@davemloft.net>2021-05-14 01:48:10 +0300
commitf19d4997fd1fb01bed127e1056ce3a5de922d9ee (patch)
tree36838927ede7011679cd73924a183309724bcff7 /drivers/net/ethernet/atheros/atl1c/atl1c_main.c
parent0d59c95ea3d2e81b76cfbd2f1ff0adf00c23c8f7 (diff)
downloadlinux-f19d4997fd1fb01bed127e1056ce3a5de922d9ee.tar.xz
atl1c: show correct link speed on Mikrotik 10/25G NIC
The new Mikrotik 10/25G NIC maintains compatibility with existing atl1c driver. However it does have new features. This defines some new register offsets, code for identifying the new type of NIC and correct speed detection for the NIC. Signed-off-by: Gatis Peisenieks <gatis@mikrotik.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/atl1c/atl1c_main.c')
-rw-r--r--drivers/net/ethernet/atheros/atl1c/atl1c_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index c6263cf8d3c0..28c30d5288e4 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -644,6 +644,7 @@ static int atl1c_alloc_queues(struct atl1c_adapter *adapter)
static void atl1c_set_mac_type(struct atl1c_hw *hw)
{
+ u32 magic;
switch (hw->device_id) {
case PCI_DEVICE_ID_ATTANSIC_L2C:
hw->nic_type = athr_l2c;
@@ -662,6 +663,9 @@ static void atl1c_set_mac_type(struct atl1c_hw *hw)
break;
case PCI_DEVICE_ID_ATHEROS_L1D_2_0:
hw->nic_type = athr_l1d_2;
+ AT_READ_REG(hw, REG_MT_MAGIC, &magic);
+ if (magic == MT_MAGIC)
+ hw->nic_type = athr_mt;
break;
default:
break;