summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol/modeedit.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r289913,r289916:ngie2015-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r289913: Use 't' (bits) not 'i' (bytes) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database as the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is 4 bits wide, not 4 bytes wide 1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf Bug 200619 Reported by: Michael Baptist <mbaptist@isilon.com> Submitted by: Lars Skodje <lskodje@isilon.com> Sponsored by: EMC / Isilon Storage Division r289916: Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the mode value isn't always clipped to -1 when (resolution * size) == 32, which would have been the case with values => {4i,32b,32t}. This seems to have been broken in r64382. PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division
* MFC r256317:mav2013-10-111-2/+2
| | | | | | | Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Approved by: re (gjb)
* More -Wmissing-variable-declarations fixes.ed2012-10-191-2/+0
| | | | | | | | | | | | | | | | 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'.
* Fix warning when compiling with gcc46:eadler2012-01-101-2/+0
| | | | | | | | | error: variable 'freq' set but not used error: variable 'mode_pars' set but not used Reviewed by: mav Approved by: dim MFC after: 3 days
* Add missing static keywords to global variables in camcontrol.ed2011-12-111-3/+3
| | | | | While there, make the vendor list const and add appropriate keywords to functions that use this list.
* Initialize variables before usage.uqs2010-06-111-0/+1
| | | | | Found by: clang static analyzer Found by: Coverity Prevent[tm] (CID 7736, 7760)
* Userland signed char fixes for PPC build. Problems were using a chargrehan2004-01-221-4/+6
| | | | | | | | | return for getopt() and comparing to -1, ditto with fgetc() and EOF, and using the kg_nice value from <sys/user.h> Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: obrien, bde (a while back) Tested lightly on: ppc, i386, make universe
* Fix alignment of the trailing \imp2003-08-221-1/+1
|
* Make this WARNS=6 clean by:johan2003-08-051-24/+21
| | | | | | | | | | | | | | | | | | | | 1: add 'const' to char * where needed; 2: mark unused variables with __unused; 3: remove double prototypes for mode_edit and mode_list. 4: moves the global variables 'bus', 'target', and 'lun' into the main function and protect them with #ifndef MINIMALISTIC, 5: renames 3 variable in order not to shadow other things index -> indx -- in modepage_dump since index is a function from <strings.h.> arglist -> arglst -- in the function parse_btl since arglist is also a global variable convertend -> convertend2 -- in the function editentry_set since that name is used two times within the function. 6: cast 0xffffffff in the macro RESOLUTION_MAX(size) to (int) since it is unsigned otherwise. Tested by: make universe Approved by: ken
* Use __FBSDID.obrien2003-05-021-4/+2
|
* Fixed (soon might be fatal) -Wformat warnings.ru2003-03-151-3/+3
|
* Make camcontrol WARNS=2 clean.johan2003-02-201-1/+1
| | | | Approved by: ken
* Fix syntax errors (labels with no statement).wollman2002-05-301-4/+4
|
* Remove 'register' keyword.obrien2002-03-201-1/+1
| | | | | | It does not help modern compilers, and some may take some hit from it. (I also found several functions that listed *every* of its 10 local vars with "register" -- just how many free registers do people think machines have?)
* Fix an order-of-operations bug and properly shift page_control values forkbyanc2000-08-101-6/+8
| | | | comparison with SMS_PAGE_CTRL_* macros.
* Fix a typo in the last commit so that this compiles.jhb2000-08-091-1/+1
|
* Fix some whitespace errors.kbyanc2000-08-081-12/+12
| | | | Pointed out by: ps
* This is an overhaul of the mode page handling in camcontrol as well askbyanc2000-08-081-373/+780
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related patches. These include: * Mode page editting can be scripted. This involves two things: first, if stdin is not a tty, changes are read from stdin rather than invoking $EDITOR. Second, and more importantly, not all modepage entries must be included in the change set. This means that camcontrol can now gracefully handle more intrusive editting from the $EDITOR, including removal or rearrangement of lines. It also means that you can do stuff like: # echo "WCE: 1" | camcontrol modepage da3 -m 8 -e # newfs /dev/da3 # echo "WCE: 0" | camcontrol modepage da3 -m 8 -e * Range-checking on user-supplied input values. modeedit.c now uses the field width specifiers to determine the maximum allowable value for a field. If the user enters a value larger than the maximum, it clips the value to the max and warns the user. This also involved patching cam_cmdparse.c to be more consistent with regards to the "count" parameter to arg_put (previously is was the length of strings and 1 for all integral types). The cam_cdbparse(3) man page was also updated to reflect the revised semantics. * In the process, I removed the 64 entry limit on mode pages (not that we were even close to hitting that limit). This was a nice side-effect of the other changes. * Technically, the new mode editting functionality allows editting of character array entries in mode pages (type 'c' or 'z'), however since buff_encode doesn't grok them it is currently useless. * Camcontrol gained two new options related to mode pages: -l and -b. The former lists all available mode pages for a given device. The latter forces mode page display in binary format (the default when no mode page definition was found in scsi_modes). * Added support for mode page names to scsi_modes. Allows names to be displayed alongside mode numbers in the mode page listing. Updated scsi_modes to use the new functionality. This also adds the semicolon into the scsi_modes syntax as an optional mode page definition terminator. This is needed to name pages without providing a page format definition. * Updated scsi_all.h to include a structure describing mode page headers. * Added $FreeBSD$ line to scsi_modes. Inspired by: dwhite Reviewed by: ken
* Do some intptr_t casting for alpha.mjacob2000-01-211-4/+4
| | | | Reviewed by: ken@freebsd.org
* Use mkstemp(3) instead of tmpnam(3) when creating temporary files for modeken1999-09-281-3/+6
| | | | | | | page editing. Submitted by: roberto Reviewed by: imp, ken
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add a new device specification syntax to camcontrol. It is now possible token1999-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | do things like: camcontrol tur da5 or camcontrol tur 1:2:0 or camcontrol tur 1:2 These changes are fully backwards compatible with the original device specification syntax (-n dev -u unit), so it is possible to use either method to specify a device now. The device specification changes do not affect the rescan, reset or debug commands, since by design, those commands work on a bus or bus:target:lun basis only. Also, shorten the default usage statement so that it fits in a 24 column terminal. The full usage statement is still available by using the "help" "-h" or "-?" arguments to camcontrol. Submitted by: Joerg Wunsch <joerg_wunsch@interface-business.de>
* Camcontrol - A utility for configuring/manipulating the CAM subsystemgibbs1998-09-151-0/+500
Submitted by: "Kenneth D. Merry" <ken@plutotech.com>
OpenPOWER on IntegriCloud