tag | line | file | source code |
portp | 608 | drivers/char/istallion.c | static int stli_initopen(stlibrd_t *brdp, stliport_t *portp); |
portp | 609 | drivers/char/istallion.c | static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait); |
portp | 610 | drivers/char/istallion.c | static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait); |
portp | 611 | drivers/char/istallion.c | static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *filp); |
portp | 614 | drivers/char/istallion.c | static int stli_setport(stliport_t *portp); |
portp | 615 | drivers/char/istallion.c | static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); |
portp | 616 | drivers/char/istallion.c | static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback); |
portp | 617 | drivers/char/istallion.c | static void stli_dodelaycmd(stliport_t *portp, volatile cdkctrl_t *cp); |
portp | 618 | drivers/char/istallion.c | static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp); |
portp | 621 | drivers/char/istallion.c | static void stli_read(stlibrd_t *brdp, stliport_t *portp); |
portp | 622 | drivers/char/istallion.c | static void stli_getserial(stliport_t *portp, struct serial_struct *sp); |
portp | 623 | drivers/char/istallion.c | static int stli_setserial(stliport_t *portp, struct serial_struct *sp); |
portp | 732 | drivers/char/istallion.c | stliport_t *portp; |
portp | 772 | drivers/char/istallion.c | portp = brdp->ports[j]; |
portp | 773 | drivers/char/istallion.c | if (portp != (stliport_t *) NULL) { |
portp | 774 | drivers/char/istallion.c | if (portp->tty != (struct tty_struct *) NULL) |
portp | 775 | drivers/char/istallion.c | tty_hangup(portp->tty); |
portp | 776 | drivers/char/istallion.c | kfree_s(portp, sizeof(stliport_t)); |
portp | 817 | drivers/char/istallion.c | stliport_t *portp; |
portp | 838 | drivers/char/istallion.c | portp = brdp->ports[portnr]; |
portp | 839 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 841 | drivers/char/istallion.c | if (portp->devnr < 1) |
portp | 850 | drivers/char/istallion.c | if (portp->flags & ASYNC_CLOSING) { |
portp | 851 | drivers/char/istallion.c | interruptible_sleep_on(&portp->close_wait); |
portp | 852 | drivers/char/istallion.c | if (portp->flags & ASYNC_HUP_NOTIFY) |
portp | 863 | drivers/char/istallion.c | portp->tty = tty; |
portp | 864 | drivers/char/istallion.c | tty->driver_data = portp; |
portp | 865 | drivers/char/istallion.c | portp->refcount++; |
portp | 867 | drivers/char/istallion.c | while (test_bit(ST_INITIALIZING, &portp->state)) { |
portp | 870 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 873 | drivers/char/istallion.c | if ((portp->flags & ASYNC_INITIALIZED) == 0) { |
portp | 874 | drivers/char/istallion.c | set_bit(ST_INITIALIZING, &portp->state); |
portp | 875 | drivers/char/istallion.c | if ((rc = stli_initopen(brdp, portp)) >= 0) { |
portp | 876 | drivers/char/istallion.c | portp->flags |= ASYNC_INITIALIZED; |
portp | 879 | drivers/char/istallion.c | clear_bit(ST_INITIALIZING, &portp->state); |
portp | 880 | drivers/char/istallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 891 | drivers/char/istallion.c | if (portp->flags & ASYNC_CLOSING) { |
portp | 892 | drivers/char/istallion.c | interruptible_sleep_on(&portp->close_wait); |
portp | 893 | drivers/char/istallion.c | if (portp->flags & ASYNC_HUP_NOTIFY) |
portp | 904 | drivers/char/istallion.c | if (portp->flags & ASYNC_NORMAL_ACTIVE) |
portp | 906 | drivers/char/istallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) { |
portp | 907 | drivers/char/istallion.c | if ((portp->flags & ASYNC_SESSION_LOCKOUT) && |
portp | 908 | drivers/char/istallion.c | (portp->session != current->session)) |
portp | 910 | drivers/char/istallion.c | if ((portp->flags & ASYNC_PGRP_LOCKOUT) && |
portp | 911 | drivers/char/istallion.c | (portp->pgrp != current->pgrp)) |
portp | 914 | drivers/char/istallion.c | portp->flags |= ASYNC_CALLOUT_ACTIVE; |
portp | 917 | drivers/char/istallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) |
portp | 920 | drivers/char/istallion.c | if ((rc = stli_waitcarrier(brdp, portp, filp)) != 0) |
portp | 923 | drivers/char/istallion.c | portp->flags |= ASYNC_NORMAL_ACTIVE; |
portp | 926 | drivers/char/istallion.c | if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) { |
portp | 928 | drivers/char/istallion.c | *tty->termios = portp->normaltermios; |
portp | 930 | drivers/char/istallion.c | *tty->termios = portp->callouttermios; |
portp | 931 | drivers/char/istallion.c | stli_setport(portp); |
portp | 934 | drivers/char/istallion.c | portp->session = current->session; |
portp | 935 | drivers/char/istallion.c | portp->pgrp = current->pgrp; |
portp | 944 | drivers/char/istallion.c | stliport_t *portp; |
portp | 951 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 952 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 961 | drivers/char/istallion.c | if (portp->refcount-- > 1) { |
portp | 966 | drivers/char/istallion.c | portp->flags |= ASYNC_CLOSING; |
portp | 968 | drivers/char/istallion.c | if (portp->flags & ASYNC_NORMAL_ACTIVE) |
portp | 969 | drivers/char/istallion.c | portp->normaltermios = *tty->termios; |
portp | 970 | drivers/char/istallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) |
portp | 971 | drivers/char/istallion.c | portp->callouttermios = *tty->termios; |
portp | 982 | drivers/char/istallion.c | if (test_bit(ST_TXBUSY, &portp->state)) { |
portp | 983 | drivers/char/istallion.c | if (portp->closing_wait != ASYNC_CLOSING_WAIT_NONE) |
portp | 984 | drivers/char/istallion.c | tty_wait_until_sent(tty, portp->closing_wait); |
portp | 987 | drivers/char/istallion.c | portp->flags &= ~ASYNC_INITIALIZED; |
portp | 988 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 989 | drivers/char/istallion.c | stli_rawclose(brdp, portp, 0, 1); |
portp | 991 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, 0, 0); |
portp | 992 | drivers/char/istallion.c | stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0); |
portp | 994 | drivers/char/istallion.c | clear_bit(ST_TXBUSY, &portp->state); |
portp | 995 | drivers/char/istallion.c | clear_bit(ST_RXSTOP, &portp->state); |
portp | 999 | drivers/char/istallion.c | set_bit(ST_DOFLUSHRX, &portp->state); |
portp | 1004 | drivers/char/istallion.c | portp->tty = (struct tty_struct *) NULL; |
portp | 1006 | drivers/char/istallion.c | if (portp->openwaitcnt) { |
portp | 1007 | drivers/char/istallion.c | if (portp->close_delay) |
portp | 1008 | drivers/char/istallion.c | stli_delay(portp->close_delay); |
portp | 1009 | drivers/char/istallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 1012 | drivers/char/istallion.c | portp->flags &= ~(ASYNC_CALLOUT_ACTIVE | ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING); |
portp | 1013 | drivers/char/istallion.c | wake_up_interruptible(&portp->close_wait); |
portp | 1027 | drivers/char/istallion.c | static int stli_initopen(stlibrd_t *brdp, stliport_t *portp) |
portp | 1035 | drivers/char/istallion.c | printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp); |
portp | 1038 | drivers/char/istallion.c | if ((rc = stli_rawopen(brdp, portp, 0, 1)) < 0) |
portp | 1044 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_SETNOTIFY, &nt, sizeof(asynotify_t), 0)) < 0) |
portp | 1047 | drivers/char/istallion.c | tty = portp->tty; |
portp | 1050 | drivers/char/istallion.c | stli_mkasyport(portp, &aport, tty->termios); |
portp | 1051 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0)) < 0) |
portp | 1054 | drivers/char/istallion.c | set_bit(ST_GETSIGS, &portp->state); |
portp | 1055 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_GETSIGNALS, &portp->asig, sizeof(asysigs_t), 1)) < 0) |
portp | 1057 | drivers/char/istallion.c | if (clear_bit(ST_GETSIGS, &portp->state)) |
portp | 1058 | drivers/char/istallion.c | portp->sigs = stli_mktiocm(portp->asig.sigvalue); |
portp | 1059 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, 1, 1); |
portp | 1060 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0)) < 0) |
portp | 1075 | drivers/char/istallion.c | static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait) |
portp | 1084 | drivers/char/istallion.c | printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n", (int) brdp, (int) portp, (int) arg, wait); |
portp | 1099 | drivers/char/istallion.c | while (test_bit(ST_CLOSING, &portp->state)) { |
portp | 1104 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1113 | drivers/char/istallion.c | cp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->ctrl; |
portp | 1117 | drivers/char/istallion.c | hdrp->slavereq |= portp->reqbit; |
portp | 1118 | drivers/char/istallion.c | bits = ((volatile unsigned char *) hdrp) + brdp->slaveoffset + portp->portidx; |
portp | 1119 | drivers/char/istallion.c | *bits |= portp->portbit; |
portp | 1132 | drivers/char/istallion.c | set_bit(ST_OPENING, &portp->state); |
portp | 1133 | drivers/char/istallion.c | while (test_bit(ST_OPENING, &portp->state)) { |
portp | 1138 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1142 | drivers/char/istallion.c | if ((rc == 0) && (portp->rc != 0)) |
portp | 1155 | drivers/char/istallion.c | static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, int wait) |
portp | 1164 | drivers/char/istallion.c | printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n", (int) brdp, (int) portp, (int) arg, wait); |
portp | 1175 | drivers/char/istallion.c | while (test_bit(ST_CLOSING, &portp->state)) { |
portp | 1180 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1188 | drivers/char/istallion.c | cp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->ctrl; |
portp | 1192 | drivers/char/istallion.c | hdrp->slavereq |= portp->reqbit; |
portp | 1193 | drivers/char/istallion.c | bits = ((volatile unsigned char *) hdrp) + brdp->slaveoffset + portp->portidx; |
portp | 1194 | drivers/char/istallion.c | *bits |= portp->portbit; |
portp | 1197 | drivers/char/istallion.c | set_bit(ST_CLOSING, &portp->state); |
portp | 1208 | drivers/char/istallion.c | while (test_bit(ST_CLOSING, &portp->state)) { |
portp | 1213 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1217 | drivers/char/istallion.c | if ((rc == 0) && (portp->rc != 0)) |
portp | 1231 | drivers/char/istallion.c | static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback) |
portp | 1236 | drivers/char/istallion.c | printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,copyback=%d)\n", (int) brdp, (int) portp, (int) cmd, (int) arg, size, copyback); |
portp | 1241 | drivers/char/istallion.c | while (test_bit(ST_CMDING, &portp->state)) { |
portp | 1246 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1249 | drivers/char/istallion.c | stli_sendcmd(brdp, portp, cmd, arg, size, copyback); |
portp | 1251 | drivers/char/istallion.c | while (test_bit(ST_CMDING, &portp->state)) { |
portp | 1256 | drivers/char/istallion.c | interruptible_sleep_on(&portp->raw_wait); |
portp | 1260 | drivers/char/istallion.c | if (portp->rc != 0) |
portp | 1272 | drivers/char/istallion.c | static int stli_setport(stliport_t *portp) |
portp | 1278 | drivers/char/istallion.c | printk("stli_setport(portp=%x)\n", (int) portp); |
portp | 1281 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1283 | drivers/char/istallion.c | if (portp->tty == (struct tty_struct *) NULL) |
portp | 1285 | drivers/char/istallion.c | if ((portp->brdnr < 0) && (portp->brdnr >= stli_nrbrds)) |
portp | 1287 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1289 | drivers/char/istallion.c | stli_mkasyport(portp, &aport, portp->tty->termios); |
portp | 1290 | drivers/char/istallion.c | return(stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0)); |
portp | 1320 | drivers/char/istallion.c | static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *filp) |
portp | 1326 | drivers/char/istallion.c | printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n", (int) brdp, (int) portp, (int) filp); |
portp | 1333 | drivers/char/istallion.c | portp->openwaitcnt++; |
portp | 1334 | drivers/char/istallion.c | if (portp->refcount > 0) |
portp | 1335 | drivers/char/istallion.c | portp->refcount--; |
portp | 1338 | drivers/char/istallion.c | if ((portp->flags & ASYNC_CALLOUT_ACTIVE) == 0) { |
portp | 1339 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, 1, 1); |
portp | 1340 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0)) < 0) |
portp | 1343 | drivers/char/istallion.c | if (tty_hung_up_p(filp) || ((portp->flags & ASYNC_INITIALIZED) == 0)) { |
portp | 1344 | drivers/char/istallion.c | if (portp->flags & ASYNC_HUP_NOTIFY) |
portp | 1350 | drivers/char/istallion.c | if (((portp->flags & ASYNC_CALLOUT_ACTIVE) == 0) && |
portp | 1351 | drivers/char/istallion.c | ((portp->flags & ASYNC_CLOSING) == 0) && |
portp | 1352 | drivers/char/istallion.c | ((portp->tty->termios->c_cflag & CLOCAL) || |
portp | 1353 | drivers/char/istallion.c | (portp->sigs & TIOCM_CD))) { |
portp | 1360 | drivers/char/istallion.c | interruptible_sleep_on(&portp->open_wait); |
portp | 1364 | drivers/char/istallion.c | portp->refcount++; |
portp | 1365 | drivers/char/istallion.c | portp->openwaitcnt--; |
portp | 1385 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1398 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1399 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1401 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1403 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1421 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 1426 | drivers/char/istallion.c | len = (head >= tail) ? (portp->txsize - (head - tail) - 1) : (tail - head - 1); |
portp | 1443 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 1448 | drivers/char/istallion.c | size = portp->txsize; |
portp | 1459 | drivers/char/istallion.c | shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); |
portp | 1474 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 1476 | drivers/char/istallion.c | if (test_bit(ST_TXBUSY, &portp->state)) { |
portp | 1481 | drivers/char/istallion.c | hdrp->slavereq |= portp->reqbit; |
portp | 1482 | drivers/char/istallion.c | bits = ((volatile unsigned char *) hdrp) + brdp->slaveoffset + portp->portidx; |
portp | 1483 | drivers/char/istallion.c | *bits |= portp->portbit; |
portp | 1484 | drivers/char/istallion.c | set_bit(ST_TXBUSY, &portp->state); |
portp | 1535 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1560 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1561 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1563 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1565 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1571 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 1576 | drivers/char/istallion.c | size = portp->txsize; |
portp | 1587 | drivers/char/istallion.c | shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); |
portp | 1603 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 1606 | drivers/char/istallion.c | if (test_bit(ST_TXBUSY, &portp->state)) { |
portp | 1611 | drivers/char/istallion.c | hdrp->slavereq |= portp->reqbit; |
portp | 1612 | drivers/char/istallion.c | bits = ((volatile unsigned char *) hdrp) + brdp->slaveoffset + portp->portidx; |
portp | 1613 | drivers/char/istallion.c | *bits |= portp->portbit; |
portp | 1614 | drivers/char/istallion.c | set_bit(ST_TXBUSY, &portp->state); |
portp | 1625 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1643 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1644 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1646 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1648 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1653 | drivers/char/istallion.c | rp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->txq; |
portp | 1658 | drivers/char/istallion.c | len = (head >= tail) ? (portp->txsize - (head - tail)) : (tail - head); |
portp | 1683 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1696 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1697 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1699 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1701 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1706 | drivers/char/istallion.c | rp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->txq; |
portp | 1711 | drivers/char/istallion.c | len = (head >= tail) ? (head - tail) : (portp->txsize - (tail - head)); |
portp | 1712 | drivers/char/istallion.c | if ((len == 0) && test_bit(ST_TXBUSY, &portp->state)) |
portp | 1726 | drivers/char/istallion.c | static void stli_getserial(stliport_t *portp, struct serial_struct *sp) |
portp | 1731 | drivers/char/istallion.c | printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); |
portp | 1736 | drivers/char/istallion.c | sio.line = portp->portnr; |
portp | 1737 | drivers/char/istallion.c | sio.port = stli_brdconf[portp->brdnr].ioaddr1; |
portp | 1738 | drivers/char/istallion.c | sio.irq = stli_brdconf[portp->brdnr].irq; |
portp | 1739 | drivers/char/istallion.c | sio.flags = portp->flags; |
portp | 1740 | drivers/char/istallion.c | sio.baud_base = portp->baud_base; |
portp | 1741 | drivers/char/istallion.c | sio.close_delay = portp->close_delay; |
portp | 1742 | drivers/char/istallion.c | sio.closing_wait = portp->closing_wait; |
portp | 1743 | drivers/char/istallion.c | sio.custom_divisor = portp->custom_divisor; |
portp | 1757 | drivers/char/istallion.c | static int stli_setserial(stliport_t *portp, struct serial_struct *sp) |
portp | 1763 | drivers/char/istallion.c | printk("stli_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); |
portp | 1768 | drivers/char/istallion.c | if ((sio.baud_base != portp->baud_base) || |
portp | 1769 | drivers/char/istallion.c | (sio.close_delay != portp->close_delay) || |
portp | 1770 | drivers/char/istallion.c | ((sio.flags & ~ASYNC_USR_MASK) != (portp->flags & ~ASYNC_USR_MASK))) |
portp | 1774 | drivers/char/istallion.c | portp->flags = (portp->flags & ~ASYNC_USR_MASK) | (sio.flags & ASYNC_USR_MASK); |
portp | 1775 | drivers/char/istallion.c | portp->baud_base = sio.baud_base; |
portp | 1776 | drivers/char/istallion.c | portp->close_delay = sio.close_delay; |
portp | 1777 | drivers/char/istallion.c | portp->closing_wait = sio.closing_wait; |
portp | 1778 | drivers/char/istallion.c | portp->custom_divisor = sio.custom_divisor; |
portp | 1780 | drivers/char/istallion.c | if ((rc = stli_setport(portp)) < 0) |
portp | 1789 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1800 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1801 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1803 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1805 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1815 | drivers/char/istallion.c | rc = stli_cmdwait(brdp, portp, A_BREAK, &val, sizeof(unsigned long), 0); |
portp | 1823 | drivers/char/istallion.c | rc = stli_cmdwait(brdp, portp, A_BREAK, &val, sizeof(unsigned long), 0); |
portp | 1838 | drivers/char/istallion.c | if ((rc = stli_cmdwait(brdp, portp, A_GETSIGNALS, &portp->asig, sizeof(asysigs_t), 1)) < 0) |
portp | 1840 | drivers/char/istallion.c | val = stli_mktiocm(portp->asig.sigvalue); |
portp | 1847 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, ((arg & TIOCM_DTR) ? 1 : -1), ((arg & TIOCM_RTS) ? 1 : -1)); |
portp | 1848 | drivers/char/istallion.c | rc = stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0); |
portp | 1854 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, ((arg & TIOCM_DTR) ? 0 : -1), ((arg & TIOCM_RTS) ? 0 : -1)); |
portp | 1855 | drivers/char/istallion.c | rc = stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0); |
portp | 1861 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, ((arg & TIOCM_DTR) ? 1 : 0), ((arg & TIOCM_RTS) ? 1 : 0)); |
portp | 1862 | drivers/char/istallion.c | rc = stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0); |
portp | 1867 | drivers/char/istallion.c | stli_getserial(portp, (struct serial_struct *) arg); |
portp | 1871 | drivers/char/istallion.c | rc = stli_setserial(portp, (struct serial_struct *) arg); |
portp | 1897 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1908 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1909 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1911 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 1913 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 1919 | drivers/char/istallion.c | stli_mkasyport(portp, &aport, tiosp); |
portp | 1920 | drivers/char/istallion.c | stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0); |
portp | 1921 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, ((tiosp->c_cflag & CBAUD) ? 1 : 0), -1); |
portp | 1922 | drivers/char/istallion.c | stli_cmdwait(brdp, portp, A_SETSIGNALS, &portp->asig, sizeof(asysigs_t), 0); |
portp | 1926 | drivers/char/istallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 1943 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1951 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1952 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1955 | drivers/char/istallion.c | set_bit(ST_RXSTOP, &portp->state); |
portp | 1968 | drivers/char/istallion.c | stliport_t *portp; |
portp | 1976 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 1977 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 1980 | drivers/char/istallion.c | clear_bit(ST_RXSTOP, &portp->state); |
portp | 1993 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2002 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 2003 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 2005 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 2007 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 2012 | drivers/char/istallion.c | stli_cmdwait(brdp, portp, A_PORTCTRL, &actrl, sizeof(asyctrl_t)); |
portp | 2024 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2034 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 2035 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 2037 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 2039 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 2044 | drivers/char/istallion.c | stli_cmdwait(brdp, portp, A_PORTCTRL, &actrl, sizeof(asyctrl_t)); |
portp | 2061 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2067 | drivers/char/istallion.c | portp = (stliport_t *) arg; |
portp | 2068 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 2070 | drivers/char/istallion.c | if (portp->tty == (struct tty_struct *) NULL) |
portp | 2072 | drivers/char/istallion.c | tty_hangup(portp->tty); |
portp | 2086 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2096 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 2097 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 2099 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 2101 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 2103 | drivers/char/istallion.c | portp->flags &= ~ASYNC_INITIALIZED; |
portp | 2107 | drivers/char/istallion.c | if (! test_bit(ST_CLOSING, &portp->state)) |
portp | 2108 | drivers/char/istallion.c | stli_rawclose(brdp, portp, 0, 0); |
portp | 2110 | drivers/char/istallion.c | stli_mkasysigs(&portp->asig, 0, 0); |
portp | 2111 | drivers/char/istallion.c | if (test_bit(ST_CMDING, &portp->state)) { |
portp | 2112 | drivers/char/istallion.c | set_bit(ST_DOSIGS, &portp->state); |
portp | 2113 | drivers/char/istallion.c | set_bit(ST_DOFLUSHTX, &portp->state); |
portp | 2114 | drivers/char/istallion.c | set_bit(ST_DOFLUSHRX, &portp->state); |
portp | 2116 | drivers/char/istallion.c | stli_sendcmd(brdp, portp, A_SETSIGNALSF, &portp->asig, sizeof(asysigs_t), 0); |
portp | 2121 | drivers/char/istallion.c | clear_bit(ST_TXBUSY, &portp->state); |
portp | 2122 | drivers/char/istallion.c | clear_bit(ST_RXSTOP, &portp->state); |
portp | 2125 | drivers/char/istallion.c | portp->tty = (struct tty_struct *) NULL; |
portp | 2126 | drivers/char/istallion.c | portp->flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CALLOUT_ACTIVE); |
portp | 2127 | drivers/char/istallion.c | portp->refcount = 0; |
portp | 2128 | drivers/char/istallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 2142 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2152 | drivers/char/istallion.c | portp = tty->driver_data; |
portp | 2153 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 2155 | drivers/char/istallion.c | if ((portp->brdnr < 0) || (portp->brdnr >= stli_nrbrds)) |
portp | 2157 | drivers/char/istallion.c | brdp = &stli_brds[portp->brdnr]; |
portp | 2166 | drivers/char/istallion.c | if (test_bit(ST_CMDING, &portp->state)) { |
portp | 2167 | drivers/char/istallion.c | set_bit(ST_DOFLUSHTX, &portp->state); |
portp | 2170 | drivers/char/istallion.c | if (test_bit(ST_DOFLUSHRX, &portp->state)) { |
portp | 2172 | drivers/char/istallion.c | clear_bit(ST_DOFLUSHRX, &portp->state); |
portp | 2174 | drivers/char/istallion.c | stli_sendcmd(brdp, portp, A_FLUSH, &ftype, sizeof(unsigned long), 0); |
portp | 2195 | drivers/char/istallion.c | static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, void *arg, int size, int copyback) |
portp | 2203 | drivers/char/istallion.c | printk("stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,copyback=%d)\n", (int) brdp, (int) portp, (int) cmd, (int) arg, size, copyback); |
portp | 2206 | drivers/char/istallion.c | if (test_bit(ST_CMDING, &portp->state)) { |
portp | 2214 | drivers/char/istallion.c | cp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->ctrl; |
portp | 2218 | drivers/char/istallion.c | portp->argp = arg; |
portp | 2219 | drivers/char/istallion.c | portp->argsize = size; |
portp | 2225 | drivers/char/istallion.c | hdrp->slavereq |= portp->reqbit; |
portp | 2226 | drivers/char/istallion.c | bits = ((volatile unsigned char *) hdrp) + brdp->slaveoffset + portp->portidx; |
portp | 2227 | drivers/char/istallion.c | *bits |= portp->portbit; |
portp | 2228 | drivers/char/istallion.c | set_bit(ST_CMDING, &portp->state); |
portp | 2243 | drivers/char/istallion.c | static inline void stli_read(stlibrd_t *brdp, stliport_t *portp) |
portp | 2252 | drivers/char/istallion.c | printk("stli_read(brdp=%x,portp=%d)\n", (int) brdp, (int) portp); |
portp | 2255 | drivers/char/istallion.c | if (test_bit(ST_RXSTOP, &portp->state)) |
portp | 2257 | drivers/char/istallion.c | tty = portp->tty; |
portp | 2261 | drivers/char/istallion.c | rp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->rxq; |
portp | 2266 | drivers/char/istallion.c | size = portp->rxsize; |
portp | 2276 | drivers/char/istallion.c | shbuf = (volatile char *) EBRDGETMEMPTR(brdp, portp->rxoffset); |
portp | 2293 | drivers/char/istallion.c | rp = &((volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr))->rxq; |
portp | 2297 | drivers/char/istallion.c | set_bit(ST_RXING, &portp->state); |
portp | 2310 | drivers/char/istallion.c | static inline void stli_dodelaycmd(stliport_t *portp, volatile cdkctrl_t *cp) |
portp | 2314 | drivers/char/istallion.c | if (test_bit(ST_DOSIGS, &portp->state)) { |
portp | 2315 | drivers/char/istallion.c | if (test_bit(ST_DOFLUSHTX, &portp->state) && test_bit(ST_DOFLUSHRX, &portp->state)) |
portp | 2317 | drivers/char/istallion.c | else if (test_bit(ST_DOFLUSHTX, &portp->state)) |
portp | 2319 | drivers/char/istallion.c | else if (test_bit(ST_DOFLUSHRX, &portp->state)) |
portp | 2323 | drivers/char/istallion.c | clear_bit(ST_DOFLUSHTX, &portp->state); |
portp | 2324 | drivers/char/istallion.c | clear_bit(ST_DOFLUSHRX, &portp->state); |
portp | 2325 | drivers/char/istallion.c | clear_bit(ST_DOSIGS, &portp->state); |
portp | 2326 | drivers/char/istallion.c | memcpy((void *) &(cp->args[0]), (void *) &portp->asig, sizeof(asysigs_t)); |
portp | 2329 | drivers/char/istallion.c | set_bit(ST_CMDING, &portp->state); |
portp | 2330 | drivers/char/istallion.c | } else if (test_bit(ST_DOFLUSHTX, &portp->state) || test_bit(ST_DOFLUSHRX, &portp->state)) { |
portp | 2331 | drivers/char/istallion.c | cmd = ((test_bit(ST_DOFLUSHTX, &portp->state)) ? FLUSHTX : 0); |
portp | 2332 | drivers/char/istallion.c | cmd |= ((test_bit(ST_DOFLUSHRX, &portp->state)) ? FLUSHRX : 0); |
portp | 2333 | drivers/char/istallion.c | clear_bit(ST_DOFLUSHTX, &portp->state); |
portp | 2334 | drivers/char/istallion.c | clear_bit(ST_DOFLUSHRX, &portp->state); |
portp | 2338 | drivers/char/istallion.c | set_bit(ST_CMDING, &portp->state); |
portp | 2358 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2366 | drivers/char/istallion.c | portp = brdp->ports[(channr - 1)]; |
portp | 2367 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 2373 | drivers/char/istallion.c | if (test_bit(ST_OPENING, &portp->state)) { |
portp | 2379 | drivers/char/istallion.c | portp->rc = rc; |
portp | 2380 | drivers/char/istallion.c | clear_bit(ST_OPENING, &portp->state); |
portp | 2381 | drivers/char/istallion.c | wake_up_interruptible(&portp->raw_wait); |
portp | 2388 | drivers/char/istallion.c | if (test_bit(ST_CLOSING, &portp->state)) { |
portp | 2394 | drivers/char/istallion.c | portp->rc = rc; |
portp | 2395 | drivers/char/istallion.c | clear_bit(ST_CLOSING, &portp->state); |
portp | 2396 | drivers/char/istallion.c | wake_up_interruptible(&portp->raw_wait); |
portp | 2404 | drivers/char/istallion.c | if (test_bit(ST_CMDING, &portp->state)) { |
portp | 2409 | drivers/char/istallion.c | if (portp->argp != (void *) NULL) { |
portp | 2410 | drivers/char/istallion.c | memcpy(portp->argp, (void *) &(cp->args[0]), portp->argsize); |
portp | 2411 | drivers/char/istallion.c | portp->argp = (void *) NULL; |
portp | 2414 | drivers/char/istallion.c | portp->rc = rc; |
portp | 2415 | drivers/char/istallion.c | clear_bit(ST_CMDING, &portp->state); |
portp | 2416 | drivers/char/istallion.c | stli_dodelaycmd(portp, cp); |
portp | 2417 | drivers/char/istallion.c | wake_up_interruptible(&portp->raw_wait); |
portp | 2431 | drivers/char/istallion.c | tty = portp->tty; |
portp | 2434 | drivers/char/istallion.c | oldsigs = portp->sigs; |
portp | 2435 | drivers/char/istallion.c | portp->sigs = stli_mktiocm(nt.sigvalue); |
portp | 2436 | drivers/char/istallion.c | clear_bit(ST_GETSIGS, &portp->state); |
portp | 2437 | drivers/char/istallion.c | if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0)) |
portp | 2438 | drivers/char/istallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 2439 | drivers/char/istallion.c | if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0)) { |
portp | 2440 | drivers/char/istallion.c | if (! ((portp->flags & ASYNC_CALLOUT_ACTIVE) && |
portp | 2441 | drivers/char/istallion.c | (portp->flags & ASYNC_CALLOUT_NOHUP))) { |
portp | 2443 | drivers/char/istallion.c | queue_task_irq_off(&portp->tqhangup, &tq_scheduler); |
portp | 2449 | drivers/char/istallion.c | clear_bit(ST_TXBUSY, &portp->state); |
portp | 2458 | drivers/char/istallion.c | if ((nt.data & DT_RXBREAK) && (portp->rxmarkmsk & BRKINT)) { |
portp | 2465 | drivers/char/istallion.c | if (portp->flags & ASYNC_SAK) |
portp | 2475 | drivers/char/istallion.c | stli_read(brdp, portp); |
portp | 2487 | drivers/char/istallion.c | if ((!donerx) && test_bit(ST_RXING, &portp->state)) { |
portp | 2488 | drivers/char/istallion.c | clear_bit(ST_RXING, &portp->state); |
portp | 2489 | drivers/char/istallion.c | stli_read(brdp, portp); |
portp | 2511 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2572 | drivers/char/istallion.c | portp = brdp->ports[(channr - 1)]; |
portp | 2573 | drivers/char/istallion.c | if (test_bit(ST_OPENING, &portp->state) || |
portp | 2574 | drivers/char/istallion.c | test_bit(ST_CLOSING, &portp->state) || |
portp | 2575 | drivers/char/istallion.c | test_bit(ST_CMDING, &portp->state) || |
portp | 2576 | drivers/char/istallion.c | test_bit(ST_TXBUSY, &portp->state)) { |
portp | 2577 | drivers/char/istallion.c | slavereq |= portp->reqbit; |
portp | 2601 | drivers/char/istallion.c | static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp) |
portp | 2604 | drivers/char/istallion.c | printk("stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n", (int) portp, (int) pp, (int) tiosp); |
portp | 2622 | drivers/char/istallion.c | if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
portp | 2624 | drivers/char/istallion.c | else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
portp | 2626 | drivers/char/istallion.c | else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) |
portp | 2627 | drivers/char/istallion.c | pp->baudout = (portp->baud_base / portp->custom_divisor); |
portp | 2689 | drivers/char/istallion.c | portp->rxmarkmsk = 0; |
portp | 2693 | drivers/char/istallion.c | portp->rxmarkmsk |= BRKINT; |
portp | 2754 | drivers/char/istallion.c | stliport_t *portp; |
portp | 2762 | drivers/char/istallion.c | portp = (stliport_t *) stli_memalloc(sizeof(stliport_t)); |
portp | 2763 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) { |
portp | 2768 | drivers/char/istallion.c | memset(portp, 0, sizeof(stliport_t)); |
portp | 2769 | drivers/char/istallion.c | portp->portnr = i; |
portp | 2770 | drivers/char/istallion.c | portp->brdnr = brdp->brdnr; |
portp | 2771 | drivers/char/istallion.c | portp->panelnr = panelnr; |
portp | 2772 | drivers/char/istallion.c | portp->baud_base = STL_BAUDBASE; |
portp | 2773 | drivers/char/istallion.c | portp->close_delay = STL_CLOSEDELAY; |
portp | 2774 | drivers/char/istallion.c | portp->closing_wait = 30 * HZ; |
portp | 2775 | drivers/char/istallion.c | portp->tqhangup.routine = stli_dohangup; |
portp | 2776 | drivers/char/istallion.c | portp->tqhangup.data = portp; |
portp | 2777 | drivers/char/istallion.c | portp->normaltermios = stli_deftermios; |
portp | 2778 | drivers/char/istallion.c | portp->callouttermios = stli_deftermios; |
portp | 2784 | drivers/char/istallion.c | brdp->ports[i] = portp; |
portp | 3623 | drivers/char/istallion.c | stliport_t *portp; |
portp | 3674 | drivers/char/istallion.c | portp = brdp->ports[portnr]; |
portp | 3675 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 3677 | drivers/char/istallion.c | portp->devnr = i; |
portp | 3678 | drivers/char/istallion.c | portp->addr = memp->offset; |
portp | 3679 | drivers/char/istallion.c | portp->reqbit = (unsigned char) (0x1 << (i * 8 / nrdevs)); |
portp | 3680 | drivers/char/istallion.c | portp->portidx = (unsigned char) (i / 8); |
portp | 3681 | drivers/char/istallion.c | portp->portbit = (unsigned char) (0x1 << (i % 8)); |
portp | 3690 | drivers/char/istallion.c | portp = brdp->ports[portnr]; |
portp | 3691 | drivers/char/istallion.c | if (portp == (stliport_t *) NULL) |
portp | 3693 | drivers/char/istallion.c | if (portp->addr == 0) |
portp | 3695 | drivers/char/istallion.c | ap = (volatile cdkasy_t *) EBRDGETMEMPTR(brdp, portp->addr); |
portp | 3697 | drivers/char/istallion.c | portp->rxsize = ap->rxq.size; |
portp | 3698 | drivers/char/istallion.c | portp->txsize = ap->txq.size; |
portp | 3699 | drivers/char/istallion.c | portp->rxoffset = ap->rxq.offset; |
portp | 3700 | drivers/char/istallion.c | portp->txoffset = ap->txq.offset; |
portp | 480 | drivers/char/stallion.c | static void stl_getserial(stlport_t *portp, struct serial_struct *sp); |
portp | 481 | drivers/char/stallion.c | static int stl_setserial(stlport_t *portp, struct serial_struct *sp); |
portp | 482 | drivers/char/stallion.c | static void stl_setreg(stlport_t *portp, int regnr, int value); |
portp | 483 | drivers/char/stallion.c | static int stl_getreg(stlport_t *portp, int regnr); |
portp | 484 | drivers/char/stallion.c | static int stl_updatereg(stlport_t *portp, int regnr, int value); |
portp | 485 | drivers/char/stallion.c | static void stl_setport(stlport_t *portp, struct termios *tiosp); |
portp | 486 | drivers/char/stallion.c | static void stl_getsignals(stlport_t *portp); |
portp | 487 | drivers/char/stallion.c | static void stl_setsignals(stlport_t *portp, int dtr, int rts); |
portp | 488 | drivers/char/stallion.c | static void stl_ccrwait(stlport_t *portp); |
portp | 489 | drivers/char/stallion.c | static void stl_enablerxtx(stlport_t *portp, int rx, int tx); |
portp | 490 | drivers/char/stallion.c | static void stl_startrxtx(stlport_t *portp, int rx, int tx); |
portp | 491 | drivers/char/stallion.c | static void stl_disableintrs(stlport_t *portp); |
portp | 492 | drivers/char/stallion.c | static void stl_sendbreak(stlport_t *portp, long len); |
portp | 493 | drivers/char/stallion.c | static int stl_waitcarrier(stlport_t *portp, struct file *filp); |
portp | 531 | drivers/char/stallion.c | stlport_t *portp; |
portp | 567 | drivers/char/stallion.c | portp = panelp->ports[k]; |
portp | 568 | drivers/char/stallion.c | if (portp != (stlport_t *) NULL) { |
portp | 569 | drivers/char/stallion.c | if (portp->tty != (struct tty_struct *) NULL) |
portp | 570 | drivers/char/stallion.c | stl_hangup(portp->tty); |
portp | 571 | drivers/char/stallion.c | if (portp->tx.buf != (char *) NULL) |
portp | 572 | drivers/char/stallion.c | kfree_s(portp->tx.buf, STL_TXBUFSIZE); |
portp | 573 | drivers/char/stallion.c | kfree_s(portp, sizeof(stlport_t)); |
portp | 623 | drivers/char/stallion.c | stlport_t *portp; |
portp | 652 | drivers/char/stallion.c | portp = brdp->panels[panelnr]->ports[portnr]; |
portp | 653 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 660 | drivers/char/stallion.c | portp->tty = tty; |
portp | 661 | drivers/char/stallion.c | tty->driver_data = portp; |
portp | 662 | drivers/char/stallion.c | portp->refcount++; |
portp | 664 | drivers/char/stallion.c | if ((portp->flags & ASYNC_INITIALIZED) == 0) { |
portp | 665 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) { |
portp | 666 | drivers/char/stallion.c | portp->tx.buf = (char *) stl_memalloc(STL_TXBUFSIZE); |
portp | 667 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 669 | drivers/char/stallion.c | portp->tx.head = portp->tx.buf; |
portp | 670 | drivers/char/stallion.c | portp->tx.tail = portp->tx.buf; |
portp | 672 | drivers/char/stallion.c | stl_setport(portp, tty->termios); |
portp | 673 | drivers/char/stallion.c | stl_getsignals(portp); |
portp | 674 | drivers/char/stallion.c | stl_setsignals(portp, 1, 1); |
portp | 675 | drivers/char/stallion.c | stl_enablerxtx(portp, 1, 1); |
portp | 676 | drivers/char/stallion.c | stl_startrxtx(portp, 1, 0); |
portp | 678 | drivers/char/stallion.c | portp->flags |= ASYNC_INITIALIZED; |
portp | 687 | drivers/char/stallion.c | if (portp->flags & ASYNC_CLOSING) { |
portp | 688 | drivers/char/stallion.c | interruptible_sleep_on(&portp->close_wait); |
portp | 689 | drivers/char/stallion.c | if (portp->flags & ASYNC_HUP_NOTIFY) |
portp | 700 | drivers/char/stallion.c | if (portp->flags & ASYNC_NORMAL_ACTIVE) |
portp | 702 | drivers/char/stallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) { |
portp | 703 | drivers/char/stallion.c | if ((portp->flags & ASYNC_SESSION_LOCKOUT) && |
portp | 704 | drivers/char/stallion.c | (portp->session != current->session)) |
portp | 706 | drivers/char/stallion.c | if ((portp->flags & ASYNC_PGRP_LOCKOUT) && |
portp | 707 | drivers/char/stallion.c | (portp->pgrp != current->pgrp)) |
portp | 710 | drivers/char/stallion.c | portp->flags |= ASYNC_CALLOUT_ACTIVE; |
portp | 713 | drivers/char/stallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) |
portp | 716 | drivers/char/stallion.c | if ((rc = stl_waitcarrier(portp, filp)) != 0) |
portp | 719 | drivers/char/stallion.c | portp->flags |= ASYNC_NORMAL_ACTIVE; |
portp | 722 | drivers/char/stallion.c | if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) { |
portp | 724 | drivers/char/stallion.c | *tty->termios = portp->normaltermios; |
portp | 726 | drivers/char/stallion.c | *tty->termios = portp->callouttermios; |
portp | 727 | drivers/char/stallion.c | stl_setport(portp, tty->termios); |
portp | 730 | drivers/char/stallion.c | portp->session = current->session; |
portp | 731 | drivers/char/stallion.c | portp->pgrp = current->pgrp; |
portp | 742 | drivers/char/stallion.c | static int stl_waitcarrier(stlport_t *portp, struct file *filp) |
portp | 748 | drivers/char/stallion.c | printk("stl_waitcarrier(portp=%x,filp=%x)\n", (int) portp, (int) filp); |
portp | 755 | drivers/char/stallion.c | portp->openwaitcnt++; |
portp | 756 | drivers/char/stallion.c | if (portp->refcount > 0) |
portp | 757 | drivers/char/stallion.c | portp->refcount--; |
portp | 760 | drivers/char/stallion.c | if ((portp->flags & ASYNC_CALLOUT_ACTIVE) == 0) |
portp | 761 | drivers/char/stallion.c | stl_setsignals(portp, 1, 1); |
portp | 762 | drivers/char/stallion.c | if (tty_hung_up_p(filp) || ((portp->flags & ASYNC_INITIALIZED) == 0)) { |
portp | 763 | drivers/char/stallion.c | if (portp->flags & ASYNC_HUP_NOTIFY) |
portp | 769 | drivers/char/stallion.c | if (((portp->flags & ASYNC_CALLOUT_ACTIVE) == 0) && |
portp | 770 | drivers/char/stallion.c | ((portp->flags & ASYNC_CLOSING) == 0) && |
portp | 771 | drivers/char/stallion.c | ((portp->tty->termios->c_cflag & CLOCAL) || |
portp | 772 | drivers/char/stallion.c | (portp->sigs & TIOCM_CD))) { |
portp | 779 | drivers/char/stallion.c | interruptible_sleep_on(&portp->open_wait); |
portp | 783 | drivers/char/stallion.c | portp->refcount++; |
portp | 784 | drivers/char/stallion.c | portp->openwaitcnt--; |
portp | 794 | drivers/char/stallion.c | stlport_t *portp; |
portp | 801 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 802 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 811 | drivers/char/stallion.c | if (portp->refcount-- > 1) { |
portp | 816 | drivers/char/stallion.c | portp->refcount = 0; |
portp | 817 | drivers/char/stallion.c | portp->flags |= ASYNC_CLOSING; |
portp | 819 | drivers/char/stallion.c | if (portp->flags & ASYNC_NORMAL_ACTIVE) |
portp | 820 | drivers/char/stallion.c | portp->normaltermios = *tty->termios; |
portp | 821 | drivers/char/stallion.c | if (portp->flags & ASYNC_CALLOUT_ACTIVE) |
portp | 822 | drivers/char/stallion.c | portp->callouttermios = *tty->termios; |
portp | 830 | drivers/char/stallion.c | if (test_bit(ASYI_TXBUSY, &portp->istate)) { |
portp | 831 | drivers/char/stallion.c | if (portp->closing_wait != ASYNC_CLOSING_WAIT_NONE) |
portp | 832 | drivers/char/stallion.c | tty_wait_until_sent(tty, portp->closing_wait); |
portp | 835 | drivers/char/stallion.c | portp->flags &= ~ASYNC_INITIALIZED; |
portp | 836 | drivers/char/stallion.c | stl_disableintrs(portp); |
portp | 838 | drivers/char/stallion.c | stl_setsignals(portp, 0, 0); |
portp | 839 | drivers/char/stallion.c | stl_enablerxtx(portp, 0, 0); |
portp | 841 | drivers/char/stallion.c | portp->istate = 0; |
portp | 842 | drivers/char/stallion.c | if (portp->tx.buf != (char *) NULL) { |
portp | 843 | drivers/char/stallion.c | kfree_s(portp->tx.buf, STL_TXBUFSIZE); |
portp | 844 | drivers/char/stallion.c | portp->tx.buf = (char *) NULL; |
portp | 845 | drivers/char/stallion.c | portp->tx.head = (char *) NULL; |
portp | 846 | drivers/char/stallion.c | portp->tx.tail = (char *) NULL; |
portp | 854 | drivers/char/stallion.c | portp->tty = (struct tty_struct *) NULL; |
portp | 856 | drivers/char/stallion.c | if (portp->openwaitcnt) { |
portp | 857 | drivers/char/stallion.c | if (portp->close_delay) |
portp | 858 | drivers/char/stallion.c | stl_delay(portp->close_delay); |
portp | 859 | drivers/char/stallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 862 | drivers/char/stallion.c | portp->flags &= ~(ASYNC_CALLOUT_ACTIVE | ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING); |
portp | 863 | drivers/char/stallion.c | wake_up_interruptible(&portp->close_wait); |
portp | 896 | drivers/char/stallion.c | stlport_t *portp; |
portp | 908 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 909 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 911 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 922 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 923 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 937 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 938 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 941 | drivers/char/stallion.c | stlen = STL_TXBUFSIZE - (head - portp->tx.buf); |
portp | 956 | drivers/char/stallion.c | if (head >= (portp->tx.buf + STL_TXBUFSIZE)) { |
portp | 957 | drivers/char/stallion.c | head = portp->tx.buf; |
portp | 961 | drivers/char/stallion.c | portp->tx.head = head; |
portp | 963 | drivers/char/stallion.c | clear_bit(ASYI_TXLOW, &portp->istate); |
portp | 964 | drivers/char/stallion.c | stl_startrxtx(portp, -1, 1); |
portp | 973 | drivers/char/stallion.c | stlport_t *portp; |
portp | 983 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 984 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 986 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 989 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 990 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 997 | drivers/char/stallion.c | if (head >= (portp->tx.buf + STL_TXBUFSIZE)) |
portp | 998 | drivers/char/stallion.c | head = portp->tx.buf; |
portp | 1000 | drivers/char/stallion.c | portp->tx.head = head; |
portp | 1013 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1021 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1022 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1024 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 1028 | drivers/char/stallion.c | if (tty->stopped || tty->hw_stopped || (portp->tx.head == portp->tx.tail)) |
portp | 1031 | drivers/char/stallion.c | stl_startrxtx(portp, -1, 1); |
portp | 1038 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1047 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1048 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1050 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 1053 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 1054 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 1071 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1081 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1082 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1084 | drivers/char/stallion.c | if (portp->tx.buf == (char *) NULL) |
portp | 1087 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 1088 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 1090 | drivers/char/stallion.c | if ((size == 0) && test_bit(ASYI_TXBUSY, &portp->istate)) |
portp | 1101 | drivers/char/stallion.c | static void stl_getserial(stlport_t *portp, struct serial_struct *sp) |
portp | 1107 | drivers/char/stallion.c | printk("stl_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); |
portp | 1112 | drivers/char/stallion.c | sio.line = portp->portnr; |
portp | 1113 | drivers/char/stallion.c | sio.port = portp->ioaddr; |
portp | 1114 | drivers/char/stallion.c | sio.flags = portp->flags; |
portp | 1115 | drivers/char/stallion.c | sio.baud_base = portp->baud_base; |
portp | 1116 | drivers/char/stallion.c | sio.close_delay = portp->close_delay; |
portp | 1117 | drivers/char/stallion.c | sio.closing_wait = portp->closing_wait; |
portp | 1118 | drivers/char/stallion.c | sio.custom_divisor = portp->custom_divisor; |
portp | 1122 | drivers/char/stallion.c | brdp = stl_brds[portp->brdnr]; |
portp | 1137 | drivers/char/stallion.c | static int stl_setserial(stlport_t *portp, struct serial_struct *sp) |
portp | 1142 | drivers/char/stallion.c | printk("stl_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp); |
portp | 1147 | drivers/char/stallion.c | if ((sio.baud_base != portp->baud_base) || |
portp | 1148 | drivers/char/stallion.c | (sio.close_delay != portp->close_delay) || |
portp | 1149 | drivers/char/stallion.c | ((sio.flags & ~ASYNC_USR_MASK) != (portp->flags & ~ASYNC_USR_MASK))) |
portp | 1153 | drivers/char/stallion.c | portp->flags = (portp->flags & ~ASYNC_USR_MASK) | (sio.flags & ASYNC_USR_MASK); |
portp | 1154 | drivers/char/stallion.c | portp->baud_base = sio.baud_base; |
portp | 1155 | drivers/char/stallion.c | portp->close_delay = sio.close_delay; |
portp | 1156 | drivers/char/stallion.c | portp->closing_wait = sio.closing_wait; |
portp | 1157 | drivers/char/stallion.c | portp->custom_divisor = sio.custom_divisor; |
portp | 1158 | drivers/char/stallion.c | stl_setport(portp, portp->tty->termios); |
portp | 1166 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1175 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1176 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1186 | drivers/char/stallion.c | stl_sendbreak(portp, 250); |
portp | 1192 | drivers/char/stallion.c | stl_sendbreak(portp, (arg ? (arg * 100) : 250)); |
portp | 1207 | drivers/char/stallion.c | stl_getsignals(portp); |
portp | 1208 | drivers/char/stallion.c | put_fs_long(portp->sigs, (unsigned long *) arg); |
portp | 1214 | drivers/char/stallion.c | stl_setsignals(portp, ((arg & TIOCM_DTR) ? 1 : -1), ((arg & TIOCM_RTS) ? 1 : -1)); |
portp | 1220 | drivers/char/stallion.c | stl_setsignals(portp, ((arg & TIOCM_DTR) ? 0 : -1), ((arg & TIOCM_RTS) ? 0 : -1)); |
portp | 1226 | drivers/char/stallion.c | stl_setsignals(portp, ((arg & TIOCM_DTR) ? 1 : 0), ((arg & TIOCM_RTS) ? 1 : 0)); |
portp | 1231 | drivers/char/stallion.c | stl_getserial(portp, (struct serial_struct *) arg); |
portp | 1235 | drivers/char/stallion.c | rc = stl_setserial(portp, (struct serial_struct *) arg); |
portp | 1256 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1265 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1266 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1273 | drivers/char/stallion.c | stl_setport(portp, tiosp); |
portp | 1274 | drivers/char/stallion.c | stl_setsignals(portp, ((tiosp->c_cflag & (CBAUD & ~CBAUDEX)) ? 1 : 0), -1); |
portp | 1280 | drivers/char/stallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 1292 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1301 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1302 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1307 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 1308 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 1310 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1311 | drivers/char/stallion.c | stl_setreg(portp, CCR, CCR_SENDSCHR2); |
portp | 1312 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1315 | drivers/char/stallion.c | stl_setreg(portp, MCOR1, (stl_getreg(portp, MCOR1) & 0xf0)); |
portp | 1316 | drivers/char/stallion.c | stl_setreg(portp, MSVR2, 0); |
portp | 1318 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 1330 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1339 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1340 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1345 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 1346 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 1348 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1349 | drivers/char/stallion.c | stl_setreg(portp, CCR, CCR_SENDSCHR1); |
portp | 1350 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1359 | drivers/char/stallion.c | stl_setreg(portp, MCOR1, (stl_getreg(portp, MCOR1) | FIFO_RTSTHRESHOLD)); |
portp | 1360 | drivers/char/stallion.c | stl_setreg(portp, MSVR2, MSVR2_RTS); |
portp | 1362 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 1375 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1383 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1384 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1387 | drivers/char/stallion.c | stl_startrxtx(portp, -1, 0); |
portp | 1398 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1406 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1407 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1410 | drivers/char/stallion.c | stl_startrxtx(portp, -1, 1); |
portp | 1423 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1431 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1432 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1435 | drivers/char/stallion.c | portp->flags &= ~ASYNC_INITIALIZED; |
portp | 1436 | drivers/char/stallion.c | stl_disableintrs(portp); |
portp | 1438 | drivers/char/stallion.c | stl_setsignals(portp, 0, 0); |
portp | 1439 | drivers/char/stallion.c | stl_enablerxtx(portp, 0, 0); |
portp | 1441 | drivers/char/stallion.c | portp->istate = 0; |
portp | 1443 | drivers/char/stallion.c | if (portp->tx.buf != (char *) NULL) { |
portp | 1444 | drivers/char/stallion.c | kfree_s(portp->tx.buf, STL_TXBUFSIZE); |
portp | 1445 | drivers/char/stallion.c | portp->tx.buf = (char *) NULL; |
portp | 1446 | drivers/char/stallion.c | portp->tx.head = (char *) NULL; |
portp | 1447 | drivers/char/stallion.c | portp->tx.tail = (char *) NULL; |
portp | 1450 | drivers/char/stallion.c | portp->tty = (struct tty_struct *) NULL; |
portp | 1451 | drivers/char/stallion.c | portp->flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CALLOUT_ACTIVE); |
portp | 1452 | drivers/char/stallion.c | portp->refcount = 0; |
portp | 1453 | drivers/char/stallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 1460 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1469 | drivers/char/stallion.c | portp = tty->driver_data; |
portp | 1470 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1475 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 1476 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 1477 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1478 | drivers/char/stallion.c | stl_setreg(portp, CCR, CCR_TXFLUSHFIFO); |
portp | 1479 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 1480 | drivers/char/stallion.c | portp->tx.tail = portp->tx.head; |
portp | 1481 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 1497 | drivers/char/stallion.c | static int stl_getreg(stlport_t *portp, int regnr) |
portp | 1499 | drivers/char/stallion.c | outb((regnr + portp->uartaddr), portp->ioaddr); |
portp | 1500 | drivers/char/stallion.c | return(inb(portp->ioaddr + EREG_DATA)); |
portp | 1503 | drivers/char/stallion.c | static void stl_setreg(stlport_t *portp, int regnr, int value) |
portp | 1505 | drivers/char/stallion.c | outb((regnr + portp->uartaddr), portp->ioaddr); |
portp | 1506 | drivers/char/stallion.c | outb(value, portp->ioaddr + EREG_DATA); |
portp | 1509 | drivers/char/stallion.c | static int stl_updatereg(stlport_t *portp, int regnr, int value) |
portp | 1511 | drivers/char/stallion.c | outb((regnr + portp->uartaddr), portp->ioaddr); |
portp | 1512 | drivers/char/stallion.c | if (inb(portp->ioaddr + EREG_DATA) != value) { |
portp | 1513 | drivers/char/stallion.c | outb(value, portp->ioaddr + EREG_DATA); |
portp | 1535 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1549 | drivers/char/stallion.c | portp = panelp->ports[(ioack >> 3)]; |
portp | 1556 | drivers/char/stallion.c | if (portp->brklen != 0) { |
portp | 1557 | drivers/char/stallion.c | if (portp->brklen > 0) { |
portp | 1558 | drivers/char/stallion.c | outb((TDR + portp->uartaddr), ioaddr); |
portp | 1563 | drivers/char/stallion.c | outb(portp->brklen, (ioaddr + EREG_DATA)); |
portp | 1566 | drivers/char/stallion.c | portp->brklen = -1; |
portp | 1569 | drivers/char/stallion.c | outb((COR2 + portp->uartaddr), ioaddr); |
portp | 1571 | drivers/char/stallion.c | portp->brklen = 0; |
portp | 1575 | drivers/char/stallion.c | head = portp->tx.head; |
portp | 1576 | drivers/char/stallion.c | tail = portp->tx.tail; |
portp | 1578 | drivers/char/stallion.c | if ((len == 0) || ((len < STL_TXBUFLOW) && (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { |
portp | 1579 | drivers/char/stallion.c | set_bit(ASYI_TXLOW, &portp->istate); |
portp | 1580 | drivers/char/stallion.c | queue_task_irq_off(&portp->tqueue, &tq_scheduler); |
portp | 1584 | drivers/char/stallion.c | outb((SRER + portp->uartaddr), ioaddr); |
portp | 1590 | drivers/char/stallion.c | clear_bit(ASYI_TXBUSY, &portp->istate); |
portp | 1595 | drivers/char/stallion.c | stlen = MIN(len, ((portp->tx.buf + STL_TXBUFSIZE) - tail)); |
portp | 1596 | drivers/char/stallion.c | outb((TDR + portp->uartaddr), ioaddr); |
portp | 1600 | drivers/char/stallion.c | if (tail >= (portp->tx.buf + STL_TXBUFSIZE)) |
portp | 1601 | drivers/char/stallion.c | tail = portp->tx.buf; |
portp | 1606 | drivers/char/stallion.c | portp->tx.tail = tail; |
portp | 1610 | drivers/char/stallion.c | outb((EOSRR + portp->uartaddr), ioaddr); |
portp | 1628 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1644 | drivers/char/stallion.c | portp = panelp->ports[(ioack >> 3)]; |
portp | 1645 | drivers/char/stallion.c | tty = portp->tty; |
portp | 1648 | drivers/char/stallion.c | outb((RDCR + portp->uartaddr), ioaddr); |
portp | 1652 | drivers/char/stallion.c | outb((RDSR + portp->uartaddr), ioaddr); |
portp | 1657 | drivers/char/stallion.c | outb((RDSR + portp->uartaddr), ioaddr); |
portp | 1667 | drivers/char/stallion.c | outb((RDSR + portp->uartaddr), ioaddr); |
portp | 1670 | drivers/char/stallion.c | if ((tty != (struct tty_struct *) NULL) && ((portp->rxignoremsk & status) == 0)) { |
portp | 1671 | drivers/char/stallion.c | if (portp->rxmarkmsk & status) { |
portp | 1675 | drivers/char/stallion.c | if (portp->flags & ASYNC_SAK) |
portp | 1704 | drivers/char/stallion.c | outb((EOSRR + portp->uartaddr), ioaddr); |
portp | 1718 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1731 | drivers/char/stallion.c | portp = panelp->ports[(ioack >> 3)]; |
portp | 1733 | drivers/char/stallion.c | outb((MISR + portp->uartaddr), ioaddr); |
portp | 1736 | drivers/char/stallion.c | set_bit(ASYI_DCDCHANGE, &portp->istate); |
portp | 1737 | drivers/char/stallion.c | queue_task_irq_off(&portp->tqueue, &tq_scheduler); |
portp | 1740 | drivers/char/stallion.c | outb((EOSRR + portp->uartaddr), ioaddr); |
portp | 1894 | drivers/char/stallion.c | stlport_t *portp; |
portp | 1898 | drivers/char/stallion.c | portp = private; |
portp | 1900 | drivers/char/stallion.c | printk("stl_offintr(portp=%x)\n", (int) portp); |
portp | 1903 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) |
portp | 1905 | drivers/char/stallion.c | tty = portp->tty; |
portp | 1909 | drivers/char/stallion.c | if (test_bit(ASYI_TXLOW, &portp->istate)) { |
portp | 1914 | drivers/char/stallion.c | if (test_bit(ASYI_DCDCHANGE, &portp->istate)) { |
portp | 1915 | drivers/char/stallion.c | clear_bit(ASYI_DCDCHANGE, &portp->istate); |
portp | 1916 | drivers/char/stallion.c | oldsigs = portp->sigs; |
portp | 1917 | drivers/char/stallion.c | stl_getsignals(portp); |
portp | 1918 | drivers/char/stallion.c | if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0)) |
portp | 1919 | drivers/char/stallion.c | wake_up_interruptible(&portp->open_wait); |
portp | 1920 | drivers/char/stallion.c | if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0)) { |
portp | 1921 | drivers/char/stallion.c | if (! ((portp->flags & ASYNC_CALLOUT_ACTIVE) && |
portp | 1922 | drivers/char/stallion.c | (portp->flags & ASYNC_CALLOUT_NOHUP))) { |
portp | 1936 | drivers/char/stallion.c | static void stl_ccrwait(stlport_t *portp) |
portp | 1941 | drivers/char/stallion.c | if (stl_getreg(portp, CCR) == 0) { |
portp | 1946 | drivers/char/stallion.c | printk("STALLION: cd1400 device not responding, port=%d panel=%d brd=%d\n", portp->portnr, portp->panelnr, portp->brdnr); |
portp | 1956 | drivers/char/stallion.c | static void stl_setport(stlport_t *portp, struct termios *tiosp) |
portp | 1981 | drivers/char/stallion.c | brdp = stl_brds[portp->brdnr]; |
portp | 1990 | drivers/char/stallion.c | portp->rxignoremsk = 0; |
portp | 1992 | drivers/char/stallion.c | portp->rxignoremsk |= (ST_PARITY | ST_FRAMING | ST_OVERRUN); |
portp | 1996 | drivers/char/stallion.c | portp->rxignoremsk |= ST_BREAK; |
portp | 2000 | drivers/char/stallion.c | portp->rxmarkmsk = ST_OVERRUN; |
portp | 2002 | drivers/char/stallion.c | portp->rxmarkmsk |= (ST_PARITY | ST_FRAMING); |
portp | 2004 | drivers/char/stallion.c | portp->rxmarkmsk |= ST_BREAK; |
portp | 2064 | drivers/char/stallion.c | if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
portp | 2066 | drivers/char/stallion.c | else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
portp | 2068 | drivers/char/stallion.c | else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) |
portp | 2069 | drivers/char/stallion.c | baudrate = (portp->baud_base / portp->custom_divisor); |
portp | 2116 | drivers/char/stallion.c | printk("SETPORT: portnr=%d panelnr=%d brdnr=%d\n", portp->portnr, portp->panelnr, portp->brdnr); |
portp | 2125 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2126 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x3)); |
portp | 2127 | drivers/char/stallion.c | srer = stl_getreg(portp, SRER); |
portp | 2128 | drivers/char/stallion.c | stl_setreg(portp, SRER, 0); |
portp | 2129 | drivers/char/stallion.c | if (stl_updatereg(portp, COR1, cor1)) |
portp | 2131 | drivers/char/stallion.c | if (stl_updatereg(portp, COR2, cor2)) |
portp | 2133 | drivers/char/stallion.c | if (stl_updatereg(portp, COR3, cor3)) |
portp | 2136 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 2137 | drivers/char/stallion.c | stl_setreg(portp, CCR, CCR_CORCHANGE); |
portp | 2139 | drivers/char/stallion.c | stl_setreg(portp, COR4, cor4); |
portp | 2140 | drivers/char/stallion.c | stl_setreg(portp, COR5, cor5); |
portp | 2141 | drivers/char/stallion.c | stl_setreg(portp, MCOR1, mcor1); |
portp | 2142 | drivers/char/stallion.c | stl_setreg(portp, MCOR2, mcor2); |
portp | 2144 | drivers/char/stallion.c | stl_setreg(portp, TCOR, clk); |
portp | 2145 | drivers/char/stallion.c | stl_setreg(portp, TBPR, div); |
portp | 2146 | drivers/char/stallion.c | stl_setreg(portp, RCOR, clk); |
portp | 2147 | drivers/char/stallion.c | stl_setreg(portp, RBPR, div); |
portp | 2149 | drivers/char/stallion.c | stl_setreg(portp, SCHR1, tiosp->c_cc[VSTART]); |
portp | 2150 | drivers/char/stallion.c | stl_setreg(portp, SCHR2, tiosp->c_cc[VSTOP]); |
portp | 2151 | drivers/char/stallion.c | stl_setreg(portp, SCHR3, tiosp->c_cc[VSTART]); |
portp | 2152 | drivers/char/stallion.c | stl_setreg(portp, SCHR4, tiosp->c_cc[VSTOP]); |
portp | 2153 | drivers/char/stallion.c | stl_setreg(portp, RTPR, rtpr); |
portp | 2154 | drivers/char/stallion.c | mcor1 = stl_getreg(portp, MSVR1); |
portp | 2156 | drivers/char/stallion.c | portp->sigs |= TIOCM_CD; |
portp | 2158 | drivers/char/stallion.c | portp->sigs &= ~TIOCM_CD; |
portp | 2159 | drivers/char/stallion.c | stl_setreg(portp, SRER, ((srer & ~sreroff) | sreron)); |
portp | 2160 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2170 | drivers/char/stallion.c | static void stl_setsignals(stlport_t *portp, int dtr, int rts) |
portp | 2176 | drivers/char/stallion.c | printk("stl_setsignals(portp=%x,dtr=%d,rts=%d)\n", (int) portp, dtr, rts); |
portp | 2188 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2189 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2191 | drivers/char/stallion.c | stl_setreg(portp, MSVR2, msvr2); |
portp | 2193 | drivers/char/stallion.c | stl_setreg(portp, MSVR1, msvr1); |
portp | 2194 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2204 | drivers/char/stallion.c | static void stl_getsignals(stlport_t *portp) |
portp | 2210 | drivers/char/stallion.c | printk("stl_getsignals(portp=%x)\n", (int) portp); |
portp | 2215 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2216 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2217 | drivers/char/stallion.c | msvr1 = stl_getreg(portp, MSVR1); |
portp | 2218 | drivers/char/stallion.c | msvr2 = stl_getreg(portp, MSVR2); |
portp | 2219 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2220 | drivers/char/stallion.c | portp->sigs = 0; |
portp | 2221 | drivers/char/stallion.c | portp->sigs |= (msvr1 & MSVR1_DCD) ? TIOCM_CD : 0; |
portp | 2222 | drivers/char/stallion.c | portp->sigs |= (msvr1 & MSVR1_CTS) ? TIOCM_CTS : 0; |
portp | 2223 | drivers/char/stallion.c | portp->sigs |= (msvr1 & MSVR1_RI) ? TIOCM_RI : 0; |
portp | 2224 | drivers/char/stallion.c | portp->sigs |= (msvr1 & MSVR1_DSR) ? TIOCM_DSR : 0; |
portp | 2225 | drivers/char/stallion.c | portp->sigs |= (msvr1 & MSVR1_DTR) ? TIOCM_DTR : 0; |
portp | 2226 | drivers/char/stallion.c | portp->sigs |= (msvr2 & MSVR2_RTS) ? TIOCM_RTS : 0; |
portp | 2236 | drivers/char/stallion.c | static void stl_enablerxtx(stlport_t *portp, int rx, int tx) |
portp | 2242 | drivers/char/stallion.c | printk("stl_enablerxtx(portp=%x,rx=%d,tx=%d)\n", (int) portp, rx, tx); |
portp | 2257 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2258 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2259 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 2260 | drivers/char/stallion.c | stl_setreg(portp, CCR, ccr); |
portp | 2261 | drivers/char/stallion.c | stl_ccrwait(portp); |
portp | 2262 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2272 | drivers/char/stallion.c | static void stl_startrxtx(stlport_t *portp, int rx, int tx) |
portp | 2278 | drivers/char/stallion.c | printk("stl_startrxtx(portp=%x,rx=%d,tx=%d)\n", (int) portp, rx, tx); |
portp | 2296 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2297 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2298 | drivers/char/stallion.c | stl_setreg(portp, SRER, ((stl_getreg(portp, SRER) & ~sreroff) | sreron)); |
portp | 2299 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2301 | drivers/char/stallion.c | set_bit(ASYI_TXBUSY, &portp->istate); |
portp | 2311 | drivers/char/stallion.c | static void stl_disableintrs(stlport_t *portp) |
portp | 2316 | drivers/char/stallion.c | printk("stl_disableintrs(portp=%x)\n", (int) portp); |
portp | 2320 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2321 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2322 | drivers/char/stallion.c | stl_setreg(portp, SRER, 0); |
portp | 2323 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2329 | drivers/char/stallion.c | static void stl_sendbreak(stlport_t *portp, long len) |
portp | 2334 | drivers/char/stallion.c | printk("stl_sendbreak(portp=%x,len=%d)\n", (int) portp, (int) len); |
portp | 2339 | drivers/char/stallion.c | BRDENABLE(portp->brdnr, portp->pagenr); |
portp | 2340 | drivers/char/stallion.c | stl_setreg(portp, CAR, (portp->portnr & 0x03)); |
portp | 2341 | drivers/char/stallion.c | stl_setreg(portp, COR2, (stl_getreg(portp, COR2) | COR2_ETC)); |
portp | 2342 | drivers/char/stallion.c | stl_setreg(portp, SRER, ((stl_getreg(portp, SRER) & ~SRER_TXDATA) | SRER_TXEMPTY)); |
portp | 2343 | drivers/char/stallion.c | BRDDISABLE(portp->brdnr); |
portp | 2345 | drivers/char/stallion.c | portp->brklen = (len > 255) ? 255 : len; |
portp | 2391 | drivers/char/stallion.c | stlport_t *portp; |
portp | 2450 | drivers/char/stallion.c | portp = (stlport_t *) stl_memalloc(sizeof(stlport_t)); |
portp | 2451 | drivers/char/stallion.c | if (portp == (stlport_t *) NULL) { |
portp | 2455 | drivers/char/stallion.c | memset(portp, 0, sizeof(stlport_t)); |
portp | 2456 | drivers/char/stallion.c | portp->portnr = i; |
portp | 2457 | drivers/char/stallion.c | portp->brdnr = panelp->brdnr; |
portp | 2458 | drivers/char/stallion.c | portp->panelnr = panelp->panelnr; |
portp | 2459 | drivers/char/stallion.c | portp->ioaddr = ioaddr; |
portp | 2460 | drivers/char/stallion.c | portp->uartaddr = (i & 0x04) << 5; |
portp | 2461 | drivers/char/stallion.c | portp->pagenr = panelp->pagenr + (i >> 3); |
portp | 2462 | drivers/char/stallion.c | portp->baud_base = STL_BAUDBASE; |
portp | 2463 | drivers/char/stallion.c | portp->close_delay = STL_CLOSEDELAY; |
portp | 2464 | drivers/char/stallion.c | portp->closing_wait = 30 * HZ; |
portp | 2465 | drivers/char/stallion.c | portp->normaltermios = stl_deftermios; |
portp | 2466 | drivers/char/stallion.c | portp->callouttermios = stl_deftermios; |
portp | 2467 | drivers/char/stallion.c | portp->tqueue.routine = stl_offintr; |
portp | 2468 | drivers/char/stallion.c | portp->tqueue.data = portp; |
portp | 2469 | drivers/char/stallion.c | stl_setreg(portp, CAR, (i & 0x03)); |
portp | 2470 | drivers/char/stallion.c | stl_setreg(portp, LIVR, (i << 3)); |
portp | 2471 | drivers/char/stallion.c | panelp->ports[i] = portp; |