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

	* Makefile: Changed VERSION to 0.12.7.

	* scsi/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.

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

	* lsmcode.in:
	In render_other_vpd, ZM becomes UL (Keith Matthews <keith@au1.ibm.com>).

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

	* setup/scan.d/07device_ide_proc:
	In add_device_ide, got rid of $number calculation - $bus_info is now
	just ide/${channel}.${unit} again.  The $number stuff can happen in
	the pSeries specific code, since it is pretty limited in the kernel
	anyway.  Also in add_device_ide added cases for tape and floppy
	drives.

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

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

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

	* lib/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-22  Martin Schwenke  <martins@rover>

	* scsi/scsi_vpd_render.c:
	Cleaned up includes.  Removed function strstrip in favour of new
	function strndup_trim in ../lib/util.c.  Cleaned up implementation of
	dump_field, splitting some functionality into new function
	dump_field_basic - both function now return a bool instead of void.
	Cleaned up implementation of make_ds_value, including addition of
	better error handling.  get_templates reimplemented so the logic is
	now clear - this included splitting off new functions template_matches
	and get_templates_line_scanner.  Function terminate_or_maybe_die
	renamed to strchr_nul_plus_plus, without the option to die - we're
	making this file into a library component, so exiting on errors is no
	longer appropriate.  Similar cleanups to above for functions
	process_template, process_templates and main.

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

	* lsmcode.in:
	Change to render_other_vpd to support UM, UT, UF fields (particularly
	to support ACARD).  This change by Keith Matthews <keith@au1.ibm.com>.

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

	* lib/util.c: Rewrote file_write_contents.

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

	* setup/scan.d/07device_scsi_sg_inq:
	In scsi_vpd_enumerate, added exception for U? fields.

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

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

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

	* lib/util.h.in:
	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.

	* lib/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.

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

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

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

	* lib/util.h.in, lib/util.c: Added strndup_trim.

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

	* setup/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.

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

	* setup/scan.d/27device_ide_sysfs: Removed function device_set_yl_ide.

	* setup/scan.d/27device_ide_sysfs:
	Removed function add_device_hook_ide.

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

	* 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.

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

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

	* setup/scan.d/10devfs:
	Renamed list_devices_scsi to basic_list_devices_scsi, reimplemented
	using a read-loop instead of calling out to sed, and added a call to
	device_setup_scsi.

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

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

	* setup/scan.d/07device_scsi_sg_scan:
	Renamed list_devices_scsi to basic_list_devices_scsi, reimplemented
	using a read-loop instead of calling out to sed, and added a call to
	device_setup_scsi.  Add basic_list_devices_scsi to new global variable
	$list_devices_functions.

	* setup/scan.d/07device_ide_proc:
	As for adapters, module load condition now checks for
	/proc/ide/drivers instead of just /proc/ide.  Renamed list_devices_ide
	to proc_list_devices_ide, reimplemented using a read-loop instead of
	calling out to sed, and added a call to device_setup_ide.  Add
	proc_list_devices_ide to new global variable $list_devices_functions.

	* setup/scan.d/27device_scsi_sysfs:
	Removed function list_devices_scsi and removed unset of function
	device_setup_scsi (since it is no longer a top-level function).

	* setup/scan.d/27device_ide_sysfs:
	Removed function list_devices_ide and removed unse of function
	device_setup_ide (since it is no longer a top-level function).

	* setup/scan.d/070device: device_setup is no longer multiplexed.

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

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

	* setup/scan.d/01adapter_defs:
	Added definitions for type serial to adapter_set_ds_DEFAULT,
	adapter_set_output_prefix.  New function adapter_set_minimum_unknown
	allows per-type setting of minimum adapter number for adapters unknown
	to the OS - this allows display and serial adapters to start at 0.

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

	* src/device.c: New file.

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

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

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

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

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

	* setup/scan.d/070device: New file.

	* setup/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>

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

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

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

	* setup/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.

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

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

	* lib/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.

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

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

	* setup/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.

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

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

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

	* pci/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>

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

	* pci/Makefile:
	Removed pci_vpd_rom_grab*.  ibm_vpd_render now uses pci_vpd_parse.c
	and ../lib/{growbug,vpd}.h.

	* pci/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>

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

	* lib/test_vpd.c, lib/vpd.h, lib/vpd.c: New file.

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

	* Makefile: Changed VERSION to 0.12.5.

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

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

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

	* setup/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.

	* setup/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.

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

	* scsi/Makefile:
	Removed generated items, now that ../lib/util.h is the only generated
	file.

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

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

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

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

	* setup/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".

	* setup/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.

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

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

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

	* lscfg.in:
	Also added sanity check to render_vpd_value - returns immediately if
	value is null.

	* lscfg.in:
	Added sanity check to render_vpd_line - returns immediately if value
	is null.

	* lsmcode.in:
	render_linux_vpd, render_sys_vpd, and render_other_vpd now expect
	vpd_field_get to set $vpd_value.

	* lscfg.in:
	render_linux_vpd and render_vpd now expect vpd_field_get to set
	$vpd_value.

	* 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.

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

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

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

	* setup/scan.d/03adapter_ide_proc:
	add_adapter_hook now takes all inputs as arguments, so added those.

	* setup/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.

	* setup/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).

	* setup/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.

	* setup/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.

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

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

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

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

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

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

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/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>

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

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

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

	* setup/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.

	* setup/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-25  Martin Schwenke  <martins@rover>

	* setup/scan.d/33adapter_scsi_dt_nosysfs:
	linux,lsvpd-pci-scsi-map now called lsvpd,pci-scsi-map.

	* setup/scan.d/33adapter_ethernet_dt_nosysfs:
	linux,lsvpd-pci-ethernet-map now called lsvpd,pci-ethernet-map.

	* setup/scan.d/33adapter_ide_dt_nosysfs:
	linux,lsvpd-pci-ide-map now called lsvpd,pci-ide-map.

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

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

	* setup/scan.d/27device_scsi_sysfs:
	sysfs_scsi_usb_hack now calls set_sysfs_adapter_class instead of
	sysfs_get_adapter_class.

	* setup/scan.d/27device_ide_sysfs:
	device_set_yl_ide should now be correct.

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

	* setup/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*".

	* setup/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.

	* setup/scan.d/07device_ide_proc:
	In add_device_ide, added manufacturer Pioneer.

	* lib/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>

	* setup/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.

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

	* setup/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.

	* setup/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.

	* setup/scan.d/27device_ide_sysfs:
	device_set_yl_ide also removes =* from $bus_info before use.

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

	* setup/scan.d/27device_ide_sysfs:
	New function add_device_hook_ide removes =* from $bus_info. and calls
	add_device_hook_DEFAULT.

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

	* setup/scan.d/07device_ide_proc:
	add_device_ide now adds "=$number" to $bus_info for add_device_hooks
	(in particular, for ibm,loc-code).

	* setup/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>

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

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

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

	* 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.

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

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

	* lsvpd_test.in: Removed use of readlink.

	* setup/scan.d/07device_ide_proc:
	In add_device_ide, removed use of readlink and local variable $l.

	* setup/scan.d/27device_scsi_sysfs:
	In functions list_devices_scsi and sysfs_scsi_usb_hack, removed calls
	to readlink.  In add_device_hook_scsi, replaced some code with call to
	device_set_yl.

	* setup/scan.d/27device_ide_sysfs:
	Removed function add_device_hook_ide and put interesting parts into
	new function device_set_yl_ide.

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

	* setup/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.

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

	* 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.

	* setup/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.

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

	* setup/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.

	* setup/scan.d/01adapter_defs:
	adapter_set_ds now multiplexed, renamed to adapter_set_ds_DEFAULT.

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

	* setup/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".

	* setup/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>

	* setup/scan.d/07device_scsi_sg_scan:
	get_kernel_device_name_scsi now sets $device_name, and no longer uses
	sed but reads through sg_map-x itself.  get_major_minor_scsi also no
	longer uses sed.

	* setup/scan.d/07device_scsi_sg_inq:
	scsi_vpd_enumerate no longer sets local variable $oldpwd - relies on
	POSIX $OLDPWD instead.

	* setup/scan.d/07device_ide_proc:
	add_device_ide calls updated version of get_kernel_device_name.
	get_kernel_device_name now sets $device_name, and no longer uses sed
	but reads through ide_map itself.

	* setup/scan.d/27device_ide_sysfs:
	Removed (and now specifially unset) function
	get_kernel_device_name_ide - rely on get_kernel_device_name_DEFAULT
	instead.  add_device_hook_ide no longer sets $adapter_os_dir and now
	uses new function device_set_adapter_yl.

	* setup/scan.d/27device_scsi_sysfs:
	get_kernel-device_name_scsi now calls get_kernel-device_name_DEFAULT,
	which contains most of the logic.  add_device_hook_scsi no longer sets
	$adapter_os_dir and now uses new function device_set_adapter_yl.
	sysfs_scsi_usb_hack no longer sets $adapter_bus_dir and now calls
	device_backlink_adapter_bus_dir.

	* setup/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!).

	* setup/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-10  Martin Schwenke  <martins@rover>

	* setup/scan.d/07device_scsi_sg_scan:
	Moved functions get_kernel-device_name_scsi and get_major_minor_scsi
	here from 07device_scsi_sg_inq.

	* setup/scan.d/07device_scsi_sg_inq:
	Moved functions get_kernel-device_name_scsi and get_major_minor_scsi
	to 07device_scsi_sg_scan.

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

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

	* setup/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.

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

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

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

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

	* setup/scan.d/27device_scsi_sysfs:
	Removed function sysfs_add_device_bus_alias_scsi - replaced with
	non-multiplexed version.

	* setup/scan.d/27device_ide_sysfs:
	Removed function sysfs_add_device_bus_alias_ide - replaced with
	non-multiplexed version.

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

	* setup/scan.d/01adapter_defs:
	In adapter_set_ds, removed special case for SCSI/fibre-channel -
	special-case needs to be done according to sysfs/device-tree so it
	doesn't belong here.

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

	* setup/scan.d/03adapter_ide_proc:
	In add_adapter_ide, removed explicit setting of $ds - add_adapter_hook
	does this anyway.

	* setup/scan.d/03adapter_ide_proc:
	Call adapter_set_ds rather than get_adapter_ds.

	* setup/scan.d/01adapter_defs: New file.

	* setup/scan.d/07device_ide_proc:
	In add_device_ide, removed setting of unused variable $os_prefix.

	* setup/scan.d/03adapter_ide_proc:
	add_adapter_ide calls set_adapter_bus_dir instead of old
	get_adapter_bus_dir, so renamed $node to $adapter_bus_dir and added
	check to ensure this variable actually gets set.

	* setup/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.

	* setup/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.

	* setup/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.

	* update-lsvpd-db.in, setup/scan.d/33adapter_scsi_dt_nosysfs, setup/scan.d/33adapter_ide_dt_nosysfs, setup/scan.d/33adapter_ethernet_dt_nosysfs, setup/scan.d/03adapter_ide_proc, setup/scan.d/00minimal, setup/scan.d/30device-tree, setup/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.

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

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

	* setup/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.

	* setup/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.

	* setup/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.

	* lsvpd.in: In render_linux_vpd_directory, call should_render.

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

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

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

	* lsmcode.in:
	Moved should_render to setup/lsmcode.d/40ibm,vpd.  render_linux_vpd
	now calls 4 argument version of should_render.

	* setup/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.

	* lscfg.in:
	Moved should_render to setup/lscfg.d/40ibm,vpd.  render_linux_vpd now
	calls 4 argument version of should_render.

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

	* setup/scan.d/33adapter_scsi_dt_nosysfs:
	Removed unset of adapter_setup_scsi.

	* setup/scan.d/33adapter_ide_dt_nosysfs:
	Removed unset of adapter_setup_ide.

	* setup/scan.d/33adapter_ethernet_dt_nosysfs:
	Removed unset of adapter_setup_ethernet.

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

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

	* pci/Makefile:
	Added $(GEN), mostly to allow proc_pci_class.c to be removed by "make
	clean".

	* pci/Makefile: Added rules for pci_*_map programs.

	* .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.

	* setup/scan.d/03adapter_ide_proc: Removed function adapter_setup_ide.

	* setup/scan.d/33adapter_ide_dt_nosysfs: New file.

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

	* pci/pci_ethernet_map.c:
	print_dodgy_matches now takes a second argument, the complete list of
	Ethernet adapters.  Added an extra heuristic to print_dodgy_matches:
	an address/name pair will not be printed if (1) the name has other
	addresses and (2) the address in question matches uniquely for another
	name.

	* setup/scan.d/07device_ide_proc:
	add_device_ide now sets variable $number - this seems to be the only
	way of ensuring that the correct device-tree $device_bus_dir is
	constructed.

	* setup/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-21  Martin Schwenke  <martins@rover>

	* setup/scan.d/07device_ide_proc:
	device_setup_ide should now get channel.unit correct.

	* setup/scan.d/27device_ide_sysfs:
	New function list_devices_ide. Removed function device_setup_ide -
	unset it instead.

	* setup/scan.d/27device_scsi_sysfs:
	Removed unused variable from list_devices_scsi.

	* setup/scan.d/27device_scsi_sysfs:
	Removed function sysfs_fake_sg_map_x.  New function
	list_devices_scsi. Removed function device_setup_scsi - unset it
	instead.  In function get_kernel_device_name, added check for "tape"
	link and added an extra variable to make the code a little bit
	cleaner.

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

	* setup/scan.d/33adapter_scsi_dt_nosysfs:
	dt_adapter_crosslink_scsi now correctly handles channels.

	* setup/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.

	* pci/pci_scsi.h: New file.

	* pci/pci_scsi_map.c:
	print_dodgy_matches now takes a second argument, the complete list of
	SCSI adapters.  Added an extra heuristic to print_dodgy_matches: an
	address/name pair will not be printed if (1) the name has other
	addresses and (2) the address in question matches uniquely for another
	name.

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

	* setup/scan.d/33adapter_scsi_dt_nosysfs, setup/scan.d/33adapter_ethernet_dt_nosysfs:
	New file.

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

	* pci/pci_ethernet_map.c:
	Normalise and just print 3 columns separated by a space: PCI address
	name and hardware address.  New function print_item to support this.

	* pci/pci_scsi_map.c:
	Removed extraneous break from print_dodgy_matches.

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

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

	* pci/pci_scsi_map.c:
	Normalise and just print 2 columns separated by a space: PCI address
	and name.

	* pci/pci_scsi_map.c: In main, name of adapter is hostX not scsiX.

	* pci/pci_scsi_map.c: New file.

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

	* pci/pci_scsi.c: New file.

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

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

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

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

	* scsi/scsi_vpd_render.c:
	Renamed scsi_vpd_render.c.in to scsi_vpd_render.c, and made
	TEMPLATE_FILE depend on LSVPD_LIBDIR.

	* scsi/Makefile:
	Removed make of scsi_vpd_render.c from scsi_vpd_render.c.in - now uses
	LSVPD_LIBDIR from util.h.

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

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

	* pci/pci_ethernet_map.c: New file.

	* pci/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.

	* pci/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>

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

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

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

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

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

	* pci/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.

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

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

	* pci/pci_ethernet.h: New file.

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

	* pci/pci_ethernet.c: New file.

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

	* pci/proc_pci.h: New file.

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

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

	* lib/util.h.in: Added line_scanner_harness.

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

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

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

	* pci/proc_pci.c: New file.

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

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

	* setup/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.

	* 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.

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

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

	* setup/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.

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

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

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

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

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

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

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

	* setup/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.

	* setup/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>

	* setup/scan.d/07device_ide_proc:
	In add_device_ide when the "identify" file is read, instead of forking
	a couple of processes and then doing a single, large string
	substitution, read the file line-by-line, substituting within each
	line.  This is faster in general, given the file size, and also avoids
	a current $LANG-related bug in bash string substitutions in some
	versions of bash.

	* lib/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.

	* lsmcode.in:
	Changes to make all output go through $sys_output & $other_output,
	partly so that a valid return code can be generated: render_all now
	only adds "sys0!" to $sys_output if $tabular is true; render_all
	prints a newline after "$other_output"; render_all returns true if
	$sys_output or $other_output is set; render_sys_vpd no longer prints
	output, but assigns to $sys_output; render_other_vpd no longer prints
	output, but assigns to $other_output without adding a trailing
	newline.  render_other_vpd now uses new -c and -s options to tdump to
	avoid creating extra processes.

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>

	* setup/scan.d/27device_scsi_sysfs:
	New functions sysfs_add_device_bus_alias_scsi and
	remove_device_hook_scsi.  In add_device_hook_scsi, fixed calculation
	of $yl so it depends on whether sysfs_add_device_hook_common or
	sysfs_scsi_usb_hack succeeded.

	* setup/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.

	* setup/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.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	adapter_setup_scsi passes an extra wildcard to pci_hack_dom_bus_hook,
	representing an unknown memory value.

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	adapter_setup_ethernet now also extracts memory information from
	ifconfig and passes it to pci_hack_dom_bus_hook.

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

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

	* setup/query.d/OLD/21sysfs_hotplug: New file.

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

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

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

	* setup/scan.d/00minimal, setup/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>

	* setup/scan.d/27device_scsi_sysfs:
	add_device_hook_scsi now needs to do a dirname/basename combination to
	determine adapter part of $yl.

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	/proc/ide/drivers is a file, not a directory.

	* setup/scan.d/07device_scsi_sg_inq:
	Added special case to add_device_scsi so it ignores $hbtl that looks
	like *:255:255:255.  This stops ipr adapter-generated stuff from
	appearing.

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

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

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

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

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

	* lsmcode.in, lscfg.in, 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.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	adapter_setup_scsi now uses $LSVPD_LIBDIR rather than $libdir.

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

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

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

	* 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.

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

	* 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.

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

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

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

	* lsmcode.in, lscfg.in, lsvpd.in:
	do_setup now also sources modules from common-post.d.

	* setup/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.

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

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

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

	* setup/scan.d/27device_scsi_sysfs:
	New function sysfs_scsi_usb_hack used in add_device_hook_scsi when
	sysfs_add_device_hook_common fails.

	* setup/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>

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

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

	* setup/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.

	* setup/scan.d/OLD/01adapter_usb_defs: New file.

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

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

	* setup/scan.d/03adapter_ide_proc:
	Change the module load check to try looking for /proc/ide/drivers -
	hopefully this is more sane than checking for /proc/ide/ide0.

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

	* setup/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.

	* setup/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>

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

	* lscfg.in: In render_vpd_line, added keywords VK.

	* lscfg.in: In render_vpd_line, added keywords CL and MI.

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

	* lsmcode.in:
	New function is_sys contains logic to check if the VPD chunk is a
	system one.  should_render now succeeds if $name is "sys0" and VPD
	chunk is a system one.  render_vpd now uses is_sys.  render_sys_vpd
	now contains a first cut at printing the system firmware version on
	some POWER 5 systems in the same way as AIX (all 3 versions) -
	currently prints a label of "b" for 3rd version since don't know how
	to work out which image is currently booted.

	* setup/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>

	* setup/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.

	* setup/scan.d/07device_ide_proc:
	Renamed get_device_name_ide to get_kernel_device_name_ide.
	add_device_ide now calls add_device_hooks rather than add_device_hook.

	* setup/scan.d/07device_scsi_sg_inq:
	Renamed get_device_name_scsi to get_kernel_device_name_scsi.

	* setup/scan.d/27device_ide_sysfs:
	Renamed get_device_name_ide to get_kernel_device_name_ide.

	* setup/scan.d/27device_scsi_sysfs:
	Renamed get_device_name_scsi to get_kernel_device_name_scsi.

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

	* setup/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.

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

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

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

	* setup/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.

	* setup/scan.d/27device_ide_sysfs:
	New functions add_device_hook_ide (moved here from 20sysfs),
	sysfs_add_device_bus_alias_ide, remove_device_hook_ide.

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

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

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

	* setup/scan.d/07device_ide_proc, setup/scan.d/07device_scsi_sg_inq:
	Renamed functions do_device* to add_device*.

	* setup/scan.d/27device_scsi_sysfs: Fixed typo in initial file comment.

	* setup/scan.d/07device_ide_proc:
	device_setup_ide, list_devices_ide, get_device_name_ide: no longer
	have device_type in ide_map file.  In do_device_ide, add manufacturer
	Hitachi.

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

	* setup/scan.d/27device_ide_sysfs: New file.

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

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

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

	* lscfg.in:
	Removed check to make sure that VPD field file is readable.  Surely
	this is dead code?  Famous last words...  :-)

	* setup/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.

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

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

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

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

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

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

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

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

	* setup/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.

	* scsi/scsihost.conf: Added template for ipr - same as ibmsis.

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	adapter_setup_ethernet no longer skips an adapter for which it can't
	find an IRQ - it now wildcards the IRQ.

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

	* setup/scan.d/OLD/03adapter_scsi_proc:
	In adapter_setup_scsi, printf format must now be %s, not %d, so it can
	accomodate the IRQ wildcard.

	* setup/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.

	* setup/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.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	adapter_setup_scsi no longer skips an adapter for which it can't find
	an IRQ - it now wildcards the IRQ.

	* setup/scan.d/OLD/01adapter_scsi_defs:
	pci_check_class_scsi now also matches PCI class for SCSI RAID
	controllers.

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

	* lsmcode.in:
	In is_service_processor, removed "Service Processor Firmware" as a
	possible value.

	* lsmcode.in:
	render_sys_vpd now checks RM before RL in service processor code.

	* lsmcode.in:
	New function is_service_processor - also contains some extra DS values
	for finding service processor version.  should_render, render_vpd and
	render_sys_vpd now call is_service_processor.

	* 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.

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

	* update-lsvpd-db.in, lsvpd_test.in, 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.

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

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

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

	* setup/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.

	* lsmcode.in:
	New functions render_sys_vpd and render_other_vpd.  render_vpd now
	calls one of the above.  New logic in render_sys_vpd to handle
	firmware version in MI field, and service processor version in CL.

	* .distfiles: Renamed 05adapter_pci_chiprev to 45adapter_pci_chiprev.

	* setup/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>

	* setup/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.

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

	* setup/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.

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

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

	* setup/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.

	* setup/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).

	* setup/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.

	* setup/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.

	* setup/scan.d/07device_scsi_sg_inq:
	In scsi_vpd_inquire, use "if ! ... ; then ..." instead of "if ...  ;
	then : ; else ...".

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

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

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

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

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

	* lsmcode.in, lsvpd.in, lscfg.in:
	Added /usr/sbin and /usr/local/sbin to $PATH.

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

	* setup/scan.d/27device_scsi_sysfs:
	Try doing a "modprobe sg" if /sys/class/scsi_generic doesn't exist.

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

	* setup/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>

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

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

	* lsmcode.in: Call run_dynamic_vpd_hooks.

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

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

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

	* setup/scan.d/OLD/03adapter_scsi_proc:
	In adapter_setup_scsi, replace sub-shell call to basename with
	explicit POSIX string operation.

	* setup/scan.d/03adapter_ide_proc:
	In adapter_setup_ide, replace sub-shell call to basename with explicit
	POSIX string operation.

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

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

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

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

	* setup/scan.d/07device_scsi_sg_inq:
	In do_device_scsi, replace sub-shell calls to dirname with explicit
	POSIX string operation.

	* setup/scan.d/27device_scsi_sysfs:
	In get_device_name_scsi and sysfs_fake_sg_map_x, replace sub-shell
	calls to dirname and basename with explicit POSIX string operations.

	* setup/scan.d/07device_ide_proc:
	In device_setup_ide and do_device_ide, replace sub-shell calls to
	dirname and basename with explicit POSIX string operations.

	* setup/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.

	* setup/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.

	* setup/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-22  Martin Schwenke  <martins@rover>

	* setup/scan.d/27device_scsi_sysfs:
	In sysfs_fake_sg_map_x, change hardcoded /sys to $sysfs_dir.

	* lscfg.in: In render_vpd_value, allow TM to be broken on spaces.

	* setup/scan.d/07device_ide_proc:
	In do_device_ide added manufacturers NEC and Maxtor.

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

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

	* setup/scan.d/OLD/01adapter_display_defs: New file.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/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).

	* setup/scan.d/07device_scsi_sg_inq:
	do_device_scsi now checks return code of do_device_hook rather than
	checking if $device_bus_dir is set.

	* setup/scan.d/07device_ide_proc:
	do_device_ide now checks return code of do_device_hook rather than
	checking if $device_bus_dir is set.

	* setup/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>

	* setup/scan.d/OLD/01adapter_ide_defs:
	That should be pci_check_class_ide, not pci_check_class_scsi.

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

	* setup/scan.d/OLD/01adapter_scsi_defs, setup/scan.d/OLD/01adapter_ide_defs, setup/scan.d/OLD/01adapter_ethernet_defs, setup/scan.d/00pci:
	get_pci_class renamed to pci_check_class.

	* setup/scan.d/OLD/01adapter_ide_defs:
	get_pci_class_ide renamed to check_pci_class_ide - now checks a
	given class value.

	* setup/scan.d/OLD/01adapter_scsi_defs:
	get_pci_class_scsi renamed to check_pci_class_scsi - now checks a
	given class value and covers fibre-channel.

	* setup/scan.d/OLD/01adapter_ethernet_defs:
	get_pci_class_ethernet renamed to check_pci_class_ethernet - now
	checks a given class value.

	* 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>

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

	* setup/scan.d/07device_ide_proc:
	do_device_ide now recognises manufacturer of models starting with "LG".

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

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

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

	* lscfg.in:
	should_render now contains a quick work-around to ensure that devices
	that use "-L*" in YL are displayed when converged location codes are
	in use.

	* .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.

	* setup/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.

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

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

	* setup/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.

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

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

	* setup/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.

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

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

	* lscfg.in:
	In render_header, us $lscfg_ds_lead_spaces, not old $lscfg_lead_spaces.

	* lsvpd.in:
	render_linux_vpd_directory now only strips suffix from field name when
	printing, not before lookup.

	* setup/scan.d/40ibm,vpd:
	ibm_vpd_adapter_init_hook no longer manufactures YL for the top node
	in the device-tree.

	* setup/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!

	* setup/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>

	* setup/scan.d/20sysfs: Oops, ensure rl and rm aren't set.

	* setup/scan.d/20sysfs: Removed dead references to $rm and RM.

	* lscfg.in:
	In render_vpd_line, the default case now does ": $k", so that $k can
	be seen when tracing...

	* setup/scan.d/03adapter_ide_proc:
	do_adapter_ide now calls adapter_extra_vpd_hook after vpd_create_hook.

	* setup/scan.d/00minimal: Removed get_adapter_firmware_version.

	* setup/scan.d/45adapter_pci_chiprev: New file.

	* setup/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.

	* setup/scan.d/00minimal:
	Moved diectory-based VPD generation functions to 00vpd.

	* setup/common.d/00vpd: New file.

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

	* setup/scan.d/07device_scsi_sg_inq:
	do_device_scsi now runs single executable scsi_vpd_render instead of
	old scsi_vpd_std scsi_vpd_custom.

	* scsi/Makefile:
	Now just build scsi_vpd_render from scsi_vpd_render.c.in.

	* scsi/scsi_vpd_render.c:
	Renamed this file from scsi_vpd_custom.c.in.  Moved functions from
	scsi_vpd_std.c and scsi_vpd_custom.c to here and merged mains.

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

	* setup/scan.d/30device-tree:
	list_adapters and get_adapter_bus_dir now explicitly set aliases for
	the parent if $bus_info includes a channel.

	* setup/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.

	* setup/scan.d/07device_scsi_sg_inq:
	In scsi_vpd_enumerate, each field name is followed by a single space.

	* pci/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>

	* setup/scan.d/40ibm,vpd:
	In db_initialise_ibm_vpd, that should be $db_bus_dt_dir.

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

	* setup/scan.d/07device_ide_proc:
	In do_device_ide, simplified handling of identify file.

	* setup/query.d/00minimal:
	In get_model_basic, commented on some obscure code.

	* setup/common-post.d/41ibm,partition-no, setup/scan.d/27device_scsi_sysfs, setup/scan.d/OLD/01adapter_scsi_defs, setup/scan.d/OLD/01adapter_ide_defs:
	Removed unneeded "function" keyword.

	* setup/scan.d/OLD/01adapter_ethernet_defs:
	Oops, made a change this year...  :-)

	* setup/scan.d/OLD/01adapter_fibre_defs, setup/scan.d/OLD/01adapter_ethernet_defs, setup/scan.d/30dmidecode, setup/scan.d/OLD/03adapter_scsi_proc, setup/scan.d/10devfs, lsvpd_test.in:
	Removed unneeded "function" keyword.

	* lsmcode.in:
	Removed -t (test) option.  This was removed from lscfg a while ago.

	* lscfg.in: Removed dead comment.

	* setup/scan.d/30device-tree:
	In dt_do_device_hook_post, removed subshell-strips-NULs nonsense -
	just use "read".

	* setup/query.d/00minimal: Removed unused function stripkey.

	* lsmcode.in:
	Now use VPD API, so now much faster (since only required fields are
	ever read).  Restructured in similar way to lscfg.

	* lscfg.in:
	Folded body of partition_disk_size into disk_size.  printheader
	renamed to print_global_header - now just prints header and doesn't
	read anything.  In fill_field replace use of sed with a simple echo to
	strip extra whitespace.  All other functions basically renamed and
	reimplemented using VPD API - no longer translate/reparse+rerender
	VPD - now shorter and more readable.

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

	* 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.

	* setup/scan.d/03adapter_ide_proc:
	do_adapter_ide uses new API to create VPD.

	* setup/scan.d/07device_ide_proc:
	do_device_ide uses new API to create VPD.  In get_device_name_ide,
	don't strip "/dev/".

	* setup/scan.d/OLD/03adapter_scsi_proc:
	Use more explicit "set -o noglob" instead of "set -f".

	* setup/scan.d/07device_scsi_sg_inq:
	Moved temporary device node creation from do_device_scsi to
	scsi_vpd_inquire - the 1st arg passed between these functions is now a
	SCSI HBTL.  do_device_scsi now uses a temporary directory name that
	includes the HBTL (instead of a fixed name) and uses the new API to
	manipulate VPD.  scsi_vpd_render renamed to scsi_vpd_enumerate - this
	function now creates the field list in the .lsvpd file instead of
	rendering to text.

	* setup/scan.d/20sysfs:
	In do_adapter_DEFAULT, use new VPD API to create and add to VPD.

	* setup/common.d/00minimal:
	Moved vpd_exists here from corresponding file in scan.d directory.

	* setup/scan.d/00minimal:
	Moved vpd_exists to corresponding file in common.d directory.

	* setup/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.

	* setup/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.

	* setup/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".

	* setup/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>

	* setup/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).

	* setup/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.

	* setup/common.d/00minimal:
	New functions vpd_dir_set_hook, vpd_subdirs_list_hook,
	vpd_fields_list_hook, vpd_field_get.

	* lib/growbuf.h:
	New function growbuf_iter_remaining returns number of chars left to
	iterate over.

	* pci/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>

	* 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.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/scan.d/07device_scsi_sg_inq:
	In do_device_scsi, refrain from parsing $hbtl completely: just extract
	the host part for $adapter, and set $bus_info for do_device_hook.

	* setup/scan.d/07device_ide_proc:
	In do_device_ide, set $bus_info for do_device_hook instead of $channel
	and $unit.

	* lsmcode.in, lsvpd.in:
	Use list_linux_vpd, not list_linux_vpd_files_all.  Sundry cleanups:
	removed uses of "function" keyword.

	* lscfg.in:
	Use list_linux_vpd, not list_linux_vpd_files.  Sundry cleanups:
	removed uses of "function" keyword, removed "declare -i" bashisms.

	* setup/query.d/30device-tree:
	In get_model and get_serial, use read and echo rather than cat.

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	Module test now checks for /proc/ide/ide0 - this might be dodgy, but
	some machines have /proc/ide, but nothing else useful.  Removed
	list_os_adapters_ide and get_pci_info_ide, and replaced with
	adapter_setup_ide, which cross-links bus and OS nodes of IDE adapters.
	do_adapter_ide now takes a bus_info arg instead of a name and also
	uses pci_set_mf_tm_hook to set mf and tm instead of local logic.
	Removed uses of "function" keyword.

	* setup/lscfg.d/00minimal:
	Removed list_linux_vpd_files - replacement definition(s) in
	common.d/00minimal.  Removed uses of "function" keyword.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/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.

	* setup/lscfg.d/30device-tree:
	Use $db_bus_dt_dir instead of $db_bus_dir throughout.  Removed use of
	"function" keyword.

	* lib/lsvpd-functions.bash:
	New function ensure_directory creates directory if it doesn't exist.
	Removed use of "function" keyword.

	* setup/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".

	* setup/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.

	* setup/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,

	* setup/scan.d/00pci: New file.

	* setup/scan.d/07device_scsi_sg_scan:
	Sundry cleanups: remove "function" keyword, remove "declare -i"
	related bashisms.

	* setup/scan.d/07device_ide_proc:
	In get_device_name_ide, remove /dev from device name.  Sundry
	cleanups: use ensure_directory rather than "mkdir -p", remove
	"function" keyword, remove "declare -i" related bashisms.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	scsi_get_host_frag renamed to scsi_proc_get_host_frag.  Removed unused
	functions list_os_adapters_scsi, get_pci_info_scsi and
	scsi_host_pci_info.  adapter_setup_scsi now crosslinks bus and OS
	nodes of SCSI adapters (using logic previously in scsi_host_pci_info),
	providing a name lookup capability.  This is not hotplug friendly and
	should only be used on non-sysfs systems.

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	Module load condition now depends on ethtool and ifconfig - the
	ifconfig-only module is gone, since it it was useless on its own.
	get_pci_info_ethernet replaced by adapter_setup_ethernet - this should
	only be used on pre-sysfs systems, and is not hotplug friendly.  The
	new function uses similar mechanisms to the old, but it now
	cross-links all bus and OS nodes for ethernet adapters, thus providing
	a name lookup function (rather than a name ot bus info lookup
	function, since bus info is now the given data).

	* setup/scan.d/07device_scsi_sg_inq:
	Removed "function" keyword from function definitions to make things a
	little more POSIX-like.  Changed uses of "mkdir -p" to use
	"ensure_directory" to avoid an unneeded fork.

	* setup/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>

	* scsi/scsivpd.conf:
	Added variations of the IBM ST3.* and an exception.

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

	* setup/scan.d/07device_scsi_sg_inq:
	In do_device_scsi, fixed removal of left over data.

	* scsi/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.

	* scsi/scsi_vpd_render.c:
	All changes in get_templates: use regexps rather than globs for
	template matching; do pattern match only if find 3rd semicolon on
	line; fix dumb pointer manipulation.

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

	* setup/scan.d/10devfs: list_devices_scsi now lists SCSI bus locations.

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

	* setup/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.

	* setup/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.

	* setup/common-post.d/41ibm,partition-no: New file.

	* setup/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.

	* setup/scan.d/07device_ide_proc:
	In device_setup_ide, create empty ide_map to avoid later errors on
	systems that don't have IDE.

	* setup/scan.d/07device_scsi_sg_inq:
	In scsi_vpd_render, call do_fc_hook (instead of old do_fc_field) and
	add logic to support.

	* setup/scan.d/03adapter_ide_proc:
	In do_adapter_ide, use renamed function print_vpd_hook, and
	additionally ensure that $sn is unset.

	* setup/scan.d/07device_ide_proc:
	In do_device_ide, use print_vpd_hook to render VPD, rather than doing
	it by hand.

	* setup/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.

	* setup/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>

	* setup/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>

	* setup/scan.d/07device_scsi_sg_scan:
	Refactored to move towards supporting hotplug.  list_devices_scsi now
	lists SCSI bus locations rather than device names.

	* setup/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.

	* setup/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.

	* setup/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.

	* 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.

	* setup/scan.d/07device_scsi_sg_inq:
	Refactored to move towards supporting hotplug.  New function
	get_major_minor_scsi gets minor number from sg device name.
	scsi_hbtl_to_dev renamed to get_device_name_scsi and now takes a
	single argument (SCSI bus location) with components separated by
	colons.  do_device_scsi now takes a SCSI bus location as its only
	argument and creates a temporary device node to do inquiries.
	Intermediate output also goes into the "bus" directory instead of the
	"linux" directory.

	* setup/scan.d/27device_scsi_sysfs:
	Refactored to move towards supporting hotplug.  New functions
	get_device_name_ide and get_major_minor_scsi use sysfs to get relevant
	information.

	* setup/scan.d/07device_ide_proc:
	Refactored to move towards supporting hotplug.  New function
	device_setup_ide creates a mapping (ide_map) between device names and
	IDE bus locations.  list_devices_ide now uses ide_map, as does new
	function get_device_name_ide.  do_device_ide now takes a bus location
	and works out the name from there to avoid having to know about naming
	itself, and VPD output file now goes in ${device_bus_dir}/linux,vpd.

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

	* setup/scan.d/30device-tree:
	In dt_do_device_post_hook, removed extraneous ')' appended to LUN, and
	renamed parameters to something less confusing.

	* setup/scan.d/27device_scsi_sysfs:
	Removed list_scsi_devices.  Default version uses sg_map-x output file,
	which is all we need.

	* setup/scan.d/07device_scsi_sg_scan:
	Removed need for sg_scan - use output of sg_map instead.  Moved creation
	of sg nodes into device_setup_scsi - it needs to be there if
	appropriate sg devices don't already exist, otherwise sg_map will fail.

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>

	* 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.

	* setup/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.

	* lscfg.in:
	Fixed a minor formatting glitch: there wasn't a blank line before VPD
	(but there is in AIX lscfg).

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

	* setup/scan.d/30device-tree:
	In do_adapter_DEFAULT, override RM in existing $vpdprop.

	* Makefile: Bumped version to 0.11.4.

	* setup/query.d/00minimal:
	In get_model_basic, only get first matching line from cpuinfo.

	* setup/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}.

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	do_adapter_ide explicitly unsets rl and rm, just in case they are
	bound in a calling function.

	* setup/scan.d/20sysfs:
	do_adapter_DEFAULT also declares local variable rl, just in case it is
	bound in a calling function.

	* setup/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.

	* setup/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>

	* scsi/scsivpd.conf: Added ZM field for ST314* IBM disks.

	* setup/scan.d/07device_scsi_sg_scan:
	Renamed from 07device_scsi_sg.  Moved all sg_inq-related code to
	07device_scsi_sg_inq.

	* setup/scan.d/07device_scsi_sg_inq, setup/scan.d/27device_scsi_sysfs:
	New file.

	* lib/lsvpd-functions.bash:
	readlink now uses a bash string operation instead of sed.

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

	* lsmcode.in:
	In render_dev, use bash string substitution rather than sed to remove
	"/dev/" prefix.

	* lscfg.in:
	Removed alternative implementation of function fill_field (I just
	wanted to check it in before deleting it :-).

	* lscfg.in:
	New function fill_field implements generic filling/wrapping of field
	values.  New function formatvpd factors out formatting of VPD items,
	instead of requiring details to be hard-coded.  In print_item, allow
	filling before DS field and also use fill_field to fill DS value.  In
	printheader, removed old unused cases.  In formatvpdline, use new
	function formatvpd to do the formatting, instead of hardcoding it.  In
	printdev, use bash string substitution rather than sed to remove
	"/dev/" prefix.

	* setup/lscfg.d/30device-tree:
	In dt_platform_specific_vpd_line, use function formatvpd instead of
	hardcoding format.

	* setup/lscfg.d/40ibm,vpd:
	In dt_handle_specials, call formatvpdline instead of hardcoding the
	formatting.

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

	* pci/OLD/pci_vpd_to_txt.c:
	In function parse_uleshort_len, parse the bytes one at a time to avoid
	possible alignment issue.

	* pci/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>

	* scsi/scsivpd.conf:
	For generic IBM disks, wildcard IBM* to catch things like IBM-PSG and
	IBM-ESXS.

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

	* lsvpd_test.in: Now always creates db-*.tgz.

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

	* setup/scan.d/07device_ide_proc:
	In do_device_ide, added manufacturers AOpen and Ricoh.

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.

	* setup/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.

	* setup/lscfg.d/40ibm,vpd: In do_post_items, always produce mem0 item.

	* lscfg.in:
	Removed -t (test) option.  I don't believe anyone was using it, and it
	provided such a small subset of functionality that it was no longer
	useful.  In printitem, prefix is a space also if $systemspecific or
	"$name" is set.  In xlatevpd, printerheader is only called is $name is
	empty.  do_platform_specific_section is called even if $dovpd is false.

	* setup/scan.d/00minimal:
	In render_ibm_vpd, filter out empty lines or those that contain
	non-printables.

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

	* setup/scan.d/07device_scsi_sg_scan:
	In list_devices_scsi, declare i as an integer.

	* setup/scan.d/20sysfs:
	In sysfs_get_node replace an invocation of sed with a bash string
	substitution.

	* setup/scan.d/03adapter_ide_proc:
	In do adapter_ide: removed redundant debug statement, simplified
	vendor/device retrieval/parsing (sed no longer required), reading of
	channel.  In get_pci_info_ide simplified retrieval/parsing instead of
	using sed.

	* setup/scan.d/07device_ide_proc:
	Minor cleanups in list_devices_ide and do_device_ide.

	* setup/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.

	* setup/scan.d/OLD/01adapter_fibre_defs:
	Made fibre channel look like SCSI, since that's the way Linux treats
	it.

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

	* .distfiles: Removed sg3_utils-1.00.sginq-raw.patch.

	* scsi/scsi_vpd_render.c, scsi/OLD/scsi_vpd_common.h, scsi/OLD/scsi_vpd_common.c, pci/OLD/pci_vpd_to_txt.h, pci/OLD/pci_vpd_to_txt.c, pci/pci_vpd_gen_grab.h, pci/pci_vpd_gen_grab.c, pci/pci_vpd_cap_grab.c, pci/pci_lookup.c, pci/ibm_vpd_render.c, lib/util.h.in, lib/util.c, lib/test_growbuf.c, lib/tdump.c, lib/lsvpd-functions.bash, lib/growbuf.h, lib/growbuf.c:
	Fixed copyright/license header.

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

	* lsvpd_test.in:
	Run lsvpd with -m, because this tests more functionality.  Change
	lsvpd output file accordingly.

	* setup/scan.d/07device_scsi_sg_scan:
	device_setup_scsi, list_devices_scsi and scsi_vpd_inquire now use
	debug_cmd instead of redirecting stderr to /dev/null.

	* setup/scan.d/07device_scsi_sg_scan:
	In list_devices_scsi, ignore error messages and filter out lines that
	don't look like device nodes.

	* Makefile: Bumped version.

	* docs/lsvpd.xml: Documented -m option.

	* setup/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.

	* setup/scan.d/07device_scsi_sg_scan:
	Function scsi_vpd_render now takes a 2nd argument ($vpdprop) and uses
	a single, grouped redirection to write the output to the file, and
	uses do_fc_field to produce the FC field.  Removed some redundant
	debug statements.  Fixed and updated copyright header.

	* setup/scan.d/07device_ide_proc:
	In function do_device_ide, use do_dc_field to produce the FC field;
	also grouped output statements and now use a single redirection to
	write to $vpdprop.

	* 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>

	* 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.

	* setup/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.

	* setup/query.d/30device-tree, setup/query.d/00minimal, setup/lscfg.d/30device-tree, setup/common.d/00minimal:
	Added 2004 to copyright.

	* docs/design.xml: Year is now 2004.

	* lsmcode.in, lscfg.in, lsvpd.in: Added 2004 to copyright.

	* lsvpd_test.in: Oops, that's copyright 2004.

	* README: New file.

	* 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>

	* lsvpd_test.in: New file.

	* .distfiles: Added lsvpd_test.in.

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

	* setup/scan.d/OLD/01adapter_fibre_defs: New file.

	* lib/lsvpd-functions.bash:
	Sanity check in unpack_device_tree_archive now works on new databases
	by checking for bus subdirectory.

	* lsmcode.in:
	Added sourcing of files from query.d to function do_setup, along with
	new loop to make it look neater.

	* lscfg.in: Changed do_setup to use a loop to make it look neater.

	* lsvpd.in:
	Added sourcing of files from query.d to function do_setup, along with
	new loop to make it look neater.

	* lscfg.in: Added sourcing of files from query.d to function do_setup.

	* .distfiles:
	Moved setup/common.d/30device-tree to setup/query.d/30device-tree,
	added new file setup/common.d/00minimal.

	* setup/query.d/30device-tree: New file.

	* setup/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.

	* setup/query.d/00minimal: New file.

	* setup/Makefile: Added query.d.

