hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/tty/ipwireless/tty.c
....@@ -248,20 +248,27 @@
248248 return room;
249249 }
250250
251
-static int ipwireless_get_serial_info(struct ipw_tty *tty,
252
- struct serial_struct __user *retinfo)
251
+static int ipwireless_get_serial_info(struct tty_struct *linux_tty,
252
+ struct serial_struct *ss)
253253 {
254
- struct serial_struct tmp;
254
+ struct ipw_tty *tty = linux_tty->driver_data;
255255
256
- memset(&tmp, 0, sizeof(tmp));
257
- tmp.type = PORT_UNKNOWN;
258
- tmp.line = tty->index;
259
- tmp.baud_base = 115200;
256
+ if (!tty)
257
+ return -ENODEV;
260258
261
- if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
262
- return -EFAULT;
259
+ if (!tty->port.count)
260
+ return -EINVAL;
263261
262
+ ss->type = PORT_UNKNOWN;
263
+ ss->line = tty->index;
264
+ ss->baud_base = 115200;
264265 return 0;
266
+}
267
+
268
+static int ipwireless_set_serial_info(struct tty_struct *linux_tty,
269
+ struct serial_struct *ss)
270
+{
271
+ return 0; /* Keeps the PCMCIA scripts happy. */
265272 }
266273
267274 static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
....@@ -386,15 +393,6 @@
386393 return -EINVAL;
387394
388395 /* FIXME: Exactly how is the tty object locked here .. */
389
-
390
- switch (cmd) {
391
- case TIOCGSERIAL:
392
- return ipwireless_get_serial_info(tty, (void __user *) arg);
393
-
394
- case TIOCSSERIAL:
395
- return 0; /* Keeps the PCMCIA scripts happy. */
396
- }
397
-
398396 if (tty->tty_type == TTYTYPE_MODEM) {
399397 switch (cmd) {
400398 case PPPIOCGCHAN:
....@@ -561,6 +559,8 @@
561559 .chars_in_buffer = ipw_chars_in_buffer,
562560 .tiocmget = ipw_tiocmget,
563561 .tiocmset = ipw_tiocmset,
562
+ .set_serial = ipwireless_set_serial_info,
563
+ .get_serial = ipwireless_get_serial_info,
564564 };
565565
566566 int ipwireless_tty_init(void)