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

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/all/tty-icount-changeover-for-other-main-devices.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Alan Cox <alan@linux.intel.com>
2
 
Date: Thu, 16 Sep 2010 18:21:52 +0100
3
 
Subject: [PATCH 2/4] tty: icount changeover for other main devices
4
 
 
5
 
commit 0587102cf9f427c185bfdeb2cef41e13ee0264b1 upstream.
6
 
 
7
 
Again basically cut and paste
8
 
 
9
 
Convert the main driver set to use the hooks for GICOUNT
10
 
 
11
 
Signed-off-by: Alan Cox <alan@linux.intel.com>
12
 
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13
 
---
14
 
 arch/ia64/hp/sim/simserial.c      |   12 +------
15
 
 drivers/char/amiserial.c          |   56 ++++++++++++++++-------------
16
 
 drivers/char/cyclades.c           |   49 +++++++++++++------------
17
 
 drivers/char/ip2/ip2main.c        |   72 ++++++++++++++++++++++---------------
18
 
 drivers/char/mxser.c              |   62 ++++++++++++++++++--------------
19
 
 drivers/char/nozomi.c             |   37 +++++++++----------
20
 
 drivers/char/pcmcia/synclink_cs.c |   60 ++++++++++++++-----------------
21
 
 drivers/char/synclink.c           |   73 +++++++++++++++++--------------------
22
 
 drivers/char/synclink_gt.c        |   56 +++++++++++++++--------------
23
 
 drivers/char/synclinkmp.c         |   61 ++++++++++++++-----------------
24
 
 drivers/serial/68360serial.c      |   51 +++++++++++++-------------
25
 
 net/bluetooth/rfcomm/tty.c        |    4 --
26
 
 12 files changed, 297 insertions(+), 296 deletions(-)
27
 
 
28
 
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
29
 
index 2bef526..204f650 100644
30
 
--- a/arch/ia64/hp/sim/simserial.c
31
 
+++ b/arch/ia64/hp/sim/simserial.c
32
 
@@ -395,7 +395,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
33
 
 {
34
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
35
 
            (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
36
 
-           (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
37
 
+           (cmd != TIOCMIWAIT)) {
38
 
                if (tty->flags & (1 << TTY_IO_ERROR))
39
 
                    return -EIO;
40
 
        }
41
 
@@ -433,16 +433,6 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
42
 
                case TIOCMIWAIT:
43
 
                        printk(KERN_INFO "rs_ioctl: TIOCMIWAIT: called\n");
44
 
                        return 0;
45
 
-               /*
46
 
-                * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
47
 
-                * Return: write counters to the user passed counter struct
48
 
-                * NB: both 1->0 and 0->1 transitions are counted except for
49
 
-                *     RI where only 0->1 is counted.
50
 
-                */
51
 
-               case TIOCGICOUNT:
52
 
-                       printk(KERN_INFO "rs_ioctl: TIOCGICOUNT called\n");
53
 
-                       return 0;
54
 
-
55
 
                case TIOCSERGWILD:
56
 
                case TIOCSERSWILD:
57
 
                        /* "setserial -W" is called in Debian boot */
58
 
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
59
 
index 6c32fbf..579d479 100644
60
 
--- a/drivers/char/amiserial.c
61
 
+++ b/drivers/char/amiserial.c
62
 
@@ -1262,6 +1262,36 @@ static int rs_break(struct tty_struct *tty, int break_state)
63
 
        return 0;
64
 
 }
65
 
 
66
 
+/*
67
 
+ * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
68
 
+ * Return: write counters to the user passed counter struct
69
 
+ * NB: both 1->0 and 0->1 transitions are counted except for
70
 
+ *     RI where only 0->1 is counted.
71
 
+ */
72
 
+static int rs_get_icount(struct tty_struct *tty,
73
 
+                               struct serial_icounter_struct *icount)
74
 
+{
75
 
+       struct async_struct *info = tty->driver_data;
76
 
+       struct async_icount cnow;
77
 
+       unsigned long flags;
78
 
+
79
 
+       local_irq_save(flags);
80
 
+       cnow = info->state->icount;
81
 
+       local_irq_restore(flags);
82
 
+       icount->cts = cnow.cts;
83
 
+       icount->dsr = cnow.dsr;
84
 
+       icount->rng = cnow.rng;
85
 
+       icount->dcd = cnow.dcd;
86
 
+       icount->rx = cnow.rx;
87
 
+       icount->tx = cnow.tx;
88
 
+       icount->frame = cnow.frame;
89
 
+       icount->overrun = cnow.overrun;
90
 
+       icount->parity = cnow.parity;
91
 
+       icount->brk = cnow.brk;
92
 
+       icount->buf_overrun = cnow.buf_overrun;
93
 
+
94
 
+       return 0;
95
 
+}
96
 
 
97
 
 static int rs_ioctl(struct tty_struct *tty, struct file * file,
98
 
                    unsigned int cmd, unsigned long arg)
99
 
@@ -1331,31 +1361,6 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
100
 
                        }
101
 
                        /* NOTREACHED */
102
 
 
103
 
-               /* 
104
 
-                * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
105
 
-                * Return: write counters to the user passed counter struct
106
 
-                * NB: both 1->0 and 0->1 transitions are counted except for
107
 
-                *     RI where only 0->1 is counted.
108
 
-                */
109
 
-               case TIOCGICOUNT:
110
 
-                       local_irq_save(flags);
111
 
-                       cnow = info->state->icount;
112
 
-                       local_irq_restore(flags);
113
 
-                       icount.cts = cnow.cts;
114
 
-                       icount.dsr = cnow.dsr;
115
 
-                       icount.rng = cnow.rng;
116
 
-                       icount.dcd = cnow.dcd;
117
 
-                       icount.rx = cnow.rx;
118
 
-                       icount.tx = cnow.tx;
119
 
-                       icount.frame = cnow.frame;
120
 
-                       icount.overrun = cnow.overrun;
121
 
