您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tty_hangup函数代码示例

51自学网 2021-06-03 09:00:23
  C++
这篇教程C++ tty_hangup函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tty_hangup函数的典型用法代码示例。如果您正苦于以下问题:C++ tty_hangup函数的具体用法?C++ tty_hangup怎么用?C++ tty_hangup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tty_hangup函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gserial_disconnect

/** * gserial_disconnect - notify TTY I/O glue that USB link is inactive * @gser: the function, on which gserial_connect() was called * Context: any (usually from irq) * * This is called to deactivate endpoints and let the TTY layer know * that the connection went inactive ... not unlike "hangup". * * On return, the state is as if gserial_connect() had never been called; * there is no active USB I/O on these endpoints. */void gserial_disconnect(struct gserial *gser){	struct gs_port	*port = gser->ioport;	unsigned long	flags;	pr_vdebug("%s/n", __func__);	if (!port)		return;	/* tell the TTY glue not to do I/O here any more */	spin_lock_irqsave(&port->port_lock, flags);	/* REVISIT as above: how best to track this? */	port->port_line_coding = gser->port_line_coding;	port->port_usb = NULL;	gser->ioport = NULL;#if 0	if (port->open_count > 0 || port->openclose) {		wake_up_interruptible(&port->drain_wait);		if (port->port_tty)			tty_hangup(port->port_tty);	}#endif	spin_unlock_irqrestore(&port->port_lock, flags);	/* disable endpoints, aborting down any active I/O */	usb_ep_fifo_flush(gser->out);	usb_ep_fifo_flush(gser->in);	usb_ep_disable(gser->out);	gser->out->driver_data = NULL;	usb_ep_disable(gser->in);	gser->in->driver_data = NULL;	/* finally, free any unused/unusable I/O buffers */	spin_lock_irqsave(&port->port_lock, flags);	if (port->open_count == 0 && !port->openclose)		gs_buf_free(&port->port_write_buf);	gs_free_requests(gser->out, &port->read_pool);	gs_free_requests(gser->out, &port->read_queue);	gs_free_requests(gser->in, &port->write_pool);	spin_unlock_irqrestore(&port->port_lock, flags);}
开发者ID:morristech,项目名称:Dorimanx-HD2-2.6.32.X,代码行数:55,


示例2: capincci_free

static void capincci_free(struct capidev *cdev, __u32 ncci){	struct capincci *np, **pp;#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE	struct capiminor *mp;#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */	pp=&cdev->nccis;	while (*pp) {		np = *pp;		if (ncci == 0xffffffff || np->ncci == ncci) {			*pp = (*pp)->next;#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE			if ((mp = np->minorp) != 0) {#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)				capifs_free_ncci('r', mp->minor);				capifs_free_ncci(0, mp->minor);#endif				if (mp->tty) {					mp->nccip = 0;#ifdef _DEBUG_REFCOUNT					printk(KERN_DEBUG "reset mp->nccip/n");#endif					tty_hangup(mp->tty);				} else if (mp->file) {					mp->nccip = 0;#ifdef _DEBUG_REFCOUNT					printk(KERN_DEBUG "reset mp->nccip/n");#endif					wake_up_interruptible(&mp->recvwait);					wake_up_interruptible(&mp->sendwait);				} else {					capiminor_free(mp);				}			}#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */			kmem_cache_free(capincci_cachep, np);			if (*pp == 0) return;		} else {			pp = &(*pp)->next;		}	}}
开发者ID:zipangotes,项目名称:DSL-G624T_GPL_code,代码行数:43,


示例3: ctc_tty_setcarrier

voidctc_tty_setcarrier(struct net_device *netdev, int on){	int i;	DBF_TEXT(trace, 4, __FUNCTION__);	if ((!driver) || ctc_tty_shuttingdown)		return;	for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)		if (driver->info[i].netdev == netdev) {			ctc_tty_info *info = &driver->info[i];			if (on)				info->msr |= UART_MSR_DCD;			else				info->msr &= ~UART_MSR_DCD;			if ((info->flags & CTC_ASYNC_CHECK_CD) && (!on))				tty_hangup(info->tty);		}}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:19,


示例4: gserial_disconnect

/** * gserial_disconnect - notify TTY I/O glue that USB link is inactive * @gser: the function, on which gserial_connect() was called * Context: any (usually from irq) * * This is called to deactivate endpoints and let the TTY layer know * that the connection went inactive ... not unlike "hangup". * * On return, the state is as if gserial_connect() had never been called; * there is no active USB I/O on these endpoints. */void gserial_disconnect(struct gserial *gser){	struct gs_port	*port = gser->ioport;	unsigned long	flags;	if (!port)		return;	/* tell the TTY glue not to do I/O here any more */	spin_lock_irqsave(&port->port_lock, flags);	/* REVISIT as above: how best to track this? */	port->port_line_coding = gser->port_line_coding;	port->port_usb = NULL;	gser->ioport = NULL;	if (atomic_read(&port->port.count) > 0 || port->openclose) {		wake_up_interruptible(&port->drain_wait);		if (port->port.tty)			tty_hangup(port->port.tty);	}	spin_unlock_irqrestore(&port->port_lock, flags);	/* disable endpoints, aborting down any active I/O */	usb_ep_disable(gser->out);	gser->out->driver_data = NULL;	usb_ep_disable(gser->in);	gser->in->driver_data = NULL;	/* finally, free any unused/unusable I/O buffers */	spin_lock_irqsave(&port->port_lock, flags);	if (atomic_read(&port->port.count) == 0 && !port->openclose)		gs_buf_free(&port->port_write_buf);	gs_free_requests(gser->out, &port->read_pool, NULL);	gs_free_requests(gser->out, &port->read_queue, NULL);	gs_free_requests(gser->in, &port->write_pool, NULL);	port->read_allocated = port->read_started =		port->write_allocated = port->write_started = 0;	spin_unlock_irqrestore(&port->port_lock, flags);}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:54,


示例5: acm_disconnect

static void acm_disconnect(struct usb_interface *intf){	struct acm *acm = usb_get_intfdata(intf);	struct usb_device *usb_dev = interface_to_usbdev(intf);	mutex_lock(&open_mutex);	if (!acm || !acm->dev) {		mutex_unlock(&open_mutex);		return;	}	if (acm->country_codes){		device_remove_file(&acm->control->dev,				&dev_attr_wCountryCodes);		device_remove_file(&acm->control->dev,				&dev_attr_iCountryCodeRelDate);	}	device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities);	acm->dev = NULL;	usb_set_intfdata(acm->control, NULL);	usb_set_intfdata(acm->data, NULL);	stop_data_traffic(acm);	acm_write_buffers_free(acm);	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);	acm_read_buffers_free(acm);	usb_driver_release_interface(&acm_driver, intf == acm->control ?					acm->data : acm->control);	if (!acm->used) {		acm_tty_unregister(acm);		mutex_unlock(&open_mutex);		return;	}	mutex_unlock(&open_mutex);	if (acm->tty)		tty_hangup(acm->tty);}
开发者ID:IgnasD,项目名称:Tomato-RAF,代码行数:41,


