Changeset 0c0f823b in mainline
- Timestamp:
- 2011-11-14T20:50:08Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 765678f, d5ba17f
- Parents:
- 612ad864
- Location:
- uspace
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
r612ad864 r0c0f823b 108 108 static ddf_dev_ops_t isa_fun_ops; 109 109 110 static int isa_ add_device(ddf_dev_t *dev);110 static int isa_dev_add(ddf_dev_t *dev); 111 111 static int isa_dev_remove(ddf_dev_t *dev); 112 112 static int isa_fun_online(ddf_fun_t *fun); … … 115 115 /** The isa device driver's standard operations */ 116 116 static driver_ops_t isa_ops = { 117 . add_device = &isa_add_device,117 .dev_add = &isa_dev_add, 118 118 .dev_remove = &isa_dev_remove, 119 119 .fun_online = &isa_fun_online, … … 494 494 } 495 495 496 static int isa_ add_device(ddf_dev_t *dev)496 static int isa_dev_add(ddf_dev_t *dev) 497 497 { 498 498 isa_bus_t *isa; 499 499 500 ddf_msg(LVL_DEBUG, "isa_ add_device, device handle = %d",500 ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d", 501 501 (int) dev->handle); 502 502 -
uspace/drv/bus/pci/pciintel/pci.c
r612ad864 r0c0f823b 205 205 }; 206 206 207 static int pci_ add_device(ddf_dev_t *);207 static int pci_dev_add(ddf_dev_t *); 208 208 static int pci_fun_online(ddf_fun_t *); 209 209 static int pci_fun_offline(ddf_fun_t *); … … 211 211 /** PCI bus driver standard operations */ 212 212 static driver_ops_t pci_ops = { 213 . add_device = &pci_add_device,213 .dev_add = &pci_dev_add, 214 214 .fun_online = &pci_fun_online, 215 215 .fun_offline = &pci_fun_offline, … … 610 610 } 611 611 612 static int pci_ add_device(ddf_dev_t *dnode)612 static int pci_dev_add(ddf_dev_t *dnode) 613 613 { 614 614 pci_bus_t *bus = NULL; … … 617 617 int rc; 618 618 619 ddf_msg(LVL_DEBUG, "pci_ add_device");619 ddf_msg(LVL_DEBUG, "pci_dev_add"); 620 620 dnode->parent_sess = NULL; 621 621 622 622 bus = ddf_dev_data_alloc(dnode, sizeof(pci_bus_t)); 623 623 if (bus == NULL) { 624 ddf_msg(LVL_ERROR, "pci_ add_deviceallocation failed.");624 ddf_msg(LVL_ERROR, "pci_dev_add allocation failed."); 625 625 rc = ENOMEM; 626 626 goto fail; … … 634 634 dnode->handle, IPC_FLAG_BLOCKING); 635 635 if (!dnode->parent_sess) { 636 ddf_msg(LVL_ERROR, "pci_ add_devicefailed to connect to the "636 ddf_msg(LVL_ERROR, "pci_dev_add failed to connect to the " 637 637 "parent driver."); 638 638 rc = ENOENT; … … 644 644 rc = hw_res_get_resource_list(dnode->parent_sess, &hw_resources); 645 645 if (rc != EOK) { 646 ddf_msg(LVL_ERROR, "pci_ add_devicefailed to get hw resources "646 ddf_msg(LVL_ERROR, "pci_dev_add failed to get hw resources " 647 647 "for the device."); 648 648 goto fail; -
uspace/drv/bus/usb/ehci/main.c
r612ad864 r0c0f823b 46 46 #include "ehci.h" 47 47 48 static int ehci_ add_device(ddf_dev_t *device);48 static int ehci_dev_add(ddf_dev_t *device); 49 49 /*----------------------------------------------------------------------------*/ 50 50 static driver_ops_t ehci_driver_ops = { 51 . add_device = ehci_add_device,51 .dev_add = ehci_dev_add, 52 52 }; 53 53 /*----------------------------------------------------------------------------*/ … … 66 66 * @return Error code. 67 67 */ 68 static int ehci_ add_device(ddf_dev_t *device)68 static int ehci_dev_add(ddf_dev_t *device) 69 69 { 70 70 assert(device); -
uspace/drv/bus/usb/ohci/main.c
r612ad864 r0c0f823b 48 48 * @return Error code. 49 49 */ 50 static int ohci_ add_device(ddf_dev_t *device)50 static int ohci_dev_add(ddf_dev_t *device) 51 51 { 52 usb_log_debug("ohci_ add_device() called\n");52 usb_log_debug("ohci_dev_add() called\n"); 53 53 assert(device); 54 54 … … 65 65 /*----------------------------------------------------------------------------*/ 66 66 static driver_ops_t ohci_driver_ops = { 67 . add_device = ohci_add_device,67 .dev_add = ohci_dev_add, 68 68 }; 69 69 /*----------------------------------------------------------------------------*/ -
uspace/drv/bus/usb/uhci/main.c
r612ad864 r0c0f823b 43 43 #define NAME "uhci" 44 44 45 static int uhci_ add_device(ddf_dev_t *device);45 static int uhci_dev_add(ddf_dev_t *device); 46 46 /*----------------------------------------------------------------------------*/ 47 47 static driver_ops_t uhci_driver_ops = { 48 . add_device = uhci_add_device,48 .dev_add = uhci_dev_add, 49 49 }; 50 50 /*----------------------------------------------------------------------------*/ … … 59 59 * @return Error code. 60 60 */ 61 int uhci_ add_device(ddf_dev_t *device)61 int uhci_dev_add(ddf_dev_t *device) 62 62 { 63 usb_log_debug2("uhci_ add_device() called\n");63 usb_log_debug2("uhci_dev_add() called\n"); 64 64 assert(device); 65 65 -
uspace/drv/bus/usb/uhcirh/main.c
r612ad864 r0c0f823b 51 51 uintptr_t *io_reg_address, size_t *io_reg_size); 52 52 53 static int uhci_rh_ add_device(ddf_dev_t *device);53 static int uhci_rh_dev_add(ddf_dev_t *device); 54 54 55 55 static driver_ops_t uhci_rh_driver_ops = { 56 . add_device = uhci_rh_add_device,56 .dev_add = uhci_rh_dev_add, 57 57 }; 58 58 … … 82 82 * @return Error code. 83 83 */ 84 static int uhci_rh_ add_device(ddf_dev_t *device)84 static int uhci_rh_dev_add(ddf_dev_t *device) 85 85 { 86 86 if (!device) 87 87 return EINVAL; 88 88 89 usb_log_debug2("uhci_rh_ add_device(handle=%" PRIun ")\n",89 usb_log_debug2("uhci_rh_dev_add(handle=%" PRIun ")\n", 90 90 device->handle); 91 91 -
uspace/drv/bus/usb/vhc/main.c
r612ad864 r0c0f823b 58 58 }; 59 59 60 static int vhc_ add_device(ddf_dev_t *dev)60 static int vhc_dev_add(ddf_dev_t *dev) 61 61 { 62 62 static int vhc_count = 0; … … 131 131 132 132 static driver_ops_t vhc_driver_ops = { 133 . add_device = vhc_add_device,133 .dev_add = vhc_dev_add, 134 134 }; 135 135 -
uspace/drv/char/ns8250/ns8250.c
r612ad864 r0c0f823b 223 223 }; 224 224 225 static int ns8250_ add_device(ddf_dev_t *dev);225 static int ns8250_dev_add(ddf_dev_t *dev); 226 226 static int ns8250_dev_remove(ddf_dev_t *dev); 227 227 228 228 /** The serial port device driver's standard operations. */ 229 229 static driver_ops_t ns8250_ops = { 230 . add_device = &ns8250_add_device,230 .dev_add = &ns8250_dev_add, 231 231 .dev_remove = &ns8250_dev_remove 232 232 }; … … 717 717 } 718 718 719 /** The add_devicecallback method of the serial port driver.719 /** The dev_add callback method of the serial port driver. 720 720 * 721 721 * Probe and initialize the newly added device. … … 723 723 * @param dev The serial port device. 724 724 */ 725 static int ns8250_ add_device(ddf_dev_t *dev)725 static int ns8250_dev_add(ddf_dev_t *dev) 726 726 { 727 727 ns8250_t *ns = NULL; … … 730 730 int rc; 731 731 732 ddf_msg(LVL_DEBUG, "ns8250_ add_device%s (handle = %d)",732 ddf_msg(LVL_DEBUG, "ns8250_dev_add %s (handle = %d)", 733 733 dev->name, (int) dev->handle); 734 734 -
uspace/drv/infrastructure/root/root.c
r612ad864 r0c0f823b 66 66 #define VIRTUAL_FUN_MATCH_SCORE 100 67 67 68 static int root_ add_device(ddf_dev_t *dev);68 static int root_dev_add(ddf_dev_t *dev); 69 69 static int root_fun_online(ddf_fun_t *fun); 70 70 static int root_fun_offline(ddf_fun_t *fun); … … 72 72 /** The root device driver's standard operations. */ 73 73 static driver_ops_t root_ops = { 74 . add_device = &root_add_device,74 .dev_add = &root_dev_add, 75 75 .fun_online = &root_fun_online, 76 76 .fun_offline = &root_fun_offline … … 198 198 * of HW and pseudo devices). 199 199 */ 200 static int root_ add_device(ddf_dev_t *dev)201 { 202 ddf_msg(LVL_DEBUG, "root_ add_device, device handle=%" PRIun,200 static int root_dev_add(ddf_dev_t *dev) 201 { 202 ddf_msg(LVL_DEBUG, "root_dev_add, device handle=%" PRIun, 203 203 dev->handle); 204 204 -
uspace/drv/infrastructure/rootmac/rootmac.c
r612ad864 r0c0f823b 125 125 * 126 126 */ 127 static int rootmac_ add_device(ddf_dev_t *dev)127 static int rootmac_dev_add(ddf_dev_t *dev) 128 128 { 129 129 /* Register functions */ … … 136 136 /** The root device driver's standard operations. */ 137 137 static driver_ops_t rootmac_ops = { 138 . add_device = &rootmac_add_device138 .dev_add = &rootmac_dev_add 139 139 }; 140 140 -
uspace/drv/infrastructure/rootpc/rootpc.c
r612ad864 r0c0f823b 63 63 } rootpc_fun_t; 64 64 65 static int rootpc_ add_device(ddf_dev_t *dev);65 static int rootpc_dev_add(ddf_dev_t *dev); 66 66 static void root_pc_init(void); 67 67 68 68 /** The root device driver's standard operations. */ 69 69 static driver_ops_t rootpc_ops = { 70 . add_device = &rootpc_add_device70 .dev_add = &rootpc_dev_add 71 71 }; 72 72 … … 175 175 * @return Zero on success, negative error number otherwise. 176 176 */ 177 static int rootpc_ add_device(ddf_dev_t *dev)178 { 179 ddf_msg(LVL_DEBUG, "rootpc_ add_device, device handle = %d",177 static int rootpc_dev_add(ddf_dev_t *dev) 178 { 179 ddf_msg(LVL_DEBUG, "rootpc_dev_add, device handle = %d", 180 180 (int)dev->handle); 181 181 -
uspace/drv/infrastructure/rootvirt/rootvirt.c
r612ad864 r0c0f823b 62 62 }; 63 63 64 static int rootvirt_ add_device(ddf_dev_t *dev);64 static int rootvirt_dev_add(ddf_dev_t *dev); 65 65 static int rootvirt_dev_remove(ddf_dev_t *dev); 66 66 static int rootvirt_fun_online(ddf_fun_t *fun); … … 68 68 69 69 static driver_ops_t rootvirt_ops = { 70 . add_device = &rootvirt_add_device,70 .dev_add = &rootvirt_dev_add, 71 71 .dev_remove = &rootvirt_dev_remove, 72 72 .fun_online = &rootvirt_fun_online, … … 172 172 173 173 174 static int rootvirt_ add_device(ddf_dev_t *dev)174 static int rootvirt_dev_add(ddf_dev_t *dev) 175 175 { 176 176 rootvirt_t *rootvirt; … … 183 183 } 184 184 185 ddf_msg(LVL_DEBUG, " add_device(handle=%d)", (int)dev->handle);185 ddf_msg(LVL_DEBUG, "dev_add(handle=%d)", (int)dev->handle); 186 186 187 187 rootvirt = ddf_dev_data_alloc(dev, sizeof(rootvirt_t)); -
uspace/drv/nic/lo/lo.c
r612ad864 r0c0f823b 79 79 } 80 80 81 static int lo_ add_device(ddf_dev_t *dev)81 static int lo_dev_add(ddf_dev_t *dev) 82 82 { 83 83 nic_t *nic_data = nic_create_and_bind(dev); … … 118 118 119 119 static driver_ops_t lo_driver_ops = { 120 . add_device = lo_add_device,120 .dev_add = lo_dev_add, 121 121 }; 122 122 -
uspace/drv/nic/ne2k/ne2k.c
r612ad864 r0c0f823b 336 336 } 337 337 338 static int ne2k_ add_device(ddf_dev_t *dev)338 static int ne2k_dev_add(ddf_dev_t *dev) 339 339 { 340 340 /* Allocate driver data for the device. */ … … 391 391 392 392 static driver_ops_t ne2k_driver_ops = { 393 . add_device = ne2k_add_device393 .dev_add = ne2k_dev_add 394 394 }; 395 395 -
uspace/drv/test/test1/test1.c
r612ad864 r0c0f823b 40 40 #include "test1.h" 41 41 42 static int test1_ add_device(ddf_dev_t *dev);42 static int test1_dev_add(ddf_dev_t *dev); 43 43 static int test1_dev_remove(ddf_dev_t *dev); 44 44 static int test1_dev_gone(ddf_dev_t *dev); … … 47 47 48 48 static driver_ops_t driver_ops = { 49 . add_device = &test1_add_device,49 .dev_add = &test1_dev_add, 50 50 .dev_remove = &test1_dev_remove, 51 51 .dev_gone = &test1_dev_gone, … … 141 141 * @return Error code reporting success of the operation. 142 142 */ 143 static int test1_ add_device(ddf_dev_t *dev)143 static int test1_dev_add(ddf_dev_t *dev) 144 144 { 145 145 ddf_fun_t *fun_a; … … 147 147 int rc; 148 148 149 ddf_msg(LVL_DEBUG, " add_device(name=\"%s\", handle=%d)",149 ddf_msg(LVL_DEBUG, "dev_add(name=\"%s\", handle=%d)", 150 150 dev->name, (int) dev->handle); 151 151 -
uspace/drv/test/test2/test2.c
r612ad864 r0c0f823b 40 40 #define NAME "test2" 41 41 42 static int test2_ add_device(ddf_dev_t *dev);42 static int test2_dev_add(ddf_dev_t *dev); 43 43 static int test2_dev_remove(ddf_dev_t *dev); 44 44 static int test2_dev_gone(ddf_dev_t *dev); … … 47 47 48 48 static driver_ops_t driver_ops = { 49 . add_device = &test2_add_device,49 .dev_add = &test2_dev_add, 50 50 .dev_remove = &test2_dev_remove, 51 51 .dev_gone = &test2_dev_gone, … … 193 193 } 194 194 195 static int test2_ add_device(ddf_dev_t *dev)195 static int test2_dev_add(ddf_dev_t *dev) 196 196 { 197 197 test2_t *test2; 198 198 199 ddf_msg(LVL_DEBUG, "test2_ add_device(name=\"%s\", handle=%d)",199 ddf_msg(LVL_DEBUG, "test2_dev_add(name=\"%s\", handle=%d)", 200 200 dev->name, (int) dev->handle); 201 201 -
uspace/drv/test/test3/test3.c
r612ad864 r0c0f823b 41 41 #define NUM_FUNCS 20 42 42 43 static int test3_ add_device(ddf_dev_t *dev);43 static int test3_dev_add(ddf_dev_t *dev); 44 44 static int test3_dev_remove(ddf_dev_t *dev); 45 45 static int test3_fun_online(ddf_fun_t *fun); … … 47 47 48 48 static driver_ops_t driver_ops = { 49 . add_device = &test3_add_device,49 .dev_add = &test3_dev_add, 50 50 .dev_remove = &test3_dev_remove, 51 51 .fun_online = &test3_fun_online, … … 127 127 } 128 128 129 static int test3_ add_device(ddf_dev_t *dev)129 static int test3_dev_add(ddf_dev_t *dev) 130 130 { 131 131 int rc = EOK; 132 132 test3_t *test3; 133 133 134 ddf_msg(LVL_DEBUG, " add_device(name=\"%s\", handle=%d)",134 ddf_msg(LVL_DEBUG, "dev_add(name=\"%s\", handle=%d)", 135 135 dev->name, (int) dev->handle); 136 136 -
uspace/lib/drv/generic/driver.c
r612ad864 r0c0f823b 288 288 (void) parent_fun_handle; 289 289 290 res = driver->driver_ops-> add_device(dev);290 res = driver->driver_ops->dev_add(dev); 291 291 292 292 if (res != EOK) { -
uspace/lib/drv/include/ddf/driver.h
r612ad864 r0c0f823b 136 136 typedef struct driver_ops { 137 137 /** Callback method for passing a new device to the device driver */ 138 int (*add_device)(ddf_dev_t *); 139 /** 140 * Notification that the device was succesfully added. 141 * The driver can do any blocking operation without 142 * blocking the device manager. 143 */ 144 void (*device_added)(ddf_dev_t *dev); 138 int (*dev_add)(ddf_dev_t *); 145 139 /** Ask driver to remove a device */ 146 140 int (*dev_remove)(ddf_dev_t *); … … 151 145 /** Ask driver to offline a specific function */ 152 146 int (*fun_offline)(ddf_fun_t *); 147 148 /** 149 * Notification that the device was succesfully added. 150 * The driver can do any blocking operation without 151 * blocking the device manager. 152 * 153 * XXX REMOVE THIS 154 */ 155 void (*device_added)(ddf_dev_t *dev); 153 156 } driver_ops_t; 154 157 -
uspace/lib/usbdev/src/devdrv.c
r612ad864 r0c0f823b 46 46 47 47 static driver_ops_t generic_driver_ops = { 48 . add_device= generic_device_add,48 .dev_add = generic_device_add, 49 49 .dev_remove = generic_device_remove, 50 50 .dev_gone = generic_device_gone,
Note:
See TracChangeset
for help on using the changeset viewer.