]>
git.ipfire.org Git - people/ummeegge/ipfire-2.x.git/blob - src/hwinfo/src/hd/isdn.c
11 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
14 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19 #if !defined(__s390__) && !defined(__s390x__) && !defined(__alpha__)
21 void hd_scan_isdn(hd_data_t
*hd_data
)
26 if(!hd_probe_feature(hd_data
, pr_isdn
)) return;
28 hd_data
->module
= mod_isdn
;
31 remove_hd_entries(hd_data
);
33 PROGRESS(1, 0, "list");
39 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
41 hd
->base_class
.id
= bc_isdn
;
42 hd
->vendor
.id
= MAKE_ID(TAG_SPECIAL
, 0x3005);
43 hd
->device
.id
= MAKE_ID(TAG_SPECIAL
, 0x0500); // type, subtype
44 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
45 res
->io
.type
= res_io
;
47 res
->io
.base
= 0x0300;
48 res
->io
.access
= acc_rw
;
50 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
52 hd
->base_class
.id
= bc_isdn
;
53 hd
->vendor
.id
= MAKE_ID(TAG_EISA
, 0x1593);
54 hd
->device
.id
= MAKE_ID(TAG_EISA
, 0x0133); // type, subtype
55 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
56 res
->io
.type
= res_io
;
58 res
->io
.base
= 0x0240;
59 res
->io
.access
= acc_rw
;
60 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
61 res
->irq
.type
= res_irq
;
65 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
67 hd
->base_class
.id
= bc_isdn
;
68 hd
->vendor
.id
= MAKE_ID(TAG_EISA
, 0x0e98);
69 hd
->device
.id
= MAKE_ID(TAG_EISA
, 0x0000); // type, subtype
70 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
71 res
->io
.type
= res_io
;
73 res
->io
.base
= 0x0180;
74 res
->io
.access
= acc_rw
;
75 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
76 res
->io
.type
= res_io
;
78 res
->io
.base
= 0x0540;
79 res
->io
.access
= acc_rw
;
80 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
81 res
->irq
.type
= res_irq
;
85 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
87 hd
->base_class
.id
= bc_isdn
;
88 hd
->vendor
.id
= MAKE_ID(TAG_PCI
, 0x1244);
89 hd
->device
.id
= MAKE_ID(TAG_PCI
, 0x0a00); // type, subtype
90 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
91 res
->io
.type
= res_io
;
93 res
->io
.base
= 0xe000;
94 res
->io
.access
= acc_rw
;
96 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
98 hd
->base_class
.id
= bc_isdn
;
99 hd
->vendor
.id
= MAKE_ID(TAG_SPECIAL
, 0x3001);
100 hd
->device
.id
= MAKE_ID(TAG_SPECIAL
, 0x0100); // type, subtype
101 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
102 res
->io
.type
= res_io
;
104 res
->io
.base
= 0xe80;
105 res
->io
.access
= acc_rw
;
107 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
108 hd
->bus
.id
= bus_isa
;
109 hd
->base_class
.id
= bc_isdn
;
110 hd
->vendor
.id
= MAKE_ID(TAG_SPECIAL
, 0x3000);
111 hd
->device
.id
= MAKE_ID(TAG_SPECIAL
, 0x1a00); // type, subtype
112 res
= add_res_entry(&hd
->res
, new_mem(sizeof *res
));
113 res
->io
.type
= res_io
;
115 res
->io
.base
= 0x400;
116 res
->io
.access
= acc_rw
;
122 for(hd
= hd_data
->hd
; hd
; hd
= hd
->next
) {
123 if((cic
= get_isdn_info(hd
))) {
124 hd
->base_class
.id
= bc_isdn
;
125 hd
->sub_class
.id
= 0;
133 cdb_isdn_card
*get_isdn_info(hd_t
*hd
)
135 cdb_isdn_card
*cic0
, *cic
;
138 if(hd
->bus
.id
== bus_pci
||
139 hd
->bus
.id
== bus_isa
||
140 hd
->bus
.id
== bus_usb
||
141 hd
->bus
.id
== bus_pcmcia
||
142 hd
->bus
.id
== bus_cardbus
) {
145 u0
= ID_VALUE(hd
->vendor
.id
);
147 hd
->bus
.id
== bus_isa
&&
148 ID_TAG(hd
->vendor
.id
) == TAG_SPECIAL
&&
149 u0
>= 0x3000 && u0
<= 0x3006 &&
150 ID_TAG(hd
->device
.id
) == TAG_SPECIAL
152 u0
= ID_VALUE(hd
->device
.id
);
153 cic
= hd_cdbisdn_get_card_from_type(u0
>> 8, u0
& 0xff);
157 hd
->bus
.id
== bus_isa
&&
158 ID_TAG(hd
->vendor
.id
) == TAG_EISA
&&
159 ID_TAG(hd
->device
.id
) == TAG_EISA
161 u0
= ID_VALUE(hd
->vendor
.id
);
162 u1
= ID_VALUE(hd
->device
.id
);
163 cic
= hd_cdbisdn_get_card_from_id(((u0
& 0xff) << 8) + ((u0
>> 8) & 0xff),
164 ((u1
& 0xff) << 8) + ((u1
>> 8) & 0xff),
168 if(hd
->bus
.id
== bus_pci
) {
169 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
170 ID_VALUE(hd
->sub_vendor
.id
), ID_VALUE(hd
->sub_device
.id
));
173 if(hd
->bus
.id
== bus_usb
&&
174 ID_TAG(hd
->vendor
.id
) == TAG_USB
&&
175 ID_TAG(hd
->device
.id
) == TAG_USB
) {
177 if (hd
->revision
.id
== 0 && hd
->revision
.name
) {
178 /* the revision is usually saved as string (1.00) */
179 sscanf(hd
->revision
.name
, "%x.%x", &u1
, &u0
);
182 u0
= ID_VALUE(hd
->revision
.id
);
184 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
186 if (!cic
) /* to get cards without revision info in database */
187 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
191 if((hd
->bus
.id
== bus_pcmcia
|| hd
->bus
.id
== bus_cardbus
) &&
192 (hd
->base_class
.id
== bc_network
|| hd
->base_class
.id
== bc_isdn
)) {
193 if (hd
->drivers
&& hd
->drivers
->str
) {
194 if (0 == strcmp(hd
->drivers
->str
, "teles_cs")) {
195 cic
= hd_cdbisdn_get_card_from_type(8, 0);
196 } else if (0 == strcmp(hd
->drivers
->str
, "sedlbauer_cs")) {
197 cic
= hd_cdbisdn_get_card_from_type(22, 2);
198 } else if (0 == strcmp(hd
->drivers
->str
, "avma1_cs")) {
199 cic
= hd_cdbisdn_get_card_from_type(26, 0);
200 } else if (0 == strcmp(hd
->drivers
->str
, "fcpcmcia_cs")) {
201 cic
= hd_cdbisdn_get_card_from_type(8002, 5);
202 } else if (0 == strcmp(hd
->drivers
->str
, "elsa_cs")) {
203 cic
= hd_cdbisdn_get_card_from_type(10, 11);
204 } else if (0 == strcmp(hd
->drivers
->str
, "avm_cs")) {
205 cic
= hd_cdbisdn_get_card_from_type(8001, 2);
210 if (cic
&& cic
->Class
&& strcmp(cic
->Class
, "DSL")) {
211 cic0
= new_mem(sizeof *cic0
);
212 memcpy(cic0
, cic
, sizeof *cic0
);
219 void hd_scan_dsl(hd_data_t
*hd_data
)
224 if(!hd_probe_feature(hd_data
, pr_isdn
)) return;
226 hd_data
->module
= mod_dsl
;
229 remove_hd_entries(hd_data
);
231 PROGRESS(1, 0, "list");
237 hd
= add_hd_entry(hd_data
, __LINE__
, 0);
238 hd
->bus
.id
= bus_pci
;
239 hd
->base_class
.id
= bc_dsl
;
240 hd
->vendor
.id
= MAKE_ID(TAG_SPECIAL
, 0x1244);
241 hd
->device
.id
= MAKE_ID(TAG_SPECIAL
, 0x2700); // type, subtype
246 for(hd
= hd_data
->hd
; hd
; hd
= hd
->next
) {
247 if((cic
= get_dsl_info(hd
))) {
255 cdb_isdn_card
*get_dsl_info(hd_t
*hd
)
257 cdb_isdn_card
*cic0
, *cic
;
261 if(hd
->bus
.id
== bus_pci
||
262 hd
->bus
.id
== bus_usb
) {
266 if(hd
->bus
.id
== bus_pci
) {
267 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
268 ID_VALUE(hd
->sub_vendor
.id
), ID_VALUE(hd
->sub_device
.id
));
271 if(hd
->bus
.id
== bus_usb
&&
272 ID_TAG(hd
->vendor
.id
) == TAG_USB
&&
273 ID_TAG(hd
->device
.id
) == TAG_USB
) {
275 if (hd
->revision
.id
== 0 && hd
->revision
.name
) {
276 /* the revision is usually saved as string (1.00) */
277 sscanf(hd
->revision
.name
, "%x.%x", &u1
, &u0
);
280 u0
= ID_VALUE(hd
->revision
.id
);
282 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
284 if (!cic
) /* to get cards without revision info in database */
285 cic
= hd_cdbisdn_get_card_from_id(ID_VALUE(hd
->vendor
.id
), ID_VALUE(hd
->device
.id
),
289 if (cic
&& cic
->Class
&& !strcmp(cic
->Class
, "DSL")) {
290 hd
->base_class
.id
= bc_dsl
;
291 hd
->sub_class
.id
= sc_dsl_unknown
;
292 civ
= hd_cdbisdn_get_vario(cic
->vario
);
293 if (civ
&& civ
->interface
) {
294 if (0 == strncmp(civ
->interface
, "CAPI20", 6)) {
295 hd
->sub_class
.id
= sc_dsl_capi
;
296 } else if (0 == strncmp(civ
->interface
, "pppoe", 5)) {
297 hd
->sub_class
.id
= sc_dsl_pppoe
;
300 cic0
= new_mem(sizeof *cic0
);
301 memcpy(cic0
, cic
, sizeof *cic0
);
308 #endif /* !defined(__s390__) && !defined(__s390x__) && !defined(__alpha__) */
310 #endif /* !defined(LIBHD_TINY) */