diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/serial/mos7720.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index aa665817a272..40abedbc5943 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -827,7 +827,6 @@ exit: | |||
827 | dev_err(&urb->dev->dev, | 827 | dev_err(&urb->dev->dev, |
828 | "%s - Error %d submitting control urb\n", | 828 | "%s - Error %d submitting control urb\n", |
829 | __func__, result); | 829 | __func__, result); |
830 | return; | ||
831 | } | 830 | } |
832 | 831 | ||
833 | /* | 832 | /* |
@@ -907,7 +906,6 @@ exit: | |||
907 | dev_err(&urb->dev->dev, | 906 | dev_err(&urb->dev->dev, |
908 | "%s - Error %d submitting control urb\n", | 907 | "%s - Error %d submitting control urb\n", |
909 | __func__, result); | 908 | __func__, result); |
910 | return; | ||
911 | } | 909 | } |
912 | 910 | ||
913 | /* | 911 | /* |
@@ -1227,8 +1225,6 @@ static void mos7720_break(struct tty_struct *tty, int break_state) | |||
1227 | mos7720_port->shadowLCR = data; | 1225 | mos7720_port->shadowLCR = data; |
1228 | write_mos_reg(serial, port->number - port->serial->minor, | 1226 | write_mos_reg(serial, port->number - port->serial->minor, |
1229 | LCR, mos7720_port->shadowLCR); | 1227 | LCR, mos7720_port->shadowLCR); |
1230 | |||
1231 | return; | ||
1232 | } | 1228 | } |
1233 | 1229 | ||
1234 | /* | 1230 | /* |
@@ -1746,7 +1742,6 @@ static void change_port_settings(struct tty_struct *tty, | |||
1746 | dbg("usb_submit_urb(read bulk) failed, status = %d", | 1742 | dbg("usb_submit_urb(read bulk) failed, status = %d", |
1747 | status); | 1743 | status); |
1748 | } | 1744 | } |
1749 | return; | ||
1750 | } | 1745 | } |
1751 | 1746 | ||
1752 | /* | 1747 | /* |
@@ -1803,7 +1798,6 @@ static void mos7720_set_termios(struct tty_struct *tty, | |||
1803 | dbg("usb_submit_urb(read bulk) failed, status = %d", | 1798 | dbg("usb_submit_urb(read bulk) failed, status = %d", |
1804 | status); | 1799 | status); |
1805 | } | 1800 | } |
1806 | return; | ||
1807 | } | 1801 | } |
1808 | 1802 | ||
1809 | /* | 1803 | /* |
@@ -1839,7 +1833,7 @@ static int get_lsr_info(struct tty_struct *tty, | |||
1839 | return 0; | 1833 | return 0; |
1840 | } | 1834 | } |
1841 | 1835 | ||
1842 | static int mos7720_tiocmget(struct tty_struct *tty, struct file *file) | 1836 | static int mos7720_tiocmget(struct tty_struct *tty) |
1843 | { | 1837 | { |
1844 | struct usb_serial_port *port = tty->driver_data; | 1838 | struct usb_serial_port *port = tty->driver_data; |
1845 | struct moschip_port *mos7720_port = usb_get_serial_port_data(port); | 1839 | struct moschip_port *mos7720_port = usb_get_serial_port_data(port); |
@@ -1864,14 +1858,14 @@ static int mos7720_tiocmget(struct tty_struct *tty, struct file *file) | |||
1864 | return result; | 1858 | return result; |
1865 | } | 1859 | } |
1866 | 1860 | ||
1867 | static int mos7720_tiocmset(struct tty_struct *tty, struct file *file, | 1861 | static int mos7720_tiocmset(struct tty_struct *tty, |
1868 | unsigned int set, unsigned int clear) | 1862 | unsigned int set, unsigned int clear) |
1869 | { | 1863 | { |
1870 | struct usb_serial_port *port = tty->driver_data; | 1864 | struct usb_serial_port *port = tty->driver_data; |
1871 | struct moschip_port *mos7720_port = usb_get_serial_port_data(port); | 1865 | struct moschip_port *mos7720_port = usb_get_serial_port_data(port); |
1872 | unsigned int mcr ; | 1866 | unsigned int mcr ; |
1873 | dbg("%s - port %d", __func__, port->number); | 1867 | dbg("%s - port %d", __func__, port->number); |
1874 | dbg("he was at tiocmget"); | 1868 | dbg("he was at tiocmset"); |
1875 | 1869 | ||
1876 | mcr = mos7720_port->shadowMCR; | 1870 | mcr = mos7720_port->shadowMCR; |
1877 | 1871 | ||
@@ -1896,10 +1890,37 @@ static int mos7720_tiocmset(struct tty_struct *tty, struct file *file, | |||
1896 | return 0; | 1890 | return 0; |
1897 | } | 1891 | } |
1898 | 1892 | ||
1893 | static int mos7720_get_icount(struct tty_struct *tty, | ||
1894 | struct serial_icounter_struct *icount) | ||
1895 | { | ||
1896 | struct usb_serial_port *port = tty->driver_data; | ||
1897 | struct moschip_port *mos7720_port; | ||
1898 | struct async_icount cnow; | ||
1899 | |||
1900 | mos7720_port = usb_get_serial_port_data(port); | ||
1901 | cnow = mos7720_port->icount; | ||
1902 | |||
1903 | icount->cts = cnow.cts; | ||
1904 | icount->dsr = cnow.dsr; | ||
1905 | icount->rng = cnow.rng; | ||
1906 | icount->dcd = cnow.dcd; | ||
1907 | icount->rx = cnow.rx; | ||
1908 | icount->tx = cnow.tx; | ||
1909 | icount->frame = cnow.frame; | ||
1910 | icount->overrun = cnow.overrun; | ||
1911 | icount->parity = cnow.parity; | ||
1912 | icount->brk = cnow.brk; | ||
1913 | icount->buf_overrun = cnow.buf_overrun; | ||
1914 | |||
1915 | dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, | ||
1916 | port->number, icount->rx, icount->tx); | ||
1917 | return 0; | ||
1918 | } | ||
1919 | |||
1899 | static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, | 1920 | static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, |
1900 | unsigned int __user *value) | 1921 | unsigned int __user *value) |
1901 | { | 1922 | { |
1902 | unsigned int mcr ; | 1923 | unsigned int mcr; |
1903 | unsigned int arg; | 1924 | unsigned int arg; |
1904 | 1925 | ||
1905 | struct usb_serial_port *port; | 1926 | struct usb_serial_port *port; |
@@ -1966,14 +1987,13 @@ static int get_serial_info(struct moschip_port *mos7720_port, | |||
1966 | return 0; | 1987 | return 0; |
1967 | } | 1988 | } |
1968 | 1989 | ||
1969 | static int mos7720_ioctl(struct tty_struct *tty, struct file *file, | 1990 | static int mos7720_ioctl(struct tty_struct *tty, |
1970 | unsigned int cmd, unsigned long arg) | 1991 | unsigned int cmd, unsigned long arg) |
1971 | { | 1992 | { |
1972 | struct usb_serial_port *port = tty->driver_data; | 1993 | struct usb_serial_port *port = tty->driver_data; |
1973 | struct moschip_port *mos7720_port; | 1994 | struct moschip_port *mos7720_port; |
1974 | struct async_icount cnow; | 1995 | struct async_icount cnow; |
1975 | struct async_icount cprev; | 1996 | struct async_icount cprev; |
1976 | struct serial_icounter_struct icount; | ||
1977 | 1997 | ||
1978 | mos7720_port = usb_get_serial_port_data(port); | 1998 | mos7720_port = usb_get_serial_port_data(port); |
1979 | if (mos7720_port == NULL) | 1999 | if (mos7720_port == NULL) |
@@ -2021,29 +2041,6 @@ static int mos7720_ioctl(struct tty_struct *tty, struct file *file, | |||
2021 | } | 2041 | } |
2022 | /* NOTREACHED */ | 2042 | /* NOTREACHED */ |
2023 | break; | 2043 | break; |
2024 | |||
2025 | case TIOCGICOUNT: | ||
2026 | cnow = mos7720_port->icount; | ||
2027 | |||
2028 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | ||
2029 | |||
2030 | icount.cts = cnow.cts; | ||
2031 | icount.dsr = cnow.dsr; | ||
2032 | icount.rng = cnow.rng; | ||
2033 | icount.dcd = cnow.dcd; | ||
2034 | icount.rx = cnow.rx; | ||
2035 | icount.tx = cnow.tx; | ||
2036 | icount.frame = cnow.frame; | ||
2037 | icount.overrun = cnow.overrun; | ||
2038 | icount.parity = cnow.parity; | ||
2039 | icount.brk = cnow.brk; | ||
2040 | icount.buf_overrun = cnow.buf_overrun; | ||
2041 | |||
2042 | dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, | ||
2043 | port->number, icount.rx, icount.tx); | ||
2044 | if (copy_to_user((void __user *)arg, &icount, sizeof(icount))) | ||
2045 | return -EFAULT; | ||
2046 | return 0; | ||
2047 | } | 2044 | } |
2048 | 2045 | ||
2049 | return -ENOIOCTLCMD; | 2046 | return -ENOIOCTLCMD; |
@@ -2055,7 +2052,7 @@ static int mos7720_startup(struct usb_serial *serial) | |||
2055 | struct usb_device *dev; | 2052 | struct usb_device *dev; |
2056 | int i; | 2053 | int i; |
2057 | char data; | 2054 | char data; |
2058 | u16 product = le16_to_cpu(serial->dev->descriptor.idProduct); | 2055 | u16 product; |
2059 | int ret_val; | 2056 | int ret_val; |
2060 | 2057 | ||
2061 | dbg("%s: Entering ..........", __func__); | 2058 | dbg("%s: Entering ..........", __func__); |
@@ -2065,6 +2062,7 @@ static int mos7720_startup(struct usb_serial *serial) | |||
2065 | return -ENODEV; | 2062 | return -ENODEV; |
2066 | } | 2063 | } |
2067 | 2064 | ||
2065 | product = le16_to_cpu(serial->dev->descriptor.idProduct); | ||
2068 | dev = serial->dev; | 2066 | dev = serial->dev; |
2069 | 2067 | ||
2070 | /* | 2068 | /* |
@@ -2212,6 +2210,7 @@ static struct usb_serial_driver moschip7720_2port_driver = { | |||
2212 | .ioctl = mos7720_ioctl, | 2210 | .ioctl = mos7720_ioctl, |
2213 | .tiocmget = mos7720_tiocmget, | 2211 | .tiocmget = mos7720_tiocmget, |
2214 | .tiocmset = mos7720_tiocmset, | 2212 | .tiocmset = mos7720_tiocmset, |
2213 | .get_icount = mos7720_get_icount, | ||
2215 | .set_termios = mos7720_set_termios, | 2214 | .set_termios = mos7720_set_termios, |
2216 | .write = mos7720_write, | 2215 | .write = mos7720_write, |
2217 | .write_room = mos7720_write_room, | 2216 | .write_room = mos7720_write_room, |