Changeset a830cb8 in rtems
- Timestamp:
- 10/07/14 14:27:51 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 7fd5e89
- Parents:
- ff7217b
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/arm/tms570/console/tms570-sci.c
rff7217b ra830cb8 104 104 minor, 105 105 handler, 106 NULL, 106 107 (void *) ctx 107 108 ); … … 537 538 .write = tms570_sci_poll_write, 538 539 .set_attributes = tms570_sci_set_attributes, 539 .stop_remote_tx = NULL,540 .start_remote_tx = NULL,541 540 .mode = TERMIOS_POLLED 542 541 }; … … 554 553 .write = tms570_sci_interrupt_write, 555 554 .set_attributes = tms570_sci_set_attributes, 556 .stop_remote_tx = NULL,557 .start_remote_tx = NULL,558 555 .mode = TERMIOS_IRQ_DRIVEN 559 556 }; -
c/src/lib/libbsp/sparc/leon3/console/console.c
rff7217b ra830cb8 132 132 minor, 133 133 handler, 134 NULL, 134 135 leon3_console_get_uart(syscon_uart_index) 135 136 ); … … 148 149 minor, 149 150 handler, 151 NULL, 150 152 leon3_console_get_uart(syscon_uart_index) 151 153 ); -
cpukit/libcsupport/include/rtems/termiostypes.h
rff7217b ra830cb8 145 145 146 146 /** 147 * @brief Indicate to stop remote transmitter.148 *149 * @param[in] tty The Termios control.150 *151 * @see rtems_termios_get_device_context().152 */153 void (*stop_remote_tx)(struct rtems_termios_tty *tty);154 155 /**156 * @brief Indicate to start remote transmitter.157 *158 * @param[in] tty The Termios control.159 *160 * @see rtems_termios_get_device_context().161 */162 void (*start_remote_tx)(struct rtems_termios_tty *tty);163 164 /**165 147 * @brief Termios device mode. 166 148 */ 167 149 rtems_termios_device_mode mode; 168 150 } rtems_termios_device_handler; 151 152 /** 153 * @brief Termios device flow control handler. 154 * 155 * @see rtems_termios_device_install(). 156 */ 157 typedef struct { 158 /** 159 * @brief Indicate to stop remote transmitter. 160 * 161 * @param[in] tty The Termios control. 162 * 163 * @see rtems_termios_get_device_context(). 164 */ 165 void (*stop_remote_tx)(struct rtems_termios_tty *tty); 166 167 /** 168 * @brief Indicate to start remote transmitter. 169 * 170 * @param[in] tty The Termios control. 171 * 172 * @see rtems_termios_get_device_context(). 173 */ 174 void (*start_remote_tx)(struct rtems_termios_tty *tty); 175 } rtems_termios_device_flow; 169 176 170 177 /** … … 178 185 rtems_device_minor_number minor; 179 186 const rtems_termios_device_handler *handler; 187 const rtems_termios_device_flow *flow; 180 188 void *context; 181 189 struct rtems_termios_tty *tty; … … 255 263 rtems_termios_device_handler handler; 256 264 265 /** 266 * @brief The device flow control handler. 267 */ 268 rtems_termios_device_flow flow; 269 257 270 volatile unsigned int flow_ctrl; 258 271 unsigned int lowwater,highwater; … … 296 309 * 297 310 * @param[in] device_file If not @c NULL, then a device file for the specified 298 * major and minor number will be created.311 * major and minor number will be created. 299 312 * @param[in] major The device major number of the corresponding device driver. 300 313 * @param[in] minor The device minor number of the corresponding device driver. 301 314 * @param[in] handler The device handler. It must be persistent throughout the 302 315 * installed time of the device. 316 * @param[in] flow The device flow control handler. The device flow control 317 * handler are optional and may be @c NULL. If present must be persistent 318 * throughout the installed time of the device. 303 319 * @param[in] context The device context. It must be persistent throughout the 304 320 * installed time of the device. … … 308 324 * @retval RTEMS_UNSATISFIED Creation of the device file failed. 309 325 * @retval RTEMS_RESOURCE_IN_USE There exists a device node for this major and 310 * minor number pair.326 * minor number pair. 311 327 * @retval RTEMS_INCORRECT_STATE Termios is not initialized. 312 328 * 313 329 * @see rtems_termios_device_remove(), rtems_termios_device_open(), 314 * rtems_termios_device_close() and rtems_termios_get_device_context().330 * rtems_termios_device_close() and rtems_termios_get_device_context(). 315 331 */ 316 332 rtems_status_code rtems_termios_device_install( … … 319 335 rtems_device_minor_number minor, 320 336 const rtems_termios_device_handler *handler, 337 const rtems_termios_device_flow *flow, 321 338 void *context 322 339 ); -
cpukit/libcsupport/src/termios.c
rff7217b ra830cb8 134 134 rtems_device_minor_number minor, 135 135 const rtems_termios_device_handler *handler, 136 const rtems_termios_device_flow *flow, 136 137 void *context 137 138 ) … … 149 150 new_device_node->minor = minor; 150 151 new_device_node->handler = handler; 152 new_device_node->flow = flow; 151 153 new_device_node->context = context; 152 154 new_device_node->tty = NULL; … … 459 461 device_node->tty = tty; 460 462 tty->handler = *device_node->handler; 463 464 if (device_node->flow != NULL) { 465 tty->flow = *device_node->flow; 466 } 467 461 468 tty->device_node = device_node; 462 469 tty->device_context = device_node->context; … … 473 480 tty->handler.set_attributes = callbacks->setAttributes != NULL ? 474 481 rtems_termios_callback_setAttributes : NULL; 475 tty-> handler.stop_remote_tx = callbacks->stopRemoteTx != NULL ?482 tty->flow.stop_remote_tx = callbacks->stopRemoteTx != NULL ? 476 483 rtems_termios_callback_stopRemoteTx : NULL; 477 tty-> handler.start_remote_tx = callbacks->startRemoteTx != NULL ?484 tty->flow.start_remote_tx = callbacks->startRemoteTx != NULL ? 478 485 rtems_termios_callback_startRemoteTx : NULL; 479 486 tty->handler.mode = callbacks->outputUsesInterrupts; … … 819 826 /* restart remote Tx, if it was stopped */ 820 827 if ((tty->flow_ctrl & FL_IRTSOFF) && 821 (tty-> handler.start_remote_tx != NULL)) {822 tty-> handler.start_remote_tx(tty);828 (tty->flow.start_remote_tx != NULL)) { 829 tty->flow.start_remote_tx(tty); 823 830 } 824 831 tty->flow_ctrl &= ~(FL_IRTSOFF); … … 1445 1452 tty->flow_ctrl &= ~FL_IRTSOFF; 1446 1453 /* activate RTS line */ 1447 if (tty-> handler.start_remote_tx != NULL) {1448 tty-> handler.start_remote_tx(tty);1454 if (tty->flow.start_remote_tx != NULL) { 1455 tty->flow.start_remote_tx(tty); 1449 1456 } 1450 1457 } … … 1625 1632 tty->flow_ctrl |= FL_IRTSOFF; 1626 1633 /* deactivate RTS line */ 1627 if (tty-> handler.stop_remote_tx != NULL) {1628 tty-> handler.stop_remote_tx(tty);1634 if (tty->flow.stop_remote_tx != NULL) { 1635 tty->flow.stop_remote_tx(tty); 1629 1636 } 1630 1637 } -
doc/bsp_howto/console.t
rff7217b ra830cb8 490 490 minor, 491 491 handler, 492 NULL, 492 493 ctx 493 494 ); -
testsuites/libtests/termios01/init.c
rff7217b ra830cb8 561 561 greedy = rtems_heap_greedy_allocate( NULL, 0 ); 562 562 563 sc = rtems_termios_device_install( "/", major, minor, &handler, NULL );563 sc = rtems_termios_device_install( "/", major, minor, &handler, NULL, NULL ); 564 564 rtems_test_assert( sc == RTEMS_NO_MEMORY ); 565 565 … … 568 568 rtems_test_assert( rtems_resource_snapshot_check( &snapshot ) ); 569 569 570 sc = rtems_termios_device_install( NULL, major, minor, &handler, NULL ); 571 rtems_test_assert( sc == RTEMS_SUCCESSFUL ); 572 573 sc = rtems_termios_device_install( NULL, major, minor, &handler, NULL ); 570 sc = rtems_termios_device_install( 571 NULL, 572 major, 573 minor, 574 &handler, 575 NULL, 576 NULL 577 ); 578 rtems_test_assert( sc == RTEMS_SUCCESSFUL ); 579 580 sc = rtems_termios_device_install( 581 NULL, 582 major, 583 minor, 584 &handler, 585 NULL, 586 NULL 587 ); 574 588 rtems_test_assert( sc == RTEMS_RESOURCE_IN_USE ); 575 589 … … 579 593 rtems_test_assert( rtems_resource_snapshot_check( &snapshot ) ); 580 594 581 sc = rtems_termios_device_install( "/", major, minor, &handler, NULL );595 sc = rtems_termios_device_install( "/", major, minor, &handler, NULL, NULL ); 582 596 rtems_test_assert( sc == RTEMS_UNSATISFIED ); 583 597 … … 587 601 rtems_test_assert( sc == RTEMS_INVALID_ID ); 588 602 589 sc = rtems_termios_device_install( &dev[0], major, minor, &handler, NULL ); 603 sc = rtems_termios_device_install( 604 &dev[0], 605 major, 606 minor, 607 &handler, 608 NULL, 609 NULL 610 ); 590 611 rtems_test_assert( sc == RTEMS_SUCCESSFUL ); 591 612 … … 639 660 rtems_resource_snapshot_take( &snapshot ); 640 661 641 sc = rtems_termios_device_install( &dev[0], major, minor, &handler, &done ); 662 sc = rtems_termios_device_install( 663 &dev[0], 664 major, 665 minor, 666 &handler, 667 NULL, 668 &done 669 ); 642 670 rtems_test_assert( sc == RTEMS_SUCCESSFUL ); 643 671 … … 690 718 rtems_resource_snapshot_take( &snapshot ); 691 719 692 sc = rtems_termios_device_install( &dev[0], major, minor, &handler, &done ); 720 sc = rtems_termios_device_install( 721 &dev[0], 722 major, 723 minor, 724 &handler, 725 NULL, 726 &done 727 ); 693 728 rtems_test_assert( sc == RTEMS_SUCCESSFUL ); 694 729
Note: See TracChangeset
for help on using the changeset viewer.