~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/staging/quatech_usb2/quatech_usb2.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
 * value of the line status flags from the port
149
149
 * @shadowMSR: Last received state of the modem status register, holds
150
150
 * the value of the modem status received from the port
151
 
 * @rcv_flush: Flag indicating that a receive flush has occured on
 
151
 * @rcv_flush: Flag indicating that a receive flush has occurred on
152
152
 * the hardware.
153
153
 * @xmit_flush: Flag indicating that a transmit flush has been processed by
154
154
 * the hardware.
156
156
 * includes the size (excluding header) of URBs that have been submitted but
157
157
 * have not yet been sent to to the device, and bytes that have been sent out
158
158
 * of the port but not yet reported sent by the "xmit_empty" messages (which
159
 
 * indicate the number of bytes sent each time they are recieved, despite the
 
159
 * indicate the number of bytes sent each time they are received, despite the
160
160
 * misleading name).
161
161
 * - Starts at zero when port is initialised.
162
162
 * - is incremented by the size of the data to be written (no headers)
649
649
        /* although the USB side is now empty, the UART itself may
650
650
         * still be pushing characters out over the line, so we have to
651
651
         * wait testing the actual line status until the lines change
652
 
         * indicating that the data is done transfering. */
 
652
         * indicating that the data is done transferring. */
653
653
        /* FIXME: slow this polling down so it doesn't run the USB bus flat out
654
654
         * if it actually has to spend any time in this loop (which it normally
655
655
         * doesn't because the buffer is nearly empty) */
726
726
                return 0;
727
727
        } else if (port_extra->tx_pending_bytes >= QT2_FIFO_DEPTH) {
728
728
                /* buffer is full (==). > should not occur, but would indicate
729
 
                 * that an overflow had occured */
 
729
                 * that an overflow had occurred */
730
730
                dbg("%s(): port transmit buffer is full!", __func__);
731
731
                /* schedule_work(&port->work); commented in vendor driver */
732
732
                return 0;
823
823
         * reduce the free space count by the size of the dispatched write.
824
824
         * When a "transmit empty" message comes back up the USB read stream,
825
825
         * we decrement the count by the number of bytes reported sent, thus
826
 
         * keeping track of the difference between sent and recieved bytes.
 
826
         * keeping track of the difference between sent and received bytes.
827
827
         */
828
828
 
829
829
        room = (QT2_FIFO_DEPTH - port_extra->tx_pending_bytes);
852
852
 * TIOCMGET and TIOCMSET are filtered off to their own methods before they get
853
853
 * here, so we don't have to handle them.
854
854
 */
855
 
static int qt2_ioctl(struct tty_struct *tty, struct file *file,
 
855
static int qt2_ioctl(struct tty_struct *tty,
856
856
                     unsigned int cmd, unsigned long arg)
857
857
{
858
858
        struct usb_serial_port *port = tty->driver_data;
1078
1078
        }
1079
1079
}
1080
1080
 
1081
 
static int qt2_tiocmget(struct tty_struct *tty, struct file *file)
 
1081
static int qt2_tiocmget(struct tty_struct *tty)
1082
1082
{
1083
1083
        struct usb_serial_port *port = tty->driver_data;
1084
1084
        struct usb_serial *serial = port->serial;
1121
1121
        }
1122
1122
}
1123
1123
 
1124
 
static int qt2_tiocmset(struct tty_struct *tty, struct file *file,
 
1124
static int qt2_tiocmset(struct tty_struct *tty,
1125
1125
                       unsigned int set, unsigned int clear)
1126
1126
{
1127
1127
        struct usb_serial_port *port = tty->driver_data;
1221
1221
        }
1222
1222
        /* Send command to box to stop receiving stuff. This will stop this
1223
1223
         * particular UART from filling the endpoint - in the multiport case the
1224
 
         * FPGA UART will handle any flow control implmented, but for the single
 
1224
         * FPGA UART will handle any flow control implemented, but for the single
1225
1225
         * port it's handed differently and we just quit submitting urbs
1226
1226
         */
1227
1227
        if (serial->dev->descriptor.idProduct != QUATECH_SSU2_100)
1795
1795
        }
1796
1796
}
1797
1797
 
1798
 
/** @brief Retreive the value of a register from the device
 
1798
/** @brief Retrieve the value of a register from the device
1799
1799
 *
1800
1800
 * Issues a GET_REGISTER vendor-spcific request over the USB control
1801
1801
 * pipe to obtain a value back from a specific register on a specific