]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a bug when getting phy address from NCL_config file
authorFuyun Liang <liangfuyun1@huawei.com>
Wed, 8 Nov 2017 07:52:22 +0000 (15:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Nov 2017 06:17:56 +0000 (15:17 +0900)
commit278e9de1b5e43462d83b8b39cecd648b22240c24
tree515b0100c549ee8212212f77924bac2673f5d459
parentea2779ad949364e72eacc65b2413695a7d1335d2
net: hns3: fix a bug when getting phy address from NCL_config file

Driver gets phy address from NCL_config file and uses the phy address
to initialize phydev. There are 5 bits for phy address. And C22 phy
address has 5 bits. So 0-31 are all valid address for phy. If there
is no phy, it will crash. Because driver always get a valid phy address.

This patch fixes the phy address to 8 bits, and use 0xff to indicate
invalid phy address.

Fixes: 575d84053c84 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support)
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h