2003-12-23  Martin Schwenke  <martins@rover>

	* lsmcode.in:
	Moved setup code to new function do_setup, which is called at
	appropriate place.

	* setup/scan.d/30device-tree:
	Unset do_adapter_hook_ide, not do_adapters_hook_ide.

	* setup/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.

	* 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.

	* setup/scan.d/07device_ide_proc:
	In do_device_ide, use dirname instead of sed.

	* setup/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.

	* setup/scan.d/00minimal:
	New functions cross_link, get_dot_dots, pseudo_realpath.

	* lib/lsvpd-functions.bash:
	Reimplemented dirname and basename using bash substitutions.

2003-12-22  Martin Schwenke  <martins@rover>

	* lscfg.in: Setup stage done after pointing to database.

	* setup/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.

	* tidy_lsvpd_dbs.in:
	Tidy directories that look like db-* too.  Fix copyright header.

	* setup/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.

	* setup/lscfg.d/40ibm,vpd:
	Use $db_bus_dir, not $db.  Fixed copyright header.

	* setup/scan.d/07device_ide_proc:
	In function do_device_ide, added manufacturer "Lite-On".  Fixed
	copyright header.

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	Fixed debug messages.  Fixed copyright header.

	* setup/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.

	* setup/scan.d/00minimal:
	Fixed typo in render_ibm_vpd - variable is $dir, not $d.

	* setup/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.

	* setup/scan.d/OLD/03adapter_ethernet_ifconfig, setup/scan.d/10devfs:
	Fixed copyright header.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	Use $db_scsi_dir instead of $scsidir.  Function list_os_adapters_scsi
	now uses glob-expansion instead of find.  Function scsi_host_pci_info
	now stored PCI in $db_scsi_dir/host*/pci-data.  Function
	get_pci_info_scsi now assigned new location for storing pci-data to a
	variable to ensure consistency.  Fixed copyright header.

	* setup/scan.d/OLD/01adapter_ide_defs: Added get_pci_class_ide.

	* setup/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.

	* setup/scan.d/07device_scsi_sg_scan:
	Removed variable scsidir.  Relevant data is now stored in
	db/linux/scsi.  Function do_device_scsi no longer stored information
	in devfs-style subdirectory under /var/lib/lsvpd - now in, for
	example, db/linux/host0/sda/tmp.  sg_map-x now lives in $db_misc_dir.

	* setup/lscfg.d/30device-tree:
	Use $db_bus_dir in most places instead of $db.  Fixed copyright header.

	* setup/common.d/30device-tree: New file.

	* setup/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.

	* 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.

	* setup/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.

	* 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.

	* lscfg.in:
	Removed function scsi_disk_short_to_long - disk sizes when devfs is in
	use are no longer supported (this simply got too hard, and the major
	distros don't appear to use devfs), hence function disk_size is
	greatly simplified.  In function partition_disk_size, partitions file
	is now ${db_proc_dir}/partitions.  In function disk_size, "0 MB" is
	never printed anymore.  In functions printitem and maybeprintitem now
	assign parameters to local variables for clarity.  Function
	maybeprintitem no longer prints items with empty AX.  Function
	printdev now assigns no value to $ax, instead of "[NONAME]".

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

	* setup/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.

	* scsi/scsivpd.conf: Added ZM field for IC35L*.

	* lsmcode.in:
	In function add_item, $zm should be hex-encoded before use.  Use tdump
	to do this.  Add @libdir@ to $PATH to be able to run tdump.

	* lib/tdump.c:
	If no file specified, reads from stdin - takes advantage of new
	file_read_contents behaviour where a NULL filename reads stdin.

	* lib/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>

	* setup/lscfg.d/00minimal:
	In function get_cpus_basic, only try using linux,cpuinfo if it exists.

	* scsi/scsivpd.conf: Added ZM field for DDYS-*.

	* lsmcode.in:
	In function add_item, if is set $zm use it and truncate $tm.  Removed
	function stripkey, now in 00minimal.  In function render_dev, set $zm
	from ZM field if found.

	* setup/common.d/00minimal:
	Function strip key moved here from lscfg.  Fixed copyright/license header.

	* lscfg.in: Fixed copyright header.

	* lscfg.in: Moved function stripkey to common.d/00minimal.

	* lscfg.in: Removed unneeded comment about stripkey change.

	* lscfg.in:
	Function stripkey now uses an internal bash string operation instead
	of sed.  This provides a useful performance improvement.

2003-11-21  Martin Schwenke  <martins@rover>

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	In function do_adapter_ide, call function get_adapter_ds instead of referencing
	$ide_ds.

	* setup/scan.d/00minimal:
	Renamed function adapter_set_ax_hook to adapter_set_ax_osname_hook,
	and added code to set $osname.  Fixed copyright/licensing.

	* setup/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.

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	Fixed copyright.  Call function adapter_set_ax_osname_hook instead of
	adapter_set_ax_hook and declare associated variable.

	* setup/scan.d/OLD/01adapter_ethernet_defs, setup/scan.d/OLD/01adapter_scsi_defs:
	Fixed copyright message.

	* setup/scan.d/OLD/01adapter_ide_defs:
	Moved $ide_ethernet to new function get_adapter_ds_ide.

	* setup/scan.d/OLD/01adapter_ethernet_defs:
	Moved $scsi_ethernet to new function get_adapter_ds_ethernet.

	* setup/scan.d/OLD/01adapter_scsi_defs:
	Moved $scsi_ds to new function get_adapter_ds_scsi.

	* setup/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).

	* lsmcode.in: Fixed usage message.

	* docs/Makefile: Added lsmcode.8 as a target.

	* lsmcode.in: Added SP_CARD_ as a name for Service Processor.

