Lines Matching +full:ethernet +full:- +full:pse

1 // SPDX-License-Identifier: GPL-2.0-only
3 // ethtool interface for Ethernet PSE (Power Sourcing Equipment)
10 #include "linux/pse-pd/pse.h"
38 struct phy_device *phydev = dev->phydev; in pse_get_pse_attributes()
42 return -EOPNOTSUPP; in pse_get_pse_attributes()
45 if (!phydev->psec) { in pse_get_pse_attributes()
46 NL_SET_ERR_MSG(extack, "No PSE is attached"); in pse_get_pse_attributes()
47 return -EOPNOTSUPP; in pse_get_pse_attributes()
50 memset(&data->status, 0, sizeof(data->status)); in pse_get_pse_attributes()
52 return pse_ethtool_get_status(phydev->psec, extack, &data->status); in pse_get_pse_attributes()
60 struct net_device *dev = reply_base->dev; in pse_prepare_data()
67 ret = pse_get_pse_attributes(dev, info->extack, data); in pse_prepare_data()
78 const struct pse_control_status *st = &data->status; in pse_reply_size()
81 if (st->podl_admin_state > 0) in pse_reply_size()
83 if (st->podl_pw_status > 0) in pse_reply_size()
94 const struct pse_control_status *st = &data->status; in pse_fill_reply()
96 if (st->podl_admin_state > 0 && in pse_fill_reply()
98 st->podl_admin_state)) in pse_fill_reply()
99 return -EMSGSIZE; in pse_fill_reply()
101 if (st->podl_pw_status > 0 && in pse_fill_reply()
103 st->podl_pw_status)) in pse_fill_reply()
104 return -EMSGSIZE; in pse_fill_reply()
121 return !!info->attrs[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL]; in ethnl_set_pse_validate()
127 struct net_device *dev = req_info->dev; in ethnl_set_pse()
129 struct nlattr **tb = info->attrs; in ethnl_set_pse()
135 phydev = dev->phydev; in ethnl_set_pse()
137 NL_SET_ERR_MSG(info->extack, "No PHY is attached"); in ethnl_set_pse()
138 return -EOPNOTSUPP; in ethnl_set_pse()
141 if (!phydev->psec) { in ethnl_set_pse()
142 NL_SET_ERR_MSG(info->extack, "No PSE is attached"); in ethnl_set_pse()
143 return -EOPNOTSUPP; in ethnl_set_pse()
146 /* Return errno directly - PSE has no notification */ in ethnl_set_pse()
147 return pse_ethtool_set_config(phydev->psec, info->extack, &config); in ethnl_set_pse()
163 /* PSE has no notification */