2005-11-16  Martin Schwenke  <martins@rover>

	* Makefile: Changed VERSION to 0.14.1.

	* debian/control: Only suggest busybox.

	* debian/control: New file.

2005-11-15  Martin Schwenke  <martins@rover>

	* src/pci.ids: Updated to 2005-11-14 daily snapshot.

	* src/pci.ids: New file.

	* src/device_sysfs.c:
	device_sysfs_retrieve_vpd_scsi calls device_scsi_ata_mf_tm to possibly
	hack MF and TM.

	* src/device_scsi.c, src/device_scsi.h:
	New function device_scsi_ata_mf_tm.

	* src/device_scsi_sg.c:
	device_scsi_sg_render calls device_scsi_ata_mf_tm unconditionally to
	possibly hack MF and TM.

	* src/pci_lookup.c:
	In adapter_pci_lookup, ensure i.subvendor_len always gets initialised.

	* src/pci_lookup.c: Added sanity check to adapter_pci_lookup.

	* src/pci_lookup.c:
	adapter_pci_lookup calculates i.subvendor_len more efficiently.

	* src/pci_lookup.c:
	subvendor and subdevice have reverts to using separate arguments.
	struct adapter_pci_lookup_info now contains precalculated lengths.
	adapter_pci_lookup now takes separate subvendor_id and subdevice_id
	arguments and combines them accordingly.  This function also populates
	the lengths in struct adapter_pci_lookup_info.

	* src/pci_lookup.c:
	subsystem once again only uses a single argument, with subvendor and
	subdevice ids separated by a space (as in pci.ids).  This means the
	program can once again be used to lookup PCI class information.

	* src/pci_lookup.c:
	Cleaned up, factored and generalised.  Will now do PCI class and
	subclass, but prog-if is broken.

	* src/pci_lookup.c: Rewrote code to be much more understandable, using
	line_scanner_harness.  No longer does PCI class lookups - this was
	unused functionality.

	* scripts/scan.d/00pci:
	Simplified logic by calling updated version of pci_lookup.

2005-11-10  Martin Schwenke  <martins@rover>

	* DODIFF:
	find_older_version now contains a test to check if a version has not
	been implemented, instead of spinning out of control.

	* scripts/scan.d/03adapter:
	In adapter_set_ds_basic capitalise "Raid Bus Controller".

	* src/device_scsi.h: New macro DEVICE_RAID_TYPE.

	* src/device_scsi.c:
	Add DEVICE_RAID_TYPE to device_scsi_ds_prefixes.  Use name "SCSI",
	since the attached devices should be SCSI.

	* src/device_scsi_sg.c:
	make_ds_value does the fancy stuff for DEVICE_RAID_TYPE too.

	* scripts/scan.d/37device_dt:
	get_source_node_device sets custom $dt_type for RAID enclosures too.

	* scripts/scan.d/03adapter:
	adapter_set_ds_basic and adapter_set_os_prefix now handle $subtype
	"raid".

	* scripts/scan.d/20sysfs:
	In adapter_get_subtype_pci added a case for new subtype "raid" instead
	of merging it into SCSI.

	* scripts/scan.d/33adapter_dt_nosysfs, scripts/scan.d/30device-tree:
	Moved dt_adapter_subdir_to_subtype from 30device-tree to
	33adapter_dt_nosysfs.

	* scripts/scan.d/30device-tree:
	adapter_retrieve_logicals_vpd ignores channels numbered 0xff.

	* scripts/scan.d/03adapter:
	adapter_retrieve_logicals_common no longer writes the lsvpd,logicals file.

	* scripts/scan.d/20sysfs:
	adapter_retrieve_logicals_vpd now writes the lsvpd,logicals file,
	generating its own channel numbers.

	* scripts/scan.d/30device-tree:
	adapter_retrieve_logicals_vpd now writes the lsvpd,logicals file and
	uses channel numbers based on the suffix of the subdir.

2005-11-07  Martin Schwenke  <martins@rover>

	* DODIFF: Added case to find_older_version for 0.14.0.

	* Makefile:
	Fixed bug where subdirectory build/install failure does not stop
	overall build/install.  dist target now ensures lsvpd.spec and
	debian/changelog are up-to-date, due to improved package building
	process.  VERSION changed to 0.14.0.

2005-11-04  Martin Schwenke  <martins@rover>

	* scripts/scan.d/21sysfs_hotplug:
	node_add_extra_hook_device now calls bus_alias_set with an absolute
	path in the 2nd argument.

	* scripts/scan.d/33adapter_dt_nosysfs:
	list_adapters now calls bus_alias_set with an absolute path in the 2nd
	argument.

	* scripts/scan.d/00minimal:
	node_add_name calls retrieve_node instead of get_node and, therefore,
	no longer needs to call get_parent_subtype.

	* scripts/scan.d/07device:
	get_parent_node_device optimised using bus_alias.

	* scripts/lsvpd-functions.bash:
	multiplex no longer forks when calling the bash built-in "type",
	making the use of multiplexing much cheaper.

	* scripts/scan.d/21sysfs_hotplug:
	hotplug_add_device now calls node_add instead of add_device.
	hotplug_name_and_crosslink now calls node_add_name instead of
	device_add_name.

	* scripts/update-lsvpd-db.in:
	process_adapters and process_devices now call node_add and
	node_add_name directly instead of removed intermediate functions.

	* scripts/scan.d/07device:
	Removed functions add_device and device_add_name.

	* scripts/scan.d/03adapter:
	Removed functions add_adapter and adapter_add_name.

	* scripts/scan.d/07device:
	Removed functions add_device_hook, device_retrieve_subtype,
	device_set_yl (stub), device_backlink_parent_node, device_crosslink.
	Removed global variable $add_device_extra_hook.  Renamed
	device_get_names to get_names_device and device_retrieve_vpd to
	retrieve_vpd_device.  Renamed device_get_parent_node to
	get_parent_node_device, which now uses variable $os_subdir rather than
	$adapter_subdir,  Renamed device_get_parent_subtype to
	get_parent_subtype_device and made some changes relating to the new
	multiplexed way of handling adapters/devices.  device_set_adapter_yl
	has changes relating to new multiplexing.  add_device is now
	implemented using a simple call to node_add.  device_add_name is now
	implemented using a simple call to node_add_name.  Renamed multiplexed
	function and instances of device_vpd_set_order to vpd_set_order_device.

	* scripts/scan.d/00minimal:
	Moved all adapter-specific functionality into new file 03adapter.
	Generalised code to create new functions node_add, node_add_hook,
	node_add_name.  New multiplexed functions get_names, get_node,
	retrieve_vpd, vpd_set_order, process_logicals, get_parent_node,
	get_yl, node_add_extra_hook, get_source_node, names_to_ax,
	do_logicals_ax, get_os_subdir - provided stub DEFAULT functions for
	many of these, and used existing functionality to implement DEFAULT
	functions for others.  Generalised adapter_crosslink and renamed to
	crosslink, and merged in functionality from removed function
	cross_link.  Similarly, generalised adapter_retrieve_subtype and
	renamed to retrieve_subtype, renaming old function retrieve_subtype to
	retrieve_subtype_basic.

	* scripts/scan.d/33adapter_dt_nosysfs:
	Renamed adapter_get_names to get_names_adapter and call retrieve_node
	instead of adapter_get_node.  dt_adapter_crosslink now calls generic
	crosslink function.  adapter_get_source_node renamed to
	get_source_node_adapter, with arguments reworked accordingly.
	adapter_get_subtype now calls generic retrieve_subtype.

2005-11-03  Martin Schwenke  <martins@rover>

	* scripts/scan.d/40ibm,loc-code:
	Renamed adapter_set_yl to get_yl_DEFAULT and modified arguments
	accordingly; unset functions get_yl_bus, get_yl_adapter,
	get_yl_adapter_logical since this function implements them.  Renamed
	device_set_yl to get_yl_device.  Removed function
	adapter_do_logicals_yl, which is now implemented by "get_yl
	adapter_logical".

	* scripts/scan.d/31bus_device_tree:
	add_bus calls multiplexed get_yl instead of old bus_set_yl.

	* scripts/scan.d/00pci:
	In pci_manufacture_vpd pass $subtype to adapter_get_source_node.

	* scripts/scan.d/33adapter_dt_sysfs:
	Renamed adapter_get_source_node to get_source_node_adapter and
	modified arguments accordingly.

	* scripts/scan.d/30device-tree:
	In adapter_retrieve_logicals_vpd, call retrieve_subtype_basic instead
	of old retrieve_subtype.  Pass $subtype to adapter_get_source_node in
	several places.

	* scripts/scan.d/27device_sysfs:
	Removed function device_get_node, implemented elsewhere by
	get_node_DEFAULT.  Removed function device_get_source_node,
	implemented by get_source_node_DEFAULT in 20sysfs.  Renamed
	device_set_yl to get_yl_device as part of multiplexed function get_yl.

	* scripts/scan.d/40ibm,vpd:
	In ibm_vpd_retrieve_vpd, pass $subtype to adapter_get_source_node.

	* scripts/scan.d/20sysfs:
	In adapter_get_subtype_pci, added "unknown" $subtype in call to
	adapter_get_source_node - subtype certainly is not known at this stage
	and should never be used for adapters anyway.  Renamed
	adapter_get_source_node to get_source_node_DEFAULT and modified
	arguments accordinging; unset functions get_source_node_adapter and
	get_source_node_device, since this function implements them.  Renamed
	adapter_get_names to get_names_adapter; changed calls to
	retrieve_subtype and retrieve_subtype_basic.  Renamed adapter_set_yl
	to get_yl_adapter.

	* scripts/scan.d/21sysfs_hotplug:
	sysfs_add_device_bus_alias renamed to node_add_extra_hook_device - now
	just an instance of multiplexed function node_add_extra_hook; reworked
	arguments and calls to get_source_node, retrieve_node as appropriate.

	* scripts/scan.d/37device_dt:
	Renamed device_get_source_node to get_source_node_device, modifying
	call to get_parent_node, removing channel code.  Removed function
	device_get_node - now handled elsewhere by get_node_DEFAULT.

	* scripts/scan.d/03adapter: New file.

	* scripts/scan.d/21sysfs_hotplug:
	hotplug_remove_device now calls retrieve_node instead of bus_alias_get.

	* scripts/scan.d/33adapter_dt_nosysfs:
	In adapter_get_names, renamed variable $adapter_bus_dir to $node.

	* scripts/scan.d/20sysfs:
	In adapter_set_yl, renamed argument $adapter_bus_dir to $node.

	* scripts/scan.d/00pci:
	In pci_not_on_vendor_blacklist, renamed argument $adapter_bus_dir to $node.

2005-11-02  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	retrieve_node now takes a single $bus_info argument.

	* scripts/scan.d/07device:
	add_device_hook now takes arguments $node_type and $bus_info rather
	than $bus_type and $bus_addr and passes the new arguments on to
	device_get_node, device_get_source_node and $add_device_extra_hook.
	device_set_adapter_yl no longer takes $bus_type and $bus_addr
	arguments.  device_add_name node passes $parent_subtype and $bus_info
	to device_get_node.

	* scripts/scan.d/27device_sysfs:
	device_get_source_node and device_get_node now take arguments
	$node_type and $bus_info rather than $bus_type and $bus_addr.
	device_set_yl now calls device_set_adapter_yl with less arguments.

	* scripts/scan.d/37device_dt:
	device_get_source_node now takes arguments $node_type and $bus_info
	rather than $bus_type and $bus_addr, and "cdrom" for "ata" and "sata"
	cause dt_type to be set to "disk" - locating the correct source node
	means that the location code is more likely to be correct.
	device_get_node also now takes arguments $node_type and $bus_info
	rather than $bus_type and $bus_addr.

	* scripts/query.d/00minimal:
	list_linux_vpd_basic doesn't need to escape '/'s when putting them
	back into a path.

	* scripts/lsvio.d/30device-tree:
	lsvio_render_vscsi_device changed to look for lsvpd,parent-node.

	* DODIFF: Sort the summary.

	* scripts/scan.d/00minimal:
	adapter_do_logicals_ax needs to handle the case where the operating
	system knows more names than we know logicals.  This happens when
	Linux notices all the channels on an adapter, but they're not listed
	in the device-tree.

	* scripts/scan.d/33adapter_dt_nosysfs:
	dt_adapter_crosslink should call adapter_crosslink, not old
	add_adapter_crosslink.

	* scripts/scan.d/00minimal:
	cross_link should put "$names", not "$@", into lsvpd,names.

2005-11-01  Martin Schwenke  <martins@rover>

	* src/Makefile:
	Removed optimisations and warnings relating to strict-aliasing from
	CFLAGS.  One of my old compilers doesn't support it.

	* scripts/scan.d/30device-tree:
	New function adapter_retrieve_logicals_vpd.

	* scripts/scan.d/40ibm,loc-code: New function adapter_do_logicals_yl.

	* scripts/lsvpd.d/40ibm,vpd:
	should_render now actually passes arguments to should_render_basic.

	* scripts/scan.d/00minimal:
	New functions adapter_do_logicals_yl and adapter_do_logicals_fc - call
	these from add_adapter.  adapter_retrieve_logicals_common now adds an
	lsvpd,logical property to each logical subdirectory.  Renamed
	add_adapter_crosslink to adapter_crosslink and changes how $names is
	passed.  adapter_add_name now calls adapter_do_logicals_ax.  Fixed bug
	in adapter_names_to_ax where adjacent adapter number weren't being
	properly collated.  New function adapter_do_logicals_ax.

	* scripts/lsvpd.d/40ibm,vpd: should_render calls should_render_basic.

	* scripts/lsvpd.d/00minimal:
	New functions should_render and should_render_basic.

	* scripts/scan.d/07device:
	In device_add_name, device_crosslink, device_names_to_ax handle names
	as a single variable with values separated by spaces.

	* scripts/lsvpd-functions.bash: Fixed typo in move_directory.

	* scripts/scan.d/27device_sysfs:
	Renamed function device_get_adapter_name to device_get_parent_name,
	now returns $parent_name.  Function add_device_hook replaced by new
	functions device_get_source_node and device_get_node (retaining old
	functionality).

	* scripts/scan.d/20sysfs:
	New function get_sysfs_device_node_subdirs contains functionality
	factored from adapter_get_names.  Modified adapter_get_names to call
	get_sysfs_device_node_subdirs.  New function
	adapter_retrieve_logicals_vpd.

	* scripts/scan.d/21sysfs_hotplug:
	Cleaned up functions sysfs_add_device_bus_alias, hotplug_add_device,
	hotplug_remove_device, hotplug_name_and_crosslink.

	* scripts/scan.d/37device_dt:
	Function add_device_hook replaced by new functions
	device_get_source_node and device_get_node (retaining old
	functionality).

	* scripts/scan.d/00minimal:
	New function retrieve_node.  Function adapter_retrieve_subtype_basic
	renamed to retrieve_subtype.  adapter_retrieve_vpd_pci and
	adapter_retrieve_vpd_DEFAULT now call adapter_retrieve_logicals_vpd.
	New stub function adapter_retrieve_logicals_vpd.  New function
	adapter_retrieve_logicals_common.

	* scripts/update-lsvpd-db.in:
	process_devices is now nice and clean like process_adapters.

	* scripts/scan.d/40ibm,loc-code:
	In device_set_yl renamed argument to $node.

	* scripts/scan.d/07device: Renamed functions as follows:

	OLD                             NEW                             NEW RETURNS
	get_device_names                device_get_names                $names
	device_get_adapter_name         device_get_parent_name          $parent_name
	device_get_adapter_node         device_get_parent_node          $parent_node
	device_get_adapter_subtype      device_get_parent_subtype       $parent_subtype
	device_backlink_adapter_bus_dir device_backlink_parent_node     -

	Renamed function add_device_hook_common to add_device_hook: now calls
	device_get_node, device_get_parent_node, device_get_source_node as
	appropriate.  New function device_retrieve_subtype.  Removed functions
	device_add_name_and_crosslink and device_add_name_and_crosslink_basic,
	replacing with new functions device_add_name, device_crosslink,
	device_names_to_ax.

2005-10-31  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	In function process_adapters: variable names made consistent with
	other code; now call adapter_add_name instead of
	adapter_set_ax_osname_hook and add_adapter_name_and_crosslink.

	* scripts/common.d/00vpd: New function vpd_node_override_value.

	* scripts/scan.d/33adapter_dt_nosysfs:
	Function dt_adapter_crosslink now takes a 5th argument $source_node
	and uses new API to call add_adapter_crosslink.  list_adapters passes
	extra $source_node argument to function dt_adapter_crosslink.

	* scripts/scan.d/00minimal:
	Fixed typo in add_adapter where variable "local" was inadvertently
	added to list of local variables.  New function adapter_add_name
	replaces functions adapter_set_ax_osname_hook and
	add_adapter_name_and_crosslink.  New function adapter_synthesise_ax
	replaces second part of function adapter_set_ax_osname_hook_basic.
	add_adapter_crosslink simplified since $subtype and $adapter_bus_dir
	are passed in as arguments.  Function cross_link now creates bus-node
	links, but the reverse "links" are now implemented by dropping the
	names into file lsvpd,names.

	* scripts/scan.d/21sysfs_hotplug:
	In hotplug_remove_device, use lsvpd,names to construct path of OS
	directory for removal, compared to old, complex method.

	* scripts/scan.d/07device:
	device_get_adapter_node simplified due to improved cross-linking
	regime.  device_add_name_and_crosslink adds $bus_type to argument list
	when calling device_add_name_and_crosslink_basic.  Simplified logic in
	device_add_name_and_crosslink_basic since bus-node links for devices
	no longer live in subdirectories under adapters.

	* scripts/scan.d/20sysfs:
	Renamed adapter_set_ax_osname_hook to adapter_get_names, which now
	returns in $names all of the possible operating system names for the
	given adapter.  This meant removing the AX construction code.

2005-10-27  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	process_adapters and process_devices are now much more clean and
	consistent.  New function process_extras, called after
	process_devices.

	* src/util.c:
	Addition of "-fstrict-aliasing -Wstrict-aliasing=2" compiler options
	forced cleanup of functions lsvpd_file_read_string,
	lsvpd_file_relative_read_string, line_scanner_harness.

	* src/Makefile:
	New program adapter_pci_map replaces pci_ethernet_map, pci_scsi_map
	and pci_ide_map.  Removed scsihost.conf from DATAS - it hasn't need
	been required for some time.  Added "-fstrict-aliasing
	-Wstrict-aliasing=2" to CFLAGS.

2005-10-26  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal: Renamed bus_set_yl_DEFAULT to bus_set_yl.

	* scripts/scan.d/37device_dt:
	add_device_hook is more careful about handling null $subid.

	* scripts/lsvpd-functions.bash:
	New function move_directory.  Move comment explaining multiplexing
	here and genericised it.

	* scripts/scan.d/00minimal:
	In add_adapter use move_directory to process the contents of the
	temporary directory.

	* scripts/scan.d/07device:
	In add_device use move_directory to process the contents of the
	temporary directory.

	* src/device_scsi_sg.c:
	Fixed logic error in device_scsi_sg_sanity_check: for EVPD page 0 byte
	3 should be greater than 0, not greater than 4 - the length of the
	page including the first 4 bytes should be greater than 4.

	* scripts/scan.d/40ibm,vpd:
	New function ibm_vpd_render_extras added to $extras_handlers - this
	handles rendering of ibm,vpd properties that are otherwise not
	rendered.

2005-10-25  Martin Schwenke  <martins@rover>

	* src/adapter_pci.h: Removed declaration of adapter_pci_map.

	* scripts/scan.d/07device: Renamed from 070device to 07device.

	* scripts/scan.d/33adapter_dt_nosysfs:
	list_adapters now runs new combined program adapter_pci_map directly
	instead of running per-{scsi,ide,ethernet} functions.  Removed
	multiplexed function dt_list_adapters_setup.  $subtype is now 3rd
	(rather than 1st) argument to new function dt_adapter_crosslink, which
	is no longer multiplexed - this function combined the functionality of
	the previous per-{scsi,ide,ethernet} functions.

	* src/device_scsi_sg.c:
	Fixed bug in device_scsi_sg_sanity_check where it would always return
	false for EVPD page != 0.

	* src/adapter_pci_map.c:
	Optimised main/adapter_pci_map so that proc_pci() gets called exactly
	once from main - it was being called once for each call to
	adapter_pci_map.  Alternatively, pushing the call down into
	adapter_pci_print_dodgy_matches means it gets called 0 or more times -
	the "more" is the problem with doing it that way.  The current version
	is a good compromise.

	* src/adapter_pci_map.c:
	New function main, which calls adapter_pci_map for all appropriate
	types.  adapter_pci_print_info now prints "ethernet" for Ethernet
	adapters.

	* src/pci_ethernet.c:
	Use adapter_pci_info_t instead of pci_ethernet_t.  pci_ethernet_parser
	now takes a name instead of a number and sanity checks memory
	allocations.  Removed functions pci_ethernet_fprint,
	pci_ethernet_free, main.  Renamed function pci_ethernet to
	adapter_pci_ethernet.

	* src/pci_ethernet.h:
	Use adapter_pci.h instead of custom structure/defines and to define
	adapter_pci_ethernet (rather than just pci_ethernet).

	* src/pci_ide.c:
	Use adapter_pci_info_t instead of pci_ide_t.  pci_ide_parser now takes
	a name instead of a number and sanity checks memory allocations.
	Removed functions pci_ide_fprint, pci_ide_free, main.  Renamed
	function pci_ide to adapter_pci_ide.

	* src/adapter_pci.h, src/adapter_pci_map.c: New file.

	* src/pci_scsi.h:
	Use adapter_pci.h instead of custom structure/defines and to define
	adapter_pci_scsi (rather than just pci_scsi).

	* src/pci_ide.h: Use adapter_pci.h instead of custom structure/defines.

	* src/pci_scsi.c:
	Use adapter_pci_info_t instead of pci_scsi_t.  Factored out new
	function pci_scsi_parser_common and use it in pci_scsi_sym538xx_parser
	and pci_scsi_ipr_parser (both of which are now static).  Removed
	unused typdeg pci_scsi_io_t and functions pci_scsi_fprint,
	pci_scsi_free, main.  Merged definition of struct pci_scsi_driver_info
	into declaration of variable pci_scsi_drivers.  hack_doms is now
	static.  Renamed function pci_scsi to adapter_pci_scsi.

	* src/pci_ide.h, src/pci_ide.c: New file.

2005-10-24  Martin Schwenke  <martins@rover>

	* scripts/scan.d/33adapter_dt_nosysfs:
	Merged function list_adapters_of_type into list_adapters; modified to
	use get_dt_adapter_subdirs and dt_adapter_subdir_to_subtype; removed
	channel code; write subtype to lsvpd,subtype.  Removed
	set_adapter_bus_dir, which has been replaced by global function.
	dt_set_bus_info_hook now sets $bus_type, $bus_addr, $channel instead
	of just $bus_info.  New functions adapter_get_source_node and
	adapter_get_subtype.

	* scripts/scan.d/37device_dt:
	add_device_hook calls get_dt_adapter_subdirs instead of
	get_dt_adapter_types.

	* scripts/scan.d/30device-tree:
	New functions get_dt_adapter_subdirs and dt_adapter_subdir_to_subtype
	replace multiplexed function get_dt_adapter_types and associated
	instances.

	* src/device_scsi_sg.c:
	New function device_scsi_sg_sanity_check replaces
	device_scsi_sg_sanity_check_evpd_0x00.  device_scsi_sg_ll_inq calls
	device_scsi_sg_sanity_check in a couple of places.
	device_scsi_sg_do_inquiries no longer does sanity checking on EVPD
	page 0 - if it is junk it won't be there due to earlier sanity
	checking.

2005-10-17  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Set new global variable $source_root to $sysfs_dir.  Removed functions
	adapter_init_node, pci_get_vendor_id - some of this functionality
	generalised and incorporated into new function pci_get_field_value and
	otherwise moved to 00pci.  pci_get_config_filename now returns value
	in $pci_config.  Removed all *list_adapters* functions and replaced
	with much simpler list_adapters, sysfs_list_adapters_by_bus,
	sysfs_list_adapters_ide_misc.  New multiplexed function
	adapter_get_subtype with instances adapter_get_subtype_DEFAULT and
	adapter_get_subtype_pci.  New functions sysfs_adapter_get_driver,
	adapter_get_source_node.  Simplified adapter_set_ax_osname_hook,
	removing channel code and using new function get_sysfs_class_node.
	Reworked sysfs_fw_version_vpd_hook to use new API for extra VPD -
	return key/value via $key, $value and $vpd_function.  adapter_set_yl
	now longer multiplexed and now simplified to just use parameter
	$bus_addr.  Removed function set_sysfs_node_hook, replaced with new
	functions get_sysfs_device_node and get_sysfs_class_node.
	set_sysfs_adapter_class now contains many more subtypes.