-                       icount.parity = cnow.parity;
122
 
-                       icount.brk = cnow.brk;
123
 
-                       icount.buf_overrun = cnow.buf_overrun;
124
 
-
125
 
-                       if (copy_to_user(argp, &icount, sizeof(icount)))
126
 
-                               return -EFAULT;
127
 
-                       return 0;
128
 
                case TIOCSERGWILD:
129
 
                case TIOCSERSWILD:
130
 
                        /* "setserial -W" is called in Debian boot */
131
 
@@ -1948,6 +1953,7 @@ static const struct tty_operations serial_ops = {
132
 
        .wait_until_sent = rs_wait_until_sent,
133
 
        .tiocmget = rs_tiocmget,
134
 
        .tiocmset = rs_tiocmset,
135
 
+       .get_icount = rs_get_icount,
136
 
        .proc_fops = &rs_proc_fops,
137
 
 };
138
 
 
139
 
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
140
 
index 0113574..eb863de 100644
141
 
--- a/drivers/char/cyclades.c
142
 
+++ b/drivers/char/cyclades.c
143
 
@@ -2798,29 +2798,6 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
144
 
                 * NB: both 1->0 and 0->1 transitions are counted except for
145
 
                 *     RI where only 0->1 is counted.
146
 
                 */
147
 
-       case TIOCGICOUNT: {
148
 
-               struct serial_icounter_struct sic = { };
149
 
-
150
 
-               spin_lock_irqsave(&info->card->card_lock, flags);
151
 
-               cnow = info->icount;
152
 
-               spin_unlock_irqrestore(&info->card->card_lock, flags);
153
 
-
154
 
-               sic.cts = cnow.cts;
155
 
-               sic.dsr = cnow.dsr;
156
 
-               sic.rng = cnow.rng;
157
 
-               sic.dcd = cnow.dcd;
158
 
-               sic.rx = cnow.rx;
159
 
-               sic.tx = cnow.tx;
160
 
-               sic.frame = cnow.frame;
161
 
-               sic.overrun = cnow.overrun;
162
 
-               sic.parity = cnow.parity;
163
 
-               sic.brk = cnow.brk;
164
 
-               sic.buf_overrun = cnow.buf_overrun;
165
 
-
166
 
-               if (copy_to_user(argp, &sic, sizeof(sic)))
167
 
-                       ret_val = -EFAULT;
168
 
-               break;
169
 
-       }
170
 
        default:
171
 
                ret_val = -ENOIOCTLCMD;
172
 
        }
173
 
@@ -2832,6 +2809,31 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
174
 
        return ret_val;
175
 
 }                              /* cy_ioctl */
176
 
 
177
 
+static int cy_get_icount(struct tty_struct *tty,
178
 
+                               struct serial_icounter_struct *sic)
179
 
+{
180
 
+       struct cyclades_port *info = tty->driver_data;
181
 
+       struct cyclades_icount cnow;    /* Used to snapshot */
182
 
+       unsigned long flags;
183
 
+
184
 
+       spin_lock_irqsave(&info->card->card_lock, flags);
185
 
+       cnow = info->icount;
186
 
+       spin_unlock_irqrestore(&info->card->card_lock, flags);
187
 
+
188
 
+       sic->cts = cnow.cts;
189
 
+       sic->dsr = cnow.dsr;
190
 
+       sic->rng = cnow.rng;
191
 
+       sic->dcd = cnow.dcd;
192
 
+       sic->rx = cnow.rx;
193
 
+       sic->tx = cnow.tx;
194
 
+       sic->frame = cnow.frame;
195
 
+       sic->overrun = cnow.overrun;
196
 
+       sic->parity = cnow.parity;
197
 
+       sic->brk = cnow.brk;
198
 
+       sic->buf_overrun = cnow.buf_overrun;
199
 
+       return 0;
200
 
+}
201
 
+
202
 
 /*
203
 
  * This routine allows the tty driver to be notified when
204
 
  * device's termios settings have changed.  Note that a
205
 
@@ -4098,6 +4100,7 @@ static const struct tty_operations cy_ops = {
206
 
        .wait_until_sent = cy_wait_until_sent,
207
 
        .tiocmget = cy_tiocmget,
208
 
        .tiocmset = cy_tiocmset,
209
 
+       .get_icount = cy_get_icount,
210
 
        .proc_fops = &cyclades_proc_fops,
211
 
 };
212
 
 
213
 
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
214
 
index 791e589..e04c1d3 100644
215
 
--- a/drivers/char/ip2/ip2main.c
216
 
+++ b/drivers/char/ip2/ip2main.c
217
 
@@ -183,6 +183,8 @@ static void ip2_hangup(PTTY);
218
 
 static int  ip2_tiocmget(struct tty_struct *tty, struct file *file);
219
 
 static int  ip2_tiocmset(struct tty_struct *tty, struct file *file,
220
 
                         unsigned int set, unsigned int clear);
221
 
+static int ip2_get_icount(struct tty_struct *tty,
222
 
+               struct serial_icounter_struct *icount);
223
 
 
224
 
 static void set_irq(int, int);
225
 
 static void ip2_interrupt_bh(struct work_struct *work);
226
 
@@ -448,6 +450,7 @@ static const struct tty_operations ip2_ops = {
227
 
        .hangup          = ip2_hangup,
228
 
        .tiocmget        = ip2_tiocmget,
229
 
        .tiocmset        = ip2_tiocmset,
230
 
+       .get_icount      = ip2_get_icount,
231
 
        .proc_fops       = &ip2_proc_fops,
232
 
 };
233
 
 
234
 
@@ -2112,7 +2115,6 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
235
 
        i2ChanStrPtr pCh = DevTable[tty->index];
236
 
        i2eBordStrPtr pB;
237
 
        struct async_icount cprev, cnow;        /* kernel counter temps */
238
 
-       struct serial_icounter_struct __user *p_cuser;
239
 
        int rc = 0;
