Lines Matching refs:brd

2222 	struct mxser_board *brd = NULL;  in mxser_interrupt()  local
2231 brd = dev_id; in mxser_interrupt()
2237 if (brd == NULL) in mxser_interrupt()
2239 max = brd->info->nports; in mxser_interrupt()
2241 irqbits = inb(brd->vector) & brd->vector_mask; in mxser_interrupt()
2242 if (irqbits == brd->vector_mask) in mxser_interrupt()
2247 if (irqbits == brd->vector_mask) in mxser_interrupt()
2251 port = &brd->ports[i]; in mxser_interrupt()
2354 static void mxser_release_ISA_res(struct mxser_board *brd) in mxser_release_ISA_res() argument
2356 free_irq(brd->irq, brd); in mxser_release_ISA_res()
2357 release_region(brd->ports[0].ioaddr, 8 * brd->info->nports); in mxser_release_ISA_res()
2358 release_region(brd->vector, 1); in mxser_release_ISA_res()
2361 static int __devinit mxser_initbrd(struct mxser_board *brd, in mxser_initbrd() argument
2369 brd->ports[0].max_baud); in mxser_initbrd()
2371 for (i = 0; i < brd->info->nports; i++) { in mxser_initbrd()
2372 info = &brd->ports[i]; in mxser_initbrd()
2375 info->board = brd; in mxser_initbrd()
2380 if (brd->chip_flag != MOXA_OTHER_UART) in mxser_initbrd()
2384 info->type = brd->uart_type; in mxser_initbrd()
2401 retval = request_irq(brd->irq, mxser_interrupt, IRQF_SHARED, "mxser", in mxser_initbrd()
2402 brd); in mxser_initbrd()
2406 brd->info->name, brd->irq); in mxser_initbrd()
2411 static int __init mxser_get_ISA_conf(int cap, struct mxser_board *brd) in mxser_get_ISA_conf() argument
2417 brd->chip_flag = MOXA_OTHER_UART; in mxser_get_ISA_conf()
2422 brd->info = &mxser_cards[0]; in mxser_get_ISA_conf()
2425 brd->info = &mxser_cards[1]; in mxser_get_ISA_conf()
2428 brd->info = &mxser_cards[2]; in mxser_get_ISA_conf()
2431 brd->info = &mxser_cards[5]; in mxser_get_ISA_conf()
2434 brd->info = &mxser_cards[6]; in mxser_get_ISA_conf()
2437 brd->info = &mxser_cards[7]; in mxser_get_ISA_conf()
2446 if (brd->info->nports == 2 || (brd->info->flags & MXSER_HAS2)) { in mxser_get_ISA_conf()
2451 } else if (brd->info->nports == 4) { in mxser_get_ISA_conf()
2457 } else if (brd->info->nports == 8) { in mxser_get_ISA_conf()
2469 brd->irq = ((int)(irq & 0xF000) >> 12); in mxser_get_ISA_conf()
2471 brd->ports[i].ioaddr = (int) regs[i + 1] & 0xFFF8; in mxser_get_ISA_conf()
2476 brd->vector = (int)regs[11]; /* interrupt vector */ in mxser_get_ISA_conf()
2478 brd->vector_mask = 0x00FF; in mxser_get_ISA_conf()
2480 brd->vector_mask = 0x000F; in mxser_get_ISA_conf()
2483 brd->ports[i].baud_base = 921600; in mxser_get_ISA_conf()
2484 brd->ports[i].max_baud = 921600; in mxser_get_ISA_conf()
2486 brd->ports[i].baud_base = 115200; in mxser_get_ISA_conf()
2487 brd->ports[i].max_baud = 115200; in mxser_get_ISA_conf()
2498 brd->uart_type = PORT_16550A; in mxser_get_ISA_conf()
2500 brd->uart_type = PORT_16450; in mxser_get_ISA_conf()
2501 if (!request_region(brd->ports[0].ioaddr, 8 * brd->info->nports, in mxser_get_ISA_conf()
2505 brd->ports[0].ioaddr, brd->ports[0].ioaddr + in mxser_get_ISA_conf()
2506 8 * brd->info->nports - 1); in mxser_get_ISA_conf()
2509 if (!request_region(brd->vector, 1, "mxser(vector)")) { in mxser_get_ISA_conf()
2510 release_region(brd->ports[0].ioaddr, 8 * brd->info->nports); in mxser_get_ISA_conf()
2513 brd->ports[0].ioaddr, brd->ports[0].ioaddr + in mxser_get_ISA_conf()
2514 8 * brd->info->nports - 1); in mxser_get_ISA_conf()
2517 return brd->info->nports; in mxser_get_ISA_conf()
2528 struct mxser_board *brd; in mxser_probe() local
2543 brd = &mxser_boards[i]; in mxser_probe()
2544 brd->idx = i * MXSER_PORTS_PER_BOARD; in mxser_probe()
2561 brd->info = &mxser_cards[ent->driver_data]; in mxser_probe()
2562 for (i = 0; i < brd->info->nports; i++) in mxser_probe()
2563 brd->ports[i].ioaddr = ioaddress + 8 * i; in mxser_probe()
2570 brd->vector = ioaddress; in mxser_probe()
2573 brd->irq = pdev->irq; in mxser_probe()
2575 brd->chip_flag = CheckIsMoxaMust(brd->ports[0].ioaddr); in mxser_probe()
2576 brd->uart_type = PORT_16550A; in mxser_probe()
2577 brd->vector_mask = 0; in mxser_probe()
2579 for (i = 0; i < brd->info->nports; i++) { in mxser_probe()
2581 if (Gpci_uart_info[j].type == brd->chip_flag) { in mxser_probe()
2582 brd->ports[i].max_baud = in mxser_probe()
2586 if (brd->info->flags & MXSER_HIGHBAUD) in mxser_probe()
2587 brd->ports[i].max_baud = 921600; in mxser_probe()
2593 if (brd->chip_flag == MOXA_MUST_MU860_HWID) { in mxser_probe()
2594 for (i = 0; i < brd->info->nports; i++) { in mxser_probe()
2596 brd->ports[i].opmode_ioaddr = ioaddress + 4; in mxser_probe()
2598 brd->ports[i].opmode_ioaddr = ioaddress + 0x0c; in mxser_probe()
2604 for (i = 0; i < brd->info->nports; i++) { in mxser_probe()
2605 brd->vector_mask |= (1 << i); in mxser_probe()
2606 brd->ports[i].baud_base = 921600; in mxser_probe()
2610 retval = mxser_initbrd(brd, pdev); in mxser_probe()
2614 for (i = 0; i < brd->info->nports; i++) in mxser_probe()
2615 tty_register_device(mxvar_sdriver, brd->idx + i, &pdev->dev); in mxser_probe()
2617 pci_set_drvdata(pdev, brd); in mxser_probe()
2623 brd->info = NULL; in mxser_probe()
2637 struct mxser_board *brd = pci_get_drvdata(pdev); in mxser_remove() local
2640 for (i = 0; i < brd->info->nports; i++) in mxser_remove()
2641 tty_unregister_device(mxvar_sdriver, brd->idx + i); in mxser_remove()
2643 free_irq(pdev->irq, brd); in mxser_remove()
2647 brd->info = NULL; in mxser_remove()
2660 struct mxser_board *brd; in mxser_module_init() local
2697 brd = &mxser_boards[m]; in mxser_module_init()
2698 retval = mxser_get_ISA_conf(ioaddr[b], brd); in mxser_module_init()
2700 brd->info = NULL; in mxser_module_init()
2705 brd->info->name, ioaddr[b]); in mxser_module_init()
2708 if (mxser_initbrd(brd, NULL) < 0) { in mxser_module_init()
2709 brd->info = NULL; in mxser_module_init()
2713 brd->idx = m * MXSER_PORTS_PER_BOARD; in mxser_module_init()
2714 for (i = 0; i < brd->info->nports; i++) in mxser_module_init()
2715 tty_register_device(mxvar_sdriver, brd->idx + i, NULL); in mxser_module_init()