Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1665367
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver |
| Date | 2017-06-14 04:40 +0200 |
| Message-ID | <tS6nU-7IK-5@gated-at.bofh.it> (permalink) |
| References | <tS3gl-5Od-5@gated-at.bofh.it> <tS3gm-5Od-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> +static const struct hns3_link_mode_mapping hns3_lm_map[] = {
> + {HNS3_LM_FIBRE_BIT, ETHTOOL_LINK_MODE_FIBRE_BIT},
> + {HNS3_LM_AUTONEG_BIT, ETHTOOL_LINK_MODE_Autoneg_BIT},
> + {HNS3_LM_TP_BIT, ETHTOOL_LINK_MODE_TP_BIT},
> + {HNS3_LM_PAUSE_BIT, ETHTOOL_LINK_MODE_Pause_BIT},
> + {HNS3_LM_BACKPLANE_BIT, ETHTOOL_LINK_MODE_Backplane_BIT},
> + {HNS3_LM_10BASET_HALF_BIT, ETHTOOL_LINK_MODE_10baseT_Half_BIT},
> + {HNS3_LM_10BASET_FULL_BIT, ETHTOOL_LINK_MODE_10baseT_Full_BIT},
> + {HNS3_LM_100BASET_HALF_BIT, ETHTOOL_LINK_MODE_100baseT_Half_BIT},
> + {HNS3_LM_100BASET_FULL_BIT, ETHTOOL_LINK_MODE_100baseT_Full_BIT},
> + {HNS3_LM_1000BASET_FULL_BIT, ETHTOOL_LINK_MODE_1000baseT_Full_BIT},
> + {HNS3_LM_10000BASEKR_FULL_BIT, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT},
> + {HNS3_LM_25000BASEKR_FULL_BIT, ETHTOOL_LINK_MODE_25000baseKR_Full_BIT},
> + {HNS3_LM_40000BASELR4_FULL_BIT,
> + ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT},
> + {HNS3_LM_50000BASEKR2_FULL_BIT,
> + ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT},
> + {HNS3_LM_100000BASEKR4_FULL_BIT,
> + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT},
> +};
I don't see anywhere your HNS3_LM_ enum's get used by the hardware. So
it would be better to just use the Linux values and avoid this translation macro:
> +
> +#define HNS3_DRV_TO_ETHTOOL_CAPS(caps, lk_ksettings, name) \
> +{ \
> + int i; \
> + \
> + for (i = 0; i < ARRAY_SIZE(hns3_lm_map); i++) { \
> + if ((caps) & hns3_lm_map[i].hns3_link_mode) \
> + __set_bit(hns3_lm_map[i].ethtool_link_mode,\
> + (lk_ksettings)->link_modes.name); \
> + } \
> +}
Andrew
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-14 01:20 +0200
Re: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Stephen Hemminger <stephen@networkplumber.org> - 2017-06-14 02:00 +0200
RE: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 13:10 +0200
Re: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Andrew Lunn <andrew@lunn.ch> - 2017-06-14 04:30 +0200
RE: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 13:30 +0200
Re: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Andrew Lunn <andrew@lunn.ch> - 2017-06-14 04:40 +0200
RE: [PATCH V2 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 14:00 +0200
csiph-web