240
 
        unsigned long flags;
241
 
        void __user *argp = (void __user *)arg;
242
 
@@ -2281,34 +2283,6 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
243
 
                break;
244
 
 
245
 
        /*
246
 
-        * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
247
 
-        * Return: write counters to the user passed counter struct
248
 
-        * NB: both 1->0 and 0->1 transitions are counted except for RI where
249
 
-        * only 0->1 is counted. The controller is quite capable of counting
250
 
-        * both, but this done to preserve compatibility with the standard
251
 
-        * serial driver.
252
 
-        */
253
 
-       case TIOCGICOUNT:
254
 
-               ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc );
255
 
-
256
 
-               write_lock_irqsave(&pB->read_fifo_spinlock, flags);
257
 
-               cnow = pCh->icount;
258
 
-               write_unlock_irqrestore(&pB->read_fifo_spinlock, flags);
259
 
-               p_cuser = argp;
260
 
-               rc = put_user(cnow.cts, &p_cuser->cts);
261
 
-               rc = put_user(cnow.dsr, &p_cuser->dsr);
262
 
-               rc = put_user(cnow.rng, &p_cuser->rng);
263
 
-               rc = put_user(cnow.dcd, &p_cuser->dcd);
264
 
-               rc = put_user(cnow.rx, &p_cuser->rx);
265
 
-               rc = put_user(cnow.tx, &p_cuser->tx);
266
 
-               rc = put_user(cnow.frame, &p_cuser->frame);
267
 
-               rc = put_user(cnow.overrun, &p_cuser->overrun);
268
 
-               rc = put_user(cnow.parity, &p_cuser->parity);
269
 
-               rc = put_user(cnow.brk, &p_cuser->brk);
270
 
-               rc = put_user(cnow.buf_overrun, &p_cuser->buf_overrun);
271
 
-               break;
272
 
-
273
 
-       /*
274
 
         * The rest are not supported by this driver. By returning -ENOIOCTLCMD they
275
 
         * will be passed to the line discipline for it to handle.
276
 
         */
277
 
@@ -2332,6 +2306,46 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
278
 
        return rc;
279
 
 }
280
 
 
281
 
+static int ip2_get_icount(struct tty_struct *tty,
282
 
+               struct serial_icounter_struct *icount)
283
 
+{
284
 
+       i2ChanStrPtr pCh = DevTable[tty->index];
285
 
+       i2eBordStrPtr pB;
286
 
+       struct async_icount cnow;       /* kernel counter temp */
287
 
+       unsigned long flags;
288
 
+
289
 
+       if ( pCh == NULL )
290
 
+               return -ENODEV;
291
 
+
292
 
+       pB = pCh->pMyBord;
293
 
+
294
 
+       /*
295
 
+        * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
296
 
+        * Return: write counters to the user passed counter struct
297
 
+        * NB: both 1->0 and 0->1 transitions are counted except for RI where
298
 
+        * only 0->1 is counted. The controller is quite capable of counting
299
 
+        * both, but this done to preserve compatibility with the standard
300
 
+        * serial driver.
301
 
+        */
302
 
+
303
 
+       write_lock_irqsave(&pB->read_fifo_spinlock, flags);
304
 
+       cnow = pCh->icount;
305
 
+       write_unlock_irqrestore(&pB->read_fifo_spinlock, flags);
306
 
+
307
 
+       icount->cts = cnow.cts;
308
 
+       icount->dsr = cnow.dsr;
309
 
+       icount->rng = cnow.rng;
310
 
+       icount->dcd = cnow.dcd;
311
 
+       icount->rx = cnow.rx;
312
 
+       icount->tx = cnow.tx;
313
 
+       icount->frame = cnow.frame;
314
 
+       icount->overrun = cnow.overrun;
315
 
+       icount->parity = cnow.parity;
316
 
+       icount->brk = cnow.brk;
317
 
+       icount->buf_overrun = cnow.buf_overrun;
318
 
+       return 0;
319
 
+}
320
 
+
321
 
 /******************************************************************************/
322
 
 /* Function:   GetSerialInfo()                                                */
323
 
 /* Parameters: Pointer to channel structure                                   */
324
 
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
325
 
index 5e28d39..4b97406 100644
326
 
--- a/drivers/char/mxser.c
327
 
+++ b/drivers/char/mxser.c
328
 
@@ -1736,7 +1736,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
329
 
                return 0;
330
 
        }
331
 
 
332
 
-       if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT &&
333
 
+       if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT &&
334
 
                        test_bit(TTY_IO_ERROR, &tty->flags))
335
 
                return -EIO;
336
 
 
337
 
@@ -1766,32 +1766,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
338
 
 
339
 
                return wait_event_interruptible(info->port.delta_msr_wait,
340
 
                                mxser_cflags_changed(info, arg, &cnow));
341
 
-       /*
342
 
-        * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
343
 
-        * Return: write counters to the user passed counter struct
344
 
-        * NB: both 1->0 and 0->1 transitions are counted except for
345
 
-        *     RI where only 0->1 is counted.
346
 
-        */
347
 
-       case TIOCGICOUNT: {
348
 
-               struct serial_icounter_struct icnt = { 0 };
349
 
-               spin_lock_irqsave(&info->slock, flags);
350
 
-               cnow = info->icount;
351
 
-               spin_unlock_irqrestore(&info->slock, flags);
352
 
-
353
 
-               icnt.frame = cnow.frame;
354
 
-               icnt.brk = cnow.brk;
355
 
-               icnt.overrun = cnow.overrun;
356
 
-               icnt.buf_overrun = cnow.buf_overrun;
357
 
-               icnt.parity = cnow.parity;
358
 
-               icnt.rx = cnow.rx;
359
 
-               icnt.tx = cnow.tx;
360
 
-               icnt.cts = cnow.cts;
361
 
-               icnt.dsr = cnow.dsr;
362
 
-               icnt.rng = cnow.rng;
363
 
-               icnt.dcd = cnow.dcd;
364
 
-
365
 
-               return copy_to_user(argp, &icnt, sizeof(icnt)) ? -EFAULT : 0;
366
 
-       }
367
 
        case MOXA_HighSpeedOn:
