On Wed, Jun 15, 2016 at 07:26:03PM -0400, ira.weiny wrote: > On Wed, Jun 15, 2016 at 10:51:06AM -0600, Jason Gunthorpe wrote: > > On Wed, Jun 15, 2016 at 11:20:49AM -0400, ira.weiny wrote: > > > The default here is that a device does not provide a firmware string. In that > > > case the assumption is that there is no firmware. Hence the empty string. I > > > don't think that reporting 0's or F's are appropriate if a device does not have > > > firmware. > > > > > > In the cases you speak of I would expect the device to supply the firmware > > > function and report all 0s or all Fs for whatever version that may represent. > > > (I'm assuming that would be some sort of debug or unreleased firmware...) > > > > > > I could just as well done something like. > > > > > > snprintf(str, str_len, "<none>"); > > > > Just don't provide a 'fw' sysfs file at all if the driver cannot > > support it. > > This function is supporting both sysfs and ethtool. > > ethtool_drvinfo->fw_version is normally up to the device. I've just provided a > default. > > For example I see "N/A", "n/a", and "none" all used in the network stack. > > ./ethernet/freescale/gianfar_ethtool.c: strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); > > ./rionet.c: strlcpy(info->fw_version, "n/a", sizeof(info->fw_version)); > > ./fjes/fjes_ethtool.c: strlcpy(drvinfo->fw_version, "none", sizeof(drvinfo->fw_version)); > > I really think we are in the weeds here and are fine to leave it blank. I'm fine with that. > > But if you wish, I can force all drivers to provide the string and then they can > put something in like the above. > > Ira >
Attachment:
signature.asc
Description: Digital signature