kernels/linux-2.4.0/drivers/usb/acm.c
/*
 * Interrupt handler for various ACM control events
 */
Interrupt handler for various ACM control events
Interrupt handler for various ACM control events
static void acm_ctrl_irq(struct urb *urb)
{
	struct acm *acm = urb->context;
	devrequest *dr = urb->transfer_buffer;
	unsigned char *data = (unsigned char *)(dr + 1);
	int newctrl;
	if (!ACM_READY(acm)) return;
	if (urb->status < 0) {
		dbg("nonzero ctrl irq status received: %d", urb->status);
		return;
	}
	switch (dr->request) {
		case ACM_IRQ_NETWORK:
			dbg("%s network", data[0] ? "connected to" : "disconnected from");
			return;
		case ACM_IRQ_LINE_STATE:
			newctrl = le16_to_cpup((__u16 *) data);
#if 0
			if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) {
				dbg("calling hangup");
				tty_hangup(acm->tty);
			}
#endif
			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 ? '+' : '-');
			return;
		default:
			dbg("unknown control event received: request %d index %d len %d data0 %d data1 %d",
				dr->request, dr->index, dr->length, data[0], data[1]);
			return;
	}
}
static void acm_ctrl_irq ( struct urb * urb ) { struct acm * acm = urb -> context ; devrequest * dr = urb -> transfer_buffer ; unsigned char * data = ( unsigned char * ) ( dr + 1 ) ; int newctrl ; if ( ! ACM_READY ( acm ) ) return ; if ( urb -> status < 0 ) { dbg ( " " , urb -> status ) ; return ; } switch ( dr -> request ) { case ACM_IRQ_NETWORK : dbg ( " " , data [ 0 ] ? " " : " " ) ; return ; case ACM_IRQ_LINE_STATE : newctrl = le16_to_cpup ( ( __u16 * ) data ) ; #if 0 if ( acm -> tty && ! acm -> clocal && ( acm -> ctrlin & ~ newctrl & ACM_CTRL_DCD ) ) { dbg ( " " ) ; tty_hangup ( acm -> tty ) ; } #endif acm -> ctrlin = newctrl ; dbg ( " " , 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 ? ' ' : ' ' ) ; return ; default : dbg ( " " , dr -> request , dr -> index , dr -> length , data [ 0 ] , data [ 1 ] ) ; return ; } }
Interrupt handler for various ACM control events
Interrupt handler for various ACM control events
/* Please someone tell me how to do this properly to kill pppd and not kill minicom */