~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

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