Lines Matching refs:ksettings
15 struct ethtool_link_ksettings ksettings; member
36 data->lsettings = &data->ksettings.base; in linkmodes_prepare_data()
42 ret = __ethtool_get_link_ksettings(dev, &data->ksettings); in linkmodes_prepare_data()
49 data->ksettings.lanes = 0; in linkmodes_prepare_data()
52 bitmap_empty(data->ksettings.link_modes.lp_advertising, in linkmodes_prepare_data()
64 const struct ethtool_link_ksettings *ksettings = &data->ksettings; in linkmodes_reply_size() local
65 const struct ethtool_link_settings *lsettings = &ksettings->base; in linkmodes_reply_size()
75 ret = ethnl_bitset_size(ksettings->link_modes.advertising, in linkmodes_reply_size()
76 ksettings->link_modes.supported, in linkmodes_reply_size()
83 ret = ethnl_bitset_size(ksettings->link_modes.lp_advertising, in linkmodes_reply_size()
105 const struct ethtool_link_ksettings *ksettings = &data->ksettings; in linkmodes_fill_reply() local
106 const struct ethtool_link_settings *lsettings = &ksettings->base; in linkmodes_fill_reply()
114 ksettings->link_modes.advertising, in linkmodes_fill_reply()
115 ksettings->link_modes.supported, in linkmodes_fill_reply()
122 ksettings->link_modes.lp_advertising, in linkmodes_fill_reply()
133 if (ksettings->lanes && in linkmodes_fill_reply()
134 nla_put_u32(skb, ETHTOOL_A_LINKMODES_LANES, ksettings->lanes)) in linkmodes_fill_reply()
173 static bool ethnl_auto_linkmodes(struct ethtool_link_ksettings *ksettings, in ethnl_auto_linkmodes() argument
176 unsigned long *advertising = ksettings->link_modes.advertising; in ethnl_auto_linkmodes()
177 unsigned long *supported = ksettings->link_modes.supported; in ethnl_auto_linkmodes()
189 (!req_speed || info->speed == ksettings->base.speed) && in ethnl_auto_linkmodes()
190 (!req_lanes || info->lanes == ksettings->lanes) && in ethnl_auto_linkmodes()
191 (!req_duplex || info->duplex == ksettings->base.duplex)) in ethnl_auto_linkmodes()
237 struct ethtool_link_ksettings *ksettings, in ethnl_update_linkmodes() argument
240 struct ethtool_link_settings *lsettings = &ksettings->base; in ethnl_update_linkmodes()
273 } else if (!lsettings->autoneg && ksettings->lanes) { in ethnl_update_linkmodes()
277 ksettings->lanes = 0; in ethnl_update_linkmodes()
281 ret = ethnl_update_bitset(ksettings->link_modes.advertising, in ethnl_update_linkmodes()
289 ethnl_update_u32(&ksettings->lanes, lanes_cfg, mod); in ethnl_update_linkmodes()
296 ethnl_auto_linkmodes(ksettings, req_speed, req_lanes, req_duplex)) in ethnl_update_linkmodes()
321 struct ethtool_link_ksettings ksettings = {}; in ethnl_set_linkmodes() local
327 ret = __ethtool_get_link_ksettings(dev, &ksettings); in ethnl_set_linkmodes()
333 ret = ethnl_update_linkmodes(info, tb, &ksettings, &mod, dev); in ethnl_set_linkmodes()
339 ret = dev->ethtool_ops->set_link_ksettings(dev, &ksettings); in ethnl_set_linkmodes()