aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/Kconfig4
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c15
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c9
-rw-r--r--drivers/char/pcmcia/ipwireless/Makefile2
-rw-r--r--drivers/char/pcmcia/synclink_cs.c60
5 files changed, 45 insertions, 45 deletions
diff --git a/drivers/char/pcmcia/Kconfig b/drivers/char/pcmcia/Kconfig
index ffa0efce0aed..6614416a8623 100644
--- a/drivers/char/pcmcia/Kconfig
+++ b/drivers/char/pcmcia/Kconfig
@@ -28,7 +28,7 @@ config CARDMAN_4000
28 28
29 This kernel driver requires additional userspace support, either 29 This kernel driver requires additional userspace support, either
30 by the vendor-provided PC/SC ifd_handler (http://www.omnikey.com/), 30 by the vendor-provided PC/SC ifd_handler (http://www.omnikey.com/),
31 or via the cm4000 backend of OpenCT (http://www.opensc.com/). 31 or via the cm4000 backend of OpenCT (http://www.opensc-project.org/opensc).
32 32
33config CARDMAN_4040 33config CARDMAN_4040
34 tristate "Omnikey CardMan 4040 support" 34 tristate "Omnikey CardMan 4040 support"
@@ -41,7 +41,7 @@ config CARDMAN_4040
41 in I/O space. To use the kernel driver, you will need either the 41 in I/O space. To use the kernel driver, you will need either the
42 PC/SC ifdhandler provided from the Omnikey homepage 42 PC/SC ifdhandler provided from the Omnikey homepage
43 (http://www.omnikey.com/), or a current development version of OpenCT 43 (http://www.omnikey.com/), or a current development version of OpenCT
44 (http://www.opensc.org/). 44 (http://www.opensc-project.org/opensc).
45 45
46config IPWIRELESS 46config IPWIRELESS
47 tristate "IPWireless 3G UMTS PCMCIA card support" 47 tristate "IPWireless 3G UMTS PCMCIA card support"
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index c7b482d15e2a..d962f25dcc2a 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -30,7 +30,7 @@
30#include <linux/fs.h> 30#include <linux/fs.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/bitrev.h> 32#include <linux/bitrev.h>
33#include <linux/smp_lock.h> 33#include <linux/mutex.h>
34#include <linux/uaccess.h> 34#include <linux/uaccess.h>
35#include <linux/io.h> 35#include <linux/io.h>
36 36
@@ -54,6 +54,8 @@
54 __func__ , ## args); \ 54 __func__ , ## args); \
55 } while (0) 55 } while (0)
56 56
57static DEFINE_MUTEX(cmm_mutex);
58
57#define T_1SEC (HZ) 59#define T_1SEC (HZ)
58#define T_10MSEC msecs_to_jiffies(10) 60#define T_10MSEC msecs_to_jiffies(10)
59#define T_20MSEC msecs_to_jiffies(20) 61#define T_20MSEC msecs_to_jiffies(20)
@@ -1415,7 +1417,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1415 iminor(inode), ioctl_names[_IOC_NR(cmd)]); 1417 iminor(inode), ioctl_names[_IOC_NR(cmd)]);
1416#endif 1418#endif
1417 1419
1418 lock_kernel(); 1420 mutex_lock(&cmm_mutex);
1419 rc = -ENODEV; 1421 rc = -ENODEV;
1420 link = dev_table[iminor(inode)]; 1422 link = dev_table[iminor(inode)];
1421 if (!pcmcia_dev_present(link)) { 1423 if (!pcmcia_dev_present(link)) {
@@ -1623,7 +1625,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1623 rc = -ENOTTY; 1625 rc = -ENOTTY;
1624 } 1626 }
1625out: 1627out:
1626 unlock_kernel(); 1628 mutex_unlock(&cmm_mutex);
1627 return rc; 1629 return rc;
1628} 1630}
1629 1631
@@ -1637,7 +1639,7 @@ static int cmm_open(struct inode *inode, struct file *filp)
1637 if (minor >= CM4000_MAX_DEV) 1639 if (minor >= CM4000_MAX_DEV)
1638 return -ENODEV; 1640 return -ENODEV;
1639 1641
1640 lock_kernel(); 1642 mutex_lock(&cmm_mutex);
1641 link = dev_table[minor]; 1643 link = dev_table[minor];
1642 if (link == NULL || !pcmcia_dev_present(link)) { 1644 if (link == NULL || !pcmcia_dev_present(link)) {
1643 ret = -ENODEV; 1645 ret = -ENODEV;
@@ -1664,7 +1666,7 @@ static int cmm_open(struct inode *inode, struct file *filp)
1664 /* opening will always block since the 1666 /* opening will always block since the
1665 * monitor will be started by open, which 1667 * monitor will be started by open, which
1666 * means we have to wait for ATR becoming 1668 * means we have to wait for ATR becoming
1667 * vaild = block until valid (or card 1669 * valid = block until valid (or card
1668 * inserted) 1670 * inserted)
1669 */ 1671 */
1670 if (filp->f_flags & O_NONBLOCK) { 1672 if (filp->f_flags & O_NONBLOCK) {
@@ -1682,7 +1684,7 @@ static int cmm_open(struct inode *inode, struct file *filp)
1682 DEBUGP(2, dev, "<- cmm_open\n"); 1684 DEBUGP(2, dev, "<- cmm_open\n");
1683 ret = nonseekable_open(inode, filp); 1685 ret = nonseekable_open(inode, filp);
1684out: 1686out:
1685 unlock_kernel(); 1687 mutex_unlock(&cmm_mutex);
1686 return ret; 1688 return ret;
1687} 1689}
1688 1690
@@ -1864,6 +1866,7 @@ static const struct file_operations cm4000_fops = {
1864 .unlocked_ioctl = cmm_ioctl, 1866 .unlocked_ioctl = cmm_ioctl,
1865 .open = cmm_open, 1867 .open = cmm_open,
1866 .release= cmm_close, 1868 .release= cmm_close,
1869 .llseek = no_llseek,
1867}; 1870};
1868 1871
1869static struct pcmcia_device_id cm4000_ids[] = { 1872static struct pcmcia_device_id cm4000_ids[] = {
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index bf2f046fc2c1..5d8d59e865f4 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -24,7 +24,7 @@
24#include <linux/fs.h> 24#include <linux/fs.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/poll.h> 26#include <linux/poll.h>
27#include <linux/smp_lock.h> 27#include <linux/mutex.h>
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/io.h> 30#include <asm/io.h>
@@ -48,6 +48,8 @@
48 __func__ , ## args); \ 48 __func__ , ## args); \
49 } while (0) 49 } while (0)
50 50
51static DEFINE_MUTEX(cm4040_mutex);
52
51#define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) 53#define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ)
52#define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) 54#define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ)
53#define CCID_DRIVER_MINIMUM_TIMEOUT (3*HZ) 55#define CCID_DRIVER_MINIMUM_TIMEOUT (3*HZ)
@@ -440,7 +442,7 @@ static int cm4040_open(struct inode *inode, struct file *filp)
440 if (minor >= CM_MAX_DEV) 442 if (minor >= CM_MAX_DEV)
441 return -ENODEV; 443 return -ENODEV;
442 444
443 lock_kernel(); 445 mutex_lock(&cm4040_mutex);
444 link = dev_table[minor]; 446 link = dev_table[minor];
445 if (link == NULL || !pcmcia_dev_present(link)) { 447 if (link == NULL || !pcmcia_dev_present(link)) {
446 ret = -ENODEV; 448 ret = -ENODEV;
@@ -469,7 +471,7 @@ static int cm4040_open(struct inode *inode, struct file *filp)
469 DEBUGP(2, dev, "<- cm4040_open (successfully)\n"); 471 DEBUGP(2, dev, "<- cm4040_open (successfully)\n");
470 ret = nonseekable_open(inode, filp); 472 ret = nonseekable_open(inode, filp);
471out: 473out:
472 unlock_kernel(); 474 mutex_unlock(&cm4040_mutex);
473 return ret; 475 return ret;
474} 476}
475 477
@@ -628,6 +630,7 @@ static const struct file_operations reader_fops = {
628 .open = cm4040_open, 630 .open = cm4040_open,
629 .release = cm4040_close, 631 .release = cm4040_close,
630 .poll = cm4040_poll, 632 .poll = cm4040_poll,
633 .llseek = no_llseek,
631}; 634};
632 635
633static struct pcmcia_device_id cm4040_ids[] = { 636static struct pcmcia_device_id cm4040_ids[] = {
diff --git a/drivers/char/pcmcia/ipwireless/Makefile b/drivers/char/pcmcia/ipwireless/Makefile
index b71eb593643d..db80873d7f20 100644
--- a/drivers/char/pcmcia/ipwireless/Makefile
+++ b/drivers/char/pcmcia/ipwireless/Makefile
@@ -6,5 +6,5 @@
6 6
7obj-$(CONFIG_IPWIRELESS) += ipwireless.o 7obj-$(CONFIG_IPWIRELESS) += ipwireless.o
8 8
9ipwireless-objs := hardware.o main.o network.o tty.o 9ipwireless-y := hardware.o main.o network.o tty.o
10 10
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index be1810057607..bfc10f89d951 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2191,6 +2191,32 @@ static int mgslpc_break(struct tty_struct *tty, int break_state)
2191 return 0; 2191 return 0;
2192} 2192}
2193 2193
2194static int mgslpc_get_icount(struct tty_struct *tty,
2195 struct serial_icounter_struct *icount)
2196{
2197 MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
2198 struct mgsl_icount cnow; /* kernel counter temps */
2199 unsigned long flags;
2200
2201 spin_lock_irqsave(&info->lock,flags);
2202 cnow = info->icount;
2203 spin_unlock_irqrestore(&info->lock,flags);
2204
2205 icount->cts = cnow.cts;
2206 icount->dsr = cnow.dsr;
2207 icount->rng = cnow.rng;
2208 icount->dcd = cnow.dcd;
2209 icount->rx = cnow.rx;
2210 icount->tx = cnow.tx;
2211 icount->frame = cnow.frame;
2212 icount->overrun = cnow.overrun;
2213 icount->parity = cnow.parity;
2214 icount->brk = cnow.brk;
2215 icount->buf_overrun = cnow.buf_overrun;
2216
2217 return 0;
2218}
2219
2194/* Service an IOCTL request 2220/* Service an IOCTL request
2195 * 2221 *
2196 * Arguments: 2222 * Arguments:
@@ -2206,11 +2232,7 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
2206 unsigned int cmd, unsigned long arg) 2232 unsigned int cmd, unsigned long arg)
2207{ 2233{
2208 MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data; 2234 MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
2209 int error;
2210 struct mgsl_icount cnow; /* kernel counter temps */
2211 struct serial_icounter_struct __user *p_cuser; /* user space */
2212 void __user *argp = (void __user *)arg; 2235 void __user *argp = (void __user *)arg;
2213 unsigned long flags;
2214 2236
2215 if (debug_level >= DEBUG_LEVEL_INFO) 2237 if (debug_level >= DEBUG_LEVEL_INFO)
2216 printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__,__LINE__, 2238 printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
@@ -2220,7 +2242,7 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
2220 return -ENODEV; 2242 return -ENODEV;
2221 2243
2222 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 2244 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
2223 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { 2245 (cmd != TIOCMIWAIT)) {
2224 if (tty->flags & (1 << TTY_IO_ERROR)) 2246 if (tty->flags & (1 << TTY_IO_ERROR))
2225 return -EIO; 2247 return -EIO;
2226 } 2248 }
@@ -2250,34 +2272,6 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
2250 return wait_events(info, argp); 2272 return wait_events(info, argp);
2251 case TIOCMIWAIT: 2273 case TIOCMIWAIT:
2252 return modem_input_wait(info,(int)arg); 2274 return modem_input_wait(info,(int)arg);
2253 case TIOCGICOUNT:
2254 spin_lock_irqsave(&info->lock,flags);
2255 cnow = info->icount;
2256 spin_unlock_irqrestore(&info->lock,flags);
2257 p_cuser = argp;
2258 PUT_USER(error,cnow.cts, &p_cuser->cts);
2259 if (error) return error;
2260 PUT_USER(error,cnow.dsr, &p_cuser->dsr);
2261 if (error) return error;
2262 PUT_USER(error,cnow.rng, &p_cuser->rng);
2263 if (error) return error;
2264 PUT_USER(error,cnow.dcd, &p_cuser->dcd);
2265 if (error) return error;
2266 PUT_USER(error,cnow.rx, &p_cuser->rx);
2267 if (error) return error;
2268 PUT_USER(error,cnow.tx, &p_cuser->tx);
2269 if (error) return error;
2270 PUT_USER(error,cnow.frame, &p_cuser->frame);
2271 if (error) return error;
2272 PUT_USER(error,cnow.overrun, &p_cuser->overrun);
2273 if (error) return error;
2274 PUT_USER(error,cnow.parity, &p_cuser->parity);
2275 if (error) return error;
2276 PUT_USER(error,cnow.brk, &p_cuser->brk);
2277 if (error) return error;
2278 PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun);
2279 if (error) return error;
2280 return 0;
2281 default: 2275 default:
2282 return -ENOIOCTLCMD; 2276 return -ENOIOCTLCMD;
2283 } 2277 }