2003-11-14  Martin Schwenke  <martins@rover>

	* Makefile:
	Added support for building lsmcode.  Bumped version to 0.10.3.

	* setup/scan.d/20sysfs: Cleaned up copyright and licensing.

	* lsvpd.spec.in:
	Added /sbin/lsmcode to %files.  Bumped version to 0.10.3.

	* setup/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.

	* lsmcode.in: New file.

2003-11-12  Martin Schwenke  <martins@rover>

	* setup/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.

	* lib/Makefile: Added debug.bash to install.

	* .distfiles: Added lib/debug.bash.

	* update-lsvpd-db.in:
	Updated copyright message.  Moved debug functions out to
	libdir/debug.bash.

	* lib/debug.bash: Added copyright header.

	* lib/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-07  Martin Schwenke  <martins@rover>

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	Use "type -p" to find ethtool instead of depending on it being in
	/usr/sbin.

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

	* setup/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.

	* scsi/OLD/scsi_vpd_std.c:
	Fixed copyright message and GPL.  Reimplemented fixed arrays using
	string_array.

	* lib/util.c:
	New function string_array_lookup, for allowing (possibly) sparse
	arrays to be declared and search without bounds checking.

	* lib/util.h.in: 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.

	* setup/scan.d/OLD/01adapter_scsi_defs: New file.

	* setup/scan.d/00minimal:
	Removed declaration of multiplexed function do_setup.  Added new
	multiplexed functions adapter_setup and device_setup.

	* setup/scan.d/20sysfs:
	In function do_adapter_DEFAULT, make mf and tm local or bad things
	happen.

	* 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.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	Added loading prereq.  Moved all functions except adapter_setup_scsi
	(renamed from do_setup_scsi), list_os_adapters_scsi,
	get_pci_info_scsi (and supporting functions: scsi_get_host_frag,
	scsi_host_pci_info) to files 01adapter_scsi_defs or 07device_scsi_sg.

	* setup/scan.d/07device_scsi_sg_scan, setup/scan.d/07device_ide_proc, setup/scan.d/OLD/01adapter_ide_defs:
	New file.

	* setup/scan.d/03adapter_ide_proc:
	Moved all functions except list_os_ide_adapters, do_ide_adapter and
	get_pci_info_ide to 01adapter_ide_defs or 07device_ide_proc.

	* setup/scan.d/OLD/03adapter_ethernet_ifconfig:
	Moved all functions except list_os_ethernet_adapters to
	01adapter_ethernet_defs.

	* setup/scan.d/OLD/01adapter_ethernet_defs: New file.

	* setup/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.

	* setup/scan.d/03adapter_ide_proc:
	In function do_device_ide, loosened pattern for recognising
	manufacturer "IBM".

	* setup/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.

	* setup/scan.d/OLD/03adapter_scsi_proc:
	In function scsi_get_host_frag, allow numbers retrieved using template
	to be hexadecimal, not just decimal.

	* setup/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).

	* setup/scan.d/20sysfs:
	In function sysfs_get_pci_string, made ide handling (more) failsafe.

	* scsi/scsihost.conf: Loosened ibmsis templates.

