Changeset 7acd787 in mainline
- Timestamp:
- 2019-01-03T00:53:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b9f1585, c477c80
- Parents:
- ca645a2
- git-author:
- Jiri Svoboda <jiri@…> (2019-01-03 00:48:00)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-01-03 00:53:50)
- Files:
-
- 9 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rca645a2 r7acd787 130 130 uspace/app/nic/nic 131 131 uspace/app/nterm/nterm 132 uspace/app/pci/pci 132 133 uspace/app/perf/perf 133 134 uspace/app/ping/ping -
abi/include/abi/ipc/interfaces.h
rca645a2 r7acd787 183 183 FOURCC_COMPACT('v', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE, 184 184 INTERFACE_IPC_TEST = 185 FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE 185 FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE, 186 INTERFACE_PCI = 187 FOURCC_COMPACT('p', 'c', 'i', ' ') | IFACE_EXCHANGE_SERIALIZE 186 188 } iface_t; 187 189 -
boot/Makefile.common
rca645a2 r7acd787 206 206 netecho \ 207 207 nterm \ 208 pci \ 208 209 ping \ 209 210 pkg \ -
uspace/Makefile
rca645a2 r7acd787 67 67 app/netecho \ 68 68 app/nterm \ 69 app/pci \ 69 70 app/perf \ 70 71 app/redir \ -
uspace/drv/bus/pci/pciintel/Makefile
rca645a2 r7acd787 32 32 33 33 SOURCES = \ 34 ctl.c \ 34 35 pci.c 35 36 -
uspace/drv/bus/pci/pciintel/pci.c
rca645a2 r7acd787 1 1 /* 2 * Copyright (c) 2019 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2018 Jiri Svoboda4 4 * All rights reserved. 5 5 * … … 58 58 #include <pci_dev_iface.h> 59 59 60 #include "ctl.h" 60 61 #include "pci.h" 62 #include "pci_regs.h" 61 63 62 64 #define NAME "pciintel" … … 73 75 74 76 /** Obtain PCI bus soft-state from DDF device node */ 75 #if 0 76 static pci_bus_t *pci_bus(ddf_dev_t *dnode) 77 pci_bus_t *pci_bus(ddf_dev_t *dnode) 77 78 { 78 79 return ddf_dev_data_get(dnode); 79 80 } 80 #endif81 81 82 82 /** Obtain PCI bus soft-state from function soft-state */ … … 448 448 449 449 /* TODO add subsys ids, but those exist only in header type 0 */ 450 } 451 452 /** Get first PCI function. 453 * 454 * @param bus PCI bus 455 * @return First PCI function on @a bus or @c NULL if there is none 456 */ 457 pci_fun_t *pci_fun_first(pci_bus_t *bus) 458 { 459 link_t *link; 460 461 link = list_first(&bus->funs); 462 if (link == NULL) 463 return NULL; 464 465 return list_get_instance(link, pci_fun_t, lfuns); 466 } 467 468 /** Get next PCI function. 469 * 470 * @param cur Current function 471 * @return Next PCI function on the same bus or @c NULL if there is none 472 */ 473 pci_fun_t *pci_fun_next(pci_fun_t *cur) 474 { 475 link_t *link; 476 477 link = list_next(&cur->lfuns, &cur->busptr->funs); 478 if (link == NULL) 479 return NULL; 480 481 return list_get_instance(link, pci_fun_t, lfuns); 450 482 } 451 483 … … 691 723 continue; 692 724 } 725 726 list_append(&fun->lfuns, &bus->funs); 693 727 } 694 728 } … … 718 752 goto fail; 719 753 } 754 755 list_initialize(&bus->funs); 720 756 fibril_mutex_initialize(&bus->conf_mutex); 721 757 … … 802 838 } 803 839 840 ddf_fun_set_conn_handler(ctl, pci_ctl_connection); 841 804 842 /* Enumerate functions. */ 805 843 ddf_msg(LVL_DEBUG, "Enumerating the bus"); … … 816 854 } 817 855 856 rc = ddf_fun_add_to_category(ctl, "pci"); 857 if (rc != EOK) { 858 ddf_msg(LVL_ERROR, "Failed adding control function to category " 859 "'pci'."); 860 goto fail; 861 } 862 818 863 hw_res_clean_resource_list(&hw_resources); 819 864 -
uspace/drv/bus/pci/pciintel/pci.h
rca645a2 r7acd787 37 37 #define PCI_H_ 38 38 39 #include <adt/list.h> 40 #include <ddi.h> 39 41 #include <ddf/driver.h> 40 #include "pci_regs.h"42 #include <fibril_synch.h> 41 43 42 44 #define PCI_MAX_HW_RES 10 … … 50 52 pio_window_t pio_win; 51 53 fibril_mutex_t conf_mutex; 54 /** List of functions (of pci_fun_t) */ 55 list_t funs; 52 56 } pci_bus_t; 53 57 … … 55 59 pci_bus_t *busptr; 56 60 ddf_fun_t *fnode; 61 /** Link to @c busptr->funs */ 62 link_t lfuns; 57 63 58 64 int bus; … … 71 77 } pci_fun_t; 72 78 79 extern pci_bus_t *pci_bus(ddf_dev_t *); 80 73 81 extern void pci_fun_create_match_ids(pci_fun_t *); 82 extern pci_fun_t *pci_fun_first(pci_bus_t *); 83 extern pci_fun_t *pci_fun_next(pci_fun_t *); 74 84 75 85 extern uint8_t pci_conf_read_8(pci_fun_t *, int); -
uspace/lib/c/Makefile
rca645a2 r7acd787 165 165 generic/assert.c \ 166 166 generic/bsearch.c \ 167 generic/pci.c \ 167 168 generic/pio_trace.c \ 168 169 generic/qsort.c \ -
uspace/srv/locsrv/locsrv.c
rca645a2 r7acd787 1390 1390 categ_dir_add_cat(&cdir, cat); 1391 1391 1392 cat = category_new("pci"); 1393 categ_dir_add_cat(&cdir, cat); 1394 1392 1395 return true; 1393 1396 }
Note:
See TracChangeset
for help on using the changeset viewer.