示例6: tty_ioctl

int tty_ioctl(uint8_t minor, uint16_t request, char *data){				/* Data in User Space */	if (!minor)		minor = udata.u_ptab->p_tty;	if (minor < 1 || minor > NUM_DEV_TTY + 1) {		udata.u_error = ENODEV;		return -1;	}	if (deadflag[minor]) {	        udata.u_error = ENXIO;	        return -1;        }	switch (request) {	case TCGETS:		uput(&ttydata[minor], data, sizeof(struct termios));		break;	case TCSETSW:		/* We don't have an output queue really so for now drop		   through */	case TCSETS:	case TCSETSF:		uget(data, &ttydata[minor], sizeof(struct termios));		if (request == TCSETSF)			clrq(&ttyinq[minor]);                tty_setup(minor);		break;	case TIOCINQ:		uput(&ttyinq[minor].q_count, data, 2);		break;	case TIOCFLUSH:		clrq(&ttyinq[minor]);		break;        case TIOCHANGUP:                tty_hangup(minor);                return 0;	default:		udata.u_error = ENOTTY;		return (-1);	}	return (0);}
开发者ID:jfernand,项目名称:FUZIX,代码行数:41,


示例7: ipwireless_tty_notify_control_line_change

voidipwireless_tty_notify_control_line_change(struct ipw_tty *tty,					  unsigned int channel_idx,					  unsigned int control_lines,					  unsigned int changed_mask){	unsigned int old_control_lines = tty->control_lines;	tty->control_lines = (tty->control_lines & ~changed_mask)		| (control_lines & changed_mask);	/*	 * If DCD is de-asserted, we close the tty so pppd can tell that we	 * have gone offline.	 */	if ((old_control_lines & IPW_CONTROL_LINE_DCD)			&& !(tty->control_lines & IPW_CONTROL_LINE_DCD)			&& tty->linux_tty) {		tty_hangup(tty->linux_tty);	}}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:21,