2003-10-03  Martin Schwenke  <martins@rover>

	* Makefile: Bumped version to 0.10.0.

	* lscfg.in, lsvpd.in: Fixed GPL.

	* setup/scan.d/03adapter_ide_proc:
	In function get_pci_info_ide, PCI bus and device values can now
	include hex digits.  In function do_device_ide, recognise manufacturer
	TOSHIBA.

	* setup/scan.d/40ibm,vpd:
	Load this module if device_tree_device_type = "chrp".

	* setup/scan.d/30device-tree: Set variable device_tree_device_type.

	* setup/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.

	* setup/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>

	* update-lsvpd-db.in: Fixed GPL.

	* update-lsvpd-db.in:
	Removed inclusion of file @libdir@/scsi-functions.bash.

	* setup/scan.d/30device-tree:
	In function do_adapter_DEFAULT, attempt to set mf and tm using
	pci_set_mf_tm_hook.

	* setup/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.

	* lscfg.in:
	In function formatvpdline, commented out "Unknown key" debug.  This is
	only used during development.

	* setup/scan.d/40ibm,vpd:
	In function db_initialise, manufacture_yl was being called
	incorrectly, causing broken output.

	* pci/OLD/pci_vpd_rom_grab.c:
	In function find_rom_info, cast PCI_ROM_ADDRESS_MASK to uint32_t to
	stop compiler warning of implicit conversion.

	* pci/OLD/pci_vpd_to_txt.c:
	In functions parse_resource_chunk and do_checksum, add 'z' modifier in
	fprintf format to handle size_t items properly.

	* pci/pci_lookup.c:
	In function strip_and_return_to_newline, cast size_t items to int in
	call to asprintf.

	* pci/pci_lookup.c: Removed global variable prog.

	* setup/common.d/00minimal:
	New fnuction ensure_db checks to ensure database exists.

	* lsvpd.in, lscfg.in:
	Removed custom db-existence checking code and call ensure_db instead.

	* lscfg.in:
	Added "DESIGN NOTE" to comment near to replace point in TODO file.

	* lib/tdump.c:
	In main, changed use of die() to die2().  Removed variable prog,
	replaced with use of vpd_program_name.

	* pci/OLD/pci_vpd_rom_grab.c, pci/pci_vpd_cap_grab.c:
	In main, changed use of die() to die2() and removed redundant asprintf.

	* pci/ibm_vpd_render.c: In main, changed use of die() to die2().

	* scsi/scsi_vpd_render.c:
	In function get_templates, changed use of die() to die2().

	* lib/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>

	* setup/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.

	* setup/scan.d/00minimal: New function pci_set_mf_tm_hook.

	* setup/scan.d/03adapter_ide_proc:
	In function do_adapter_ide, updated use of pci_lookup to reflect new
	usage.

	* setup/scan.d/20sysfs:
	In function do_adapter_DEFAULT, updated use of pci_lookup to reflect
	new usage.

	* pci/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.

	* lib/util.c, lib/util.h.in: New function die2.

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

	* setup/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.

	* scsi/Makefile:
	Removed scsi-functions.bash - this functionality has been rolled into
	../setup/scan.d/01sg-scsi.

	* lib/lsvpd-functions.bash:
	New functions sanitise, hex2ascii, hex2substring, multiplex, make_multiplexed.

	* setup/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.

	* setup/scan.d/10devfs:
	Renamed function list_scsi_devices to list_devices_scsi to take
	advantage of multiplexed functions.  Removed duplicated comment at top
	of file.

	* lsvpd.in:
	serial_number and type_model now set using get_system_id and get_model
	functions.

	* 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".

	* lscfg.in:
	Function scsi_disk_size renamed to partition_disk_size, since it works
	for IDE disks too.  In function printheader, removed various
	hard-coded and inlined logic and replaced by function calls.  Use of
	function do_extra_items changed to do_post_items.

	* setup/common.d/00minimal: New functions get_model and get_system_id.

	* setup/scan.d/03adapter_ide_proc: New file.

	* setup/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.

	* setup/scan.d/OLD/03adapter_ethernet_ifconfig, setup/scan.d/OLD/03adapter_scsi_proc:
	New file.

	* setup/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.

	* setup/scan.d/30dmidecode: New file.

	* setup/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.

	* setup/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.

	* setup/lscfg.d/30device-tree: New file.

