]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r225798: Improve battery capacity reporting
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 27 Sep 2011 17:11:09 +0000 (17:11 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 27 Sep 2011 17:11:09 +0000 (17:11 +0000)
commitb777a6f3cfb256d15eb7060c077558bf9962f717
tree895b33a71554efefab22d841ca8f34a5980791cf
parentb1fc58c015961e0f77f0726a395ea65ca7cffbc3
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
Approved by:  re

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