示例8: usb_serial_handle_dcd_change

/** * usb_serial_handle_dcd_change - handle a change of carrier detect state * @port: usb-serial port * @tty: tty for the port * @status: new carrier detect status, nonzero if active */void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port,				struct tty_struct *tty, unsigned int status){	struct tty_port *port = &usb_port->port;	dev_dbg(&usb_port->dev, "%s - status %d/n", __func__, status);	if (tty) {		struct tty_ldisc *ld = tty_ldisc_ref(tty);		if (ld) {			if (ld->ops->dcd_change)				ld->ops->dcd_change(tty, status);			tty_ldisc_deref(ld);		}	}	if (status)		wake_up_interruptible(&port->open_wait);	else if (tty && !C_CLOCAL(tty))		tty_hangup(tty);}
开发者ID:atmark-techno,项目名称:linux-3.14-at,代码行数:28,


示例9: cctdev_release

int cctdev_release(struct inode *inode, struct file *filp){	struct cctdev_dev *dev = filp->private_data;	/* remove this filp from the asynchronously notified filp's */	cctdev_fasync(-1, filp, 0);	down(&dev->sem);	if (filp->f_mode & FMODE_READ)		dev->nreaders--;	if (filp->f_mode & FMODE_WRITE)		dev->nwriters--;	if (dev->nreaders == 0 && dev->nwriters == 0) {		int minor_num = MINOR(dev->cdev.dev);		struct citty_port *citty = citty_table[minor_num];		if (citty && citty->port->tty)			tty_hangup(citty->port->tty);	}	up(&dev->sem);	return 0;}
开发者ID:GalaxyTab4,项目名称:maxicm_kernel_samsung_degaswifi,代码行数:22,


示例10: ipw_disconnect

