Lines Matching refs:cs

93 ReadISAC(struct IsdnCardState *cs, u_char offset)  in ReadISAC()  argument
95 return (readreg(cs->hw.asus.adr, cs->hw.asus.isac, offset)); in ReadISAC()
99 WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC() argument
101 writereg(cs->hw.asus.adr, cs->hw.asus.isac, offset, value); in WriteISAC()
105 ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) in ReadISACfifo() argument
107 readfifo(cs->hw.asus.adr, cs->hw.asus.isac, 0, data, size); in ReadISACfifo()
111 WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) in WriteISACfifo() argument
113 writefifo(cs->hw.asus.adr, cs->hw.asus.isac, 0, data, size); in WriteISACfifo()
117 ReadISAC_IPAC(struct IsdnCardState *cs, u_char offset) in ReadISAC_IPAC() argument
119 return (readreg(cs->hw.asus.adr, cs->hw.asus.isac, offset|0x80)); in ReadISAC_IPAC()
123 WriteISAC_IPAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC_IPAC() argument
125 writereg(cs->hw.asus.adr, cs->hw.asus.isac, offset|0x80, value); in WriteISAC_IPAC()
129 ReadISACfifo_IPAC(struct IsdnCardState *cs, u_char * data, int size) in ReadISACfifo_IPAC() argument
131 readfifo(cs->hw.asus.adr, cs->hw.asus.isac, 0x80, data, size); in ReadISACfifo_IPAC()
135 WriteISACfifo_IPAC(struct IsdnCardState *cs, u_char * data, int size) in WriteISACfifo_IPAC() argument
137 writefifo(cs->hw.asus.adr, cs->hw.asus.isac, 0x80, data, size); in WriteISACfifo_IPAC()
141 ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) in ReadHSCX() argument
143 return (readreg(cs->hw.asus.adr, in ReadHSCX()
144 cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0))); in ReadHSCX()
148 WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) in WriteHSCX() argument
150 writereg(cs->hw.asus.adr, in WriteHSCX()
151 cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0), value); in WriteHSCX()
158 #define READHSCX(cs, nr, reg) readreg(cs->hw.asus.adr, \ argument
159 cs->hw.asus.hscx, reg + (nr ? 0x40 : 0))
160 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.asus.adr, \ argument
161 cs->hw.asus.hscx, reg + (nr ? 0x40 : 0), data)
163 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.asus.adr, \ argument
164 cs->hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
166 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.asus.adr, \ argument
167 cs->hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
174 struct IsdnCardState *cs = dev_id; in asuscom_interrupt() local
177 if (!cs) { in asuscom_interrupt()
181 val = readreg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_ISTA + 0x40); in asuscom_interrupt()
184 hscx_int_main(cs, val); in asuscom_interrupt()
185 val = readreg(cs->hw.asus.adr, cs->hw.asus.isac, ISAC_ISTA); in asuscom_interrupt()
188 isac_interrupt(cs, val); in asuscom_interrupt()
189 val = readreg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_ISTA + 0x40); in asuscom_interrupt()
191 if (cs->debug & L1_DEB_HSCX) in asuscom_interrupt()
192 debugl1(cs, "HSCX IntStat after IntRoutine"); in asuscom_interrupt()
195 val = readreg(cs->hw.asus.adr, cs->hw.asus.isac, ISAC_ISTA); in asuscom_interrupt()
197 if (cs->debug & L1_DEB_ISAC) in asuscom_interrupt()
198 debugl1(cs, "ISAC IntStat after IntRoutine"); in asuscom_interrupt()
201 writereg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_MASK, 0xFF); in asuscom_interrupt()
202 writereg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_MASK + 0x40, 0xFF); in asuscom_interrupt()
203 writereg(cs->hw.asus.adr, cs->hw.asus.isac, ISAC_MASK, 0xFF); in asuscom_interrupt()
204 writereg(cs->hw.asus.adr, cs->hw.asus.isac, ISAC_MASK, 0x0); in asuscom_interrupt()
205 writereg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_MASK, 0x0); in asuscom_interrupt()
206 writereg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_MASK + 0x40, 0x0); in asuscom_interrupt()
212 struct IsdnCardState *cs = dev_id; in asuscom_interrupt_ipac() local
215 if (!cs) { in asuscom_interrupt_ipac()
219 ista = readreg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_ISTA); in asuscom_interrupt_ipac()
221 if (cs->debug & L1_DEB_IPAC) in asuscom_interrupt_ipac()
222 debugl1(cs, "IPAC ISTA %02X", ista); in asuscom_interrupt_ipac()
224 val = readreg(cs->hw.asus.adr, cs->hw.asus.hscx, HSCX_ISTA + 0x40); in asuscom_interrupt_ipac()
232 hscx_int_main(cs, val); in asuscom_interrupt_ipac()
235 val = 0xfe & readreg(cs->hw.asus.adr, cs->hw.asus.isac, ISAC_ISTA | 0x80); in asuscom_interrupt_ipac()
237 isac_interrupt(cs, val); in asuscom_interrupt_ipac()
242 isac_interrupt(cs, val); in asuscom_interrupt_ipac()
244 ista = readreg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_ISTA); in asuscom_interrupt_ipac()
251 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xFF); in asuscom_interrupt_ipac()
252 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xC0); in asuscom_interrupt_ipac()
256 release_io_asuscom(struct IsdnCardState *cs) in release_io_asuscom() argument
260 if (cs->hw.asus.cfg_reg) in release_io_asuscom()
261 release_region(cs->hw.asus.cfg_reg, bytecnt); in release_io_asuscom()
265 reset_asuscom(struct IsdnCardState *cs) in reset_asuscom() argument
269 if (cs->subtyp == ASUS_IPAC) in reset_asuscom()
270 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x20); in reset_asuscom()
272 byteout(cs->hw.asus.adr, ASUS_RESET); /* Reset On */ in reset_asuscom()
277 if (cs->subtyp == ASUS_IPAC) in reset_asuscom()
278 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x0); in reset_asuscom()
280 byteout(cs->hw.asus.adr, 0); /* Reset Off */ in reset_asuscom()
283 if (cs->subtyp == ASUS_IPAC) { in reset_asuscom()
284 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_CONF, 0x0); in reset_asuscom()
285 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_ACFG, 0xff); in reset_asuscom()
286 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_AOE, 0x0); in reset_asuscom()
287 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xc0); in reset_asuscom()
288 writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_PCFG, 0x12); in reset_asuscom()
294 Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg) in Asus_card_msg() argument
298 reset_asuscom(cs); in Asus_card_msg()
301 release_io_asuscom(cs); in Asus_card_msg()
304 cs->debug |= L1_DEB_IPAC; in Asus_card_msg()
305 inithscxisac(cs, 3); in Asus_card_msg()
338 struct IsdnCardState *cs = card->cs; in setup_asuscom() local
344 if (cs->typ != ISDN_CTYPE_ASUSCOM) in setup_asuscom()
386 cs->hw.asus.cfg_reg = card->para[1]; in setup_asuscom()
387 cs->irq = card->para[0]; in setup_asuscom()
388 if (check_region((cs->hw.asus.cfg_reg), bytecnt)) { in setup_asuscom()
392 cs->hw.asus.cfg_reg, in setup_asuscom()
393 cs->hw.asus.cfg_reg + bytecnt); in setup_asuscom()
396 request_region(cs->hw.asus.cfg_reg, bytecnt, "asuscom isdn"); in setup_asuscom()
399 cs->hw.asus.cfg_reg, cs->irq); in setup_asuscom()
400 cs->BC_Read_Reg = &ReadHSCX; in setup_asuscom()
401 cs->BC_Write_Reg = &WriteHSCX; in setup_asuscom()
402 cs->BC_Send_Data = &hscx_fill_fifo; in setup_asuscom()
403 cs->cardmsg = &Asus_card_msg; in setup_asuscom()
404 val = readreg(cs->hw.asus.cfg_reg + ASUS_IPAC_ALE, in setup_asuscom()
405 cs->hw.asus.cfg_reg + ASUS_IPAC_DATA, IPAC_ID); in setup_asuscom()
407 cs->subtyp = ASUS_IPAC; in setup_asuscom()
408 cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_IPAC_ALE; in setup_asuscom()
409 cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA; in setup_asuscom()
410 cs->hw.asus.hscx = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA; in setup_asuscom()
411 test_and_set_bit(HW_IPAC, &cs->HW_Flags); in setup_asuscom()
412 cs->readisac = &ReadISAC_IPAC; in setup_asuscom()
413 cs->writeisac = &WriteISAC_IPAC; in setup_asuscom()
414 cs->readisacfifo = &ReadISACfifo_IPAC; in setup_asuscom()
415 cs->writeisacfifo = &WriteISACfifo_IPAC; in setup_asuscom()
416 cs->irq_func = &asuscom_interrupt_ipac; in setup_asuscom()
419 cs->subtyp = ASUS_ISACHSCX; in setup_asuscom()
420 cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_ADR; in setup_asuscom()
421 cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_ISAC; in setup_asuscom()
422 cs->hw.asus.hscx = cs->hw.asus.cfg_reg + ASUS_HSCX; in setup_asuscom()
423 cs->hw.asus.u7 = cs->hw.asus.cfg_reg + ASUS_CTRL_U7; in setup_asuscom()
424 cs->hw.asus.pots = cs->hw.asus.cfg_reg + ASUS_CTRL_POTS; in setup_asuscom()
425 cs->readisac = &ReadISAC; in setup_asuscom()
426 cs->writeisac = &WriteISAC; in setup_asuscom()
427 cs->readisacfifo = &ReadISACfifo; in setup_asuscom()
428 cs->writeisacfifo = &WriteISACfifo; in setup_asuscom()
429 cs->irq_func = &asuscom_interrupt; in setup_asuscom()
430 ISACVersion(cs, "ISDNLink:"); in setup_asuscom()
431 if (HscxVersion(cs, "ISDNLink:")) { in setup_asuscom()
434 release_io_asuscom(cs); in setup_asuscom()
439 reset_asuscom(cs); in setup_asuscom()