Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89099d73 authored by Yisen Zhuang's avatar Yisen Zhuang Committed by Greg Kroah-Hartman
Browse files

net: hns3: fix the port information display when sfp is absent



[ Upstream commit 674d9591a32d01df75d6b5fffed4ef942a294376 ]

When sfp is absent or unidentified, the port type should be
displayed as PORT_OTHERS, rather than PORT_FIBRE.

Fixes: 88d10bd6 ("net: hns3: add support for multiple media type")
Signed-off-by: default avatarYisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a4460288
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -676,7 +676,9 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
		hns3_get_ksettings(h, cmd);
		break;
	case HNAE3_MEDIA_TYPE_FIBER:
		if (module_type == HNAE3_MODULE_TYPE_CR)
		if (module_type == HNAE3_MODULE_TYPE_UNKNOWN)
			cmd->base.port = PORT_OTHER;
		else if (module_type == HNAE3_MODULE_TYPE_CR)
			cmd->base.port = PORT_DA;
		else
			cmd->base.port = PORT_FIBRE;