368
 
                return put_user(info->baud_base != 115200 ? 1 : 0, (int __user *)argp);
369
 
        case MOXA_SDS_RSTICOUNTER:
370
 
@@ -1862,6 +1836,39 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
371
 
        return 0;
372
 
 }
373
 
 
374
 
+       /*
375
 
+        * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
376
 
+        * Return: write counters to the user passed counter struct
377
 
+        * NB: both 1->0 and 0->1 transitions are counted except for
378
 
+        *     RI where only 0->1 is counted.
379
 
+        */
380
 
+
381
 
+static int mxser_get_icount(struct tty_struct *tty,
382
 
+               struct serial_icounter_struct *icount)
383
 
+
384
 
+{
385
 
+       struct mxser_port *info = tty->driver_data;
386
 
+       struct async_icount cnow;
387
 
+       unsigned long flags;
388
 
+
389
 
+       spin_lock_irqsave(&info->slock, flags);
390
 
+       cnow = info->icount;
391
 
+       spin_unlock_irqrestore(&info->slock, flags);
392
 
+
393
 
+       icount->frame = cnow.frame;
394
 
+       icount->brk = cnow.brk;
395
 
+       icount->overrun = cnow.overrun;
396
 
+       icount->buf_overrun = cnow.buf_overrun;
397
 
+       icount->parity = cnow.parity;
398
 
+       icount->rx = cnow.rx;
399
 
+       icount->tx = cnow.tx;
400
 
+       icount->cts = cnow.cts;
401
 
+       icount->dsr = cnow.dsr;
402
 
+       icount->rng = cnow.rng;
403
 
+       icount->dcd = cnow.dcd;
404
 
+       return 0;
405
 
+}
406
 
+
407
 
 static void mxser_stoprx(struct tty_struct *tty)
408
 
 {
409
 
        struct mxser_port *info = tty->driver_data;
410
 
@@ -2358,6 +2365,7 @@ static const struct tty_operations mxser_ops = {
411
 
        .wait_until_sent = mxser_wait_until_sent,
412
 
        .tiocmget = mxser_tiocmget,
413
 
        .tiocmset = mxser_tiocmset,
414
 
+       .get_icount = mxser_get_icount,
415
 
 };
416
 
 
417
 
 struct tty_port_operations mxser_port_ops = {
418
 
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
419
 
index dc52f75..19b3e1d 100644
420
 
--- a/drivers/char/nozomi.c
421
 
+++ b/drivers/char/nozomi.c
422
 
@@ -1783,24 +1783,24 @@ static int ntty_cflags_changed(struct port *port, unsigned long flags,
423
 
        return ret;
424
 
 }
425
 
 
426
 
-static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp)
427
 
+static int ntty_tiocgicount(struct tty_struct *tty,
428
 
+                               struct serial_icounter_struct *icount)
429
 
 {
430
 
+       struct port *port = tty->driver_data;
431
 
        const struct async_icount cnow = port->tty_icount;
432
 
-       struct serial_icounter_struct icount;
433
 
-
434
 
-       icount.cts = cnow.cts;
435
 
-       icount.dsr = cnow.dsr;
436
 
-       icount.rng = cnow.rng;
437
 
-       icount.dcd = cnow.dcd;
438
 
-       icount.rx = cnow.rx;
439
 
-       icount.tx = cnow.tx;
440
 
-       icount.frame = cnow.frame;
441
 
-       icount.overrun = cnow.overrun;
442
 
-       icount.parity = cnow.parity;
443
 
-       icount.brk = cnow.brk;
444
 
-       icount.buf_overrun = cnow.buf_overrun;
445
 
-
446
 
-       return copy_to_user(argp, &icount, sizeof(icount)) ? -EFAULT : 0;
447
 
+
448
 
+       icount->cts = cnow.cts;
449
 
+       icount->dsr = cnow.dsr;
450
 
+       icount->rng = cnow.rng;
451
 
+       icount->dcd = cnow.dcd;
452
 
+       icount->rx = cnow.rx;
453
 
+       icount->tx = cnow.tx;
454
 
+       icount->frame = cnow.frame;
455
 
+       icount->overrun = cnow.overrun;
456
 
+       icount->parity = cnow.parity;
457
 
+       icount->brk = cnow.brk;
458
 
+       icount->buf_overrun = cnow.buf_overrun;
459
 
+       return 0;
460
 
 }
461
 
 
462
 
 static int ntty_ioctl(struct tty_struct *tty, struct file *file,
463
 
@@ -1819,9 +1819,7 @@ static int ntty_ioctl(struct tty_struct *tty, struct file *file,
464
 
                rval = wait_event_interruptible(port->tty_wait,
465
 
                                ntty_cflags_changed(port, arg, &cprev));
466
 
                break;
467
 
-       } case TIOCGICOUNT:
468
 
-               rval = ntty_ioctl_tiocgicount(port, argp);
469
 
-               break;
470
 
+       }
471
 
        default:
472
 
                DBG1("ERR: 0x%08X, %d", cmd, cmd);
473
 
                break;
474
 
@@ -1895,6 +1893,7 @@ static const struct tty_operations tty_ops = {
475
 
        .chars_in_buffer = ntty_chars_in_buffer,
476
 
        .tiocmget = ntty_tiocmget,
477
 
        .tiocmset = ntty_tiocmset,
478
 
+       .get_icount = ntty_tiocgicount,
479
 
 };
480
 
 
481
 
 /* Module initialization */
482
 
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
483
 
index a08c899..74d124b 100644
484
 
--- a/drivers/char/pcmcia/synclink_cs.c
485
 
+++ b/drivers/char/pcmcia/synclink_cs.c
486
 
@@ -2252,6 +2252,32 @@ static int mgslpc_break(struct tty_struct *tty, int break_state)
487
 
        return 0;
488
 
 }
