• Home
  • Raw
  • Download

Lines Matching refs:cs

136 static void set_arcofi(struct IsdnCardState *cs, int bc);
176 ReadISAC(struct IsdnCardState *cs, u_char offset) in ReadISAC() argument
178 return (readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset)); in ReadISAC()
182 WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC() argument
184 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset, value); in WriteISAC()
188 ReadISACfifo(struct IsdnCardState *cs, u_char *data, int size) in ReadISACfifo() argument
190 readfifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0, data, size); in ReadISACfifo()
194 WriteISACfifo(struct IsdnCardState *cs, u_char *data, int size) in WriteISACfifo() argument
196 writefifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0, data, size); in WriteISACfifo()
200 ReadISAC_IPAC(struct IsdnCardState *cs, u_char offset) in ReadISAC_IPAC() argument
202 return (readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset + 0x80)); in ReadISAC_IPAC()
206 WriteISAC_IPAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC_IPAC() argument
208 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, offset | 0x80, value); in WriteISAC_IPAC()
212 ReadISACfifo_IPAC(struct IsdnCardState *cs, u_char *data, int size) in ReadISACfifo_IPAC() argument
214 readfifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0x80, data, size); in ReadISACfifo_IPAC()
218 WriteISACfifo_IPAC(struct IsdnCardState *cs, u_char *data, int size) in WriteISACfifo_IPAC() argument
220 writefifo(cs->hw.elsa.ale, cs->hw.elsa.isac, 0x80, data, size); in WriteISACfifo_IPAC()
224 ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) in ReadHSCX() argument
226 return (readreg(cs->hw.elsa.ale, in ReadHSCX()
227 cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0))); in ReadHSCX()
231 WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) in WriteHSCX() argument
233 writereg(cs->hw.elsa.ale, in WriteHSCX()
234 cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0), value); in WriteHSCX()
238 readitac(struct IsdnCardState *cs, u_char off) in readitac() argument
242 byteout(cs->hw.elsa.ale, off); in readitac()
243 ret = bytein(cs->hw.elsa.itac); in readitac()
248 writeitac(struct IsdnCardState *cs, u_char off, u_char data) in writeitac() argument
250 byteout(cs->hw.elsa.ale, off); in writeitac()
251 byteout(cs->hw.elsa.itac, data); in writeitac()
255 TimerRun(struct IsdnCardState *cs) in TimerRun() argument
259 v = bytein(cs->hw.elsa.cfg); in TimerRun()
260 if ((cs->subtyp == ELSA_QS1000) || (cs->subtyp == ELSA_QS3000)) in TimerRun()
262 else if (cs->subtyp == ELSA_PCC8) in TimerRun()
270 #define READHSCX(cs, nr, reg) readreg(cs->hw.elsa.ale, \ argument
271 cs->hw.elsa.hscx, reg + (nr ? 0x40 : 0))
272 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.elsa.ale, \ argument
273 cs->hw.elsa.hscx, reg + (nr ? 0x40 : 0), data)
275 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.elsa.ale, \ argument
276 cs->hw.elsa.hscx, (nr ? 0x40 : 0), ptr, cnt)
278 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.elsa.ale, \ argument
279 cs->hw.elsa.hscx, (nr ? 0x40 : 0), ptr, cnt)
286 struct IsdnCardState *cs = dev_id; in elsa_interrupt() local
291 if ((cs->typ == ISDN_CTYPE_ELSA_PCMCIA) && (*cs->busy_flag == 1)) { in elsa_interrupt()
297 spin_lock_irqsave(&cs->lock, flags); in elsa_interrupt()
299 if (cs->hw.elsa.MFlag) { in elsa_interrupt()
300 val = serial_inp(cs, UART_IIR); in elsa_interrupt()
302 debugl1(cs, "IIR %02x", val); in elsa_interrupt()
303 rs_interrupt_elsa(cs); in elsa_interrupt()
307 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt()
310 hscx_int_main(cs, val); in elsa_interrupt()
312 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA); in elsa_interrupt()
315 isac_interrupt(cs, val); in elsa_interrupt()
317 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt()
319 if (cs->debug & L1_DEB_HSCX) in elsa_interrupt()
320 debugl1(cs, "HSCX IntStat after IntRoutine"); in elsa_interrupt()
324 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA); in elsa_interrupt()
326 if (cs->debug & L1_DEB_ISAC) in elsa_interrupt()
327 debugl1(cs, "ISAC IntStat after IntRoutine"); in elsa_interrupt()
333 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF); in elsa_interrupt()
334 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF); in elsa_interrupt()
335 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF); in elsa_interrupt()
336 if (cs->hw.elsa.status & ELIRQF_TIMER_AKTIV) { in elsa_interrupt()
337 if (!TimerRun(cs)) { in elsa_interrupt()
339 byteout(cs->hw.elsa.timer, 0); in elsa_interrupt()
340 cs->hw.elsa.counter++; in elsa_interrupt()
344 if (cs->hw.elsa.MFlag) { in elsa_interrupt()
345 val = serial_inp(cs, UART_MCR); in elsa_interrupt()
347 serial_outp(cs, UART_MCR, val); in elsa_interrupt()
348 val = serial_inp(cs, UART_MCR); in elsa_interrupt()
350 serial_outp(cs, UART_MCR, val); in elsa_interrupt()
353 if (cs->hw.elsa.trig) in elsa_interrupt()
354 byteout(cs->hw.elsa.trig, 0x00); in elsa_interrupt()
355 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0x0); in elsa_interrupt()
356 writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0x0); in elsa_interrupt()
357 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0x0); in elsa_interrupt()
358 spin_unlock_irqrestore(&cs->lock, flags); in elsa_interrupt()
365 struct IsdnCardState *cs = dev_id; in elsa_interrupt_ipac() local
370 spin_lock_irqsave(&cs->lock, flags); in elsa_interrupt_ipac()
371 if (cs->subtyp == ELSA_QS1000PCI || cs->subtyp == ELSA_QS3000PCI) { in elsa_interrupt_ipac()
372 val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */ in elsa_interrupt_ipac()
374 spin_unlock_irqrestore(&cs->lock, flags); in elsa_interrupt_ipac()
379 if (cs->hw.elsa.MFlag) { in elsa_interrupt_ipac()
380 val = serial_inp(cs, UART_IIR); in elsa_interrupt_ipac()
382 debugl1(cs, "IIR %02x", val); in elsa_interrupt_ipac()
383 rs_interrupt_elsa(cs); in elsa_interrupt_ipac()
387 ista = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ISTA); in elsa_interrupt_ipac()
389 if (cs->debug & L1_DEB_IPAC) in elsa_interrupt_ipac()
390 debugl1(cs, "IPAC ISTA %02X", ista); in elsa_interrupt_ipac()
392 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40); in elsa_interrupt_ipac()
400 hscx_int_main(cs, val); in elsa_interrupt_ipac()
403 val = 0xfe & readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA + 0x80); in elsa_interrupt_ipac()
405 isac_interrupt(cs, val); in elsa_interrupt_ipac()
410 isac_interrupt(cs, val); in elsa_interrupt_ipac()
412 ista = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ISTA); in elsa_interrupt_ipac()
419 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xFF); in elsa_interrupt_ipac()
420 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xC0); in elsa_interrupt_ipac()
421 spin_unlock_irqrestore(&cs->lock, flags); in elsa_interrupt_ipac()
426 release_io_elsa(struct IsdnCardState *cs) in release_io_elsa() argument
430 del_timer(&cs->hw.elsa.tl); in release_io_elsa()
432 clear_arcofi(cs); in release_io_elsa()
434 if (cs->hw.elsa.ctrl) in release_io_elsa()
435 byteout(cs->hw.elsa.ctrl, 0); /* LEDs Out */ in release_io_elsa()
436 if (cs->subtyp == ELSA_QS1000PCI) { in release_io_elsa()
437 byteout(cs->hw.elsa.cfg + 0x4c, 0x01); /* disable IRQ */ in release_io_elsa()
438 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
440 release_region(cs->hw.elsa.cfg, 0x80); in release_io_elsa()
442 if (cs->subtyp == ELSA_QS3000PCI) { in release_io_elsa()
443 byteout(cs->hw.elsa.cfg + 0x4c, 0x03); /* disable ELSA PCI IRQ */ in release_io_elsa()
444 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
445 release_region(cs->hw.elsa.cfg, 0x80); in release_io_elsa()
447 if (cs->subtyp == ELSA_PCMCIA_IPAC) { in release_io_elsa()
448 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in release_io_elsa()
450 if ((cs->subtyp == ELSA_PCFPRO) || in release_io_elsa()
451 (cs->subtyp == ELSA_QS3000) || in release_io_elsa()
452 (cs->subtyp == ELSA_PCF) || in release_io_elsa()
453 (cs->subtyp == ELSA_QS3000PCI)) { in release_io_elsa()
456 release_modem(cs); in release_io_elsa()
459 if (cs->hw.elsa.base) in release_io_elsa()
460 release_region(cs->hw.elsa.base, bytecnt); in release_io_elsa()
464 reset_elsa(struct IsdnCardState *cs) in reset_elsa() argument
466 if (cs->hw.elsa.timer) { in reset_elsa()
468 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
469 while (TimerRun(cs)); in reset_elsa()
470 cs->hw.elsa.ctrl_reg |= 0x50; in reset_elsa()
471 cs->hw.elsa.ctrl_reg &= ~ELSA_ISDN_RESET; /* Reset On */ in reset_elsa()
472 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in reset_elsa()
474 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
475 while (TimerRun(cs)); in reset_elsa()
476 cs->hw.elsa.ctrl_reg |= ELSA_ISDN_RESET; /* Reset Off */ in reset_elsa()
477 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in reset_elsa()
479 byteout(cs->hw.elsa.timer, 0); in reset_elsa()
480 while (TimerRun(cs)); in reset_elsa()
481 if (cs->hw.elsa.trig) in reset_elsa()
482 byteout(cs->hw.elsa.trig, 0xff); in reset_elsa()
484 …if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA… in reset_elsa()
485 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x20); in reset_elsa()
487 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x00); in reset_elsa()
488 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xc0); in reset_elsa()
490 if (cs->subtyp != ELSA_PCMCIA_IPAC) { in reset_elsa()
491 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x0); in reset_elsa()
492 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0x3c); in reset_elsa()
494 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_PCFG, 0x10); in reset_elsa()
495 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x4); in reset_elsa()
496 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0xf8); in reset_elsa()
498 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, 0xff); in reset_elsa()
499 if (cs->subtyp == ELSA_QS1000PCI) in reset_elsa()
500 byteout(cs->hw.elsa.cfg + 0x4c, 0x41); /* enable ELSA PCI IRQ */ in reset_elsa()
501 else if (cs->subtyp == ELSA_QS3000PCI) in reset_elsa()
502 byteout(cs->hw.elsa.cfg + 0x4c, 0x43); /* enable ELSA PCI IRQ */ in reset_elsa()
509 set_arcofi(struct IsdnCardState *cs, int bc) { in set_arcofi() argument
510 cs->dc.isac.arcofi_bc = bc; in set_arcofi()
511 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_COP_5); in set_arcofi()
512 wait_event_interruptible(cs->dc.isac.arcofi_wait, in set_arcofi()
513 cs->dc.isac.arcofi_state == ARCOFI_NOP); in set_arcofi()
517 check_arcofi(struct IsdnCardState *cs) in check_arcofi() argument
524 if (!cs->dc.isac.mon_tx) in check_arcofi()
525 if (!(cs->dc.isac.mon_tx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) { in check_arcofi()
526 if (cs->debug & L1_DEB_WARN) in check_arcofi()
527 debugl1(cs, "ISAC MON TX out of buffers!"); in check_arcofi()
530 cs->dc.isac.arcofi_bc = 0; in check_arcofi()
531 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_VERSION); in check_arcofi()
532 wait_event_interruptible(cs->dc.isac.arcofi_wait, in check_arcofi()
533 cs->dc.isac.arcofi_state == ARCOFI_NOP); in check_arcofi()
534 if (!test_and_clear_bit(FLG_ARCOFI_ERROR, &cs->HW_Flags)) { in check_arcofi()
535 debugl1(cs, "Arcofi response received %d bytes", cs->dc.isac.mon_rxp); in check_arcofi()
536 p = cs->dc.isac.mon_rx; in check_arcofi()
539 QuickHex(t, p, cs->dc.isac.mon_rxp); in check_arcofi()
540 debugl1(cs, "%s", tmp); in check_arcofi()
541 if ((cs->dc.isac.mon_rxp == 2) && (cs->dc.isac.mon_rx[0] == 0xa0)) { in check_arcofi()
542 switch (cs->dc.isac.mon_rx[1]) { in check_arcofi()
544 debugl1(cs, "Arcofi 2160 detected"); in check_arcofi()
548 debugl1(cs, "Arcofi 2165 detected"); in check_arcofi()
552 debugl1(cs, "Arcofi 2163 detected"); in check_arcofi()
556 debugl1(cs, "unknown Arcofi response"); in check_arcofi()
560 debugl1(cs, "undefined Monitor response"); in check_arcofi()
561 cs->dc.isac.mon_rxp = 0; in check_arcofi()
562 } else if (cs->dc.isac.mon_tx) { in check_arcofi()
563 debugl1(cs, "Arcofi not detected"); in check_arcofi()
566 if (cs->subtyp == ELSA_QS1000) { in check_arcofi()
567 cs->subtyp = ELSA_QS3000; in check_arcofi()
570 Elsa_Types[cs->subtyp], in check_arcofi()
571 cs->hw.elsa.base + 8); in check_arcofi()
572 release_region(cs->hw.elsa.base, 8); in check_arcofi()
573 if (!request_region(cs->hw.elsa.base, 16, "elsa isdn modem")) { in check_arcofi()
576 Elsa_Types[cs->subtyp], in check_arcofi()
577 cs->hw.elsa.base + 8, in check_arcofi()
578 cs->hw.elsa.base + 16); in check_arcofi()
580 } else if (cs->subtyp == ELSA_PCC16) { in check_arcofi()
581 cs->subtyp = ELSA_PCF; in check_arcofi()
584 Elsa_Types[cs->subtyp], in check_arcofi()
585 cs->hw.elsa.base + 8); in check_arcofi()
586 release_region(cs->hw.elsa.base, 8); in check_arcofi()
587 if (!request_region(cs->hw.elsa.base, 16, "elsa isdn modem")) { in check_arcofi()
590 Elsa_Types[cs->subtyp], in check_arcofi()
591 cs->hw.elsa.base + 8, in check_arcofi()
592 cs->hw.elsa.base + 16); in check_arcofi()
597 Elsa_Types[cs->subtyp], in check_arcofi()
598 cs->hw.elsa.base + 8); in check_arcofi()
599 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_XOP_0); in check_arcofi()
600 wait_event_interruptible(cs->dc.isac.arcofi_wait, in check_arcofi()
601 cs->dc.isac.arcofi_state == ARCOFI_NOP); in check_arcofi()
609 elsa_led_handler(struct IsdnCardState *cs) in elsa_led_handler() argument
613 if (cs->subtyp == ELSA_PCMCIA || cs->subtyp == ELSA_PCMCIA_IPAC) in elsa_led_handler()
615 del_timer(&cs->hw.elsa.tl); in elsa_led_handler()
616 if (cs->hw.elsa.status & ELSA_ASSIGN) in elsa_led_handler()
617 cs->hw.elsa.ctrl_reg |= ELSA_STAT_LED; in elsa_led_handler()
618 else if (cs->hw.elsa.status & ELSA_BAD_PWR) in elsa_led_handler()
619 cs->hw.elsa.ctrl_reg &= ~ELSA_STAT_LED; in elsa_led_handler()
621 cs->hw.elsa.ctrl_reg ^= ELSA_STAT_LED; in elsa_led_handler()
624 if (cs->hw.elsa.status & 0xf000) in elsa_led_handler()
625 cs->hw.elsa.ctrl_reg |= ELSA_LINE_LED; in elsa_led_handler()
626 else if (cs->hw.elsa.status & 0x0f00) { in elsa_led_handler()
627 cs->hw.elsa.ctrl_reg ^= ELSA_LINE_LED; in elsa_led_handler()
630 cs->hw.elsa.ctrl_reg &= ~ELSA_LINE_LED; in elsa_led_handler()
632 if ((cs->subtyp == ELSA_QS1000PCI) || in elsa_led_handler()
633 (cs->subtyp == ELSA_QS3000PCI)) { in elsa_led_handler()
635 if (cs->hw.elsa.ctrl_reg & ELSA_LINE_LED) in elsa_led_handler()
637 if (cs->hw.elsa.ctrl_reg & ELSA_STAT_LED) in elsa_led_handler()
639 writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ATX, led); in elsa_led_handler()
641 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in elsa_led_handler()
643 init_timer(&cs->hw.elsa.tl); in elsa_led_handler()
644 cs->hw.elsa.tl.expires = jiffies + ((blink * HZ) / 1000); in elsa_led_handler()
645 add_timer(&cs->hw.elsa.tl); in elsa_led_handler()
650 Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) in Elsa_card_msg() argument
657 spin_lock_irqsave(&cs->lock, flags); in Elsa_card_msg()
658 reset_elsa(cs); in Elsa_card_msg()
659 spin_unlock_irqrestore(&cs->lock, flags); in Elsa_card_msg()
662 release_io_elsa(cs); in Elsa_card_msg()
665 spin_lock_irqsave(&cs->lock, flags); in Elsa_card_msg()
666 cs->debug |= L1_DEB_IPAC; in Elsa_card_msg()
667 reset_elsa(cs); in Elsa_card_msg()
668 inithscxisac(cs, 1); in Elsa_card_msg()
669 if ((cs->subtyp == ELSA_QS1000) || in Elsa_card_msg()
670 (cs->subtyp == ELSA_QS3000)) in Elsa_card_msg()
672 byteout(cs->hw.elsa.timer, 0); in Elsa_card_msg()
674 if (cs->hw.elsa.trig) in Elsa_card_msg()
675 byteout(cs->hw.elsa.trig, 0xff); in Elsa_card_msg()
676 inithscxisac(cs, 2); in Elsa_card_msg()
677 spin_unlock_irqrestore(&cs->lock, flags); in Elsa_card_msg()
680 if ((cs->subtyp == ELSA_PCMCIA) || in Elsa_card_msg()
681 (cs->subtyp == ELSA_PCMCIA_IPAC) || in Elsa_card_msg()
682 (cs->subtyp == ELSA_QS1000PCI)) { in Elsa_card_msg()
684 } else if (cs->subtyp == ELSA_QS3000PCI) { in Elsa_card_msg()
687 spin_lock_irqsave(&cs->lock, flags); in Elsa_card_msg()
688 cs->hw.elsa.counter = 0; in Elsa_card_msg()
689 cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT; in Elsa_card_msg()
690 cs->hw.elsa.status |= ELIRQF_TIMER_AKTIV; in Elsa_card_msg()
691 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in Elsa_card_msg()
692 byteout(cs->hw.elsa.timer, 0); in Elsa_card_msg()
693 spin_unlock_irqrestore(&cs->lock, flags); in Elsa_card_msg()
695 spin_lock_irqsave(&cs->lock, flags); in Elsa_card_msg()
696 cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT; in Elsa_card_msg()
697 byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); in Elsa_card_msg()
698 cs->hw.elsa.status &= ~ELIRQF_TIMER_AKTIV; in Elsa_card_msg()
699 spin_unlock_irqrestore(&cs->lock, flags); in Elsa_card_msg()
701 cs->hw.elsa.counter); in Elsa_card_msg()
702 if ((cs->hw.elsa.counter > 10) && in Elsa_card_msg()
703 (cs->hw.elsa.counter < 16)) { in Elsa_card_msg()
709 cs->hw.elsa.counter, cs->irq); in Elsa_card_msg()
714 if (check_arcofi(cs)) { in Elsa_card_msg()
715 init_modem(cs); in Elsa_card_msg()
718 elsa_led_handler(cs); in Elsa_card_msg()
721 cs->hw.elsa.status &= 0; in Elsa_card_msg()
724 cs->hw.elsa.status |= ELSA_ASSIGN; in Elsa_card_msg()
728 cs->hw.elsa.status |= 0x0200; in Elsa_card_msg()
730 cs->hw.elsa.status |= 0x0100; in Elsa_card_msg()
734 cs->hw.elsa.status |= 0x2000; in Elsa_card_msg()
736 cs->hw.elsa.status |= 0x1000; in Elsa_card_msg()
740 cs->hw.elsa.status &= ~0x2000; in Elsa_card_msg()
741 cs->hw.elsa.status &= ~0x0200; in Elsa_card_msg()
743 cs->hw.elsa.status &= ~0x1000; in Elsa_card_msg()
744 cs->hw.elsa.status &= ~0x0100; in Elsa_card_msg()
749 if (cs->hw.elsa.MFlag) { in Elsa_card_msg()
758 modem_write_cmd(cs, msg, len); in Elsa_card_msg()
763 if (cs->typ == ISDN_CTYPE_ELSA) { in Elsa_card_msg()
764 int pwr = bytein(cs->hw.elsa.ale); in Elsa_card_msg()
766 cs->hw.elsa.status |= ELSA_BAD_PWR; in Elsa_card_msg()
768 cs->hw.elsa.status &= ~ELSA_BAD_PWR; in Elsa_card_msg()
770 elsa_led_handler(cs); in Elsa_card_msg()
824 probe_elsa(struct IsdnCardState *cs) in probe_elsa() argument
831 if ((cs->subtyp = probe_elsa_adr(CARD_portlist[i], cs->typ))) in probe_elsa()
839 struct IsdnCardState *cs = card->cs; in setup_elsa_isa() local
842 cs->hw.elsa.base = card->para[0]; in setup_elsa_isa()
844 if (cs->hw.elsa.base) { in setup_elsa_isa()
845 if (!(cs->subtyp = probe_elsa_adr(cs->hw.elsa.base, in setup_elsa_isa()
846 cs->typ))) { in setup_elsa_isa()
849 cs->hw.elsa.base); in setup_elsa_isa()
853 cs->hw.elsa.base = probe_elsa(cs); in setup_elsa_isa()
855 if (!cs->hw.elsa.base) { in setup_elsa_isa()
861 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG; in setup_elsa_isa()
862 cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL; in setup_elsa_isa()
863 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE; in setup_elsa_isa()
864 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC; in setup_elsa_isa()
865 cs->hw.elsa.itac = cs->hw.elsa.base + ELSA_ITAC; in setup_elsa_isa()
866 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa_isa()
867 cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ; in setup_elsa_isa()
868 cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER; in setup_elsa_isa()
869 val = bytein(cs->hw.elsa.cfg); in setup_elsa_isa()
870 if (cs->subtyp == ELSA_PC) { in setup_elsa_isa()
873 cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX_PC) >> 2]; in setup_elsa_isa()
874 } else if (cs->subtyp == ELSA_PCC8) { in setup_elsa_isa()
877 cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX_PCC8) >> 4]; in setup_elsa_isa()
881 cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX) >> 3]; in setup_elsa_isa()
883 val = bytein(cs->hw.elsa.ale) & ELSA_HW_RELEASE; in setup_elsa_isa()
889 if ((cs->subtyp == ELSA_PCFPRO) && (val == 'G')) in setup_elsa_isa()
893 Elsa_Types[cs->subtyp], in setup_elsa_isa()
894 cs->hw.elsa.base, in setup_elsa_isa()
895 val, cs->irq); in setup_elsa_isa()
896 val = bytein(cs->hw.elsa.ale) & ELSA_S0_POWER_BAD; in setup_elsa_isa()
900 cs->hw.elsa.status |= ELSA_BAD_PWR; in setup_elsa_isa()
923 struct IsdnCardState *cs = card->cs; in setup_elsa_isapnp() local
955 cs->subtyp = ELSA_QS1000; in setup_elsa_isapnp()
957 cs->subtyp = ELSA_QS3000; in setup_elsa_isapnp()
975 cs->hw.elsa.base = card->para[1]; in setup_elsa_isapnp()
976 cs->irq = card->para[0]; in setup_elsa_isapnp()
977 if (!cs->subtyp) in setup_elsa_isapnp()
978 cs->subtyp = ELSA_QS1000; in setup_elsa_isapnp()
982 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG; in setup_elsa_isapnp()
983 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE; in setup_elsa_isapnp()
984 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC; in setup_elsa_isapnp()
985 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa_isapnp()
986 cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ; in setup_elsa_isapnp()
987 cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER; in setup_elsa_isapnp()
988 cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL; in setup_elsa_isapnp()
991 Elsa_Types[cs->subtyp], in setup_elsa_isapnp()
992 cs->hw.elsa.base, in setup_elsa_isapnp()
993 cs->irq); in setup_elsa_isapnp()
1000 struct IsdnCardState *cs = card->cs; in setup_elsa_pcmcia() local
1003 cs->hw.elsa.base = card->para[1]; in setup_elsa_pcmcia()
1004 cs->irq = card->para[0]; in setup_elsa_pcmcia()
1005 val = readreg(cs->hw.elsa.base + 0, cs->hw.elsa.base + 2, IPAC_ID); in setup_elsa_pcmcia()
1007 cs->subtyp = ELSA_PCMCIA_IPAC; in setup_elsa_pcmcia()
1008 cs->hw.elsa.ale = cs->hw.elsa.base + 0; in setup_elsa_pcmcia()
1009 cs->hw.elsa.isac = cs->hw.elsa.base + 2; in setup_elsa_pcmcia()
1010 cs->hw.elsa.hscx = cs->hw.elsa.base + 2; in setup_elsa_pcmcia()
1011 test_and_set_bit(HW_IPAC, &cs->HW_Flags); in setup_elsa_pcmcia()
1013 cs->subtyp = ELSA_PCMCIA; in setup_elsa_pcmcia()
1014 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE_PCM; in setup_elsa_pcmcia()
1015 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC_PCM; in setup_elsa_pcmcia()
1016 cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX; in setup_elsa_pcmcia()
1018 cs->hw.elsa.timer = 0; in setup_elsa_pcmcia()
1019 cs->hw.elsa.trig = 0; in setup_elsa_pcmcia()
1020 cs->hw.elsa.ctrl = 0; in setup_elsa_pcmcia()
1021 cs->irq_flags |= IRQF_SHARED; in setup_elsa_pcmcia()
1024 Elsa_Types[cs->subtyp], in setup_elsa_pcmcia()
1025 cs->hw.elsa.base, in setup_elsa_pcmcia()
1026 cs->irq); in setup_elsa_pcmcia()
1035 struct IsdnCardState *cs = card->cs; in setup_elsa_pci() local
1037 cs->subtyp = 0; in setup_elsa_pci()
1042 cs->subtyp = ELSA_QS1000PCI; in setup_elsa_pci()
1043 cs->irq = dev_qs1000->irq; in setup_elsa_pci()
1044 cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1); in setup_elsa_pci()
1045 cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3); in setup_elsa_pci()
1050 cs->subtyp = ELSA_QS3000PCI; in setup_elsa_pci()
1051 cs->irq = dev_qs3000->irq; in setup_elsa_pci()
1052 cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1); in setup_elsa_pci()
1053 cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3); in setup_elsa_pci()
1058 if (!cs->irq) { in setup_elsa_pci()
1063 if (!(cs->hw.elsa.base && cs->hw.elsa.cfg)) { in setup_elsa_pci()
1067 if ((cs->hw.elsa.cfg & 0xff) || (cs->hw.elsa.base & 0xf)) { in setup_elsa_pci()
1072 cs->hw.elsa.ale = cs->hw.elsa.base; in setup_elsa_pci()
1073 cs->hw.elsa.isac = cs->hw.elsa.base + 1; in setup_elsa_pci()
1074 cs->hw.elsa.hscx = cs->hw.elsa.base + 1; in setup_elsa_pci()
1075 test_and_set_bit(HW_IPAC, &cs->HW_Flags); in setup_elsa_pci()
1076 cs->hw.elsa.timer = 0; in setup_elsa_pci()
1077 cs->hw.elsa.trig = 0; in setup_elsa_pci()
1078 cs->irq_flags |= IRQF_SHARED; in setup_elsa_pci()
1081 Elsa_Types[cs->subtyp], in setup_elsa_pci()
1082 cs->hw.elsa.base, in setup_elsa_pci()
1083 cs->hw.elsa.cfg, in setup_elsa_pci()
1084 cs->irq); in setup_elsa_pci()
1099 struct IsdnCardState *cs = card->cs; in setup_elsa_common() local
1103 switch (cs->subtyp) { in setup_elsa_common()
1123 "Unknown ELSA subtype %d\n", cs->subtyp); in setup_elsa_common()
1129 if (cs->typ != ISDN_CTYPE_ELSA_PCMCIA && !request_region(cs->hw.elsa.base, bytecnt, "elsa isdn")) { in setup_elsa_common()
1132 cs->hw.elsa.base, in setup_elsa_common()
1133 cs->hw.elsa.base + bytecnt); in setup_elsa_common()
1136 if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI)) { in setup_elsa_common()
1137 if (!request_region(cs->hw.elsa.cfg, 0x80, "elsa isdn pci")) { in setup_elsa_common()
1140 cs->hw.elsa.cfg, in setup_elsa_common()
1141 cs->hw.elsa.cfg + 0x80); in setup_elsa_common()
1142 release_region(cs->hw.elsa.base, bytecnt); in setup_elsa_common()
1147 init_arcofi(cs); in setup_elsa_common()
1149 setup_isac(cs); in setup_elsa_common()
1150 cs->hw.elsa.tl.function = (void *) elsa_led_handler; in setup_elsa_common()
1151 cs->hw.elsa.tl.data = (long) cs; in setup_elsa_common()
1152 init_timer(&cs->hw.elsa.tl); in setup_elsa_common()
1154 if (cs->hw.elsa.timer) { in setup_elsa_common()
1155 byteout(cs->hw.elsa.trig, 0xff); in setup_elsa_common()
1156 byteout(cs->hw.elsa.timer, 0); in setup_elsa_common()
1157 if (!TimerRun(cs)) { in setup_elsa_common()
1158 byteout(cs->hw.elsa.timer, 0); /* 2. Versuch */ in setup_elsa_common()
1159 if (!TimerRun(cs)) { in setup_elsa_common()
1162 release_io_elsa(cs); in setup_elsa_common()
1167 if (TimerRun(cs)) { in setup_elsa_common()
1169 release_io_elsa(cs); in setup_elsa_common()
1174 cs->BC_Read_Reg = &ReadHSCX; in setup_elsa_common()
1175 cs->BC_Write_Reg = &WriteHSCX; in setup_elsa_common()
1176 cs->BC_Send_Data = &hscx_fill_fifo; in setup_elsa_common()
1177 cs->cardmsg = &Elsa_card_msg; in setup_elsa_common()
1178 …if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA… in setup_elsa_common()
1179 cs->readisac = &ReadISAC_IPAC; in setup_elsa_common()
1180 cs->writeisac = &WriteISAC_IPAC; in setup_elsa_common()
1181 cs->readisacfifo = &ReadISACfifo_IPAC; in setup_elsa_common()
1182 cs->writeisacfifo = &WriteISACfifo_IPAC; in setup_elsa_common()
1183 cs->irq_func = &elsa_interrupt_ipac; in setup_elsa_common()
1184 val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ID); in setup_elsa_common()
1187 cs->readisac = &ReadISAC; in setup_elsa_common()
1188 cs->writeisac = &WriteISAC; in setup_elsa_common()
1189 cs->readisacfifo = &ReadISACfifo; in setup_elsa_common()
1190 cs->writeisacfifo = &WriteISACfifo; in setup_elsa_common()
1191 cs->irq_func = &elsa_interrupt; in setup_elsa_common()
1192 ISACVersion(cs, "Elsa:"); in setup_elsa_common()
1193 if (HscxVersion(cs, "Elsa:")) { in setup_elsa_common()
1196 release_io_elsa(cs); in setup_elsa_common()
1200 if (cs->subtyp == ELSA_PC) { in setup_elsa_common()
1201 val = readitac(cs, ITAC_SYS); in setup_elsa_common()
1203 writeitac(cs, ITAC_ISEN, 0); in setup_elsa_common()
1204 writeitac(cs, ITAC_RFIE, 0); in setup_elsa_common()
1205 writeitac(cs, ITAC_XFIE, 0); in setup_elsa_common()
1206 writeitac(cs, ITAC_SCIE, 0); in setup_elsa_common()
1207 writeitac(cs, ITAC_STIE, 0); in setup_elsa_common()
1215 struct IsdnCardState *cs = card->cs; in setup_elsa() local
1220 cs->hw.elsa.ctrl_reg = 0; in setup_elsa()
1221 cs->hw.elsa.status = 0; in setup_elsa()
1222 cs->hw.elsa.MFlag = 0; in setup_elsa()
1223 cs->subtyp = 0; in setup_elsa()
1225 if (cs->typ == ISDN_CTYPE_ELSA) { in setup_elsa()
1230 } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) { in setup_elsa()
1235 } else if (cs->typ == ISDN_CTYPE_ELSA_PCMCIA) in setup_elsa()
1238 else if (cs->typ == ISDN_CTYPE_ELSA_PCI) { in setup_elsa()