Hello community, here is the log from the commit of package hwinfo checked in at Tue May 9 00:24:08 CEST 2006. -------- --- hwinfo/hwinfo.changes 2006-05-02 14:22:49.000000000 +0200 +++ STABLE/hwinfo/hwinfo.changes 2006-05-08 17:03:50.000000000 +0200 @@ -1,0 +2,11 @@ +Mon May 8 17:03:43 CEST 2006 - snwint@suse.de + +- fix some memory leaks (#148043) +- jdelvare: last 240 bytes of ROM were not scanned for SMBIOS + entry point (#171640) +- jdelvare: support legacy DMI entry points (#17164) +- get vio devices from sysfs, not prom (#161684) +- don't load st module (#160304) +- fixed really big memory leak in s390 code (bug #148043) + +------------------------------------------------------------------- Old: ---- hwinfo-12.29.tar.bz2 New: ---- hwinfo-12.31.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hwinfo.spec ++++++ --- /var/tmp/diff_new_pack.KPNXs0/_old 2006-05-09 00:23:58.000000000 +0200 +++ /var/tmp/diff_new_pack.KPNXs0/_new 2006-05-09 00:23:58.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package hwinfo (Version 12.29) +# spec file for package hwinfo (Version 12.31) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -20,9 +20,9 @@ PreReq: /sbin/ldconfig %insserv_prereq %fillup_prereq Autoreqprov: on Summary: Hardware Library -Version: 12.29 -Release: 1 -Source: hwinfo-12.29.tar.bz2 +Version: 12.31 +Release: 2 +Source: hwinfo-12.31.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -96,6 +96,14 @@ %doc doc/libhd/html %changelog -n hwinfo +* Mon May 08 2006 - snwint@suse.de +- fix some memory leaks (#148043) +- jdelvare: last 240 bytes of ROM were not scanned for SMBIOS + entry point (#171640) +- jdelvare: support legacy DMI entry points (#17164) +- get vio devices from sysfs, not prom (#161684) +- don't load st module (#160304) +- fixed really big memory leak in s390 code (bug #148043) * Tue May 02 2006 - snwint@suse.de - updated X11 data * Thu Apr 27 2006 - snwint@suse.de ++++++ hwinfo-12.29.tar.bz2 -> hwinfo-12.31.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/Changelog new/hwinfo-12.31/Changelog --- old/hwinfo-12.29/Changelog 2006-05-02 12:34:51.000000000 +0200 +++ new/hwinfo-12.31/Changelog 2006-05-08 17:01:44.000000000 +0200 @@ -1,3 +1,14 @@ +8/5/2006: v12.31 + - get vio devices from sysfs, not prom (#161684) + - don't load st module (#160304) + - fixed really big memory leak in s390 code (bug #148043) + +4/5/2006: v12.30 + - fix some memory leaks (#148043) + - jdelvare: last 240 bytes of ROM were not scanned for SMBIOS + entry point (#171640) + - jdelvare: support legacy DMI entry points (#17164) + 2/5/2006: v12.29 - updated X11 data diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/VERSION new/hwinfo-12.31/VERSION --- old/hwinfo-12.29/VERSION 2006-05-02 12:34:32.000000000 +0200 +++ new/hwinfo-12.31/VERSION 2006-05-08 12:54:18.000000000 +0200 @@ -1 +1 @@ -12.29 +12.31 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/hwinfo.c new/hwinfo-12.31/hwinfo.c --- old/hwinfo-12.29/hwinfo.c 2006-01-31 15:39:04.000000000 +0100 +++ new/hwinfo-12.31/hwinfo.c 2006-05-08 17:01:06.000000000 +0200 @@ -160,7 +160,7 @@ FILE *f = NULL; int i; unsigned first_probe = 1; - + hd_data = calloc(1, sizeof *hd_data); hd_data->progress = isatty(1) ? progress2 : NULL; hd_data->debug=~(HD_DEB_DRIVER_INFO | HD_DEB_HDDB); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/bios.c new/hwinfo-12.31/src/hd/bios.c --- old/hwinfo-12.29/src/hd/bios.c 2006-03-13 15:43:57.000000000 +0100 +++ new/hwinfo-12.31/src/hd/bios.c 2006-05-04 14:01:12.000000000 +0200 @@ -615,24 +615,37 @@ memory_range_t memory; hd_smbios_t *sm; - if(!mem->data || mem->size < 0x100) return; + if(!mem->data || mem->size < 0x10) return; - for(u = ok = 0; u <= mem->size - 0x100; u += 0x10) { + for(u = ok = 0; u <= mem->size - 0x10; u += 0x10) { if(*(unsigned *) (mem->data + u) == 0x5f4d535f) { /* "_SM_" */ hlen = mem->data[u + 5]; + if(hlen < 0x1e || u + hlen > mem->size) continue; addr = *(unsigned *) (mem->data + u + 0x18); len = *(unsigned short *) (mem->data + u + 0x16); structs = *(unsigned short *) (mem->data + u + 0x1c); - if(hlen < 0x1e) continue; ok = crc(mem->data + u, hlen) == 0 && len; - if(ok) break; + if(ok) { + bt->smbios_ver = (mem->data[u + 6] << 8) + mem->data[u + 7]; + break; + } + } + /* Also look for legacy DMI entry point */ + if(memcmp(mem->data + u, "_DMI_", 5) == 0) { + hlen = 0x0f; + addr = *(unsigned *) (mem->data + u + 0x08); + len = *(unsigned short *) (mem->data + u + 0x06); + structs = *(unsigned short *) (mem->data + u + 0x0c); + ok = crc(mem->data + u, hlen) == 0 && len; + if(ok) { + bt->smbios_ver = ((mem->data[u + 0x0e] & 0xf0) << 4) + (mem->data[u + 0x0e] & 0x0f); + break; + } } } if(!ok) return; - bt->smbios_ver = (mem->data[u + 6] << 8) + mem->data[u + 7]; - hd_data->smbios = smbios_free(hd_data->smbios); memory.start = mem->start + u; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/block.c new/hwinfo-12.31/src/hd/block.c --- old/hwinfo-12.29/src/hd/block.c 2006-04-11 11:45:43.000000000 +0200 +++ new/hwinfo-12.31/src/hd/block.c 2006-05-08 14:52:36.000000000 +0200 @@ -55,7 +55,9 @@ load_module(hd_data, "ide_cd"); load_module(hd_data, "sr_mod"); load_module(hd_data, "sd_mod"); +#if !defined(__s390__) && !defined(__s390x__) load_module(hd_data, "st"); +#endif } PROGRESS(2, 0, "sysfs drivers"); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/hal.c new/hwinfo-12.31/src/hd/hal.c --- old/hwinfo-12.29/src/hd/hal.c 2006-03-14 12:55:28.000000000 +0100 +++ new/hwinfo-12.31/src/hd/hal.c 2006-05-04 13:56:03.000000000 +0200 @@ -531,6 +531,8 @@ } } + free_str_list(sl0); + return prop_list; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/hd.c new/hwinfo-12.31/src/hd/hd.c --- old/hwinfo-12.29/src/hd/hd.c 2006-03-17 15:35:16.000000000 +0100 +++ new/hwinfo-12.31/src/hd/hd.c 2006-05-08 12:59:16.000000000 +0200 @@ -1279,6 +1279,9 @@ free_mem(hd->modalias); + hd_free_hal_properties(hd->hal_prop); + hd_free_hal_properties(hd->persistent_prop); + memset(hd, 0, sizeof *hd); return NULL; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/pci.c new/hwinfo-12.31/src/hd/pci.c --- old/hwinfo-12.29/src/hd/pci.c 2006-03-27 18:25:30.000000000 +0200 +++ new/hwinfo-12.31/src/hd/pci.c 2006-05-08 13:00:36.000000000 +0200 @@ -41,6 +41,7 @@ static unsigned char pci_cfg_byte(pci_t *pci, int fd, unsigned idx); static void dump_pci_data(hd_data_t *hd_data); static void hd_read_macio(hd_data_t *hd_data); +static void hd_read_vio(hd_data_t *hd_data); void hd_scan_sysfs_pci(hd_data_t *hd_data) { @@ -66,6 +67,10 @@ PROGRESS(3, 0, "macio"); hd_read_macio(hd_data); + + PROGRESS(3, 0, "vio"); + + hd_read_vio(hd_data); } @@ -703,8 +708,10 @@ sysfs_close_attribute(attr); if( - !strcmp(macio_type, "network") || - !strcmp(macio_type, "scsi") + macio_type && ( + !strcmp(macio_type, "network") || + !strcmp(macio_type, "scsi") + ) ) { hd = add_hd_entry(hd_data, __LINE__, 0); @@ -712,7 +719,7 @@ hd->base_class.id = bc_network; hd->sub_class.id = 0; /* ethernet */ - if(!strcmp(macio_compat, "wireless")) { + if(macio_compat && !strcmp(macio_compat, "wireless")) { hd->sub_class.id = 0x82; hd->is.wlan = 1; } @@ -750,3 +757,87 @@ } +/* + * Get vio data from sysfs. + */ +void hd_read_vio(hd_data_t *hd_data) +{ + char *s, *vio_name, *vio_type; + int eth_cnt = 0, scsi_cnt = 0; + hd_t *hd; + + struct sysfs_bus *sf_bus; + struct dlist *sf_dev_list; + struct sysfs_device *sf_dev; + struct sysfs_attribute *attr; + + sf_bus = sysfs_open_bus("vio"); + + if(!sf_bus) { + ADD2LOG("sysfs: no such bus: vio\n"); + return; + } + + sf_dev_list = sysfs_get_bus_devices(sf_bus); + if(sf_dev_list) dlist_for_each_data(sf_dev_list, sf_dev, struct sysfs_device) { + ADD2LOG( + " vio device: name = %s, bus_id = %s, bus = %s\n path = %s\n", + sf_dev->name, + sf_dev->bus_id, + sf_dev->bus, + hd_sysfs_id(sf_dev->path) + ); + + vio_name = vio_type = NULL; + + if((s = hd_attr_str(attr = hd_read_single_sysfs_attribute(sf_dev->path, "devspec")))) { + vio_name = canon_str(s, strlen(s)); + ADD2LOG(" name = \"%s\"\n", vio_name); + } + sysfs_close_attribute(attr); + + if((s = hd_attr_str(attr = hd_read_single_sysfs_attribute(sf_dev->path, "name")))) { + vio_type = canon_str(s, strlen(s)); + ADD2LOG(" type = \"%s\"\n", vio_type); + } + sysfs_close_attribute(attr); + + if( + vio_type && ( + !strcmp(vio_type, "l-lan") || + !strcmp(vio_type, "v-scsi") + ) + ) { + hd = add_hd_entry(hd_data, __LINE__, 0); + hd->bus.id = bus_vio; + + hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6001); + + if(!strcmp(vio_type, "l-lan")) { + hd->base_class.id = bc_network; + hd->sub_class.id = 0; /* ethernet */ + hd->slot = eth_cnt++; + hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1002); + str_printf(&hd->device.name, 0, "Virtual Ethernet card %d", hd->slot); + } + else { /* scsi */ + hd->base_class.id = bc_storage; + hd->sub_class.id = sc_sto_scsi; + hd->slot = scsi_cnt++; + hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1001); + str_printf(&hd->device.name, 0, "Virtual SCSI %d", hd->slot); + } + + hd->rom_id = new_str(vio_name ? vio_name + 1 : 0); /* skip leading '/' */ + + hd->sysfs_id = new_str(hd_sysfs_id(sf_dev->path)); + hd->sysfs_bus_id = new_str(sf_dev->bus_id); + s = hd_sysfs_find_driver(hd_data, hd->sysfs_id, 1); + if(s) add_str_list(&hd->drivers, s); + } + } + + sysfs_close_bus(sf_bus); +} + + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/prom.c new/hwinfo-12.31/src/hd/prom.c --- old/hwinfo-12.29/src/hd/prom.c 2006-03-08 16:57:03.000000000 +0100 +++ new/hwinfo-12.31/src/hd/prom.c 2006-05-08 12:59:07.000000000 +0200 @@ -28,8 +28,6 @@ static void add_pci_prom_devices(hd_data_t *hd_data, hd_t *hd_parent, devtree_t *parent); static void add_legacy_prom_devices(hd_data_t *hd_data, devtree_t *dt); static int add_prom_display(hd_data_t *hd_data, devtree_t *dt); -static int add_prom_vscsi(hd_data_t *hd_data, devtree_t *dt); -static int add_prom_veth(hd_data_t *hd_data, devtree_t *dt); static void add_devices(hd_data_t *hd_data); static void dump_devtree_data(hd_data_t *hd_data); @@ -459,8 +457,6 @@ if(dt->pci) return; if(add_prom_display(hd_data, dt)) return; - if(add_prom_vscsi(hd_data, dt)) return; - if(add_prom_veth(hd_data, dt)) return; } int add_prom_display(hd_data_t *hd_data, devtree_t *dt) @@ -509,82 +505,6 @@ return 0; } -int add_prom_vscsi(hd_data_t *hd_data, devtree_t *dt) -{ - hd_t *hd; - char *s, *id; - - if( - dt->path && - dt->device_type && - !strcmp(dt->device_type, "vscsi") - ) { - /* vscsi storage */ - - if( - (s = strstr(dt->path, "v-scsi@")) && - *(id = s + sizeof "v-scsi@" - 1) - ) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_vio; - hd->base_class.id = bc_storage; - hd->sub_class.id = sc_sto_scsi; - hd->slot = veth_cnt++; - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6001); - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1001); - str_printf(&hd->device.name, 0, "Virtual SCSI %d", hd->slot); - hd->rom_id = new_str(dt->path); - - str_printf(&hd->sysfs_id, 0, "/devices/vio/%s", id); - str_printf(&hd->sysfs_bus_id, 0, "%s", id); - - return 1; - } - } - - return 0; -} - -int add_prom_veth(hd_data_t *hd_data, devtree_t *dt) -{ - hd_t *hd; - char *s, *id; - - if( - dt->path && - dt->device_type && - dt->compatible && - !strcmp(dt->device_type, "network") && - !strcmp(dt->compatible, "IBM,l-lan") - ) { - /* veth network */ - - if( - (s = strstr(dt->path, "l-lan@")) && - *(id = s + sizeof "l-lan@" - 1) - ) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_vio; - hd->base_class.id = bc_network; - hd->sub_class.id = 0x00; - hd->slot = veth_cnt++; - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6001); - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1002); - str_printf(&hd->device.name, 0, "Virtual Ethernet card %d", hd->slot); - hd->rom_id = new_str(dt->path); - - str_printf(&hd->sysfs_id, 0, "/devices/vio/%s", id); - str_printf(&hd->sysfs_bus_id, 0, "%s", id); - - return 1; - } - } - - return 0; -} - void add_devices(hd_data_t *hd_data) { hd_t *hd; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/s390.c new/hwinfo-12.31/src/hd/s390.c --- old/hwinfo-12.29/src/hd/s390.c 2006-04-11 11:45:38.000000000 +0200 +++ new/hwinfo-12.31/src/hd/s390.c 2006-05-08 17:01:06.000000000 +0200 @@ -189,6 +189,7 @@ hd->detail->ccw.data->lcss=(strtol(curdev->bus_id,0,16) << 8) + strtol(curdev->bus_id+2,0,16); hddb_add_info(hd_data,hd); } + sysfs_close_list(devlist); if(virtual_machine) { @@ -229,6 +230,7 @@ hd->sysfs_bus_id = new_str(strrchr(curdev->path,'/')+1); hddb_add_info(hd_data,hd); } + sysfs_close_list(devlist); } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-12.29/src/hd/smbios.c new/hwinfo-12.31/src/hd/smbios.c --- old/hwinfo-12.29/src/hd/smbios.c 2006-01-31 15:57:46.000000000 +0100 +++ new/hwinfo-12.31/src/hd/smbios.c 2006-05-04 13:56:03.000000000 +0200 @@ -851,7 +851,7 @@ sm->connect.i_type.id = sm_data[5]; sm->connect.x_type.id = sm_data[7]; sm->connect.port_type.id = sm_data[8]; - smbios_id2str(&sm->connect.port_type, &smbios_connect_conn_type, 0xff); + smbios_id2str(&sm->connect.i_type, &smbios_connect_conn_type, 0xff); smbios_id2str(&sm->connect.x_type, &smbios_connect_conn_type, 0xff); smbios_id2str(&sm->connect.port_type, &smbios_connect_port_type, 0xff); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de