489
 
 
490
 
+static int mgslpc_get_icount(struct tty_struct *tty,
491
 
+                               struct serial_icounter_struct *icount)
492
 
+{
493
 
+       MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
494
 
+       struct mgsl_icount cnow;        /* kernel counter temps */
495
 
+       unsigned long flags;
496
 
+
497
 
+       spin_lock_irqsave(&info->lock,flags);
498
 
+       cnow = info->icount;
499
 
+       spin_unlock_irqrestore(&info->lock,flags);
500
 
+
501
 
+       icount->cts = cnow.cts;
502
 
+       icount->dsr = cnow.dsr;
503
 
+       icount->rng = cnow.rng;
504
 
+       icount->dcd = cnow.dcd;
505
 
+       icount->rx = cnow.rx;
506
 
+       icount->tx = cnow.tx;
507
 
+       icount->frame = cnow.frame;
508
 
+       icount->overrun = cnow.overrun;
509
 
+       icount->parity = cnow.parity;
510
 
+       icount->brk = cnow.brk;
511
 
+       icount->buf_overrun = cnow.buf_overrun;
512
 
+
513
 
+       return 0;
514
 
+}
515
 
+
516
 
 /* Service an IOCTL request
517
 
  *
518
 
  * Arguments:
519
 
@@ -2267,11 +2293,7 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
520
 
                        unsigned int cmd, unsigned long arg)
521
 
 {
522
 
        MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
523
 
-       int error;
524
 
-       struct mgsl_icount cnow;        /* kernel counter temps */
525
 
-       struct serial_icounter_struct __user *p_cuser;  /* user space */
526
 
        void __user *argp = (void __user *)arg;
527
 
-       unsigned long flags;
528
 
 
529
 
        if (debug_level >= DEBUG_LEVEL_INFO)
530
 
                printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
531
 
@@ -2281,7 +2303,7 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
532
 
                return -ENODEV;
533
 
 
534
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
535
 
-           (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
536
 
+           (cmd != TIOCMIWAIT)) {
537
 
                if (tty->flags & (1 << TTY_IO_ERROR))
538
 
                    return -EIO;
539
 
        }
540
 
@@ -2311,34 +2333,6 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
541
 
                return wait_events(info, argp);
542
 
        case TIOCMIWAIT:
543
 
                return modem_input_wait(info,(int)arg);
544
 
-       case TIOCGICOUNT:
545
 
-               spin_lock_irqsave(&info->lock,flags);
546
 
-               cnow = info->icount;
547
 
-               spin_unlock_irqrestore(&info->lock,flags);
548
 
-               p_cuser = argp;
549
 
-               PUT_USER(error,cnow.cts, &p_cuser->cts);
550
 
-               if (error) return error;
551
 
-               PUT_USER(error,cnow.dsr, &p_cuser->dsr);
552
 
-               if (error) return error;
553
 
-               PUT_USER(error,cnow.rng, &p_cuser->rng);
554
 
-               if (error) return error;
555
 
-               PUT_USER(error,cnow.dcd, &p_cuser->dcd);
556
 
-               if (error) return error;
557
 
-               PUT_USER(error,cnow.rx, &p_cuser->rx);
558
 
-               if (error) return error;
559
 
-               PUT_USER(error,cnow.tx, &p_cuser->tx);
560
 
-               if (error) return error;
561
 
-               PUT_USER(error,cnow.frame, &p_cuser->frame);
562
 
-               if (error) return error;
563
 
-               PUT_USER(error,cnow.overrun, &p_cuser->overrun);
564
 
-               if (error) return error;
565
 
-               PUT_USER(error,cnow.parity, &p_cuser->parity);
566
 
-               if (error) return error;
567
 
-               PUT_USER(error,cnow.brk, &p_cuser->brk);
568
 
-               if (error) return error;
569
 
-               PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun);
570
 
-               if (error) return error;
571
 
-               return 0;
572
 
        default:
573
 
                return -ENOIOCTLCMD;
574
 
        }
575
 
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
576
 
index 4846b73..b118959 100644
577
 
--- a/drivers/char/synclink.c
578
 
+++ b/drivers/char/synclink.c
579
 
@@ -2920,6 +2920,38 @@ static int mgsl_break(struct tty_struct *tty, int break_state)
580
 
        
581
 
 }      /* end of mgsl_break() */
582
 
 
583
 
+/*
584
 
+ * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
585
 
+ * Return: write counters to the user passed counter struct
586
 
+ * NB: both 1->0 and 0->1 transitions are counted except for
587
 
+ *     RI where only 0->1 is counted.
588
 
+ */
589
 
+static int msgl_get_icount(struct tty_struct *tty,
590
 
+                               struct serial_icounter_struct *icount)
591
 
+
592
 
+{
593
 
+       struct mgsl_struct * info = tty->driver_data;
594
 
+       struct mgsl_icount cnow;        /* kernel counter temps */
595
 
+       unsigned long flags;
596
 
+
597
 
+       spin_lock_irqsave(&info->irq_spinlock,flags);
598
 
+       cnow = info->icount;
599
 
+       spin_unlock_irqrestore(&info->irq_spinlock,flags);
600
 
+
601
 
+       icount->cts = cnow.cts;
602
 
+       icount->dsr = cnow.dsr;
603
 
+       icount->rng = cnow.rng;
604
 
+       icount->dcd = cnow.dcd;
605
 
+       icount->rx = cnow.rx;
606
 
+       icount->tx = cnow.tx;
607
 
+       icount->frame = cnow.frame;
608
 
+       icount->overrun = cnow.overrun;
609
 
+       icount->parity = cnow.parity;
610
 
+       icount->brk = cnow.brk;
611
 
+       icount->buf_overrun = cnow.buf_overrun;
612
 
+       return 0;
613
 
+}
614
 
