Lines 1-5
Link Here
|
1 |
--- sys/dev/ltmdm/ltmdmsio.c.orig Tue Mar 12 04:47:31 2002 |
1 |
--- ltmdmsio.c.orig Tue Mar 12 09:47:31 2002 |
2 |
+++ sys/dev/ltmdm/ltmdmsio.c Sat Nov 5 07:27:48 2005 |
2 |
+++ ltmdmsio.c Sat Jan 21 19:36:48 2006 |
3 |
@@ -60,7 +60,9 @@ |
3 |
@@ -60,7 +60,9 @@ |
4 |
#include <sys/proc.h> |
4 |
#include <sys/proc.h> |
5 |
#include <sys/module.h> |
5 |
#include <sys/module.h> |
Lines 286-292
Link Here
|
286 |
{ |
286 |
{ |
287 |
struct com_s *com; |
287 |
struct com_s *com; |
288 |
int error; |
288 |
int error; |
289 |
@@ -1610,7 +1690,11 @@ |
289 |
@@ -1488,7 +1568,11 @@ |
|
|
290 |
return (ENXIO); |
291 |
if (mynor & CONTROL_MASK) |
292 |
return (0); |
293 |
+#if __FreeBSD_version >= 700013 |
294 |
+ tp = dev->si_tty = com->tp = ttyalloc(); |
295 |
+#else |
296 |
tp = dev->si_tty = com->tp = ttymalloc(com->tp); |
297 |
+#endif |
298 |
s = splfunc(); |
299 |
/* |
300 |
* We jump to this label after all non-interrupted sleeps to pick |
301 |
@@ -1610,7 +1694,11 @@ |
290 |
* the true carrier. |
302 |
* the true carrier. |
291 |
*/ |
303 |
*/ |
292 |
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK) |
304 |
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK) |
Lines 298-304
Link Here
|
298 |
} |
310 |
} |
299 |
/* |
311 |
/* |
300 |
* Wait for DCD if necessary. |
312 |
* Wait for DCD if necessary. |
301 |
@@ -1626,7 +1710,11 @@ |
313 |
@@ -1626,7 +1714,11 @@ |
302 |
goto out; |
314 |
goto out; |
303 |
goto open_top; |
315 |
goto open_top; |
304 |
} |
316 |
} |
Lines 310-316
Link Here
|
310 |
disc_optim(tp, &tp->t_termios, com); |
322 |
disc_optim(tp, &tp->t_termios, com); |
311 |
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK) |
323 |
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK) |
312 |
com->active_out = TRUE; |
324 |
com->active_out = TRUE; |
313 |
@@ -1639,7 +1727,11 @@ |
325 |
@@ -1639,7 +1731,11 @@ |
314 |
} |
326 |
} |
315 |
|
327 |
|
316 |
static int |
328 |
static int |
Lines 322-328
Link Here
|
322 |
{ |
334 |
{ |
323 |
struct com_s *com; |
335 |
struct com_s *com; |
324 |
int mynor; |
336 |
int mynor; |
325 |
@@ -1654,11 +1746,19 @@ |
337 |
@@ -1654,11 +1750,19 @@ |
326 |
return (ENODEV); |
338 |
return (ENODEV); |
327 |
tp = com->tp; |
339 |
tp = com->tp; |
328 |
s = splfunc(); |
340 |
s = splfunc(); |
Lines 342-348
Link Here
|
342 |
siosettimeout(); |
354 |
siosettimeout(); |
343 |
splx(s); |
355 |
splx(s); |
344 |
if (com->gone) { |
356 |
if (com->gone) { |
345 |
@@ -1685,7 +1785,9 @@ |
357 |
@@ -1685,7 +1789,9 @@ |
346 |
s = splfunc(); |
358 |
s = splfunc(); |
347 |
com->do_timestamp = FALSE; |
359 |
com->do_timestamp = FALSE; |
348 |
com->do_dcd_timestamp = FALSE; |
360 |
com->do_dcd_timestamp = FALSE; |
Lines 352-358
Link Here
|
352 |
write_vuart_port(UART_CFCR, com->cfcr_image &= ~CFCR_SBREAK); |
364 |
write_vuart_port(UART_CFCR, com->cfcr_image &= ~CFCR_SBREAK); |
353 |
{ |
365 |
{ |
354 |
write_vuart_port(UART_IER, 0); |
366 |
write_vuart_port(UART_IER, 0); |
355 |
@@ -1724,7 +1826,11 @@ |
367 |
@@ -1724,7 +1830,11 @@ |
356 |
} |
368 |
} |
357 |
|
369 |
|
358 |
static int |
370 |
static int |
Lines 364-370
Link Here
|
364 |
{ |
376 |
{ |
365 |
int mynor; |
377 |
int mynor; |
366 |
struct com_s *com; |
378 |
struct com_s *com; |
367 |
@@ -1735,11 +1841,19 @@ |
379 |
@@ -1735,11 +1845,19 @@ |
368 |
com = com_addr(MINOR_TO_UNIT(mynor)); |
380 |
com = com_addr(MINOR_TO_UNIT(mynor)); |
369 |
if (com == NULL || com->gone) |
381 |
if (com == NULL || com->gone) |
370 |
return (ENODEV); |
382 |
return (ENODEV); |
Lines 384-390
Link Here
|
384 |
{ |
396 |
{ |
385 |
int mynor; |
397 |
int mynor; |
386 |
struct com_s *com; |
398 |
struct com_s *com; |
387 |
@@ -1754,7 +1868,11 @@ |
399 |
@@ -1754,7 +1872,11 @@ |
388 |
if (com == NULL || com->gone) |
400 |
if (com == NULL || com->gone) |
389 |
return (ENODEV); |
401 |
return (ENODEV); |
390 |
|
402 |
|
Lines 396-402
Link Here
|
396 |
} |
408 |
} |
397 |
|
409 |
|
398 |
static void |
410 |
static void |
399 |
@@ -1860,7 +1978,11 @@ |
411 |
@@ -1860,7 +1982,11 @@ |
400 |
if (line_status & LSR_PE) |
412 |
if (line_status & LSR_PE) |
401 |
recv_data |= TTY_PE; |
413 |
recv_data |= TTY_PE; |
402 |
} |
414 |
} |
Lines 408-414
Link Here
|
408 |
lt_disable_intr(); |
420 |
lt_disable_intr(); |
409 |
} while (buf < com->iptr); |
421 |
} while (buf < com->iptr); |
410 |
} |
422 |
} |
411 |
@@ -1894,23 +2016,34 @@ |
423 |
@@ -1894,23 +2020,34 @@ |
412 |
u_char recv_data; |
424 |
u_char recv_data; |
413 |
u_char int_ctl; |
425 |
u_char int_ctl; |
414 |
u_char int_ctl_new; |
426 |
u_char int_ctl_new; |
Lines 443-449
Link Here
|
443 |
line_status = read_vuart_port(UART_LSR); |
455 |
line_status = read_vuart_port(UART_LSR); |
444 |
|
456 |
|
445 |
/* input event? (check first to help avoid overruns) */ |
457 |
/* input event? (check first to help avoid overruns) */ |
446 |
@@ -1948,7 +2081,11 @@ |
458 |
@@ -1948,7 +2085,11 @@ |
447 |
recv_data = 0; |
459 |
recv_data = 0; |
448 |
} |
460 |
} |
449 |
++com->bytes_in; |
461 |
++com->bytes_in; |
Lines 455-461
Link Here
|
455 |
setsofttty(); |
467 |
setsofttty(); |
456 |
ioptr = com->iptr; |
468 |
ioptr = com->iptr; |
457 |
if (ioptr >= com->ibufend) |
469 |
if (ioptr >= com->ibufend) |
458 |
@@ -2053,7 +2190,11 @@ |
470 |
@@ -2053,7 +2194,11 @@ |
459 |
} |
471 |
} |
460 |
|
472 |
|
461 |
static int |
473 |
static int |
Lines 467-473
Link Here
|
467 |
{ |
479 |
{ |
468 |
struct com_s *com; |
480 |
struct com_s *com; |
469 |
int error; |
481 |
int error; |
470 |
@@ -2103,6 +2244,7 @@ |
482 |
@@ -2103,6 +2248,7 @@ |
471 |
} |
483 |
} |
472 |
} |
484 |
} |
473 |
tp = com->tp; |
485 |
tp = com->tp; |
Lines 475-481
Link Here
|
475 |
#if defined(COMPAT_43) || defined(COMPAT_SUNOS) |
487 |
#if defined(COMPAT_43) || defined(COMPAT_SUNOS) |
476 |
term = tp->t_termios; |
488 |
term = tp->t_termios; |
477 |
oldcmd = cmd; |
489 |
oldcmd = cmd; |
478 |
@@ -2112,6 +2254,7 @@ |
490 |
@@ -2112,6 +2258,7 @@ |
479 |
if (cmd != oldcmd) |
491 |
if (cmd != oldcmd) |
480 |
data = (caddr_t)&term; |
492 |
data = (caddr_t)&term; |
481 |
#endif |
493 |
#endif |
Lines 483-489
Link Here
|
483 |
if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { |
495 |
if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { |
484 |
int cc; |
496 |
int cc; |
485 |
struct termios *dt = (struct termios *)data; |
497 |
struct termios *dt = (struct termios *)data; |
486 |
@@ -2134,7 +2277,11 @@ |
498 |
@@ -2134,7 +2281,11 @@ |
487 |
if (lt->c_ospeed != 0) |
499 |
if (lt->c_ospeed != 0) |
488 |
dt->c_ospeed = tp->t_ospeed; |
500 |
dt->c_ospeed = tp->t_ospeed; |
489 |
} |
501 |
} |
Lines 495-501
Link Here
|
495 |
if (error != ENOIOCTL) |
507 |
if (error != ENOIOCTL) |
496 |
return (error); |
508 |
return (error); |
497 |
s = splfunc(); |
509 |
s = splfunc(); |
498 |
@@ -2189,13 +2336,17 @@ |
510 |
@@ -2189,13 +2340,17 @@ |
499 |
com->do_timestamp = TRUE; |
511 |
com->do_timestamp = TRUE; |
500 |
*(struct timeval *)data = com->timestamp; |
512 |
*(struct timeval *)data = com->timestamp; |
501 |
break; |
513 |
break; |
Lines 513-519
Link Here
|
513 |
if (error == ENODEV) |
525 |
if (error == ENODEV) |
514 |
error = ENOTTY; |
526 |
error = ENOTTY; |
515 |
return (error); |
527 |
return (error); |
516 |
@@ -2257,8 +2408,13 @@ |
528 |
@@ -2257,8 +2412,13 @@ |
517 |
com->state &= ~CS_CHECKMSR; |
529 |
com->state &= ~CS_CHECKMSR; |
518 |
lt_enable_intr(); |
530 |
lt_enable_intr(); |
519 |
if (delta_modem_status & MSR_DCD) |
531 |
if (delta_modem_status & MSR_DCD) |
Lines 527-533
Link Here
|
527 |
} |
539 |
} |
528 |
if (com->state & CS_ODONE) { |
540 |
if (com->state & CS_ODONE) { |
529 |
lt_disable_intr(); |
541 |
lt_disable_intr(); |
530 |
@@ -2270,7 +2426,11 @@ |
542 |
@@ -2270,7 +2430,11 @@ |
531 |
sio_busycheck_handle = timeout(siobusycheck, com, hz / 100); |
543 |
sio_busycheck_handle = timeout(siobusycheck, com, hz / 100); |
532 |
com->extra_state |= CSE_BUSYCHECK; |
544 |
com->extra_state |= CSE_BUSYCHECK; |
533 |
} |
545 |
} |
Lines 539-545
Link Here
|
539 |
} |
551 |
} |
540 |
if (com_events == 0) |
552 |
if (com_events == 0) |
541 |
break; |
553 |
break; |
542 |
@@ -2769,11 +2929,21 @@ |
554 |
@@ -2769,11 +2933,21 @@ |
543 |
&& (!(t->c_iflag & PARMRK) |
555 |
&& (!(t->c_iflag & PARMRK) |
544 |
|| (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK)) |
556 |
|| (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK)) |
545 |
&& !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN)) |
557 |
&& !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN)) |
Lines 561-567
Link Here
|
561 |
} |
573 |
} |
562 |
|
574 |
|
563 |
#ifdef KLD_MODULE |
575 |
#ifdef KLD_MODULE |
564 |
@@ -2796,7 +2966,7 @@ |
576 |
@@ -2796,7 +2970,7 @@ |
565 |
#endif |
577 |
#endif |
566 |
|
578 |
|
567 |
DRIVER_MODULE(ltmdm, pci, ltmdm_pci_driver, ltmdm_devclass, ltmdm_event, 0); |
579 |
DRIVER_MODULE(ltmdm, pci, ltmdm_pci_driver, ltmdm_devclass, ltmdm_event, 0); |