Lines Matching refs:cs
229 struct zs_chanstate *cs; in zs_ioasic_attach() local
247 cs = &zs_ioasic_conschanstate_store; in zs_ioasic_attach()
250 cs = malloc(sizeof(struct zs_chanstate), in zs_ioasic_attach()
252 zs_lock_init(cs); in zs_ioasic_attach()
254 cs->cs_reg_csr = (volatile void *)&zc->zc_csr; in zs_ioasic_attach()
256 memcpy(cs->cs_creg, zs_ioasic_init_reg, 16); in zs_ioasic_attach()
257 memcpy(cs->cs_preg, zs_ioasic_init_reg, 16); in zs_ioasic_attach()
259 cs->cs_defcflag = zs_def_cflag; in zs_ioasic_attach()
260 cs->cs_defspeed = 9600; /* XXX */ in zs_ioasic_attach()
261 (void)zs_set_modes(cs, cs->cs_defcflag); in zs_ioasic_attach()
264 zs->zsc_cs[channel] = cs; in zs_ioasic_attach()
266 cs->cs_channel = channel; in zs_ioasic_attach()
267 cs->cs_ops = &zsops_null; in zs_ioasic_attach()
268 cs->cs_brg_clk = PCLK / 16; in zs_ioasic_attach()
277 cs->cs_creg[15] |= ZSWR15_DCD_IE; in zs_ioasic_attach()
278 cs->cs_preg[15] |= ZSWR15_DCD_IE; in zs_ioasic_attach()
284 cs->cs_private = (void *)zflg; in zs_ioasic_attach()
292 zs_write_reg(cs, 9, 0); in zs_ioasic_attach()
301 cs->cs_ctl_chan = zs->zsc_cs[0]; in zs_ioasic_attach()
303 cs->cs_ctl_chan = NULL; in zs_ioasic_attach()
318 zs_write_reg(cs, 9, reset); in zs_ioasic_attach()
451 zs_set_speed(struct zs_chanstate *cs, int bps /*bits per second*/) in zs_set_speed() argument
459 if (cs->cs_brg_clk == 0) in zs_set_speed()
463 tconst = BPS_TO_TCONST(cs->cs_brg_clk, bps); in zs_set_speed()
468 real_bps = TCONST_TO_BPS(cs->cs_brg_clk, tconst); in zs_set_speed()
474 cs->cs_preg[12] = tconst; in zs_set_speed()
475 cs->cs_preg[13] = tconst >> 8; in zs_set_speed()
482 zs_set_modes(struct zs_chanstate *cs, int cflag) in zs_set_modes() argument
484 u_long privflags = (u_long)cs->cs_private; in zs_set_modes()
496 cs->cs_rr0_dcd = 0; in zs_set_modes()
498 cs->cs_rr0_dcd = ZSRR0_DCD; in zs_set_modes()
500 cs->cs_wr5_dtr = ZSWR5_DTR; in zs_set_modes()
501 cs->cs_wr5_rts = ZSWR5_RTS; in zs_set_modes()
502 cs->cs_rr0_cts = ZSRR0_CTS; in zs_set_modes()
504 cs->cs_wr5_dtr = 0; in zs_set_modes()
505 cs->cs_wr5_rts = ZSWR5_DTR; in zs_set_modes()
506 cs->cs_rr0_cts = ZSRR0_CTS; in zs_set_modes()
508 cs->cs_wr5_dtr = 0; in zs_set_modes()
509 cs->cs_wr5_rts = ZSWR5_DTR; in zs_set_modes()
510 cs->cs_rr0_cts = ZSRR0_DCD; in zs_set_modes()
512 cs->cs_wr5_dtr = ZSWR5_DTR | ZSWR5_RTS; in zs_set_modes()
513 cs->cs_wr5_rts = 0; in zs_set_modes()
514 cs->cs_rr0_cts = 0; in zs_set_modes()
518 cs->cs_rr0_dcd &= ~(ZSRR0_CTS|ZSRR0_DCD); in zs_set_modes()
519 cs->cs_rr0_cts &= ~(ZSRR0_CTS|ZSRR0_DCD); in zs_set_modes()
522 cs->cs_wr5_dtr &= ~(ZSWR5_RTS|ZSWR5_DTR); in zs_set_modes()
523 cs->cs_wr5_rts &= ~(ZSWR5_RTS|ZSWR5_DTR); in zs_set_modes()
544 zs_read_reg(struct zs_chanstate *cs, u_int reg) in zs_read_reg() argument
546 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_read_reg()
559 zs_write_reg(struct zs_chanstate *cs, u_int reg, u_int val) in zs_write_reg() argument
561 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_write_reg()
572 zs_read_csr(struct zs_chanstate *cs) in zs_read_csr() argument
574 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_read_csr()
584 zs_write_csr(struct zs_chanstate *cs, u_int val) in zs_write_csr() argument
586 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_write_csr()
594 zs_read_data(struct zs_chanstate *cs) in zs_read_data() argument
596 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_read_data()
606 zs_write_data(struct zs_chanstate *cs, u_int val) in zs_write_data() argument
608 volatile struct zshan *zc = (volatile void *)cs->cs_reg_csr; in zs_write_data()
623 zs_abort(struct zs_chanstate *cs) in zs_abort() argument
630 rr0 = zs_read_csr(cs); in zs_abort()
634 zskgdb(cs); in zs_abort()
646 zs_getc(struct zs_chanstate *cs) in zs_getc() argument
654 rr0 = zs_read_csr(cs); in zs_getc()
657 c = zs_read_data(cs); in zs_getc()
671 zs_putc(struct zs_chanstate *cs, int c) in zs_putc() argument
679 rr0 = zs_read_csr(cs); in zs_putc()
682 zs_write_data(cs, c); in zs_putc()
686 rr0 = zs_read_csr(cs); in zs_putc()
701 struct zs_chanstate *cs; in zs_ioasic_cninit() local
716 cs = &zs_ioasic_conschanstate_store; in zs_ioasic_cninit()
731 cs->cs_reg_csr = (volatile void *)&zc->zc_csr; in zs_ioasic_cninit()
733 cs->cs_channel = channel; in zs_ioasic_cninit()
734 cs->cs_ops = &zsops_null; in zs_ioasic_cninit()
735 cs->cs_brg_clk = PCLK / 16; in zs_ioasic_cninit()
738 memcpy(cs->cs_preg, zs_ioasic_init_reg, 16); in zs_ioasic_cninit()
753 cs->cs_private = (void *)zflg; in zs_ioasic_cninit()
756 zs_write_reg(cs, 9, 0); in zs_ioasic_cninit()
759 zs_write_reg(cs, 9, ZSWR9_HARD_RESET); in zs_ioasic_cninit()
762 zs_loadchannelregs(cs); in zs_ioasic_cninit()
772 struct zs_chanstate *cs = &zs_ioasic_conschanstate_store; in zs_ioasic_cnattach() local
776 zs_lock_init(cs); in zs_ioasic_cnattach()
777 cs->cs_defspeed = 9600; in zs_ioasic_cnattach()
778 cs->cs_defcflag = (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8; in zs_ioasic_cnattach()
796 struct zs_chanstate *cs = &zs_ioasic_conschanstate_store; in zs_ioasic_lk201_cnattach() local
799 zs_lock_init(cs); in zs_ioasic_lk201_cnattach()
800 cs->cs_defspeed = 4800; in zs_ioasic_lk201_cnattach()
801 cs->cs_defcflag = (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8; in zs_ioasic_lk201_cnattach()
802 return (zskbd_cnattach(cs)); in zs_ioasic_lk201_cnattach()