Commit Graph

71 Commits

Author SHA1 Message Date
Dimitry Andric
3ac0e4769e Avoid taking the address of a packed struct member in mfiutil
Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:

    usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
    member 'members' of class or structure 'mfi_evt' may result in an
    unaligned pointer value [-Werror,-Waddress-of-packed-member]
                            if (parse_locale(optarg, &filter.members.locale) < 0) {
                                                      ^~~~~~~~~~~~~~~~~~~~~

Use a local variable instead, and copy that into the struct.

Reviewed by:	jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9069
2017-01-09 19:39:35 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Ed Maste
e2a78b0008 mfiutil: increase buffer size to accommodate sprintf string
PR:		201289
MFC after:	1 week
2015-07-03 01:43:11 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Steven Hartland
92958cd02d Style (9) fixes, spaces to tabs.
Fix style issues noticed when I went to MFC r257820

MFC after:	2 days
X-MFC-With:	r257820
Sponsored by:	Multiplay
2014-09-19 23:38:44 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
John Baldwin
186ddf9631 - Fix an off by one error when checking for the stop event. This resulted
in not showing the most recent event by default.
- When the stop even is hit, break out of the outer loop to stop fetching
  more events.

MFC after:	1 week
2014-04-22 15:17:32 +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
Dimitry Andric
4abd7edcbd Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC after:	3 days
2014-01-05 21:03:49 +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
43a3230ade Noted that the stripe_size argument was not being displayed in the usage
message

MFC after:	2 weeks
2013-11-12 17:10:56 +00:00
Joel Dahl
13121e810d mdoc: remove superfluous paragraph macro. 2013-11-08 23:08:01 +00:00
Sean Bruno
ee7a2acac5 Add support for controlling mfi(4) controller properties:
allow user control of rebuild rate
allow user control of silence/enable alarm

MFC after:	2 weeks
Sponsored by:	Yahoo! Inc.
2013-11-07 21:47:59 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Sean Bruno
7c2ad1ee5c Add support to reconfigure a drive as SYSPD (real JBOD in LSI
terminology).

Adds command "mfiutil syspd <drive#>" to change a drive to SYSPD.  Drive
will then be scanned/reported immediately as /dev/mfisyspdX by the host.

"mfiutil good <drive#>" clears SYSPD mode, remove /dev/mfisyspdX and
sets disk into UNCONFIGURED mode.

Tested on Dell H310 SAS/SATA RAID controller.

MFC after:	2 weeks
Sponsored by:	Yahoo! Inc.
2013-08-26 12:05:38 +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
252d859338 Add a remark to the effect that a manually started relearn will always
result in the battery being completely drained, even in transparent learning
mode.

MFC in:		3 days
Sponsored by:	Sandvine Inc.
2013-05-13 15:00:36 +00:00
Simon J. Gerraty
69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00
Mark Johnston
8f66059200 Switch to a 2-clause license.
Approved by:	emaste (co-mentor)
X-MFC with:	r249257
2013-04-08 18:25:07 +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
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +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
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Matt Jacob
0896d52530 Fix ARM compilation issue.
X-MFC: 237260
2012-06-20 17:20:25 +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
Doug Ambrisko
b53011f9cf MFhead_mfi r233621
Remove the magic mfi_array is 288 bytes and just use the
        sizeof the array since it is not 288 bytes.

        Change reporting of a "SYSTEM" disk to "JBOD" to match
        LSI MegaCli and firmware reporting.

        This means that fiutil command to "create jbod" is now a
        little confusing since a RAID per drive is not really what
        LSI defines JBOD to be.  This should be fixed in the future
        and support added to really create LSI JBOD and enable that
        feature on cards that support it.
2012-03-30 23:39:39 +00:00
Doug Ambrisko
1d8f043a74 Now that mfi(4) header files uses the absolute number of entries to
make the mfi_array 288 bytes, remove this magic number and the
calculations that go with it.  Use the MFI_MAX_ROW_SIZE and
sizeof(struct mfi_array) in place of the prior calculations.

Change reporting a disk as "SYSTEM" when it is a "JBOD" reported
by the firmware and MegaCli.  A JBOD appears as /dev/mfisyspd<n>.

This also means the mfiutil command to "create jbod" is now a
little confusing since a RAID per drive is not really what LSI
defines JBOD to be.  In the future mfiutil should have an option
to create real JBOD's and enable that option in RAID controllers
that support it.  In testing, it appears the RAID cache is not
used with JBOD but is with the RAID per disk.  When this is
implemented more testing should be done to determine the pro's and
con's of JBOD versus RAID per disk.

Reviewed by:	jhb
2012-03-28 18:35:07 +00:00
Joel Dahl
46355096e1 mdoc: correct .Bd/.Bl arguments.
Reviewed by:	brueffer
2012-03-26 21:22:53 +00:00
Joel Dahl
c0cbd1c6f1 Remove superfluous paragraph macro. 2012-03-25 09:18:34 +00:00
John Baldwin
1b202316ec Use the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
arguments.

MFC after:	2 weeks
2011-12-05 15:11:35 +00:00
Xin LI
6dc3afae75 In build_volume(), check if arrays is allocated before traversing its
items.  While parsing the arrays input, it's possible that we reach the
error path before initializing the 'arrays' pointer, which in turn leads
to a NULL deference.

Submitted by:	Garrett Cooper
MFC after:	1 week
2011-11-29 08:16:14 +00:00
Ed Maste
f1e7af36c0 Avoid double free creating a new RAID with invalid command line arguments.
Submitted by:	Xin Huang <xhuang sandvine com>
Reviewed by:	rstone@
MFC after:	1 week
2011-11-23 17:02:27 +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
John Baldwin
2e5df98a18 Move the logic to parse volume cache commands out into a separate function
and use a loop so that multiple cache commands can be strung together on
the command line into a single update to the volume's properties.

Reviewed by:	bz
Approved by:	re (kib)
MFC after:	1 week
2011-09-02 16:00:51 +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
30d1616ed8 Add 'show logstate' to usage().
MFC after:	1 week
2011-06-18 21:08:27 +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