2003-09-23  Martin Schwenke  <martins@rover>

	* setup/common.d/00minimal:
	In function list_linux_vpd_files_all, add trailing slash to influence
	sort order.

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

	* setup/scan.d/OLD/05adapter_ethernet_ethtool:
	About to change name to 02ethtool.  Removed function get_pci_info,
	renamed function ethtool_pci_info to get_pci_info_ethernet - will use
	new multiplexing infrastructure.

	* Makefile: Bumped version to 0.9.2.

2003-09-19  Martin Schwenke  <martins@rover>

	* setup/scan.d/OLD/05adapter_ethernet_ethtool, update-lsvpd-db.in:
	Wrap "set -- ..." in  "set -f" and "set +f".

	* setup/scan.d/00minimal, setup/scan.d/20sysfs:
	No silly "shopt -u nullglob".  Use "set -f" followed by "set +f"
	instead.

	* setup/scan.d/20sysfs:
	No silly "shopt -u nullglob".  Use "set -f -- ..." followed by
	"set +f" instead.

	* setup/Makefile:
	With the scripts set to use nullglob, no longer need 000EMPTY files.

	* lscfg.in, lsvpd.in: Added nullglob at beginning of script.

	* setup/Makefile: Fixed installation to avoid copying RCS directories.

	* setup/scan.d/40ibm,vpd, setup/scan.d/30device-tree:
	Changed remaining instances of $dt to $db.

	* lib/lsvpd-functions.bash:
	In function unpack_device_tree_archive, changed instances of $dt* to
	$db*.

	* update-lsvpd-db.in: Changed remaining instances of $dt to $db.