+
615
 
 /* mgsl_ioctl()        Service an IOCTL request
616
 
  *     
617
 
  * Arguments:
618
 
@@ -2945,7 +2977,7 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
619
 
                return -ENODEV;
620
 
 
621
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
622
 
-           (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
623
 
+           (cmd != TIOCMIWAIT)) {
624
 
                if (tty->flags & (1 << TTY_IO_ERROR))
625
 
                    return -EIO;
626
 
        }
627
 
@@ -2958,11 +2990,7 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
628
 
 
629
 
 static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long arg)
630
 
 {
631
 
-       int error;
632
 
-       struct mgsl_icount cnow;        /* kernel counter temps */
633
 
        void __user *argp = (void __user *)arg;
634
 
-       struct serial_icounter_struct __user *p_cuser;  /* user space */
635
 
-       unsigned long flags;
636
 
        
637
 
        switch (cmd) {
638
 
                case MGSL_IOCGPARAMS:
639
 
@@ -2991,40 +3019,6 @@ static int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigne
640
 
                case TIOCMIWAIT:
641
 
                        return modem_input_wait(info,(int)arg);
642
 
 
643
 
-               /* 
644
 
-                * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
645
 
-                * Return: write counters to the user passed counter struct
646
 
-                * NB: both 1->0 and 0->1 transitions are counted except for
647
 
-                *     RI where only 0->1 is counted.
648
 
-                */
649
 
-               case TIOCGICOUNT:
650
 
-                       spin_lock_irqsave(&info->irq_spinlock,flags);
651
 
-                       cnow = info->icount;
652
 
-                       spin_unlock_irqrestore(&info->irq_spinlock,flags);
653
 
-                       p_cuser = argp;
654
 
-                       PUT_USER(error,cnow.cts, &p_cuser->cts);
655
 
-                       if (error) return error;
656
 
-                       PUT_USER(error,cnow.dsr, &p_cuser->dsr);
657
 
-                       if (error) return error;
658
 
-                       PUT_USER(error,cnow.rng, &p_cuser->rng);
659
 
-                       if (error) return error;
660
 
-                       PUT_USER(error,cnow.dcd, &p_cuser->dcd);
661
 
-                       if (error) return error;
662
 
-                       PUT_USER(error,cnow.rx, &p_cuser->rx);
663
 
-                       if (error) return error;
664
 
-                       PUT_USER(error,cnow.tx, &p_cuser->tx);
665
 
-                       if (error) return error;
666
 
-                       PUT_USER(error,cnow.frame, &p_cuser->frame);
667
 
-                       if (error) return error;
668
 
-                       PUT_USER(error,cnow.overrun, &p_cuser->overrun);
669
 
-                       if (error) return error;
670
 
-                       PUT_USER(error,cnow.parity, &p_cuser->parity);
671
 
-                       if (error) return error;
672
 
-                       PUT_USER(error,cnow.brk, &p_cuser->brk);
673
 
-                       if (error) return error;
674
 
-                       PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun);
675
 
-                       if (error) return error;
676
 
-                       return 0;
677
 
                default:
678
 
                        return -ENOIOCTLCMD;
679
 
        }
680
 
@@ -4325,6 +4319,7 @@ static const struct tty_operations mgsl_ops = {
681
 
        .hangup = mgsl_hangup,
682
 
        .tiocmget = tiocmget,
683
 
        .tiocmset = tiocmset,
684
 
+       .get_icount = msgl_get_icount,
685
 
        .proc_fops = &mgsl_proc_fops,
686
 
 };
687
 
 
688
 
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
689
 
index 8678f0c..c300ff6 100644
690
 
--- a/drivers/char/synclink_gt.c
691
 
+++ b/drivers/char/synclink_gt.c
692
 
@@ -1057,9 +1057,6 @@ static int ioctl(struct tty_struct *tty, struct file *file,
693
 
                 unsigned int cmd, unsigned long arg)
