> +int aq_nic_set_downshift(struct aq_nic_s *self)
> +{
> +     int err = 0;
> +     struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg;
> +
> +     if (!self->aq_fw_ops->set_downshift)
> +             return -EOPNOTSUPP;
> +
> +     if (ATL_HW_IS_CHIP_FEATURE(self->aq_hw, ANTIGUA)) {
> +             if (cfg->downshift_counter > 15)
> +                     cfg->downshift_counter = 15;
> +     } else {
> +             if (cfg->downshift_counter > 255)
> +                     cfg->downshift_counter = 255;
> +     }

Hi Igor

I think all other implementations return -EINVAL or -E2BIG or similar
when the value is not supported.

Also, given that a u8 is being passed, is cfg->downshift_counter > 255
possible? I'm not even sure 255 makes any sense. Autoneg takes around
1.5s, maybe longer. Do you really want to wait 255 * 1.5 seconds
before downshifting? Even 15*1.5 seems a long time.

        Andrew

Reply via email to