Move subdir-objects options to configure.ac rather than Makefile.am(s)

Easier to keep it in one place than several

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
remove autogenerated files

files such as Makefile.in and configure should not be checked into
source repositories as they'll be regenerated on build.

Add a autogen.sh script to run autoreconf

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
check for and use gcc hardening flags if available

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
add sys/time.h and gettimeofday detection to configure.ac courtesy autoscan

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
recursive make considered harmful

Instead, we can use include/ for makefiles, or because we're a small
project, just put it in one makefile of ~150 lines.

We also fix up the spec file version substitution to use autofoo.

With these fixes, make distcheck works correctly.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Move librtas error code to common directory.

Now that we have a src/common directory this patch moves the
librtas_error files to the common directory.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
ppc64_cpu: Add option --threads-per-core

The threads per core calculated in ppc64_cpu is more relaiable than the
same provided by any other utility. Expose the value through an option.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Updating .gitignore fo files that are no longer in git.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
drmgr: Update action option validation

The drmgr command does not do any validation of the action option
specified on the command line, except for some checking for CPU
operations.. The omission of an action option can lead to confusing
error messages or just exiting with an error.

This patch updates each connector type with a validation check for
their respective valid action options.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
ofpathname: Convert logical device path to OF format for usb devices

Add support to convert logical device path to Open firmware
device path for usb devices.

Reported-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
ofpathname: Convert OF path to logical names for usb devices

Add support to convert a Open Firmware device path to logical
device path for usb device.

Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
ppc64_cpu: Let kernel validate subcore options

Previously we checked for valid subcore-per-core options, however, the
kernel knows better than we do as to what is valid. Remove the check.

Signed-off-by: Joel Stanley <joel@jms.id.au>
update_flash: Remove some bashisms

== is a bashism. Replace it with =.

We also need to add quotes around some variables to avoid:

	local: FW710.00: bad variable name

Signed-off-by: Anton Blanchard <anton@samba.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
snap: Fix typo in output display

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
update_flash_nv: Display current FW version

Add support to display current firmware version detail
on PowerKVM host.

Sample output:
[root@abc123 tmp]# update_flash -d
Current firwmare version :
  T side    : FW770.20 (ZL770_060)
  P side    : FW770.20 (ZL770_060)
  Boot side : FW770.20 (ZL770_060)

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
update_flash: Fix typo in man page

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
ppc64_cpu: update access validation routines

The use of fopen() to check for read/write access of system attribute
files (i.e. sysfs) no longer works with kernels 3.14 and later. The man
page for fopen() states that there is an implied file creation if the
file does not exist. This now causes fopen() to return EACCES instead
of ENOENT for files that do not exist.

This patch updates ppc64_cpu to use access() to validate file existence
and file read/write permissions.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
lsslot: fix segfault when lmb_list->lmbs is NULL

PowerKVM guests currently do not support dynamically reconfigurable
memory, and as such get_lmbs will return a lmb_list struct whose lmbs
field is NULL. Added a NULL check to avoid segfault for the case where
no LMB drc-names  are defined in device tree.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
serv_config: handle endianess in sysparm buffer

rtas_get_sysparm and rtas_set_sysparm commands both
manipulate buffers in which the first two bytes are a big
endian integer indicating the size of the remaining buffer.
This patch makes sure those bytes are in the correct format.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
uesensor: fix endian issues reading device-tree

The values in /proc/device-tree/rtas/rtas-sensors are
big endian so this needs to be handled for little endian
architectures.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>