diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-03 16:05:16 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-03 16:05:16 -0800 |
| commit | 94f61e3d1a2b191b34a98a179285a98542ad24a0 (patch) | |
| tree | ee9ea13baf23fce114ec35253b5f8a65bca99d23 | |
| parent | 666f6ecc7efc5e7a65f092d8f6e15eb5a2022ede (diff) | |
| download | patches-94f61e3d1a2b191b34a98a179285a98542ad24a0.tar.gz | |
more patches
| -rw-r--r-- | f1.patch | 732 | ||||
| -rw-r--r-- | f2.patch | 969 | ||||
| -rw-r--r-- | series | 2 |
3 files changed, 1703 insertions, 0 deletions
diff --git a/f1.patch b/f1.patch new file mode 100644 index 00000000000000..1c5c308eaf3fb4 --- /dev/null +++ b/f1.patch @@ -0,0 +1,732 @@ +--- + drivers/staging/uc2322/aten2011.c | 241 +++++++++++++++----------------------- + 1 file changed, 99 insertions(+), 142 deletions(-) + +--- a/drivers/staging/uc2322/aten2011.c ++++ b/drivers/staging/uc2322/aten2011.c +@@ -117,9 +117,8 @@ struct ATENINTL_port + __u8 SpRegOffset; + __u8 ControlRegOffset; + __u8 DcrRegOffset; +- //for processing control URBS in interrupt context ++ /* for processing control URBS in interrupt context */ + struct urb *control_urb; +- // __le16 rx_creg; + char *ctrl_buf; + int MsrLsr; + +@@ -141,10 +140,10 @@ struct ATENINTL_serial + struct urb *read_urb; /* our bulk read urb */ + __u8 bulk_out_endpoint; /* the bulk out endpoint handle */ + struct usb_serial *serial; /* loop back to the owner of this object */ +- int ATEN2011_spectrum_2or4ports; //this says the number of ports in the device +- // Indicates about the no.of opened ports of an individual USB-serial adapater. ++ int ATEN2011_spectrum_2or4ports; /* this says the number of ports in the device */ ++ /* Indicates about the no.of opened ports of an individual USB-serial adapater. */ + unsigned int NoOfOpenPorts; +- // a flag for Status endpoint polling ++ /* a flag for Status endpoint polling */ + unsigned char status_polling_started; + }; + +@@ -350,11 +349,10 @@ static int handle_newLsr(struct ATENINTL + dbg("%s - %02x", __FUNCTION__, newLsr); + + if (newLsr & SERIAL_LSR_BI) { +- // +- // Parity and Framing errors only count if they +- // occur exclusive of a break being +- // received. +- // ++ /* ++ * Parity and Framing errors only count if they occur exclusive ++ * of a break being received. ++ */ + newLsr &= (__u8) (SERIAL_LSR_OE | SERIAL_LSR_BI); + } + +@@ -430,11 +428,10 @@ static int ATEN2011_get_reg(struct ATENI + int ret = 0; + buffer = (__u8 *) ATEN->ctrl_buf; + +-// dr=(struct usb_ctrlrequest *)(buffer); + dr = (void *)(buffer + 2); + dr->bRequestType = ATEN_RD_RTYPE; + dr->bRequest = ATEN_RDREQ; +- dr->wValue = cpu_to_le16(Wval); //0; ++ dr->wValue = cpu_to_le16(Wval); + dr->wIndex = cpu_to_le16(reg); + dr->wLength = cpu_to_le16(2); + +@@ -459,12 +456,11 @@ static void ATEN2011_interrupt_callback( + int i; + __u16 wval; + int minor; +- //printk("in the function ATEN2011_interrupt_callback Length %d, Data %x \n",urb->actual_length,(unsigned int)urb->transfer_buffer); ++ + DPRINTK("%s", " : Entering\n"); + + ATEN2011_serial = (struct ATENINTL_serial *)urb->context; +- if (!urb) // || ATEN2011_serial->status_polling_started == 0 ) +- { ++ if (!urb) { + DPRINTK("%s", "Invalid Pointer !!!!:\n"); + return; + } +@@ -488,7 +484,6 @@ static void ATEN2011_interrupt_callback( + length = urb->actual_length; + data = urb->transfer_buffer; + +- //ATEN2011_serial= (struct ATENINTL_serial *)urb->context; + serial = ATEN2011_serial->serial; + + /* ATENINTL get 5 bytes +@@ -513,12 +508,11 @@ static void ATEN2011_interrupt_callback( + } else { + sp[0] = (__u8) data[0]; + sp[1] = (__u8) data[2]; +- //sp[2]=(__u8)data[2]; +- //sp[3]=(__u8)data[3]; ++ /* sp[2]=(__u8)data[2]; */ ++ /* sp[3]=(__u8)data[3]; */ + st = (__u8) data[4]; + + } +- // printk("%s data is sp1:%x sp2:%x sp3:%x sp4:%x status:%x\n",__FUNCTION__,sp1,sp2,sp3,sp4,st); + for (i = 0; i < serial->num_ports; i++) { + ATEN2011_port = usb_get_serial_port_data(serial->port[i]); + minor = serial->minor; +@@ -534,8 +528,6 @@ static void ATEN2011_interrupt_callback( + (((__u16) serial->port[i]->number - + (__u16) (minor)) + 1) << 8; + if (ATEN2011_port->open != 0) { +- //printk("%s wval is:(for 2011) %x\n",__FUNCTION__,wval); +- + if (sp[i] & 0x01) { + DPRINTK("SP%d No Interrupt !!!\n", i); + } else { +@@ -596,8 +588,6 @@ static void ATEN2011_bulk_in_callback(st + + if (urb->status) { + DPRINTK("nonzero read bulk status received: %d", urb->status); +-// if(urb->status==84) +- //ThreadState=1; + return; + } + +@@ -630,7 +620,6 @@ static void ATEN2011_bulk_in_callback(st + ATEN2011_port->icount.rx += urb->actual_length; + DPRINTK("ATEN2011_port->icount.rx is %d:\n", + ATEN2011_port->icount.rx); +-//MATRIX + } + + if (!ATEN2011_port->read_urb) { +@@ -680,7 +669,7 @@ static void ATEN2011_bulk_out_data_callb + wake_up_interruptible(&tty->write_wait); + } + +-//schedule_work(&ATEN2011_port->port->work); ++ /* schedule_work(&ATEN2011_port->port->work); */ + tty_kref_put(tty); + + } +@@ -704,7 +693,6 @@ static int ATEN2011_open(struct tty_stru + int response; + int j; + struct usb_serial *serial; +-// struct usb_serial_port *port0; + struct urb *urb; + __u16 Data; + int status; +@@ -713,7 +701,6 @@ static int ATEN2011_open(struct tty_stru + struct ktermios tmp_termios; + int minor; + +- //ATEN2011_serial->NoOfOpenPorts++; + serial = port->serial; + + ATEN2011_port = usb_get_serial_port_data(port); +@@ -736,17 +723,14 @@ static int ATEN2011_open(struct tty_stru + ATEN2011_port->control_urb=kmalloc(sizeof(struct urb),GFP_KERNEL); + } + */ +-// port0 = serial->port[0]; + + ATEN2011_serial = usb_get_serial_data(serial); + +- if (ATEN2011_serial == NULL) //|| port0 == NULL) +- { ++ if (ATEN2011_serial == NULL) { + return -ENODEV; + } +- // increment the number of opened ports counter here ++ /* increment the number of opened ports counter here */ + ATEN2011_serial->NoOfOpenPorts++; +- //printk("the num of ports opend is:%d\n",ATEN2011_serial->NoOfOpenPorts); + + usb_clear_halt(serial->dev, port->write_urb->pipe); + usb_clear_halt(serial->dev, port->read_urb->pipe); +@@ -782,7 +766,7 @@ static int ATEN2011_open(struct tty_stru + * 0x08 : SP1/2 Control Reg + *****************************************************************************/ + +-//NEED to check the fallowing Block ++/* NEED to check the fallowing Block */ + + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data); +@@ -804,8 +788,8 @@ static int ATEN2011_open(struct tty_stru + return -1; + } + +-//End of block to be checked +-//**************************CHECK***************************// ++/* End of block to be checked */ ++/**************************CHECK***************************/ + + if (RS485mode == 0) + Data = 0xC0; +@@ -820,7 +804,7 @@ static int ATEN2011_open(struct tty_stru + DPRINTK("SCRATCH_PAD_REGISTER Writing success status%d\n", + status); + +-//**************************CHECK***************************// ++/**************************CHECK***************************/ + + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data); +@@ -828,8 +812,8 @@ static int ATEN2011_open(struct tty_stru + DPRINTK("Reading Controlreg failed\n"); + return -1; + } +- Data |= 0x08; //Driver done bit +- Data |= 0x20; //rx_disable ++ Data |= 0x08; /* Driver done bit */ ++ Data |= 0x20; /* rx_disable */ + status = 0; + status = + set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data); +@@ -837,11 +821,11 @@ static int ATEN2011_open(struct tty_stru + DPRINTK("writing Controlreg failed\n"); + return -1; + } +- //do register settings here +- // Set all regs to the device default values. +- //////////////////////////////////// +- // First Disable all interrupts. +- //////////////////////////////////// ++ /* ++ * do register settings here ++ * Set all regs to the device default values. ++ * First Disable all interrupts. ++ */ + + Data = 0x00; + status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); +@@ -849,7 +833,7 @@ static int ATEN2011_open(struct tty_stru + DPRINTK("disableing interrupts failed\n"); + return -1; + } +- // Set FIFO_CONTROL_REGISTER to the default value ++ /* Set FIFO_CONTROL_REGISTER to the default value */ + Data = 0x00; + status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { +@@ -857,18 +841,18 @@ static int ATEN2011_open(struct tty_stru + return -1; + } + +- Data = 0xcf; //chk ++ Data = 0xcf; /* chk */ + status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { + DPRINTK("Writing FIFO_CONTROL_REGISTER failed\n"); + return -1; + } + +- Data = 0x03; //LCR_BITS_8 ++ Data = 0x03; /* LCR_BITS_8 */ + status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data); + ATEN2011_port->shadowLCR = Data; + +- Data = 0x0b; // MCR_DTR|MCR_RTS|MCR_MASTER_IE ++ Data = 0x0b; /* MCR_DTR|MCR_RTS|MCR_MASTER_IE */ + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + ATEN2011_port->shadowMCR = Data; + +@@ -877,7 +861,7 @@ static int ATEN2011_open(struct tty_stru + status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data); + ATEN2011_port->shadowLCR = Data; + +- Data |= SERIAL_LCR_DLAB; //data latch enable in LCR 0x80 ++ Data |= SERIAL_LCR_DLAB; /* data latch enable in LCR 0x80 */ + status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data); + + Data = 0x0c; +@@ -889,12 +873,12 @@ static int ATEN2011_open(struct tty_stru + Data = 0x00; + status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data); + +-// Data = ATEN2011_port->shadowLCR; //data latch disable ++/* Data = ATEN2011_port->shadowLCR; */ /* data latch disable */ + Data = Data & ~SERIAL_LCR_DLAB; + status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data); + ATEN2011_port->shadowLCR = Data; + #endif +- //clearing Bulkin and Bulkout Fifo ++ /* clearing Bulkin and Bulkout Fifo */ + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data); + +@@ -903,18 +887,18 @@ static int ATEN2011_open(struct tty_stru + + Data = Data & ~0x0c; + status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data); +- //Finally enable all interrupts ++ /* Finally enable all interrupts */ + Data = 0x0; + Data = 0x0c; + status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); + +- //clearing rx_disable ++ /* clearing rx_disable */ + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data); + Data = Data & ~0x20; + status = set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data); + +- // rx_negate ++ /* rx_negate */ + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data); + Data = Data | 0x10; +@@ -935,22 +919,19 @@ static int ATEN2011_open(struct tty_stru + printk("Interrupt endpoint is %d \n",port->interrupt_in_endpointAddress); + printk("port's number in the device is %d\n",ATEN2011_port->port_num); + */ +-//////////////////////// +-//#ifdef CheckStatusPipe +-/* Check to see if we've set up our endpoint info yet * +- * (can't set it up in ATEN2011_startup as the structures * +- * were not set up at that time.) */ ++ /* ++ * Check to see if we've set up our endpoint info yet ++ * (can't set it up in ATEN2011_startup as the structures ++ * were not set up at that time.) ++ */ + if (ATEN2011_serial->NoOfOpenPorts == 1) { +- // start the status polling here ++ /* start the status polling here */ + ATEN2011_serial->status_polling_started = 1; +- //if (ATEN2011_serial->interrupt_in_buffer == NULL) +- // { + /* If not yet set, Set here */ + ATEN2011_serial->interrupt_in_buffer = + serial->port[0]->interrupt_in_buffer; + ATEN2011_serial->interrupt_in_endpoint = + serial->port[0]->interrupt_in_endpointAddress; +- //printk(" interrupt endpoint:%d \n",ATEN2011_serial->interrupt_in_endpoint); + ATEN2011_serial->interrupt_read_urb = + serial->port[0]->interrupt_in_urb; + +@@ -976,18 +957,14 @@ static int ATEN2011_open(struct tty_stru + DPRINTK("%s - Error %d submitting interrupt urb", + __FUNCTION__, response); + } +- // else +- // printk(" interrupt URB submitted\n"); +- +- //} + + } +-//#endif + +-/////////////////////// +- /* see if we've set up our endpoint info yet * +- * (can't set it up in ATEN2011_startup as the * +- * structures were not set up at that time.) */ ++ /* ++ * See if we've set up our endpoint info yet ++ * (can't set it up in ATEN2011_startup as the ++ * structures were not set up at that time.) ++ */ + + DPRINTK("port number is %d \n", port->number); + DPRINTK("serial number is %d \n", port->serial->minor); +@@ -1047,7 +1024,7 @@ static int ATEN2011_open(struct tty_stru + ATEN2011_port->chaseResponsePending = 0; + /* send a open port command */ + ATEN2011_port->open = 1; +- //ATEN2011_change_port_settings(ATEN2011_port,old_termios); ++ /* ATEN2011_change_port_settings(ATEN2011_port,old_termios); */ + /* Setup termios */ + ATEN2011_set_termios(tty, port, &tmp_termios); + ATEN2011_port->icount.tx = 0; +@@ -1069,7 +1046,7 @@ static int ATEN2011_chars_in_buffer(stru + int chars = 0; + struct ATENINTL_port *ATEN2011_port; + +- //DPRINTK("%s \n"," ATEN2011_chars_in_buffer:entering ..........."); ++ /* DPRINTK("%s \n"," ATEN2011_chars_in_buffer:entering ..........."); */ + + ATEN2011_port = usb_get_serial_port_data(port); + if (ATEN2011_port == NULL) { +@@ -1127,16 +1104,11 @@ static void ATEN2011_close(struct tty_st + struct ATENINTL_port *ATEN2011_port; + int no_urbs; + __u16 Data; +- //__u16 Data1= 20; + + DPRINTK("%s\n", "ATEN2011_close:entering..."); +- /* MATRIX */ +- //ThreadState = 1; +- /* MATRIX */ +- //printk("Entering... :ATEN2011_close\n"); + serial = port->serial; + +- // take the Adpater and port's private data ++ /* take the Adpater and port's private data */ + ATEN2011_serial = usb_get_serial_data(serial); + ATEN2011_port = usb_get_serial_port_data(port); + if ((ATEN2011_serial == NULL) || (ATEN2011_port == NULL)) { +@@ -1146,7 +1118,7 @@ static void ATEN2011_close(struct tty_st + /* flush and block(wait) until tx is empty */ + ATEN2011_block_until_tx_empty(tty, ATEN2011_port); + } +- // kill the ports URB's ++ /* kill the ports URB's */ + for (no_urbs = 0; no_urbs < NUM_URBS; no_urbs++) + usb_kill_urb(ATEN2011_port->write_urb_pool[no_urbs]); + /* Freeing Write URBs */ +@@ -1172,25 +1144,23 @@ static void ATEN2011_close(struct tty_st + } + if ((&ATEN2011_port->control_urb)) { + DPRINTK("%s", "Shutdown control read\n"); +- // usb_kill_urb (ATEN2011_port->control_urb); ++ /* usb_kill_urb (ATEN2011_port->control_urb); */ + + } + } +- //if(ATEN2011_port->ctrl_buf != NULL) +- //kfree(ATEN2011_port->ctrl_buf); +- // decrement the no.of open ports counter of an individual USB-serial adapter. ++ /* if(ATEN2011_port->ctrl_buf != NULL) */ ++ /* kfree(ATEN2011_port->ctrl_buf); */ ++ /* decrement the no.of open ports counter of an individual USB-serial adapter. */ + ATEN2011_serial->NoOfOpenPorts--; + DPRINTK("NoOfOpenPorts in close%d:in port%d\n", + ATEN2011_serial->NoOfOpenPorts, port->number); +- //printk("the num of ports opend is:%d\n",ATEN2011_serial->NoOfOpenPorts); + if (ATEN2011_serial->NoOfOpenPorts == 0) { +- //stop the stus polling here +- //printk("disabling the status polling flag to 0 :\n"); ++ /* stop the stus polling here */ + ATEN2011_serial->status_polling_started = 0; + if (ATEN2011_serial->interrupt_read_urb) { + DPRINTK("%s", "Shutdown interrupt_read_urb\n"); +- //ATEN2011_serial->interrupt_in_buffer=NULL; +- //usb_kill_urb (ATEN2011_serial->interrupt_read_urb); ++ /* ATEN2011_serial->interrupt_in_buffer=NULL; */ ++ /* usb_kill_urb (ATEN2011_serial->interrupt_read_urb); */ + } + } + if (ATEN2011_port->write_urb) { +@@ -1200,7 +1170,7 @@ static void ATEN2011_close(struct tty_st + } + usb_free_urb(ATEN2011_port->write_urb); + } +- // clear the MCR & IER ++ /* clear the MCR & IER */ + Data = 0x00; + set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + Data = 0x00; +@@ -1294,8 +1264,6 @@ static int ATEN2011_write_room(struct tt + int room = 0; + struct ATENINTL_port *ATEN2011_port; + +-// DPRINTK("%s \n"," ATEN2011_write_room:entering ..........."); +- + ATEN2011_port = usb_get_serial_port_data(port); + if (ATEN2011_port == NULL) { + DPRINTK("%s \n", "ATEN2011_break:leaving ..........."); +@@ -1326,7 +1294,6 @@ static int ATEN2011_write(struct tty_str + struct usb_serial *serial; + struct ATENINTL_serial *ATEN2011_serial; + struct urb *urb; +- //__u16 Data; + const unsigned char *current_position = data; + unsigned char *data1; + DPRINTK("%s \n", "entering ..........."); +@@ -1373,7 +1340,7 @@ static int ATEN2011_write(struct tty_str + transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); + + memcpy(urb->transfer_buffer, current_position, transfer_size); +- //usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, urb->transfer_buffer); ++ /* usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, urb->transfer_buffer); */ + + /* fill urb with data and submit */ + minor = port->serial->minor; +@@ -1402,8 +1369,8 @@ static int ATEN2011_write(struct tty_str + + data1 = urb->transfer_buffer; + DPRINTK("\nbulkout endpoint is %d", port->bulk_out_endpointAddress); +- //for(i=0;i < urb->actual_length;i++) +- // DPRINTK("Data is %c\n ",data1[i]); ++ /* for(i=0;i < urb->actual_length;i++) */ ++ /* DPRINTK("Data is %c\n ",data1[i]); */ + + /* send it down the pipe */ + status = usb_submit_urb(urb, GFP_ATOMIC); +@@ -1451,7 +1418,7 @@ static void ATEN2011_throttle(struct tty + /* if we are implementing XON/XOFF, send the stop character */ + if (I_IXOFF(tty)) { + unsigned char stop_char = STOP_CHAR(tty); +- status = ATEN2011_write(tty, port, &stop_char, 1); //FC4 ++ status = ATEN2011_write(tty, port, &stop_char, 1); + if (status <= 0) { + return; + } +@@ -1495,7 +1462,7 @@ static void ATEN2011_unthrottle(struct t + /* if we are implementing XON/XOFF, send the start character */ + if (I_IXOFF(tty)) { + unsigned char start_char = START_CHAR(tty); +- status = ATEN2011_write(tty, port, &start_char, 1); //FC4 ++ status = ATEN2011_write(tty, port, &start_char, 1); + if (status <= 0) { + return; + } +@@ -1517,12 +1484,11 @@ static void ATEN2011_unthrottle(struct t + static int ATEN2011_tiocmget(struct tty_struct *tty, struct file *file) + { + struct usb_serial_port *port = tty->driver_data; +- //struct ti_port *tport = usb_get_serial_port_data(port); + struct ATENINTL_port *ATEN2011_port; + unsigned int result; + __u16 msr; + __u16 mcr; +- //unsigned int mcr; ++ /* unsigned int mcr; */ + int status = 0; + ATEN2011_port = usb_get_serial_port_data(port); + +@@ -1533,8 +1499,8 @@ static int ATEN2011_tiocmget(struct tty_ + + status = get_uart_reg(port, MODEM_STATUS_REGISTER, &msr); + status = get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr); +-// mcr = ATEN2011_port->shadowMCR; +-// COMMENT2: the Fallowing three line are commented for updating only MSR values ++ /* mcr = ATEN2011_port->shadowMCR; */ ++ /* COMMENT2: the Fallowing three line are commented for updating only MSR values */ + result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0) + | ((mcr & MCR_RTS) ? TIOCM_RTS : 0) + | ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0) +@@ -1553,7 +1519,6 @@ static int ATEN2011_tiocmset(struct tty_ + { + struct usb_serial_port *port = tty->driver_data; + struct ATENINTL_port *ATEN2011_port; +- //struct ti_port *tport = usb_get_serial_port_data(port); + unsigned int mcr; + unsigned int status; + +@@ -1823,8 +1788,6 @@ static int ATEN2011_ioctl(struct tty_str + int ATENret = 0; + unsigned int __user *user_arg = (unsigned int __user *)arg; + +- //printk("%s - port %d, cmd = 0x%x\n", __FUNCTION__, port->number, cmd); +- + ATEN2011_port = usb_get_serial_port_data(port); + + if (ATEN2011_port == NULL) +@@ -1855,10 +1818,7 @@ static int ATEN2011_ioctl(struct tty_str + case TIOCMSET: + dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, + port->number); +- // printk("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); +- ATENret = +- set_modem_info(ATEN2011_port, cmd, user_arg); +- // printk(" %s: ret:%d\n",__FUNCTION__,ATENret); ++ ATENret = set_modem_info(ATEN2011_port, cmd, user_arg); + return ATENret; + + case TIOCMGET: +@@ -1926,9 +1886,6 @@ static int ATEN2011_ioctl(struct tty_str + static int ATEN2011_calc_baud_rate_divisor(int baudRate, int *divisor, + __u16 * clk_sel_val) + { +- //int i; +- //__u16 custom,round1, round; +- + dbg("%s - %d", __FUNCTION__, baudRate); + + if (baudRate <= 115200) { +@@ -1985,12 +1942,14 @@ static int ATEN2011_send_cmd_write_baud_ + + dbg("%s - port = %d, baud = %d", __FUNCTION__, + ATEN2011_port->port->number, baudRate); +- //reset clk_uart_sel in spregOffset ++ /* reset clk_uart_sel in spregOffset */ + if (baudRate > 115200) { + #ifdef HW_flow_control +- //NOTE: need to see the pther register to modify +- //setting h/w flow control bit to 1; +- //Data = ATEN2011_port->shadowMCR ; ++ /* ++ * NOTE: need to see the pther register to modify ++ * setting h/w flow control bit to 1; ++ */ ++ /* Data = ATEN2011_port->shadowMCR; */ + Data = 0x2b; + ATEN2011_port->shadowMCR = Data; + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); +@@ -2002,8 +1961,8 @@ static int ATEN2011_send_cmd_write_baud_ + + } else { + #ifdef HW_flow_control +- //setting h/w flow control bit to 0; +- //Data = ATEN2011_port->shadowMCR ; ++ /* setting h/w flow control bit to 0; */ ++ /* Data = ATEN2011_port->shadowMCR; */ + Data = 0xb; + ATEN2011_port->shadowMCR = Data; + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); +@@ -2015,7 +1974,7 @@ static int ATEN2011_send_cmd_write_baud_ + + } + +- if (1) //baudRate <= 115200) ++ if (1) /* baudRate <= 115200) */ + { + clk_sel_val = 0x0; + Data = 0x0; +@@ -2109,8 +2068,8 @@ static void ATEN2011_change_port_setting + + /* Change the number of bits */ + +-//COMMENT1: the below Line"if(cflag & CSIZE)" is added for the errors we get for serial loop data test i.e serial_loopback.pl -v +- //if(cflag & CSIZE) ++ /* COMMENT1: the below Line"if(cflag & CSIZE)" is added for the errors we get for serial loop data test i.e serial_loopback.pl -v */ ++ /* if(cflag & CSIZE) */ + { + switch (cflag & CSIZE) { + case CS5: +@@ -2247,8 +2206,6 @@ static int ATEN2011_calc_num_ports(struc + ATEN_RDREQ, ATEN_RD_RTYPE, 0, GPIO_REGISTER, + &Data, VENDOR_READ_LENGTH, ATEN_WDR_TIMEOUT); + +- //printk("ATEN2011_calc_num_ports GPIO is %x\n",Data); +- + /* ghostgum: here is where the problem appears to bet */ + /* Which of the following are needed? */ + /* Greg used the serial->type->num_ports=2 */ +@@ -2258,7 +2215,7 @@ static int ATEN2011_calc_num_ports(struc + serial->type->num_ports = 2; + serial->num_ports = 2; + } +- //else if(serial->interface->cur_altsetting->desc.bNumEndpoints == 9) ++ /* else if(serial->interface->cur_altsetting->desc.bNumEndpoints == 9) */ + else { + ATEN2011_2or4ports = 4; + serial->type->num_ports = 4; +@@ -2300,7 +2257,7 @@ static int ATEN2011_startup(struct usb_s + memset(ATEN2011_serial, 0, sizeof(struct ATENINTL_serial)); + + ATEN2011_serial->serial = serial; +- //initilize status polling flag to 0 ++ /* initilize status polling flag to 0 */ + ATEN2011_serial->status_polling_started = 0; + + usb_set_serial_data(serial, ATEN2011_serial); +@@ -2321,13 +2278,14 @@ static int ATEN2011_startup(struct usb_s + } + memset(ATEN2011_port, 0, sizeof(struct ATENINTL_port)); + +- /* Initialize all port interrupt end point to port 0 int endpoint * +- * Our device has only one interrupt end point comman to all port */ +- +- // serial->port[i]->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress; ++ /* ++ * Initialize all port interrupt end point to port 0 ++ * int endpoint. Our device has only one interrupt end point ++ * comman to all port ++ */ ++ /* serial->port[i]->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress; */ + + ATEN2011_port->port = serial->port[i]; +-// + usb_set_serial_port_data(serial->port[i], ATEN2011_port); + + minor = serial->port[i]->serial->minor; +@@ -2368,7 +2326,7 @@ static int ATEN2011_startup(struct usb_s + + usb_set_serial_port_data(serial->port[i], ATEN2011_port); + +- //enable rx_disable bit in control register ++ /* enable rx_disable bit in control register */ + + status = get_reg_sync(serial->port[i], + ATEN2011_port->ControlRegOffset, &Data); +@@ -2380,10 +2338,10 @@ static int ATEN2011_startup(struct usb_s + DPRINTK + ("ControlReg Reading success val is %x, status%d\n", + Data, status); +- Data |= 0x08; //setting driver done bit +- Data |= 0x04; //sp1_bit to have cts change reflect in modem status reg ++ Data |= 0x08; /* setting driver done bit */ ++ Data |= 0x04; /* sp1_bit to have cts change reflect in modem status reg */ + +- //Data |= 0x20; //rx_disable bit ++ /* Data |= 0x20; */ /* rx_disable bit */ + status = set_reg_sync(serial->port[i], + ATEN2011_port->ControlRegOffset, Data); + if (status < 0) { +@@ -2396,7 +2354,10 @@ static int ATEN2011_startup(struct usb_s + ("ControlReg Writing success(rx_disable) status%d\n", + status); + +- //Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2 and 0x24 in DCR3 ++ /* ++ * Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2 ++ * and 0x24 in DCR3 ++ */ + Data = 0x01; + status = set_reg_sync(serial->port[i], + (__u16)(ATEN2011_port->DcrRegOffset + 0), +@@ -2427,7 +2388,7 @@ static int ATEN2011_startup(struct usb_s + } else + DPRINTK("DCR2 Writing success status%d\n", status); + +- // write values in clkstart0x0 and clkmulti 0x20 ++ /* write values in clkstart0x0 and clkmulti 0x20 */ + Data = 0x0; + status = set_reg_sync(serial->port[i], CLK_START_VALUE_REGISTER, + Data); +@@ -2453,7 +2414,7 @@ static int ATEN2011_startup(struct usb_s + DPRINTK("CLK_MULTI_REGISTER Writing success status%d\n", + status); + +- //Zero Length flag register ++ /* Zero Length flag register */ + if ((ATEN2011_port->port_num != 1) + && (ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)) { + +@@ -2496,7 +2457,7 @@ static int ATEN2011_startup(struct usb_s + + } + +- //Zero Length flag enable ++ /* Zero Length flag enable */ + Data = 0x0f; + status = set_reg_sync(serial->port[0], ZLP_REG5, Data); + if (status < 0) { +@@ -2517,10 +2478,6 @@ static void ATEN2011_shutdown(struct usb + struct ATENINTL_port *ATEN2011_port; + DPRINTK("%s \n", " shutdown :entering.........."); + +-/* MATRIX */ +- //ThreadState = 1; +-/* MATRIX */ +- + if (!serial) { + DPRINTK("%s", "Invalid Handler \n"); + return; diff --git a/f2.patch b/f2.patch new file mode 100644 index 00000000000000..01a8cb5ed57133 --- /dev/null +++ b/f2.patch @@ -0,0 +1,969 @@ +--- + drivers/staging/uc2322/aten2011.c | 313 ++++++++++++++------------------------ + 1 file changed, 123 insertions(+), 190 deletions(-) + +--- a/drivers/staging/uc2322/aten2011.c ++++ b/drivers/staging/uc2322/aten2011.c +@@ -191,18 +191,7 @@ static void ATEN2011_change_port_setting + #define ATEN2011_MSR_CD 0x80 /* Current state of CD */ + + +-/* 1: Enables the debugging -- 0: Disable the debugging */ +-#define ATEN_DEBUG 0 +- +-#ifdef ATEN_DEBUG +-static int debug = 0; +-#define DPRINTK(fmt, args...) printk( "%s: " fmt, __FUNCTION__ , ## args) +- +-#else +-static int debug = 0; +-#define DPRINTK(fmt, args...) +- +-#endif ++static int debug; + + /* + * Version Information +@@ -233,7 +222,7 @@ static int set_reg_sync(struct usb_seria + struct usb_device *dev = port->serial->dev; + val = val & 0x00ff; + +- dbg("%s: is %x, value %x\n", __func__, reg, val); ++ dbg("%s: is %x, value %x", __func__, reg, val); + + return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ, + ATEN_WR_RTYPE, val, reg, NULL, 0, +@@ -248,7 +237,7 @@ static int get_reg_sync(struct usb_seria + ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ, + ATEN_RD_RTYPE, 0, reg, val, VENDOR_READ_LENGTH, + ATEN_WDR_TIMEOUT); +- dbg("%s: offset is %x, return val %x\n", __func__, reg, *val); ++ dbg("%s: offset is %x, return val %x", __func__, reg, *val); + *val = (*val) & 0x00ff; + return ret; + } +@@ -277,7 +266,7 @@ static int set_uart_reg(struct usb_seria + else + val |= (((__u16)port->number - minor) + 2) << 8; + } +- dbg("%s: application number is %x\n", __func__, val); ++ dbg("%s: application number is %x", __func__, val); + + return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ, + ATEN_WR_RTYPE, val, reg, NULL, 0, +@@ -305,7 +294,7 @@ static int get_uart_reg(struct usb_seria + else + wval = (((__u16) port->number - minor) + 2) << 8; + } +- dbg("%s: application number is %x\n", __func__, wval); ++ dbg("%s: application number is %x", __func__, wval); + ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ, + ATEN_RD_RTYPE, wval, reg, val, VENDOR_READ_LENGTH, + ATEN_WDR_TIMEOUT); +@@ -380,11 +369,6 @@ static void ATEN2011_control_callback(st + struct ATENINTL_port *ATEN2011_port; + __u8 regval = 0x0; + +- if (!urb) { +- DPRINTK("%s", "Invalid Pointer !!!!:\n"); +- return; +- } +- + switch (urb->status) { + case 0: + /* success */ +@@ -404,12 +388,12 @@ static void ATEN2011_control_callback(st + + ATEN2011_port = (struct ATENINTL_port *)urb->context; + +- DPRINTK("%s urb buffer size is %d\n", __FUNCTION__, urb->actual_length); +- DPRINTK("%s ATEN2011_port->MsrLsr is %d port %d\n", __FUNCTION__, ++ dbg("%s urb buffer size is %d", __FUNCTION__, urb->actual_length); ++ dbg("%s ATEN2011_port->MsrLsr is %d port %d", __FUNCTION__, + ATEN2011_port->MsrLsr, ATEN2011_port->port_num); + data = urb->transfer_buffer; + regval = (__u8) data[0]; +- DPRINTK("%s data is %x\n", __FUNCTION__, regval); ++ dbg("%s data is %x", __FUNCTION__, regval); + if (ATEN2011_port->MsrLsr == 0) + handle_newMsr(ATEN2011_port, regval); + else if (ATEN2011_port->MsrLsr == 1) +@@ -457,13 +441,9 @@ static void ATEN2011_interrupt_callback( + __u16 wval; + int minor; + +- DPRINTK("%s", " : Entering\n"); ++ dbg("%s", " : Entering"); + + ATEN2011_serial = (struct ATENINTL_serial *)urb->context; +- if (!urb) { +- DPRINTK("%s", "Invalid Pointer !!!!:\n"); +- return; +- } + + switch (urb->status) { + case 0: +@@ -494,7 +474,7 @@ static void ATEN2011_interrupt_callback( + * Byte 5 FIFO status for both */ + + if (length && length > 5) { +- DPRINTK("%s \n", "Wrong data !!!"); ++ dbg("%s", "Wrong data !!!"); + return; + } + +@@ -529,24 +509,18 @@ static void ATEN2011_interrupt_callback( + (__u16) (minor)) + 1) << 8; + if (ATEN2011_port->open != 0) { + if (sp[i] & 0x01) { +- DPRINTK("SP%d No Interrupt !!!\n", i); ++ dbg("SP%d No Interrupt !!!", i); + } else { + switch (sp[i] & 0x0f) { + case SERIAL_IIR_RLS: +- DPRINTK +- ("Serial Port %d: Receiver status error or ", +- i); +- DPRINTK +- ("address bit detected in 9-bit mode\n"); ++ dbg("Serial Port %d: Receiver status error or address bit detected in 9-bit mode", i); + ATEN2011_port->MsrLsr = 1; + ATEN2011_get_reg(ATEN2011_port, wval, + LINE_STATUS_REGISTER, + &Data); + break; + case SERIAL_IIR_MS: +- DPRINTK +- ("Serial Port %d: Modem status change\n", +- i); ++ dbg("Serial Port %d: Modem status change", i); + ATEN2011_port->MsrLsr = 0; + ATEN2011_get_reg(ATEN2011_port, wval, + MODEM_STATUS_REGISTER, +@@ -581,49 +555,38 @@ static void ATEN2011_bulk_in_callback(st + struct ATENINTL_serial *ATEN2011_serial; + struct ATENINTL_port *ATEN2011_port; + struct tty_struct *tty; +- if (!urb) { +- DPRINTK("%s", "Invalid Pointer !!!!:\n"); +- return; +- } + + if (urb->status) { +- DPRINTK("nonzero read bulk status received: %d", urb->status); ++ dbg("nonzero read bulk status received: %d", urb->status); + return; + } + + ATEN2011_port = (struct ATENINTL_port *)urb->context; +- if (!ATEN2011_port) { +- DPRINTK("%s", "NULL ATEN2011_port pointer \n"); +- return; +- } + + port = (struct usb_serial_port *)ATEN2011_port->port; + serial = port->serial; + +- DPRINTK("%s\n", "Entering... \n"); ++ dbg("%s", "Entering..."); + + data = urb->transfer_buffer; + ATEN2011_serial = usb_get_serial_data(serial); + +- DPRINTK("%s", "Entering ........... \n"); +- + if (urb->actual_length) { + tty = tty_port_tty_get(&ATEN2011_port->port->port); + if (tty) { + tty_buffer_request_room(tty, urb->actual_length); + tty_insert_flip_string(tty, data, urb->actual_length); +- DPRINTK(" %s \n", data); + tty_flip_buffer_push(tty); + tty_kref_put(tty); + } + + ATEN2011_port->icount.rx += urb->actual_length; +- DPRINTK("ATEN2011_port->icount.rx is %d:\n", ++ dbg("ATEN2011_port->icount.rx is %d:", + ATEN2011_port->icount.rx); + } + + if (!ATEN2011_port->read_urb) { +- DPRINTK("%s", "URB KILLED !!!\n"); ++ dbg("%s", "URB KILLED !!!"); + return; + } + +@@ -633,9 +596,7 @@ static void ATEN2011_bulk_in_callback(st + status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC); + + if (status) { +- DPRINTK +- (" usb_submit_urb(read bulk) failed, status = %d", +- status); ++ dbg("usb_submit_urb(read bulk) failed, status = %d", status); + } + } + } +@@ -644,23 +605,15 @@ static void ATEN2011_bulk_out_data_callb + { + struct ATENINTL_port *ATEN2011_port; + struct tty_struct *tty; +- if (!urb) { +- DPRINTK("%s", "Invalid Pointer !!!!:\n"); +- return; +- } + + if (urb->status) { +- DPRINTK("nonzero write bulk status received:%d\n", urb->status); ++ dbg("nonzero write bulk status received:%d", urb->status); + return; + } + + ATEN2011_port = (struct ATENINTL_port *)urb->context; +- if (!ATEN2011_port) { +- DPRINTK("%s", "NULL ATEN2011_port pointer \n"); +- return; +- } + +- DPRINTK("%s \n", "Entering ........."); ++ dbg("%s", "Entering ........."); + + tty = tty_port_tty_get(&ATEN2011_port->port->port); + +@@ -771,20 +724,20 @@ static int ATEN2011_open(struct tty_stru + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data); + if (status < 0) { +- DPRINTK("Reading Spreg failed\n"); ++ dbg("Reading Spreg failed"); + return -1; + } + Data |= 0x80; + status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data); + if (status < 0) { +- DPRINTK("writing Spreg failed\n"); ++ dbg("writing Spreg failed"); + return -1; + } + + Data &= ~0x80; + status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data); + if (status < 0) { +- DPRINTK("writing Spreg failed\n"); ++ dbg("writing Spreg failed"); + return -1; + } + +@@ -797,19 +750,17 @@ static int ATEN2011_open(struct tty_stru + Data = 0x00; + status = set_uart_reg(port, SCRATCH_PAD_REGISTER, Data); + if (status < 0) { +- DPRINTK("Writing SCRATCH_PAD_REGISTER failed status-0x%x\n", +- status); ++ dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x", status); + return -1; + } else +- DPRINTK("SCRATCH_PAD_REGISTER Writing success status%d\n", +- status); ++ dbg("SCRATCH_PAD_REGISTER Writing success status%d", status); + + /**************************CHECK***************************/ + + Data = 0x0; + status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data); + if (status < 0) { +- DPRINTK("Reading Controlreg failed\n"); ++ dbg("Reading Controlreg failed"); + return -1; + } + Data |= 0x08; /* Driver done bit */ +@@ -818,7 +769,7 @@ static int ATEN2011_open(struct tty_stru + status = + set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data); + if (status < 0) { +- DPRINTK("writing Controlreg failed\n"); ++ dbg("writing Controlreg failed"); + return -1; + } + /* +@@ -830,21 +781,21 @@ static int ATEN2011_open(struct tty_stru + Data = 0x00; + status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); + if (status < 0) { +- DPRINTK("disableing interrupts failed\n"); ++ dbg("disableing interrupts failed"); + return -1; + } + /* Set FIFO_CONTROL_REGISTER to the default value */ + Data = 0x00; + status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { +- DPRINTK("Writing FIFO_CONTROL_REGISTER failed\n"); ++ dbg("Writing FIFO_CONTROL_REGISTER failed"); + return -1; + } + + Data = 0xcf; /* chk */ + status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { +- DPRINTK("Writing FIFO_CONTROL_REGISTER failed\n"); ++ dbg("Writing FIFO_CONTROL_REGISTER failed"); + return -1; + } + +@@ -911,14 +862,6 @@ static int ATEN2011_open(struct tty_stru + + if (tty) + tty->low_latency = 1; +-/* +- printk("port number is %d \n",port->number); +- printk("serial number is %d \n",port->serial->minor); +- printk("Bulkin endpoint is %d \n",port->bulk_in_endpointAddress); +- printk("BulkOut endpoint is %d \n",port->bulk_out_endpointAddress); +- printk("Interrupt endpoint is %d \n",port->interrupt_in_endpointAddress); +- printk("port's number in the device is %d\n",ATEN2011_port->port_num); +-*/ + /* + * Check to see if we've set up our endpoint info yet + * (can't set it up in ATEN2011_startup as the structures +@@ -954,7 +897,7 @@ static int ATEN2011_open(struct tty_stru + usb_submit_urb(ATEN2011_serial->interrupt_read_urb, + GFP_KERNEL); + if (response) { +- DPRINTK("%s - Error %d submitting interrupt urb", ++ dbg("%s - Error %d submitting interrupt urb", + __FUNCTION__, response); + } + +@@ -966,13 +909,13 @@ static int ATEN2011_open(struct tty_stru + * structures were not set up at that time.) + */ + +- DPRINTK("port number is %d \n", port->number); +- DPRINTK("serial number is %d \n", port->serial->minor); +- DPRINTK("Bulkin endpoint is %d \n", port->bulk_in_endpointAddress); +- DPRINTK("BulkOut endpoint is %d \n", port->bulk_out_endpointAddress); +- DPRINTK("Interrupt endpoint is %d \n", ++ dbg("port number is %d", port->number); ++ dbg("serial number is %d", port->serial->minor); ++ dbg("Bulkin endpoint is %d", port->bulk_in_endpointAddress); ++ dbg("BulkOut endpoint is %d", port->bulk_out_endpointAddress); ++ dbg("Interrupt endpoint is %d", + port->interrupt_in_endpointAddress); +- DPRINTK("port's number in the device is %d\n", ATEN2011_port->port_num); ++ dbg("port's number in the device is %d", ATEN2011_port->port_num); + ATEN2011_port->bulk_in_buffer = port->bulk_in_buffer; + ATEN2011_port->bulk_in_endpoint = port->bulk_in_endpointAddress; + ATEN2011_port->read_urb = port->read_urb; +@@ -1004,7 +947,7 @@ static int ATEN2011_open(struct tty_stru + transfer_buffer_length, + ATEN2011_bulk_in_callback, ATEN2011_port); + +- DPRINTK("ATEN2011_open: bulkin endpoint is %d\n", ++ dbg("ATEN2011_open: bulkin endpoint is %d", + port->bulk_in_endpointAddress); + response = usb_submit_urb(ATEN2011_port->read_urb, GFP_KERNEL); + if (response) { +@@ -1030,8 +973,7 @@ static int ATEN2011_open(struct tty_stru + ATEN2011_port->icount.tx = 0; + ATEN2011_port->icount.rx = 0; + +- DPRINTK +- ("\n\nusb_serial serial:%x ATEN2011_port:%x\nATEN2011_serial:%x usb_serial_port port:%x\n\n", ++ dbg("usb_serial serial:%x ATEN2011_port:%x\nATEN2011_serial:%x usb_serial_port port:%x", + (unsigned int)serial, (unsigned int)ATEN2011_port, + (unsigned int)ATEN2011_serial, (unsigned int)port); + +@@ -1046,11 +988,11 @@ static int ATEN2011_chars_in_buffer(stru + int chars = 0; + struct ATENINTL_port *ATEN2011_port; + +- /* DPRINTK("%s \n"," ATEN2011_chars_in_buffer:entering ..........."); */ ++ /* dbg("%s"," ATEN2011_chars_in_buffer:entering ..........."); */ + + ATEN2011_port = usb_get_serial_port_data(port); + if (ATEN2011_port == NULL) { +- DPRINTK("%s \n", "ATEN2011_break:leaving ..........."); ++ dbg("%s", "ATEN2011_break:leaving ..........."); + return -1; + } + +@@ -1105,7 +1047,7 @@ static void ATEN2011_close(struct tty_st + int no_urbs; + __u16 Data; + +- DPRINTK("%s\n", "ATEN2011_close:entering..."); ++ dbg("%s", "ATEN2011_close:entering..."); + serial = port->serial; + + /* take the Adpater and port's private data */ +@@ -1135,15 +1077,15 @@ static void ATEN2011_close(struct tty_st + * and interrupt read if they exists */ + if (serial->dev) { + if (ATEN2011_port->write_urb) { +- DPRINTK("%s", "Shutdown bulk write\n"); ++ dbg("%s", "Shutdown bulk write"); + usb_kill_urb(ATEN2011_port->write_urb); + } + if (ATEN2011_port->read_urb) { +- DPRINTK("%s", "Shutdown bulk read\n"); ++ dbg("%s", "Shutdown bulk read"); + usb_kill_urb(ATEN2011_port->read_urb); + } + if ((&ATEN2011_port->control_urb)) { +- DPRINTK("%s", "Shutdown control read\n"); ++ dbg("%s", "Shutdown control read"); + /* usb_kill_urb (ATEN2011_port->control_urb); */ + + } +@@ -1152,13 +1094,13 @@ static void ATEN2011_close(struct tty_st + /* kfree(ATEN2011_port->ctrl_buf); */ + /* decrement the no.of open ports counter of an individual USB-serial adapter. */ + ATEN2011_serial->NoOfOpenPorts--; +- DPRINTK("NoOfOpenPorts in close%d:in port%d\n", ++ dbg("NoOfOpenPorts in close%d:in port%d", + ATEN2011_serial->NoOfOpenPorts, port->number); + if (ATEN2011_serial->NoOfOpenPorts == 0) { + /* stop the stus polling here */ + ATEN2011_serial->status_polling_started = 0; + if (ATEN2011_serial->interrupt_read_urb) { +- DPRINTK("%s", "Shutdown interrupt_read_urb\n"); ++ dbg("%s", "Shutdown interrupt_read_urb"); + /* ATEN2011_serial->interrupt_in_buffer=NULL; */ + /* usb_kill_urb (ATEN2011_serial->interrupt_read_urb); */ + } +@@ -1177,7 +1119,7 @@ static void ATEN2011_close(struct tty_st + set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); + + ATEN2011_port->open = 0; +- DPRINTK("%s \n", "Leaving ............"); ++ dbg("%s", "Leaving ............"); + + } + +@@ -1222,8 +1164,8 @@ static void ATEN2011_break(struct tty_st + struct ATENINTL_serial *ATEN2011_serial; + struct ATENINTL_port *ATEN2011_port; + +- DPRINTK("%s \n", "Entering ..........."); +- DPRINTK("ATEN2011_break: Start\n"); ++ dbg("%s", "Entering ..........."); ++ dbg("ATEN2011_break: Start"); + + serial = port->serial; + +@@ -1250,7 +1192,7 @@ static void ATEN2011_break(struct tty_st + } + + ATEN2011_port->shadowLCR = data; +- DPRINTK("ATEN2011_break ATEN2011_port->shadowLCR is %x\n", ++ dbg("ATEN2011_break ATEN2011_port->shadowLCR is %x", + ATEN2011_port->shadowLCR); + set_uart_reg(port, LINE_CONTROL_REGISTER, ATEN2011_port->shadowLCR); + +@@ -1266,7 +1208,7 @@ static int ATEN2011_write_room(struct tt + + ATEN2011_port = usb_get_serial_port_data(port); + if (ATEN2011_port == NULL) { +- DPRINTK("%s \n", "ATEN2011_break:leaving ..........."); ++ dbg("%s", "ATEN2011_break:leaving ..........."); + return -1; + } + +@@ -1296,19 +1238,19 @@ static int ATEN2011_write(struct tty_str + struct urb *urb; + const unsigned char *current_position = data; + unsigned char *data1; +- DPRINTK("%s \n", "entering ..........."); ++ dbg("%s", "entering ..........."); + + serial = port->serial; + + ATEN2011_port = usb_get_serial_port_data(port); + if (ATEN2011_port == NULL) { +- DPRINTK("%s", "ATEN2011_port is NULL\n"); ++ dbg("%s", "ATEN2011_port is NULL"); + return -1; + } + + ATEN2011_serial = usb_get_serial_data(serial); + if (ATEN2011_serial == NULL) { +- DPRINTK("%s", "ATEN2011_serial is NULL \n"); ++ dbg("%s", "ATEN2011_serial is NULL"); + return -1; + } + +@@ -1318,7 +1260,7 @@ static int ATEN2011_write(struct tty_str + for (i = 0; i < NUM_URBS; ++i) { + if (ATEN2011_port->write_urb_pool[i]->status != -EINPROGRESS) { + urb = ATEN2011_port->write_urb_pool[i]; +- DPRINTK("\nURB:%d", i); ++ dbg("URB:%d", i); + break; + } + } +@@ -1368,9 +1310,9 @@ static int ATEN2011_write(struct tty_str + ATEN2011_port); + + data1 = urb->transfer_buffer; +- DPRINTK("\nbulkout endpoint is %d", port->bulk_out_endpointAddress); ++ dbg("bulkout endpoint is %d", port->bulk_out_endpointAddress); + /* for(i=0;i < urb->actual_length;i++) */ +- /* DPRINTK("Data is %c\n ",data1[i]); */ ++ /* dbg("Data is %c ",data1[i]); */ + + /* send it down the pipe */ + status = usb_submit_urb(urb, GFP_ATOMIC); +@@ -1383,7 +1325,7 @@ static int ATEN2011_write(struct tty_str + } + bytes_sent = transfer_size; + ATEN2011_port->icount.tx += transfer_size; +- DPRINTK("ATEN2011_port->icount.tx is %d:\n", ATEN2011_port->icount.tx); ++ dbg("ATEN2011_port->icount.tx is %d:", ATEN2011_port->icount.tx); + exit: + + return bytes_sent; +@@ -1396,7 +1338,7 @@ static void ATEN2011_throttle(struct tty + struct ATENINTL_port *ATEN2011_port; + int status; + +- DPRINTK("- port %d\n", port->number); ++ dbg("- port %d", port->number); + + ATEN2011_port = usb_get_serial_port_data(port); + +@@ -1404,11 +1346,11 @@ static void ATEN2011_throttle(struct tty + return; + + if (!ATEN2011_port->open) { +- DPRINTK("%s\n", "port not opened"); ++ dbg("%s", "port not opened"); + return; + } + +- DPRINTK("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .......... "); + + if (!tty) { + dbg("%s - no tty available", __FUNCTION__); +@@ -1452,7 +1394,7 @@ static void ATEN2011_unthrottle(struct t + return; + } + +- DPRINTK("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .......... "); + + if (!tty) { + dbg("%s - no tty available", __FUNCTION__); +@@ -1492,7 +1434,7 @@ static int ATEN2011_tiocmget(struct tty_ + int status = 0; + ATEN2011_port = usb_get_serial_port_data(port); + +- DPRINTK("%s - port %d", __FUNCTION__, port->number); ++ dbg("%s - port %d", __FUNCTION__, port->number); + + if (ATEN2011_port == NULL) + return -ENODEV; +@@ -1509,7 +1451,7 @@ static int ATEN2011_tiocmget(struct tty_ + | ((msr & ATEN2011_MSR_RI) ? TIOCM_RI : 0) + | ((msr & ATEN2011_MSR_DSR) ? TIOCM_DSR : 0); + +- DPRINTK("%s - 0x%04X", __FUNCTION__, result); ++ dbg("%s - 0x%04X", __FUNCTION__, result); + + return result; + } +@@ -1522,7 +1464,7 @@ static int ATEN2011_tiocmset(struct tty_ + unsigned int mcr; + unsigned int status; + +- DPRINTK("%s - port %d", __FUNCTION__, port->number); ++ dbg("%s - port %d", __FUNCTION__, port->number); + + ATEN2011_port = usb_get_serial_port_data(port); + +@@ -1548,7 +1490,7 @@ static int ATEN2011_tiocmset(struct tty_ + + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr); + if (status < 0) { +- DPRINTK("setting MODEM_CONTROL_REGISTER Failed\n"); ++ dbg("setting MODEM_CONTROL_REGISTER Failed"); + return -1; + } + +@@ -1564,7 +1506,7 @@ static void ATEN2011_set_termios(struct + struct usb_serial *serial; + struct ATENINTL_port *ATEN2011_port; + +- DPRINTK("ATEN2011_set_termios: START\n"); ++ dbg("ATEN2011_set_termios: START"); + + serial = port->serial; + +@@ -1578,12 +1520,12 @@ static void ATEN2011_set_termios(struct + return; + } + +- DPRINTK("%s\n", "setting termios - "); ++ dbg("%s", "setting termios - "); + + cflag = tty->termios->c_cflag; + + if (!cflag) { +- DPRINTK("%s %s\n", __FUNCTION__, "cflag is NULL"); ++ dbg("%s %s", __FUNCTION__, "cflag is NULL"); + return; + } + +@@ -1592,7 +1534,7 @@ static void ATEN2011_set_termios(struct + if ((cflag == old_termios->c_cflag) && + (RELEVANT_IFLAG(tty->termios->c_iflag) == + RELEVANT_IFLAG(old_termios->c_iflag))) { +- DPRINTK("%s\n", "Nothing to change"); ++ dbg("%s", "Nothing to change"); + return; + } + } +@@ -1612,7 +1554,7 @@ static void ATEN2011_set_termios(struct + ATEN2011_change_port_settings(tty, ATEN2011_port, old_termios); + + if (!ATEN2011_port->read_urb) { +- DPRINTK("%s", "URB KILLED !!!!!\n"); ++ dbg("%s", "URB KILLED !!!!!"); + return; + } + +@@ -1620,7 +1562,7 @@ static void ATEN2011_set_termios(struct + ATEN2011_port->read_urb->dev = serial->dev; + status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC); + if (status) { +- DPRINTK ++ dbg + (" usb_submit_urb(read bulk) failed, status = %d", + status); + } +@@ -1717,7 +1659,7 @@ static int set_modem_info(struct ATENINT + Data = ATEN2011_port->shadowMCR; + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + if (status < 0) { +- DPRINTK("setting MODEM_CONTROL_REGISTER Failed\n"); ++ dbg("setting MODEM_CONTROL_REGISTER Failed"); + return -1; + } + +@@ -1933,7 +1875,7 @@ static int ATEN2011_send_cmd_write_baud_ + + port = (struct usb_serial_port *)ATEN2011_port->port; + +- DPRINTK("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .......... "); + + minor = ATEN2011_port->port->serial->minor; + if (minor == SERIAL_TTY_NO_MINOR) +@@ -1954,7 +1896,7 @@ static int ATEN2011_send_cmd_write_baud_ + ATEN2011_port->shadowMCR = Data; + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + if (status < 0) { +- DPRINTK("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + #endif +@@ -1967,7 +1909,7 @@ static int ATEN2011_send_cmd_write_baud_ + ATEN2011_port->shadowMCR = Data; + status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + if (status < 0) { +- DPRINTK("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + #endif +@@ -1983,20 +1925,20 @@ static int ATEN2011_send_cmd_write_baud_ + &clk_sel_val); + status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data); + if (status < 0) { +- DPRINTK("reading spreg failed in set_serial_baud\n"); ++ dbg("reading spreg failed in set_serial_baud"); + return -1; + } + Data = (Data & 0x8f) | clk_sel_val; + status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data); + if (status < 0) { +- DPRINTK("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + /* Calculate the Divisor */ + + if (status) { + err("%s - bad baud rate", __FUNCTION__); +- DPRINTK("%s\n", "bad baud rate"); ++ dbg("%s", "bad baud rate"); + return status; + } + /* Enable access to divisor latch */ +@@ -2006,11 +1948,11 @@ static int ATEN2011_send_cmd_write_baud_ + + /* Write the divisor */ + Data = (unsigned char)(divisor & 0xff); +- DPRINTK("set_serial_baud Value to write DLL is %x\n", Data); ++ dbg("set_serial_baud Value to write DLL is %x", Data); + set_uart_reg(port, DIVISOR_LATCH_LSB, Data); + + Data = (unsigned char)((divisor & 0xff00) >> 8); +- DPRINTK("set_serial_baud Value to write DLM is %x\n", Data); ++ dbg("set_serial_baud Value to write DLM is %x", Data); + set_uart_reg(port, DIVISOR_LATCH_MSB, Data); + + /* Disable access to divisor latch */ +@@ -2057,7 +1999,7 @@ static void ATEN2011_change_port_setting + return; + } + +- DPRINTK("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .......... "); + + lData = LCR_BITS_8; + lStop = LCR_STOP_1; +@@ -2121,8 +2063,8 @@ static void ATEN2011_change_port_setting + ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK); + ATEN2011_port->shadowLCR |= (lData | lParity | lStop); + +- DPRINTK +- ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is %x\n", ++ dbg ++ ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is %x", + ATEN2011_port->shadowLCR); + /* Disable Interrupts */ + Data = 0x00; +@@ -2167,7 +2109,7 @@ static void ATEN2011_change_port_setting + + if (!baud) { + /* pick a default, any default... */ +- DPRINTK("%s\n", "Picked default baud..."); ++ dbg("%s", "Picked default baud..."); + baud = 9600; + } + +@@ -2184,13 +2126,13 @@ static void ATEN2011_change_port_setting + status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC); + + if (status) { +- DPRINTK ++ dbg + (" usb_submit_urb(read bulk) failed, status = %d", + status); + } + } +- DPRINTK +- ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is End %x\n", ++ dbg ++ ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is End %x", + ATEN2011_port->shadowLCR); + + return; +@@ -2235,16 +2177,16 @@ static int ATEN2011_startup(struct usb_s + int minor; + + __u16 Data; +- DPRINTK("%s \n", " ATEN2011_startup :entering.........."); ++ dbg("%s", " ATEN2011_startup :entering.........."); + + if (!serial) { +- DPRINTK("%s\n", "Invalid Handler"); ++ dbg("%s", "Invalid Handler"); + return -1; + } + + dev = serial->dev; + +- DPRINTK("%s\n", "Entering..."); ++ dbg("%s", "Entering..."); + + /* create our private serial structure */ + ATEN2011_serial = kzalloc(sizeof(struct ATENINTL_serial), GFP_KERNEL); +@@ -2331,12 +2273,12 @@ static int ATEN2011_startup(struct usb_s + status = get_reg_sync(serial->port[i], + ATEN2011_port->ControlRegOffset, &Data); + if (status < 0) { +- DPRINTK("Reading ControlReg failed status-0x%x\n", ++ dbg("Reading ControlReg failed status-0x%x", + status); + break; + } else +- DPRINTK +- ("ControlReg Reading success val is %x, status%d\n", ++ dbg ++ ("ControlReg Reading success val is %x, status%d", + Data, status); + Data |= 0x08; /* setting driver done bit */ + Data |= 0x04; /* sp1_bit to have cts change reflect in modem status reg */ +@@ -2345,13 +2287,13 @@ static int ATEN2011_startup(struct usb_s + status = set_reg_sync(serial->port[i], + ATEN2011_port->ControlRegOffset, Data); + if (status < 0) { +- DPRINTK +- ("Writing ControlReg failed(rx_disable) status-0x%x\n", ++ dbg ++ ("Writing ControlReg failed(rx_disable) status-0x%x", + status); + break; + } else +- DPRINTK +- ("ControlReg Writing success(rx_disable) status%d\n", ++ dbg ++ ("ControlReg Writing success(rx_disable) status%d", + status); + + /* +@@ -2363,55 +2305,55 @@ static int ATEN2011_startup(struct usb_s + (__u16)(ATEN2011_port->DcrRegOffset + 0), + Data); + if (status < 0) { +- DPRINTK("Writing DCR0 failed status-0x%x\n", status); ++ dbg("Writing DCR0 failed status-0x%x", status); + break; + } else +- DPRINTK("DCR0 Writing success status%d\n", status); ++ dbg("DCR0 Writing success status%d", status); + + Data = 0x05; + status = set_reg_sync(serial->port[i], + (__u16)(ATEN2011_port->DcrRegOffset + 1), + Data); + if (status < 0) { +- DPRINTK("Writing DCR1 failed status-0x%x\n", status); ++ dbg("Writing DCR1 failed status-0x%x", status); + break; + } else +- DPRINTK("DCR1 Writing success status%d\n", status); ++ dbg("DCR1 Writing success status%d", status); + + Data = 0x24; + status = set_reg_sync(serial->port[i], + (__u16)(ATEN2011_port->DcrRegOffset + 2), + Data); + if (status < 0) { +- DPRINTK("Writing DCR2 failed status-0x%x\n", status); ++ dbg("Writing DCR2 failed status-0x%x", status); + break; + } else +- DPRINTK("DCR2 Writing success status%d\n", status); ++ dbg("DCR2 Writing success status%d", status); + + /* write values in clkstart0x0 and clkmulti 0x20 */ + Data = 0x0; + status = set_reg_sync(serial->port[i], CLK_START_VALUE_REGISTER, + Data); + if (status < 0) { +- DPRINTK +- ("Writing CLK_START_VALUE_REGISTER failed status-0x%x\n", ++ dbg ++ ("Writing CLK_START_VALUE_REGISTER failed status-0x%x", + status); + break; + } else +- DPRINTK +- ("CLK_START_VALUE_REGISTER Writing success status%d\n", ++ dbg ++ ("CLK_START_VALUE_REGISTER Writing success status%d", + status); + + Data = 0x20; + status = set_reg_sync(serial->port[i], CLK_MULTI_REGISTER, + Data); + if (status < 0) { +- DPRINTK +- ("Writing CLK_MULTI_REGISTER failed status-0x%x\n", ++ dbg ++ ("Writing CLK_MULTI_REGISTER failed status-0x%x", + status); + break; + } else +- DPRINTK("CLK_MULTI_REGISTER Writing success status%d\n", ++ dbg("CLK_MULTI_REGISTER Writing success status%d", + status); + + /* Zero Length flag register */ +@@ -2422,33 +2364,33 @@ static int ATEN2011_startup(struct usb_s + status = set_reg_sync(serial->port[i], + (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num)), + Data); +- DPRINTK("ZLIP offset%x\n", ++ dbg("ZLIP offset%x", + (__u16) (ZLP_REG1 + + ((__u16) ATEN2011_port->port_num))); + if (status < 0) { +- DPRINTK +- ("Writing ZLP_REG%d failed status-0x%x\n", ++ dbg ++ ("Writing ZLP_REG%d failed status-0x%x", + i + 2, status); + break; + } else +- DPRINTK("ZLP_REG%d Writing success status%d\n", ++ dbg("ZLP_REG%d Writing success status%d", + i + 2, status); + } else { + Data = 0xff; + status = set_reg_sync(serial->port[i], + (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num) - 0x1), + Data); +- DPRINTK("ZLIP offset%x\n", ++ dbg("ZLIP offset%x", + (__u16) (ZLP_REG1 + + ((__u16) ATEN2011_port->port_num) - + 0x1)); + if (status < 0) { +- DPRINTK +- ("Writing ZLP_REG%d failed status-0x%x\n", ++ dbg ++ ("Writing ZLP_REG%d failed status-0x%x", + i + 1, status); + break; + } else +- DPRINTK("ZLP_REG%d Writing success status%d\n", ++ dbg("ZLP_REG%d Writing success status%d", + i + 1, status); + + } +@@ -2461,10 +2403,10 @@ static int ATEN2011_startup(struct usb_s + Data = 0x0f; + status = set_reg_sync(serial->port[0], ZLP_REG5, Data); + if (status < 0) { +- DPRINTK("Writing ZLP_REG5 failed status-0x%x\n", status); ++ dbg("Writing ZLP_REG5 failed status-0x%x", status); + return -1; + } else +- DPRINTK("ZLP_REG5 Writing success status%d\n", status); ++ dbg("ZLP_REG5 Writing success status%d", status); + + /* setting configuration feature to one */ + usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), +@@ -2476,14 +2418,8 @@ static void ATEN2011_shutdown(struct usb + { + int i; + struct ATENINTL_port *ATEN2011_port; +- DPRINTK("%s \n", " shutdown :entering.........."); + +- if (!serial) { +- DPRINTK("%s", "Invalid Handler \n"); +- return; +- } +- +- /* check for the ports to be closed,close the ports and disconnect */ ++ /* check for the ports to be closed,close the ports and disconnect */ + + /* free private structure allocated for serial port * + * stop reads and writes on all ports */ +@@ -2500,9 +2436,6 @@ static void ATEN2011_shutdown(struct usb + + kfree(usb_get_serial_data(serial)); + usb_set_serial_data(serial, NULL); +- +- DPRINTK("%s\n", "Thank u :: "); +- + } + + static struct usb_serial_driver aten_serial_driver = { @@ -248,3 +248,5 @@ staging/staging-add-b3dfg-driver.patch staging/staging-b3dfg-fixups-and-improvements.patch staging/staging-b3dfg-prepare-b3dfg-for-submission-upstream.patch +f1.patch +f2.patch |