static void ipw_disconnect(struct usb_serial *serial){	struct usb_serial_port *port;	struct ipw_private *priv;	if (serial) {		port = &serial->port[0];		if (port->tty)			tty_hangup(port->tty);		priv = usb_get_serial_port_data(port);		kfree(priv);		usb_set_serial_port_data(port, NULL);		if (serial->dev) {                /* shutdown any bulk reads that might be going on */			if (serial->num_bulk_out)				usb_unlink_urb (port->write_urb);			if (serial->num_bulk_in)				usb_unlink_urb (port->read_urb);		}//2.6		usb_serial_generic_shutdown(serial);		kfree(serial);	}}
开发者ID:NieHao,项目名称:Tomato-RAF,代码行数:23,


示例11: check_modem_status

static void check_modem_status(struct serial_state *info){	struct tty_port *port = &info->tport;	unsigned char status = ciab.pra & (SER_DCD | SER_CTS | SER_DSR);	unsigned char dstatus;	struct	async_icount *icount;	/* Determine bits that have changed */	dstatus = status ^ current_ctl_bits;	current_ctl_bits = status;	if (dstatus) {		icount = &info->icount;		/* update input line counters */		if (dstatus & SER_DSR)			icount->dsr++;		if (dstatus & SER_DCD) {			icount->dcd++;#ifdef CONFIG_HARD_PPS			if ((port->flags & ASYNC_HARDPPS_CD) &&			    !(status & SER_DCD))				hardpps();#endif		}		if (dstatus & SER_CTS)			icount->cts++;		wake_up_interruptible(&port->delta_msr_wait);	}	if ((port->flags & ASYNC_CHECK_CD) && (dstatus & SER_DCD)) {#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))		printk("ttyS%d CD now %s...", info->line,		       (!(status & SER_DCD)) ? "on" : "off");#endif		if (!(status & SER_DCD))			wake_up_interruptible(&port->open_wait);		else {#ifdef SERIAL_DEBUG_OPEN			printk("doing serial hangup...");#endif			if (port->tty)				tty_hangup(port->tty);		}	}	if (port->flags & ASYNC_CTS_FLOW) {		if (port->tty->hw_stopped) {			if (!(status & SER_CTS)) {#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))				printk("CTS tx start...");#endif				port->tty->hw_stopped = 0;				info->IER |= UART_IER_THRI;				custom.intena = IF_SETCLR | IF_TBE;				mb();				/* set a pending Tx Interrupt, transmitter should restart now */				custom.intreq = IF_SETCLR | IF_TBE;				mb();				tty_wakeup(port->tty);				return;			}		} else {			if ((status & SER_CTS)) {#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))				printk("CTS tx stop...");#endif				port->tty->hw_stopped = 1;				info->IER &= ~UART_IER_THRI;				/* disable Tx interrupt and remove any pending interrupts */				custom.intena = IF_TBE;				mb();				custom.intreq = IF_TBE;				mb();			}		}	}}
开发者ID:kprog,项目名称:linux,代码行数:76,


示例12: a2232_vbl_inter

//.........这里部分代码省略.........						/* data types of bytes in ibuf */						cbuf = mem->InCtl[p]; 						/* do for all chars */						while (bufpos != newhead) {							/* which type of input data? */							switch (cbuf[bufpos]) {								/* switch on input event (CD, BREAK, etc.) */							case A2232INCTL_EVENT:								switch (ibuf[bufpos++]) {								case A2232EVENT_Break:									/* TODO: Handle BREAK signal */									break;									/*	A2232EVENT_CarrierOn and A2232EVENT_CarrierOff are										handled in a separate queue and should not occur here. */								case A2232EVENT_Sync:									printk("A2232: 65EC02 software sent SYNC event, don't know what to do. Ignoring.");									break;								default:									printk("A2232: 65EC02 software broken, unknown event type %d occurred./n",ibuf[bufpos-1]);								} /* event type switch */								break; 							case A2232INCTL_CHAR:								/* Receive incoming char */								a2232_receive_char(port, ibuf[bufpos], err);								bufpos++;								break; 							default:								printk("A2232: 65EC02 software broken, unknown data type %d occurred./n",cbuf[bufpos]);								bufpos++;							} /* switch on input data type */						} /* while there's something in the buffer */						status->InTail = bufpos;            /* tell 65EC02 what we've read */											} /* if there was something in the buffer */                          				} /* If input is not disabled */				/* Now check if there's something to output */				obuf = mem->OutBuf[p];				bufpos = status->OutHead;				while ( (port->gs.xmit_cnt > 0)		&&					(!port->gs.port.tty->stopped)	&&					(!port->gs.port.tty->hw_stopped) ){	/* While there are chars to transmit */					if (((bufpos+1) & A2232_IOBUFLENMASK) != status->OutTail) { /* If the A2232 buffer is not full */						ch = port->gs.xmit_buf[port->gs.xmit_tail];					/* get the next char to transmit */						port->gs.xmit_tail = (port->gs.xmit_tail+1) & (SERIAL_XMIT_SIZE-1); /* modulo-addition for the gs.xmit_buf ring-buffer */						obuf[bufpos++] = ch;																/* put it into the A2232 buffer */						port->gs.xmit_cnt--;					}					else{																									/* If A2232 the buffer is full */						break;																							/* simply stop filling it. */					}																	}									status->OutHead = bufpos;									/* WakeUp if output buffer runs low */				if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.port.tty) {					tty_wakeup(port->gs.port.tty);				}			} // if the port is used		} // for every port on the board					/* Now check the CD message queue */		newhead = mem->Common.CDHead;		bufpos = mem->Common.CDTail;		if (newhead != bufpos){				/* There are CD events in queue */			ocd = mem->Common.CDStatus; 		/* get old status bits */			while (newhead != bufpos){		/* read all events */				ncd = mem->CDBuf[bufpos++]; 	/* get one event */				ccd = ncd ^ ocd; 		/* mask of changed lines */				ocd = ncd; 			/* save new status bits */				for(p=0; p < NUMLINES; p++){	/* for all ports */					if (ccd & 1){		/* this one changed */						struct a2232_port *port = &a2232_ports[n*7+p];						port->cd_status = !(ncd & 1); /* ncd&1 <=> CD is now off */						if (!(port->gs.port.flags & ASYNC_CHECK_CD))							;	/* Don't report DCD changes */						else if (port->cd_status) { // if DCD on: DCD went UP!														/* Are we blocking in open?*/							wake_up_interruptible(&port->gs.port.open_wait);						}						else { // if DCD off: DCD went DOWN!							if (port->gs.port.tty)								tty_hangup (port->gs.port.tty);						}											} // if CD changed for this port					ccd >>= 1;					ncd >>= 1;									/* Shift bits for next line */				} // for every port			} // while CD events in queue			mem->Common.CDStatus = ocd; /* save new status */			mem->Common.CDTail = bufpos; /* remove events */		} // if events in CD queue			} // for every completely initialized A2232 board
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:101,


示例13: tty_ioctl

int tty_ioctl(uint8_t minor, uarg_t request, char *data){				/* Data in User Space */        struct tty *t;	if (minor > NUM_DEV_TTY + 1) {		udata.u_error = ENODEV;		return -1;	}        t = &ttydata[minor];	if (t->flag & TTYF_DEAD) {	        udata.u_error = ENXIO;	        return -1;        }        jobcontrol_in(minor, t);	switch (request) {	case TCGETS:		return uput(&t->termios, data, sizeof(struct termios));		break;	case TCSETSF:		clrq(&ttyinq[minor]);		/* Fall through for now */	case TCSETSW:		/* We don't have an output queue really so for now drop		   through */	case TCSETS:		if (uget(data, &t->termios, sizeof(struct termios)) == -1)		        return -1;                tty_setup(minor);		break;	case TIOCINQ:		return uput(&ttyinq[minor].q_count, data, 2);	case TIOCFLUSH:		clrq(&ttyinq[minor]);		break;        case TIOCHANGUP:                tty_hangup(minor);                return 0;	case TIOCOSTOP:		t->flag |= TTYF_STOP;		break;	case TIOCOSTART:		t->flag &= ~TTYF_STOP;		break;        case TIOCGWINSZ:                return uput(&t->winsize, data, sizeof(struct winsize));        case TIOCSWINSZ:                if (uget(&t->winsize, data, sizeof(struct winsize)))                        return -1;                sgrpsig(t->pgrp, SIGWINCH);                return 0;        case TIOCGPGRP:                return uputw(t->pgrp, data);#ifdef CONFIG_LEVEL_2        case TIOCSPGRP:                /* Only applicable via controlling terminal */                if (minor != udata.u_ptab->p_tty) {                        udata.u_error = ENOTTY;                        return -1;                }                return tcsetpgrp(t, data);#endif	default:		udata.u_error = ENOTTY;		return -1;	}	return 0;}
开发者ID:aralbrec,项目名称:FUZIX,代码行数:66,


示例14: RIOCommandRup

//.........这里部分代码省略.........			p->CdRegister = (readb(&PktCmdP->ModemStatus) & MSVR1_HOST);			break;		default:			subCommand = 0;			break;		}		if (subCommand)			break;		rio_dprintk(RIO_DEBUG_CMD, "New status is 0x%x was 0x%x/n", readb(&PktCmdP->PortStatus), PortP->PortState);		if (PortP->PortState != readb(&PktCmdP->PortStatus)) {			rio_dprintk(RIO_DEBUG_CMD, "Mark status & wakeup/n");			PortP->PortState = readb(&PktCmdP->PortStatus);			/* What should we do here ...			   wakeup( &PortP->PortState );			 */		} else			rio_dprintk(RIO_DEBUG_CMD, "No change/n");		/* FALLTHROUGH */	case MODEM_STATUS:		/*		 ** Knock out the tbusy and tstop bits, as these are not relevant		 ** to the check for modem status change (they're just there because		 ** it's a convenient place to put them!).		 */		ReportedModemStatus = readb(&PktCmdP->ModemStatus);		if ((PortP->ModemState & MSVR1_HOST) == (ReportedModemStatus & MSVR1_HOST)) {			rio_dprintk(RIO_DEBUG_CMD, "Modem status unchanged 0x%x/n", PortP->ModemState);			/*			 ** Update ModemState just in case tbusy or tstop states have			 ** changed.			 */			PortP->ModemState = ReportedModemStatus;		} else {			rio_dprintk(RIO_DEBUG_CMD, "Modem status change from 0x%x to 0x%x/n", PortP->ModemState, ReportedModemStatus);			PortP->ModemState = ReportedModemStatus;#ifdef MODEM_SUPPORT			if (PortP->Mapped) {				/***********************************************************/				*************************************************************				***													   ***				***		  M O D E M   S T A T E   C H A N G E		  ***				***													   ***				*************************************************************				/***********************************************************/				/*				 ** If the device is a modem, then check the modem				 ** carrier.				 */				if (PortP->gs.tty == NULL)					break;				if (PortP->gs.tty->termios == NULL)					break;				if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) && ((PortP->State & (RIO_MOPEN | RIO_WOPEN)))) {					rio_dprintk(RIO_DEBUG_CMD, "Is there a Carrier?/n");					/*					 ** Is there a carrier?					 */					if (PortP->ModemState & MSVR1_CD) {						/*						 ** Has carrier just appeared?						 */						if (!(PortP->State & RIO_CARR_ON)) {							rio_dprintk(RIO_DEBUG_CMD, "Carrier just came up./n");							PortP->State |= RIO_CARR_ON;							/*							 ** wakeup anyone in WOPEN							 */							if (PortP->State & (PORT_ISOPEN | RIO_WOPEN))								wake_up_interruptible(&PortP->gs.open_wait);						}					} else {						/*						 ** Has carrier just dropped?						 */						if (PortP->State & RIO_CARR_ON) {							if (PortP->State & (PORT_ISOPEN | RIO_WOPEN | RIO_MOPEN))								tty_hangup(PortP->gs.tty);							PortP->State &= ~RIO_CARR_ON;							rio_dprintk(RIO_DEBUG_CMD, "Carrirer just went down/n");						}					}				}			}#endif		}		break;	default:		rio_dprintk(RIO_DEBUG_CMD, "Unknown command %d on CMD_RUP of host %Zd/n", readb(&PktCmdP->Command), HostP - p->RIOHosts);		break;	}	rio_spin_unlock_irqrestore(&PortP->portSem, flags);	func_exit();	return 1;}
开发者ID:Einheri,项目名称:wl500g,代码行数:101,


示例15: acm_ctrl_irq

/* control interface reports status changes with "interrupt" transfers */static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs){	struct acm *acm = urb->context;	struct usb_ctrlrequest *dr = urb->transfer_buffer;	unsigned char *data = (unsigned char *)(dr + 1);	int newctrl;	int status;	switch (urb->status) {	case 0:		/* success */		break;	case -ECONNRESET:	case -ENOENT:	case -ESHUTDOWN:		/* this urb is terminated, clean up */		dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);		return;	default:		dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);		goto exit;	}	if (!ACM_READY(acm))		goto exit;	switch (dr->bRequest) {		case ACM_IRQ_NETWORK:			dbg("%s network", dr->wValue ? "connected to" : "disconnected from");			break;		case ACM_IRQ_LINE_STATE:			newctrl = le16_to_cpup((__u16 *) data);			if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) {				dbg("calling hangup");				tty_hangup(acm->tty);			}			acm->ctrlin = newctrl;			dbg("input control lines: dcd%c dsr%c break%c ring%c framing%c parity%c overrun%c",				acm->ctrlin & ACM_CTRL_DCD ? '+' : '-',	acm->ctrlin & ACM_CTRL_DSR ? '+' : '-',				acm->ctrlin & ACM_CTRL_BRK ? '+' : '-',	acm->ctrlin & ACM_CTRL_RI  ? '+' : '-',				acm->ctrlin & ACM_CTRL_FRAMING ? '+' : '-',	acm->ctrlin & ACM_CTRL_PARITY ? '+' : '-',				acm->ctrlin & ACM_CTRL_OVERRUN ? '+' : '-');			break;		default:			dbg("unknown control event received: request %d index %d len %d data0 %d data1 %d",				dr->bRequest, dr->wIndex, dr->wLength, data[0], data[1]);			break;	}exit:	status = usb_submit_urb (urb, GFP_ATOMIC);	if (status)		err ("%s - usb_submit_urb failed with result %d",		     __FUNCTION__, status);}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:64,


示例16: tty_carrier_drop

void tty_carrier_drop(uint8_t minor){        if (ttydata[minor].c_cflag & HUPCL)                tty_hangup(minor);}
开发者ID:jfernand,项目名称:FUZIX,代码行数:5,


示例17: sysbef

//.........这里部分代码省略.........      if (*befbuf)      {        if (m.ttydevice > 1)          putf_tty("%s/r", befbuf);        else          putf(ms(m_nomodem));      }      else        putf("Syntax: TTYCMD <command>/n");    } break;    case ttydial:    {      strupr(befbuf);      char *nummer;      char call[8];      nummer = nexttoken(befbuf, call, 8);      if (*befbuf && mbcallok(call))      {        if (m.ttydevice            && (get_ufwd(call)[0] || isforwardpartner(call) >= 0))        {          putf(ms(m_startphonefwd), call, nummer);          sprintf(befbuf, "%s TTY %s", call, nummer);          fork(P_BACK | P_MAIL, 0, fwdsend, befbuf);        }        else          putf(ms(m_nottyactive));      }      else        putf("Syntax: TTYDIAL <call> <number>/n");    } break;    case ttyhangup:    {      tty_hangup();      putf(ms(m_hangupmodem));    } break;    case ttystatus:    {      tty_statustext();      putv(LF);    } break;    case ttywin_:    {      fork(P_WIND | P_MAIL, 0, tty_win, befbuf);    } break;    case ttycounterreset:    {      tty_counterreset();      putv(LF);    } break;#endif#ifdef _FILEFWD    case fwdimport:    {      if (*befbuf) fwd_import(befbuf);    } break;    case fwdexport:    {      if (*befbuf) fwd_export(befbuf);    } break;#endif    case ymbtest:    {#ifdef _USERCOMP      if (u->comp == 1)
开发者ID:donzelot,项目名称:openBCM,代码行数:67,


示例18: acm_ctrl_irq

/* control interface reports status changes with "interrupt" transfers */static void acm_ctrl_irq(struct urb *urb){	struct acm *acm = urb->context;	struct usb_cdc_notification *dr = urb->transfer_buffer;	unsigned char *data;	int newctrl;	int retval;	int status = urb->status;	switch (status) {	case 0:		/* success */		break;	case -ECONNRESET:	case -ENOENT:	case -ESHUTDOWN:		/* this urb is terminated, clean up */		dbg("%s - urb shutting down with status: %d", __FUNCTION__, status);		return;	default:		dbg("%s - nonzero urb status received: %d", __FUNCTION__, status);		goto exit;	}	if (!ACM_READY(acm))		goto exit;	data = (unsigned char *)(dr + 1);	switch (dr->bNotificationType) {		case USB_CDC_NOTIFY_NETWORK_CONNECTION:			dbg("%s network", dr->wValue ? "connected to" : "disconnected from");			break;		case USB_CDC_NOTIFY_SERIAL_STATE:			newctrl = le16_to_cpu(get_unaligned((__le16 *) data));			if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) {				dbg("calling hangup");				tty_hangup(acm->tty);			}			acm->ctrlin = newctrl;			dbg("input control lines: dcd%c dsr%c break%c ring%c framing%c parity%c overrun%c",				acm->ctrlin & ACM_CTRL_DCD ? '+' : '-',	acm->ctrlin & ACM_CTRL_DSR ? '+' : '-',				acm->ctrlin & ACM_CTRL_BRK ? '+' : '-',	acm->ctrlin & ACM_CTRL_RI  ? '+' : '-',				acm->ctrlin & ACM_CTRL_FRAMING ? '+' : '-',	acm->ctrlin & ACM_CTRL_PARITY ? '+' : '-',				acm->ctrlin & ACM_CTRL_OVERRUN ? '+' : '-');			break;		default:			dbg("unknown notification %d received: index %d len %d data0 %d data1 %d",				dr->bNotificationType, dr->wIndex,				dr->wLength, data[0], data[1]);			break;	}exit:	usb_mark_last_busy(acm->dev);	retval = usb_submit_urb (urb, GFP_ATOMIC);	if (retval)		err ("%s - usb_submit_urb failed with result %d",		     __FUNCTION__, retval);}
开发者ID:IgnasD,项目名称:Tomato-RAF,代码行数:68,



注:本文中的tty_hangup函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ tty_init函数代码示例
C++ tty_get_baud_rate函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。