2005-10-14  Martin Schwenke  <martins@rover>

	* scripts/common.d/00vpd:
	vpd_create_hook no longer handles the FC field.  Added support for FC
	field to _vpd_field_insert.  Reimplemented adapter_extra_vpd_hook to
	support new API where hooks in $adapter_extra_vpd_hooks return $key
	and $val instead of writing to VPD file, and option function
	$vpd_function which is used to write the value.

	* scripts/common.d/00minimal:
	db_set_subdirs_vars_basic sets new global variables $db_bus_root,
	$db_tmp_subdir, $db_tmp_dir.

	* scripts/scan.d/45adapter_pci_chiprev:
	pci_chiprev_extra_vpd_hook now implements new API, setting $key and
	$val rather than writing value to file.

	* scripts/scan.d/41ibm,converged-loc-codes:
	Renamed dt_device_yl_hook to dt_device_get_yl_suffix and only return
	device suffix part of YL.

	* scripts/scan.d/00minimal:
	Removed comment about multiplexing - there are no longer any
	multiplexed functions here: add_adapter, bus_set_yl and adapter_set_yl
	are no longer multiplexed.  Removed functions adapter_init_node,
	check_if_adapter_is_a_channel.  New stub functions list_adapters,
	adapter_get_source_node, adapter_get_subtype.  Reimplemented
	add_adapter replaces add_adapter_DEFAULT is basically a copy of
	add_device.  add_adapter_hook accepts a new set of arguments and
	implements functionality similar to add_device_hook (see a pattern?
	:-).  adapter_set_ax_osname_hook_basic now accepts $bus_type (which
	now will be, for example, "pci" rather than "scsi") and must retrieve
	the subtype (e.g. "scsi") by calling adapter_retrieve_subtype.
	set_adapter_bus_dir stub implementation replaced by new global
	implementation, which attempts to use bus alias and then, if that
	doesn't work, uses adapter_get_source_node and builds $adapter_bus_dir
	from $source_node.  add_adapter_name_and_crosslink and
	add_adapter_crosslink no longer uses $type (subtype) and $bus_info
	arguments, but uses $bus_type and $bus_addr instead.

	* scripts/scan.d/07device:
	Functions device_set_yl, add_device_hook and remove_device_hook are no
	longer multiplexed.  Some device_get_adapter_name functionality split
	out into device_get_adapter_name_basic (so the latter can be called
	from elsewhere).  device_retrieve_vpd only accepts a single directory,
	for compatibility with devices, and takes a full $bus_info argument in
	addition to $bus_type - the 2 bus types can be different: the first
	reflects the adapter type so DS can be set properly and the one in
	$bus_info reflects the bus type to be used for retrieving VPD; this
	accomodates various types such as USB storage and SATA, which uses the
	SCSI subsystem.  add_device_hook_common renamed to
	device_get_adapter_node, since this is all it does - now calls
	device_get_adapter_name directly instead of expecting a global value
	to be passed, and contains a hack for USB devices, which will
	hopefully go away.  add_devices_hooks is removed and is replaced by
	new function add_device_hook_common, which should be called from each
	instance of add_device_hook.  New function device_get_adapter_subtype.
	Stub device_set_yl_DEFAULT replaced by stub non-multiplexed
	device_set_yl, which has all arguments.  device_set_adapter_yl
	reimplemented.  add_device now passes adapter subtype to
	device_retrieve_vpd and now only passes one directory; fixed bug in
	temporary directory removal; drop bus info into lsvpd,bus-info
	property; other cleanups.

	* scripts/scan.d/33adapter_dt_sysfs:
	New function adapter_get_source_node uses the devspec functionality
	from removed function set_adapter_bus_dir (which is now global).
	Removed dt_sysfs_add_channels - this may need to be recovered later to
	reimplement channel support.

	* scripts/scan.d/27device_sysfs:
	New function device_get_adapter_name hacks name for USB devices - this
	is probably temporary.  Non-multiplexed add_device_hook replaces
	add_device_hook_DEFAULT and merges functionality from removed function
	sysfs_add_device_hook_common, although $device_bus_dir is now
	essentially $sysfs_device_node (with a different prefix).
	Non-multiplexed device_set_yl replaces device_set_yl_DEFAULT.

	* scripts/scan.d/00pci:
	Removed functions pci_check_class and pci_get_vendor_id.  New stub
	function pci_get_field_value.  New function pci_retrieve_vpd acts as
	top-level function for retrieving PCI VPD using various methods -
	supported by new global variables $pci_retrieve_vpd_pre_functions and
	$pci_retrieve_vpd_std_functions.  New function pci_manufacture_vpd
	merges functionality from removed function pci_set_mf_tm_hook.
	pci_get_config_filename now puts name in $pci_config instead of
	printing filename.  pci_render_vpd now takes explicit input file and
	output directory arguments instead of just a directory name that
	shoudl contain input and output.  pci_do_pci22_vpd renamed to
	pci_retrieve_pci22_vpd and overhauled to meet requirements for adding
	to $pci_retrieve_vpd_std_functions.

	* scripts/common.d/30device-tree:
	In db-set_subdir_vars_dt, assign $db_bus_dt_dir to new global variable
	$db_bus_root.

	* scripts/scan.d/21sysfs_hotplug:
	sysfs_add_device_bus_alias is now assigned to new variable
	$add_device_extra_hook instead of being added to list
	$add_device_hooks - this was overkill.  sysfs_add_device_bus_alias now
	accepts explicit arguments $bus_type, $bus_addr and $subtype instead
	of using global $bus_info, and explicitly returns 0.
	hotplug_remove_device reads $bus_info from lsvpd,bus-info property
	instead of calling deprecated function remove_device_hook.

	* scripts/scan.d/31bus_device_tree:
	add_bus now constructs source node to pass to bus_set_yl and now
	creates the FC value manually since vpd_create_hook no longer handles
	this.

	* scripts/scan.d/40ibm,vpd:
	Removed functions db_initialise_ibm_vpd and ibm_vpd_adapter_init_hook,
	and no longer add these to variables $db_initialise_functions and
	$dt_adapter_init_hooks respectively.  This functionality, which used
	to render ibm,vpd properties has been (partially) replaced by new
	function ibm_vpd_retrieve_vpd, which is added to
	$pci_retrieve_vpd_pre_functions and renders ibm,vpd properties as part
	of the VPD retrieval process.  Something still needs to be implemented
	for lscfg's platform specific section.

	* scripts/scan.d/30device-tree:
	Set new global variable $source_root to $source_device_tree.  Removed
	functions adapter_init_node and add_adapter_hook - the last is now a
	global function.  Replaced functions pci_get_vendor_id and
	dt_set_pci_class with new function pci_get_field_value.  Merged
	functions adapter_set_ds_scsi and adapter_set_ds_ethernet into much
	simpler, non-multiplexed function.  dt_mac_address_vpd_hook now sets
	$key and $val instead of putting the value into a file.
	add_adapter_pci_hook generalised and moved to 00pci.

	* scripts/scan.d/33adapter_dt_nosysfs:
	Moved set_dt_pci_domain_prop_hook here from 30device-tree.  In
	function dt_set_bus_info_hook: renamed variable $device_type to
	$node_type for clarity; for $node_type "vdevice" $bus_type is now set
	to "vio".

	* scripts/scan.d/37device_dt:
	add_device_hook is no longer multiplexed: combined old
	add_device_hook_scsi and add_device_hook_ide.  replaced
	dt_ide_set_number with new multiplexed function(s)
	dt_parse_address_scsi and dt_parse_address_ide.

	* scripts/scan.d/40ibm,loc-code:
	dt_manufacture_yl_hook now expects a $source_node in the device-tree.
	adapter_set_yl now accepts 4 args: $bus_type, $bus_addr, $source_node
	and $adapter_bus_dir - passes just $source_node to
	dt_manufacture_yl_hook.  adapter_set_yl now accepts 4 args: $bus_type,
	$bus_addr, $source_node and $adapter_bus_dir - passes just
	$source_node to dt_manufacture_yl_hook.  device_set_yl is no longer
	multiplexed and uses a more efficient algorithm for finding the
	adapter's YL field so it can be appended to.  SCSI and IDE specific
	code has been moved out to 37device_dt.  dt_device_yl_hook renamed to
	dt_device_get_yl_suffix and now only sets the suffix, not the whole YL
	value.

	* src/device_scsi.c:
	Changed device_scsi_ds_prefixes so that "ATA" is printed for SATA
	devices and included appropriate comment.  Also, added special case so
	"USB Disk Drive" becomes "USB Mass Storage Device" and included
	comment saying it can be generalised when there are at least 2 special
	cases.

	* src/device_ide_proc.c:
	Added comment to device_ide_proc_subtype_to_ds explaining strange use
	of strncmp.

	* src/device_scsi_sg.c:
	device_scsi_sg_render was losing simple return values.

	* src/device_scsi.c: device_scsi_ds uses strcmp, not strncmp.

2005-10-13  Martin Schwenke  <martins@rover>

	* src/device_scsi_sg.c:
	make_ds_value now has a "type" argument, and longer needs mf, and only
	does the fancy stuff if type is DEVICE_SCSI_TYPE.
	device_scsi_sg_render accepts an extra "type" argument, passes it to
	make_ds_value.  device_scsi_sg_retrieve_vpd now passes
	DEVICE_SCSI_TYPE instead of type to device_scsi_sg_do_inquiries and
	also passes type to device_scsi_sg_render.  init now registers all the
	extra types in device_scsi_ds_prefixes.

	* src/device_sysfs.c:
	device_sysfs_retrieve_vpd_scsi hardcodes DEVICE_SCSI_TYPE in some
	places instead of using type - type is only passed to device_scsi_ds.
	init now registers all the extra types in device_scsi_ds_prefixes.

	* src/device_scsi.h:
	device_scsi_ds now accepts type and subtype args, instead of subtype
	and mf.  New macros DEVICE_SATA_TYPE, DEVICE_ATA_TYPE,
	DEVICE_ISCSI_TYPE, DEVICE_FIBRE_TYPE, DEVICE_SCSI_DEBUG_TYPE,
	DEVICE_IBMVSCSI_TYPE, DEVICE_USB_TYPE.  New array definition
	device_scsi_ds_prefixes.

	* src/device_scsi.c:
	device_scsi_ds now accepts type and subtype args, instead of subtype
	and mf, uses type and new array device_scsi_ds_prefixes to produce
	correct prefix instead of relying on mf.  init now registers all the
	extra types in device_scsi_ds_prefixes.

2005-09-27  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30dmidecode:
	Weaken Handle number patterns due to dmidecode output format change.
	Added comment about why we don't currently use -s option.

2005-09-14  Martin Schwenke  <martins@rover>

	* scripts/scan.d/07device:
	Changed to function add_device: no longer pass $vpd_dir to
	device_retrieve_vpd - $vpd_dir is now implicity a subdirectory of
	$tmp_dir; $device_type is now read from lsvpd,subtype; $tmp_dir is now
	moved to $device_bus_dir (rather than the previous bizarre behaviour);
	left-over temporary directory removal has been simplified.

2005-09-13  Martin Schwenke  <martins@rover>

	* scripts/scan.d/45adapter_pci_chiprev:
	Changed the way pci_get_config_filename is called.

2005-09-09  Martin Schwenke  <martins@rover>

	* src/device.h:
	Type device_retrieve_vpd_function_t takes argument node (instead of
	tmp_dir).

	* src/device.c:
	Function retrieve_vpd takes argument node (instead of tmp_dir).

	* src/lsvpd.h: New macros LSVPD_SUBTYPE_FILE and LSVPD_TMP_SUBDIR.

	* src/device_sysfs.c:
	Function device_sysfs_retrieve_vpd_scsi takes argument node (instead
	of tmp_dir) and writes subtype_string to LSVPD_SUBTYPE_FILE in node.

	* src/device_ide_proc.c:
	Function device_ide_proc_retrieve_vpd takes argument node (instead of
	tmp_dir) and writes subtype to LSVPD_SUBTYPE_FILE in node.

	* src/device_scsi_sg.c:
	In functions process_template and process_templates, changed argument
	name to subtype_string for clarity.  Function scsi_vpd_render takes
	extra argument subtype_file and now writes subtype_string there.
	Reworked function device_scsi_sg_retrieve_vpd, which now takes
	argument node (instead of tmp_dir), constructs tmp_dir and
	subtype_file, and passes them to other functions as appropriate.

	* src/device_handler.c:
	In functions main and usage, changed arguments for get_vpd.  Function
	device_get_vpd: now just takes node instead of tmp_dir and vpd_dir;
	uses vpd_list_list_to_node to write VPD to appropriate subdirectory.

2005-09-01  Martin Schwenke  <martins@rover>

	* scripts/query.d/00minimal:
	In function list_linux_vpd_basic: added a long comment explaining why,
	about 2 years ago, a trailing '/' was added to each directory name
	before sorting; modified this to temporarily change all '/'s to '!'s
	before sorting, resulting in lscfg producing more naturally sorted
	output.

	* scripts/scan.d/00pci: Removed unused function pci_parse_addr_hook.

2005-08-30  Martin Schwenke  <martins@rover>

	* debian/init.d:
	Exit with appropriate return value instead of always 0.

2005-08-26  Martin Schwenke  <martins@rover>

	* src/init.h:
	Added comment about how using -funit-at-a-time (and, hence, -O2) will
	result in a link failure

2005-08-05  Martin Schwenke  <martins@rover>

	* Makefile: Version to 0.13.1.

2005-07-26  Martin Schwenke  <martins@rover>

	* DODIFF: Added -V option to specify version.

2005-07-20  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	In add_adapter_DEFAULT, check return code from add_adapter_hook.  In
	add_adapter_hook_basic, if the lsvpd,bus-info file already exists
	assume something silly is going on and return 1 - the most likely case
	is that we're trying to use the same directory for an adapter and then
	a channel, and this is likely to end in tears.

	* scripts/scan.d/07device:
	In add_device_hook_common, added a horrible hack so that if we're
	trying to find host8, it will match host8, host8-9, host7,8,9 or
	similar.

	* scripts/scan.d/20sysfs:
	In function set_sysfs_node_hook, try stripping off host* or similar
	from to see if that helps find the sysfs node.

	* scripts/scan.d/30device-tree:
	In function adapter_set_ds_scsi, add special cases for ATA/IDE I/O
	Controller and iSCSI Adapter.

2005-07-13  Martin Schwenke  <martins@rover>

	* .distfiles:
	Removed scripts/scan.d/07device_ide_proc, scripts/scan.d/10devfs.
	Added src/proc_scsi.c, src/proc_scsi.h.

	* scripts/scan.d/20sysfs:
	In sysfs_pci_quirks_include_scsi, allow PCI class 0x0180 (unknown mass
	storage controller) as well as IDE.  In sysfs_pci_adapter_is_sata,
	added pata_pdc2027x to $sysfs_sata_drivers to support Promise 20275
	adapter.  New function sysfs_list_adapters_iscsi, added to
	$sysfs_list_adapter_functions, recognises all PCI adapters with driver
	qla4xxx as SCSI.

	* DODIFF: When going backwards from 0.13.0, try value is 0.12.9.

2005-07-11  Martin Schwenke  <martins@rover>

	* scripts/scan.d/07device:
	device_get_adapter_name no longer multiplexed: new function
	device_get_adapter_name now invokes device_handler; removed functions
	device_get_adapter_name_DEFAULT, device_get_adapter_name_scsi.

	* src/device_handler.c:
	New argv[1] alternative get_parent_name supported by new function
	device_print_parent_name.

2005-07-10  Martin Schwenke  <martins@rover>

	* src/ibm_vpd_render.c:
	Fix gcc-4.0 warnings: in macro IBM_VPD_SEP_FIELD, cast value to
	(unsigned char*); in function ibm_vpd_add_sep, cast IBM_VPD_SEP_VALUE
	to (unsigned char*); in main, variable data changed to (unsigned
	char*).

	* src/growbuf.h: New function growbuf_append_byte.

	* src/device.h:
	device_functions_t member get_adapter_name and associated type and
	functions renamed to get_parent_name as appropriate.

	* src/device.c:
	Function and device_functions_t member renamed from get_adapter_name
	to get_parent_name.  In function device_list_add, change braces to fix
	gcc-4.0 warning.

	* src/tdump.c:
	Fix gcc-4.0 warnings: in main variable data is now (unsigned char*)
	and change use of strncpy to memcpy.

	* src/util.h: Fix gcc-4.0 warnings: in functions file_read_contents,
	file_relative_write_contents, file_write_contents,
	file_relative_write_contents, argument buf is now unsigned; in
	function strndup_trim, argument s is now unsigned.

	* src/device_scsi.c:
	Fix gcc-4.0 warnings: in function process_template, argument data
	changed to (unsigned char*); in function device_scsi_hexify, argument
	s changed to (unsigned char*); in device_scsi_append_field, argument
	data changed to (unsigned char*).  Function
	device_scsi_get_adapter_name renamed to device_scsi_get_parent_name.
	In function init, renamed device_functions_t member get_adapter_name
	to get_parent_name.

	* src/device_scsi.h:
	Fix gcc-4.0 warnings: in function process_template, argument data
	changed to (unsigned char*).

	* src/device_ide_proc.c:
	Renamed function device_ide_proc_get_adapter_name to
	device_ide_proc_get_parent_name.  In function init, renamed
	device_functions_t member get_adapter_name to get_parent_name.

	* src/device_sysfs.c: Fix gcc-4.0 warnings: in function
	device_sysfs_get_directory_attribute, cast sa->value to (unsigned
	char*) when calling strndup_trim.

	* src/device_scsi_sg.c:
	Fix gcc-4.0 warnings: in function make_ds_value, variable data_0xc7
	becomes (unsigned char*); in function process_template, argument type
	renamed to subtype and variable buf changed to (unsigned char*); in
	function process_templates, argument type renamed to subtype; in
	function device_scsi_sg_render, variable data changed to (unsigned
	char*); in function device_scsi_sg_sanity_check_evpd_0x00, argument
	buf changed to (unsigned char*); in function
	device_scsi_sg_do_inquiries, variable buf changed to (unsigned char*).

2005-07-09  Martin Schwenke  <martins@rover>

	* src/vpd.h:
	Fix gcc-4.0 warnings: vpd_key_t is now an array of unsigned char.
	vpd_list_new_internal, vpd_list_append_key_value,
	vpd_list_prepend_key_value now take (unsigned char*) argument;
	vpd_list_maybe_append_key_string's key argument is now a (char*)
	string instead of a vpd_key_t.

	* src/vpd.c: Fix gcc-4.0 warnings: vpd_list_new_internal,
	vpd_list_append_key_value, vpd_list_prepend_key_value now take
	(unsigned char*) argument; vpd_list_maybe_append_key_string's key
	argument is now a (char*) string instead of a vpd_key_t;
	vpd_list_to_text does some extra casting and now calls new function
	growbuf_append_byte in several places; vpd_key_value_to_vpd_dir now
	calls lsvpd_file_write_string instead of file_write_contents;
	vpd_dir_field_add_to_keys_file simplified using
	lsvpd_file_relative_read_string, lsvpd_file_relative_write_string;
	vpd_dir_field_ensure simplified using lsvpd_file_write_string; various
	extra casts added.

	* src/util.c: Fix gcc-4.0 warnings: read_to_eof, file_read_contents,
	file_relative_read_contents now take (unsigned char**) argument
	instead of just (char**); lsvpd_file_read_string and
	lsvpd_file_relative_read_string need to cast &ret to (unsigned char**)
	when calling lower-level functions.  file_write_contents,
	file_relative_write_contents now take (unsigned char*) argument
	instead of just (char*); lsvpd_file_write_string,
	lsvpd_file_relative_write_string cast string to (unsigned char*) when
	calling lower-level functions; strndup_trim now takes (unsigned char*)
	argument instead of (char*); line_scanner_harness casts &data to
	(unsigned char**).

	* src/pci_vpd_parse.c:
	Fix gcc-4.0 warnings: function is_printable now takes a char* argument
	rather than unsigned char*, since it is a NUL-terminated string;
	function is_good calls memcmp instead of strncmp, since kv->-key is
	unsigned char*; various other variables change from char* to unsigned
	char* or uint8_t*.

	* src/pci_vpd_gen_grab.c:
	In function grab_vpd variable tmp is now a uint8_t* rather than a
	char* and &data is now cast to uint8_t* as well.  This fixes warnings
	from gcc-4.0.

2005-07-07  Martin Schwenke  <martins@rover>

	* src/pci_lookup.c:
	In main, use lsvpd_file_read_string instead of file_read_contents.

	* src/pci_scsi.c:
	In function pci_scsi_file, use lsvpd_file_read_string instead of
	file_read_contents.

2005-07-06  Martin Schwenke  <martins@rover>

	* src/device.c:
	Renamed macro DEVICE_SET_FUNCTION to DEVICE_SET_POINTER.  Modified
	device_type_register to use DEVICE_SET_POINTER and added registration
	of supertype field.  Modified macros DEVICE_MULTIPLEXED_VOID and
	DEVICE_MULTIPLEXED_RET to use registered supertype instead of just
	trying hardcoded default supertype of DEVICE_DEFAULT_TYPE - as a
	result supertypes are now configurable and can be chained.

	* src/device.h: Add supertype field to device_functions_t.

	* src/device_scsi.c:
	Register DEVICE_DEFAULT_TYPE as supertype for DEVICE_SCSI_TYPE.

	* src/device_ide.c:
	New function init registers DEVICE_DEFAULT_TYPE as supertype for
	DEVICE_IDE_TYPE.

2005-06-29  Martin Schwenke  <martins@rover>

	* src/device_scsi_sg.c:
	New function device_scsi_sg_sanity_check_evpd_0x00 does sanity
	checking of EVPD page 0x00 and is called in function
	device_scsi_sg_do_inquiries.

	* src/device_handler.c:
	Added comment to main about init() functions allocating memory that is
	never freed.

	* src/device_scsi_sg.c:
	Fixed memory leak in function device_scsi_sg_do_inquiries.

2005-06-28  Martin Schwenke  <martins@rover>

	* src/Makefile:
	Added new module proc_scsi.o.  New variables DEVICE_MODULES and
	UTIL_MODULES used to define device_handler.  device_scsi_sg.o now
	comes after device_sysfs.o.

	* src/device_sysfs.c:
	In function device_sysfs_get_directory_attribute, use strndup_trim
	instead of malloc/memcpy.  New function device_sysfs_retrieve_vpd_scsi
	registered in function init.

	* src/vpd.c:
	In vpd_dir_field_ensure, use lsvpd_relative_filename instead of
	equivalent asprintf.

	* src/device_scsi.h:
	New functions device_scsi_subtype_string, device_scsi_ds,
	device_scsi_append_field, device_scsi_append_field_string.

	* src/device_scsi_sg.c:
	Moved functions hexify, append_field and append_field_string, and
	arrays scsi_device_types_short and scsi_device_types to device_scsi.c.
	Modified function make_ds_value to use device_scsi_ds.  Modified
	device_scsi_sg_render to use newly factored code.

	* src/device_scsi.c:
	Moved arrays device_scsi_types_short and device_scsi_types, and new
	functions hexify, append_field and append_field_string (and added
	"device_scsi" prefix) from device_scsi_sg.c.  New functions
	device_scsi_subtype_string and device_scsi_ds to access above arrays
	and do some other common processing.

2005-06-27  Martin Schwenke  <martins@rover>

	* src/device_scsi_sg.c:
	New variable have_sg_checks and new function have_sg used to check if
	generic SCSI (SG) driver is available.  Function init now checks to
	see if SG driver is available before registering retrieve_vpd function.

	* src/device_sysfs.c:
	Moved code from init() to modprobe sg kernel module to
	device_scsi_sg.c.

	* src/proc_scsi.h, src/proc_scsi.c: New file.

	* src/sysfs.c: Function init should copy from x, not t.

	* src/sysfs.c:
	Logic for setting lsvpd_sysfs_dir in function init has change: init
	checks for environment variable LSVPD_SYSFS_DIR; if this is not set
	then libsysfs is asked for the sysfs mount path; either way, if the
	returned directory exists it is copied into lsvpd_sysfs_dir.

	* src/device_ide_proc.c:
	In init, use access(2) instead of stat(2) - this simplifies things
	because we don't need to declare a struct stat.

	* src/vpd.c, src/device_scsi_sg_map.c:
	Removed #includes associated with stat(2).

	* src/vpd.c:
	In vpd_dir_field_ensure, use access(2) instead of stat(2) - this
	simplifies things because we don't need to declare a struct stat.

2005-06-24  Martin Schwenke  <martins@rover>

	* Makefile:
	Now pass VERSION to subdirectories.  Changed version to 0.13.0.

	* src/device_scsi_sg.c:
	Fixed bug in device_scsi_sg_render - it was doing s/^SCSI/ATA/ to DS
	regardless of manufacturer.

2005-06-22  Martin Schwenke  <martins@rover>

	* src/ide_mf.map:
	Added Matshita devices starting with "UJDA" and Hitachi devices
	starting with "IC25N".

	* scripts/scan.d/20sysfs:
	Changes to support SATA on ata_piix adapter under Linux 2.6 (running
	in "split mode"): function adapter_init_node now creates "type" file
	for all non-PCI adapters; in function sysfs_pci_adapter_is_sata, added
	ata_piix as a SATA driver; renamed function sysfs_list_adapters_ide_cs
	to sysfs_list_adapters_ide_misc and use "unknown" bus type instead of
	"pseudo"; in function adapter_set_yl_DEFAULT, prepend $yl with "?" if
	$adapter_bus_dir matches a bus-less IDE adapter; in function
	set_sysfs_node_hook set candidate link/directory more carefully by
	checking if the bus type is "unknown" and use this as $sysfs_node if
	it is a directory.

	* src/device_scsi_sg.c:
	Changed to function device_scsi_sg_render: reordered code to
	accomodate new template for disks with mf ATA; if mf is ATA try to
	override it using function device_ide_do_mf_tm; if mf is ATA do prefix
	substitution on ds changing "SCSI" to "ATA".

2005-06-21  Martin Schwenke  <martins@rover>

	* src/device_ide.h: New function device_ide_do_mf_tm.

	* src/device_ide_proc.c:
	Moved device_ide_proc_do_mf_tm and supporting code to device_ide.c.

	* src/device_ide.c:
	Moved device_ide_do_mf_tm here from device_ide_proc.c: new type
	device_ide_do function device_ide_do_mf_tm, array device_ide_tm_skip,
	functions device_ide_do_mf_tm_scanner and device_ide_do_mf_tm.

	* src/scsivpd.conf: Added ATA disk template.

2005-06-17  Martin Schwenke  <martins@rover>

	* docs/install.xml:
	Added section about compile-time dependencies.  Changed heading of
	section "Software dependencies" to "Runtime software dependencies".
	Modified sg3_utils section to loosen requirement to Linux 2.4 and
	moved some information to the compile-time section.

	* docs/design.xml:
	Updated with current details from C reimplementation.

2005-06-16  Martin Schwenke  <martins@rover>

	* DODIFF: New file.

	* src/device_scsi_sg.c:
	Renamed variables and parameters do_evpd and evpd_page to evpd and
	page_code respectively, for consistency with SPC-3.
	device_scsi_sg_ll_inq now does an initial standard inquiry using an
	allocation length of DEVICE_SCSI_SG_DEFAULT_STD_LEN (36) or an initial
	EVPD inquiry using an allocation length of
	DEVICE_SCSI_SG_DEFAULT_EVPD_LEN (252) and follows up with an inquiry
	using the length reported in the result of the initial inquiry.  See
	comments near the above new macros for the reasoning behind this.

	* src/device_handler.c:
	Functions device_print_name and device_print_kernel_name now prepend
	whatever they print with "/dev/".

	* .distfiles:
	debug.bash and lsvpd-functions.bash moved from src/ to scripts/.
	Removed files scripts/scan.d/07device_scsi_sg_inq,
	scripts/scan.d/07device_scsi_sg_scan,
	scripts/scan.d/27device_scsi_sysfs_no_sg_inq - all functionality
	subsumed by device_handler.  Many new files in src subdirectory to
	support device_handler.  Removed src/scsi_vpd_render.c.  Test files
	moved to src/test.

	* src/Makefile:
	No longer build scsi_vpd_render, build new program device_handler
	instead.  util.h is no longer generated - the relevant snippet of code
	now lives in lsvpd_lib_dir.h.in and lsvpd_lib_dir.h is generated from
	this.  New data file ide_mf.map.  Test programs moved to test
	subdirectory.

	* src/device_scsi_sg.c:
	Some functionality of function device_scsi_do_inq split into new
	function device_scsi_sg_ll_inq, which now always tries to do an
	inquiry of maximum length 252 and only tries a larger inquiry if
	necessary.

	* scripts/update-lsvpd-db.in:
	Set LSVPD_DB_DIR to $db for benefit of device_handler (and other
	upcoming subsystems written in C).

