cy.c (12490) | cy.c (12502) |
---|---|
1/*- 2 * cyclades cyclom-y serial driver 3 * Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993 4 * 5 * Copyright (c) 1993 Andrew Herbert. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 13 unchanged lines hidden (view full) --- 22 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/*- 2 * cyclades cyclom-y serial driver 3 * Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993 4 * 5 * Copyright (c) 1993 Andrew Herbert. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 13 unchanged lines hidden (view full) --- 22 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $Id: cy.c,v 1.18 1995/11/04 17:07:14 bde Exp $ | 30 * $Id: cy.c,v 1.19 1995/11/26 17:13:23 bde Exp $ |
31 */ 32 33#include "cy.h" 34#if NCY > 0 35/* 36 * TODO: 37 * Check that cy16's work. 38 * Implement BREAK. --- 353 unchanged lines hidden (view full) --- 392static u_int cy_svrr_probes; 393static u_int cy_timeouts; 394#endif 395 396static int cy_nr_cd1400s[NCY]; 397#undef RxFifoThreshold 398static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2); 399 | 31 */ 32 33#include "cy.h" 34#if NCY > 0 35/* 36 * TODO: 37 * Check that cy16's work. 38 * Implement BREAK. --- 353 unchanged lines hidden (view full) --- 392static u_int cy_svrr_probes; 393static u_int cy_timeouts; 394#endif 395 396static int cy_nr_cd1400s[NCY]; 397#undef RxFifoThreshold 398static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2); 399 |
400#ifdef JREMOD 401#define CDEV_MAJOR 48 402static void cy_devsw_install(); 403#endif /*JREMOD*/ 404 |
|
400static struct kern_devconf kdc_sio[NCY] = { { 401 0, 0, 0, /* filled in by dev_attach */ 402 "cyc", 0, { MDDT_ISA, 0, "tty" }, 403 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN, 404 &kdc_isa0, /* parent */ 405 0, /* parentdata */ 406 DC_UNCONFIGURED, /* state */ 407 "Cyclades multiport board", --- 24 unchanged lines hidden (view full) --- 432 int unit; 433 434 iobase = (cy_addr)dev->id_maddr; 435 unit = dev->id_unit; 436 if ((u_int)unit >= NCY) 437 return (0); 438 cy_nr_cd1400s[unit] = 0; 439 sioregisterdev(dev); | 405static struct kern_devconf kdc_sio[NCY] = { { 406 0, 0, 0, /* filled in by dev_attach */ 407 "cyc", 0, { MDDT_ISA, 0, "tty" }, 408 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN, 409 &kdc_isa0, /* parent */ 410 0, /* parentdata */ 411 DC_UNCONFIGURED, /* state */ 412 "Cyclades multiport board", --- 24 unchanged lines hidden (view full) --- 437 int unit; 438 439 iobase = (cy_addr)dev->id_maddr; 440 unit = dev->id_unit; 441 if ((u_int)unit >= NCY) 442 return (0); 443 cy_nr_cd1400s[unit] = 0; 444 sioregisterdev(dev); |
445#ifdef JREMOD 446 cy_devsw_install(); 447#endif /*JREMOD*/ |
|
440 | 448 |
449 |
|
441 /* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */ 442 cy_inb(iobase, CY16_RESET); /* XXX? */ 443 DELAY(500); /* wait for the board to get its act together */ 444 445 /* this is needed to get the board out of reset */ 446 cy_outb(iobase, CY_CLEAR_INTR, 0); 447 DELAY(500); 448 --- 2057 unchanged lines hidden (view full) --- 2506 printf("tty state:\t\t\t0x%08x\n", tp->t_state); 2507 printf("upper layer queue lengths:\t%d raw, %d canon, %d output\n", 2508 tp->t_rawq.c_cc, tp->t_canq.c_cc, tp->t_outq.c_cc); 2509 } else 2510 printf("tty state:\t\t\tclosed\n"); 2511} 2512#endif /* CyDebug */ 2513 | 450 /* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */ 451 cy_inb(iobase, CY16_RESET); /* XXX? */ 452 DELAY(500); /* wait for the board to get its act together */ 453 454 /* this is needed to get the board out of reset */ 455 cy_outb(iobase, CY_CLEAR_INTR, 0); 456 DELAY(500); 457 --- 2057 unchanged lines hidden (view full) --- 2515 printf("tty state:\t\t\t0x%08x\n", tp->t_state); 2516 printf("upper layer queue lengths:\t%d raw, %d canon, %d output\n", 2517 tp->t_rawq.c_cc, tp->t_canq.c_cc, tp->t_outq.c_cc); 2518 } else 2519 printf("tty state:\t\t\tclosed\n"); 2520} 2521#endif /* CyDebug */ 2522 |
2523 2524#ifdef JREMOD 2525struct cdevsw cy_cdevsw = 2526 { cyopen, cyclose, cyread, cywrite, /*48*/ 2527 cyioctl, cystop, nxreset, cydevtotty,/*cyclades*/ 2528 ttselect, nxmmap, NULL }; 2529 2530static cy_devsw_installed = 0; 2531 2532static void cy_devsw_install() 2533{ 2534 dev_t descript; 2535 if( ! cy_devsw_installed ) { 2536 descript = makedev(CDEV_MAJOR,0); 2537 cdevsw_add(&descript,&cy_cdevsw,NULL); 2538#if defined(BDEV_MAJOR) 2539 descript = makedev(BDEV_MAJOR,0); 2540 bdevsw_add(&descript,&cy_bdevsw,NULL); 2541#endif /*BDEV_MAJOR*/ 2542 cy_devsw_installed = 1; 2543 } 2544} 2545#endif /* JREMOD */ |
|
2514#endif /* NCY > 0 */ | 2546#endif /* NCY > 0 */ |