def virtio_printer(dict, dep, filename): v0 = value("device", dict) v1 = value("vendor", dict) if v0 == 0 and v1 == 0: return v0 = str_value(v0, -1, 8) v1 = str_value(v1, 0xffffffff, 8) lkddb.lkddb_add("virtio '%s %s' %s # %s" % (v0, v1, dep, filename))
def sbb_printer(dict, dep, filename): v0 = value("vendor", dict) v1 = value("coreid", dict) v2 = value("revision", dict) if v0 == 0 and v1 == 0 and v2 == 0: return v0 = str_value(v0, 0xffff, 4) v1 = str_value(v1, 0xffff, 4) v2 = str_value(v2, 0xff, 2) lkddb.lkddb_add("sbb '%s %s %s' %s # %s" % (v0, v1, v2, dep, filename))
def parisc_printer(dict, dep, filename): v3 = value("sversion", dict) if v3 == 0: return v3 = str_value(v3, 0xffffffff, 8) v0 = str_value(value("hw_type", dict), 0xff, 2) v1 = str_value(value("hversion_rev", dict), 0xff, 2) v2 = str_value(value("hversion", dict), 0xffff, 4) lkddb.lkddb_add("parisc '%s %s %s %s' %s # %s" % (v0, v1, v2, v3, dep, filename))
def sdio_printer(dict, dep, filename): v0 = value("class", dict) v1 = value("vendor", dict) v2 = value("device", dict) if v0 == 0 and v1 == 0 and v2 == 0: return v0 = str_value(v0, -1, 2) v1 = str_value(v1, -1, 4) v2 = str_value(v2, -1, 4) lkddb.lkddb_add("sdio '%s %s %s' %s # %s" % (v0, v1, v2, dep, filename))
def serio_printer(dict, dep, filename): v0 = value("type", dict) v1 = value("proto", dict) if v0 == 0 and v1 == 0: return v0 = str_value(v0, 0xff, 2) v1 = str_value(v1, 0xff, 2) v2 = str_value(value("id", dict), 0xff, 2) v3 = str_value(value("extra", dict), 0xff, 2) lkddb.lkddb_add("serio '%s %s %s %s' %s # %s" % (v0, v1, v2, v3, dep, filename))
def input_printer(dict, dep, filename): match = value("flags", dict) if not match: return v0 = "...." v1 = "...." v2 = "...." v3 = "...." if match & INPUT_DEVICE_ID_MATCH_BUS: v0 = str_value(value("bustype", dict), -1, 4) if match & INPUT_DEVICE_ID_MATCH_VENDOR: v1 = str_value(value("vendor", dict), -1, 4) if match & INPUT_DEVICE_ID_MATCH_PRODUCT: v2 = str_value(value("product", dict), -1, 4) if match & INPUT_DEVICE_ID_MATCH_VERSION: v3 = str_value(value("version", dict), -1, 4) b1 = 0xff b2 = 0xffff b3 = 0xff b4 = 0xff b5 = 0xff b6 = 0xff b7 = 0xff b8 = 0xff b9 = 0xff if match & INPUT_DEVICE_ID_MATCH_EVBIT: b1 = value("evbit", dict) if match & INPUT_DEVICE_ID_MATCH_KEYBIT: b2 = value("keybit", dict) if match & INPUT_DEVICE_ID_MATCH_RELBIT: b3 = value("relbit", dict) if match & INPUT_DEVICE_ID_MATCH_ABSBIT: b4 = value("absbit", dict) if match & INPUT_DEVICE_ID_MATCH_MSCIT: b5 = value("mscbit", dict) if match & INPUT_DEVICE_ID_MATCH_LEDBIT: b6 = value("ledbit", dict) if match & INPUT_DEVICE_ID_MATCH_SNDBIT: b7 = value("sndbit", dict) if match & INPUT_DEVICE_ID_MATCH_FFBIT: b8 = value("ffbit", dict) if match & INPUT_DEVICE_ID_MATCH_SWBIT: b9 = value("swbit", dict) lkddb.lkddb_add( "input '%s %s %s %s' %s %s %s %s %s %s %s %s %s %s # %s" % (v0, v1, v2, v3, b1, b2, b3, b4, b5, b6, b7, b8, b9, dep, filename))
def ap_printer(dict, dep, filename): match = value("match_flags", dict) if not match: return if match & AP_DEVICE_ID_MATCH_DEVICE_TYPE: v0 = str_value(value("dev_type", dict), -1, 2) else: v0 = ".." lkddb.lkddb_add("ap '%s' %s # %s" % (v0, dep, filename))
def ccw_printer(dict, dep, filename): match = value("match_flags", dict) if not match: return v0 = "...." v1 = ".." v2 = "...." v3 = ".." if match & CCW_DEVICE_ID_MATCH_CU_TYPE: v0 = str_value(value("cu_type", dict), -1, 4) if match & CCW_DEVICE_ID_MATCH_CU_MODEL: v1 = str_value(value("cu_model", dict), -1, 2) if match & CCW_DEVICE_ID_MATCH_DEVICE_TYPE: v2 = str_value(value("dev_type", dict), -1, 4) if match & CCW_DEVICE_ID_MATCH_DEVICE_MODEL: v3 = str_value(value("dev_model", dict), -1, 2) lkddb.lkddb_add("ccw '%s %s %s %s' %s # %s" % (v0, v1, v2, v3, dep, filename))
def ieee1394_printer(dict, dep, filename): match = value("match_flags", dict) if not match: return v0 = "......" v1 = "......" v2 = "......" v3 = "......" if match & IEEE1394_MATCH_VENDOR_ID: v0 = str_value(value("vendor_id", dict), -1, 6) if match & IEEE1394_MATCH_MODEL_ID: v1 = str_value(value("model_id", dict), -1, 6) if match & IEEE1394_MATCH_SPECIFIER_ID: v2 = str_value(value("specifier_id", dict), -1, 6) if match & IEEE1394_MATCH_VERSION: v3 = str_value(value("version", dict), -1, 6) lkddb.lkddb_add("ieee1394 '%s %s %s %s' %s # %s" % (v0, v1, v2, v3, dep, filename))
def pcmcia_printer(dict, dep, filename): match = value("match_flags", dict) if not match: return v0 = "...." v1 = "...." v2 = ".." v3 = ".." v4 = ".." if match & PCMCIA_DEV_ID_MATCH_MANF_ID: v0 = str_value(value("manf_id", dict), -1, 4) if match & PCMCIA_DEV_ID_MATCH_CARD_ID: v1 = str_value(value("card_id", dict), -1, 4) if match & PCMCIA_DEV_ID_MATCH_FUNC_ID: v2 = str_value(value("func_id", dict), -1, 2) if match & PCMCIA_DEV_ID_MATCH_FUNCTION: v3 = str_value(value("function", dict), -1, 2) if match & PCMCIA_DEV_ID_MATCH_DEVICE_NO: v4 = str_value(value("device_no", dict), -1, 2) s1 = '""' s2 = '""' s3 = '""' s4 = '""' if match & (PCMCIA_DEV_ID_MATCH_PROD_ID1 | PCMCIA_DEV_ID_MATCH_PROD_ID2 | PCMCIA_DEV_ID_MATCH_PROD_ID3 | PCMCIA_DEV_ID_MATCH_PROD_ID4): prods = lkddb.nullstring_re.sub('""', dict["prod_id"]) line = lkddb.split_structs(prods)[0] dict_prod = lkddb.parse_struct(None, lkddb.unwind_array, line, None, filename, ret=True) if match | PCMCIA_DEV_ID_MATCH_PROD_ID1: s1 = strings("n1", dict_prod, '""') if match | PCMCIA_DEV_ID_MATCH_PROD_ID2: s2 = strings("n2", dict_prod, '""') if match | PCMCIA_DEV_ID_MATCH_PROD_ID3: s3 = strings("n3", dict_prod, '""') if match | PCMCIA_DEV_ID_MATCH_PROD_ID4: s4 = strings("n4", dict_prod, '""') lkddb.lkddb_add("pcmcia '%s %s %s %s %s' %s %s %s %s %s # %s" % (v0, v1, v2, v3, v4, s1, s2, s3, s4, dep, filename))
def usb_printer(dict, dep, filename): match = value("match_flags", dict) if not match: return v0 = "...." v1 = "...." v2 = 0 v3 = 65535 v4 = ".." v5 = ".." v6 = ".." v7 = ".." v8 = ".." v9 = ".." if match & USB_DEVICE_ID_MATCH_VENDOR: v0 = str_value(value("idVendor", dict), -1, 4) if match & USB_DEVICE_ID_MATCH_PRODUCT: v1 = str_value(value("idProduct", dict), -1, 4) if match & USB_DEVICE_ID_MATCH_DEV_LO: v2 = str_value(value("bcdDevice_lo", dict), -1, 4) if match & USB_DEVICE_ID_MATCH_DEV_HI: v3 = str_value(value("bcdDevice_hi", dict), -1, 4) if match & USB_DEVICE_ID_MATCH_DEV_CLASS: v4 = str_value(value("bDeviceClass", dict), -1, 2) if match & USB_DEVICE_ID_MATCH_DEV_SUBCLASS: v5 = str_value(value("bDeviceSubClass", dict), -1, 2) if match & USB_DEVICE_ID_MATCH_DEV_PROTOCOL: v6 = str_value(value("bDeviceProtocol", dict), -1, 2) if match & USB_DEVICE_ID_MATCH_INT_CLASS: v7 = str_value(value("bInterfaceClass", dict), -1, 2) if match & USB_DEVICE_ID_MATCH_INT_SUBCLASS: v8 = str_value(value("bInterfaceSubClass", dict), -1, 2) if match & USB_DEVICE_ID_MATCH_INT_PROTOCOL: v9 = str_value(value("bInterfaceProtocol", dict), -1, 2) lkddb.lkddb_add("usb '%s %s %s%s%s %s%s%s ....' %s %s %s # %s" % (v0, v1, v4, v5, v6, v7, v8, v9, v2, v3, dep, filename))
def pci_printer(dict, dep, filename): v0 = value("vendor", dict) v1 = value("device", dict) cl = value("class", dict) if v0 == 0 and v1 == 0 and cl == 0: return v2 = value("subvendor", dict) v3 = value("subdevice", dict) cm = value("class_mask", dict) v0 = str_value(v0, -1, 4) v1 = str_value(v1, -1, 4) v2 = str_value(v2, -1, 4) v3 = str_value(v3, -1, 4) cl = str_value(cl, -1, 6).replace("......", "ffffff") ### really needed ????????? cm = str_value(cm, -1, 6).replace("......", "ffffff") v4 = mask(cl, cm, 6) lkddb.lkddb_add("pci '%s %s %s %s %s' %s # %s" % (v0, v1, v2, v3, v4, dep, filename))