2003-09-05  Martin Schwenke  <martins@rover>

	* lscfg.in: -d option was broken, fixed.

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

	* update-lsvpd-db.in, setup/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.

	* setup/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.

	* setup/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.

	* setup/scan.d/20sysfs: Use pci.ids from /lib/lsvpd/.

	* pci/Makefile: Added install of pci.ids.

	* scsi/Makefile: Removed all traces of scsi_host_pci_info{,.in}.

	* .distfiles:
	Removed scsi/scsi_host_pci_info.in, added setup/scan.d/01ethtool.

	* setup/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").

	* setup/scan.d/OLD/05adapter_ethernet_ethtool: New file.

2003-08-19  Martin Schwenke  <martins@rover>

	* update-lsvpd-db.in: Set $libdir.

2003-08-18  Martin Schwenke  <martins@rover>

	* setup/scan.d/40ibm,vpd:
	In function db_initialise, added debug messages and use of debug_cmd
	to conditionally trap stderr from ibm_vpd_render.

	* 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.

	* setup/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.

	* setup/scan.d/30device-tree:
	In function dt_find_adapter, add debug and change echo to stderr to be debug.

	* scsi/OLD/scsi-functions.bash:
	Add debugs.  Change echo to stderr to be debug.

2003-08-15  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_std.c: Oops, argc should now be 3.

	* setup/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>

	* setup/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>

	* setup/scan.d/00minimal:
	Changed module name in debug messages to "minimal".

	* setup/scan.d/00minimal:
	Added debug to functions match_adapter and do_adapter.

2003-08-08  Martin Schwenke  <martins@rover>

	* scsi/scsi_vpd_render.c:
	Now accepts 2 arguments: input directory containing inquiry data and
	output directory, which must exist.  Functions process_template and
	process_templates now both take separate indir and outdir arguments.

	* setup/scan.d/30device-tree:
	In function scsi_do_device_hook, use variable $outdir for output
	directory.

	* scsi/OLD/scsi_vpd_std.c:
	Now accepts 2 arguments: input directory containing inquiry data and
	output directory, which must exist.

	* 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.

	* lscfg.in:
	Use function list_linux_vpd_files instead of doing find directly.

	* setup/common.d/00minimal: New function list_linux_vpd_files_all.

	* setup/lscfg.d/00minimal, setup/lscfg.d/40ibm,vpd:
	New function list_linux_vpd_files.

	* lscfg.in, lsvpd.in: Check database initialisation.