2005-06-15  Martin Schwenke  <martins@rover>

	* src/device_sysfs.c:
	In function device_sysfs_get_mode, increment i in loop.

2005-06-14  Martin Schwenke  <martins@rover>

	* src/device_handler.c:
	Added get_kernel_name functionality via new function
	device_print_kernel_name.

	* scripts/scan.d/07device:
	In add_device, also remove .lsvpd file before attempting to remove directory.

	* scripts/scan.d/07device:
	Functions get_kernel_device_name and device_retrieve_vpd are no longer
	multiplexed.  Functions list_devices, device_retrieve_vpd and
	device_get_name are now implemented by calling out to external program
	device_handler.

	* src/device_scsi.c:
	New function device_scsi_validate registered in init().

	* src/device.c:
	Function device_type_register also calls DEVICE_SET_FUNCTION for
	validate.  New multiplexed definition for device_validate.
	device_list_add calls device_validate before adding an item to the
	list of devices.

	* src/device.h:
	device_list_add now takes an extra device_t argument.  Also added new
	type device_validate_function_t, new member of struct device_functions
	validate, new function device_validate.

	* src/device_ide_proc.c, src/device_scsi_sg_map.c, src/device_sysfs.c:
	device_list_add now takes an extra device_t argument.

	* scripts/scan.d/27device_sysfs:
	Removed functions sysfs_list_devices, get_kernel_device_name_DEFAULT,
	sysfs_get_device_link.

	* src/device_handler.c:
	Behaviour no longer depends on argv[0] - that got old very quickly!
	Now depends on argv[1].  Added get_name functionality via new function
	device_print_name and appropriate logic changes to main().

2005-06-10  Martin Schwenke  <martins@rover>

	* src/device_handler.c:
	Functionality now depends on argv[0] - supports commands
	device_get_vpd and device_list.  Most functionality from old main
	moved to new function device_get_vpd.  New function device_list.

	* src/device_sysfs.c:
	New function device_sysfs_list_devices.  Type device_info_t renamed to
	device_node_info_t, affecting function device_sysfs_get_info.
	Function init no longer sets up .type_setup functions, and has calls
	to device_listing_functions_clear and device_listing_function_register
	added to register device_sysfs_list_devices.

	* src/device_scsi_sg_map.c:
	Enabled functions device_scsi_sg_map_list_scanner and
	device_scsi_sg_map_list_devices.  Function device_scsi_sg_map_setup no
	longer requires any arguments, and is no longer assigned into s.type
	in function init.  Type device_info_t renamed to device_node_info_t,
	affecting function device_scsi_sg_map_get_info.  Enabled call to
	device_listing_function_register in function init.

	* src/device_scsi_sg.c:
	Type device_info_t renamed to device_node_info_t, affecting functions
	device_scsi_sg_do_inquiries.

	* src/device_ide_proc.c:
	Enabled functions device_ide_proc_list_scanner and
	device_ide_proc_list_devices.  Function device_ide_proc_setup no
	longer requires any arguments, and is no longer assigned into i.type
	in function init.  Type device_info_t renamed to device_node_info_t,
	affected functions device_ide_proc_get_info and
	device_ide_proc_get_identity.  Enabled call to
	device_listing_function_register in function init.

	* src/device.h: Added device listing functions and variable: new type
	device_bus_info_list_t; new variable device_listing_functions; new
	functions device_listing_functions_clear,
	device_listing_function_register, device_list_devices,
	device_list_add, device_list_clear.  Removed type_setup functions -
	now called directly by the device listing functions.  Renamed type
	device_info_t to device_node_info_t, affecting functions
	device_open_temporary and multiplexed device_get_info.

	* src/device.c:
	Added device listing functions and variable: new variable
	device_listing_functions; new functions
	device_listing_functions_clear, device_listing_function_register,
	device_list_devices, device_list_add, device_list_clear.  Removed
	type_setup functions - now called directly by the device listing
	functions.  Renamed type device_info_t to device_node_info_t,
	affecting functions device_open_temporary and multiplexed
	device_get_info.

2005-06-09  Martin Schwenke  <martins@rover>

	* src/test/test_device_db_init.c: New file.

	* src/lsvpd.h:
	New function lsvpd_db_mkdirs creates all the standard database
	directories.

	* src/device.c:
	Function device_open_temporary does a better job of setting the
	permissions of the temporary device node.

	* src/device_scsi.h: New file.

	* src/lsvpd.c:
	New function lsvpd_db_mkdirs creates all the standard database
	directories.

	* src/sysfs.c:
	If environment variable LSVPD_FAKE_NO_SYSFS is set then no attempt is
	made to set lsvpd_sysfs_dir.  All other sysfs-related code should
	depend on this variable being set.

	* src/util.h: New function lsvpd_mkdirname.

	* src/device_ide_proc.c:
	In fnuction device_ide_proc_set1, fixed bug in format string.

	* src/util.c:
	New function lsvpd_mkdirname.  Fixed lsvpd_mkdir so it creates parent
	directories properly - it now uses lsvpd_mkdirname - mutual recursion.

	* src/vpd.c:
	Changed vpd_list_maybe_append_key_string to actually append instead of prepend.

	* src/lsvpd.c:
	Renamed array lsvpd_vars_subdirs to lsvpd_vars_dirs and added extra
	field in structure: directory that the current directory is relative
	to.  Updated function lsvpd_db_set_subdirs_basic to use this.

	* src/device_scsi_sg_map.c, src/device_scsi.c: New file.

	* src/device_sysfs.c:
	In function init, set type_setup function to DEVICE_UNDEF for both IDE
	and SCSI.

2005-06-08  Martin Schwenke  <martins@rover>

	* src/device_sysfs.c:
	In function init, if /sys/class/scsi_generic does not exist, trying
	doing modprobe sg.

	* src/device_sysfs.c:
	Uncomment item in device_sysfs_type_alist for DEVICE_SCSI_TYPE.
	Removed function device_sysfs_resolve_link - the target in struct
	sysfs_link is already resolved/absolute.  In function
	device_sysfs_get_directory_attribute, NUL-terminate return value.
	Function device_sysfs_get_info no longer calls removed function
	device_sysfs_resolve_link, but passes l->target instead.  Function
	init now sets get_info functions for SCSI and IDE to DEVICE_UNDEF,
	since device_sysfs_get_info handles all device types.

	* src/device_scsi_sg.c: New file.

2005-06-07  Martin Schwenke  <martins@rover>

	* src/util.c, src/util.h: New function lsvpd_readlink.

	* src/make_proc_pci_class: New file.

	* src/vpd.h, src/vpd.c:
	Functions vpd_list_append_key_value, vpd_list_prepend_key_value,
	vpd_list_maybe_prepend_key_string now modify vpd_list** and return
	bool.

	* src/sysfs.h, src/sysfs.c, src/lsvpd_lib_dir.h.in, src/lsvpd_lib_dir.c, src/lsvpd.h, src/lsvpd.c, src/init.h, src/ide_mf.map, src/device_sysfs.c, src/device_ide_proc.h, src/device_ide.h, src/device_ide.c, src/device.h, src/device.c, src/device_handler.c, src/device_ide_proc.c:
	New file.

2005-06-03  Martin Schwenke  <martins@rover>

	* DOTEST: If package_subdir is DIST and package doesn't exist (on local
	machine), then see if package_subdir="DIST/OLD" would be better.

2005-06-01  Martin Schwenke  <martins@rover>

	* src/util.c, src/util.h:
	New functions lsvpd_realpath, lsvpd_realpath_relative,
	lsvpd_prefix_substitute.

2005-05-31  Martin Schwenke  <martins@rover>

	* src/util.h: Renamed to util.h.  Removed macro LSVPD_LIBDIR.

	* src/util.c, src/util.h:
	New functions lsvpd_file_write_string and lsvpd_file_relative_write_string.

2005-05-27  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/00minimal:
	lsvpd_render_line, suppress U? fields - they are used internally by
	lsmcode and have never been seen in other VPD.

	* scripts/Makefile:
	lsvpd-functions.bash and debug.bash should be installed here.

	* src/Makefile:
	lsvpd-functions.bash and debug.bash should not be installed - they're
	not here!

	* scripts/lsvpd.d/00minimal:
	In lsvpd_render_linux_vpd_directory, suppress U? fields - they are
	used internally by lsmcode and have never been seen in other VPD.

2005-05-26  Martin Schwenke  <martins@rover>

	* src/pci_vpd_parse.c: Fixed calls to vpd_list_append_key_value.

	* src/ibm_vpd_render.c:
	In function ibm_vpd_add_sep, change the way vpd_list_prepend_key_value
	is called.

	* src/util.h: New functions lsvpd_file_read_string and
	lsvpd_file_relative_read_string.  Changed one declaration of
	lsvpd_basename to lsvpd_dirname.

	* src/util.c:
	New functions lsvpd_file_read_string and lsvpd_file_relative_read_string.

	* src/test/test_vpd.c:
	Renamed types vpd_list to vpd_list_t and vpd_list_list to
	vpd_list_list_t.  Added extra command-line argument and corresponding
	test for vpd_list_sort.

	* src/pci_vpd_parse.c, src/pci_vpd_parse.h, src/ibm_vpd_render.c:
	Renamed types vpd_list to vpd_list_t and vpd_list_list to
	vpd_list_list_t.

	* src/vpd.c: Renamed types vpd_list to vpd_list_t and vpd_list_list to
	vpd_list_list_t.  New functions vpd_list_sort and vpd_list_delete.
	Macro VPD_CHECK_NEW now takes curr as 2nd argument and also checks to
	make sure it isn't NULL.  VPD_FOREACH_TEMP now copes with case where
	removing head in the loop body caused head to catch up to temp,
	causing early termination of the loop.  vpd_list_append and
	vpd_list_prepend now return void.  Fixed vpd_list_prepend.

	* src/vpd.h: Renamed types vpd_list to vpd_list_t and vpd_list_list to
	vpd_list_list_t.  New function vpd_list_sort.

2005-05-24  Martin Schwenke  <martins@rover>

	* src/Makefile: Removed redundant -I../lib from CFLAGS.

	* lsvpd.spec.in:
	lsvpd.cron.daily is now generated in scripts/ subdirectory.

	* .distfiles: All scripts live in scripts subdirectory.  Resorted file.

	* src/util.c: Ensure lsvpd_rm_rf_unlink returns a value.

	* src/Makefile:
	Set CFLAGS here, since it is no longer set in top-level Makefile.

	* Makefile:
	Moved building and installation of scripts to scripts/Makefile.

	* scripts/Makefile:
	Moved the various top-level scripts to this directory, so they are now
	built here.

	* .distfiles:
	Removed lib/list.h and renamed all files in lib/, pci/, scsi/ to be in
	src/ instead.

	* src/vpd.c:
	Calls of build_relative_filename renamed to lsvpd_relative_filename.

	* src/util.c, src/util.h: Removed lsvpd_mkdirname.

	* src/Makefile:
	Removed libvpd.a and merge contents of old ../pci/Makefile and ../scsi/Makefile.

	* src/util.c:
	lsvpd_rm_rf_unlink() now doesn't try to remove "." or "..".

	* src/util.h:
	Removed variable vpd_program_name and functions die() and die2().
	Renamed function build_relative_filename to lsvpd_relative_filename.
	New functions lsvpd_basename(), lsvpd_dirname(), lsvpd_mkdir(),
	lsvpd_mkdirname(), lsvpd_rm_rf().

	* src/util.c:
	Removed variable vpd_program_name and functions die() and die2().
	Renamed function build_relative_filename to lsvpd_relative_filename.
	New functions lsvpd_basename(), lsvpd_dirname(), lsvpd_mkdir(),
	lsvpd_mkdirname(), lsvpd_rm_rf_unlink(), lsvpd_rm_rf().

	* src/test/test_vpd.c, src/pci_vpd_parse.c, src/pci_vpd_cap_grab.c, src/pci_lookup.c, src/ibm_vpd_render.c, src/tdump.c:
	Removed need for function die2() and variable vpd_program_name.

	* src/vpd.c:
	Minor tweaks to vpd_list_to_vpd_dir and vpd_list_list_to_node.

	* src/vpd.c:
	New macros VPD_CHECK_NEXT, VPD_FOREACH, VPD_FOREACH_TEMP - these are
	now used for loops in various functions.

2005-05-23  Martin Schwenke  <martins@rover>

	* src/Makefile: Removed references to list.h.

	* src/growbuf.h, src/growbuf.c:
	growbuf_append's 2nd argument (data) is now const.

	* src/pci_vpd_parse.c:
	parse_key_value calls vpd_list_append_key_value instead of
	vpd_list_new and vpd_list_new instead of vpd_list_new_empty.

	* src/ibm_vpd_render.c:
	ibm_vpd_parse calls vpd_list_list_new instead of
	vpd_list_list_new_empty.

	* src/vpd.c:
	vpd_list_new_renamed to vpd_list_new_internal and made static.
	vpd_list_new_empty renamed to vpd_list_new and now just returns NULL.
	vpd_list_list_new_renamed to vpd_list_list_new_internal and made
	static.  vpd_list_list_new_empty renamed to vpd_list_list_new and now
	just returns NULL.  Base functions now do their own list pointer and loop
	handling instead of relying on list.h.

	* src/vpd.h:
	No longer use list.h.  vpd_list and vpd_list_list now have their own
	prev and next pointers.  Renamed function vpd_list_new_empty to
	vpd_list_new and vpd_list_list_new_empty to vpd_list_list_new.  Only
	one version of each now exists.

	* src/util.h:
	Moved big_cool_pread and big_cool_pwrite to pci/pci_vpd_cap_grab.c.

	* src/pci_vpd_cap_grab.c:
	Moved big_cool_pread and big_cool_pwrite her from lib/util.c.

	* src/util.c:
	Moved big_cool_pread and big_cool_pwrite to pci/pci_vpd_cap_grab.c.

2005-05-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/37device_dt:
	add_device_hook_scsi and add_device_hook_ide now use renamed variable
	$device_adapter_name instead of $adapter.

	* scripts/scan.d/27device_sysfs:
	sysfs_list_devices now checks items by calling device_list_device_ok
	before adding them to $device_list.  sysfs_add_device_hook_common and
	add_device_hook_DEFAULT now use renamed variable $device_adapter_name
	instead of $adapter.

	* scripts/scan.d/07device:
	add_device is no longer multiplexed.  New multiplexed functions
	device_retrieve_vpd, device_get_adapter_name, device_vpd_set_order.
	In add_device_hook_common use renamed variable $device_adapter_name
	instead of $adapter.  Renamed function add_device_scsi to add_device -
	generalised to call device_retrieve_vpd, device_get_adapter_name,
	device_vpd_set_order instead of calling old SCSI-specific functions
	and using inline SCSI-specific functionality.  Factored out IPR driver
	workaround from add_device_scsi into new function
	device_list_device_ok, which is called by device listing functions.
	Stub function device_scsi_get_vpd renamed to
	device_retrieve_vpd_DEFAULT.  scsi_vpd_enumerate removed and split
	into new functions device_vpd_set_order_scsi,
	device_vpd_set_order_DEFAULT and device_vpd_set_order_basic.  New
	function device_get_adapter_name_DEFAULT.

