Changes in uspace/drv/ns8250/ns8250.c [7e752b2:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ns8250/ns8250.c
r7e752b2 rffa2c8ef 53 53 54 54 #include <driver.h> 55 #include <char.h> 56 #include <resource.h> 55 #include <ops/char_dev.h> 57 56 58 57 #include <devman.h> … … 227 226 228 227 /** The character interface's callbacks. */ 229 static char_ iface_t ns8250_char_iface= {228 static char_dev_ops_t ns8250_char_dev_ops = { 230 229 .read = &ns8250_read, 231 230 .write = &ns8250_write … … 257 256 258 257 if (dev->parent_phone > 0) { 259 ipc_hangup(dev->parent_phone);258 async_hangup(dev->parent_phone); 260 259 dev->parent_phone = 0; 261 260 } … … 274 273 275 274 /* Gain control over port's registers. */ 276 if (pio_enable((void *) data->io_addr, REG_COUNT,275 if (pio_enable((void *)(uintptr_t) data->io_addr, REG_COUNT, 277 276 (void **) &data->port)) { 278 277 printf(NAME ": error - cannot gain the port %#" PRIx32 " for device " … … 342 341 printf(NAME ": failed to connect to the parent driver of the " 343 342 "device %s.\n", dev->name); 344 ret = EPARTY; /* FIXME: use another EC */343 ret = dev->parent_phone; 345 344 goto failed; 346 345 } 347 346 348 347 /* Get hw resources. */ 349 if (!get_hw_resources(dev->parent_phone, &hw_resources)) { 348 ret = hw_res_get_resource_list(dev->parent_phone, &hw_resources); 349 if (ret != EOK) { 350 350 printf(NAME ": failed to get hw resources for the device " 351 351 "%s.\n", dev->name); 352 ret = EPARTY; /* FIXME: use another EC */353 352 goto failed; 354 353 } … … 374 373 printf(NAME ": i/o range assigned to the device " 375 374 "%s is too small.\n", dev->name); 376 ret = E PARTY; /* FIXME: use another EC */375 ret = ELIMIT; 377 376 goto failed; 378 377 } … … 390 389 printf(NAME ": missing hw resource(s) for the device %s.\n", 391 390 dev->name); 392 ret = E PARTY; /* FIXME: use another EC */391 ret = ENOENT; 393 392 goto failed; 394 393 } 395 394 396 clean_hw_resource_list(&hw_resources);395 hw_res_clean_resource_list(&hw_resources); 397 396 return ret; 398 397 399 398 failed: 400 399 ns8250_dev_cleanup(dev); 401 clean_hw_resource_list(&hw_resources);400 hw_res_clean_resource_list(&hw_resources); 402 401 return ret; 403 402 } … … 432 431 { 433 432 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 434 int res;435 436 /* Enable interrupt globally. */437 res = interrupt_enable(data->irq);438 if (res != EOK)439 return res;440 433 441 434 /* Enable interrupt on the serial port. */ … … 727 720 { 728 721 printf(NAME ": ns8250_add_device %s (handle = %d)\n", 729 dev->name, dev->handle);722 dev->name, (int) dev->handle); 730 723 731 724 int res = ns8250_dev_initialize(dev); … … 887 880 ipc_call_t *call) 888 881 { 889 ipcarg_t method = IPC_GET_METHOD(*call);882 sysarg_t method = IPC_GET_IMETHOD(*call); 890 883 int ret; 891 884 unsigned int baud_rate, parity, word_length, stop_bits; … … 895 888 ns8250_get_props(dev, &baud_rate, &parity, &word_length, 896 889 &stop_bits); 897 ipc_answer_4(callid, EOK, baud_rate, parity, word_length,890 async_answer_4(callid, EOK, baud_rate, parity, word_length, 898 891 stop_bits); 899 892 break; … … 906 899 ret = ns8250_set_props(dev, baud_rate, parity, word_length, 907 900 stop_bits); 908 ipc_answer_0(callid, ret);901 async_answer_0(callid, ret); 909 902 break; 910 903 911 904 default: 912 ipc_answer_0(callid, ENOTSUP);905 async_answer_0(callid, ENOTSUP); 913 906 } 914 907 } … … 924 917 ns8250_dev_ops.close = &ns8250_close; 925 918 926 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_ iface;919 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_dev_ops; 927 920 ns8250_dev_ops.default_handler = &ns8250_default_handler; 928 921 }
Note:
See TracChangeset
for help on using the changeset viewer.