]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/hwinfo/src/hd/isa.c
9 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
12 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
17 static void scan_isa_isdn(hd_data_t
*hd_data
);
18 static isa_isdn_t
*free_isa_isdn(isa_isdn_t
*ii
);
20 static void dump_isa_isdn_data(hd_data_t
*hd_data
, isa_isdn_t
*ii
);
22 void hd_scan_isa(hd_data_t
*hd_data
)
24 if(!hd_probe_feature(hd_data
, pr_isa
)) return;
26 hd_data
->module
= mod_isa
;
29 remove_hd_entries(hd_data
);
30 // hd_data->isa = NULL;
32 if(hd_probe_feature(hd_data
, pr_isa_isdn
)) {
33 scan_isa_isdn(hd_data
);
38 void scan_isa_isdn(hd_data_t
*hd_data
)
44 PROGRESS(1, 0, "isdn");
48 dump_isa_isdn_data(hd_data
, ii0
);
50 PROGRESS(1, 1, "isdn");
52 for(ii
= ii0
; ii
; ii
= ii
->next
) {
53 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
55 hd
->base_class
.id
= bc_isdn
;
56 hd
->vendor
.id
= MAKE_ID(TAG_SPECIAL
, 0x3000 + ii
->type
);
57 hd
->device
.id
= MAKE_ID(TAG_SPECIAL
, ((ii
->type
<< 8) + (ii
->subtype
& 0xff)) & 0xffff);
60 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
61 res
->io
.type
= res_io
;
63 res
->io
.base
= ii
->io
;
64 res
->io
.access
= acc_rw
;
68 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
69 res
->irq
.type
= res_irq
;
71 res
->irq
.base
= ii
->irq
;
74 // #### ask libihw? -> isdn.c
81 isa_isdn_t
*new_isa_isdn(isa_isdn_t
**ii
)
83 while(*ii
) ii
= &(*ii
)->next
;
85 return *ii
= new_mem(sizeof **ii
);
88 isa_isdn_t
*free_isa_isdn(isa_isdn_t
*ii
)
92 for(; ii
; ii
= (l
= ii
)->next
, free_mem(l
));
97 void dump_isa_isdn_data(hd_data_t
*hd_data
, isa_isdn_t
*ii
)
99 ADD2LOG("---------- ISA ISDN raw data ----------\n");
101 for(; ii
; ii
= ii
->next
) {
102 ADD2LOG(" type %d, subtype %d", ii
->type
, ii
->subtype
);
103 if(ii
->has_mem
) ADD2LOG(", mem 0x%04x", ii
->mem
);
104 if(ii
->has_io
) ADD2LOG(", io 0x%04x", ii
->io
);
105 if(ii
->has_irq
) ADD2LOG(", irq %d", ii
->irq
);
109 ADD2LOG("---------- ISA ISDN raw data end ----------\n");
113 #endif /* defined(__i386__) */