Lines Matching refs:cs
116 ReadISAC(struct IsdnCardState *cs, u_char offset) in ReadISAC() argument
120 switch (cs->subtyp) { in ReadISAC()
124 return (readreg(cs->hw.gazel.isac, off2)); in ReadISAC()
127 return (readreg_ipac(cs->hw.gazel.ipac, 0x80 + off2)); in ReadISAC()
133 WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC() argument
137 switch (cs->subtyp) { in WriteISAC()
141 writereg(cs->hw.gazel.isac, off2, value); in WriteISAC()
145 writereg_ipac(cs->hw.gazel.ipac, 0x80 + off2, value); in WriteISAC()
151 ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) in ReadISACfifo() argument
153 switch (cs->subtyp) { in ReadISACfifo()
156 read_fifo(cs->hw.gazel.isacfifo, data, size); in ReadISACfifo()
160 read_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); in ReadISACfifo()
166 WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) in WriteISACfifo() argument
168 switch (cs->subtyp) { in WriteISACfifo()
171 write_fifo(cs->hw.gazel.isacfifo, data, size); in WriteISACfifo()
175 write_fifo_ipac(cs->hw.gazel.ipac, 0x80, data, size); in WriteISACfifo()
181 ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) in ReadHSCXfifo() argument
183 switch (cs->subtyp) { in ReadHSCXfifo()
186 read_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); in ReadHSCXfifo()
190 read_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); in ReadHSCXfifo()
196 WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) in WriteHSCXfifo() argument
198 switch (cs->subtyp) { in WriteHSCXfifo()
201 write_fifo(cs->hw.gazel.hscxfifo[hscx], data, size); in WriteHSCXfifo()
205 write_fifo_ipac(cs->hw.gazel.ipac, hscx * 0x40, data, size); in WriteHSCXfifo()
211 ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) in ReadHSCX() argument
215 switch (cs->subtyp) { in ReadHSCX()
219 return (readreg(cs->hw.gazel.hscx[hscx], off2)); in ReadHSCX()
222 return (readreg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2)); in ReadHSCX()
228 WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) in WriteHSCX() argument
232 switch (cs->subtyp) { in WriteHSCX()
236 writereg(cs->hw.gazel.hscx[hscx], off2, value); in WriteHSCX()
240 writereg_ipac(cs->hw.gazel.ipac, hscx * 0x40 + off2, value); in WriteHSCX()
249 #define READHSCX(cs, nr, reg) ReadHSCX(cs, nr, reg) argument
250 #define WRITEHSCX(cs, nr, reg, data) WriteHSCX(cs, nr, reg, data) argument
251 #define READHSCXFIFO(cs, nr, ptr, cnt) ReadHSCXfifo(cs, nr, ptr, cnt) argument
252 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) WriteHSCXfifo(cs, nr, ptr, cnt) argument
260 struct IsdnCardState *cs = dev_id; in gazel_interrupt() local
264 if (!cs) { in gazel_interrupt()
269 valhscx = ReadHSCX(cs, 1, HSCX_ISTA); in gazel_interrupt()
271 hscx_int_main(cs, valhscx); in gazel_interrupt()
272 valisac = ReadISAC(cs, ISAC_ISTA); in gazel_interrupt()
274 isac_interrupt(cs, valisac); in gazel_interrupt()
278 WriteHSCX(cs, 0, HSCX_MASK, 0xFF); in gazel_interrupt()
279 WriteHSCX(cs, 1, HSCX_MASK, 0xFF); in gazel_interrupt()
280 WriteISAC(cs, ISAC_MASK, 0xFF); in gazel_interrupt()
281 WriteISAC(cs, ISAC_MASK, 0x0); in gazel_interrupt()
282 WriteHSCX(cs, 0, HSCX_MASK, 0x0); in gazel_interrupt()
283 WriteHSCX(cs, 1, HSCX_MASK, 0x0); in gazel_interrupt()
290 struct IsdnCardState *cs = dev_id; in gazel_interrupt_ipac() local
294 if (!cs) { in gazel_interrupt_ipac()
298 ista = ReadISAC(cs, IPAC_ISTA - 0x80); in gazel_interrupt_ipac()
301 val = ReadHSCX(cs, 1, HSCX_ISTA); in gazel_interrupt_ipac()
309 hscx_int_main(cs, val); in gazel_interrupt_ipac()
313 val = 0xfe & ReadISAC(cs, ISAC_ISTA); in gazel_interrupt_ipac()
315 isac_interrupt(cs, val); in gazel_interrupt_ipac()
320 isac_interrupt(cs, val); in gazel_interrupt_ipac()
322 ista = ReadISAC(cs, IPAC_ISTA - 0x80); in gazel_interrupt_ipac()
327 WriteISAC(cs, IPAC_MASK - 0x80, 0xFF); in gazel_interrupt_ipac()
328 WriteISAC(cs, IPAC_MASK - 0x80, 0xC0); in gazel_interrupt_ipac()
331 release_io_gazel(struct IsdnCardState *cs) in release_io_gazel() argument
335 switch (cs->subtyp) { in release_io_gazel()
338 release_region(i + cs->hw.gazel.hscx[0], 16); in release_io_gazel()
339 release_region(0xC000 + cs->hw.gazel.hscx[0], 1); in release_io_gazel()
343 release_region(cs->hw.gazel.hscx[0], 0x100); in release_io_gazel()
344 release_region(cs->hw.gazel.cfg_reg, 0x80); in release_io_gazel()
348 release_region(cs->hw.gazel.ipac, 0x8); in release_io_gazel()
349 release_region(cs->hw.gazel.cfg_reg, 0x80); in release_io_gazel()
353 release_region(cs->hw.gazel.ipac, 8); in release_io_gazel()
359 reset_gazel(struct IsdnCardState *cs) in reset_gazel() argument
362 unsigned long plxcntrl, addr = cs->hw.gazel.cfg_reg; in reset_gazel()
364 switch (cs->subtyp) { in reset_gazel()
389 WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); in reset_gazel()
393 WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); in reset_gazel()
394 WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); in reset_gazel()
395 WriteISAC(cs, IPAC_AOE - 0x80, 0x0); in reset_gazel()
396 WriteISAC(cs, IPAC_MASK - 0x80, 0xff); in reset_gazel()
397 WriteISAC(cs, IPAC_CONF - 0x80, 0x1); in reset_gazel()
399 WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); in reset_gazel()
402 WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); in reset_gazel()
404 WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); in reset_gazel()
405 WriteISAC(cs, IPAC_ACFG - 0x80, 0xff); in reset_gazel()
406 WriteISAC(cs, IPAC_AOE - 0x80, 0x0); in reset_gazel()
407 WriteISAC(cs, IPAC_MASK - 0x80, 0xff); in reset_gazel()
408 WriteISAC(cs, IPAC_CONF - 0x80, 0x1); in reset_gazel()
409 WriteISAC(cs, IPAC_MASK - 0x80, 0xc0); in reset_gazel()
416 Gazel_card_msg(struct IsdnCardState *cs, int mt, void *arg) in Gazel_card_msg() argument
420 reset_gazel(cs); in Gazel_card_msg()
423 release_io_gazel(cs); in Gazel_card_msg()
426 inithscxisac(cs, 1); in Gazel_card_msg()
427 if ((cs->subtyp==R647)||(cs->subtyp==R685)) { in Gazel_card_msg()
430 cs->bcs[i].hw.hscx.tsaxr0 = 0x1f; in Gazel_card_msg()
431 cs->bcs[i].hw.hscx.tsaxr1 = 0x23; in Gazel_card_msg()
442 reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs) in reserve_regions() argument
446 switch (cs->subtyp) { in reserve_regions()
448 base = cs->hw.gazel.hscx[0]; in reserve_regions()
463 if (check_region(adr = cs->hw.gazel.hscx[0], len = 0x100)) in reserve_regions()
465 if (check_region(adr = cs->hw.gazel.cfg_reg, len = 0x80)) in reserve_regions()
468 request_region(cs->hw.gazel.hscx[0], 0x100, "gazel"); in reserve_regions()
469 request_region(cs->hw.gazel.cfg_reg, 0x80, "gazel"); in reserve_regions()
473 if (check_region(adr = cs->hw.gazel.ipac, len = 0x8)) in reserve_regions()
475 if (check_region(adr = cs->hw.gazel.cfg_reg, len = 0x80)) in reserve_regions()
478 request_region(cs->hw.gazel.ipac, 0x8, "gazel"); in reserve_regions()
479 request_region(cs->hw.gazel.cfg_reg, 0x80, "gazel"); in reserve_regions()
483 if (check_region(adr = cs->hw.gazel.ipac, len = 0x8)) in reserve_regions()
485 request_region(cs->hw.gazel.ipac, 0x8, "gazel"); in reserve_regions()
493 CardType[cs->typ], adr, adr + len); in reserve_regions()
498 setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) in setup_gazelisa() argument
506 cs->subtyp = R742; in setup_gazelisa()
508 cs->subtyp = R647; in setup_gazelisa()
510 cs->hw.gazel.cfg_reg = card->para[1] + 0xC000; in setup_gazelisa()
511 cs->hw.gazel.ipac = card->para[1]; in setup_gazelisa()
512 cs->hw.gazel.isac = card->para[1] + 0x8000; in setup_gazelisa()
513 cs->hw.gazel.hscx[0] = card->para[1]; in setup_gazelisa()
514 cs->hw.gazel.hscx[1] = card->para[1] + 0x4000; in setup_gazelisa()
515 cs->irq = card->para[0]; in setup_gazelisa()
516 cs->hw.gazel.isacfifo = cs->hw.gazel.isac; in setup_gazelisa()
517 cs->hw.gazel.hscxfifo[0] = cs->hw.gazel.hscx[0]; in setup_gazelisa()
518 cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1]; in setup_gazelisa()
520 switch (cs->subtyp) { in setup_gazelisa()
523 cs->dc.isac.adf2 = 0x87; in setup_gazelisa()
526 cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); in setup_gazelisa()
529 cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); in setup_gazelisa()
534 test_and_set_bit(HW_IPAC, &cs->HW_Flags); in setup_gazelisa()
537 cs->irq, cs->hw.gazel.ipac); in setup_gazelisa()
547 setup_gazelpci(struct IsdnCardState *cs) in setup_gazelpci() argument
591 cs->hw.gazel.pciaddr[0] = pci_ioaddr0; in setup_gazelpci()
592 cs->hw.gazel.pciaddr[1] = pci_ioaddr1; in setup_gazelpci()
595 cs->hw.gazel.cfg_reg = pci_ioaddr0 & 0xfffe; in setup_gazelpci()
596 cs->hw.gazel.ipac = pci_ioaddr1; in setup_gazelpci()
597 cs->hw.gazel.isac = pci_ioaddr1 + 0x80; in setup_gazelpci()
598 cs->hw.gazel.hscx[0] = pci_ioaddr1; in setup_gazelpci()
599 cs->hw.gazel.hscx[1] = pci_ioaddr1 + 0x40; in setup_gazelpci()
600 cs->hw.gazel.isacfifo = cs->hw.gazel.isac; in setup_gazelpci()
601 cs->hw.gazel.hscxfifo[0] = cs->hw.gazel.hscx[0]; in setup_gazelpci()
602 cs->hw.gazel.hscxfifo[1] = cs->hw.gazel.hscx[1]; in setup_gazelpci()
603 cs->irq = pci_irq; in setup_gazelpci()
604 cs->irq_flags |= SA_SHIRQ; in setup_gazelpci()
609 cs->subtyp = R685; in setup_gazelpci()
610 cs->dc.isac.adf2 = 0x87; in setup_gazelpci()
613 cs->irq, cs->hw.gazel.isac, cs->hw.gazel.cfg_reg); in setup_gazelpci()
616 cs->hw.gazel.hscx[0], cs->hw.gazel.hscx[1]); in setup_gazelpci()
621 cs->subtyp = R753; in setup_gazelpci()
622 test_and_set_bit(HW_IPAC, &cs->HW_Flags); in setup_gazelpci()
625 cs->irq, cs->hw.gazel.ipac, cs->hw.gazel.cfg_reg); in setup_gazelpci()
635 struct IsdnCardState *cs = card->cs; in setup_gazel() local
642 if (cs->typ != ISDN_CTYPE_GAZEL) in setup_gazel()
646 if (setup_gazelisa(card, cs)) in setup_gazel()
651 if (setup_gazelpci(cs)) in setup_gazel()
659 if (reserve_regions(card, cs)) { in setup_gazel()
662 if (reset_gazel(cs)) { in setup_gazel()
664 release_io_gazel(cs); in setup_gazel()
667 cs->readisac = &ReadISAC; in setup_gazel()
668 cs->writeisac = &WriteISAC; in setup_gazel()
669 cs->readisacfifo = &ReadISACfifo; in setup_gazel()
670 cs->writeisacfifo = &WriteISACfifo; in setup_gazel()
671 cs->BC_Read_Reg = &ReadHSCX; in setup_gazel()
672 cs->BC_Write_Reg = &WriteHSCX; in setup_gazel()
673 cs->BC_Send_Data = &hscx_fill_fifo; in setup_gazel()
674 cs->cardmsg = &Gazel_card_msg; in setup_gazel()
676 switch (cs->subtyp) { in setup_gazel()
679 cs->irq_func = &gazel_interrupt; in setup_gazel()
680 ISACVersion(cs, "Gazel:"); in setup_gazel()
681 if (HscxVersion(cs, "Gazel:")) { in setup_gazel()
684 release_io_gazel(cs); in setup_gazel()
690 cs->irq_func = &gazel_interrupt_ipac; in setup_gazel()
691 val = ReadISAC(cs, IPAC_ID - 0x80); in setup_gazel()