]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/hwinfo/src/isdn/isa_probe.c
14f7575deb949bba49b54ab16431e3ae023605dc
10 #define AVM_CONFIG_OFF 0x1800 /* offset for config register */
11 #define AVM_TEST_MASK 0x28 /* allways zero */
12 #define AVM_HSCX_A_VSTR 0x40e /* HSCX A version reg */
13 #define AVM_HSCX_B_VSTR 0xc0e /* HSCX B version reg */
15 int avm_a1_detect(isa_isdn_t
**ii
) {
17 unsigned char val
,v1
,v2
;
19 unsigned short AVM_ADR
[4]={0x200,0x240,0x300,0x340};
23 adr
=AVM_ADR
[i
] + AVM_CONFIG_OFF
;
25 if (val
& AVM_TEST_MASK
)
27 /* May be we found an AVM A1 or AVM Fritz!Classic */
28 /* Checking HSCX VERSIONS */
29 v1
= 0xf & inb(AVM_ADR
[i
] + AVM_HSCX_A_VSTR
);
30 if ((v1
!= 5) && (v1
!= 4))
32 v2
= 0xf & inb(AVM_ADR
[i
] + AVM_HSCX_B_VSTR
);
35 /* 99% we found an AVM A1 or AVM Fritz!Classic */
36 /* printf("# AVM A1 or Fritz!Classic found\n");
37 printf("TYPE=5 SUBTYPE=0 IO=0x%3x\n", AVM_ADR[i]); */
38 card
= new_isa_isdn(ii
);
39 card
->type
= 5; card
->has_io
= 1; card
->io
= AVM_ADR
[i
];
52 #define ELSA_IRQ_IDX 0x38 /* Bit 3,4,5 des Config-Reg */
53 #define ELSA_IRQ_IDX_PCC8 0x30 /* Bit 4,5 des Config-Reg */
54 #define ELSA_IRQ_IDX_PC 0x0c /* Bit 2,3 des Config-Reg */
58 probe_elsa_adr(unsigned int adr
)
60 int i
, in1
, in2
, p16_1
= 0, p16_2
= 0, p8_1
= 0, p8_2
= 0, pc_1
= 0,
61 pc_2
= 0, pfp_1
= 0, pfp_2
= 0;
63 for (i
= 0; i
< 16; i
++) {
64 in1
= inb(adr
+ ELSA_CONFIG
); /* 'toggelt' bei */
65 in2
= inb(adr
+ ELSA_CONFIG
); /* jedem Zugriff */
75 if (65 == ++p16_1
* ++p16_2
) {
77 } else if (1025 == ++pfp_1
* ++pfp_2
) {
79 } else if (33 == ++p8_1
* ++p8_2
) {
81 } else if (17 == ++pc_1
* ++pc_2
) {
88 probe_elsa(isa_isdn_t
**ii
)
90 int i
, subtyp
, val
, irq
, found
=0;
93 unsigned int CARD_portlist
[] =
94 {0x160, 0x170, 0x260, 0x360, 0};
96 for (i
= 0; CARD_portlist
[i
]; i
++) {
97 if ((subtyp
= probe_elsa_adr(CARD_portlist
[i
]))) {
99 val
= inb(CARD_portlist
[i
] + ELSA_CONFIG
);
100 if (subtyp
== ELSA_PC
) {
102 {7, 3, 5, 9, 0, 0, 0, 0};
103 irq
= CARD_IrqTab
[(val
& ELSA_IRQ_IDX_PC
) >> 2];
104 } else if (subtyp
== ELSA_PCC8
) {
106 {7, 3, 5, 9, 0, 0, 0, 0};
107 irq
= CARD_IrqTab
[(val
& ELSA_IRQ_IDX_PCC8
) >> 4];
110 {15, 10, 15, 3, 11, 5, 11, 9};
111 irq
= CARD_IrqTab
[(val
& ELSA_IRQ_IDX
) >> 3];
115 /* printf("# Elsa ML PC found\n");
116 printf("TYPE=6 SUBTYPE=%d IO=0x%03x IRQ=%d\n",
117 subtyp, CARD_portlist[i], irq); */
119 /* printf("# Elsa ML PCC-8 found\n");
120 printf("TYPE=6 SUBTYPE=%d IO=0x%03x IRQ=%d\n",
121 subtyp, CARD_portlist[i], irq); */
123 /* printf("# Elsa ML PCC-16 found\n");
124 printf("TYPE=6 SUBTYPE=%d IO=0x%03x IRQ=%d\n",
125 subtyp, CARD_portlist[i], irq); */
127 /* printf("# Elsa ML PCF found\n");
128 printf("TYPE=6 SUBTYPE=%d IO=0x%03x IRQ=%d\n",
129 subtyp, CARD_portlist[i], irq); */
131 /* printf("# Elsa ML PCFPro found\n");
132 printf("TYPE=6 SUBTYPE=%d IO=0x%03x IRQ=%d\n",
133 subtyp, CARD_portlist[i], irq); */
135 card
= new_isa_isdn(ii
);
136 card
->type
= 6; card
->subtype
= subtyp
;
137 card
->has_io
= 1; card
->io
= CARD_portlist
[i
];
138 card
->has_irq
= 1; card
->irq
= irq
;
147 #define TELES_CONFIG_OFF 0xc00
148 #define TELES_ID1 0x51
149 #define TELES_ID2 0x93
150 #define TELES_16_0 0x1e
151 #define TELES_16_0_AB 0x1f
152 #define TELES_16_3_0 0x1c
153 #define TELES_16_3_1 0x39
154 #define TELES_16_3_3 0x38
155 #define TELES_16_3_AB 0x46
158 int telesdetect(isa_isdn_t
**ii
) {
161 unsigned short TELES_ADR
[3]={0x380,0x280,0x180};
165 adr
=TELES_ADR
[i
] + TELES_CONFIG_OFF
;
168 if (val
!= TELES_ID1
)
172 if (val
!= TELES_ID2
)
178 /* printf("# Teles 16.0 found\n");
179 printf("TYPE=1 SUBTYPE=0 IO=0x%3x\n",
180 TELES_ADR[i] + TELES_CONFIG_OFF); */
182 /* printf("# Teles 16.0 AB found\n");
183 printf("TYPE=1 SUBTYPE=1 IO=0x%3x\n",
184 TELES_ADR[i] + TELES_CONFIG_OFF); */
185 card
= new_isa_isdn(ii
);
187 if(val
== TELES_16_0_AB
) card
->subtype
= 1;
188 card
->has_io
= 1; card
->io
= TELES_ADR
[i
] + TELES_CONFIG_OFF
;
192 /* printf("# Teles 16.3 v1.0 found\n");
193 printf("TYPE=3 SUBTYPE=0 IO=0x%3x\n",
196 /* printf("# Teles 16.3 v1.1 found\n");
197 printf("TYPE=3 SUBTYPE=0 IO=0x%3x\n",
200 /* printf("# Teles 16.3 v1.3 found\n");
201 printf("TYPE=3 SUBTYPE=0 IO=0x%3x\n",
204 /* printf("# Teles 16.3 AB Video found\n");
205 printf("TYPE=3 SUBTYPE=1 IO=0x%3x\n",
207 card
= new_isa_isdn(ii
);
209 if(val
== TELES_16_3_AB
) card
->subtype
= 1;
210 card
->has_io
= 1; card
->io
= TELES_ADR
[i
];
215 printf("# may be a Teles 16.0/16.3 detected at IO=0x%3x byte 3 is 0x%02x\n",
216 TELES_ADR
[i
] + TELES_CONFIG_OFF
, val
);
223 isa_isdn_t
*isdn_detect()
225 isa_isdn_t
*ii
= NULL
;
227 if(iopl(3) < 0) return ii
;