694
 
 {
695
 
        struct slgt_info *info = tty->driver_data;
696
 
-       struct mgsl_icount cnow;        /* kernel counter temps */
697
 
-       struct serial_icounter_struct __user *p_cuser;  /* user space */
698
 
-       unsigned long flags;
699
 
        void __user *argp = (void __user *)arg;
700
 
        int ret;
701
 
 
702
 
@@ -1068,7 +1065,7 @@ static int ioctl(struct tty_struct *tty, struct file *file,
703
 
        DBGINFO(("%s ioctl() cmd=%08X\n", info->device_name, cmd));
704
 
 
705
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
706
 
-           (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
707
 
+           (cmd != TIOCMIWAIT)) {
708
 
                if (tty->flags & (1 << TTY_IO_ERROR))
709
 
                    return -EIO;
710
 
        }
711
 
@@ -1121,25 +1118,6 @@ static int ioctl(struct tty_struct *tty, struct file *file,
712
 
        case MGSL_IOCWAITGPIO:
713
 
                ret = wait_gpio(info, argp);
714
 
                break;
715
 
-       case TIOCGICOUNT:
716
 
-               spin_lock_irqsave(&info->lock,flags);
717
 
-               cnow = info->icount;
718
 
-               spin_unlock_irqrestore(&info->lock,flags);
719
 
-               p_cuser = argp;
720
 
-               if (put_user(cnow.cts, &p_cuser->cts) ||
721
 
-                   put_user(cnow.dsr, &p_cuser->dsr) ||
722
 
-                   put_user(cnow.rng, &p_cuser->rng) ||
723
 
-                   put_user(cnow.dcd, &p_cuser->dcd) ||
724
 
-                   put_user(cnow.rx, &p_cuser->rx) ||
725
 
-                   put_user(cnow.tx, &p_cuser->tx) ||
726
 
-                   put_user(cnow.frame, &p_cuser->frame) ||
727
 
-                   put_user(cnow.overrun, &p_cuser->overrun) ||
728
 
-                   put_user(cnow.parity, &p_cuser->parity) ||
729
 
-                   put_user(cnow.brk, &p_cuser->brk) ||
730
 
-                   put_user(cnow.buf_overrun, &p_cuser->buf_overrun))
731
 
-                       ret = -EFAULT;
732
 
-               ret = 0;
733
 
-               break;
734
 
        default:
735
 
                ret = -ENOIOCTLCMD;
736
 
        }
737
 
@@ -1147,6 +1125,33 @@ static int ioctl(struct tty_struct *tty, struct file *file,
738
 
        return ret;
739
 
 }
740
 
 
741
 
+static int get_icount(struct tty_struct *tty,
742
 
+                               struct serial_icounter_struct *icount)
743
 
+
744
 
+{
745
 
+       struct slgt_info *info = tty->driver_data;
746
 
+       struct mgsl_icount cnow;        /* kernel counter temps */
747
 
+       unsigned long flags;
748
 
+
749
 
+       spin_lock_irqsave(&info->lock,flags);
750
 
+       cnow = info->icount;
751
 
+       spin_unlock_irqrestore(&info->lock,flags);
752
 
+
753
 
+       icount->cts = cnow.cts;
754
 
+       icount->dsr = cnow.dsr;
755
 
+       icount->rng = cnow.rng;
756
 
+       icount->dcd = cnow.dcd;
757
 
+       icount->rx = cnow.rx;
758
 
+       icount->tx = cnow.tx;
759
 
+       icount->frame = cnow.frame;
760
 
+       icount->overrun = cnow.overrun;
761
 
+       icount->parity = cnow.parity;
762
 
+       icount->brk = cnow.brk;
763
 
+       icount->buf_overrun = cnow.buf_overrun;
764
 
+
765
 
+       return 0;
766
 
+}
767
 
+
768
 
 /*
769
 
  * support for 32 bit ioctl calls on 64 bit systems
770
 
  */
771
 
@@ -1236,10 +1241,6 @@ static long slgt_compat_ioctl(struct tty_struct *tty, struct file *file,
772
 
        case MGSL_IOCSGPIO:
773
 
        case MGSL_IOCGGPIO:
774
 
        case MGSL_IOCWAITGPIO:
775
 
-       case TIOCGICOUNT:
776
 
-               rc = ioctl(tty, file, cmd, (unsigned long)(compat_ptr(arg)));
777
 
-               break;
778
 
-
779
 
        case MGSL_IOCSTXIDLE:
780
 
        case MGSL_IOCTXENABLE:
781
 
        case MGSL_IOCRXENABLE:
782
 
@@ -3639,6 +3640,7 @@ static const struct tty_operations ops = {
783
 
        .hangup = hangup,
784
 
        .tiocmget = tiocmget,
785
 
        .tiocmset = tiocmset,
786
 
+       .get_icount = get_icount,
787
 
        .proc_fops = &synclink_gt_proc_fops,
788
 
 };
789
 
 
790
 
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
791
 
index 2b18adc..951b65f 100644
792
 
--- a/drivers/char/synclinkmp.c
793
 
+++ b/drivers/char/synclinkmp.c
794
 
@@ -1255,10 +1255,6 @@ static int do_ioctl(struct tty_struct *tty, struct file *file,
795
 
                 unsigned int cmd, unsigned long arg)
796
 
 {
797
 
        SLMP_INFO *info = tty->driver_data;
798
 
-       int error;
799
 
-       struct mgsl_icount cnow;        /* kernel counter temps */
800
 
-       struct serial_icounter_struct __user *p_cuser;  /* user space */
801
 
-       unsigned long flags;
802
 
        void __user *argp = (void __user *)arg;
803
 
 
804
 
        if (debug_level >= DEBUG_LEVEL_INFO)
805
 
@@ -1269,7 +1265,7 @@ static int do_ioctl(struct tty_struct *tty, struct file *file,
806
 
                return -ENODEV;
807
 
 
808
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
809
 
-           (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
810
 
+           (cmd != TIOCMIWAIT)) {
811
 
                if (tty->flags & (1 << TTY_IO_ERROR))
812
 
                    return -EIO;
813
 
        }
814
 
@@ -1307,40 +1303,38 @@ static int do_ioctl(struct tty_struct *tty, struct file *file,
815
 
                 * NB: both 1->0 and 0->1 transitions are counted except for
816
 
                 *     RI where only 0->1 is counted.
817
 
                 */
818
 
-       case TIOCGICOUNT:
819
 
-               spin_lock_irqsave(&info->lock,flags);
820
 
-               cnow = info->icount;
821
 
-               spin_unlock_irqrestore(&info->lock,flags);
822
 
-               p_cuser = argp;
823
 
-               PUT_USER(error,cnow.cts, &p_cuser->cts);
824
 
-               if (error) return error;
825
 
-               PUT_USER(error,cnow.dsr, &p_cuser->dsr);
826
 
-               if (error) return error;
827
 
-               PUT_USER(error,cnow.rng, &p_cuser->rng);
828
 
-               if (error) return error;
829
 
-               PUT_USER(error,cnow.dcd, &p_cuser->dcd);
830
 
-               if (error) return error;
831
 
-               PUT_USER(error,cnow.rx, &p_cuser->rx);
832
 
-               if (error) return error;
833
 
-               PUT_USER(error,cnow.tx, &p_cuser->tx);
834
 
-               if (error) return error;
835
 
-               PUT_USER(error,cnow.frame, &p_cuser->frame);
836
 
-               if (error) return error;
837
 
-               PUT_USER(error,cnow.overrun, &p_cuser->overrun);
838
 
-               if (error) return error;
839
 
-               PUT_USER(error,cnow.parity, &p_cuser->parity);
840
 
-               if (error) return error;
841
 
-               PUT_USER(error,cnow.brk, &p_cuser->brk);
842
 
-               if (error) return error;
843
 
-               PUT_USER(error,cnow.buf_overrun, &p_cuser->buf_overrun);
844
 
-               if (error) return error;
845
 
-               return 0;
846
 
        default:
847
 
                return -ENOIOCTLCMD;
848
 
        }
849
 
        return 0;
850
 
 }
851
 
 
852
 
+static int get_icount(struct tty_struct *tty,
853
 
+                               struct serial_icounter_struct *icount)
854
 
+{
855
 
+       SLMP_INFO *info = tty->driver_data;
856
 
+       struct mgsl_icount cnow;        /* kernel counter temps */
857
 
+       unsigned long flags;
858
 
+
859
 
+       spin_lock_irqsave(&info->lock,flags);
860
 
+       cnow = info->icount;
861
 
+       spin_unlock_irqrestore(&info->lock,flags);
862
 
+
863
 
+       icount->cts = cnow.cts;
864
 
+       icount->dsr = cnow.dsr;
865
 
+       icount->rng = cnow.rng;
866
 
+       icount->dcd = cnow.dcd;
867
 
+       icount->rx = cnow.rx;
868
 
+       icount->tx = cnow.tx;
869
 
+       icount->frame = cnow.frame;
870
 
+       icount->overrun = cnow.overrun;
871
 
+       icount->parity = cnow.parity;
872
 
+       icount->brk = cnow.brk;
873
 
+       icount->buf_overrun = cnow.buf_overrun;
874
 
+
875
 
+       return 0;
876
 
+}
877
 
+
878
 
 static int ioctl(struct tty_struct *tty, struct file *file,
879
 
                 unsigned int cmd, unsigned long arg)
880
 
 {
881
 
@@ -3908,6 +3902,7 @@ static const struct tty_operations ops = {
882
 
        .hangup = hangup,
883
 
        .tiocmget = tiocmget,
884
 
        .tiocmset = tiocmset,
885
 
+       .get_icount = get_icount,
886
 
        .proc_fops = &synclinkmp_proc_fops,
887
 
 };
888
 
 
889
 
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
890
 
index 24661cd..1e4f831 100644
891
 
--- a/drivers/serial/68360serial.c
892
 
+++ b/drivers/serial/68360serial.c
893
 
@@ -1381,6 +1381,30 @@ static void send_break(ser_info_t *info, unsigned int duration)
894
 
 }
895
 
 
896
 
 
897
 
+/*
898
 
+ * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
899
 
+ * Return: write counters to the user passed counter struct
900
 
+ * NB: both 1->0 and 0->1 transitions are counted except for
901
 
+ *     RI where only 0->1 is counted.
902
 
+ */
903
 
+static int rs_360_get_icount(struct tty_struct *tty,
904
 
+                               struct serial_icounter_struct *icount)
905
 
+{
906
 
+       ser_info_t *info = (ser_info_t *)tty->driver_data;
907
 
+       struct async_icount cnow;
908
 
+
909
 
+       local_irq_disable();
910
 
+       cnow = info->state->icount;
911
 
+       local_irq_enable();
912
 
+
913
 
+       icount->cts = cnow.cts;
914
 
+       icount->dsr = cnow.dsr;
915
 
+       icount->rng = cnow.rng;
916
 
+       icount->dcd = cnow.dcd;
917
 
+
918
 
+       return 0;
919
 
+}
920
 
+
921
 
 static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
922
 
                    unsigned int cmd, unsigned long arg)
923
 
 {
924
 
@@ -1394,7 +1418,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
925
 
        if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
926
 
                return -ENODEV;
927
 
 
928
 
-       if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
929
 
+       if (cmd != TIOCMIWAIT) {
930
 
                if (tty->flags & (1 << TTY_IO_ERROR))
931
 
                    return -EIO;
932
 
        }
933
 
@@ -1477,31 +1501,6 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
934
 
                        return 0;
935
 
 #endif
936
 
 
937
 
-               /* 
938
 
-                * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
939
 
-                * Return: write counters to the user passed counter struct
940
 
-                * NB: both 1->0 and 0->1 transitions are counted except for
941
 
-                *     RI where only 0->1 is counted.
942
 
-                */
943
 
-               case TIOCGICOUNT:
944
 
-                       local_irq_disable();
945
 
-                       cnow = info->state->icount;
946
 
-                       local_irq_enable();
947
 
-                       p_cuser = (struct serial_icounter_struct *) arg;
948
 
-/*                     error = put_user(cnow.cts, &p_cuser->cts); */
949
 
-/*                     if (error) return error; */
950
 
-/*                     error = put_user(cnow.dsr, &p_cuser->dsr); */
951
 
-/*                     if (error) return error; */
952
 
-/*                     error = put_user(cnow.rng, &p_cuser->rng); */
953
 
-/*                     if (error) return error; */
954
 
-/*                     error = put_user(cnow.dcd, &p_cuser->dcd); */
955
 
-/*                     if (error) return error; */
956
 
-
957
 
-                       put_user(cnow.cts, &p_cuser->cts);
958
 
-                       put_user(cnow.dsr, &p_cuser->dsr);
959
 
-                       put_user(cnow.rng, &p_cuser->rng);
960
 
-                       put_user(cnow.dcd, &p_cuser->dcd);
961
 
-                       return 0;
962
 
 
963
 
                default:
964
 
                        return -ENOIOCTLCMD;
965
 
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
966
 
index cab71ea..5f6a305 100644
967
 
--- a/net/bluetooth/rfcomm/tty.c
968
 
+++ b/net/bluetooth/rfcomm/tty.c
969
 
@@ -844,10 +844,6 @@ static int rfcomm_tty_ioctl(struct tty_struct *tty, struct file *filp, unsigned
970
 
                BT_DBG("TIOCMIWAIT");
971
 
                break;
972
 
 
973
 
-       case TIOCGICOUNT:
974
 
-               BT_DBG("TIOCGICOUNT");
975
 
-               break;
976
 
-
977
 
        case TIOCGSERIAL:
978
 
                BT_ERR("TIOCGSERIAL is not supported");
979
 
                return -ENOIOCTLCMD;
980
 
1.7.2.3
981