lkml.org 
[lkml]   [2014]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 10/10] i8k: Add support for fan labels
Date
On Monday 22 December 2014 00:01:49 Guenter Roeck wrote:
> > +static ssize_t i8k_hwmon_show_fan_label(struct device *dev,
> > + struct device_attribute *devattr,
> > + char *buf)
> > +{
> > + static const char * const labels[] = {
> > + "Processor Fan",
> > + "Motherboard Fan",
> > + "Video Fan",
> > + "Power Supply Fan",
> > + "Chipset Fan",
> > + "Other Fan",
> > + };
> > + int index = to_sensor_dev_attr(devattr)->index;
> > + bool dock = false;
> > + int type;
> > +
> > + type = i8k_get_fan_type(index);
> > + if (type < 0)
> > + return type;
> > +
> > + if (type & 0x10) {
> > + dock = true;
> > + type &= 0x0F;
> > + }
> > +
>
> What if bit 5..7 is set ? This would result in a result of
> "other fan", which given the above does not seem to be
> correct. Given that, I wonder why the type mask is only
> applied if bit 4 is set and not unconditionally.
>
> Thanks,
> Guenter
>

NBSVC.MDM maps values 0x0-0x5 to exactly to strings in labels[].
Next it maps 0x10-0x15 to values same values in strings labels[]
but with prefix "Docking". I do not see nothing more in NBSVC.MDM
so for other values is "Other Fan" better than nothing.

--
Pali Rohár
pali.rohar@gmail.com
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-12-22 09:41    [W:0.220 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site