23 static const char *Asuscom_revision =
"$Revision: 1.14.2.4 $";
25 #define byteout(addr, val) outb(val, addr)
26 #define bytein(addr) inb(addr)
31 #define ASUS_CTRL_U7 3
32 #define ASUS_CTRL_POTS 5
34 #define ASUS_IPAC_ALE 0
35 #define ASUS_IPAC_DATA 1
37 #define ASUS_ISACHSCX 1
41 #define ASUS_RESET 0x80
57 insb(adr, data, size);
72 outsb(adr, data, size);
80 return (
readreg(cs->hw.asus.adr, cs->hw.asus.isac, offset));
86 writereg(cs->hw.asus.adr, cs->hw.asus.isac, offset, value);
92 readfifo(cs->hw.asus.adr, cs->hw.asus.isac, 0, data, size);
98 writefifo(cs->hw.asus.adr, cs->hw.asus.isac, 0, data, size);
102 ReadISAC_IPAC(
struct IsdnCardState *cs,
u_char offset)
104 return (
readreg(cs->hw.asus.adr, cs->hw.asus.isac, offset | 0x80));
110 writereg(cs->hw.asus.adr, cs->hw.asus.isac, offset | 0x80, value);
114 ReadISACfifo_IPAC(
struct IsdnCardState *cs,
u_char *
data,
int size)
116 readfifo(cs->hw.asus.adr, cs->hw.asus.isac, 0x80, data, size);
120 WriteISACfifo_IPAC(
struct IsdnCardState *cs,
u_char *
data,
int size)
122 writefifo(cs->hw.asus.adr, cs->hw.asus.isac, 0x80, data, size);
128 return (
readreg(cs->hw.asus.adr,
129 cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0)));
136 cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0), value);
143 #define READHSCX(cs, nr, reg) readreg(cs->hw.asus.adr, \
144 cs->hw.asus.hscx, reg + (nr ? 0x40 : 0))
145 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.asus.adr, \
146 cs->hw.asus.hscx, reg + (nr ? 0x40 : 0), data)
148 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.asus.adr, \
149 cs->hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
151 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.asus.adr, \
152 cs->hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
157 asuscom_interrupt(
int intno,
void *
dev_id)
159 struct IsdnCardState *cs =
dev_id;
167 hscx_int_main(cs, val);
174 if (cs->debug & L1_DEB_HSCX)
175 debugl1(cs,
"HSCX IntStat after IntRoutine");
180 if (cs->debug & L1_DEB_ISAC)
181 debugl1(cs,
"ISAC IntStat after IntRoutine");
190 spin_unlock_irqrestore(&cs->lock, flags);
195 asuscom_interrupt_ipac(
int intno,
void *
dev_id)
197 struct IsdnCardState *cs =
dev_id;
204 if (cs->debug & L1_DEB_IPAC)
205 debugl1(cs,
"IPAC ISTA %02X", ista);
215 hscx_int_main(cs, val);
228 if ((ista & 0x3f) && icnt) {
236 spin_unlock_irqrestore(&cs->lock, flags);
241 release_io_asuscom(
struct IsdnCardState *cs)
245 if (cs->hw.asus.cfg_reg)
250 reset_asuscom(
struct IsdnCardState *cs)
272 Asus_card_msg(
struct IsdnCardState *cs,
int mt,
void *
arg)
280 spin_unlock_irqrestore(&cs->lock, flags);
283 release_io_asuscom(cs);
287 cs->debug |= L1_DEB_IPAC;
289 spin_unlock_irqrestore(&cs->lock, flags);
301 (
unsigned long)
"Asus1688 PnP" },
304 (
unsigned long)
"Asus1690 PnP" },
307 (
unsigned long)
"Isurf2 PnP" },
310 (
unsigned long)
"Iscas TE320" },
322 struct IsdnCardState *cs = card->
cs;
326 strcpy(tmp, Asuscom_revision);
333 while (ipid->card_vendor) {
335 ipid->card_device, pnp_c))) {
338 ipid->vendor, ipid->function, pnp_d))) {
342 (
char *)ipid->driver_data);
350 card->
para[1] = pnp_port_start(pnp_d, 0);
352 if (!card->
para[0] || !card->
para[1]) {
366 if (!ipid->card_vendor) {
373 cs->hw.asus.cfg_reg = card->
para[1];
374 cs->irq = card->
para[0];
375 if (!
request_region(cs->hw.asus.cfg_reg, bytecnt,
"asuscom isdn")) {
377 "HiSax: ISDNLink config port %x-%x already in use\n",
379 cs->hw.asus.cfg_reg + bytecnt);
383 cs->hw.asus.cfg_reg, cs->irq);
387 cs->BC_Send_Data = &hscx_fill_fifo;
388 cs->cardmsg = &Asus_card_msg;
391 if ((val == 1) || (val == 2)) {
397 cs->readisac = &ReadISAC_IPAC;
398 cs->writeisac = &WriteISAC_IPAC;
399 cs->readisacfifo = &ReadISACfifo_IPAC;
400 cs->writeisacfifo = &WriteISACfifo_IPAC;
401 cs->irq_func = &asuscom_interrupt_ipac;
405 cs->hw.asus.adr = cs->hw.asus.cfg_reg +
ASUS_ADR;
406 cs->hw.asus.isac = cs->hw.asus.cfg_reg +
ASUS_ISAC;
407 cs->hw.asus.hscx = cs->hw.asus.cfg_reg +
ASUS_HSCX;
412 cs->readisacfifo = &ReadISACfifo;
413 cs->writeisacfifo = &WriteISACfifo;
414 cs->irq_func = &asuscom_interrupt;
418 "ISDNLink: wrong HSCX versions check IO address\n");
419 release_io_asuscom(cs);