Lines Matching refs:IoAdapter

47 static void qBri_cpu_trapped(PISDN_ADAPTER IoAdapter) {  in qBri_cpu_trapped()  argument
52 int factor = (IoAdapter->tasks == 1) ? 1 : 2; in qBri_cpu_trapped()
58 base = DIVA_OS_MEM_ATTACH_CONTROL(IoAdapter); in qBri_cpu_trapped()
59 offset = IoAdapter->ControllerNumber * (IoAdapter->MemorySize >> factor); in qBri_cpu_trapped()
65 dump_trap_frame(IoAdapter, &base[0x90]); in qBri_cpu_trapped()
66 IoAdapter->trapped = 1; in qBri_cpu_trapped()
73 regs[0] &= IoAdapter->MemorySize - 1; in qBri_cpu_trapped()
76 && (regs[0] < offset + (IoAdapter->MemorySize >> factor) - 1)) in qBri_cpu_trapped()
79 DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base); in qBri_cpu_trapped()
83 size = offset + (IoAdapter->MemorySize >> factor) - regs[0]; in qBri_cpu_trapped()
88 xlogDesc.cnt = READ_WORD(&base[regs[1] & (IoAdapter->MemorySize - 1)]); in qBri_cpu_trapped()
89 xlogDesc.out = READ_WORD(&base[regs[2] & (IoAdapter->MemorySize - 1)]); in qBri_cpu_trapped()
90 dump_xlog_buffer(IoAdapter, &xlogDesc); in qBri_cpu_trapped()
92 IoAdapter->trapped = 2; in qBri_cpu_trapped()
94 DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base); in qBri_cpu_trapped()
100 static void reset_qBri_hardware(PISDN_ADAPTER IoAdapter) { in reset_qBri_hardware() argument
105 qBriReset = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter); in reset_qBri_hardware()
114 DIVA_OS_MEM_DETACH_PROM(IoAdapter, qBriReset); in reset_qBri_hardware()
116 qBriCntrl = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in reset_qBri_hardware()
117 p = &qBriCntrl[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)]; in reset_qBri_hardware()
119 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, qBriCntrl); in reset_qBri_hardware()
128 void start_qBri_hardware(PISDN_ADAPTER IoAdapter) { in start_qBri_hardware() argument
132 p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in start_qBri_hardware()
133 qBriReset = &p[(DIVA_4BRI_REVISION(IoAdapter)) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)]; in start_qBri_hardware()
138 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); in start_qBri_hardware()
146 static void stop_qBri_hardware(PISDN_ADAPTER IoAdapter) { in stop_qBri_hardware() argument
151 int rev2 = DIVA_4BRI_REVISION(IoAdapter); in stop_qBri_hardware()
156 if (IoAdapter->ControllerNumber > 0) in stop_qBri_hardware()
158 p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in stop_qBri_hardware()
166 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); in stop_qBri_hardware()
168 p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); in stop_qBri_hardware()
170 DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); in stop_qBri_hardware()
172 p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in stop_qBri_hardware()
175 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); in stop_qBri_hardware()
186 static byte *qBri_check_FPGAsrc(PISDN_ADAPTER IoAdapter, char *FileName, in qBri_check_FPGAsrc() argument
251 switch (IoAdapter->cardType) { in qBri_check_FPGAsrc()
257 IoAdapter->fpga_features |= PCINIT_FPGA_PLX_ACCESS_SUPPORTED; in qBri_check_FPGAsrc()
275 int qBri_FPGA_download(PISDN_ADAPTER IoAdapter) { in qBri_FPGA_download() argument
279 word volatile __iomem *addr = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter); in qBri_FPGA_download()
284 if (DIVA_4BRI_REVISION(IoAdapter)) in qBri_FPGA_download()
288 switch (IoAdapter->cardType) { in qBri_FPGA_download()
302 File = qBri_check_FPGAsrc(IoAdapter, name, in qBri_FPGA_download()
307 File = qBri_check_FPGAsrc(IoAdapter, "ds4bri.bit", in qBri_FPGA_download()
311 DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); in qBri_FPGA_download()
327 DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); in qBri_FPGA_download()
351 DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); in qBri_FPGA_download()
362 static int load_qBri_hardware(PISDN_ADAPTER IoAdapter) { in load_qBri_hardware() argument
369 static int qBri_ISR(struct _ISDN_ADAPTER *IoAdapter) { in qBri_ISR() argument
372 PADAPTER_LIST_ENTRY QuadroList = IoAdapter->QuadroList; in qBri_ISR()
378 p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); in qBri_ISR()
381 DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); in qBri_ISR()
384 DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); in qBri_ISR()
389 p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in qBri_ISR()
390 …qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ… in qBri_ISR()
392 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); in qBri_ISR()
394 for (i = 0; i < IoAdapter->tasks; ++i) in qBri_ISR()
396 IoAdapter = QuadroList->QuadroAdapter[i]; in qBri_ISR()
398 if (IoAdapter && IoAdapter->Initialized in qBri_ISR()
399 && IoAdapter->tst_irq(&IoAdapter->a)) in qBri_ISR()
401 IoAdapter->IrqCount++; in qBri_ISR()
403 diva_os_schedule_soft_isr(&IoAdapter->isr_soft_isr); in qBri_ISR()
413 static void disable_qBri_interrupt(PISDN_ADAPTER IoAdapter) { in disable_qBri_interrupt() argument
417 if (IoAdapter->ControllerNumber > 0) in disable_qBri_interrupt()
422 p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); in disable_qBri_interrupt()
424 DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); in disable_qBri_interrupt()
426 p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); in disable_qBri_interrupt()
427 …qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ… in disable_qBri_interrupt()
429 DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); in disable_qBri_interrupt()
435 static void set_common_qBri_functions(PISDN_ADAPTER IoAdapter) { in set_common_qBri_functions() argument
438 a = &IoAdapter->a; in set_common_qBri_functions()
449 IoAdapter->out = pr_out; in set_common_qBri_functions()
450 IoAdapter->dpc = pr_dpc; in set_common_qBri_functions()
451 IoAdapter->tst_irq = scom_test_int; in set_common_qBri_functions()
452 IoAdapter->clr_irq = scom_clear_int; in set_common_qBri_functions()
453 IoAdapter->pcm = (struct pc_maint *)MIPS_MAINT_OFFS; in set_common_qBri_functions()
455 IoAdapter->load = load_qBri_hardware; in set_common_qBri_functions()
457 IoAdapter->disIrq = disable_qBri_interrupt; in set_common_qBri_functions()
458 IoAdapter->rstFnc = reset_qBri_hardware; in set_common_qBri_functions()
459 IoAdapter->stop = stop_qBri_hardware; in set_common_qBri_functions()
460 IoAdapter->trapFnc = qBri_cpu_trapped; in set_common_qBri_functions()
462 IoAdapter->diva_isr_handler = qBri_ISR; in set_common_qBri_functions()
464 IoAdapter->a.io = (void *)IoAdapter; in set_common_qBri_functions()
467 static void set_qBri_functions(PISDN_ADAPTER IoAdapter) { in set_qBri_functions() argument
468 if (!IoAdapter->tasks) { in set_qBri_functions()
469 IoAdapter->tasks = MQ_INSTANCE_COUNT; in set_qBri_functions()
471 IoAdapter->MemorySize = MQ_MEMORY_SIZE; in set_qBri_functions()
472 set_common_qBri_functions(IoAdapter); in set_qBri_functions()
473 diva_os_set_qBri_functions(IoAdapter); in set_qBri_functions()
476 static void set_qBri2_functions(PISDN_ADAPTER IoAdapter) { in set_qBri2_functions() argument
477 if (!IoAdapter->tasks) { in set_qBri2_functions()
478 IoAdapter->tasks = MQ_INSTANCE_COUNT; in set_qBri2_functions()
480 IoAdapter->MemorySize = (IoAdapter->tasks == 1) ? BRI2_MEMORY_SIZE : MQ2_MEMORY_SIZE; in set_qBri2_functions()
481 set_common_qBri_functions(IoAdapter); in set_qBri2_functions()
482 diva_os_set_qBri2_functions(IoAdapter); in set_qBri2_functions()
487 void prepare_qBri_functions(PISDN_ADAPTER IoAdapter) { in prepare_qBri_functions() argument
489 set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[0]); in prepare_qBri_functions()
490 set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[1]); in prepare_qBri_functions()
491 set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[2]); in prepare_qBri_functions()
492 set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[3]); in prepare_qBri_functions()
496 void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter) { in prepare_qBri2_functions() argument
497 if (!IoAdapter->tasks) { in prepare_qBri2_functions()
498 IoAdapter->tasks = MQ_INSTANCE_COUNT; in prepare_qBri2_functions()
501 set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[0]); in prepare_qBri2_functions()
502 if (IoAdapter->tasks > 1) { in prepare_qBri2_functions()
503 set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[1]); in prepare_qBri2_functions()
504 set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[2]); in prepare_qBri2_functions()
505 set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[3]); in prepare_qBri2_functions()