Commit Graph

20 Commits

Author SHA1 Message Date
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
John Baldwin
4099f0ec42 Don't claim the adapter is idle if it is clearing a drive.
MFC after:	1 week
2014-04-22 15:15:54 +00:00
Sean Bruno
4a40e59f97 svn r251516 resized the buf argument a bit too much. Pass a hardcoded
size of 6 to humanize_number() to resolve this.

PR:		184405
Submitted by:	jhb
MFC after:	2 weeks
2013-12-04 00:28:44 +00:00
Sean Bruno
06f1884fa8 Implement foreign volume handling. Allows admins to view foreign metadata
and clear or import it for use.

PR:     kern/172091
Submitted by:   smh@freebsd.org
Reviewed by:    jhb@freebsd.org
MFC after:      2 weeks
2013-06-08 02:54:59 +00:00
Mark Johnston
dee3e845aa Add support for getting and setting BBU properties related to battery
relearning. Specifically, add subcommands to mfiutil(8) which allow the
user to set the BBU and autolearn modes when the firmware supports it,
and add a subcommand which kicks off a battery relearn.

Reviewed by:	sbruno, rstone
Tested by:	sbruno
Approved by:	rstone (co-mentor)
MFC after:	2 weeks
Sponsored by:	Sandvine Incorporated
2013-04-08 17:46:45 +00:00
Ed Schouten
186475e2dd Remove redundant code.
Both mfi_flash.c and mfi_show.c contain very similar functions to print
a list of firmwares. Move these routines into mfiutil.c.

Reported by:	jhb
2012-10-20 10:20:06 +00:00
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
Eitan Adler
41b8cbda7d Add __unused macros to appropriate places in order to allow building
with WARNS=6 on base gcc, gcc46, and clang

Approved by:	cperciva
MFC after:	1 week
2012-06-19 06:18:42 +00:00
Eitan Adler
bf4ec4dfab Allow users with RO privilege to the device to read the RO attributes.
PR:		bin/167302
Submitted by:	markham breitbach <markham@ssimicro.com>
Discussed with:	pjd (briefly)
Approved by:	cperciva
MFC after:	1 week
2012-06-19 06:18:37 +00:00
Sean Bruno
f8b329b0bf Decode new battery status indications.
Requires r235634

Reviewed by:	ambrisko@
MFC after:	3 days
2012-05-18 21:50:26 +00:00
Ed Maste
b08d3049f0 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.)

Reviewd by:   jhb, bz
Tested by:    pluknet@, Garrett Cooper
PR:           bin/160581
MFC after:    1 week
2011-09-27 14:28:07 +00:00
Bjoern A. Zeeb
64371599f0 If a drive is not part of the array (i.e. missing) we need to print the
new line after the pd state information as well, so move it to the outside
of the block.

Submitted by:	Mark Johnston at Sandvine Inc
MFC atfer:	3 days
Approved by:	re (kib)
2011-08-25 08:47:38 +00:00
John Baldwin
c0ca022a34 Properly initialize an error variable to avoid returning uninitialized
data when 'show drives' succeeds, often resulting in a failing exit code
even though the command worked fine.

Reviewed by:	bz
Approved by:	re (kib)
MFC after:	3 days
2011-07-29 20:24:04 +00:00
Bjoern A. Zeeb
7bbae305a1 Add global -d and -e options to either print device numbers
(usually default) or enclosure:slot information as (Exx:Sxx)
or both.

Discussed with:		jhb
Reviewed by:		jhb
Sponsored by:		Sandvine Incorporated
MFC after:		1 week
2011-06-20 21:28:50 +00:00
Bjoern A. Zeeb
375c46563c Contrary to when returning in all-good cases at the end of functions we
did not free memory (1) or close the file descriptor (2) in error cases.

Reported by:	Mark Johnston (1)
Reported by:	attilio (2)
Reviewed by:	jhb
Sponsored by:	Sandvine Incorporated
MFC after:	1 week
2011-06-09 19:52:28 +00:00
John Baldwin
98be0dfebd Add a 'show progress' command that shows a summary of all in-progress
commands for a given adapter.  Specifically, it shows the status of any
drive or volume activities currently in progress similar to the
'drive process' and 'volume progress' commands.

Reviewed by:	emaste
MFC after:	1 week
2011-04-29 14:06:37 +00:00
John Baldwin
b09e402ad0 Preserve errno in an error case.
Submitted by:	gcooper
2011-03-17 21:24:32 +00:00
John Baldwin
100ec05ae5 Add more details to the 'show battery' command including more raw
capacity values, charge cycle count, temperature, and more detailed
status.

Reviewed by:	bz, emaste (older version)
MFC after:	1 week
2011-03-17 17:29:46 +00:00
John Baldwin
c02999d982 - Save errno values before calling warn(3) so that errors are correctly
reported.
- Use powerof2() from <sys/param.h> rather than a copy and paste version.

Submitted by:	gcooper
MFC after:	1 week
2010-10-26 19:11:09 +00:00
Scott Long
763fae7918 ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6
controllers.  Controller, array, and drive status can be checked, basic
attributes can be changed, and arrays and spares can be created and deleted.
Controller firmware can also be flashed.

This does not replace MegaCLI, found in ports, as that is officially sanctioned
and supported by LSI and includes vastly more functionality.  However, mfiutil
is open source and guaranteed to provide basic functionality, which can be
especially useful if you have a problem and can't get MegaCLI to work.

Approved by:    re
Obtained from:  Yahoo! Inc.
2009-08-13 23:18:45 +00:00