usb_clear_halt(serial->dev, port->write_urb->pipe); usb_clear_halt(serial->dev, port->read_urb->pipe); 
if (priv->type != HX) { usb_clear_halt(serial->dev, port->write_urb->pipe); usb_clear_halt(serial->dev, port->read_urb->pipe); } 
static int pl2303_open (struct usb_serial_port *port, struct file *filp){	struct termios tmp_termios;	struct usb_serial *serial = port->serial;	struct pl2303_private *priv = usb_get_serial_port_data(port);	unsigned char *buf;	int result;	dbg("%s -  port %d", __FUNCTION__, port->number);	usb_clear_halt(serial->dev, port->write_urb->pipe);	usb_clear_halt(serial->dev, port->read_urb->pipe);	buf = kmalloc(10, GFP_KERNEL);	if (buf==NULL)		return -ENOMEM;#define FISH(a,b,c,d)								\	result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0),	\			       b, a, c, d, buf, 1, 100);			\	dbg("0x%x:0x%x:0x%x:0x%x  %d - %x",a,b,c,d,result,buf[0]);#define SOUP(a,b,c,d)								\	result=usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0),	\			       b, a, c, d, NULL, 0, 100);			\	dbg("0x%x:0x%x:0x%x:0x%x  %d",a,b,c,d,result);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 0);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0);	if (priv->type == HX) {		/* HX chip */		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x44);		/* reset upstream data pipes */          	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 8, 0);        	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 9, 0);	} else {		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x24);	}	kfree(buf);	/* Setup termios */	if (port->tty) {		pl2303_set_termios (port, &tmp_termios);	}	//FIXME: need to assert RTS and DTR if CRTSCTS off	dbg("%s - submitting read urb", __FUNCTION__);	port->read_urb->dev = serial->dev;	result = usb_submit_urb (port->read_urb, GFP_KERNEL);	if (result) {		dev_err(&port->dev, "%s - failed submitting read urb, error %d\n", __FUNCTION__, result);		pl2303_close (port, NULL);		return -EPROTO;	}	dbg("%s - submitting interrupt urb", __FUNCTION__);	port->interrupt_in_urb->dev = serial->dev;	result = usb_submit_urb (port->interrupt_in_urb, GFP_KERNEL);	if (result) {		dev_err(&port->dev, "%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result);		pl2303_close (port, NULL);		return -EPROTO;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1694899fd1af43636351aac97f415fd3c9cefb1d/pl2303.c/buggy/drivers/usb/serial/pl2303.c