Changeset 3b5d1535 in mainline for uspace/drv/ns8250/ns8250.c
- Timestamp:
- 2011-02-23T10:28:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb48f61
- Parents:
- e936e8e (diff), eb1a2f4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ns8250/ns8250.c
re936e8e r3b5d1535 1 1 /* 2 2 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 52 53 #include <libarch/ddi.h> 53 54 54 #include <driver.h> 55 #include <ddf/driver.h> 56 #include <ddf/interrupt.h> 55 57 #include <ops/char_dev.h> 56 58 … … 67 69 #define MAX_BAUD_RATE 115200 68 70 #define DLAB_MASK (1 << 7) 71 72 /** Obtain soft-state structure from function node */ 73 #define NS8250(fnode) ((ns8250_t *) ((fnode)->dev->driver_data)) 74 75 /** Obtain soft-state structure from device node */ 76 #define NS8250_FROM_DEV(dnode) ((ns8250_t *) ((dnode)->driver_data)) 69 77 70 78 /** The number of bits of one data unit send by the serial port. */ … … 85 93 86 94 /** The driver data for the serial port devices. */ 87 typedef struct ns8250_dev_data { 95 typedef struct ns8250 { 96 /** DDF device node */ 97 ddf_dev_t *dev; 98 /** DDF function node */ 99 ddf_fun_t *fun; 88 100 /** Is there any client conntected to the device? */ 89 101 bool client_connected; … … 98 110 /** The fibril mutex for synchronizing the access to the device. */ 99 111 fibril_mutex_t mutex; 100 } ns8250_ dev_data_t;101 102 /** Create driver data for a device.103 * 104 * @return The driver data.105 */ 106 static ns8250_ dev_data_t *create_ns8250_dev_data(void)107 { 108 ns8250_ dev_data_t *data;109 110 data = (ns8250_dev_data_t *) malloc(sizeof(ns8250_dev_data_t));111 if ( NULL != data) {112 memset(data, 0, sizeof(ns8250_dev_data_t));113 fibril_mutex_initialize(&data->mutex);114 }115 return data;116 } 117 118 /** Delete driver data.119 * 120 * @param dataThe driver data structure.121 */ 122 static void delete_ns8250_dev_data(ns8250_dev_data_t *data)123 { 124 if (data != NULL)125 free(data);112 } ns8250_t; 113 114 /** Create per-device soft-state structure. 115 * 116 * @return Pointer to soft-state structure. 117 */ 118 static ns8250_t *ns8250_new(void) 119 { 120 ns8250_t *ns; 121 122 ns = (ns8250_t *) calloc(1, sizeof(ns8250_t)); 123 if (ns == NULL) 124 return NULL; 125 126 fibril_mutex_initialize(&ns->mutex); 127 return ns; 128 } 129 130 /** Delete soft-state structure. 131 * 132 * @param ns The driver data structure. 133 */ 134 static void ns8250_delete(ns8250_t *ns) 135 { 136 assert(ns != NULL); 137 free(ns); 126 138 } 127 139 … … 171 183 /** Read data from the serial port device. 172 184 * 173 * @param dev The serial port device.185 * @param fun The serial port function 174 186 * @param buf The ouput buffer for read data. 175 187 * @param count The number of bytes to be read. … … 178 190 * error number otherwise. 179 191 */ 180 static int ns8250_read(device_t *dev, char *buf, size_t count) 181 { 192 static int ns8250_read(ddf_fun_t *fun, char *buf, size_t count) 193 { 194 ns8250_t *ns = NS8250(fun); 182 195 int ret = EOK; 183 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 184 185 fibril_mutex_lock(&data->mutex); 186 while (!buf_is_empty(&data->input_buffer) && (size_t)ret < count) { 187 buf[ret] = (char)buf_pop_front(&data->input_buffer); 196 197 fibril_mutex_lock(&ns->mutex); 198 while (!buf_is_empty(&ns->input_buffer) && (size_t)ret < count) { 199 buf[ret] = (char)buf_pop_front(&ns->input_buffer); 188 200 ret++; 189 201 } 190 fibril_mutex_unlock(& data->mutex);202 fibril_mutex_unlock(&ns->mutex); 191 203 192 204 return ret; … … 195 207 /** Write a character to the serial port. 196 208 * 197 * @param data The serial port device's driver data.198 * @param c The character to be written .199 */ 200 static inline void ns8250_putchar(ns8250_ dev_data_t *data, uint8_t c)201 { 202 fibril_mutex_lock(& data->mutex);203 ns8250_write_8( data->port, c);204 fibril_mutex_unlock(& data->mutex);209 * @param ns Serial port device 210 * @param c The character to be written 211 */ 212 static inline void ns8250_putchar(ns8250_t *ns, uint8_t c) 213 { 214 fibril_mutex_lock(&ns->mutex); 215 ns8250_write_8(ns->port, c); 216 fibril_mutex_unlock(&ns->mutex); 205 217 } 206 218 207 219 /** Write data to the serial port. 208 220 * 209 * @param dev The serial port device.210 * @param buf The data to be written .211 * @param count The number of bytes to be written .212 * @return Zero on success .213 */ 214 static int ns8250_write(d evice_t *dev, char *buf, size_t count)215 { 216 ns8250_ dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;221 * @param fun The serial port function 222 * @param buf The data to be written 223 * @param count The number of bytes to be written 224 * @return Zero on success 225 */ 226 static int ns8250_write(ddf_fun_t *fun, char *buf, size_t count) 227 { 228 ns8250_t *ns = NS8250(fun); 217 229 size_t idx; 218 230 219 231 for (idx = 0; idx < count; idx++) 220 ns8250_putchar( data, (uint8_t) buf[idx]);232 ns8250_putchar(ns, (uint8_t) buf[idx]); 221 233 222 234 return 0; 223 235 } 224 236 225 static d evice_ops_t ns8250_dev_ops;237 static ddf_dev_ops_t ns8250_dev_ops; 226 238 227 239 /** The character interface's callbacks. */ … … 231 243 }; 232 244 233 static int ns8250_add_device(d evice_t *dev);245 static int ns8250_add_device(ddf_dev_t *dev); 234 246 235 247 /** The serial port device driver's standard operations. */ … … 244 256 }; 245 257 246 /** Clean up the serial port device structure. 247 * 248 * @param dev The device structure. 249 */ 250 static void ns8250_dev_cleanup(device_t *dev) 251 { 252 if (dev->driver_data != NULL) { 253 delete_ns8250_dev_data((ns8250_dev_data_t*) dev->driver_data); 254 dev->driver_data = NULL; 255 } 256 257 if (dev->parent_phone > 0) { 258 async_hangup(dev->parent_phone); 259 dev->parent_phone = 0; 258 /** Clean up the serial port soft-state 259 * 260 * @param ns Serial port device 261 */ 262 static void ns8250_dev_cleanup(ns8250_t *ns) 263 { 264 if (ns->dev->parent_phone > 0) { 265 async_hangup(ns->dev->parent_phone); 266 ns->dev->parent_phone = 0; 260 267 } 261 268 } … … 263 270 /** Enable the i/o ports of the device. 264 271 * 265 * @param dev The serial port device. 266 * @return True on success, false otherwise. 267 */ 268 static bool ns8250_pio_enable(device_t *dev) 269 { 270 printf(NAME ": ns8250_pio_enable %s\n", dev->name); 271 272 ns8250_dev_data_t *data = (ns8250_dev_data_t *)dev->driver_data; 272 * @param ns Serial port device 273 * @return True on success, false otherwise 274 */ 275 static bool ns8250_pio_enable(ns8250_t *ns) 276 { 277 printf(NAME ": ns8250_pio_enable %s\n", ns->dev->name); 273 278 274 279 /* Gain control over port's registers. */ 275 if (pio_enable((void *)(uintptr_t) data->io_addr, REG_COUNT,276 (void **) & data->port)) {280 if (pio_enable((void *)(uintptr_t) ns->io_addr, REG_COUNT, 281 (void **) &ns->port)) { 277 282 printf(NAME ": error - cannot gain the port %#" PRIx32 " for device " 278 "%s.\n", data->io_addr,dev->name);283 "%s.\n", ns->io_addr, ns->dev->name); 279 284 return false; 280 285 } … … 285 290 /** Probe the serial port device for its presence. 286 291 * 287 * @param dev The serial port device. 288 * @return True if the device is present, false otherwise. 289 */ 290 static bool ns8250_dev_probe(device_t *dev) 291 { 292 printf(NAME ": ns8250_dev_probe %s\n", dev->name); 293 294 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 295 ioport8_t *port_addr = data->port; 292 * @param ns Serial port device 293 * @return True if the device is present, false otherwise 294 */ 295 static bool ns8250_dev_probe(ns8250_t *ns) 296 { 297 printf(NAME ": ns8250_dev_probe %s\n", ns->dev->name); 298 299 ioport8_t *port_addr = ns->port; 296 300 bool res = true; 297 301 uint8_t olddata; … … 310 314 311 315 if (!res) 312 printf(NAME ": device %s is not present.\n", dev->name);316 printf(NAME ": device %s is not present.\n", ns->dev->name); 313 317 314 318 return res; … … 317 321 /** Initialize serial port device. 318 322 * 319 * @param dev The serial port device.320 * @return Zero on success, negative error number otherwise .321 */ 322 static int ns8250_dev_initialize( device_t *dev)323 { 324 printf(NAME ": ns8250_dev_initialize %s\n", dev->name);323 * @param ns Serial port device 324 * @return Zero on success, negative error number otherwise 325 */ 326 static int ns8250_dev_initialize(ns8250_t *ns) 327 { 328 printf(NAME ": ns8250_dev_initialize %s\n", ns->dev->name); 325 329 326 330 int ret = EOK; … … 329 333 memset(&hw_resources, 0, sizeof(hw_resource_list_t)); 330 334 331 /* Allocate driver data for the device. */332 ns8250_dev_data_t *data = create_ns8250_dev_data();333 if (data == NULL)334 return ENOMEM;335 dev->driver_data = data;336 337 335 /* Connect to the parent's driver. */ 338 dev->parent_phone = devman_parent_device_connect(dev->handle,336 ns->dev->parent_phone = devman_parent_device_connect(ns->dev->handle, 339 337 IPC_FLAG_BLOCKING); 340 if ( dev->parent_phone < 0) {338 if (ns->dev->parent_phone < 0) { 341 339 printf(NAME ": failed to connect to the parent driver of the " 342 "device %s.\n", dev->name);343 ret = dev->parent_phone;340 "device %s.\n", ns->dev->name); 341 ret = ns->dev->parent_phone; 344 342 goto failed; 345 343 } 346 344 347 345 /* Get hw resources. */ 348 ret = hw_res_get_resource_list( dev->parent_phone, &hw_resources);346 ret = hw_res_get_resource_list(ns->dev->parent_phone, &hw_resources); 349 347 if (ret != EOK) { 350 348 printf(NAME ": failed to get hw resources for the device " 351 "%s.\n", dev->name);349 "%s.\n", ns->dev->name); 352 350 goto failed; 353 351 } … … 362 360 switch (res->type) { 363 361 case INTERRUPT: 364 data->irq = res->res.interrupt.irq;362 ns->irq = res->res.interrupt.irq; 365 363 irq = true; 366 364 printf(NAME ": the %s device was asigned irq = 0x%x.\n", 367 dev->name, data->irq);365 ns->dev->name, ns->irq); 368 366 break; 369 367 370 368 case IO_RANGE: 371 data->io_addr = res->res.io_range.address;369 ns->io_addr = res->res.io_range.address; 372 370 if (res->res.io_range.size < REG_COUNT) { 373 371 printf(NAME ": i/o range assigned to the device " 374 "%s is too small.\n", dev->name);372 "%s is too small.\n", ns->dev->name); 375 373 ret = ELIMIT; 376 374 goto failed; … … 378 376 ioport = true; 379 377 printf(NAME ": the %s device was asigned i/o address = " 380 "0x%x.\n", dev->name, data->io_addr);378 "0x%x.\n", ns->dev->name, ns->io_addr); 381 379 break; 382 380 … … 388 386 if (!irq || !ioport) { 389 387 printf(NAME ": missing hw resource(s) for the device %s.\n", 390 dev->name);388 ns->dev->name); 391 389 ret = ENOENT; 392 390 goto failed; … … 397 395 398 396 failed: 399 ns8250_dev_cleanup( dev);397 ns8250_dev_cleanup(ns); 400 398 hw_res_clean_resource_list(&hw_resources); 401 399 return ret; … … 404 402 /** Enable interrupts on the serial port device. 405 403 * 406 * Interrupt when data is received .404 * Interrupt when data is received 407 405 * 408 406 * @param port The base address of the serial port device's ports. 409 407 */ 410 408 static inline void ns8250_port_interrupts_enable(ioport8_t *port) 411 { 409 { 412 410 pio_write_8(port + 1, 0x1); /* Interrupt when data received. */ 413 411 pio_write_8(port + 4, 0xB); … … 416 414 /** Disable interrupts on the serial port device. 417 415 * 418 * @param port The base address of the serial port device's ports .416 * @param port The base address of the serial port device's ports 419 417 */ 420 418 static inline void ns8250_port_interrupts_disable(ioport8_t *port) … … 425 423 /** Enable interrupts for the serial port device. 426 424 * 427 * @param dev The device. 428 * @return Zero on success, negative error number otherwise. 429 */ 430 static int ns8250_interrupt_enable(device_t *dev) 431 { 432 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 433 425 * @param ns Serial port device 426 * @return Zero on success, negative error number otherwise 427 */ 428 static int ns8250_interrupt_enable(ns8250_t *ns) 429 { 434 430 /* Enable interrupt on the serial port. */ 435 ns8250_port_interrupts_enable( data->port);431 ns8250_port_interrupts_enable(ns->port); 436 432 437 433 return EOK; … … 618 614 * Set the default parameters of the serial communication. 619 615 * 620 * @param dev The serial port device. 621 */ 622 static void ns8250_initialize_port(device_t *dev) 623 { 624 ns8250_dev_data_t *data = (ns8250_dev_data_t *)dev->driver_data; 625 ioport8_t *port = data->port; 616 * @param ns Serial port device 617 */ 618 static void ns8250_initialize_port(ns8250_t *ns) 619 { 620 ioport8_t *port = ns->port; 626 621 627 622 /* Disable interrupts. */ … … 643 638 * buffer. 644 639 * 645 * @param dev The serial port device. 646 */ 647 static void ns8250_read_from_device(device_t *dev) 648 { 649 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 650 ioport8_t *port = data->port; 640 * @param ns Serial port device 641 */ 642 static void ns8250_read_from_device(ns8250_t *ns) 643 { 644 ioport8_t *port = ns->port; 651 645 bool cont = true; 652 646 653 647 while (cont) { 654 fibril_mutex_lock(& data->mutex);648 fibril_mutex_lock(&ns->mutex); 655 649 656 650 cont = ns8250_received(port); … … 658 652 uint8_t val = ns8250_read_8(port); 659 653 660 if ( data->client_connected) {661 if (!buf_push_back(& data->input_buffer, val)) {654 if (ns->client_connected) { 655 if (!buf_push_back(&ns->input_buffer, val)) { 662 656 printf(NAME ": buffer overflow on " 663 "%s.\n", dev->name);657 "%s.\n", ns->dev->name); 664 658 } else { 665 659 printf(NAME ": the character %c saved " 666 660 "to the buffer of %s.\n", 667 val, dev->name);661 val, ns->dev->name); 668 662 } 669 663 } 670 664 } 671 665 672 fibril_mutex_unlock(& data->mutex);666 fibril_mutex_unlock(&ns->mutex); 673 667 fibril_yield(); 674 668 } … … 682 676 * @param dev The serial port device. 683 677 */ 684 static inline void ns8250_interrupt_handler(d evice_t *dev, ipc_callid_t iid,678 static inline void ns8250_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid, 685 679 ipc_call_t *icall) 686 680 { 687 ns8250_read_from_device( dev);681 ns8250_read_from_device(NS8250_FROM_DEV(dev)); 688 682 } 689 683 690 684 /** Register the interrupt handler for the device. 691 685 * 686 * @param ns Serial port device 687 */ 688 static inline int ns8250_register_interrupt_handler(ns8250_t *ns) 689 { 690 return register_interrupt_handler(ns->dev, ns->irq, 691 ns8250_interrupt_handler, NULL); 692 } 693 694 /** Unregister the interrupt handler for the device. 695 * 696 * @param ns Serial port device 697 */ 698 static inline int ns8250_unregister_interrupt_handler(ns8250_t *ns) 699 { 700 return unregister_interrupt_handler(ns->dev, ns->irq); 701 } 702 703 /** The add_device callback method of the serial port driver. 704 * 705 * Probe and initialize the newly added device. 706 * 692 707 * @param dev The serial port device. 693 708 */ 694 static inline int ns8250_register_interrupt_handler(device_t *dev) 695 { 696 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 697 698 return register_interrupt_handler(dev, data->irq, 699 ns8250_interrupt_handler, NULL); 700 } 701 702 /** Unregister the interrupt handler for the device. 703 * 704 * @param dev The serial port device. 705 */ 706 static inline int ns8250_unregister_interrupt_handler(device_t *dev) 707 { 708 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 709 710 return unregister_interrupt_handler(dev, data->irq); 711 } 712 713 /** The add_device callback method of the serial port driver. 714 * 715 * Probe and initialize the newly added device. 716 * 717 * @param dev The serial port device. 718 */ 719 static int ns8250_add_device(device_t *dev) 720 { 709 static int ns8250_add_device(ddf_dev_t *dev) 710 { 711 ns8250_t *ns = NULL; 712 ddf_fun_t *fun = NULL; 713 bool need_cleanup = false; 714 int rc; 715 721 716 printf(NAME ": ns8250_add_device %s (handle = %d)\n", 722 717 dev->name, (int) dev->handle); 723 718 724 int res = ns8250_dev_initialize(dev); 725 if (res != EOK) 726 return res; 727 728 if (!ns8250_pio_enable(dev)) { 729 ns8250_dev_cleanup(dev); 730 return EADDRNOTAVAIL; 719 /* Allocate soft-state for the device */ 720 ns = ns8250_new(); 721 if (ns == NULL) { 722 rc = ENOMEM; 723 goto fail; 724 } 725 726 ns->dev = dev; 727 dev->driver_data = ns; 728 729 rc = ns8250_dev_initialize(ns); 730 if (rc != EOK) 731 goto fail; 732 733 need_cleanup = true; 734 735 if (!ns8250_pio_enable(ns)) { 736 rc = EADDRNOTAVAIL; 737 goto fail; 731 738 } 732 739 733 740 /* Find out whether the device is present. */ 734 if (!ns8250_dev_probe( dev)) {735 ns8250_dev_cleanup(dev);736 return ENOENT;741 if (!ns8250_dev_probe(ns)) { 742 rc = ENOENT; 743 goto fail; 737 744 } 738 745 739 746 /* Serial port initialization (baud rate etc.). */ 740 ns8250_initialize_port( dev);747 ns8250_initialize_port(ns); 741 748 742 749 /* Register interrupt handler. */ 743 if (ns8250_register_interrupt_handler( dev) != EOK) {750 if (ns8250_register_interrupt_handler(ns) != EOK) { 744 751 printf(NAME ": failed to register interrupt handler.\n"); 745 ns8250_dev_cleanup(dev);746 return res;752 rc = EADDRNOTAVAIL; 753 goto fail; 747 754 } 748 755 749 756 /* Enable interrupt. */ 750 r es = ns8250_interrupt_enable(dev);751 if (r es!= EOK) {757 rc = ns8250_interrupt_enable(ns); 758 if (rc != EOK) { 752 759 printf(NAME ": failed to enable the interrupt. Error code = " 753 "%d.\n", res); 754 ns8250_dev_cleanup(dev); 755 ns8250_unregister_interrupt_handler(dev); 756 return res; 760 "%d.\n", rc); 761 goto fail; 762 } 763 764 fun = ddf_fun_create(dev, fun_exposed, "a"); 765 if (fun == NULL) { 766 printf(NAME ": error creating function.\n"); 767 goto fail; 757 768 } 758 769 759 770 /* Set device operations. */ 760 dev->ops = &ns8250_dev_ops; 761 762 add_device_to_class(dev, "serial"); 771 fun->ops = &ns8250_dev_ops; 772 rc = ddf_fun_bind(fun); 773 if (rc != EOK) { 774 printf(NAME ": error binding function.\n"); 775 goto fail; 776 } 777 778 ns->fun = fun; 779 780 ddf_fun_add_to_class(fun, "serial"); 763 781 764 782 printf(NAME ": the %s device has been successfully initialized.\n", … … 766 784 767 785 return EOK; 786 fail: 787 if (fun != NULL) 788 ddf_fun_destroy(fun); 789 if (need_cleanup) 790 ns8250_dev_cleanup(ns); 791 if (ns != NULL) 792 ns8250_delete(ns); 793 return rc; 768 794 } 769 795 … … 775 801 * @param dev The device. 776 802 */ 777 static int ns8250_open(d evice_t *dev)778 { 779 ns8250_ dev_data_t *data = (ns8250_dev_data_t *)dev->driver_data;803 static int ns8250_open(ddf_fun_t *fun) 804 { 805 ns8250_t *data = (ns8250_t *) fun->dev->driver_data; 780 806 int res; 781 807 … … 788 814 } 789 815 fibril_mutex_unlock(&data->mutex); 790 816 791 817 return res; 792 818 } … … 799 825 * @param dev The device. 800 826 */ 801 static void ns8250_close(d evice_t *dev)802 { 803 ns8250_ dev_data_t *data = (ns8250_dev_data_t *)dev->driver_data;827 static void ns8250_close(ddf_fun_t *fun) 828 { 829 ns8250_t *data = (ns8250_t *) fun->dev->driver_data; 804 830 805 831 fibril_mutex_lock(&data->mutex); … … 823 849 */ 824 850 static void 825 ns8250_get_props(d evice_t *dev, unsigned int *baud_rate, unsigned int *parity,851 ns8250_get_props(ddf_dev_t *dev, unsigned int *baud_rate, unsigned int *parity, 826 852 unsigned int *word_length, unsigned int* stop_bits) 827 853 { 828 ns8250_ dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;854 ns8250_t *data = (ns8250_t *) dev->driver_data; 829 855 ioport8_t *port = data->port; 830 856 … … 850 876 * @param stop_bits The number of stop bits to be used. 851 877 */ 852 static int ns8250_set_props(d evice_t *dev, unsigned int baud_rate,878 static int ns8250_set_props(ddf_dev_t *dev, unsigned int baud_rate, 853 879 unsigned int parity, unsigned int word_length, unsigned int stop_bits) 854 880 { … … 857 883 stop_bits); 858 884 859 ns8250_ dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;885 ns8250_t *data = (ns8250_t *) dev->driver_data; 860 886 ioport8_t *port = data->port; 861 887 int ret; … … 877 903 * Configure the parameters of the serial communication. 878 904 */ 879 static void ns8250_default_handler(d evice_t *dev, ipc_callid_t callid,905 static void ns8250_default_handler(ddf_fun_t *fun, ipc_callid_t callid, 880 906 ipc_call_t *call) 881 907 { … … 886 912 switch (method) { 887 913 case SERIAL_GET_COM_PROPS: 888 ns8250_get_props( dev, &baud_rate, &parity, &word_length,914 ns8250_get_props(fun->dev, &baud_rate, &parity, &word_length, 889 915 &stop_bits); 890 916 async_answer_4(callid, EOK, baud_rate, parity, word_length, … … 897 923 word_length = IPC_GET_ARG3(*call); 898 924 stop_bits = IPC_GET_ARG4(*call); 899 ret = ns8250_set_props( dev, baud_rate, parity, word_length,925 ret = ns8250_set_props(fun->dev, baud_rate, parity, word_length, 900 926 stop_bits); 901 927 async_answer_0(callid, ret); … … 925 951 printf(NAME ": HelenOS serial port driver\n"); 926 952 ns8250_init(); 927 return d river_main(&ns8250_driver);953 return ddf_driver_main(&ns8250_driver); 928 954 } 929 955
Note:
See TracChangeset
for help on using the changeset viewer.