···735735 for (j = 0; j < STL_MAXPORTS; j++) {736736 portp = brdp->ports[j];737737 if (portp != NULL) {738738- if (portp->tty != NULL)739739- tty_hangup(portp->tty);738738+ if (portp->port.tty != NULL)739739+ tty_hangup(portp->port.tty);740740 kfree(portp);741741 }742742 }···811811 * The sleep here does not need interrupt protection since the wakeup812812 * for it is done with the same context.813813 */814814- if (portp->flags & ASYNC_CLOSING) {815815- interruptible_sleep_on(&portp->close_wait);816816- if (portp->flags & ASYNC_HUP_NOTIFY)814814+ if (portp->port.flags & ASYNC_CLOSING) {815815+ interruptible_sleep_on(&portp->port.close_wait);816816+ if (portp->port.flags & ASYNC_HUP_NOTIFY)817817 return -EAGAIN;818818 return -ERESTARTSYS;819819 }···824824 * requires several commands to the board we will need to wait for any825825 * other open that is already initializing the port.826826 */827827- portp->tty = tty;827827+ portp->port.tty = tty;828828 tty->driver_data = portp;829829 portp->refcount++;830830···833833 if (signal_pending(current))834834 return -ERESTARTSYS;835835836836- if ((portp->flags & ASYNC_INITIALIZED) == 0) {836836+ if ((portp->port.flags & ASYNC_INITIALIZED) == 0) {837837 set_bit(ST_INITIALIZING, &portp->state);838838 if ((rc = stli_initopen(brdp, portp)) >= 0) {839839- portp->flags |= ASYNC_INITIALIZED;839839+ portp->port.flags |= ASYNC_INITIALIZED;840840 clear_bit(TTY_IO_ERROR, &tty->flags);841841 }842842 clear_bit(ST_INITIALIZING, &portp->state);···851851 * The sleep here does not need interrupt protection since the wakeup852852 * for it is done with the same context.853853 */854854- if (portp->flags & ASYNC_CLOSING) {855855- interruptible_sleep_on(&portp->close_wait);856856- if (portp->flags & ASYNC_HUP_NOTIFY)854854+ if (portp->port.flags & ASYNC_CLOSING) {855855+ interruptible_sleep_on(&portp->port.close_wait);856856+ if (portp->port.flags & ASYNC_HUP_NOTIFY)857857 return -EAGAIN;858858 return -ERESTARTSYS;859859 }···867867 if ((rc = stli_waitcarrier(brdp, portp, filp)) != 0)868868 return rc;869869 }870870- portp->flags |= ASYNC_NORMAL_ACTIVE;870870+ portp->port.flags |= ASYNC_NORMAL_ACTIVE;871871 return 0;872872}873873···895895 return;896896 }897897898898- portp->flags |= ASYNC_CLOSING;898898+ portp->port.flags |= ASYNC_CLOSING;899899900900/*901901 * May want to wait for data to drain before closing. The BUSY flag···911911 if (portp->closing_wait != ASYNC_CLOSING_WAIT_NONE)912912 tty_wait_until_sent(tty, portp->closing_wait);913913914914- portp->flags &= ~ASYNC_INITIALIZED;914914+ portp->port.flags &= ~ASYNC_INITIALIZED;915915 brdp = stli_brds[portp->brdnr];916916 stli_rawclose(brdp, portp, 0, 0);917917 if (tty->termios->c_cflag & HUPCL) {···931931 stli_flushbuffer(tty);932932933933 tty->closing = 0;934934- portp->tty = NULL;934934+ portp->port.tty = NULL;935935936936 if (portp->openwaitcnt) {937937 if (portp->close_delay)938938 msleep_interruptible(jiffies_to_msecs(portp->close_delay));939939- wake_up_interruptible(&portp->open_wait);939939+ wake_up_interruptible(&portp->port.open_wait);940940 }941941942942- portp->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);943943- wake_up_interruptible(&portp->close_wait);942942+ portp->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);943943+ wake_up_interruptible(&portp->port.close_wait);944944}945945946946/*****************************************************************************/···970970 sizeof(asynotify_t), 0)) < 0)971971 return rc;972972973973- tty = portp->tty;973973+ tty = portp->port.tty;974974 if (tty == NULL)975975 return -ENODEV;976976 stli_mkasyport(portp, &aport, tty->termios);···1169116911701170 if (portp == NULL)11711171 return -ENODEV;11721172- if (portp->tty == NULL)11721172+ if (portp->port.tty == NULL)11731173 return -ENODEV;11741174 if (portp->brdnr >= stli_nrbrds)11751175 return -ENODEV;···11771177 if (brdp == NULL)11781178 return -ENODEV;1179117911801180- stli_mkasyport(portp, &aport, portp->tty->termios);11801180+ stli_mkasyport(portp, &aport, portp->port.tty->termios);11811181 return(stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0));11821182}11831183···11961196 rc = 0;11971197 doclocal = 0;1198119811991199- if (portp->tty->termios->c_cflag & CLOCAL)11991199+ if (portp->port.tty->termios->c_cflag & CLOCAL)12001200 doclocal++;1201120112021202 spin_lock_irqsave(&stli_lock, flags);···12111211 &portp->asig, sizeof(asysigs_t), 0)) < 0)12121212 break;12131213 if (tty_hung_up_p(filp) ||12141214- ((portp->flags & ASYNC_INITIALIZED) == 0)) {12151215- if (portp->flags & ASYNC_HUP_NOTIFY)12141214+ ((portp->port.flags & ASYNC_INITIALIZED) == 0)) {12151215+ if (portp->port.flags & ASYNC_HUP_NOTIFY)12161216 rc = -EBUSY;12171217 else12181218 rc = -ERESTARTSYS;12191219 break;12201220 }12211221- if (((portp->flags & ASYNC_CLOSING) == 0) &&12211221+ if (((portp->port.flags & ASYNC_CLOSING) == 0) &&12221222 (doclocal || (portp->sigs & TIOCM_CD))) {12231223 break;12241224 }···12261226 rc = -ERESTARTSYS;12271227 break;12281228 }12291229- interruptible_sleep_on(&portp->open_wait);12291229+ interruptible_sleep_on(&portp->port.open_wait);12301230 }1231123112321232 spin_lock_irqsave(&stli_lock, flags);···15481548 sio.type = PORT_UNKNOWN;15491549 sio.line = portp->portnr;15501550 sio.irq = 0;15511551- sio.flags = portp->flags;15511551+ sio.flags = portp->port.flags;15521552 sio.baud_base = portp->baud_base;15531553 sio.close_delay = portp->close_delay;15541554 sio.closing_wait = portp->closing_wait;···15831583 if ((sio.baud_base != portp->baud_base) ||15841584 (sio.close_delay != portp->close_delay) ||15851585 ((sio.flags & ~ASYNC_USR_MASK) !=15861586- (portp->flags & ~ASYNC_USR_MASK)))15861586+ (portp->port.flags & ~ASYNC_USR_MASK)))15871587 return -EPERM;15881588 } 1589158915901590- portp->flags = (portp->flags & ~ASYNC_USR_MASK) |15901590+ portp->port.flags = (portp->port.flags & ~ASYNC_USR_MASK) |15911591 (sio.flags & ASYNC_USR_MASK);15921592 portp->baud_base = sio.baud_base;15931593 portp->close_delay = sio.close_delay;···17511751 if ((old->c_cflag & CRTSCTS) && ((tiosp->c_cflag & CRTSCTS) == 0))17521752 tty->hw_stopped = 0;17531753 if (((old->c_cflag & CLOCAL) == 0) && (tiosp->c_cflag & CLOCAL))17541754- wake_up_interruptible(&portp->open_wait);17541754+ wake_up_interruptible(&portp->port.open_wait);17551755}1756175617571757/*****************************************************************************/···18341834 if (brdp == NULL)18351835 return;1836183618371837- portp->flags &= ~ASYNC_INITIALIZED;18371837+ portp->port.flags &= ~ASYNC_INITIALIZED;1838183818391839 if (!test_bit(ST_CLOSING, &portp->state))18401840 stli_rawclose(brdp, portp, 0, 0);···18551855 clear_bit(ST_TXBUSY, &portp->state);18561856 clear_bit(ST_RXSTOP, &portp->state);18571857 set_bit(TTY_IO_ERROR, &tty->flags);18581858- portp->tty = NULL;18591859- portp->flags &= ~ASYNC_NORMAL_ACTIVE;18581858+ portp->port.tty = NULL;18591859+ portp->port.flags &= ~ASYNC_NORMAL_ACTIVE;18601860 portp->refcount = 0;18611861 spin_unlock_irqrestore(&stli_lock, flags);1862186218631863- wake_up_interruptible(&portp->open_wait);18631863+ wake_up_interruptible(&portp->port.open_wait);18641864}1865186518661866/*****************************************************************************/···2188218821892189 if (test_bit(ST_RXSTOP, &portp->state))21902190 return;21912191- tty = portp->tty;21912191+ tty = portp->port.tty;21922192 if (tty == NULL)21932193 return;21942194···23622362 if (ap->notify) {23632363 nt = ap->changed;23642364 ap->notify = 0;23652365- tty = portp->tty;23652365+ tty = portp->port.tty;2366236623672367 if (nt.signal & SG_DCD) {23682368 oldsigs = portp->sigs;···23702370 clear_bit(ST_GETSIGS, &portp->state);23712371 if ((portp->sigs & TIOCM_CD) &&23722372 ((oldsigs & TIOCM_CD) == 0))23732373- wake_up_interruptible(&portp->open_wait);23732373+ wake_up_interruptible(&portp->port.open_wait);23742374 if ((oldsigs & TIOCM_CD) &&23752375 ((portp->sigs & TIOCM_CD) == 0)) {23762376- if (portp->flags & ASYNC_CHECK_CD) {23762376+ if (portp->port.flags & ASYNC_CHECK_CD) {23772377 if (tty)23782378 tty_hangup(tty);23792379 }···23922392 if ((nt.data & DT_RXBREAK) && (portp->rxmarkmsk & BRKINT)) {23932393 if (tty != NULL) {23942394 tty_insert_flip_char(tty, 0, TTY_BREAK);23952395- if (portp->flags & ASYNC_SAK) {23952395+ if (portp->port.flags & ASYNC_SAK) {23962396 do_SAK(tty);23972397 EBRDENABLE(brdp);23982398 }···25422542/*25432543 * Start of by setting the baud, char size, parity and stop bit info.25442544 */25452545- pp->baudout = tty_get_baud_rate(portp->tty);25452545+ pp->baudout = tty_get_baud_rate(portp->port.tty);25462546 if ((tiosp->c_cflag & CBAUD) == B38400) {25472547- if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)25472547+ if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)25482548 pp->baudout = 57600;25492549- else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)25492549+ else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)25502550 pp->baudout = 115200;25512551- else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)25512551+ else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)25522552 pp->baudout = 230400;25532553- else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)25532553+ else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)25542554 pp->baudout = 460800;25552555- else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)25552555+ else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)25562556 pp->baudout = (portp->baud_base / portp->custom_divisor);25572557 }25582558 if (pp->baudout > STL_MAXBAUD)···26252625 * Set up clocal processing as required.26262626 */26272627 if (tiosp->c_cflag & CLOCAL)26282628- portp->flags &= ~ASYNC_CHECK_CD;26282628+ portp->port.flags &= ~ASYNC_CHECK_CD;26292629 else26302630- portp->flags |= ASYNC_CHECK_CD;26302630+ portp->port.flags |= ASYNC_CHECK_CD;2631263126322632/*26332633 * Transfer any persistent flags into the asyport structure.···27032703 portp->baud_base = STL_BAUDBASE;27042704 portp->close_delay = STL_CLOSEDELAY;27052705 portp->closing_wait = 30 * HZ;27062706- init_waitqueue_head(&portp->open_wait);27072707- init_waitqueue_head(&portp->close_wait);27062706+ init_waitqueue_head(&portp->port.open_wait);27072707+ init_waitqueue_head(&portp->port.close_wait);27082708 init_waitqueue_head(&portp->raw_wait);27092709 panelport++;27102710 if (panelport >= brdp->panels[panelnr]) {···42464246 stli_comstats.panel = portp->panelnr;42474247 stli_comstats.port = portp->portnr;42484248 stli_comstats.state = portp->state;42494249- stli_comstats.flags = portp->flags;42494249+ stli_comstats.flags = portp->port.flag;4250425042514251 spin_lock_irqsave(&brd_lock, flags);42524252- if (portp->tty != NULL) {42534253- if (portp->tty->driver_data == portp) {42544254- stli_comstats.ttystate = portp->tty->flags;42524252+ if (portp->port.tty != NULL) {42534253+ if (portp->port.tty->driver_data == portp) {42544254+ stli_comstats.ttystate = portp->port.tty->flags;42554255 stli_comstats.rxbuffered = -1;42564256- if (portp->tty->termios != NULL) {42574257- stli_comstats.cflags = portp->tty->termios->c_cflag;42584258- stli_comstats.iflags = portp->tty->termios->c_iflag;42594259- stli_comstats.oflags = portp->tty->termios->c_oflag;42604260- stli_comstats.lflags = portp->tty->termios->c_lflag;42564256+ if (portp->port.tty->termios != NULL) {42574257+ stli_comstats.cflags = portp->port.tty->termios->c_cflag;42584258+ stli_comstats.iflags = portp->port.tty->termios->c_iflag;42594259+ stli_comstats.oflags = portp->port.tty->termios->c_oflag;42604260+ stli_comstats.lflags = portp->port.tty->termios->c_lflag;42614261 }42624262 }42634263 }
+1-5
include/linux/istallion.h
···5151 */5252struct stliport {5353 unsigned long magic;5454+ struct tty_port port;5455 unsigned int portnr;5556 unsigned int panelnr;5657 unsigned int brdnr;5758 unsigned long state;5859 unsigned int devnr;5959- int flags;6060 int baud_base;6161 int custom_divisor;6262 int close_delay;6363 int closing_wait;6464- int refcount;6564 int openwaitcnt;6665 int rc;6766 int argsize;6867 void *argp;6968 unsigned int rxmarkmsk;7070- struct tty_struct *tty;7171- wait_queue_head_t open_wait;7272- wait_queue_head_t close_wait;7369 wait_queue_head_t raw_wait;7470 struct asysigs asig;7571 unsigned long addr;