Hello community, here is the log from the commit of package hwinfo checked in at Thu Feb 22 14:27:11 CET 2007. -------- --- hwinfo/hwinfo.changes 2007-02-19 17:44:52.000000000 +0100 +++ /mounts/work_src_done/STABLE/hwinfo/hwinfo.changes 2007-02-21 14:27:21.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Feb 21 14:27:14 CET 2007 - snwint@suse.de + +- removed most of prom parsing code (#220762) +- detect new xen stuff (#241564) + +------------------------------------------------------------------- Old: ---- hwinfo-13.22.tar.bz2 New: ---- hwinfo-13.23.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hwinfo.spec ++++++ --- /var/tmp/diff_new_pack.W18458/_old 2007-02-22 14:16:38.000000000 +0100 +++ /var/tmp/diff_new_pack.W18458/_new 2007-02-22 14:16:38.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package hwinfo (Version 13.22) +# spec file for package hwinfo (Version 13.23) # # Copyright (c) 2007 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: 13.22 +Version: 13.23 Release: 1 -Source: hwinfo-13.22.tar.bz2 +Source: hwinfo-13.23.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -89,6 +89,9 @@ %doc doc/libhd/html %changelog +* Wed Feb 21 2007 - snwint@suse.de +- removed most of prom parsing code (#220762) +- detect new xen stuff (#241564) * Mon Feb 19 2007 - snwint@suse.de - provide a bit more xen device info (#241564) - sysfs: 'bus' is now called 'subsystem' ++++++ hwinfo-13.22.tar.bz2 -> hwinfo-13.23.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/Changelog new/hwinfo-13.23/Changelog --- old/hwinfo-13.22/Changelog 2007-02-19 17:34:19.000000000 +0100 +++ new/hwinfo-13.23/Changelog 2007-02-21 14:26:50.000000000 +0100 @@ -1,3 +1,7 @@ +21/2/2007: v13.23 + - removed most of prom parsing code (#220762) + - detect new xen stuff (#241564) + 19/2/2007: v13.22 - provide a bit more xen device info (#241564) - sysfs: 'bus' is now called 'subsystem' diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/VERSION new/hwinfo-13.23/VERSION --- old/hwinfo-13.22/VERSION 2007-02-12 17:48:31.000000000 +0100 +++ new/hwinfo-13.23/VERSION 2007-02-20 13:04:36.000000000 +0100 @@ -1 +1 @@ -13.22 +13.23 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/hwinfo.c new/hwinfo-13.23/hwinfo.c --- old/hwinfo-13.22/hwinfo.c 2007-02-16 16:06:22.000000000 +0100 +++ new/hwinfo-13.23/hwinfo.c 2007-02-21 12:31:38.000000000 +0100 @@ -152,6 +152,7 @@ { "smp", 0, NULL, 2002 }, { "arch", 0, NULL, 2003 }, { "uml", 0, NULL, 2004 }, + { "xen", 0, NULL, 2005 }, { } }; @@ -306,11 +307,7 @@ hw_item[hw_items++] = i - 1000; break; - case 2000: - case 2001: - case 2002: - case 2003: - case 2004: + case 2000 ... 2005: if(hw_items < (int) (sizeof hw_item / sizeof *hw_item) - 1) hw_item[hw_items++] = i; break; @@ -479,7 +476,7 @@ void do_hw(hd_data_t *hd_data, FILE *f, hd_hw_item_t hw_item) { hd_t *hd, *hd0; - int smp = -1, uml = 0, i; + int smp = -1, uml = 0, xen = 0, i; char *s, *t; enum boot_arch b_arch; enum cpu_arch c_arch; @@ -512,6 +509,10 @@ uml = hd_is_uml(hd_data); break; + case 2005: + xen = hd_is_xen(hd_data); + break; + default: hd0 = hd_list(hd_data, hw_item, 1, NULL); } @@ -638,6 +639,9 @@ else if(hw_item == 2004) { fprintf(f ? f : stdout, "UML: %s\n", uml ? "yes" : "no"); } + else if(hw_item == 2005) { + fprintf(f ? f : stdout, "Xen: %s\n", xen ? "yes" : "no"); + } else { if(is_short) { /* always to stdout */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/src/hd/hd.c new/hwinfo-13.23/src/hd/hd.c --- old/hwinfo-13.22/src/hd/hd.c 2006-12-06 14:41:26.000000000 +0100 +++ new/hwinfo-13.23/src/hd/hd.c 2007-02-21 12:24:41.000000000 +0100 @@ -3155,6 +3155,41 @@ /* + * check for xen hypervisor + */ +int hd_is_xen(hd_data_t *hd_data) +{ + char signature[13]; + unsigned u, foo; + + __asm__( +#ifdef __i386__ + "push %%ebx\n\t" + "cpuid\n\t" + "mov %%ebx,(%%esi)\n\t" + "mov %%ecx,4(%%esi)\n\t" + "mov %%edx,8(%%esi)\n\t" + "pop %%ebx" +#else + "push %%rbx\n\t" + "cpuid\n\t" + "mov %%ebx,(%%rsi)\n\t" + "mov %%ecx,4(%%rsi)\n\t" + "mov %%edx,8(%%rsi)\n\t" + "pop %%rbx" +#endif + : "=a" (u), "=c" (foo) + : "a" (0x40000000), "c" (0), "S" (signature) + : "%edx" + ); + + signature[12] = 0; + + return u < 0x40000002 || strcmp(signature, "XenVMMXenVMM") ? 0 : 1; +} + + +/* * makes a (shallow) copy; does some magic fixes */ void hd_copy(hd_t *dst, hd_t *src) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/src/hd/hd.h new/hwinfo-13.23/src/hd/hd.h --- old/hwinfo-13.22/src/hd/hd.h 2007-02-13 12:37:51.000000000 +0100 +++ new/hwinfo-13.23/src/hd/hd.h 2007-02-21 12:24:59.000000000 +0100 @@ -2646,6 +2646,7 @@ int hd_mac_color(hd_data_t *hd_data); int hd_color(hd_data_t *hd_data); int hd_is_uml(hd_data_t *hd_data); +int hd_is_xen(hd_data_t *hd_data); unsigned hd_display_adapter(hd_data_t *hd_data); unsigned hd_boot_disk(hd_data_t *hd_data, int *matches); enum cpu_arch hd_cpu_arch(hd_data_t *hd_data); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/src/hd/pci.c new/hwinfo-13.23/src/hd/pci.c --- old/hwinfo-13.22/src/hd/pci.c 2007-02-12 15:47:53.000000000 +0100 +++ new/hwinfo-13.23/src/hd/pci.c 2007-02-21 12:54:16.000000000 +0100 @@ -50,6 +50,8 @@ static void hd_read_macio(hd_data_t *hd_data); static void hd_read_vio(hd_data_t *hd_data); static void hd_read_xen(hd_data_t *hd_data); +static void add_xen_network(hd_data_t *hd_data); +static void add_xen_storage(hd_data_t *hd_data); void hd_scan_sysfs_pci(hd_data_t *hd_data) { @@ -742,6 +744,12 @@ if(!sf_bus) { ADD2LOG("sysfs: no such bus: xen\n"); + + if(hd_is_xen(hd_data)) { + add_xen_network(hd_data); + add_xen_storage(hd_data); + } + return; } @@ -796,7 +804,7 @@ if(!strcmp(module, "xen_vnif")) u = 2; } hd->device.id = MAKE_ID(TAG_SPECIAL, u); - str_printf(&hd->device.name, 0, "Virtual Ethernet card %d", hd->slot); + str_printf(&hd->device.name, 0, "Virtual Ethernet Card %d", hd->slot); } else { /* storage */ hd->base_class.id = bc_storage; @@ -825,6 +833,42 @@ } free_str_list(sf_bus); + + /* maybe only one of xen_vnif, xen_vbd was loaded */ + if(!eth_cnt && !hd_module_is_active(hd_data, "xen_vnif")) add_xen_network(hd_data); + if(!blk_cnt && !hd_module_is_active(hd_data, "xen_vbd")) add_xen_storage(hd_data); +} + + +/* + * fake xen network device + */ +void add_xen_network(hd_data_t *hd_data) +{ + hd_t *hd; + + hd = add_hd_entry(hd_data, __LINE__, 0); + hd->base_class.id = bc_network; + hd->sub_class.id = 0; /* ethernet */ + hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6011); /* xen */ + hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0002); /* xen-vnif */ + hd->device.name = new_str("Virtual Ethernet Card"); +} + + +/* + * fake xen storage controller + */ +void add_xen_storage(hd_data_t *hd_data) +{ + hd_t *hd; + + hd = add_hd_entry(hd_data, __LINE__, 0); + hd->base_class.id = bc_storage; + hd->sub_class.id = sc_sto_other; + hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x6011); /* xen */ + hd->device.id = MAKE_ID(TAG_SPECIAL, 0x1002); /* xen-vbd */ + hd->device.name = new_str("Virtual Storage"); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.22/src/hd/prom.c new/hwinfo-13.23/src/hd/prom.c --- old/hwinfo-13.22/src/hd/prom.c 2007-02-19 17:31:38.000000000 +0100 +++ new/hwinfo-13.23/src/hd/prom.c 2007-02-20 13:04:10.000000000 +0100 @@ -28,9 +28,7 @@ static void read_mem(char *path, char *name, unsigned char **mem, unsigned len); static void read_int(char *path, char *name, int *val); static void read_devtree(hd_data_t *hd_data); -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 void add_prom_ehea(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); @@ -237,278 +235,11 @@ } -void add_pci_prom_devices(hd_data_t *hd_data, hd_t *hd_parent, devtree_t *parent) -{ - hd_t *hd; - hd_res_t *res; - devtree_t *dt, *dt2; - int irq, floppy_ctrl_idx; - unsigned sound_ok = 0, net_ok = 0, scsi_ok = 0; - unsigned id; - char *s; - - for(dt = hd_data->devtree; dt; dt = dt->next) { - if( - dt->parent == parent || - ( - /* special magic to reach some sound chips */ - dt->parent && - dt->parent->parent == parent && - !dt->parent->pci - ) - ) { - - if( - dt->device_type && - (!strcmp(dt->device_type, "block") || !strcmp(dt->device_type, "swim3")) - ) { - /* block devices */ - - s = dt->compatible ? dt->compatible : dt->name; - id = 0; - - if(s) { - if(strstr(s, "swim3")) { - id = MAKE_ID(TAG_SPECIAL, 0x0040); - } - } - - if(id) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_none; - hd->base_class.id = bc_storage; - hd->sub_class.id = sc_sto_floppy; - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x0401); - hd->device.id = id; - hd->attached_to = hd_parent->idx; - hd->rom_id = new_str(dt->path); - if(dt->interrupt) { - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->irq.type = res_irq; - res->irq.enabled = 1; - res->irq.base = dt->interrupt; - } - floppy_ctrl_idx = hd->idx; - - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->base_class.id = bc_storage_device; - hd->sub_class.id = sc_sdev_floppy; - hd->bus.id = bus_floppy; - hd->unix_dev_name = new_str("/dev/fd0"); - - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->size.type = res_size; - res->size.val1 = str2float("3.5", 2); - res->size.unit = size_unit_cinch; - - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->size.type = res_size; - res->size.val1 = 2880; - res->size.val2 = 0x200; - res->size.unit = size_unit_sectors; - - hd->attached_to = floppy_ctrl_idx; - } - } - - if( - !scsi_ok && - dt->device_type && - !strcmp(dt->device_type, "scsi") - ) { - /* scsi */ - scsi_ok = 1; /* max. 1 controller */ - - s = dt->compatible ? dt->compatible : dt->name; - id = 0; - - if(s) { - if(strstr(s, "mesh")) { /* mesh || chrp,mesh0 */ - id = MAKE_ID(TAG_SPECIAL, 0x0030); - } - else if(!strcmp(s, "53c94")) { - id = MAKE_ID(TAG_SPECIAL, 0x0031); - } - } - - if(id) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_none; - hd->base_class.id = bc_storage; - hd->sub_class.id = sc_sto_scsi; - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x0401); - hd->device.id = id; - hd->attached_to = hd_parent->idx; - hd->rom_id = new_str(dt->path); - if(dt->interrupt) { - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->irq.type = res_irq; - res->irq.enabled = 1; - res->irq.base = dt->interrupt; - } - } - } - - if( - !net_ok && - dt->device_type && - !strcmp(dt->device_type, "network") - ) { - /* network */ - net_ok = 1; /* max. 1 controller */ - - s = dt->compatible ? dt->compatible : dt->name; - id = 0; - - if(s) { - if(!strcmp(s, "mace")) { - id = MAKE_ID(TAG_SPECIAL, 0x0020); - } - else if(!strcmp(s, "bmac")) { - id = MAKE_ID(TAG_SPECIAL, 0x0021); - } - else if(!strcmp(s, "bmac+")) { - id = MAKE_ID(TAG_SPECIAL, 0x0022); - } - } - - if(id) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_none; - hd->base_class.id = bc_network; - hd->sub_class.id = 0; /* ethernet */ - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x0401); - hd->device.id = id; - hd->attached_to = hd_parent->idx; - hd->rom_id = new_str(dt->path); - if(dt->interrupt) { - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->irq.type = res_irq; - res->irq.enabled = 1; - res->irq.base = dt->interrupt; - } - } - } - - if( - !sound_ok && - dt->device_type && - strstr(dt->device_type, "sound") == dt->device_type - ) { - /* sound */ - sound_ok = 1; /* max 1 controller */ - - for(dt2 = dt; dt2; dt2 = dt2->next) { - if( - ( - dt2 == dt || - (dt2->parent && dt2->parent == dt) - ) && - ( - !strcmp(dt2->device_type, "sound") || - !strcmp(dt2->device_type, "soundchip") - ) - ) break; - } - if(!dt2) dt2 = dt; - - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_none; - hd->base_class.id = bc_multimedia; - hd->sub_class.id = sc_multi_audio; - hd->attached_to = hd_parent->idx; - hd->rom_id = new_str(dt2->path); - irq = dt2->interrupt; - if(irq <= 1 && dt2->parent && !dt2->parent->pci) { - irq = dt2->parent->interrupt; - } - if(irq > 1) { - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->irq.type = res_irq; - res->irq.enabled = 1; - res->irq.base = irq; - } - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x401); /* Apple */ - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0010); - - if(dt2->compatible) { - if(!strcmp(dt2->compatible, "screamer")) { - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0011); - } - else if(!strcmp(dt2->compatible, "burgundy")) { - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0012); - } - else if(!strcmp(dt2->compatible, "daca")) { - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0013); - } - else if(!strcmp(dt2->compatible, "CRUS,CS4236B")) { - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x402); /* IBM */ - hd->device.id = MAKE_ID(TAG_SPECIAL, 0x0014); - } - } - } - } - } -} - - void add_legacy_prom_devices(hd_data_t *hd_data, devtree_t *dt) { if(dt->pci) return; add_prom_ehea(hd_data, dt); - - if(add_prom_display(hd_data, dt)) return; -} - -int add_prom_display(hd_data_t *hd_data, devtree_t *dt) -{ - hd_t *hd; - hd_res_t *res; - unsigned id; - - if( - dt->device_type && - !strcmp(dt->device_type, "display") - ) { - /* display devices */ - - id = 0; - - if(dt->name) { - if(!strcmp(dt->name, "valkyrie")) { - id = MAKE_ID(TAG_SPECIAL, 0x3000); - } - else if(!strcmp(dt->name, "platinum")) { - id = MAKE_ID(TAG_SPECIAL, 0x3001); - } - } - - if(id) { - hd = add_hd_entry(hd_data, __LINE__, 0); - hd->bus.id = bus_none; - hd->base_class.id = bc_display; - hd->sub_class.id = sc_dis_other; - - hd->vendor.id = MAKE_ID(TAG_SPECIAL, 0x0401); - hd->device.id = id; - hd->rom_id = new_str(dt->path); - if(dt->interrupt) { - res = add_res_entry(&hd->res, new_mem(sizeof *res)); - res->irq.type = res_irq; - res->irq.enabled = 1; - res->irq.base = dt->interrupt; - } - - return 1; - } - } - - return 0; } void add_prom_ehea(hd_data_t *hd_data, devtree_t *dt) @@ -571,52 +302,10 @@ void add_devices(hd_data_t *hd_data) { - hd_t *hd; devtree_t *dt; -#if 0 - hd_res_t *res; - unsigned pci_slot = 0, u; -#endif - - /* remove old assignments */ - for(hd = hd_data->hd; hd; hd = hd->next) { - if(ID_TAG(hd->device.id) == TAG_PCI && ID_TAG(hd->vendor.id) == TAG_PCI) { - hd->rom_id = free_mem(hd->rom_id); - hd->detail = free_hd_detail(hd->detail); - } - } for(dt = hd_data->devtree; dt; dt = dt->next) { - if(dt->pci) { - for(hd = hd_data->hd; hd; hd = hd->next) { - if( - /* do *not* compare class ids */ - /* It would be better to check the slot numbers instead but - * as they are not stored within /proc/device-tree in a consistent - * way, we can't do that. - */ - !hd->rom_id && - ID_TAG(hd->device.id) == TAG_PCI && - ID_TAG(hd->vendor.id) == TAG_PCI && - ID_VALUE(hd->device.id) == dt->device_id && - ID_VALUE(hd->vendor.id) == dt->vendor_id && - (dt->subvendor_id == -1 || ID_VALUE(hd->sub_vendor.id) == dt->subvendor_id) && - (dt->subdevice_id == -1 || ID_VALUE(hd->sub_device.id) == dt->subdevice_id) && - hd->revision.id == dt->revision_id - ) break; - } - - if(hd) { - hd->rom_id = new_str(dt->path); - hd->detail = new_mem(sizeof *hd->detail); - hd->detail->type = hd_detail_devtree; - hd->detail->devtree.data = dt; - add_pci_prom_devices(hd_data, hd, dt); - } - } - else { - add_legacy_prom_devices(hd_data, dt); - } + if(!dt->pci) add_legacy_prom_devices(hd_data, dt); } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org