]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r225798: Improve battery capacity reporting
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Oct 2011 00:29:10 +0000 (00:29 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Oct 2011 00:29:10 +0000 (00:29 +0000)
commit6c34bb65f9dfa32ce7fe9f3c95a6b120b48c1381
tree0bc68332fb86ac936eaece59ffa40976c3ac9fef
parent0b1da6434630715a9e65253900eb4eb81aef650c
MFC r225798: Improve battery capacity reporting

  When a status pointer is passed in mfi_dcmd_command does not return an
  errno (if the ioctl is successful), so move the test for NO_HW_PRESENT
  outside of the error case.  This should fix incorrect reporting for
  systems with a dead or no battery.

  Additionally, handle error codes other than NO_HW_PRESENT by omitting
  the battery capacity display.  LSI's supercap-based parts (CV series)
  report their data using the same interface as battery-based parts,
  except that they do not include the capacity stats (state of charge,
  cumulative charge cycles, etc.)

PR: bin/160581

git-svn-id: svn://svn.freebsd.org/base/stable/8@225956 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.sbin/mfiutil/mfi_show.c