2005-05-18  Martin Schwenke  <martins@rover>

	* .distfiles: Added setup/scan.d/27device_scsi_sysfs_no_sg_inq.

	* DOTEST: Oops, don't set $version to $1 if it is already set.

	* DOTEST:
	Now use test/*/.testconfig files instead of having all the test hosts
	listed in this script.

	* scripts/scan.d/07device:
	New functions add_device_scsi scsi_vpd_enumerate moved here from
	07device_scsi_sg_inq.  New stub function device_scsi_get_vpd always
	fails.

2005-05-13  Martin Schwenke  <martins@rover>

	* README: Added lsvio.

	* scripts/Makefile: Added lsvio.d to DATADIRS.

	* .distfiles:
	Removed lscfg.in, lsmcode.in, added docs/lsvio.{xml,8}.  Removed
	pci/pci.vendor.blacklist, setup/common.d/20sysfs.  New files
	setup/lsmcode.d/41ibm_serv_config, setup/lsvio.d/00minimal,
	setup/lsvio.d/30device-tree, setup/lsvpd.d/00minimal.

	* Makefile:
	lsvpd is now generated from lsvpd.in.  lscfg, lsmcode, lsvio are
	copies of lsvpd.  Changed version to 0.12.8.

	* scripts/scan.d/27device_sysfs:
	Changed the order of some statements in get_kernel_device_name_DEFAULT
	that were stopping sr0 being mapped to scd0.

	* scripts/scan.d/33adapter_dt_nosysfs:
	Added limited support for ISA adapters to dt_set_bus_info_hook.

	* scripts/scan.d/37device_dt:
	add_device_hook_scsi now uses local variable $dt_type to build
	$device_bus_dir.  $dt_type is usually $device_type, but for
	$device_type "enclosure" $dt_type is set to "Enclosure" to hack the
	sort ordering in lscfg.

	* scripts/scan.d/00minimal:
	New function check_if_adapter_is_a_channel.  add_adapter_DEFAULT now
	calls check_if_adapter_is_a_channel to set local variable
	$adapter_is_a_channel, uses it instead of deleted local variable
	$not_a_channel, and passes $adapter_is_a_channel to add_adapter_hook.
	add_adapter_hook_basic takes new 4th argument $adapter_is_a_channel
	and passes this to adapter_set_ds.

	* scripts/scan.d/30device-tree:
	Moved $is_a_channel-related checking from add_adapter_hook to new
	function in 00minimal.  add_adapter_hook is now passed 3rd argument
	$adapter_is_a_channel and uses this.  adapter_set_ds_scsi and
	adapter_set_ds_ethernet also take extra argument $adapter_is_a_channel
	and now append " Channel" to DS when appropriate, and in such cases DS
	is often the simple default rather than a device-tree-specific
	version.

	* scripts/scan.d/20sysfs:
	adaper_set_ds_scsi now takes 2 arguments: $adapter_bus_dir and
	$adapter_is_a_channel and appends " Channel" to DS when
	$adapter_is_a_channel is true.

2005-05-12  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	add_adapter_hook now has its own check to see if this "adapter" is
	really a channel, instead of depending on the caller to set
	$not_a_channel, which wasn't always the case.

	* scripts/query.d/41rtas_get_ibm_vpd: Bump copyright.

	* scripts/query.d/41rtas_get_ibm_vpd:
	Added locking to rtas_ibm_get_vpd_hook and added a comment about the
	failure policy.

	* scripts/scan.d/00pci:
	Added a comment to pci_do_pci22_vpd explaining the locking policy.

	* scripts/scan.d/00minimal:
	adapter_set_ax_osname_hook_basic now prefixes sequence files with
	"adapter_".  set_sequence_number_hook now uses $db_state_dir.

	* scripts/common.d/00minimal:
	db_set_subdir_vars_basic now sets $db_state_subdir and $db_state_dir.

	* scripts/scan.d/00pci:
	pci_not_on_vendor_blacklist now checks for blacklist file earlier.
	pci_do_pci22_vpd now does locking around fetch of VPD and writes to
	temporary file - this anticipates problems that might occur if PCI 2.2
	VPD is made dynamic (i.e. fetchable by query programs).

2005-05-11  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Removed function db_prepare, moving relevant functionality to the end
	of main script.  This means the db link is only changed after a new
	database is completely built and it is changed as close to atomically
	as possible.  process_buses_of_type renamed to process_buses, which
	now uses new list_buses and add_bus interfaces.  Also fixed bug in
	process_buses, which was numbering all buses sequentially across all
	types, but now numbers sequentially within bus type.  Main script now
	calls process_buses once instead of process_buses_of_type in a loop.
	Buses, adapters and devices are now handled consistently.

	* scripts/scan.d/31bus_device_tree:
	Renamed function list_buses to list_buses_of_type, which now adds the buses to
	$bus_list.  New function list_buses handles all buses types.  add_bus
	now sets $ds instead of taking it as a parameter.

	* scripts/scan.d/20sysfs: In list_adapters, $f is local.

	* scripts/tidy_lsvpd_dbs.in:
	Do sanity checks on values of $db_prefix and $vardir.  Also do sanity
	check to ensure a database exists after (possibly) running
	update-lsvpd-db.  Use [ -L ... ] instead of [ -h ... ] for
	consistency.  Added functionality to remove old database archives and
	associated symlinks, ensuring that at least 10 archives are kept and
	nothing less than a month old is removed.  Remove old
	/var/lib/device-tree if it exists.  Remove dodgy
	/var/lib/lsvpd/device-tree-0000-00-00-00:00:00 link if it exists.  If
	enough db archives exist then remove /var/lib/lsvpd/-device-tree-*
	directories and any associated symlink.  Ensure 0 exit status.

2005-05-06  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	sysfs_fw_version_vpd_hook now checks for 2 class attributes:
	"fw_version" and "fwrev".

	* src/scsivpd.conf:
	For IBM enclosures, changed unknown 8 bytes at offset 36 to be SN.

2005-05-05  Martin Schwenke  <martins@rover>

	* docs/lsvio.xml: Fixed typo: -s -> -e.

	* docs/update-lsvpd-db.xml, docs/lscfg.xml, docs/lsmcode.xml, docs/lsvpd.xml:
	Added lsvio(8) to SEE ALSO.

	* docs/Makefile: Added lsvio.8 to MANPAGES.

	* docs/lsvio.xml: New file.

	* scripts/scan.d/20sysfs: Added sound to sysfs_list_adapters_pci.

	* scripts/scan.d/00pci: Added sound to pci_check_class.

	* scripts/lscfg.d/00minimal:
	lscfg_render_vpd_value now also fills MF fields, wrapping on spaces.

2005-05-04  Martin Schwenke  <martins@rover>

	* scripts/scan.d/27device_sysfs:
	New function sysfs_get_device_link.  get_kernel_device_name_DEFAULT
	reimplemented using sysfs_get_device_link.
	get_kernel_device_name_DEFAULT also now includes hack to rename sr
	devices to scd.

	* scripts/lsmcode.d/41ibm_serv_config: New file.

	* scripts/lsmcode.d/00minimal:
	New function lsmcode_get_current_firmware just sets
	lsmcode_current_firmware to "b".  lsmcode_render_sys_vpd now calls
	lsmcode_get_current_firmware to indicate the current firmware image.

	* scripts/lsvpd_test.in: Added support for lsvio.

	* src/vpd.h: Added declaration for vpd_list_maybe_prepend_key_string.

	* src/vpd.c:
	In vpd_dir_get_subdirnum, added check to ensure dir is not NULL.
	vpd_list_maybe_prepend_key_string is no longer static.

	* lsvpd.spec.in: Added lsvio to file list.

2005-05-03  Martin Schwenke  <martins@rover>

	* scripts/lsvpd.d/40ibm,vpd: Bumped copyright.

	* scripts/lsvpd.d/40ibm,vpd:
	Added environment variable $LSVPD_LIST_BUILTIN to force listing of
	builtin adapters on planar 1.

2005-04-28  Martin Schwenke  <martins@rover>

	* scripts/lsmcode.d/40ibm,vpd:
	should_render calls renamed lsmcode_should_render and lsmcode_is_sys.

	* scripts/lsmcode.d/00minimal:
	New functions usage, process_options, render_all, render_linux_vpd,
	lsmcode_is_sys, lsmcode_is_service_processor, lsmcode_render_vpd,
	lsmcode_render_sys_vpd, lsmcode_render_other_vpd moved here from main
	lsmcode.in script, some with added "lsmcode_" prefix.
	should_render_lsmcode renamed to lsmcode_should_render.

	* scripts/lscfg.d/40ibm,vpd:
	ibm_vpd_handle_specials and ibm_vpd_maybe_render_header call renamed
	functions with "lscfg_" prefix.

	* scripts/lscfg.d/30device-tree, scripts/lscfg.d/00minimal, scripts/common.d/30device-tree:
	Bump copyright.

	* scripts/lscfg.d/30device-tree:
	In dt_platform_specific_vpd_line, renamed calls to functions by
	prefixing with "lscfg_".

	* scripts/lsvpd.d/00minimal: New file.

	* scripts/lsvpd-functions.bash:
	New function process_db_path_options.  The trap in
	unpack_device_tree_archive that causes the unpacked database to be
	removed now redirects stderr to /dev/null - there seems to be a
	harmless race condition in there somewhere.

	* scripts/lsvpd.in:
	This is now the main script for all the query commands.  All the
	command-specific logic is now in the command-specific module
	directories, usually in 00minimal.  Changes mostly involved moving
	function out, but some logic was rewritten to support modularising the
	options processing code.  Options that change the database path are
	now handled by the generic function process_db_path_options and should
	be ignored by the individual process_options() functions.

	* scripts/lsvio.d/00minimal: New file.

	* scripts/lscfg.d/00minimal:
	New functions usage, process_options, print_global_header, render_all,
	render_linux_vpd, lscfg_disk_size, lscfg_fill_field,
	lscfg_render_header, lscfg_render_vpd, lscfg_render_vpd_line,
	lscfg_render_vpd_value - all moved here from main lscfg script, some
	renamed with "lscfg_" prefix.  Also added various $lscfg_* variables
	related to output wrapping.

	* scripts/query.d/00minimal:
	New stub functions usage, process_options, print_global_header.  New
	functions render_all and render_all_basic, moved here from query
	commands.

	* scripts/lsvio.d/30device-tree: New file.

2005-04-26  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Moved setting of $sysfs_dir back here, removing need for
	../common.d/20sysfs.

2005-04-06  Martin Schwenke  <martins@rover>

	* scripts/tidy_lsvpd_dbs.in:
	Check for actually database directory/symlink instead of just
	$vardir.  Don't hardcode $vardir or "db", but source enough stuff so
	we can run do_setup (without any args).

2005-02-24  Martin Schwenke  <martins@rover>

	* Makefile: Changed VERSION to 0.12.7.

	* src/scsivpd.conf:
	Split IBM CD-ROMs into known pure SCSIs and the rest that (we assume)
	use SCSI -> IDE converters.

2005-02-23  Martin Schwenke  <martins@rover>

	* README: Added Keith as a maintainer.

	* docs/update-lsvpd-db.xml: Added bugs section about Linux 2.4.

	* docs/lsmcode.xml, docs/lscfg.xml, docs/lsvpd.xml:
	Replaced references to /var/lib/lsvpd/device-tree with
	/var/lib/lsvpd/db.  Added bugs section about Linux 2.4.

	* docs/Makefile: Changed ../INSTALL to do different substitution for <.

	* docs/install.xml, docs/design.xml:
	Updated to reflect more recent reality.

	* src/scsivpd.conf:
	For IBM CD-ROMs, loosened RMBO0020311 to just match on RMBO0020.

	* src/scsivpd.conf: ZM becomes UL (Keith Matthews <keith@au1.ibm.com>).

	* src/proc_pci.c:
	Cleaned up type of proc_pci_line_scanner to avoid cast in
	proc_pci_file.

	* src/pci_ethernet.c:
	Cleaned up type of pci_ethernet_line_scanner to avoid cast in
	pci_ethernet_file.

	* src/vpd.h: New functions vpd_dir_get_subdirnum, vpd_dir_get_default,
	vpd_dir_field_ensure.  Formatting changes.

	* src/vpd.c:
	Added some #defines for common strings linux,vpd and .lsvpd.  Cleaned
	up logic in many functions to make them more readable.  Renamed
	function vpd_append_key_to_keys_file to
	vpd_dir_append_string_to_keys_file and change type of 2nd arg to
	arbitrary string.  Pretty much rewrote vpd_key_value_to_vpd_dir.  Use
	of build_relative_filename in several places to make things clearer.
	New functions vpd_dir_get_subdirnum, vpd_dir_get_default,
	vpd_dir_field_add_to_keys_file, vpd_dir_field_ensure.

2005-02-18  Martin Schwenke  <martins@rover>

	* src/util.c: Rewrote file_write_contents.

	* src/util.c, src/util.h, src/proc_pci.c, src/pci_ethernet.c:
	3rd argument to line_scanner_harness is now only (void *).

	* src/scsivpd.conf: Added comment about U? field.

	* src/scsivpd.conf:
	IBM CD-ROMS: weakened DROM002.*, added RMBO0020311, added page 0x83
	for ACARD.

2005-02-17  Martin Schwenke  <martins@rover>

	* src/util.h:
	Function passed to line_scanner_harness now returns bool to indicate
	whether scanning should continue for subsequent lines.
	line_scanner_harness now returns a bool to indicate whether it could
	read the file.  file_relative_read_contents and
	file_relative_write_contents no longer die on error, but return a bool
	and are passed a pointer to an error flag.  Added real argument
	variables to prototypes instead of just using comments.

	* src/util.c:
	Function passed to line_scanner_harness now returns bool to indicate
	whether scanning should continue for subsequent lines.
	line_scanner_harness now returns a bool to indicate whether it could
	read the file.  file_relative_read_contents and
	file_relative_write_contents no longer die on error, but return a bool
	and are passed a pointer to an error flag.

	* src/pci_ethernet.c, src/proc_pci.c:
	Function passed to line_scanner_harness now returns bool to indicate
	whether scanning should continue for subsequent lines.

	* src/util.c: Fixed termination condition in 2nd loop in strndup_trim.

	* src/util.c: Added include for ctype.h.

	* src/util.h, src/util.c: Added strndup_trim.

2005-02-11  Martin Schwenke  <martins@rover>

	* scripts/scan.d/37device_dt:
	New function dt_ide_set_number.  add_device_hook_ide now calls
	dt_ide_set_number to set $number based on $bus_info when setting
	$device_bus_dir.

	* scripts/scan.d/40ibm,loc-code:
	device_set_yl_ide now calls dt_ide_set_number to set $number based on
	$bus_info.

2005-02-09  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Renamed function process_devices_of_type to process_devices and
	changed logic to cope with new-style list_devices function, including
	removal of call to device_setup.  Replaced main device processing loop
	with a call to process_devices.

	* .distfiles:
	New files setup/scan.d/070device, setup/scan.d/27device_sysfs,
	setup/scan.d/37device_dt.

	* scripts/scan.d/27device_sysfs:
	New function sysfs_list_devices, also gets added to new global
	variable $list_devices_functions.

	* scripts/scan.d/20sysfs:
	In function sysfs_list_adapters_pci, added serial to list of types.

	* scripts/scan.d/00pci: Added type serial to pci_check_class.

	* scripts/scan.d/33adapter_dt_nosysfs:
	In function list_adapters, added serial to list of types.

	* scripts/scan.d/07device: device_setup is no longer multiplexed.

	* scripts/scan.d/30device-tree:
	Removed functions add_adapter_display and dt_add_adapter_fake -
	add_adapter_DEFAULT does a better job

	* scripts/scan.d/00minimal:
	In adapter_set_ax_osname_hook_basic, added call to
	adapter_set_minimum_unknown.

2005-02-08  Martin Schwenke  <martins@rover>

	* new/device.c: New file.

2005-01-24  Martin Schwenke  <martins@rover>

	* src/vpd.h: Removed unused definition of struct/typedef vpd_field.

	* src/Makefile: Include stdlib.h at top of list.h.

2005-01-20  Martin Schwenke  <martins@rover>

	* scripts/scan.d/07device:
	list_devices is no loner multiplexed.  New function list_devices calls
	functions in list_devices_functions.

	* scripts/scan.d/07device: New file.

	* scripts/scan.d/00minimal:
	Moved multiplexing of device_set_yl, device_setup, list_devices,
	add_device, add_device_hook, remove_device_hook,
	get_kernel_device_name and definitions of $add_device_hooks,
	add_device_hooks(), add_device_common, device_add_name_and_crosslink,
	device_add_name_and_crosslink_basic, get_device_name,
	get_kernel_device_name_DEFAULT, device_set_yl_DEFAULT,
	device_set_adapter_yl, device_backlink_adapter_bus_dir,
	scsi_parse_addr_hook to 07device_minimal.

2005-01-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/37device_dt: New file.

	* scripts/scan.d/30device-tree:
	Moved add_device_hook_scsi, add_device_hook_ide to new file
	37device_dt.

	* scripts/scan.d/27device_sysfs: New file.

	* scripts/scan.d/20sysfs:
	Moved sysfs_add_device_hook_common, add_device_hook_DEFAULT,
	device_set_yl_DEFAULT, get_kernel_device_name_DEFAULT to new file
	27device_sysfs.

2005-01-18  Martin Schwenke  <martins@rover>

	* .distfiles:
	New files lib/list.h, lib/test_vpd.c, lib/vpd.h, lib/vpd.c,
	pci/pci.vendor.blacklist, pci/pci_vpd_parse.c, pci/pci_vpd_parse.h.
	Removed files pci/pci_vpd_rom_grab.c, pci/pci_vpd_to_txt.c,
	pci/pci_vpd_to_txt.h.

2005-01-17  Martin Schwenke  <martins@rover>

	* Makefile: Changed VERSION to 0.12.6.

	* src/pci_vpd_parse.h, src/pci_vpd_parse.c: New file.

	* src/vpd.h:
	vpd_list_new now takes an extra argument (length).  New functions
	vpd_list_append vpd_list_prepend, vpd_list_prepend_key_value.

	* src/vpd.c:
	vpd_list_new now takes an extra argument (length), has corrected
	return values, no longer uses strdup. vpd_list_new_empty now passes
	length of 0 to vpd_list_new.  vpd_list_append is not static.  New
	functions vpd_list_prepend and vpd_list_prepend_key_value.  Function
	vpd_append_key_to_keys_file no longer returns anything.  Function
	vpd_text_to_vpd_list now calls vpd_list_append_key_value.  Function
	vpd_list_to_vpd_list_list also passes a length to
	vpd_list_append_key_value.

	* src/growbuf.h:
	growbuf_iter_new, growbuf_data and growbuf_length now take a const
	argument.  struct growbuf_iter now has const member buf.

	* src/growbuf.c: growbuf_iter_new now takes a const argument.

	* scripts/scan.d/00pci: New functions pci_get_vendor_id (stub) and
	pci_not_on_vendor_blacklist.  Function pci_do_pci22_vpd now checks
	whether it should retrieve VPD by calling pci_not_on_vendor_blacklist.

	* scripts/scan.d/20sysfs, scripts/scan.d/30device-tree:
	New function pci_get_vendor_id.

	* src/Makefile: Don't remove $GEN on make clean.

	* src/Makefile: Possibly generate list.h, also build $TESTS.

	* src/ibm_vpd_render.c:
	Many changes to support using pci_vpd_parse.[ch] instead of
	pci_vpd_to_txt.[ch].

2005-01-14  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	Added sanity check to device_add_name_and_crosslink_basic to ensure
	that $device_bus_dir is set.

	* src/pci_vpd_cap_grab.c:
	In function vpd_cap_read, added sanity-checks/timeouts to loop that
	waits for VPD ready flag bit to be set.  Also added sanity check to
	make sure the last read in the loop succeeded (and, therefore, the
	loop must have exited because the flag is set).  Minor coding style
	changes.

2004-12-20  Martin Schwenke  <martins@rover>

	* src/vpd.h, src/test/test_vpd.c, src/vpd.c:
	Switched to the kernel's list implementation.

	* src/test/test_vpd.c, src/vpd.h, src/vpd.c: New file.

2004-12-06  Martin Schwenke  <martins@rover>

	* Makefile: Changed VERSION to 0.12.5.

	* scripts/update-vpd.hotplug.in:
	Now set $LSVPD_DEBUG for debugging.  Added case in main for SCSI
	disks.

2004-12-04  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Added a special case in sysfs_pci_quirks_include_ide to handle the
	Promise IDE adapter with PCI class 0x0180.

	* scripts/query.d/00minimal:
	Variables $dynamic_vpd_hooks and $linux_dynamic_vpd, and functions
	on_live_system, should_show_dynamic_vpd, can_cache_vpd,
	should_show_cached_vpd and node_contains_dynamic_vpd moved to
	../common.d/00minimal.

	* scripts/common.d/00minimal:
	Variables $dynamic_vpd_hooks and $linux_dynamic_vpd, and functions
	on_live_system, should_show_dynamic_vpd, can_cache_vpd,
	should_show_cached_vpd and node_contains_dynamic_vpd moved here from
	../query.d/00minimal.

2004-12-03  Martin Schwenke  <martins@rover>

	* Makefile: Changed VERSION to 0.12.4.

	* scripts/vpd-name-crosslink.hotplug.in:
	Now set $LSVPD_DEBUG for debugging.  Added case in main for SCSI
	disks.

2004-12-02  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	adapter_init_node doesn't try to copy to the directory if it already
	exists.

	* scripts/scan.d/00minimal:
	do_adapter_DEFAULT now runs adapter_init_node unconditionally.

	* scripts/common.d/00vpd:
	Added backward compatibility case for old-style link values in
	vpd_field_get.

	* scripts/query.d/00minimal:
	Removed function dynamic_vpd_ok, which was trying to be all things to
	all people and replaced with new functions on_live_system,
	should_show_dynamic_vpd, can_cache_vpd and should_show_cached_vpd.
	Set $LSVPD_DYNAMIC_VPD to "false" if not already set to "true" or
	"false".

	* scripts/common.d/00vpd:
	New function vpd_field_remove_directory.  vpd_field_add_value and
	vpd_field_add_link call vpd_field_remove_directory to ensure it will
	be able to write the value.  vpd_field_add_link now creates "link" in
	a subdirectory and populates cache file "last".  vpd_field_get now
	sets $vpd_value instead of printing value, and handles new "link" in
	directory with "last" cache file.

	* scripts/lscfg.d/30device-tree:
	dt_platform_specific_node checks condition should_show_dynamic_vpd
	rather than dynamic_vpd_ok.

	* scripts/query.d/41rtas_get_ibm_vpd:
	rtas_ibm_get_vpd_hook checks condition can_cache_vpd rather than
	dynamic_vpd_ok.

	* scripts/lscfg.d/30device-tree:
	dt_platform_specific_vpd and dt_platform_specific_node_maybe now
	expect vpd_field_get to set $vpd_value.

	* scripts/lsvpd.in:
	render_linux_vpd_directory now expects vpd_field_get to set
	$vpd_value.

2004-12-01  Martin Schwenke  <martins@rover>

	* .distfiles: Removed setup/query.d/21sysfs_hotplug.  Replaced
	setup/scan.d/01adapter_display_defs,
	setup/scan.d/01adapter_ethernet_defs, setup/scan.d/01adapter_ide_defs,
	setup/scan.d/01adapter_scsi_defs, setup/scan.d/01adapter_usb_defs with
	much simpler setup/scan.d/01adapter_defs.  Added
	setup/scan.d/33adapter_dt_nosysfs, setup/scan.d/33adapter_dt_sysfs and
	setup/scan.d/40ibm,loc-code.

	* src/scsivpd.conf:
	Added ST318305.* and DPSS-309170M to template that knows about ZM
	field (used for LIDs).

2004-11-30  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	add_adapter_DEFAULT added YL to existing VPD before running
	add_adapter_hook, so $yl was unset.  Fixed.

	* scripts/scan.d/30device-tree:
	Moved add_adapter_DEFAULT to 00minimal after much code factoring.  New
	function add_adapter_hook creates built-in property for channel when
	required and calls add_adapter_hook_basic.  Renamed
	dt_do_pci_adapter_hook to add_adapter_pci_hook.

	* scripts/scan.d/20sysfs:
	Moved add_adapter_DEFAULT to 00minimal after much code factoring.
	Renamed sysfs_do_pci_adapter_hook to add_adapter_pci_hook, cleaned up
	code and removed SCSI channel special case (seems to have been
	unused).

	* scripts/scan.d/00minimal:
	add_adapter_hook no longer multiplexed.  add_adapter_hook_DEFAULT
	renamed to add_adapter_hook_basic, and called by new function
	add_adapter_hook.  Moved add_adapter_DEFAULT here from 20sysfs and
	30device-tree after much code factoring.  bus_alias_set now returns 0
	if it actually created the alias, 1 otherwise.

	* scripts/scan.d/33adapter_dt_nosysfs:
	In list_adapters_of_type, if this is a channel and bus_alias_set
	succeeds then also call dt_adapter_crosslink and add to adapter_list.

	* src/pci_scsi.c:
	In function hack_doms, use variable t in comparisons, not l.

2004-11-29  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Fixed channel naming in adapter_set_ax_osname_hook - tweaking for real
	subchannels broke the IDE-style pseudo channel naming.

	* scripts/update-lsvpd-db.in:
	Removed function process_adapters_of_type, replacing it with new
	function process_adapters, which processes all adapters.

	* scripts/scan.d/00minimal:
	Removed add_adapter_crosslink_basic and folded functionality back into
	add_adapter_crosslink.

	* scripts/scan.d/30device-tree:
	Removed add_adapter_crosslink - it had degenerated to being the same
	as the default version.

	* scripts/scan.d/00minimal:
	adapter_set_ax_osname_hook no longer multiplexed, so renamed
	adapter_set_ax_osname_hook_DEFAULT to adapter_set_ax_osname_hook_basic
	and made new function adapter_set_ax_osname_hook call it.  Removed
	adapter crosslinking code from add_adapter_name_and_crosslink.

	* scripts/scan.d/30device-tree:
	adapter_init_node now actually sets variable $bus_addr.  Removed
	channel cross-linking code from add_adapter_crosslink.  Moved
	declaration of multiplexed functions dt_list_adaptes_setup and
	dt_adapter_crosslink, and function definitions of
	list_adapters_DEFAULT list_adapters_scsi, list_adapters_ethernet,
	list_adapters_ide, set_adapter_bus_dir and dt_set_bus_info_hook to
	33adapter_dt_nosysfs (before rewriting the list_adapters*
	functionality).  Added a case for Serial ATA adapters in
	adapter_set_ds_scsi.  dt_mac_address_vpd_hook now tries
	local-mac-address property if mac-address property isn't there or is
	empty.  New multiplexed function get_dt_adapter_types, with new
	implementations get_dt_adapter_types_DEFAULT,
	get_dt_adapter_types_scsi, get_dt_adapter_types_ethernet,
	get_dt_adapter_types_ide.

	* scripts/scan.d/33adapter_dt_sysfs:
	New function dt_sysfs_add_channels added to
	$sysfs_last_chance_pci_channels_hooks.  Minor code cleanup in
	set_adapter_bus_dir.

	* scripts/scan.d/20sysfs:
	adapter_init_node no longer does anything special for IDE channels -
	in fact, it now just returns if $bus_info has a channel.
	list_adapters is no longer multiplexed and now lists all adapters,
	preceeding them with "$type@", and putting them in $adapter_list.
	Removed functions list_adapters_DEFAULT, list_adapters_scsi,
	list_adapters_ide.  New function list_adapters, which runs all
	functions in $sysfs_list_adapter_functions.  New functions
	sysfs_list_adapters_pci, sysfs_list_adapters_scsi_debug,
	sysfs_list_adapters_ide_scsi, sysfs_list_adapters_veth,
	sysfs_list_adapters_scsi added to $sysfs_list_adapter_functions.
	sysfs_list_adapters_pci calls new functions
	sysfs_list_adapter_pci_channels, sysfs_last_chance_pci_channels_hook
	(uses $sysfs_last_chance_pci_channels_hooks) and new multiplexed
	functions sysfs_pci_quirks_include and sysfs_pci_quirks_exclude
	(supported by new functions sysfs_pci_quirks_include_DEFAULT,
	sysfs_pci_quirks_exclude_DEFAULT, sysfs_pci_quirks_include_ide,
	sysfs_pci_quirks_include_scsi, sysfs_pci_quirks_exclude_ide and
	sysfs_pci_adapter_is_sata.  sysfs_list_adapters_ibmveth and
	sysfs_list_adapters_ibmvscsi supported by new function
	sysfs_list_adapters_by_driver.  adapter_set_ax_osname_hook is no
	longer multiplexed: removed sysfs_default_set_ax_osname_hook,
	adapter_set_ax_osname_hook_scsi, adapter_set_ax_osname_hook_ide,
	adapter_set_ax_osname_hook_ethernet, adapter_set_ax_osname_hook_usb;
	replaced with new function adapter_set_ax_osname_hook.
	set_adapter_bus_dir no longer contains channel-specific code.
	add_adapter_DEFAULT now runs sysfs_do_pci_adapter_hook only if not a
	channel and if the bus_type is exactly equal to "pci" (no longer a
	pattern match). Also add_adapter_DEFAULT only rnus
	adapter_extra_vpd_hook if not a channel.  sysfs_fw_version_vpd_hook
	now calls get_sysfs_class_attribute instead of
	sysfs_set_class_property and expects to be set, since
	get_sysfs_class_attribute now sets $sysfs_class_attribute instead of
	$class_property.  In adapter_set_ds_scsi, added a case for Serial ATA
	adapters.  device_set_yl_DEFAULT now attempts to strip a channel from
	$adapter_yl.  set_sysfs_node_hook now calls get_sysfs_bus_type instead
	of doing vdevice -> vio mapping directly.  New function
	get_sysfs_bus_type.

2004-11-26  Martin Schwenke  <martins@rover>

	* scripts/lsvpd-functions.bash:
	lock_file now has a sanity check that should catch the case where
	dirname($file) doesn't exist.

	* scripts/scan.d/33adapter_dt_sysfs, scripts/scan.d/33adapter_dt_nosysfs:
	New file.

	* scripts/scan.d/40ibm,loc-code:
	Removed trailing space after backslash in module load check.

	* scripts/scan.d/41ibm,converged-loc-codes:
	Module load check no longer checks for pci/ibm,loc-code, since some
	LPARs don't have PCI - now just check for ibm,converged-loc-codes.

	* scripts/scan.d/40ibm,loc-code:
	Module load check now checks for ibm,loc-code at top level of
	device-tree or for ibm,converged-loc-codes.

2004-11-24  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00pci: pci_check_class now checks for unknown/ff00.

2004-11-23  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	New function list-adapters_ide, calls list_adapters_DEFAULT for both
	"ide" and "ata-6".  adapter_set_ds_scsi has special case for
	"*k2-sata*".

	* scripts/scan.d/20sysfs:
	unset add_adapter_ide function, since our version is better.  In
	set_sysfs_adapter_class, default is null string, and no longer handle
	type "ide".  set_sysfs_node_hook completely rewritten - now works for
	arbitrary types.

	* scripts/lsvpd-functions.bash:
	Minimised debug in functions multiplex and make_multiplexed - it is
	all fairly self-evident when tracing.

2004-11-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/40ibm,loc-code:
	In device_set_yl_scsi and device_set_yl_ide, add a final test to check
	if $yl is set.  device_set_yl_ide was sometimes returning a failure
	even though dt_device_set_yl_common has succeeded.

	* scripts/query.d/41rtas_get_ibm_vpd:
	In rtas_ibm_get_vpd_hook, wrap execution of rtas_ibm_get_vpd in
	debug_cmd.

	* scripts/scan.d/30device-tree:
	Removed function dt_add_device_hook_post, unrolling functionality back
	into add_device_hook_scsi and add_device_hook_ide.
	add_device_hook_ide now plays save-and-restore games with $bus_info.
	Removed function dt_hack_ide_hook - as the name suggested, it was a
	bad way of doing things.

	* scripts/scan.d/40ibm,loc-code:
	In device_set_yl_scsi, call dt_device_set_yl_common with explicit
	"scsi" argument instead of beating around the bush.  Similarly for
	device_set_yl_ide, which also now uses the "number" part of $bus_info.

	* scripts/scan.d/30device-tree:
	New function dt_mac_address_vpd_hook, which gets added to
	adapter_extra_vpd_hooks.

	* scripts/scan.d/21sysfs_hotplug:
	sysfs_add_device_bus_alias now removes =* from $bus_info.

	* scripts/scan.d/45adapter_pci_chiprev:
	pci_chiprev_extra_vpd_hook now also accepts $adapter_bus_dir as an
	argument.

2004-11-18  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	fw_version_vpd_hook renamed to sysfs_fw_version_vpd_hook, now also
	accepts $adapter_bus_dir as an argument.

	* scripts/common.d/00vpd:
	adapter_extra_vpd_hook now also passes $adapter_bus_dir.

	* scripts/scan.d/20sysfs:
	fw_version_vpd_hook calls renamed function sysfs_set_class_property,
	which now sets $class_property.

	* scripts/update-lsvpd-db.in:
	Use $LSVPD_DEBUG, not $debug... and don't default it to false - so it
	can be set in the calling environment.

	* scripts/debug.bash:
	Check environment variable $LSVPD_DEBUG rather than local $debug.

	* scripts/lsvpd-functions.bash: Removed function readlink.

	* scripts/lsvpd_test.in: Removed use of readlink.

	* scripts/scan.d/20sysfs:
	New functions add_default_hook_DEFAULT and device_set_yl_DEFAULT.  In
	function set_sysfs_node_hook, removed use of readlink.

	* scripts/scan.d/21sysfs_hotplug:
	In hotplug_add_device and hotplug_name_and_crosslink, removed use of
	readlink... also set $t to empty if lsvpd,os-node can't be followed.

	* scripts/scan.d/30device-tree:
	add_device_hook_ide doesn't use adapter_bus_dir.

	* scripts/update-lsvpd-db.in:
	process_device_of_type no longer expects add_device to set
	device_bus_dir and adapter_os_dir - device_add_name_and_crosslink now
	uses the lsvpd,adapter-bus-node backlink to determine those things.

	* scripts/scan.d/41ibm,converged-loc-codes:
	Added check for ibm,loc-code to module load condition.
	dt_device_yl_hook now only uses $adapter_yl and s passed $id and
	$subid.

	* scripts/scan.d/31bus_device_tree:
	add_bus now calls bus_set_yl instead of dt_manufacture_yl_hook.

	* scripts/scan.d/21sysfs_hotplug:
	sysfs_add_device_bus_alias now followed lsvpd,os-node rather than
	linux,os-node and no longer uses a subshell to determine physical
	directory - uses "cd -P ... ; $PWD" hack instead.
	hotplug_name_and_crosslink vastly simplified, mostly due to use of
	lsvpd,adapter-bus-node backlink in
	device_add_name_and_crosslink_basic.

	* scripts/scan.d/40ibm,loc-code: New file.

	* scripts/scan.d/30device-tree:
	In db_initialise_bus, execution of cp wrapped in a debug_cmd.  Removed
	bash-ism (==) from adapter_init_node.  Took out an extraneous call to
	ensure_directory from add_adapter_crosslink - this is now done in
	cross_link.  list_adapters_scsi now tries to list adapters of type
	"k2-sata" (for G5 Mac).  set_adapter_bus_dir now calls updated version
	of bus_alias_get.  In function add_adapter_DEFAULT, moved call to
	add_adapter_hook further down in the code, so it isn't called
	unnecessarily.  Removed functions add_adapter_hook_DEFAULT,
	add_adapter_hook_scsi, add_adapter_hook_ethernet - indirectly replaced
	with adapter_set_ds_scsi and adapter_set_ds_ethernet.
	add_device_hook_scsi and add_device_hook_ide no longer set
	$adapter_os_dir and have much neater interface through to
	dt_add_device_hook_post (which now only uses $bus_info and
	$device_bus_dir) (although had to add new function dt_device_yl_hook
	to support this).  add_device_hook_scsi now checks for "k2-sata" in
	multi-channel code.  dt_add_device_hook_post no longer calls uses
	pseudo_realpath and now calls device_backlink_adapter_bus_dir and
	device_set_yl.  dt_device_yl_hook and dt_manufacture_yl_hook moved to
	40ibm,loc-code.  dt_set_bus_info_hook now checks for "ht" as well as
	"pci".

	* scripts/scan.d/20sysfs:
	list_adapters_DEFAULT now calls sysfs_set_pci_class instead of
	sysfs_get_pci_class.  sysfs_default_set_ax_osname_hook,
	set_adapter_bus_dir, set_sysfs_node_hook and sysfs_get_class_property
	call updated bus_alias_get.  sysfs_default_set_ax_osname_hook and
	set_sysfs_node_hook call updated set_sysfs_adapter_class instead of
	updated sysfs_get_adapter_class.  Removed functions
	add_adapter_hook_scsi and add_adapter_hook_ide - indirectly replaced
	with new functions adapter_set_yl_DEFAULT, adapter_set_ds_scsi.
	sysfs_add_device_hook_common now only sets $device_bus_dir, but also
	now calls device_backlink_adapter_bus_dir.  add_adapter_DEFAULT and
	sysfs_add_device_hook_common no longer do pseudo handling for $yl -
	this has been relegated to adapter_set_yl_DEFAULT.  New function
	get_kernel_device_name_DEFAULT.  sysfs_get_adapter_class replaced by
	new function set_sysfs_adapter_class.  set_sysfs_node_hook no longer
	calls readlink and pseudo_realpath, but does "cd -P ... ; $PWD" hack
	instead.  sysfs_get_pci_class renamed to sysfs_set_pci_class, and now
	sets $pci_class.

2004-11-17  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00pci:
	pci_check_class is no longer multiplexed - all checking is now done by
	a single top-level function.  Removed functions pci_get_hack_list and
	pci_hack_dom_bus_hook (finally!).

	* scripts/scan.d/00minimal:
	New multiplexed functions bus_set_yl, adapter_set_yl, device_set_yl.
	Removed multiplexed functions get_adapter_os_prefix,
	get_adapter_output_prefix, get_adapter_subdir, get_adapter_ds.  New
	stub functions bus_set_yl_DEFAULT, adapter_set_yl_DEFAULT, .
	add_adapter_hook_DEFAULT is now common code, and includes calls to
	adapter_set_ds and adapter_set_yl.  adapter_set_ax_osname_hook_DEFAULT
	no longer calls readlink, but does "cd -P ... ; $PWD" hack.
	adapter_set_ax_osname_hook_DEFAULT, adapter_set_ax_from_osname_hook
	now call adapter_set_output_prefix instead of
	get_adapter_output_prefix.  add_device_hook_common no longer sets
	$adapter_os_dir and now calls now call adapter_set_adapter_subdir
	instead of get_adapter_subdir.  add_device_name_and_crosslink renamed
	to device_add_name_and_crosslink - now table more sensible arguments
	and uses lsvpd,adapter-bus-node to help find $adapter_os_dir.  New
	function device_add_name_and_crosslink_basic to support this.
	get_device_name now sets $device_name instead of printing it.  New
	stub function get_kernel_device_name_DEFAULT helps this along.  New
	stub function device_set_yl_DEFAULT.  New function
	device_set_adapter_yl sets $adapter_yl using lvpd,adapter-bus-node,
	given $type and $device_bus_dir.  New function
	device_backlink_adapter_bus_dir, creates lsvpd,adapter-bus-node.
	Updated add_adapter_crosslink_basic to use adapter_set-adapter_subdir.
	Function cross_link now assumes both arguments are realpaths, OS node
	link is now called lsvpd,os-node (instead of linux,os-node) and added
	calls to function ensure_directory.  Removed function
	pseudo_realpath.  Returned function bus_alias_get to this file.

2004-11-05  Martin Schwenke  <martins@rover>

	* scripts/scan.d/21sysfs_hotplug:
	In hotplug_remove_device and hotplug_name_and_crosslink, use changed
	bus_alias_get that sets $bus_alias.

	* scripts/common.d/00minimal:
	Removed unused function vpd_exists.  Moved functions vpd_dir_set_hook,
	vpd_subdirs_list_hook, vpd_fields_list_hook and vpd_field_get to
	00vpd.  Moved function wait_for_node to scan.d/21sysfs_hotplug.  Moved
	function bus_alias_get back to scan.d/00minimal.

	* scripts/common.d/00vpd:
	Moved functions vpd_dir_set_hook, vpd_subdirs_list_hook,
	vpd_fields_list_hook and vpd_field_get from 00minimal.

	* scripts/scan.d/21sysfs_hotplug:
	Moved function wait_for_node to here from common.d/00minimal.

	* scripts/scan.d/21sysfs_hotplug:
	In hotplug_name_and_crosslink, removed use of pseudo_realpath.

	* scripts/scan.d/21sysfs_hotplug:
	Function sysfs_add_device_bus_alias is no longer multiplexed.

2004-10-29  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	get_adapter_bus_dir becomes set_adapter_bus_dir, which is a hook that
	sets $adapter_bus_dir.  Modified various functions to use
	set_adapter_bus_dir and $adapter_bus_dir.

	* scripts/scan.d/20sysfs:
	Fixed a harmless bug in get_adapter_bus_dir and renamed it to
	set_adapter_bus_dir, which is a hook that sets $adapter_bus_dir.
	Modified various functions to use set_adapter_bus_dir and
	$adapter_bus_dir.  Removed case statement with type-specific code from
	list_adapters_DEFAULT and created new functions list_adapters_scsi and
	list_adapters_ide.

	* scripts/scan.d/30device-tree:
	get_adapter_bus_dir becomes set_adapter_bus_dir, which is a hook that
	sets $adapter_bus_dir.  Modified various functions to use
	set_adapter_bus_dir and $adapter_bus_dir.

	* scripts/update-lsvpd-db.in, scripts/scan.d/00minimal, scripts/scan.d/30device-tree, scripts/scan.d/20sysfs:
	Renamed functions do_adapter_* to add_adapter_*.

2004-10-27  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.12.3.

2004-10-25  Martin Schwenke  <martins@rover>

	* .distfiles:
	New files setup/lsmcode.d/00minimal and setup/lsmcode.d/40ibm,vpd.

	* scripts/lsmcode.d/40ibm,vpd:
	should_render now calls should_render_lsmcode, where the basic
	functionality has been factored out to.

	* scripts/lsmcode.d/00minimal: New file.

	* scripts/query.d/30device-tree:
	Removed intermediate function dt_list_linux_vpd - this was the only
	place it was being called.  list_linux_vpd now calls
	list_linux_vpd_basic directly.

	* scripts/query.d/00minimal:
	New functions should_render and should_render_basic.
	list_linux_vpd_basic no longer forces a redundant "/." into the find
	command and resulting output.

	* scripts/lsvpd.d/40ibm,vpd:
	Removed setting of global $device_tree_device_type - it is now in
	setup/query.d/30device-tree.  Removed function list_linux_vpd and
	replaced functionality with new function should_render.

	* scripts/lsvpd.in: In render_linux_vpd_directory, call should_render.

	* scripts/query.d/30device-tree:
	Moved setting of global $device_tree_device_type from
	setup/lscfg.d/30device-tree.

	* scripts/lscfg.d/30device-tree:
	Moved setting of global $device_tree_device_type to
	setup/query.d/30device-tree.

	* scripts/lsmcode.d/40ibm,vpd: New file.

	* scripts/lscfg.d/40ibm,vpd:
	New function should_render, adapted from lscfg.in, replaces
	functionality from removed function list_linux_vpd.
	ibm_vpd_handle_specials and ibm_vpd_maybe_render_header changed to use
	4 argument version of should_render.

	* scripts/update-lsvpd-db.in:
	process_adapters_of_type no longer calls adapter_setup - this function
	no longer exists.

	* scripts/scan.d/20sysfs:
	Removed unset of adapter_setup_* - these functions no longer exist
	anyway.

	* scripts/scan.d/00minimal:
	Removed multiplexed function do_adapter_setup.

	* .distfiles:
	Renamed lib/util.h to lib/util.h.in.  Added pci/make_proc_pci_class,
	pci/pci_ethernet.c, pci/pci_ethernet.h, pci/pci_ethernet_map.c,
	pci/pci_scsi.c, pci/pci_scsi.h, pci/pci_scsi_map.c, pci/proc_pci.c,
	pci/proc_pci.h.  Renamed scsi/scsi_vpd_render.c.in to
	scsi/scsi_vpd_render.c.  Removed setup/scan.d/03adapter_scsi_proc and
	setup/scan.d/05adapter_ethernet_ethtool, replaced with
	setup/scan.d/33adapter_ethernet_dt_nosysfs and
	setup/scan.d/33adapter_scsi_dt_nosysfs.  Added new file,
	setup/scan.d/33adapter_ide_dt_nosysfs that replaces some functionality
	from setup/scan.d/03adapter_ide_proc.

2004-10-22  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	dt_add_device_hook_post no longer accepts any arguments: id, subid,
	id_hex and subid_hex are just used, and device_type is no longer
	needed, also no longer sets device_bus_dir, just uses it.
	add_device_hook_scsi and add_device_hook_ide now set device_bus_dir
	directly and also set id, subid, id_hex, subid_hex.
	add_device_hook_ide uses new variable $number.  dt_device_yl_hook now
	checks to see if subid_hex is non-empty.

2004-10-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	New multiplexed functions dt_list_adapters_setup and
	dt_adapter_crosslink.  list_adapters_DEFAULT now calls these functions
	as appropriate - will replace function adapter_setup (corresponding
	files will be removed after testing).  get_adapter_bus_dir no longer
	does any address -> device-tree node calculations - it simply does a
	bus_alias_get and depends on list_adapters_DEFAULT to set the bus
	alias(es).  As a result of this, the functions following functions
	have been removed: dt_check_bus_range, dt_check_bus_num,
	dt_check_pci_domain, dt_get_pci_adapter_relnode.

	* src/pci_scsi.h: New file.

2004-10-15  Martin Schwenke  <martins@rover>

	* src/pci_ethernet.h:
	New #define PCI_ETHERNET_HWADDR_LEN, used in struct instead of
	hardcoded 6.

	* src/pci_ethernet.c:
	In pci_ethernet_printf and pci_ethernet_line_scanner, use
	PCI_ETHERNET_HWADDR_LEN instead of hardcoded 6.

2004-10-14  Martin Schwenke  <martins@rover>

	* src/pci_scsi.c: New file.

	* src/util.c, src/util.h:
	line_scanner_harness no longer returns a value, but takes a pointer to
	a result.

	* src/proc_pci.c:
	In proc_pci_file, line_scanner_harness no longer returns a value, but
	takes a pointer to a result.

	* src/pci_ethernet.c:
	In pci_ethernet_file, line_scanner_harness no longer returns a value,
	but takes a pointer to a result.

	* src/Makefile:
	Removed references to old vpd_common.* and added a dependency for
	building util.h from util.h.in.

	* src/util.h: Added #define for LSVPD_LIBDIR.  Renamed to util.h.in.

2004-10-13  Martin Schwenke  <martins@rover>

	* src/pci_ethernet.c:
	Replaced ethernet_list_free with pci_ethernet_free, and removed
	ethernet_list_get.  Merged ethernet_list_line_scanner into
	pci_ethernet_line_scanner.

	* src/pci_ethernet.h:
	Removed struct ethernet_list, struct pci_ethernet now has name and
	next fields.  Replaced ethernet_list_free with pci_ethernet_free, and
	removed ethernet_list_get.  New #define PCI_ETHERNET_NODOM.

2004-10-12  Martin Schwenke  <martins@rover>

	* src/proc_pci.h: Re-added extern for function proc_pci_class.

2004-10-07  Martin Schwenke  <martins@rover>

	* src/pci_ethernet.c, src/pci_ethernet.h: ethernet_pci -> pci_ethernet.

	* src/proc_pci.c:
	proc_pci_list_new and proc_pci_line_scanner are static.

	* src/proc_pci.h:
	Don't declare proc_pci_list_new or (non-existent) proc_pci_class.
	Declare proc_pci.

	* src/proc_pci.c:
	Function proc_pci now accepts no arguments, and passes filename to
	proc_pci_file - this is for easier testing.  main is now surrounded by
	#if 0.

	* src/pci_ethernet.c: Change filename in comment.  Comment out main.

	* src/pci_ethernet.c:
	ethernet_list_line_scanner and ethernet_pci now close file descriptors
	return by socket(2).

	* src/pci_ethernet.h: New file.

	* src/pci_ethernet.c:
	Removed #if 0 alternate defintion for ethernet_list_get.

	* src/pci_ethernet.c: New file.

2004-10-05  Martin Schwenke  <martins@rover>

	* src/proc_pci.h: New file.

	* src/proc_pci.c: Moved line_scanner_harness to ../lib/util.c.

	* src/util.c:
	Most logic from read_file_contents moved to new function read_to_eof.
	New function line_scanner_harness.

	* src/util.h: Added line_scanner_harness.

	* src/proc_pci.c:
	New function proc_pci_list_new, now used in proc_pci_line_scanner.

2004-09-30  Martin Schwenke  <martins@rover>

	* src/proc_pci.c:
	Removed monolithic definition of proc_pci (actually xproc_pci) in
	favour of definition using line_scanner_harness.

	* src/proc_pci.c: New file.

2004-09-22  Martin Schwenke  <martins@rover>

	* scripts/lsvpd.d/40ibm,vpd: New file.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, if looking at a channel and the parent is
	built-in, then mark the channel as built-in too.

	* .distfiles:
	New files setup/lsvpd.d/40ibm,vpd and setup/scan.d/31bus_device_tree.

	* scripts/update-lsvpd-db.in:
	New function process_buses_of_type.  process_adapters_of_type no
	longer uses $num.  Main now handles PCI and ISA buses.

	* scripts/scan.d/31bus_device_tree: New file.

	* scripts/lsvpd-functions.bash:
	New functions lock_file and unlock_file.

	* scripts/scan.d/00minimal:
	New function set_sequence_number_hook maintains persistent (within
	current database session) sequence numbers for the given prefix (and
	optional initial value).  This means hotplug of adapters and buses
	should work properly.  adapter_set_ax_osname_hook_DEFAULT no longer
	uses/sets $num, but calls set_sequence_number_hook_instead.  New
	(stub) functions list_buses and add_bus.

	* src/tdump.c:
	Cleaned up options logic, added braces to get rid of warning.

	* src/tdump.c: Oops, getopt returns an int.

2004-09-20  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/40ibm,vpd:
	do_post_items no longer handles PCI and ISA buses.

	* src/scsivpd.conf:
	Added IBM VSCSI disks. Use ZZ for the unknown useful information for
	now - need to investigate further.

	* scripts/scan.d/30device-tree:
	Added listing of "v-scsi" adapters to list_adapters_scsi.

2004-09-17  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	Changes to support virtual I/O devices (only implemented ethernet so
	far): new function list_adapters_ethernet, lists ethernet adapters of
	types ethernet and l-lan; renamed function dt_get_bus_info to
	dt_set_bus_info_hook to avoid unnecessary fork and to be able to cache
	$dt_pci_domain_prop; renamed dt_pci_domain_prop to
	set_dt_pci_domain_prop_hook for extra efficiency; in
	dt_set_bus_info_hook, added cases for vdevice.

	* scripts/scan.d/20sysfs:
	In set_sysfs_node_hook, in the scsi|ethernet|usb case, set
	$sysfs_bus_type to $bus_type unless it is "vdevice", which gets mapped
	to vio.

2004-09-16  Martin Schwenke  <martins@rover>

	* src/tdump.c:
	Now accepts -c (compact - no spaces) and -s (string to hexdump is on
	command line).  Option handling logic now uses getopt plus sanity
	checks.

2004-09-14  Martin Schwenke  <martins@rover>

	* .distfiles:
	Added setup/common.d/20sysfs and setup/query.d/21sysfs_hotplug.

2004-09-13  Martin Schwenke  <martins@rover>

	* scripts/scan.d/21sysfs_hotplug:
	Added some debug to hotplug_add_device, hotplug_remove_device,
	hotplug_name_and_crosslink, which is currently commented out.  In
	hotplug_remove_device, explicitly dereference $device_bus_dir.  In
	hotplug_name_and_crosslink added walk backwards up from
	$device_bus_dir to find $adapter_bus_dir - need to fix this by
	dropping a link to $adapter_bus_dir in $device_bus_dir.

	* scripts/scan.d/00pci:
	Renamed function pci_get_bus_dev_fun_irq_type_list to
	pci_get_hack_list and made these changes: declared local variables mem
	and line, output now includes memory information - the latter involved
	some restructuring.  In function pci_hack_dom_bus_hook, cache variable
	name changed from pci_bus_dev_fun_irq_type_list to pci_hack_list.

	* scripts/scan.d/20sysfs:
	Setting of $sysfs_dir moved to common.d/20sysfs.

	* scripts/scan.d/00minimal: bus_alias_get moved to common.d/00minimal.

	* scripts/common.d/00minimal:
	bus_alias_get moved here from scan.d/00minimal.

	* scripts/common.d/20sysfs: New file.

2004-08-31  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal, scripts/common.d/00minimal:
	Moved function wait_for_node from scan.d to common.d.

	* Makefile:
	Add hotplug scripts, moved TARBALLS to DIST/PRE, bump version to 0.12.1.

2004-08-26  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	do_adapter_hook_scsi now needs to do a dirname/basename combination to
	determine $yl.  Added case for display in set_sysfs_node_hook.

	* scripts/scan.d/20sysfs:
	sysfs_get_class_property updated in line with changes to set_sysfs_node_hook.

	* scripts/common.d/00minimal:
	vpd_field_get no longer gets symlinked fields in offline mode.

	* src/ibm_vpd_render.c:
	In dump_field add hack to always include DS field, even if value
	contains unprintables.

	* scripts/Makefile: Added common-post.d to $DATADIRS.

	* scripts/debug.bash:
	Remove broken spaces around = when setting debug=false.

	* scripts/lsvpd.in: Source debug.bash.

	* .distfiles:
	New files update-vpd.hotplug.in, vpd-name-crosslink.hotplug.in,
	setup/scan.d/01adapter_usb_defs, setup/scan.d/21sysfs_hotplug.  Moved
	setup/scan.d/41ibm,partition-no to
	setup/common-post.d/41ibm,partition-no and setup/scan.d/00vpd to
	setup/common.d/00vpd.

	* scripts/scan.d/00pci:
	pci_set_mf_tm_hook now uses $LSVPD_LIBDIR rather than $libdir.

	* scripts/lsvpd_test.in:
	Reworked preamble to allow libdir to be overwritten with environment
	variable.  Call do_setup instead of inline code.

	* scripts/update-lsvpd-db.in, scripts/update-vpd.hotplug.in:
	Use $LSVPD_LIBDIR rather than @libdir@.

	* scripts/vpd-name-crosslink.hotplug.in:
	Reworked preamble to allow libdir to be overwritten with environment
	variable.  Call do_setup instead of inline code.  Use $LSVPD_LIBDIR
	rather than @libdir@ elsewhere.

	* scripts/update-vpd.hotplug.in:
	Reworked preamble to allow libdir to be overwritten with environment
	variable.  Call do_setup instead of inline code.

	* scripts/update-lsvpd-db.in:
	Reworked preamble to allow libdir to be overwritten with environment
	variable.  Call do_setup instead of inline code.  Handle usb adapters.

	* scripts/lsvpd-functions.bash:
	Removed unused functions dirname and basename.  New function do_setup
	encapsulates the module load setup.

	* scripts/lsvpd.in:
	Don't pass common and common-post to do_setup, since they're common.

	* scripts/lsvpd.in:
	Removed function do_setup - now use version from lsvpd-functions.bash.
	Reworked preamble to allow libdir to be overwritten with environment
	variable.

	* scripts/lsvpd.in:
	do_setup now also sources modules from common-post.d.

	* scripts/query.d/41rtas_get_ibm_vpd:
	In rtas_ibm_get_vpd_hook, wrap ibm_vpd_render in a debug_cmd and
	override FC field as necessary for lsvpd -m.

	* scripts/common-post.d/41ibm,partition-no:
	Moved to setup/common-post.d and changed applicability condition.

2004-08-25  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	bus_alias_set, bus_alias_get and bus_alias_clear modified to cope
	sensibly with absolute path for target.

	* scripts/scan.d/20sysfs:
	Renamed function sysfs_get_node to set_sysfs_node_hook, which now sets
	$sysfs_node.  sysfs node cache now utilises bus-alias code, so doesn't
	need to know $adapter_bus_node.  sysfs_default_set_ax_osname_hook,
	adapter_set_ax_osname_hook_scsi, adapter_set_ax_osname_hook_ide and
	sysfs_get_class_property changed to use the above.  New function
	get_adapter_bus_dir uses a path relative to /sys/devices to determine
	$adapter_bus_dir - this means that we're no longer trying to invent
	structure, but are relying on sysfs's structure.

2004-08-10  Martin Schwenke  <martins@rover>

	* scripts/common.d/00minimal:
	Optimised vpd_subdirs_list_hook to avoid sub-shell, if 001 doesn't
	exist but 000 does.

	* scripts/scan.d/21sysfs_hotplug: New file.

	* scripts/scan.d/20sysfs: Globally unset function adapter_setup_usb.
	adapter_set_ax_osname_hook_ethernet abstracted to new function
	sysfs_default_set_ax_osname_hook, used by
	adapter_set_ax_osname_hook_ethernet and new function
	adapter_set_ax_osname_hook_usb.  Moved hotplug related code to new
	file 21sysfs_hotplug: declaration and linkage of
	sysfs_add_device_bus_alias, definitions of hotplug_add_device,
	hotplug_remove_device, hotplug_name_and_crosslink.
	sysfs_get_adapter_class now has definition for "usb".  sysfs_get_node
	now handles usb in the same way as scsi and ethernet.
	sysfs_do_pci_adapter_hook only sets $cd and updates $ds if subvendor
	and subdevice are non-zero.

	* scripts/lscfg.d/40ibm,vpd:
	In do_post_items, look for l2-cache@* too (lowercase 'l').

2004-08-07  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf:
	Added DROM00205 as an IBM CD-ROM with extra information.  Will
	generalise that once a pattern is established.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, if a channel, recurse to create common VPD in
	parent and assume that it works.  Changed some variable assignments
	from a cat of file contents to a read.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, if a channel, ensure PCI VPD is got or
	manufactured properly from parent, and also don't run extra VPD hooks
	if parent has VPD, since hooks will be run for parent.

2004-08-06  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/30device-tree:
	In dt_platform_specific_vpd, removed hardcoding of VK field value to
	"RS6K".

2004-07-30  Martin Schwenke  <martins@rover>

	* scripts/query.d/00minimal:
	dynamic_vpd_ok now succeeds if $LSVPD_FORCE_DYNAMIC is 1.  This can be
	useful for debugging in offline mode.

2004-07-15  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	Renamed multiplexed function from get_device_name to
	get_kernel_device_name.  New function get_device_name calls
	get_kernel_device_name, but may be overriden with more interesting
	functionality.

	* scripts/scan.d/20sysfs:
	Moved add_device_hook_scsi from 20sysfs to 27device_scsi_sysfs.

	* scripts/scan.d/00minimal:
	New multiplexed function remove_device_hook.  New function
	add_device_hooks allows multiple hooks from $add_device_hooks,
	containing add_device_hook by default.  New functions bus_alias_clear
	and wait_for_node.

	* scripts/scan.d/20sysfs:
	New function hotplug_add_device - logic was previously in
	update-vpd.hotplug.in.

	* scripts/vpd-name-crosslink.hotplug.in, scripts/update-vpd.hotplug.in:
	Removed function process_ide_device_hotplug, moving relevant logic to
	main program.

	* scripts/scan.d/20sysfs:
	In hotplug_remove_device, hotplug_remove_device_hook renamed to
	remove_device_hook.

	* scripts/scan.d/20sysfs:
	Moved add_device_hook to 27device_ide_sysfs.  In
	sysfs_add_device_hook_common, $device_bus_dir has now been processed
	by pseudo_realpath.  New functions hotplug_remove_device and
	hotplug_name_and_crosslink.  New multiplexed function
	sysfs_add_device_bus_aliasadded to $add_device_hooks.

	* scripts/update-vpd.hotplug.in, scripts/vpd-name-crosslink.hotplug.in:
	New file.

2004-07-13  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in, scripts/scan.d/00minimal, scripts/scan.d/20sysfs, scripts/scan.d/30device-tree:
	Renamed functions *do_device* to *add_device*.

	* .distfiles: Added setup/scan.d/27device_ide_sysfs.

2004-07-06  Martin Schwenke  <martins@rover>

	* .distfiles: Added query.d/99vpd_file.

	* scripts/query.d/99vpd_file: New file.

	* scripts/scan.d/30dmidecode:
	db_initialise_dmidecode now reads whole lines and parses them, when
	necessary, using POSIX string operations.

2004-06-22  Martin Schwenke  <martins@rover>

	* Makefile: $TARBALLS is now DIST subdirectory.

	* scripts/update-lsvpd-db.in:
	Added /usr/sbin and /usr/local/sbin to $PATH.

2004-06-21  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30dmidecode:
	Blacklist x86_64 architecture, since dmidecode seems broken there.

	* .distfiles, Makefile, scripts/tidy_lsvpd_dbs.in, scripts/lsvpd.cron.daily.in:
	Renamed tidy_device_trees to tidy_lsvpd_dbs.

	* scripts/lsvpd.cron.daily.in: New file.

2004-06-18  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/30device-tree:
	dt_platform_specific_node now calls node_contains_dynamic_vpd.

	* scripts/query.d/41rtas_get_ibm_vpd:
	Moved $linux_dynamic_vpd and dynamic_vpd_ok from 41rtas_get_ibm_vpd to
	00minimal.

	* scripts/query.d/00minimal:
	Moved $linux_dynamic_vpd and dynamic_vpd_ok from 41rtas_get_ibm_vpd to
	00minimal.  New function node_contains_dynamic_vpd.
	list_linux_vpd_basic now calls node_contains_dynamic_vpd.

2004-06-17  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	dt_pci_domain_prop now always finds linux,pci-domain (since this is
	what is expected under 2.6), but ignores
	linux,phbnum/linux,global-number if
	/proc/device-tree/rtas/ibm,read-pci-config is missing.  New function
	do_adapter_crosslink calls do_adapter_crosslink_basic and also
	crosslinks any channels found.

	* scripts/scan.d/00minimal:
	Function do_adapter_crosslink renamed to do_adapter_crosslink_basic
	with variables bus_dir and os_dir no longer local and renamed to
	adapter_bus_dir and adapter_os_dir.  New function do_adapter_crosslink
	makes adapter_bus_dir and adapter_os local and calls
	do_adapter_crosslink_basic.  This has been done to allow
	do_adapter_crosslink to be redefined so it can also crosslink
	channels.

2004-06-16  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.12.0.

	* debian/init.d: Renamed update-device-tree to update-lsvpd-db.

	* debian/init.d: New file.

	* README, .distfiles: Renamed update-device-tree to update-lsvpd-db.

	* scripts/query.d/00minimal:
	ensure_db now tells user to run /sbin/update-lsvpd-db if no database found.

	* scripts/update-lsvpd-db.in, scripts/lsvpd_test.in, scripts/tidy_lsvpd_dbs.in, lsvpd.spec.in, docs/design.xml:
	Renamed update-device-tree to update-lsvpd-db.

	* docs/lsmcode.xml, docs/lscfg.xml, docs/lsvpd.xml, docs/update-lsvpd-db.xml:
	Remove explicit <> around email address.  <email> tags now do this.

	* .distfiles: Added docs/update-lsvpd-db.{xml,8}.

	* docs/lscfg.xml, docs/lsvpd.xml, docs/lsmcode.xml:
	Added comments relating to dynamic VPD in non-root and offline modes.
	Changes references to update-device-tree to be update-lsvpd-db instead.

	* docs/update-lsvpd-db.xml: New file.

	* docs/Makefile: Added update-lsvpd-db.8.

	* scripts/query.d/41rtas_get_ibm_vpd:
	Set $linux_dynamic_vpd unconditionally.

2004-06-15  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in: Added linux.distro-$lsvpd_version file.

	* scripts/lscfg.d/30device-tree:
	Use find and egrep instead of just find with complex options - will
	now work with busybox's simple version of find.

	* DOTEST: New file.

	* .distfiles: Renamed 05adapter_pci_chiprev to 45adapter_pci_chiprev.

	* scripts/scan.d/45adapter_pci_chiprev:
	Renamed from 05adapter_pci_chiprev.  Don't load module if
	$device_tree_device_type is "chrp".

2004-06-11  Martin Schwenke  <martins@rover>

	* scripts/query.d/41rtas_get_ibm_vpd:
	New function dynamic_vpd_ok, now used in rtas_ibm_get_vpd to decide
	whether to update dynamic VPD.

	* scripts/query.d/00minimal:
	list_linux_vpd_basic now renders dynamic VPD only on the default
	database and when root.

	* scripts/lscfg.d/30device-tree:
	New function dt_platform_specific_vpd_all renders VPD for all
	subdirs.  dt_platform_specific_node now renders dynamic VPD only on
	the default database and when root.

	* scripts/query.d/41rtas_get_ibm_vpd: New file.

2004-06-10  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	do_adapter_name_and_crosslink now checks to see if VPD exists before
	setting AX - this check move to top of function from channel/parent
	code.

	* scripts/scan.d/30device-tree:
	Changes to do_adapter_DEFAULT: changed some "if" statements to be
	simple uses of && or || (readability); no longer use vpd_exists
	(optimisation, less cluttered tracing); new variable $have_parent_vpd
	(optimisation, clarity); removed variable $parent (no longer needed).

	* scripts/scan.d/20sysfs:
	do_adapter_DEFAULT no longer calls vpd_exists - as well as being
	inefficient, it also made traces much more difficult to read due.

	* scripts/scan.d/40ibm,vpd:
	ibm_vpd_adapter_init_hook no longer calls vpd_exists - as well as
	being inefficient, it also made traces much more difficult to read
	due.

2004-06-09  Martin Schwenke  <martins@rover>

	* scripts/common.d/00minimal:
	Fixed order of setting variables db_prefix and db_default.

	* scripts/common.d/00minimal:
	Optimise vpd_dir_set_hook to avoid printf subshell for common subnode
	value of 0.

	* scripts/scan.d/00minimal:
	do_adapter_name_and_crosslink now recurses for parent if there is
	already VPD.

2004-06-07  Martin Schwenke  <martins@rover>

	* scripts/lsvpd.in: Added /usr/sbin and /usr/local/sbin to $PATH.

2004-06-02  Martin Schwenke  <martins@rover>

	* scripts/common.d/00minimal:
	New variable $db_default contains default database location - can be
	used to check if the database location has been changed.  $db is now
	initialised to this value.

2004-06-01  Martin Schwenke  <martins@rover>

	* scripts/query.d/00minimal:
	New variable $dynamic_vpd_hooks and corresponding function
	run_dynamic_vpd_hooks.

	* .distfiles: Add setup/query.d/41rtas_get_ibm_vpd.

	* scripts/lsvpd.in:
	Add @libdir@ and /sbin to $PATH.  Call run_dynamic_vpd_hooks.

2004-05-24  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	In adapter_set_ax_osname_hook_DEFAULT, replace sub-shell call to
	basename with explicit POSIX string operation.

	* scripts/lscfg.d/30device-tree:
	In dt_platform_specific_node_maybe, replace sub-shell call to basename
	with explicit POSIX string operation.

	* scripts/query.d/00minimal:
	In list_linux_vpd_basic, replace sub-shell call to dirname with
	explicit POSIX string operation.

	* scripts/common-post.d/41ibm,partition-no:
	In do_fc_hook, replace sub-shell calls to dirname and basename with
	explicit POSIX string operation.

	* scripts/scan.d/40ibm,vpd:
	In ibm_vpd_adapter_init_hook, replace sub-shell call to dirname with
	explicit POSIX string operation.

	* scripts/scan.d/20sysfs:
	In do_adapter_hook_DEFAULT, do_adapter_hook_ide, do_device_hook_scsi,
	do_device_hook_ide and sysfs_do_pci_adapter_hook replace sub-shell
	calls to dirname and basename with explicit POSIX string operations.

	* scripts/scan.d/30device-tree:
	In adapter_init_node, list_adapters_DEFAULT, get_adapter_bus_dir,
	dt_get_pci_adapter_relnode, dt_manufacture_yl_hook, dt_get_bus_info,
	replace sub-shell calls to dirname (and basename, once) with explicit
	POSIX string operations.

	* scripts/scan.d/00minimal:
	Renamed get_dot_dots to set_dot_dots_hook. it now sets $dot_dots and
	no longer calls dirname in a sub-shell (and now does the appropriate
	string manipulation inline).  cross_link and bus_alias_set changed to
	use set_dot_dots_hook.  bus_alias_get now does string operation
	instead of calling dirname.

2004-05-21  Martin Schwenke  <martins@rover>

	* .distfiles: Added setup/scan.d/01adapter_display_defs.

	* scripts/scan.d/20sysfs:
	For IDE, sysfs_get_node now returns a little less of the sysfs path
	for the device, and also only return the first (even though they will
	now all be the same).  adapter_set_ax_osname_hook_ide simplified
	because it expects the shorter path that sysfs_get_node returns.

	* scripts/scan.d/30device-tree:
	Ensure dt_manufacture_yl_hook returns true when it successfully reads
	a location code, otherwise all the callers fail.

2004-05-20  Martin Schwenke  <martins@rover>

	* .distfiles: Removed setup/scan.d/01adapter_fibre_defs.

	* scripts/scan.d/20sysfs:
	list_adapters renamed to list_adapters_DEFAULT, which uses new
	function pci_check_class instead of retrieving PCI class and doing
	direct comparison (supports fibre channel better).  New function
	do_adapter_hook_scsi contains hack for fibre channel DS.
	do_device_hook_scsi and do_device_hook_ide no longer claim to set
	$adapter_bus_dir, and now have useful return codes.

	* scripts/scan.d/30device-tree:
	list_adapters renamed to list_adapters_DEFAULT.  New functoin
	list_adapters_scsi calls list_adapters_DEFAULT on "scsi" and
	"fibre-channel", do_adapter_hook_scsi now contains an explicit hack to
	set the default DS for fibre channel.  do_device_hook_scsi and
	do_device_hook_ide no longer claim to set $adapter_bus_dir, and have
	been restructured and have useful return codes.

	* scripts/scan.d/00pci:
	New function pci_check_class_DEFAULT always fails (returns 1).
	pci_hack_dom_bus_hook now just uses $type instead of converting to a
	PCI class.  Consequently, pci_get_bus_dev_fun_irq_class_list has been
	renamed to pci_get_bus_dev_fun_irq_type_list, and deals with types
	rather than PCI classes.

	* scripts/scan.d/00minimal:
	get_adapter_bus_dir is no longer multiplexed.  do_device_hook_common
	now returns 0 (or 1) to signify success (or not).

	* scripts/common.d/00vpd:
	vpd_create_hook no longer tries to write AX, which isn't generally
	available when VPD is created.

2004-05-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	do_device_hook_common clears adapter_bus_dir to ensure old value not
	returned on error.

	* scripts/scan.d/00pci: get_pci_class renamed to pci_check_class.

	* scripts/update-lsvpd-db.in:
	Remove "fibre-channel" as top-level adapter - it will be treated as
	part of SCSI.

2004-05-18  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	do_device_name_and_crosslink strips "/dev/" from device name when
	building device_os_dir.

2004-05-13  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	sysfs_get_node now copes with IDE adapters that have no channel
	specified.

	* scripts/lscfg.d/40ibm,vpd:
	ibm_vpd_handle_specials now only prints YL as VPD line if $dovpd.

	* .distfiles: Replaced various scsi/*.[ch] files with just
	scsi/scsi_vpd_render.c.in.  Removed
	setup/scan.d/03adapter_ethernet_ifconfig.  Added new files
	setup/common.d/30device-tree, setup/scan.d/00pci, setup/scan.d/00vpd,
	setup/scan.d/05adapter_pci_chiprev,
	setup/scan.d/41ibm,converged-loc-codes.

	* scripts/scan.d/30device-tree:
	do_adapter_hook_DEFAULT uses renamed dt_manufacture_yl_hook rather
	than old dt_manufacture_yl.  dt_do_device_hook_post now uses
	dt_manufacture_yl_hook instead of trying to read ibm,loc-code
	properties directly, and also uses new function dt_device_yl_hook to
	do device-specific part.

	* scripts/scan.d/40ibm,vpd:
	ibm_vpd_adapter_init_hook uses renamed dt_manufacture_yl_hook rather
	than old dt_manufacture_yl.

	* scripts/scan.d/41ibm,converged-loc-codes: New file.

	* scripts/common-post.d/41ibm,partition-no:
	If not a partition, explicitly return 0.

2004-05-10  Martin Schwenke  <martins@rover>

	* docs/install.xml: Also added mkdir core command.

	* docs/install.xml:
	Added more core commands and more commentary on busybox/find.

	* scripts/scan.d/20sysfs:
	list_adapters no longer leaves a trailing / on pseudo SCSI adapter names.

2004-05-06  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	list_adapters now lists pseudo SCSI adapters again.
	sysfs_do_device_hook_common now uses $yl_prefix of "~", which is
	consistent with adapters.

	* scripts/scan.d/45adapter_pci_chiprev: chiprev should be decimal.

	* scripts/scan.d/30device-tree:
	do_adapter_DEFAULT only runs adapter_extra_vpd_hook for channels if
	the parent node has no VPD.

	* scripts/lsvpd.in:
	render_linux_vpd_directory now only strips suffix from field name when
	printing, not before lookup.

	* scripts/scan.d/40ibm,vpd:
	ibm_vpd_adapter_init_hook no longer manufactures YL for the top node
	in the device-tree.

	* scripts/scan.d/30device-tree:
	do_adapter_DEFAULT no longer declares rl and rm as locals to be set by
	do_adapter_hook - they are now declared before vpd_create_hook to
	avoid spurious values being rendered there; traces of rl, rm, RM
	removed from this function and adapter_extra_vpd_hook now called in
	relevant places.  do_adapter_hook_scsi no longer calls
	get_adapter_firmware_version - that was broken!

	* scripts/scan.d/00pci:
	pci_hack_dom_bus_hook now initialises $dom and $bus to empty,
	otherwise bad things can happen.

2004-05-05  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs: Oops, ensure rl and rm aren't set.

	* scripts/scan.d/20sysfs: Removed dead references to $rm and RM.

	* scripts/scan.d/00minimal: Removed get_adapter_firmware_version.

	* scripts/scan.d/45adapter_pci_chiprev: New file.

	* scripts/scan.d/20sysfs:
	Renamed sysfs_get_class_attribute to sysfs_get_class_property - now
	returns the sysfs path of the attribute, if it exists.  Removed
	function get_adapter_firmware_version - replaced with function
	fw_version_vpd hook, which gets added to adapter_extra_vpd_hooks.
	do_adapter_DEFAULT now calls adapter_extra_vpd_hook in a couple of
	places.

	* scripts/scan.d/00minimal:
	Moved diectory-based VPD generation functions to 00vpd.

	* scripts/common.d/00vpd: New file.

2004-05-03  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	list_adapters and get_adapter_bus_dir now explicitly set aliases for
	the parent if $bus_info includes a channel.

	* scripts/scan.d/00minimal:
	vpd_field_insert now ensures a single space after an added field
	name.  do_device_name_and_crosslink calls vpd_field_ensure rather than
	vpd_field_insert.  bus_alias_set no longer sets an alias for the
	parent is the request is for a "channel" - this was a bad hack and
	should be done by the caller.

	* src/ibm_vpd_render.c:
	dump_txt_vpd must chdir back to origin, just in case output directory
	is relative.

2004-04-30  Martin Schwenke  <martins@rover>

	* scripts/scan.d/40ibm,vpd:
	In db_initialise_ibm_vpd, that should be $db_bus_dt_dir.

2004-04-28  Martin Schwenke  <martins@rover>

	* scripts/query.d/00minimal:
	In get_model_basic, commented on some obscure code.

	* scripts/common-post.d/41ibm,partition-no, scripts/scan.d/30dmidecode, scripts/lsvpd_test.in:
	Removed unneeded "function" keyword.

	* scripts/scan.d/30device-tree:
	In dt_do_device_hook_post, removed subshell-strips-NULs nonsense -
	just use "read".

	* scripts/query.d/00minimal: Removed unused function stripkey.

2004-04-27  Martin Schwenke  <martins@rover>

	* scripts/lsvpd.in:
	do_header_renamed to print_global_header.  Moved rendering of VPD into
	new function render_linux_vpd, which calls new function
	render_linux_vpd_directory or render_linux_vpd_file (the latter is for
	backward compatibility).  render_linux_vpd_directory uses new API.

	* scripts/scan.d/20sysfs:
	In do_adapter_DEFAULT, use new VPD API to create and add to VPD.

	* scripts/common.d/00minimal:
	Moved vpd_exists here from corresponding file in scan.d directory.

	* scripts/scan.d/00minimal:
	Moved vpd_exists to corresponding file in common.d directory.

	* scripts/scan.d/40ibm,vpd:
	db_initialise_ibm_vpd uses $db_dt_bus_dir, not $db_bus_dir.
	ibm_vpd_adapter_init_hook uses new VPD API to possibly set YL field.

	* scripts/lscfg.d/40ibm,vpd:
	dt_handle_specials renamed to ibm_vpd_handle_specials and uses new VPD
	API and changed function names from lscfg.  New function
	ibm_vpd_maybe_render_header.  do_pre_items and do_post_items use
	changed and new functions as appropriate.

	* scripts/lscfg.d/30device-tree:
	In dt_platform_specific_line, use renamed/updated functions
	render_vpd_value and render_vpd_line. dt_platform_specific_vpd now
	takes vpd_dir as 1st arg and uses new directory-based VPD API - field
	value is only retrieved for the fields where it is used using factored
	code.  dt_platform_specific_node no longer takes a $vpd_dir argument -
	instead it loops through the available dirs using the API.
	dt_platform_specific_node_maybe modified to use new VPD API.  In
	dt_platform_specific_header and dt_platform_specific_node, got rid of
	excess "cat" nonsense to "strip NULs".

	* scripts/scan.d/30device-tree:
	do_adapter_DEFAULT uses new functions for creating directory-based
	VPD.  dt_do_adapter_fake properly updated in line with other recent
	updates.  dt_do_pci_adapter_hook now gets $node as an argument,
	instead of relying on it to be set.

2004-04-23  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	adapter_set_ax_osname_hook_DEFAULT now fakes output_prefix if needed.
	Changes to support directory-based VPD.  print_vpd_hook renamed to
	vpd_create_hook, and changed to produce directory-based VPD.  New
	functions vpd_exists, vpd_add_field_value, vpd_field_append.
	Functions add_field, ensure_field, override_field renamed to
	vpd_field_insert, vpd_field_ensure, vpd_field_override.
	do_device_name_and_crosslink and do_adapter_name_and_crosslink now
	uses vpd_field_insert.  In do_adapter_name_and_crosslink, only
	crosslink if $osname is set (bug fix).

	* scripts/scan.d/00pci:
	pci_render_vpd uses new 2nd argument to ibm_vpd_render, and uses vpd_*
	functions to manipulate FC fields in generated VPD.

	* scripts/common.d/00minimal:
	New functions vpd_dir_set_hook, vpd_subdirs_list_hook,
	vpd_fields_list_hook, vpd_field_get.

	* src/growbuf.h:
	New function growbuf_iter_remaining returns number of chars left to
	iterate over.

	* src/ibm_vpd_render.c:
	No longer render text to stdout - render to directory structure
	instead.  2nd argument is dircetory to create linux,vpd subdirectory
	under.  Replaced ibm_vpd_to_txt with function ibm_vpd_render, and
	added supplementary functions dump_txt_vpd, dump_field, is_printable.

2004-04-16  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	New functions process_adapters_of_type and process_devices_of_type
	encapsulate relevant logic and constrain scope of variables.  Adapter
	handling logic is now bus_info-, rather than name-, based.

	* scripts/scan.d/30device-tree:
	do_device_scsi and do_device_ide now use $bus_info instead of $type
	and type-specific variables.  do_device_scsi uses scsi_parse_addr_hook
	to extract address components.  dt_do_device_hook_post now takes
	decimal arguments and converts them to hex, and also sets bus aliases.

	* scripts/scan.d/20sysfs:
	do_device_hook_scsi and do_device_hook_ide now use $bus_info instead
	of type-specific variables.  sysfs_do_device_hook_common also uses
	$bus_info, and additionally sets up a bus alias for the device.

	* scripts/scan.d/00minimal:
	In do_device_hook_common use $bus_info to get type, not $type.  Remove
	$bus_info arg and related bus alias code from
	do_device_name_and_crosslink - the bus aliasing should be done much
	earlier.  New function scsi_parse_addr_hook for parsing SCSI addresses.

	* scripts/lsvpd.in:
	Use list_linux_vpd, not list_linux_vpd_files_all.  Sundry cleanups:
	removed uses of "function" keyword.

	* scripts/query.d/30device-tree:
	In get_model and get_serial, use read and echo rather than cat.

	* scripts/common.d/30device-tree:
	Moved get_model and get_serial to query.d/30device-tree.  New function
	db_set_subdir_vars_dt sets $db_bus_dt_subdir and $db_bus_dt_dir.

	* scripts/lscfg.d/00minimal:
	Removed list_linux_vpd_files - replacement definition(s) in
	common.d/00minimal.  Removed uses of "function" keyword.

	* scripts/query.d/00minimal:
	Renamed list_linux_vpd_files_all to list_linux_vpd_files_basic, and
	made it accept an argument: the directory to find VPD under.  New
	function list_linux_vpd calls list_linux_vpd_files_basic with arg of
	$db_bus_dir.  Removed uses of "function" keyword.

	* scripts/common.d/00minimal:
	db_set_subdir_vars_hook body moved to new function
	db_set_subdir_vars_basic, and db_set_subdir_vars_hook now calls
	functions in $db_subdir_vars_hooks.

	* scripts/lscfg.d/40ibm,vpd:
	Renamed list_linux_vpd_files to list_linux_vpd, which calls
	dt_list_linux_vpd instead of list_linux_vpd_files_all, and now also
	ignore the top-level directory a little more cleverly.  Removed uses
	of "function" keyword.

	* scripts/query.d/30device-tree:
	Call db_set_subdir_vars_dt and add it to db_subdir_varshook, to ensure
	$db_bus_dt_dir is set correctly, and use this variable throughout
	(instead of $db_bus_dir).  New functions list_linux_vpd and
	dt_list_linux_vpd.  Removed use of "function" keyword.

	* scripts/lscfg.d/30device-tree:
	Use $db_bus_dt_dir instead of $db_bus_dir throughout.  Removed use of
	"function" keyword.

	* scripts/lsvpd-functions.bash:
	New function ensure_directory creates directory if it doesn't exist.
	Removed use of "function" keyword.

	* scripts/scan.d/30device-tree:
	Module load condition not unsets $source_device_tree if it isn't
	relevant.  Call db_set_subdir_vars_dt (defined in
	common.d/30device-tree) and add it to $db_subdir_vars_hooks.  New
	function adapter_init_node copies as much source device tree as is
	missing, calls $dt_adapter_init_hooks, and renders any PCI 2.2 VPD for
	the current adapter.  Removed match_adapter.  list_db_adapters renamed
	to list_adapters, and now lists bus info, caching the mappings between
	bus info and nodes using bus_alias_set.  New function
	get_adapter_bus_dir gets and sets bus aliases, but uses
	dt_get_pci_adapter_relnode when needed.  do_adapter_default node takes
	bus_info instead of name and AX-related code has been removed.
	Functions manufacture_yl, check_bus_range, check_bus_num,
	check_pci_domain renamed to dt_manufacture_yl, dt_check_bus_range,
	dt_check_bus_num, dt_check_pci_domain.  In dt_do_device_hook_post,
	fixed a bug by adding a use of hex2dec.

	dt_find_adapter renamed to dt_get_pci_adapter_relnode, now uses source
	device-tree directly and returns the node relative to the top of the
	device-tree, PCI domain property name guessing code moved out to new
	function dt_pci_domain_prop.  dt_do_adapter_fake now accepts bus_info
	instead of name.

	New function dt_find_bus_info works out the bus info for a device-tree
	node.

	Sundry cleanups: shuffled order of functions, removed use of
	"function" keyword, used ensure_directory instead of "mkdir -p".

	* scripts/scan.d/20sysfs:
	db_initialise_bus replaced by adapter_init_node, which does on-demand
	creation of bus nodes - adapter enumeration moved to list_adapters.
	Removed get_pci_info and renamed get_pci_config_filename to
	pci_get_config_filename.  Removed list_os_adapters_DEFAULT and
	match_adapter.  Renamed list_db_adapters to list_adapters, and now do
	listing directly from sysfs (and have temporarily lost pseudo adapters
	in the processes).  New functions adapter_set_ax_osname_hook_scsi,
	adapter_set_ax_osname_hook_ethernet and
	adapter_set_ax_osname_hook_ide.  do_adapter_DEFAULT now take bus_info
	argument instead of node, calls adapter_init_node if required, no
	longer handles the AX field, and uses "~" as prefix for pseudo
	adapters instead of "pseudo:".  Removed pcistring2info and
	sysfs_get_bus_string.  sysfs_get_node now takes bus_info argument
	instead of name and now does a lot more sanity checking.
	Miscellaneous cleanups: use ensure_directory instead of "mkdir -p",
	remove uses of "function" keyword.

	* scripts/scan.d/00minimal:
	Moved PCI-related functions to 00pci and made sure they all start with
	"pci_":

	  get_pci_config_filename        -> pci_get_config_filename
	  render_ibm_vpd                 -> pci_render_vpd
	  do_pci22_vpd                   -> pci_do_pci22_vpd
	  get_bus_dev_fun_irq_class_list -> pci_get_bus_dev_fun_irq_class_list
	  get_real_bus                   -> pci_hack_dom_bus_hook
	  pci_set_mf_tm_hook             -> pci_set_mf_tm_hook

	adapter_set_ax_osname_hook is now multiplexed, and the local version
	has had "_DEFAULT" appended to its name, and now accepts a bus_info
	parameter instead of using other random junk.  Setting of ax from
	osname moved to new function adpater_set_ax_from_osname_hook, since it
	is needed elsewhere.

	New multiplexed function get_adapter_bus_dir with default definition
	that encourages a simple directory hierarchy.
	do_device_name_and_crosslink now accepts extra arguments and creates
	bus alias (e.g. bus/scsi/0:1:2:0) for device.  New functions
	do_adapter_name_and_crosslink and do_adapter_crosslink.

	get_dot_dots does its sanity check more carefully by checking to
	ensure there's at least trailing slash after the prefix, and also
	prints one less set of dots (bug fix).  cross_link now only attempts
	to create links if they don't already exist.  New functions
	bus_alias_set and bus_alias_get create and lookup aliases in
	$db_bus_dir.

	Sundry cleanups: reordered various functions, use ensure_directory
	instead of "mkdir -p", remove "function" keyword,

	* scripts/scan.d/00pci: New file.

	* scripts/scan.d/40ibm,vpd:
	Pushed body of db_initialise_ibm_vpd into new function
	ibm_vpd_adapter_init_hook, and call this function on $db_bus_dir from
	db_initialise_ibm_vpd.  Various called functions have had their names
	changed.

2004-04-08  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf: Added variations of the IBM ST3.* and an exception.

2004-04-07  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf:
	Use regexps instead of globs for patterns.  This allows rules for
	different models to be compressed into a single rule.  Removed old,
	commented out rules.

2004-03-24  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	Renamed do_fc_field to do_fc_hook, which now just sets $fc, and moved
	device-tree-specific implementation to 41ibm,partition-no, leaving a
	simple 1-liner.  render_ibm_vpd modified to use do_fc_hook.
	print_adapter_vpd_hook renamed to print_vpd_hook: now prints $sn if
	available and uses do_fc_hook to get FC field.  Documents variable
	uses and sets for hook functions.

	* scripts/scan.d/20sysfs:
	In do_adapter_DEFAULT, made addition of fields to existing VPD
	consistent with 30device-tree, and call renamed print_vpd_hook instead
	of print_adapter_vpd_hook (after ensuring $sn is unset).

	* .distfiles: Added setup/scan.d/41ibm,partition-no.

	* scripts/common-post.d/41ibm,partition-no: New file.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, also add YL, if missing, to existing VPD, and
	call renamed print_vpd_hook instead of print_adapter_vpd_hook (after
	ensuring $sn is unset).  Document variable uses and sets on hook
	functions.

	* scripts/scan.d/20sysfs:
	In do_adapter_DEFAULT, made control flow more cleanly -
	print_adapter_vpd_hook is only called once at the end now.
	sysfs_do_pci_adapter_hook no longer prints anything, but now sets mf,
	tm and cd, which are no longer local variables.  Updated various
	comments, mostly about variables used and set by hooks.

	* scripts/scan.d/30device-tree:
	In do_adapter, cleaned up the multi-channel code: use absence of
	class-code in current node rather than absence of bus-range in parent
	to determine current node is for a channel; use $parent and $node for
	clarity rather than $node and $old; ensure any existing VPD has an AX
	field (probably an unused code-path); VPD is now rendered once,
	unconditionally at the bottom of this function.
	dt_do_pci_adapter_hook no longer prints anything - it is just a hook
	that can set mf, tm and cd, which are no longer local variables.

2004-03-23  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, attempt to fix case where channel number
	contains hex digits.  Do it much more simply, using a bash string
	substitution, but with a sanity check.

2004-03-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Refactored to move towards supporting hotplug.  do_device_hook_scsi
	and do_device_hook_ide now rely on global $adapter_bus_dir rather than
	local $adpater_bus_link to help construct $yl.
	sysfs_do_device_hook_common now calls do_device_hook_common and no
	longer sets $vpdprop.

	* scripts/scan.d/30device-tree:
	Refactored to move towards supporting hotplug.
	dt_do_device_hook_common moved to 00minimal as do_device_hook_common.
	In do_device_hook_scsi and do_device_hook_ide, call
	do_device_hook_common.  dt_do_device_hook_post now sets global
	$device_bus_dir rather than local $bus_dir, no longer contains any
	cross-linking code and no longer sets $vpdprop.

	* scripts/scan.d/00minimal:
	New multiplexed function get_device_name.  New function
	do_device_hook_common gets variables adapter_os_dir and
	adapter_bus_dir given $type and $adapter.  New function
	do_device_name_and_crosslink.

	* scripts/update-lsvpd-db.in:
	Refactored to move towards supporting hotplug.  Device loop change to
	reflect this - instead of just calling do_device, the loop now calls
	do_device to gather the VPD, then get_device_name and finally
	do_device_name_and_crosslink.

2004-03-17  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	In dt_do_device_post_hook, removed extraneous ')' appended to LUN, and
	renamed parameters to something less confusing.

2004-03-16  Martin Schwenke  <martins@rover>

	* docs/lscfg.xml: Clarified what name is for the -l option.

2004-03-08  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in:
	Moved setting of db_name and db_file to a more sensible place.  It was
	getting the previous database, and failing stupidly if there wasn't
	one.

2004-02-26  Martin Schwenke  <martins@rover>

	* lsvpd.spec.in: Added INSTALL to %doc.

	* .distfiles: Added INSTALL, docs/text-short.xsl.

	* docs/Makefile: Added ../INSTALL.

	* docs/install.xml: Added "basics" section.

2004-02-25  Martin Schwenke  <martins@rover>

	* .distfiles: Added setup/scan.d/27device_scsi_sysfs.

	* Makefile: Bumped version to 0.11.5.

	* scripts/lscfg.d/40ibm,vpd:
	In dt_handle_specials, moved where a newline is inserted into VPD.
	Empty "VPD" would have a newline added, and it would no longer be
	empty, so "VPD" containing only a single newline was sometimes
	printed.

2004-02-19  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, override RM in existing $vpdprop.

	* Makefile: Bumped version to 0.11.4.

	* scripts/query.d/00minimal:
	In get_model_basic, only get first matching line from cpuinfo.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, override RM in the parent node for a
	multi-channel adapter.

	* .distfiles: Replaced setup/scan.d/07device_scsi_sg with
	setup/scan.d/07device_scsi_sg_{inq,scan}.

	* scripts/scan.d/30device-tree:
	In do_adapter_DEFAULT, added rl and rm to list of variables that
	do_adapter_hook may set.  do_adapter_hook_scsi now calls
	get_adapter_firmware_version to try and set rm.

	* scripts/scan.d/20sysfs:
	do_adapter_DEFAULT also declares local variable rl, just in case it is
	bound in a calling function.

	* scripts/scan.d/00minimal:
	print_adapter_vpd_hook now prints fields for RL and RM if
	corresponding variables are set.  New stub function
	get_adapter_firmware_version.  New function add_field factored out of
	ensure_field - add_field also used by new function override_field.

	* scripts/scan.d/20sysfs:
	In do_adapter_DEFAULT, add local variable "rm" before call of
	do_adapter_hook, and use override_field on RM for existing linux,vpd
	file.  New functions get_adapter_firmware_version and
	sysfs_get_class_attribute to support retrieving firmware version with
	ips SCSI driver.  sysfs_get_node now caches a link to the sysfs device
	node and the sysfs class node (if available) - the former is an
	optimisation, and the latter is used to support
	sysfs_get_class_attribute.

2004-02-18  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf: Added ZM field for ST314* IBM disks.

	* scripts/lsvpd-functions.bash:
	readlink now uses a bash string operation instead of sed.

2004-02-17  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/30device-tree:
	In dt_platform_specific_vpd_line, use function formatvpd instead of
	hardcoding format.

	* scripts/lscfg.d/40ibm,vpd:
	In dt_handle_specials, call formatvpdline instead of hardcoding the
	formatting.

2004-02-16  Martin Schwenke  <martins@rover>

	* src/ibm_vpd_render.c:
	In function ibm_vpd_to_txt, read the 4 bytes in big-endian length one
	at a time in a loop to avoid possible alignment problem.

2004-01-22  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf:
	For generic IBM disks, wildcard IBM* to catch things like IBM-PSG and
	IBM-ESXS.

2004-01-20  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in: Now always creates db-*.tgz.

2004-01-13  Martin Schwenke  <martins@rover>

	* docs/lscfg.xml: Added 2004 to copyright.

	* docs/lscfg.xml:
	Fixed documentation for -p and -l to reflect improvements.

	* Makefile: Bumped version to 0.11.2.

	* scripts/lscfg.d/30device-tree:
	dt_platform_specific_node is now wrapped in
	dt_platform_specific_node_maybe, which also takes over setting certain
	variables, which are then passed as parameters instead of being
	recomputed.  dt_platform_specific_node_maybe respects $name, so only
	items with AX matching $name are printed (except for "mem*", which is
	a special case, and causes all memory modules to be displayed).
	dt_platform_specific_node respects $dovpd and, in any case, will now
	only produce VPD if there is no AX field.  The reasoning here is that
	the VPD should have been printed in the configurations section above.
	Printing of "PLATFORM SPECIFIC" heading moved from
	do_platform_specific_section moved to dt_platform_specific_node, and
	is now only done when first item is printed.  Filtering of "memory@*"
	case moved from do_platform_specific_section moved to
	dt_platform_specific_node_maybe.

	* scripts/lscfg.d/40ibm,vpd:
	In do_post_items, always produce mem0 item.

	* scripts/scan.d/00minimal:
	In render_ibm_vpd, filter out empty lines or those that contain
	non-printables.

2004-01-09  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	In sysfs_get_node replace an invocation of sed with a bash string
	substitution.

	* scripts/scan.d/00minimal:
	Fixed buglet in (currently) unused code in get_pci_config_filename.
	Optimised get_bus_dev_fun_irq_class_list - no more sed.  Cleaned up
	extraction of the bus# in get_real_bus, and also declared variable n
	as an integer.  Fixed typo in comment at top of
	adapter_set_ax_osname_hook.  In adapter_set_ax_osname_hook, removed
	dead code referring to linux,adapter-name file and replaced use of sed
	with bash string substitution.  In get_dot_dots, replaced == with = in
	1 place for consistency.

2004-01-08  Martin Schwenke  <martins@rover>

	* .distfiles: Removed sg3_utils-1.00.sginq-raw.patch.

	* src/pci_vpd_gen_grab.h, src/pci_vpd_gen_grab.c, src/pci_vpd_cap_grab.c, src/pci_lookup.c, src/ibm_vpd_render.c, src/util.h, src/util.c, src/test/test_growbuf.c, src/tdump.c, scripts/lsvpd-functions.bash, src/growbuf.h, src/growbuf.c:
	Fixed copyright/license header.

2004-01-07  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in:
	Run lsvpd with -m, because this tests more functionality.  Change
	lsvpd output file accordingly.

	* Makefile: Bumped version.

	* docs/lsvpd.xml: Documented -m option.

	* scripts/scan.d/00minimal:
	New function do_fc_field produced marked FC field depending on given
	directory.  render_ibm_vpd now calls do_fc_field and filters output
	from ibm_vpd_render accordingly.  print_adapter_vpd_hook now calls
	do_fc_field too, and depends upon $node being available.

	* scripts/lsvpd.in:
	Added -m option to mark VPD as global or partition specific.  Added
	code to unmark marked VPD if we're not marking.

	* docs/lsvpd.xml:
	Fixed synopsis.  Had "-s" (again), not "-t".  Added 2004 to copyright.

2004-01-06  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in:
	Moved package determination code so it is only run if we're sending
	email.

	* debian/changelog.in: New file.

	* lsvpd.spec.in: Updated description.

	* Makefile: Added lsvpd_test.  Added generation of lsvpd.spec and
	debian/changelog.  Files built from *.in files now use a generic rule.

	* scripts/scan.d/30device-tree:
	Fixed typo in do_device_scsi_hook that was cauing SCSI devices
	attached to a multi-channel adapter to appear in the directory for the
	adapter rather than in the subdirectories for the channels.

	* .distfiles:
	Renamed debian/changelog to debian/changelog.in, so debian/changelog
	is now generated, including the version.

	* lsvpd.spec.in:
	Renamed to lsvpd.spec.in, so lsvpd.spec is now generated, including
	the version.

	* .distfiles: Added lsvpd.spec.in.

	* scripts/query.d/30device-tree, scripts/query.d/00minimal, scripts/lscfg.d/30device-tree, scripts/common.d/00minimal:
	Added 2004 to copyright.

	* docs/design.xml: Year is now 2004.

	* scripts/lsvpd.in: Added 2004 to copyright.

	* scripts/lsvpd_test.in: Oops, that's copyright 2004.

	* README: New file.

	* scripts/lsvpd_test.in:
	Added an attempt to include packaging information.

	* docs/design.xml:
	Added information about lsmcode, query.d and lsmcode.d directories,
	and the database structure.

2004-01-05  Martin Schwenke  <martins@rover>

	* scripts/lsvpd_test.in: New file.

	* .distfiles: Added lsvpd_test.in.

	* .distfiles: Added setup/scan.d/01adapter_fibre_defs.

	* scripts/lsvpd-functions.bash:
	Sanity check in unpack_device_tree_archive now works on new databases
	by checking for bus subdirectory.

	* scripts/lsvpd.in:
	Added sourcing of files from query.d to function do_setup, along with
	new loop to make it look neater.

	* .distfiles:
	Moved setup/common.d/30device-tree to setup/query.d/30device-tree,
	added new file setup/common.d/00minimal.

	* scripts/query.d/30device-tree: New file.

	* scripts/common.d/00minimal:
	Moved functions ensure_db, list_linux_vpd_files_all, get_model,
	get_serial, get_model_basic, get_serial_basic, stripkey to
	../query.d/00common.

	* scripts/query.d/00minimal: New file.

	* scripts/Makefile: Added query.d.

2003-12-23  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	Unset do_adapter_hook_ide, not do_adapters_hook_ide.

	* scripts/scan.d/30device-tree:
	Function db_initialise renamed to db_initialise_bus.  In
	list_db_adapters, dt_find_adapter, manufacture_yl, use $db_bus_dir
	instead of $db.  In function match_adapter, rename variables for
	consistency (i.e. use bus_dir and os_dir), and use new function
	cross_link instead of creating files with directory names in them.
	Removed function dt_find_scsi_node.  Factored as much functionality as
	possible out of do_device_hook_scsi and do_device_hook_ide into new
	functions dt_do_device_hook_common and dt_do_device_hook_post.  In
	do_adapter_DEFAULT use function ensure_field instead of ensure_ax. In
	various places use $db_bus_dir instead of $db.  In dt_do_adapter_fake,
	use bash string substitutions instead of sed.  Removed function
	ensure_ax - functionality moved to ensure_field in 00common.

	* scripts/lsvpd.in:
	New function do_setup does setup and is called late enough for things
	to work properly.

	* .distfiles: Added setup/common.d/30device-tree.

	* scripts/scan.d/20sysfs:
	Simplified functions match_adapter, do_device_hook_scsi,
	do_device_hook_ide, sysfs_do_device_hook_common by using generic
	cross_link function.  Fixed bug in do_adapter_DEFAULT where old
	variable sysfs_node was referenced.

	* scripts/scan.d/00minimal:
	New functions cross_link, get_dot_dots, pseudo_realpath.

	* scripts/lsvpd-functions.bash:
	Reimplemented dirname and basename using bash substitutions.

2003-12-22  Martin Schwenke  <martins@rover>

	* scripts/common.d/00minimal:
	Only set $db if it is not already set.  This is necessary for the ls*
	commands, since they may be pointing to a different database and
	the setup process should respect this.

	* scripts/tidy_lsvpd_dbs.in:
	Tidy directories that look like db-* too.  Fix copyright header.

	* scripts/lscfg.d/00minimal:
	Function get_cpus_basic uses new location of cpuinfo in $db_proc_dir.
	get_architecture now uses $db_uname_dir/machine for default value.
	Fixed copyright header.

	* scripts/lscfg.d/40ibm,vpd:
	Use $db_bus_dir, not $db.  Fixed copyright header.

	* scripts/scan.d/40ibm,vpd:
	Replaced function db_initialise with new function
	db_initialise_ibm_vpd and add this to $db_initialise_functions.
	Serial and model numbers now go to files in $db_misc_dir.  Fixed
	copyright header.  db_initialise_ibm_vpd now uses factored
	functionality in new functions render_ibm_vpd and ensure_field.

	* scripts/scan.d/00minimal:
	Fixed typo in render_ibm_vpd - variable is $dir, not $d.

	* scripts/scan.d/30dmidecode:
	Replaced function db_initialise with new function
	db_initialise_dmidecode and add this to $db_initialise_functions.
	Serial and model numbers now go to files in $db_misc_dir.  Fixed
	copyright header.

	* scripts/scan.d/20sysfs:
	New functions db_initialise_bus, db_initialise_sysfs,
	get_pci_config_filename.  db_initialise_sysfs copies information from
	sysfs and also attempts to gather PCI-2.2-style VPD.  Function
	get_pci_info reimplemented.  Function list_os_adapters_DEFAULT now has
	sanity check on variable values.  Function match_adapter now builds
	symlinks in both directions and has horrible special case for IDE.
	list_db_adapters is more complex due to added functionality.  Function
	do_adapter_DEFAULT no longer uses $sysfs_node, since $node contains
	all of the relevant files.  do_adapter_DEFAULT no longer overwrites an
	existing linux,vpd file, but ensures that it contains both AX and YL
	fields.  Functions do_adapter_hook_scsi and do_adapter_hook_ethernet
	are now correctly unset, so locally defined do_adapter_hook_DEFAULT is
	used.  do_adapter_hook_DEFAULT and do_adapter_hook_ide now use part of
	$node to get YL, instead of calling a complicated function.
	do_device_hook_scsi and do_device_hook_ide now call new function
	sysfs_do_device_hook_common, mosty to accomplish cross-linking of the
	OS-specific and bus directories.  Function sysfs_get_adapter_class
	gratuitously reformatted.  Function pcistring2info now uses bash
	substitution instead of sed.  Function sysfs_get_pci_string renamed to
	sysfs_get_bus_string and now returns a value prefixed with either
	"pci:" or "pseudo:".  Function sysfs_do_pci_adapter_hook now uses
	$node, not $sysfs_node, and also uses bash variable substitutions
	where possible instead of sed.  New function sysfs_get_pci_class.

	* scripts/lscfg.d/30device-tree:
	Use $db_bus_dir in most places instead of $db.  Fixed copyright header.

	* scripts/common.d/30device-tree: New file.

	* scripts/scan.d/00minimal:
	Function db_initialise now calls functions listed in
	$db_initialise_functions.  New functions db_initialise_bus,
	db_initialise_basic, db_initialise_misc, db_initialise_misc_uname,
	db_initialise_misc_proc, get_pci_config_filename, render_ibm_vpd,
	do_pci22_vpd.  Remove functions maybe_fake_model and
	maybe_fake_system_id.  Function adapter_set_ax_osname_hook now tries
	linux,os-node symlink first.  New function ensure_field ensures given
	VPD file contains the given field - if not, adds it with given value.

	* scripts/update-lsvpd-db.in:
	Added "fibre-channel" to list of adapter types.  Removed miscellaneous
	section at end - this is now done by db_initialise_misc.

	* scripts/common.d/00minimal:
	$db_prefix is now "db" rather than "device-tree".  New function
	db_set_subdir_vars_hook sets variables pointing to certain DB
	subdirectories.  This function is called immediately after being
	defined, but may be called again after changing the value of $db.  In
	function list_linux_vpd_files_all, find is now done in "$db_bus_dir
	instead of $db.  Function get_model now simply calls new function
	get_model_basic, which encodes all relevant logic for finding model
	from basic database.  Function get_system_id replaced by function
	get_serial_basic, which is called by get_serial.

	* scripts/lsvpd.in:
	Printing header now happens inside dedicated function: call new
	function get_serial instead of get_system_id; use $db_uname_dir to
	find system information, and no longer try to run uname directly if
	information is missing.  Fixed copyright header.

2003-12-02  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	Split out new function ensure_ax from function dt_do_adapter_fake.
	Split out new function dt_do_pci_adapter_hook from function
	do_adapter_DEFAULT.  If dealing with a multi-channel adapter, ensure
	that any existing linux,vpd property for the adapter has the correct
	AX field and then generate minimal linux,vpd property for channels.

2003-11-25  Martin Schwenke  <martins@rover>

	* docs/install.xml:
	Clarified the ServerWorks issue - it isn't only 2.6 and it isn't only
	sysfs.

	* docs/install.xml: Added section on ServerWorks/sysfs strangeness.

	* Makefile:
	Added check to ensure tarball doesn't already exist on dist target.
	Bumped version to 0.10.4.

	* lsvpd.spec.in: Bumped version to 0.10.4.

	* src/scsivpd.conf: Added ZM field for IC35L*.

	* src/tdump.c:
	If no file specified, reads from stdin - takes advantage of new
	file_read_contents behaviour where a NULL filename reads stdin.

	* src/util.c:
	Function file_read_contents no longer uses fstat to determine file
	size - grows a buffer and reallocs instead.

2003-11-24  Martin Schwenke  <martins@rover>

	* scripts/lscfg.d/00minimal:
	In function get_cpus_basic, only try using linux,cpuinfo if it exists.

	* src/scsivpd.conf: Added ZM field for DDYS-*.

	* scripts/common.d/00minimal:
	Function strip key moved here from lscfg.  Fixed copyright/license header.

2003-11-21  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	New function sysfs_get_node (hopefully) all the logic for figuring out
	the the canonical sysfs node (hopefully including PCI information, for
	PCI adapters) in one place.  Function match_adapter now uses
	sysfs_get_node.  PCI specific code in function do_adapter_DEFAULT
	pushed out to new function sysfs_do_pci_adapter.  Also in
	do_adapter_DEFAULT, sysfs_node-related code cleaned up courtesy of
	better value in linux,sysfs-node file, and case statement added to
	handle PCI-specific nodes and "pseudo" nodes, ignoring other types of
	sysfs nodes.  Function sysfs_get_pci_string has had new function
	sysfs_get_node factored out of it.

	* scripts/scan.d/00minimal:
	Renamed function adapter_set_ax_hook to adapter_set_ax_osname_hook,
	and added code to set $osname.  Fixed copyright/licensing.

	* scripts/scan.d/20sysfs:
	Call function adapter_set_ax_osname_hook instead of
	adapter_set_ax_hook and declare associated variable.  Refactored
	do_adapter_hook_* functions, partly using get_adapter_ds.

	* scripts/scan.d/30device-tree:
	Call function adapter_set_ax_osname_hook instead of
	adapter_set_ax_hook and declare associated variable.  Refactored
	do_adapter_hook_* functions, partly using get_adapter_ds.  Fixed
	copyright.

	* scripts/scan.d/00minimal: Made get_adapter_ds a multiplex function.

2003-11-18  Martin Schwenke  <martins@rover>

	* docs/lsmcode.xml: Fixed typo in BUGS section.

2003-11-17  Martin Schwenke  <martins@rover>

	* .distfiles: Added lsmcode.{xml,8}.

	* docs/lsvpd.xml, docs/lscfg.xml:
	Replaced SEE ALSO for update-device-tree to lsmcode, since
	update-device-tree isn't documented in a man page.

	* docs/lsmcode.xml: New file.

	* docs/lsvpd.xml, docs/lscfg.xml:
	Fixed typo in options - that's 'z', not 'd' (again).

	* docs/Makefile: Added lsmcode.8 as a target.

2003-11-14  Martin Schwenke  <martins@rover>

	* Makefile:
	Added support for building lsmcode.  Bumped version to 0.10.3.

	* scripts/scan.d/20sysfs: Cleaned up copyright and licensing.

	* lsvpd.spec.in:
	Added /sbin/lsmcode to %files.  Bumped version to 0.10.3.

	* scripts/scan.d/20sysfs:
	Attempt to fix bug in function sysfs_get_pci_string for IDE.  Was
	failing on IDE channels with more than 1 device attached.

	* .distfiles: Added lsmcode.in.

2003-11-12  Martin Schwenke  <martins@rover>

	* scripts/Makefile: Added lsmcode.d.

2003-11-11  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.10.2.

	* docs/install.xml:
	Moved previous dependencies to "Software dependencies" section. Added
	filesystem and kernel dependencies.

2003-11-10  Martin Schwenke  <martins@rover>

	* lsvpd.spec.in: Added extra docs.

	* src/Makefile: Added debug.bash to install.

	* .distfiles: Added lib/debug.bash.

	* scripts/update-lsvpd-db.in:
	Updated copyright message.  Moved debug functions out to
	libdir/debug.bash.

	* scripts/debug.bash: Added copyright header.

	* scripts/debug.bash, lsvpd.spec.in: New file.

	* .distfiles:
	Added design and installation documentation, and supporting stylesheets.

	* docs/install.xml, docs/design.xml: Added releaseinfo.

	* docs/design.xml, docs/install.xml: New file.

	* docs/Makefile: Cleanups and additions.

2003-11-05  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Removed function sysfs_pci_string and moved 2 line function body to
	sysfs_get_pci_string, the only place where sysfs_pci_string was used.

	* src/util.c:
	New function string_array_lookup, for allowing (possibly) sparse
	arrays to be declared and search without bounds checking.

	* src/util.h: New struct string_array and corresponding function
	string_array_lookup, for allowing (possibly) sparse arrays to be
	declared and search without bounds checking.

2003-10-07  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.10.1.

	* scripts/scan.d/00minimal:
	Removed declaration of multiplexed function do_setup.  Added new
	multiplexed functions adapter_setup and device_setup.

	* scripts/scan.d/20sysfs:
	In function do_adapter_DEFAULT, make mf and tm local or bad things
	happen.

	* scripts/update-lsvpd-db.in:
	In main section, use adapter_setup and device_setup instead of
	do_setup.

	* docs/Makefile: Oops, installing MANPAGES, not DOCS.

	* docs/Makefile: New file.

	* .distfiles: Added new files in docs subdirectory.

	* docs/lsvpd.xml, docs/lscfg.xml: New file.

	* .distfiles: Changes for file splits in scan.d.

	* .distfiles: Various changes for 0.10.0.

	* scripts/scan.d/30device-tree:
	Removed function device_tree_scsi_adapter_prehook.  In function
	do_adapter_DEFAULT, removed conditional (on type scsi) call to
	device_tree_scsi_adapter_prehook, and replaced with logic that
	attempts to spot multichannel adapters.

	* scripts/scan.d/00minimal:
	In function pci_set_mf_tm_hook, tidied logic and fixed a bug where mf
	could get set to an unknown device-id and tm wouldn't get set at all.

	* scripts/lscfg.d/00minimal:
	In function get_cpus_basic, count CPUs using grep, not by hand
	(especially at the end of a pipe, where the count gets lost).

	* scripts/scan.d/20sysfs:
	In function sysfs_get_pci_string, made ide handling (more) failsafe.

2003-10-03  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.10.0.

	* scripts/lsvpd.in: Fixed GPL.

	* scripts/scan.d/40ibm,vpd:
	Load this module if device_tree_device_type = "chrp".

	* scripts/scan.d/30device-tree: Set variable device_tree_device_type.

	* scripts/lscfg.d/40ibm,vpd:
	Load this module if device_tree_device_type = "chrp".  Moved functions
	dt_platform_specific_header, dt_platform_specific_vpd_line,
	dt_platform_specific_vpd, dt_platform_specific_node,
	do_platform_specific_section to 30device-tree.

	* scripts/lscfg.d/30device-tree:
	Set variable device_tree_device_type.  Moved functions
	dt_platform_specific_header, dt_platform_specific_vpd_line,
	dt_platform_specific_vpd, dt_platform_specific_node,
	do_platform_specific_section from 40ibm,vpd.

2003-10-02  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in: Fixed GPL.

	* scripts/update-lsvpd-db.in:
	Removed inclusion of file @libdir@/scsi-functions.bash.

	* scripts/scan.d/30device-tree:
	In function do_adapter_DEFAULT, attempt to set mf and tm using
	pci_set_mf_tm_hook.

	* scripts/scan.d/00minimal:
	In function pci_set_mf_tm_hook, added work-around for broken 1023/2000
	card and fixed logic to only set mf to unknown subvendor if subdevice
	lookup worked.

	* scripts/scan.d/40ibm,vpd:
	In function db_initialise, manufacture_yl was being called
	incorrectly, causing broken output.

	* src/pci_lookup.c:
	In function strip_and_return_to_newline, cast size_t items to int in
	call to asprintf.

	* src/pci_lookup.c: Removed global variable prog.

	* scripts/common.d/00minimal:
	New fnuction ensure_db checks to ensure database exists.

	* scripts/lsvpd.in:
	Removed custom db-existence checking code and call ensure_db instead.

	* src/tdump.c:
	In main, changed use of die() to die2().  Removed variable prog,
	replaced with use of vpd_program_name.

	* src/pci_vpd_cap_grab.c:
	In main, changed use of die() to die2() and removed redundant asprintf.

	* src/ibm_vpd_render.c: In main, changed use of die() to die2().

	* src/util.c: In fnuctions file_relative_read_contents and
	file_relative_write_contents, changed uses of die() to die2().

2003-10-01  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	In function do_adapter_DEFAULT, use function pci_set_mf_tm_hook
	instead of hand-coding PCI lookups - required some small surrounding
	code changes.

	* scripts/scan.d/00minimal: New function pci_set_mf_tm_hook.

	* scripts/scan.d/20sysfs:
	In function do_adapter_DEFAULT, updated use of pci_lookup to reflect
	new usage.

	* src/pci_lookup.c:
	Rewrite to support subsystem-ids.  Now only prints a single item -
	must run multiple times to get both vendor and device string.  Has
	been generalised to also do PCI class lookups.

	* src/util.c, src/util.h: New function die2.

2003-09-30  Martin Schwenke  <martins@rover>

	* scripts/scan.d/20sysfs:
	Remove definitions of functions list_os_adapters_scsi and
	list_os_adapters_ethernet, since we want list_os_adapters_DEFAULT to
	be run.

	* scripts/lsvpd-functions.bash:
	New functions sanitise, hex2ascii, hex2substring, multiplex, make_multiplexed.

	* scripts/lscfg.d/40ibm,vpd:
	Replaced variable model_architecture with function get_architecture.
	Renamed function do_extra_items to do_post_items.  New function do_pre_items.

	* scripts/lsvpd.in:
	serial_number and type_model now set using get_system_id and get_model
	functions.

	* scripts/update-lsvpd-db.in:
	Moved SCSI-specific code to 01sg-scsi.  Function add_ax moved to
	setup/scan.d/30device-tree and renamed to dt_do_adapter_fake.
	Reorganised main section to use nested loops instead of duplicated
	sections.  Also save output of "uname -m" in "linux,architecture",
	"hostname" in "linux,hostname" and "/proc/cpuinfo" in "linux,cpuinfo".

	* scripts/common.d/00minimal:
	New functions get_model and get_system_id.

	* scripts/scan.d/00minimal:
	Added declarations for multiplexed function.  Removed prefix variables
	- replaced with a group of multiplexed functions.  Moved SCSI-specific
	code to 01sg-scsi.  Function maybe_fake_model now outputs to
	"linux,model" if required (not just "model", which is used to figure
	if we've got an OF device-tree).  New function adapter_set_ax_hook.

	* scripts/scan.d/30device-tree:
	Major changes to support function multiplexing scheme, as described in
	setup/scan.d/00minimal.  Added various hooks, including those to
	support IDE devices and adapters.

	* scripts/scan.d/30dmidecode: New file.

	* scripts/scan.d/20sysfs:
	Major changes to support function multiplexing scheme, as described in
	setup/scan.d/00minimal.  Added various hooks, including those to
	support IDE devices and adapters.

	* scripts/lscfg.d/00minimal:
	Removed variable model_architecture and replaced with new function
	get_architecture.  Renamed function do_extra_items to do_post_items.
	Added new function do_pre_items with some content that was in
	lscfg.in.  New functions get_cpus_basic and get_cpus attempt to
	decide if the machine is SMP or not.

	* scripts/lscfg.d/30device-tree: New file.

2003-09-23  Martin Schwenke  <martins@rover>

	* scripts/common.d/00minimal:
	In function list_linux_vpd_files_all, add trailing slash to influence
	sort order.

2003-09-22  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.9.2.

2003-09-19  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Wrap "set -- ..." in  "set -f" and "set +f".

	* scripts/scan.d/00minimal, scripts/scan.d/20sysfs:
	No silly "shopt -u nullglob".  Use "set -f" followed by "set +f"
	instead.

	* scripts/scan.d/20sysfs:
	No silly "shopt -u nullglob".  Use "set -f -- ..." followed by
	"set +f" instead.

	* scripts/Makefile:
	With the scripts set to use nullglob, no longer need 000EMPTY files.

	* scripts/lsvpd.in: Added nullglob at beginning of script.

	* scripts/Makefile:
	Fixed installation to avoid copying RCS directories.

	* scripts/scan.d/40ibm,vpd, scripts/scan.d/30device-tree:
	Changed remaining instances of $dt to $db.

	* scripts/lsvpd-functions.bash:
	In function unpack_device_tree_archive, changed instances of $dt* to
	$db*.

	* scripts/update-lsvpd-db.in:
	Changed remaining instances of $dt to $db.

2003-09-02  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in, scripts/scan.d/00minimal:
	Changed function name to maybe_fake_system_id (no '-' in name).

2003-09-01  Martin Schwenke  <martins@rover>

	* Makefile: Bump version to 0.9.1.

	* scripts/common.d/00minimal:
	In function list_linux_vpd_files_all sort on directory names, not full
	filename.  This means, for example, when using a device-tree, SCSI
	devices will now appear after the adapter they're connected to.

	* scripts/scan.d/20sysfs:
	In function sysfs_pci_string, removed extraneous '-' in sed
	expression.

2003-08-22  Martin Schwenke  <martins@rover>

	* Makefile:
	No longer builds/install dt_find_adapter.  Added "setup" subdir for
	install target.  Bumped version to 0.9.0.

	* .distfiles: Added pci/pci.ids.

	* scripts/scan.d/20sysfs: Use pci.ids from /lib/lsvpd/.

	* .distfiles:
	Removed scsi/scsi_host_pci_info.in, added setup/scan.d/01ethtool.

	* scripts/scan.d/00minimal:
	Added modified versions of functions from scsi_host_pci_info.in here.
	Function list_os_adapters now lists ethernet adapters (via "ifconfig -a").

2003-08-19  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in: Set $libdir.

2003-08-18  Martin Schwenke  <martins@rover>

	* scripts/scan.d/40ibm,vpd:
	In function db_initialise, added debug messages and use of debug_cmd
	to conditionally trap stderr from ibm_vpd_render.

	* scripts/update-lsvpd-db.in:
	No longer use -e flag - should never stop processing 1/2 way.  Use
	"shopt -s nullgob", since some directories may be empty.  Added -d
	(debug) flag and corresponding debug and debug_cmd functions.  Added
	debug message to various functions, and echo to stderr and exit 1
	become debug and return 1.  In function scsi_do_device, out separate
	output directory for VPD components - remove that output directory if
	it is empty after rendering.

	* scripts/scan.d/20sysfs:
	Relaxed pattern for sysfs mount in /proc/mounts.  Initial support for
	using sysfs (partly) in place of device-tree: new functions
	sysfs_pci_string, sysfs_get_adapter_class, sysfs_get_adapter_prefix,
	get_pci_string, match_adapter, list_db_adapters, do_adapter;
	sysfs_pci_info now uses sysfs_pci_string; get_pci_info now uses
	sysfs_get_adapter_class.

	* scripts/scan.d/30device-tree:
	In function dt_find_adapter, add debug and change echo to stderr to be debug.

2003-08-15  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	maybe_fake_model now looks for both "machine" and "model name" in
	/proc/cpuinfo.  It now shows something vaguely useful on my Thinkpad.
	:-)

2003-08-14  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	"echo 1>&2" changed to "debug" in several places.  "exit 1" changed to
	"return 1" in several places.

2003-08-13  Martin Schwenke  <martins@rover>

	* scripts/scan.d/00minimal:
	Changed module name in debug messages to "minimal".

	* scripts/scan.d/00minimal:
	Added debug to functions match_adapter and do_adapter.

2003-08-08  Martin Schwenke  <martins@rover>

	* scripts/scan.d/30device-tree:
	In function scsi_do_device_hook, use variable $outdir for output
	directory.

	* scripts/lsvpd.in:
	Use function list_linux_vpd_files_all instead of using find directly.
	Replace use of xargs (which is in /usr/bin) will a read loop.

	* scripts/common.d/00minimal: New function list_linux_vpd_files_all.

	* scripts/lscfg.d/00minimal, scripts/lscfg.d/40ibm,vpd:
	New function list_linux_vpd_files.

	* scripts/lsvpd.in: Check database initialisation.

2003-08-01  Martin Schwenke  <martins@rover>

	* src/Makefile: Replaced GStringIter with growbuf.

	* .distfiles: Added and changed files under setup/ for lscfg.

	* scripts/lsvpd.in:
	Use @libdir@/{common,lsvpd}.d/*.  $dt is now $db and is defined in
	common.d/00minimal.

	* scripts/lscfg.d/40ibm,vpd, scripts/common.d/00minimal, scripts/lscfg.d/00minimal:
	New file.

	* scripts/update-lsvpd-db.in:
	Don't call db_configure.  That's now implicit.

	* scripts/update-lsvpd-db.in:
	Moved initialisation of variable vardir into db_configure and moved
	that function to setup/common.d/00minimal.  Call maybe_fake_model and
	maybe_fake_system-id at end.

	* scripts/scan.d/00minimal:
	Add -p to mkdir in db_initialise.  New functions maybe_fake_model and
	maybe_fake_system-id.

2003-07-31  Martin Schwenke  <martins@rover>

	* scripts/scan.d/40ibm,vpd, scripts/scan.d/20sysfs, scripts/scan.d/00minimal:
	New file.

	* scripts/update-lsvpd-db.in:
	Abstracted and extracted many functions into setup/scan.d/*.

	* scripts/Makefile, scripts/scan.d/30device-tree: New file.

	* .distfiles:
	Remove dt_find_adapter.in - now in setup/scan.d/30device-tree.

2003-07-29  Martin Schwenke  <martins@rover>

	* .distfiles: Removed pci/ibm_vpd_to_txt.[ch].

	* src/util.c:
	In function read_file_contents, fixed bad memory free in bail branch.

	* src/ibm_vpd_render.c:
	In main, use fwrite to print txt, not fputs, since growbuf_data(txt)
	is not (necessarily) NUL-terminated.

	* Makefile: No more glib.

	* .distfiles: Switch from GStringIter.* to growbuf.*.

	* src/pci_vpd_cap_grab.c:
	In main, use growbuf_length(frag) instead of frag->len.

	* src/pci_vpd_cap_grab.c:
	Update copyright.  Part of lsvpd package, not rtasdiag utils.  Use
	growbuf instead of glib/GString and GByteArray.

2003-07-28  Martin Schwenke  <martins@rover>

	* src/pci_vpd_gen_grab.c, src/pci_vpd_gen_grab.h:
	Update copyright.  Part of lsvpd package, not rtasdiag utils.  Use
	growbuf instead of glib/GString.

	* src/util.c:
	In function read_file_contents initialise *buf to a void bogus free if
	goto bail.

	* src/ibm_vpd_render.c:
	Removed use of glib.  Use growbuf instead of GString.  Removed
	function grab_file.  Moved function ibm_vpd_to_txt here from
	ibm_vpd_to_txt.c.

	* src/growbuf.c: In growbuf_iter_free, don't free the growbuf's data.

	* src/growbuf.h, src/growbuf.c, src/test/test_growbuf.c: New file.

	* src/Makefile: tdump needs util.{h,o}

2003-07-25  Martin Schwenke  <martins@rover>

	* src/util.c: file_write_contents: set file mode in open(2).

	* src/pci_lookup.c: In main free(data), not munmap(data, len).

	* src/tdump.c: In main free(data).

	* src/util.c:
	file_read_contents now returns malloced memory and is NUL-terminated.

	* src/util.h:
	Removed comment about munmap being needed to free memory.  This won't
	be true in a couple of minutes.

	* src/util.c:
	file_write_contents: oops, initialised variable done to 0.

	* src/pci_lookup.c:
	skip_and_print_to_newline now modifies pci.ids memory buffer returned
	by mmap.

	* src/util.c:
	Use private, writable memory for mmap in file_read_contents.

	* src/pci_lookup.c: Use asprintf instead of strconcat2, strconcat3.

	* src/util.c:
	Removed strconcat2, strconcat3 - use asprintf instead.  Modified
	build_relative_filename accordingly.

	* src/util.h: Removed strconcat2, strconcat3 - use asprintf instead.

2003-07-24  Martin Schwenke  <martins@rover>

	* src/util.h: Fixed copyright, comments.

	* src/util.h:
	Removed dependency on glib, most functions changed, including argument
	list.  New functions strconcat2, strconcat3, build_relative_filename,
	read_file_contents.

	* src/tdump.c: Removed dependency on glib.

	* src/util.c:
	Removed dependency on glib, most functions changed, including argument
	list.  New functions strconcat2, strconcat3, build_relative_filename,
	read_file_contents.

	* src/pci_lookup.c: New file.

	* src/util.c:
	(file_relative_read_contents, file_relative_write_contents):
	simplified using g_build_filename.

2003-07-22  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.8.7.

	* src/scsivpd.conf:
	Changed IBM;cdrom;CDRM00203 to wildcard on *RM00203 to catch DVD-RAM
	drives.  This wildcard could be loosened later to cover more/all IBM
	CD-ROM drives.

	* scripts/update-lsvpd-db.in:
	New function sysfs_dir to facilitate better handling of sysfs.

2003-07-18  Martin Schwenke  <martins@rover>

	* src/Makefile: New file.

	* .distfiles:
	Added scsi/scsi-functions.bash.  Removed scsi/scs_vpd_inquire and
	scsi_scsi_vpd_render.

	* scripts/update-lsvpd-db.in:
	Added source of scsi-functions.bash.  In function scsi_do_device,
	scsi_vpd_render stdout is now redirected directly to linux,vpd file.

	* scripts/lsvpd.in:
	Check for extraneous arguments (without flags) and print usage message
	if present.

2003-07-02  Martin Schwenke  <martins@rover>

	* Makefile:
	Fixed the dist target so that everything happens in $(TARBALLS).  It
	was leaving a half-baked tarball in the top-level directory.

	* Makefile: dist tarball now gets constructed in $(TARBALLS).

	* Makefile: Bumped version to 0.8.6.

2003-07-01  Martin Schwenke  <martins@rover>

	* scripts/lsvpd-functions.bash:
	In function unpack_device_tree_archive, the trap now makes the
	device-tree writable before tryig to remove it.

2003-06-27  Martin Schwenke  <martins@rover>

	* .distfiles: Removed scsi/scsi_vpd_scan - no longer needed.

	* scripts/update-lsvpd-db.in:
	- Removed optional device-tree and scsidir arguments to script - too
	  many external commands are used for this to work sensibly.

	- Removed function scsi_get_ax, and replaced with neater (shorter) new
	  function scsi_hbtl_to_dev.

	- New function sysfs_pci_info, moved from lib/lsvpd-functions.bash,
	  allows easy retrieval of PCI (dom,bus,dev,fun) for a PCI adapter.

	- Changes to allow processing of individual devices and adapters - in
	  the long term this involves splitting some of the functions out to a
	  library, so that they can be used by other scripts; for now the
	  functions are still here.

	  scsi_match_adapter:  Now takes just the name of a SCSI adapter
	  (e.g. "host1") and uses sysfs_pci_info directly if /sys is
	  available.  File device-tree-node is now created 1 level higher,
	  since the PCI subdirectory is not needed if sysfs is being used, but
	  it does unconditionally create the directory that will contain that
	  file.

	  New functions scsi_list_adapters, scsi_list_devices and
	  ethernet_list_adapters - the logic for these has been separated out
	  from the per-adapter/device code.

	  scsi_do_device now takes just an sg device node, does the SCSI
	  inquiries for that node (using scsi_vpd_inquire) and then does the
	  parsing, field manufacturing and rendering that it used to do.

	  scsi_do_adapter now expects linux,scsihost file to contain the
	  "scsi" prefix, if it exists.

	  ethernet_match_adapters has been replaced by new functions
	  ethernet_list_adapters and ethernet_match_adapter.

	- New function add_ax adds an AX fields to the given linux,vpd file if
	  it does not already contain one.  The prefix of the AX field is
	  taken from the first 4 characters of the directory name.

	- Variable sdt renamed to source_dt.

	- Logic of main SCSI processing section changed to reflect new
	  scsi_list_* functions and changes to scsi_do_device.

	- Added new main section to use add_ax to add AX fields for various
	  types of device-tree node.  Currently just display.

	- /proc/partitions is now copied verbatim to $dt/linux,partitions,
	  rather than being preprocessed to produce $dt/linux,disk-sizes file.
	  The makes debugging easier, given a device-tree.tar.gz archive.

	* scripts/lsvpd-functions.bash:
	Removed function scsi_get_ax - optimised both uses in different ways.

2003-06-26  Martin Schwenke  <martins@rover>

	* scripts/lsvpd-functions.bash:
	Moved sysfs_pci_info to update-device-tree.in.

2003-06-20  Martin Schwenke  <martins@rover>

	* scripts/lsvpd-functions.bash:
	Moved scsi_get_ax here from update-device-tree.

2003-06-18  Martin Schwenke  <martins@rover>

	* Makefile:
	dist target now puts tarball into TARBALLS/ directory.  Added new
	ChangeLog target.

	* .distfiles: Added ChangeLog.

	* scripts/lsvpd-functions.bash:
	hex2dec now uses implicit arithmetic conversion, via $((...)), rather
	than printf.  This should be faster... although if speed was terribly
	important this would all be written in C!

2003-06-17  Martin Schwenke  <martins@rover>

	* .distfiles: Added lsvpd.cron.daily.in.

	* src/ibm_vpd_render.c, src/util.c, src/tdump.c:
	Added #include <stdlib.h> to avoid compiler warning.  Changed comment
	to say this is part of lsvpd package.  Bumped copyright.

	* Makefile: Added lsvpd.cron.daily.in to GEN_SRC.

	* Makefile: Added dependency for lsvpd.cron.daily.

	* Makefile: Bumped version to 0.8.5.

	* scripts/update-lsvpd-db.in:
	In function scsi_match adapter: simplified retrieval of PCI
	information, since it is now in a single file.  In function
	ethernet_match_adapters: simplified by using shell function
	sysfs_pci_info in direct combination with dt_find_adapter.

	* scripts/dt_find_adapter.in:
	Now accepts arguments device-tree, dom, bus, dev, fun, where the last
	4 are in hexadecimail format.  All check_* functions now accept
	hexadecimal arguments and convert to decimal as needed.  Renamed
	function check_phbprop to check_pci_domain - 2nd argument is now just
	the PCI domain, in hex.  Variable phbprop renamed to pci_domain_prop,
	and "linux,pci-domain" added to list of possibilities.  Comments
	cleaned up to talk about PCI domains and bignum machines instead of
	using ad hoc terminology.  Removed unneeded dec2hex conversions and
	added a hex2dec on $fun in one spot.

	* scripts/lsvpd-functions.bash: New function sysfs_pci_info.

	* scripts/update-lsvpd-db.in:
	Implemented ethernet adapter/device-tree matching with sysfs.

	* scripts/dt_find_adapter.in:
	Added linux,pci-domain for magic property in PCI nodes.

2003-06-16  Martin Schwenke  <martins@rover>

	* scripts/tidy_lsvpd_dbs.in:
	Got rid of $pattern.  Put glob pattern explicitly in loop and regexp
	pattern explicitly in call to tidy_subdirs.

	* scripts/tidy_subdirs:
	$2 is now a regexp, as allowed by grep.  Temporary directories now
	start with '.'.  Reimplemented compress_group and main loop to avoid
	long command lines as much as possible.

2003-05-26  Martin Schwenke  <martins@rover>

	* scripts/tidy_lsvpd_dbs.in:
	Run update-device-tree if it hasn't been run.  Change command-line
	arguments to tidy_subdirs.

	* scripts/tidy_subdirs:
	Now accepts separate directory and glob pattern.  This is a more
	standard way of doing things.  Along with the above, use find to
	minimise the length of command line passed to ls.

2003-05-23  Martin Schwenke  <martins@rover>

	* Makefile: New file.

	* .distfiles:
	Added COPYING, NEWS, TODO, tidy_device_trees.in, tidy_subdirs files,
	and added ".in" suffix to lscfg and lsvpd.

	* scripts/lsvpd-functions.bash: Added copyright message.

	* scripts/update-lsvpd-db.in, scripts/dt_find_adapter.in, scripts/lsvpd.in:
	Changed comment to say Linux lsvpd package, not other stuff.
	Added 2003 to copyright.

	* scripts/lsvpd.in:
	Added -z option to use device-tree tgz archive.  Renamed to lsvpd.in
	to get access to shell function library.

	* scripts/lsvpd-functions.bash:
	New function unpack_device_tree_archive.

2003-05-22  Martin Schwenke  <martins@rover>

	* scripts/tidy_lsvpd_dbs.in, scripts/tidy_subdirs: New file.

	* scripts/update-lsvpd-db.in:
	Date/time in device-tree directory name now has no colons in time,
	since this confuses tar.  Old device-tree only renamed to
	device-tree-0000-00-00-000000 when it is not a symlink.

	* scripts/lsvpd-functions.bash: Added readlink.

2003-04-29  Martin Schwenke  <martins@rover>

	* scripts/dt_find_adapter.in:
	Optimised away some hex2dec and dec2hex calls.

	* scripts/lsvpd-functions.bash:
	Simplified dec2hex and hex2dec using printf.

2003-03-28  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Remove -prune on find.  busybox doesn't implement it.

	* scripts/update-lsvpd-db.in:
	Factored out new function manufacture_yl.  Moved most code from
	dt_find_scsi_node to new function scsi_match_adapter, which drops
	cross reference files into $dt and $scsidir. dt_find_scsi_node now
	does less work.  new function scsi_do_device contains most of the code
	that used to be in the main SCSI loop.  New function scsi_do_adapter
	synthesises linux,vpd for SCSI adapters.  New function
	ethernet_do_adapter synthesises VPD for Ethernet adapters.  Main SCSI
	loop now much shorter and easier to read, and ensures linux,vpd props
	exist for adapters.  New loop for Ethernet adapters.

2003-03-26  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Moved ${scsidir}/disk-sizes to ${dt}/linux,disk-sizes.

	* scripts/dt_find_adapter.in:
	Fixed careless bug: check_phbprop grabs hex numbers from file, not
	octal.

2003-03-24  Martin Schwenke  <martins@rover>

	* scripts/lsvpd-functions.bash: Removed nulcat.  It didn't work.

	* scripts/lsvpd-functions.bash: Make that "nulcat".

	* scripts/lsvpd-functions.bash: New function nullcat().

2003-03-21  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Filter comments from sg_map output, and throw away stderr.

	* scripts/update-lsvpd-db.in: Changed "partitions" to "disk-sizes".

2003-03-20  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	If /proc/partition is available, dump disk names and sizes to
	$scsidir/partitions.   This is in preparation for adding size info to
	output in at least lscfg.

2003-03-18  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	dt_find_scsi_node now exits on error, rather than returning.  New
	function scsi_get_ax, which uses the output of sg_map -x to match up
	block/sg devices.  Use dirname function in a few spots, instead of
	using sed directly.  Factor out distillation of host/bus/target/lun
	into a single spot.  AX field now contains short SCSI device name as
	reported by sg_map, not devfs version.  Added a few comments.

	* scripts/dt_find_adapter.in:
	Better attempt to decide whether a machine is "bignum" - might have
	PCI bus numbers >255, so linux,phbnum props need to be used.

2003-03-13  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Needs bash, not just sh.  Use dec2hex from lsvpd-functions.bash.
	scsi_dt_find_host renamed to dt_find_scsi_node, which now looks for
	subdirectories in case the adapter is multi-channel and
	dt_find_adapter just finds the top level.  Added separator comments.

	* .distfiles: New file.

	* scripts/lsvpd-functions.bash: Added basename.

	* scripts/dt_find_adapter.in:
	Removed tdump variable.  Moved functions out to
	lib/lsvpd-functions.bash.  Added keyword "function" for clarity.
	Explicity set PATH for easier testing.  Renamed file so Makefile can
	substitute @libdir@.

	* scripts/lsvpd-functions.bash:
	Just renamed file and added comment about needing bash.

	* scripts/lsvpd-functions.bash: New file.

	* scripts/dt_find_adapter.in:
	Factorised unreadable code into shell functions.  Reworked logic to
	search for PCI bus top-down - the odl logic was broken.  Removed type
	parameter.

	* scripts/lsvpd.in:
	Use device-tree file with "uname -s -r" output if present.

	* scripts/update-lsvpd-db.in:
	Added device-tree file with "uname -s -r" output.

2003-03-11  Martin Schwenke  <martins@rover>

	* scripts/lsvpd.in: Force dereference of $dt symlink in find.

	* scripts/update-lsvpd-db.in: Oops, mkdir $vardir.

	* scripts/update-lsvpd-db.in: Oops fixed unmatched quote.

	* scripts/lsvpd.in:
	Changed options handling to use getopts.  Added -d option to specify
	device-tree.

	* scripts/update-lsvpd-db.in:
	Don't remove old device-tree.  Now create dated device-tree
	directories and symlink to the current one.  Also parameterised top
	level directory ($vardir).

	* scripts/update-lsvpd-db.in:
	Changed location of device-tree to /var/lib/lsvpd/device-tree.
	Similar for SCSI data.

	* scripts/lsvpd.in:
	Changed location of device-tree to /var/lib/lsvpd/device-tree.

2003-03-03  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Made scsi_dt_find_host a shell function that calls the newly renamed
	dt_find_adapter.

	* scripts/dt_find_adapter.in:
	Fixed documentation to reflect previous changes.

	* scripts/dt_find_adapter.in:
	Renamed from scsi_dt_find_host (which is now just a shell function in
	update-device-tree) and threw out the SCSI specific bit.  Now looks
	for linux,phbnum if linux,global-number is not there.

2002-11-07  Martin Schwenke  <martins@rover>

	* src/util.h:
	Added cpu_to_le32 and le32_to_cpu.  Also cleaned up the 16-bit ones...

	* src/pci_vpd_cap_grab.c:
	Moved big_cool_{read,write} to ../lib/util.[ch].

	* src/util.h: Added #include <sys/types.h>.

	* src/util.c: Moved #define _XOPEN_SOURCE to top.

	* src/util.h, src/util.c: Added big_cool_{read,write}.

	* src/pci_vpd_cap_grab.c:
	Abstracted out reading/top-level-parsing of VPD to
	pci_vpd_gen_grab.[ch].

	* src/pci_vpd_gen_grab.h, src/pci_vpd_gen_grab.c: New file.

2002-10-25  Martin Schwenke  <martins@rover>

	* src/pci_vpd_cap_grab.c:
	Added more comments throughout.  (vpd_byte): restructured for
	readability.  (have_capabilities, find_vpd_capabilities): use of pci.h
	#defines instead of hard-coded constants.  (find_vpd_capabilities):
	code to detect correct position of capability list, depending on
	header type.  (grab_vpd): restructured for clarity.  (main): better
	error handling.

2002-10-24  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in: s/pci_vpd_render/ibm_vpd_render/

	* src/ibm_vpd_render.c:
	Change of include file name and associated function (ibm_vpd_to_txt).

	* src/pci_vpd_cap_grab.c: Removed le16_to_cpu and cpu_to_le16.

	* src/util.h: Added le16_to_cpu and cpu_to_le16.

	* src/pci_vpd_cap_grab.c:
	Fixed crash on failed open.  Changed message about no capabilities
	list to "return 1".

	* src/pci_vpd_cap_grab.c: This works.  :-)

	* src/pci_vpd_cap_grab.c: New file.

2002-09-23  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf:
	For enclosures, we don't want the FN, even though it looks OK.  We
	want a broken looking Z1 instead!

2002-09-20  Martin Schwenke  <martins@rover>

	* src/scsivpd.conf: Removed SN field from enclosure type.

2002-09-17  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Add /sbin to PATH, assuming this is where the sg_* stuff is.

2002-09-03  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	In SCSI YL values, target and LUN are now lowercase hex, not decimal.

	* scripts/dt_find_adapter.in: Took out "not tested" message.

2002-09-02  Martin Schwenke  <martins@rover>

	* scripts/dt_find_adapter.in: Fixed usage message.

2002-08-23  Martin Schwenke  <martins@rover>

	* scripts/dt_find_adapter.in:
	Remove -prune on find.  This is just an optimisation and doesn't work
	with busybox's find.

	* scripts/dt_find_adapter.in: Fixed order of parameters.

2002-08-14  Martin Schwenke  <martins@rover>

	* scripts/update-lsvpd-db.in:
	Added copyright/license.  Change PATH to include @libdir@.

	* scripts/update-lsvpd-db.in:
	Eek, library directory should not be in /usr.

	* scripts/update-lsvpd-db.in, scripts/lsvpd.in: New file.

2002-08-12  Martin Schwenke  <martins@rover>

	* scripts/dt_find_adapter.in: Make $dt the 1st argument.

	* src/ibm_vpd_render.c: Sensible reimplimentation of grab_file.

	* src/util.h, src/util.c, src/tdump.c, src/scsivpd.conf, scripts/dt_find_adapter.in:
	New file.

2002-06-19  Martin Schwenke  <martins@rover>

	* src/ibm_vpd_render.c:
	Actually implemented proper main().  Use g_string_append_len() to make
	building buffer trivial.  Added copyright message.

2002-06-05  Martin Schwenke  <martins@rover>

	* src/ibm_vpd_render.c: New file.