2003-08-01  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_common.h: Removed use of glib.

	* lib/Makefile: Replaced GStringIter with growbuf.

	* .distfiles: Added and changed files under setup/ for lscfg.

	* lsvpd.in:
	Use @libdir@/{common,lsvpd}.d/*.  $dt is now $db and is defined in
	common.d/00minimal.

	* setup/lscfg.d/40ibm,vpd, setup/common.d/00minimal, setup/lscfg.d/00minimal:
	New file.

	* lscfg.in:
	Added use of  @libdir@/{common,lscfg}.d/*.  dt is now db.  Moved
	device-tree specific functionality to setup/lscfg.d/40ibm,vpd.

	* update-lsvpd-db.in: Don't call db_configure.  That's now implicit.

	* 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.

	* setup/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>

	* setup/scan.d/40ibm,vpd, setup/scan.d/20sysfs, setup/scan.d/10devfs, setup/scan.d/00minimal:
	New file.

	* update-lsvpd-db.in:
	Abstracted and extracted many functions into setup/scan.d/*.

	* setup/Makefile, setup/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].

	* lib/util.c:
	In function read_file_contents, fixed bad memory free in bail branch.

	* scsi/scsi_vpd_render.c: Fixed memory leaks.

	* scsi/OLD/scsi_vpd_std.c: In main, free(data) to fix memory leak.

	* scsi/OLD/scsi_vpd_common.c:
	In function dump_field, free(ldata) to fix memory leak.

	* pci/ibm_vpd_render.c:
	In main, use fwrite to print txt, not fputs, since growbuf_data(txt)
	is not (necessarily) NUL-terminated.

	* pci/OLD/pci_vpd_to_txt.c:
	In function parse_board_id use growbuf_free(name), not free(name), to
	avoid memory leak.

	* pci/OLD/pci_vpd_to_txt.c: Remove MIN - unused.

	* pci/OLD/pci_vpd_to_txt.c:
	Renamed functions ending in _string to end in _data to avoid
	impression that they deal with NUL-terminated strings.  Moved
	NUL-termination checking from parse_uchar_length_data (where it was
	a gross hack) to parse_resource_chunk (where it probably belongs).

	* pci/Makefile: New file.

	* Makefile: No more glib.

	* .distfiles: Switch from GStringIter.* to growbuf.*.

	* pci/OLD/pci_vpd_rom_grab.c:
	Update copyright.  Part of lsvpd package, not rtasdiag utils.  Use
	growbuf instead of glib/GString.

	* pci/pci_vpd_cap_grab.c:
	In main, use growbuf_length(frag) instead of frag->len.

	* pci/OLD/pci_vpd_rom_grab.c: New file.

	* pci/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>

	* pci/pci_vpd_gen_grab.c, pci/pci_vpd_gen_grab.h:
	Update copyright.  Part of lsvpd package, not rtasdiag utils.  Use
	growbuf instead of glib/GString.

	* pci/OLD/pci_vpd_to_txt.h:
	Update copyright.  Part of lsvpd package, no rtasdiag utils.

	* pci/OLD/pci_vpd_to_txt.h: Change type of function pci_vpd_to_txt.

	* pci/OLD/pci_vpd_to_txt.c:
	Removed use of glib.  Use growbuf instead of GString.  Got rid of
	intermediate parse tree - convert straight to text... some functions
	disappeared in the process.

	* lib/util.c:
	In function read_file_contents initialise *buf to a void bogus free if
	goto bail.

	* pci/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.

	* scsi/scsi_vpd_render.c: Removed trace fprintf in main.

	* lib/growbuf.c: In growbuf_iter_free, don't free the growbuf's data.

	* lib/growbuf.h, lib/growbuf.c, lib/test_growbuf.c: New file.

	* lib/Makefile: tdump needs util.{h,o}

2003-07-25  Martin Schwenke  <martins@rover>

	* scsi/scsi_vpd_render.c: Remove glib usage - major rewrite.

	* lib/util.c: file_write_contents: set file mode in open(2).

	* scsi/OLD/scsi_vpd_common.c: Remove fprintf debug statements.

	* scsi/OLD/scsi_vpd_common.c:
	strstrip: fix off by one error and add NUL-termination.

	* scsi/OLD/scsi_vpd_std.c:
	In make_ds_value free(data_0xc7) rather than munmap.

	* pci/pci_lookup.c: In main free(data), not munmap(data, len).

	* lib/tdump.c: In main free(data).

	* lib/util.c:
	file_read_contents now returns malloced memory and is NUL-terminated.

	* lib/util.h.in:
	Removed comment about munmap being needed to free memory.  This won't
	be true in a couple of minutes.

	* scsi/OLD/scsi_vpd_std.c: Remove glib usage.

	* scsi/OLD/scsi_vpd_common.c: Remove tracing fprintf.

	* scsi/OLD/scsi_vpd_common.c:
	Removed dependency on glib.  New function strstrip removes leading and
	trailing whitespace, and truncates at the first non-printable
	character.  dumpfield: dropped unneeded variable llen.

	* lib/util.c:
	file_write_contents: oops, initialised variable done to 0.

	* pci/pci_lookup.c:
	skip_and_print_to_newline now modifies pci.ids memory buffer returned
	by mmap.

	* lib/util.c:
	Use private, writable memory for mmap in file_read_contents.

	* pci/pci_lookup.c: Use asprintf instead of strconcat2, strconcat3.

	* lib/util.c:
	Removed strconcat2, strconcat3 - use asprintf instead.  Modified
	build_relative_filename accordingly.

	* lib/util.h.in: Removed strconcat2, strconcat3 - use asprintf instead.

2003-07-24  Martin Schwenke  <martins@rover>

	* lib/util.h.in: Fixed copyright, comments.

	* lib/util.h.in:
	Removed dependency on glib, most functions changed, including argument
	list.  New functions strconcat2, strconcat3, build_relative_filename,
	read_file_contents.

	* lib/tdump.c: Removed dependency on glib.

	* lib/util.c:
	Removed dependency on glib, most functions changed, including argument
	list.  New functions strconcat2, strconcat3, build_relative_filename,
	read_file_contents.

	* pci/pci_lookup.c: New file.

	* scsi/OLD/scsi_vpd_std.c (make_ds_value):
	simplified filename construction using
	g_build_filename, thus changing type of variable "file".

	* scsi/scsi_vpd_render.c (process_template):
	simplified filename construction using
	g_build_filename, thus changing type of variable "file".

	* scsi/OLD/scsi_vpd_std.c:
	In main(): simplified filename construction  using g_build_filename, thus
	changing type of variable "file"; fixed bug in message about short
	standard inquiry - was using uninitialised value.

	* lib/util.c:
	(file_relative_read_contents, file_relative_write_contents):
	simplified using g_build_filename.

2003-07-22  Martin Schwenke  <martins@rover>

	* scsi/Makefile:
	Removed scsi_vpd_inquire and scsi_vpd_render from SCRIPTS variable, so
	nothing attempts to install them.

	* Makefile: Bumped version to 0.8.7.

	* scsi/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.

	* update-lsvpd-db.in:
	New function sysfs_dir to facilitate better handling of sysfs.

	* lscfg.in: Added comment about -mindepth option to find.

2003-07-18  Martin Schwenke  <martins@rover>

	* lib/Makefile: New file.

	* scsi/Makefile:
	Renamed CONFIGS to DATAS.  Added scsi-functions.bash to DATAS.

	* scsi/Makefile: New file.

	* .distfiles:
	Added scsi/scsi-functions.bash.  Removed scsi/scs_vpd_inquire and
	scsi_scsi_vpd_render.

	* 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.

	* scsi/OLD/scsi-functions.bash: New file.

	* lscfg.in, lsvpd.in:
	Check for extraneous arguments (without flags) and print usage message
	if present.

2003-07-17  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_std.c:
	Removed macro constant MAX_SCSI_DEVICE_TYPES and made arrays size
	automatically.   New macro ARRAY_LEN.  New array cdrom_device_types.
	Function make_ds_value now uses cdrom_device_types array to fill in
	ret for DS.

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>

	* lib/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.

	* 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.

	* lscfg.in: scsi_disk_size only worked when there were statistics in
	/proc/partitions, which seems to be the default for SuSE kernels.
	Loosened up the regexp a bit and it works for both styles of
	/proc/partitions.

	* lscfg.in:
	New functions disk_size, scsi_disk_size, scsi_disk_short_to_long and
	changes to print_item to do disk sizes properly, including under
	devfs.

	* lib/lsvpd-functions.bash:
	Removed function scsi_get_ax - optimised both uses in different ways.

2003-06-26  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_scan:
	Changed multi-line, overcomplicated, looped construction of
	hostH/busB/targetT/lunL strings for non-devfs case to just use a very
	long sed substitution.

	* lib/lsvpd-functions.bash:
	Moved sysfs_pci_info to update-device-tree.in.

	* scsi/OLD/scsi_host_pci_info.in:
	Moved sysfs code into update-device-tree.in since it is so small, and
	(hopefully) this file will be deprecated when all systems use sysfs.

2003-06-20  Martin Schwenke  <martins@rover>

	* lib/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.

	* lib/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.

	* scsi/scsi_vpd_render.c:
	Added #include <string.h> to avoid compiler warning.  Changed comment
	to say this is part of lsvpd package.  Bumped copyright.

	* scsi/OLD/scsi_vpd_std.c, pci/ibm_vpd_render.c, pci/OLD/pci_vpd_to_txt.c, lib/util.c, lib/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.

	* scsi/OLD/scsi_host_pci_info.in:
	Added 2003 to copyright comment.  Simplify usage function.

	* Makefile: Bumped version to 0.8.5.

	* 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.

	* 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.

	* scsi/OLD/scsi_host_pci_info.in:
	In function get_all_pci_non_sysfs: made many variables local; store
	information in single file "data" rather than separate "bus", "dev",
	"fun" files; "data" contains "dom bus dev fun" all in hexadecimal.  In
	function get_all_pci_sysfs: factored out body of function, now calling
	sysfs_pci_info and dropping 4 hexadecimal numbers into "data" file, as
	above.

	* lib/lsvpd-functions.bash: New function sysfs_pci_info.

	* update-lsvpd-db.in:
	Implemented ethernet adapter/device-tree matching with sysfs.

	* scsi/OLD/scsi_host_pci_info.in:
	Added logic to work with sysfs, including Anton's prototype PCI domain
	support.

	* dt_find_adapter.in:
	Added linux,pci-domain for magic property in PCI nodes.

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

	* tidy_lsvpd_dbs.in:
	Got rid of $pattern.  Put glob pattern explicitly in loop and regexp
	pattern explicitly in call to tidy_subdirs.

	* 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>

	* tidy_lsvpd_dbs.in:
	Run update-device-tree if it hasn't been run.  Change command-line
	arguments to tidy_subdirs.

	* 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.

	* lib/lsvpd-functions.bash: Added copyright message.

	* update-lsvpd-db.in, dt_find_adapter.in, lsvpd.in:
	Changed comment to say Linux lsvpd package, not other stuff.
	Added 2003 to copyright.

	* lscfg.in: Added -z option to use device-tree tgz archive.

	* lsvpd.in:
	Added -z option to use device-tree tgz archive.  Renamed to lsvpd.in
	to get access to shell function library.

	* lib/lsvpd-functions.bash: New function unpack_device_tree_archive.

2003-05-22  Martin Schwenke  <martins@rover>

	* tidy_lsvpd_dbs.in, tidy_subdirs: New file.

	* 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.

	* lib/lsvpd-functions.bash: Added readlink.

2003-05-07  Martin Schwenke  <martins@rover>

	* scsi/scsihost.conf: Fixed typo in bus pattern for sym53c8xx.

2003-04-29  Martin Schwenke  <martins@rover>

	* scsi/scsihost.conf:
	Loosened the pattern for the ibmsis PCI bus number so it can be more
	than 2 digits.

	* scsi/OLD/scsi_host_pci_info.in:
	get_real_bus: removed redundant echo from at end.  New function
	get_host_frag to avoid duplicating logic in main loop.  In main loop -
	added use of prefix fields from template file; use new function
	get_host_frag; only call get_real_bus if $irq is set; use printf to
	print values, implicitly converting prefixed (hex or octal) numbers to
	decimal.

	* dt_find_adapter.in: Optimised away some hex2dec and dec2hex calls.

	* scsi/scsihost.conf:
	Anchors are now in this file, not put in by the code.  Added comment
	about field 6-9.  Added line for ibmsis driver.

	* lib/lsvpd-functions.bash:
	Simplified dec2hex and hex2dec using printf.

	* scsi/scsihost.conf: Added IRQ field.

2003-03-28  Martin Schwenke  <martins@rover>

	* lscfg.in: Fixed quoting error in printdev.

	* lscfg.in:
	Fixed wrapping on device header line in VPD section again.  Forgot to
	do it after changing the field width.

	* lscfg.in: Changed width of AX field to 16 chars.

	* update-lsvpd-db.in:
	Remove -prune on find.  busybox doesn't implement it.

	* 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.

	* lscfg.in:
	Fixed wrapping on device header line in VPD section.  renamed function
	render_platform_specific_node to just platform_specific_node.
	platform_specific_node only prints VPD is ibm,vpd exists too.  Added
	trivial handling for ISA Bus.

2003-03-26  Martin Schwenke  <martins@rover>

	* lscfg.in:
	Removed -s option and corresponding $sd.  Use ${dt}/linux,disk-sizes
	instead of ${sd}/disk-sizes.

	* update-lsvpd-db.in:
	Moved ${scsidir}/disk-sizes to ${dt}/linux,disk-sizes.

	* lscfg.in:
	New function platform_specific_vpd_line() overrides some of the
	descriptions for keys found in formatvpdline().  This function is
	called in platform_specific_vpd() instead of formatvpdline().

	* lscfg.in: Added MP key type.  Print the PS VPD DS field in a 16 byte
	field.  Hard-code the printing of the Physical Location, since the ':
	is only followed by a single space.

	* dt_find_adapter.in:
	Fixed careless bug: check_phbprop grabs hex numbers from file, not
	octal.

2003-03-25  Martin Schwenke  <martins@rover>

	* lscfg.in:
	Got rid of use of "set" - use read instead.  Factored out prcoessing
	of key after read into new function stripkey().  Implemented platform
	specific (PS) VPD handling.  Added more exceptions on the PS-related
	find command.

	* lscfg.in: First cut of most of the platform specific stuff.

2003-03-24  Martin Schwenke  <martins@rover>

	* lib/lsvpd-functions.bash: Removed nulcat.  It didn't work.

	* lscfg.in:
	Starting to implement -p option.  Time to rename to lscfg.in, so can
	include lsvpd-functions.bash.

	* lib/lsvpd-functions.bash: Make that "nulcat".

	* lib/lsvpd-functions.bash: New function nullcat().

	* lscfg.in:
	Factored out formatting of VPD lines to function formatvpdline().

2003-03-21  Martin Schwenke  <martins@rover>

	* update-lsvpd-db.in:
	Filter comments from sg_map output, and throw away stderr.

	* lscfg.in: Ditto - missed one.

	* lscfg.in: Added -f to set line to stop really stupid things being
	filename-expanded by the shell.

	* lscfg.in:
	Added -s option, since scsi directory needs to be used now, because it
	contains the disk-sizes file.  Speaking of which, SCSI disks now have
	their sizes printed.  Consistent syntax/layout used for shell
	functions.

	* scsi/OLD/scsi_host_pci_info.in:
	Implemented yet a different workaround to the problem of SCSI drivers
	only reporting 8-bit worth of PCI bus number.

	* update-lsvpd-db.in: Changed "partitions" to "disk-sizes".

2003-03-20  Martin Schwenke  <martins@rover>

	* 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.

	* lscfg.in:
	Removed need for xargs and grep.  Fixed filter to stop printing items
	from root node ibm,vpd prop.  Hard-coded sys0, sysplanar0.  Added
	support for pci, proc, L2cache via handle_specials function.  Other
	minor cleanups.

2003-03-18  Martin Schwenke  <martins@rover>

	* 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.

	* lscfg.in:
	Device names are hopefully now shorter - made the column widths same
	as AIX.

	* 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>

	* 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.

	* lib/lsvpd-functions.bash: Added basename.

	* 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@.

	* lib/lsvpd-functions.bash:
	Just renamed file and added comment about needing bash.

	* lib/lsvpd-functions.bash: New file.

	* 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.

	* lsvpd.in: Use device-tree file with "uname -s -r" output if present.

	* update-lsvpd-db.in: Added device-tree file with "uname -s -r" output.

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

	* scsi/OLD/scsi_host_pci_info.in:
	Completely reimplemented based on output of lspci.  If that changes,
	or hot-plug events occur, we go back to the old implementation.

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

	* lsvpd.in, lscfg.in: Force dereference of $dt symlink in find.

	* update-lsvpd-db.in: Oops, mkdir $vardir.

	* update-lsvpd-db.in: Oops fixed unmatched quote.

	* lsvpd.in:
	Changed options handling to use getopts.  Added -d option to specify
	device-tree.

	* lscfg.in: Fixed stupid comment.

	* lscfg.in: Added -d option to specify device-tree directory.

	* 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).

	* update-lsvpd-db.in:
	Changed location of device-tree to /var/lib/lsvpd/device-tree.
	Similar for SCSI data.

	* lsvpd.in, lscfg.in:
	Changed location of device-tree to /var/lib/lsvpd/device-tree.

	* lscfg.in:
	Now accesses device-tree copy directly, instead of via lsvpd.  Added
	options processing.  Now shows summary without any options and shows
	VPD with -v option.  Added -l option to print only some devices - this
	is currently pretty useless without names for most devices.  Resorted
	case statement in xlatevpd.  Supress more fields.  Generally make it
	output look more like AIX version.  Added -t option - give it a file
	containing lsvpd output and it uses that rather than device-tree.

2003-03-03  Martin Schwenke  <martins@rover>

	* update-lsvpd-db.in:
	Made scsi_dt_find_host a shell function that calls the newly renamed
	dt_find_adapter.

	* dt_find_adapter.in: Fixed documentation to reflect previous changes.

	* 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.

2003-02-25  Martin Schwenke  <martins@rover>

	* lscfg.in: Implemented line wrapping for the header line of each item.

	* lscfg.in: Added SE and U? fields.

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

	* lscfg.in: Fixed typo in "unknown field" error message line.

	* lscfg.in:
	Fixed bug that stopped the last item being printed, added function
	printvpd.  Fixed comment at top, added copyright message.

2003-02-21  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_scan: Fixed the check for devfs.

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

	* lib/util.h.in:
	Added cpu_to_le32 and le32_to_cpu.  Also cleaned up the 16-bit ones...

	* pci/pci_vpd_cap_grab.c:
	Moved big_cool_{read,write} to ../lib/util.[ch].

	* scsi/OLD/scsi_vpd_std.c (main): changed to use strerror.

	* lib/util.h.in: Added #include <sys/types.h>.

	* lib/util.c: Moved #define _XOPEN_SOURCE to top.

	* lib/util.h.in, lib/util.c: Added big_cool_{read,write}.

	* pci/pci_vpd_cap_grab.c:
	Abstracted out reading/top-level-parsing of VPD to
	pci_vpd_gen_grab.[ch].

	* pci/pci_vpd_gen_grab.h, pci/pci_vpd_gen_grab.c: New file.

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

	* pci/OLD/pci_vpd_to_txt.c (parse_resource_chunk):
	fixed formatting/length of warning message.

	* pci/OLD/pci_vpd_to_txt.c:
	Improved warning messages throughout.  (parse_pci_vpd): Fixed
	indentation.

	* pci/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>

	* pci/OLD/pci_vpd_to_txt.c:
	Rewrote parse_pci_vpd so that it follows the PCI specification more
	closely and isn't limited to what is documented in the RS6K RPA.
	Factored out the checksum validation code into do_checksum function.

	* update-lsvpd-db.in: s/pci_vpd_render/ibm_vpd_render/

	* pci/ibm_vpd_render.c:
	Change of include file name and associated function (ibm_vpd_to_txt).

	* pci/OLD/ibm_vpd_to_txt.c:
	Cut down from original version of pci_vpd_to_txt.c.

	* pci/OLD/pci_vpd_to_txt.c:
	Factored out IBM-specific stuff to separate file.  Changed, for
	example, all unsigned char to uint8_t.  Pruned redundant includes.

	* pci/OLD/ibm_vpd_to_txt.c, pci/OLD/ibm_vpd_to_txt.h: New file.

	* pci/OLD/pci_vpd_to_txt.h: Renamed to pci_vpd_to_txt.

	* pci/OLD/pci_vpd_to_txt.c:
	Various functions renamed and refactored.  Used ntohl instead of
	home-grown stuff at one point.

	* pci/pci_vpd_cap_grab.c: Removed le16_to_cpu and cpu_to_le16.

	* lib/util.h.in: Added le16_to_cpu and cpu_to_le16.

	* pci/pci_vpd_cap_grab.c:
	Fixed crash on failed open.  Changed message about no capabilities
	list to "return 1".

	* pci/pci_vpd_cap_grab.c: This works.  :-)

	* pci/pci_vpd_cap_grab.c: New file.

2002-09-26  Martin Schwenke  <martins@rover>

	* lscfg.in: Made the output look more like AIX lscfg -v.

	* lscfg.in: New file.

2002-09-23  Martin Schwenke  <martins@rover>

	* scsi/scsi_vpd_render.c (process_template):
	Fixed off-by-one error at end of data.

	* scsi/OLD/scsi_vpd_std.c (make_ds_value):
	Fixed type of parameter 3 (dir).  Reorganised 0xc7
	checking to get "Other SCSI CD-ROM Drive" for unknowns.

	* scsi/scsi_vpd_render.c (process_template):
	Now takes struct containing directory and short
	device type string as argument.  Changed call to dump_field to reflect
	changed argument.

	* scsi/OLD/scsi_vpd_std.c (scsi_device_types, scsi_device_types_short):
	type is now gchar, not
	char - no real difference!
	(make_ds_value): New function that does some of the work main used to
	do, and also adds extra information from inquiry page 0xc7.
	(main): Pulled some logic into make_ds_value, changed calls to
	dump_field to reflect argument change.

	* scsi/OLD/scsi_vpd_common.h, scsi/OLD/scsi_vpd_common.c (dump_string):
	Removed strip argument - the only field not being
	stripped was Z0, and it is safe to do so after hex encoding it - all
	values are stripped now.  Added dtype argument - short device type
	string, which is used to help decide if value should be hex encoded.

	* scsi/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>

	* scsi/scsivpd.conf: Removed SN field from enclosure type.

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

	* scsi/OLD/scsi_vpd_inquire: - Fixed usage message.
	- Throw away stderr of sg_inq.

	* update-lsvpd-db.in:
	Add /sbin to PATH, assuming this is where the sg_* stuff is.

	* scsi/OLD/scsi_vpd_scan: Removed debugging PATH stuff.

	* scsi/OLD/scsi_vpd_scan:
	- Now requires /bin/bash because we want to loop from 0 to 255.  :-(
	- Fixed usage message.
	- Now handle non-devfs case, although this is a bit of a hack.
	- If an scsi_vpd_inquire call fails, return the exit code of the last
	  one.

2002-09-03  Martin Schwenke  <martins@rover>

	* update-lsvpd-db.in:
	In SCSI YL values, target and LUN are now lowercase hex, not decimal.

	* scsi/OLD/scsi_vpd_common.c:
	hexify() now produces uppercase hex output.

	* dt_find_adapter.in: Took out "not tested" message.

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

	* dt_find_adapter.in: Fixed usage message.

2002-08-23  Martin Schwenke  <martins@rover>

	* dt_find_adapter.in:
	Remove -prune on find.  This is just an optimisation and doesn't work
	with busybox's find.

	* dt_find_adapter.in: Fixed order of parameters.

2002-08-14  Martin Schwenke  <martins@rover>

	* scsi/scsi_vpd_render.c: Add Emacs mode to top line in comment.

	* scsi/scsi_vpd_render.c: template file resides in @libdir@.

	* scsi/OLD/scsi_host_pci_info.in: conf file resides in @libdir@.

	* update-lsvpd-db.in:
	Added copyright/license.  Change PATH to include @libdir@.

	* update-lsvpd-db.in: Eek, library directory should not be in /usr.

	* update-lsvpd-db.in, lsvpd.in: New file.

	* pci/OLD/pci_vpd_to_txt.c: - Made internal functions static.
	- Factor out length grabbing functions.
	- Use gsize instead of unsigned int for lengths.
	- Factored out parsing code for board id and included checksum
	  calculation.
	- Made chunk parsing more forgiving of errors, which required restructure.
	- Incorrect checksum now prints a warning instead of exiting.

	* pci/OLD/pci_vpd_to_txt.c:
	Now parses multiple chunks.  Fix g_free -> g_string_free bug.

2002-08-13  Martin Schwenke  <martins@rover>

	* lib/GStringIter.c, lib/GStringIter.h: Changed bool to gboolean.

2002-08-12  Martin Schwenke  <martins@rover>

	* scsi/OLD/scsi_vpd_std.c: Added "SCSI " to DS string.

	* dt_find_adapter.in: Make $dt the 1st argument.

	* scsi/scsi_vpd_render: Added *FC line.

	* pci/ibm_vpd_render.c: Sensible reimplimentation of grab_file.

	* lib/util.h.in, lib/util.c, lib/tdump.c, scsi/scsivpd.conf, scsi/scsihost.conf, scsi/OLD/scsi_vpd_std.c, scsi/OLD/scsi_vpd_scan, scsi/scsi_vpd_render, scsi/OLD/scsi_vpd_inquire, scsi/scsi_vpd_render.c, scsi/OLD/scsi_vpd_common.h, scsi/OLD/scsi_vpd_common.c, scsi/OLD/scsi_host_pci_info.in, dt_find_adapter.in:
	New file.

2002-06-19  Martin Schwenke  <martins@rover>

	* pci/ibm_vpd_render.c:
	Actually implemented proper main().  Use g_string_append_len() to make
	building buffer trivial.  Added copyright message.

	* pci/OLD/pci_vpd_to_txt.h: New file.

	* pci/OLD/pci_vpd_to_txt.c: Use GStringIter.  Add copyright message.

	* lib/GStringIter.h: That should be ".h". :-)

	* lib/GStringIter.h, lib/GStringIter.c: New file.

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

	* pci/OLD/pci_vpd_to_txt.c, pci/ibm_vpd_render.c: New file.

