diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2011-11-28 00:49:50 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-28 19:02:24 -0500 |
commit | 6db5193b29642ab18e6343c8fcbc3417d6e80983 (patch) | |
tree | a4a33329dffdac783289019eb09d04d6492ce367 /drivers/net/ethernet/broadcom | |
parent | ec15b898a4a812e89a63b8e52bc11d4e84d74db1 (diff) | |
download | blackbird-op-linux-6db5193b29642ab18e6343c8fcbc3417d6e80983.tar.gz blackbird-op-linux-6db5193b29642ab18e6343c8fcbc3417d6e80983.zip |
bnx2x: Add known PHY type check
The populate function will fail in case an unknown external PHY is detected.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 4ffc75dfa10a..cc7dbbeed457 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c @@ -11489,6 +11489,10 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, return -EINVAL; default: *phy = phy_null; + /* In case external PHY wasn't found */ + if ((phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) && + (phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) + return -EINVAL; return 0; } |