Lines Matching full:fec
32 ethtool_fec_to_link_modes(u32 fec, unsigned long *link_modes, u8 *fec_auto) in ethtool_fec_to_link_modes() argument
35 *fec_auto = !!(fec & ETHTOOL_FEC_AUTO); in ethtool_fec_to_link_modes()
37 if (fec & ETHTOOL_FEC_OFF) in ethtool_fec_to_link_modes()
39 if (fec & ETHTOOL_FEC_RS) in ethtool_fec_to_link_modes()
41 if (fec & ETHTOOL_FEC_BASER) in ethtool_fec_to_link_modes()
43 if (fec & ETHTOOL_FEC_LLRS) in ethtool_fec_to_link_modes()
48 ethtool_link_modes_to_fecparam(struct ethtool_fecparam *fec, in ethtool_link_modes_to_fecparam() argument
51 memset(fec, 0, sizeof(*fec)); in ethtool_link_modes_to_fecparam()
54 fec->fec |= ETHTOOL_FEC_AUTO; in ethtool_link_modes_to_fecparam()
57 fec->fec |= ETHTOOL_FEC_OFF; in ethtool_link_modes_to_fecparam()
59 fec->fec |= ETHTOOL_FEC_RS; in ethtool_link_modes_to_fecparam()
61 fec->fec |= ETHTOOL_FEC_BASER; in ethtool_link_modes_to_fecparam()
63 fec->fec |= ETHTOOL_FEC_LLRS; in ethtool_link_modes_to_fecparam()
100 struct ethtool_fecparam fec = {}; in fec_prepare_data() local
108 ret = dev->ethtool_ops->get_fecparam(dev, &fec); in fec_prepare_data()
123 WARN_ON_ONCE(fec.reserved); in fec_prepare_data()
125 ethtool_fec_to_link_modes(fec.fec, data->fec_link_modes, in fec_prepare_data()
128 ethtool_fec_to_link_modes(fec.active_fec, active_fec_modes, NULL); in fec_prepare_data()
131 /* Don't report attr if no FEC mode set. Note that in fec_prepare_data()
242 struct ethtool_fecparam fec = {}; in ethnl_set_fec() local
247 ret = dev->ethtool_ops->get_fecparam(dev, &fec); in ethnl_set_fec()
251 ethtool_fec_to_link_modes(fec.fec, fec_link_modes, &fec_auto); in ethnl_set_fec()
263 ret = ethtool_link_modes_to_fecparam(&fec, fec_link_modes, fec_auto); in ethnl_set_fec()
266 "invalid FEC modes requested"); in ethnl_set_fec()
269 if (!fec.fec) { in ethnl_set_fec()
271 "no FEC modes set"); in ethnl_set_fec()
275 ret = dev->ethtool_ops->set_fecparam(dev, &fec); in ethnl_set_fec()