Exemple #1
0
def of_printer(dict, dep, filename):
    v0 = strings("name", dict, '""')
    v1 = strings("type", dict, '""')
    v2 = strings("compat", dict, '""')
    if v0 == '""' and v1 == '""' and v2 == '""':
        return
    lkddb.lkddb_add("of '%s %s %s' %s # %s" % (v0, v1, v2, dep, filename))
Exemple #2
0
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))
Exemple #3
0
def pnp_card_printer(dict, dep, filename):
    v0 = strings("id", dict, '""')
    if v0 == '""':
        return
    s = [
        '""',
    ] * 8
    prods = lkddb.nullstring_re.sub('""', dict["devs"])
    line = lkddb.split_structs(prods)[0]
    dict_prod = lkddb.parse_struct(None,
                                   lkddb.unwind_array,
                                   line,
                                   None,
                                   filename,
                                   ret=True)
    for i in range(8):
        s[i] = strings("n%u" % (i + 1), dict_prod, '""')
    lkddb.lkddb_add(
        "pnp_card %s %s %s %s %s %s %s %s %s %s # %s" %
        (v0, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], dep, filename))
Exemple #4
0
def platform_printer(dict, dep, filename):
    if not dict.has_key("driver"):
        return
    block = dict["driver"]
    line = lkddb.split_structs(block)[0]
    driver_dict = lkddb.parse_struct(None,
                                     device_driver_fields,
                                     line,
                                     None,
                                     filename,
                                     ret=True)
    v0 = strings("name", driver_dict, '""')
    lkddb.lkddb_add("platform %s %s # %s" % (v0, dep, filename))
Exemple #5
0
def fs_printer(dict, dep, filename):
    v0 = strings("name", dict, '""')
    lkddb.lkddb_add("fs %s %s # %s" % (v0, dep, filename))
Exemple #6
0
def i2c_snd_printer(dict, dep, filename):
    if not dict.has_key("name"):
        return
    v0 = strings("name", dict, '""')
    lkddb.lkddb_add("i2c %s %s # %s" % (v0, dep, filename))
Exemple #7
0
def eisa_printer(dict, dep, filename):
    v0 = strings("sig", dict, '""')
    if v0 == '""':
        return
    lkddb.lkddb_add("eisa %s %s # %s" % (v0, dep, filename))
Exemple #8
0
def vio_printer(dict, dep, filename):
    v0 = strings("name", dict, '""')
    v1 = strings("compat", dict, '""')
    if v0 == '""' and v1 == '""':
        return
    lkddb.lkddb_add("vio %s %s %s # %s" % (v0, v1, dep, filename))
Exemple #9
0
def pnp_printer(dict, dep, filename):
    v0 = strings("id", dict, '""')
    if v0 == '""':
        return
    lkddb.lkddb_add("pnp %s %s # %s" % (v0, dep, filename))