Ticket #3124: fbsd_compat.2.diff
File fbsd_compat.2.diff, 11.6 KB (added by , 16 years ago) |
---|
-
src/libs/compat/freebsd_network/if.c
101 101 driver_printf("%s: /dev/%s\n", gDriverName, ifp->device_name); 102 102 103 103 gDeviceNameList[ifp->if_index] = ifp->device_name; 104 ktrace_printf("if_initname: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 104 105 gDevices[ifp->if_index] = ifp; 105 106 106 107 ifp->root_device = find_root_device(unit); … … 309 310 void 310 311 ether_ifattach(struct ifnet *ifp, const uint8_t *macAddress) 311 312 { 313 ktrace_printf("ether_ifattach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 312 314 ifp->if_addrlen = ETHER_ADDR_LEN; 313 315 ifp->if_hdrlen = ETHER_HDR_LEN; 314 316 if_attach(ifp); … … 324 326 // once all drivers are cleaned up. 325 327 if (macAddress != IFP2ENADDR(ifp)) 326 328 memcpy(IFP2ENADDR(ifp), macAddress, ETHER_ADDR_LEN); 329 ktrace_printf("ether_ifattach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 327 330 } 328 331 329 332 -
src/libs/compat/freebsd_network/device.c
33 33 break; 34 34 } 35 35 36 ktrace_printf("compat_open: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 37 36 38 if (gDeviceNameList[i] == NULL) 37 39 return B_ERROR; 38 40 -
src/libs/compat/freebsd_network/compat/sys/haiku-module.h
74 74 void uninit_driver() \ 75 75 { _fbsd_uninit_driver(DRIVER_MODULE_NAME(name, busname)); } \ 76 76 const char **publish_devices() \ 77 { return gDeviceNameList; } \77 { ktrace_printf("publish_devices: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); return gDeviceNameList; } \ 78 78 device_hooks *find_device(const char *name) \ 79 79 { return &gDeviceHooks; } 80 80 -
src/libs/compat/freebsd_network/fbsd_mii.c
192 192 { 193 193 struct mii_data *mii; 194 194 195 ktrace_printf("miibus_detach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 195 196 bus_generic_detach(dev); 197 ktrace_printf("miibus_detach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 196 198 mii = device_get_softc(dev); 197 199 ifmedia_removeall(&mii->mii_media); 198 200 mii->mii_ifp = NULL; 201 ktrace_printf("miibus_detach: c: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 199 202 200 203 return(0); 201 204 } -
src/libs/compat/freebsd_network/compat.c
377 377 if (result == 0) 378 378 atomic_or(&device->flags, DEVICE_ATTACHED); 379 379 380 ktrace_printf("device_attach: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 381 380 382 return result; 381 383 } 382 384 … … 384 386 int 385 387 device_detach(device_t device) 386 388 { 389 ktrace_printf("device_detach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 387 390 if (device->driver == NULL) 388 391 return B_ERROR; 392 ktrace_printf("device_detach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 389 393 390 394 if ((atomic_and(&device->flags, ~DEVICE_ATTACHED) & DEVICE_ATTACHED) != 0 391 395 && device->methods.detach != NULL) { 392 396 int result = device->methods.detach(device); 397 ktrace_printf("device_detach: c: gDeviceNameList[0]=%s, result=0x%x\n", gDeviceNameList[0], result); 393 398 if (result != 0) { 394 399 atomic_or(&device->flags, DEVICE_ATTACHED); 395 400 return result; … … 404 409 bus_generic_attach(device_t dev) 405 410 { 406 411 device_t child = NULL; 412 ktrace_printf("bus_generic_attach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 407 413 408 414 while ((child = list_get_next_item(&dev->children, child)) != NULL) { 409 415 if (child->driver == NULL) { … … 418 424 } else 419 425 child->methods.probe(child); 420 426 427 ktrace_printf("bus_generic_attach: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 421 428 if (child->driver != NULL) { 422 429 int result = device_attach(child); 423 430 if (result != 0) 424 431 return result; 425 432 } 426 433 } 434 ktrace_printf("bus_generic_attach: c: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 427 435 428 436 return 0; 429 437 } … … 433 441 bus_generic_detach(device_t device) 434 442 { 435 443 device_t child = NULL; 444 ktrace_printf("bus_generic_detach: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 436 445 437 446 if ((device->flags & DEVICE_ATTACHED) == 0) 438 447 return B_ERROR; 439 448 449 ktrace_printf("bus_generic_detach: c: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 450 440 451 while (true) { 441 452 child = list_get_next_item(&device->children, child); 442 453 if (child == NULL) 443 454 break; 444 455 456 ktrace_printf("bus_generic_detach: d: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 445 457 device_detach(child); 446 458 } 459 ktrace_printf("bus_generic_detach: e: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 447 460 448 461 return 0; 449 462 } -
src/libs/compat/freebsd_network/driver.c
58 58 device_delete_child(NULL, root); 59 59 return B_NO_MEMORY; 60 60 } 61 ktrace_printf("init_root_device: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 61 62 62 63 root->driver = &sRootDriver; 63 64 root->root = root; … … 95 96 pci_info *info; 96 97 int i; 97 98 99 ktrace_printf("_fbsd_init_hardware: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 100 98 101 if (get_module(B_PCI_MODULE_NAME, (module_info **)&gPci) < B_OK) 99 102 return B_ERROR; 103 ktrace_printf("_fbsd_init_hardware: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 100 104 101 105 if (init_root_device(driver, &root, &child) != B_OK) { 102 106 dprintf("%s: creating device failed.\n", gDriverName); 103 107 put_module(B_PCI_MODULE_NAME); 104 108 return B_ERROR; 105 109 } 110 ktrace_printf("_fbsd_init_hardware: c: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 106 111 107 112 TRACE(("%s: init_hardware(%p)\n", gDriverName, driver)); 108 113 … … 125 130 break; 126 131 } 127 132 } 133 ktrace_printf("_fbsd_init_hardware: d: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 128 134 129 135 if (status < B_OK) 130 136 TRACE(("%s: no hardware found.\n", gDriverName)); … … 132 138 device_delete_child(NULL, root); 133 139 put_module(B_PCI_MODULE_NAME); 134 140 141 ktrace_printf("_fbsd_init_hardware: e: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 142 135 143 return status; 136 144 } 137 145 … … 142 150 status_t status; 143 151 int i = 0; 144 152 153 ktrace_printf("_fbsd_init_driver: a: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 154 145 155 dprintf("%s: init_driver(%p)\n", gDriverName, driver); 146 156 147 157 status = get_module(B_PCI_MODULE_NAME, (module_info **)&gPci); … … 169 179 bool found = false; 170 180 pci_info *info; 171 181 182 ktrace_printf("_fbsd_init_driver: b: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 172 183 status = init_root_device(driver, &root, &device); 184 ktrace_printf("_fbsd_init_driver: c: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 173 185 if (status < B_OK) 174 186 break; 175 187 176 188 info = get_pci_info(root); 177 189 178 190 for (; gPci->get_nth_pci_info(i, info) == B_OK; i++) { 191 ktrace_printf("_fbsd_init_driver: ca: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 179 192 if (device->methods.probe(device) < 0) 180 193 continue; 181 194 195 ktrace_printf("_fbsd_init_driver: d: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 182 196 if (device_attach(device) == 0) 183 197 found = true; 198 ktrace_printf("_fbsd_init_driver: e: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 184 199 185 200 i++; 186 201 break; … … 192 207 } 193 208 } 194 209 210 ktrace_printf("_fbsd_init_driver: f: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 195 211 if (gDeviceCount > 0) 196 212 return B_OK; 197 213 … … 206 222 uninit_mutexes(); 207 223 err1: 208 224 put_module(B_PCI_MODULE_NAME); 225 ktrace_printf("_fbsd_init_driver: g: gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 209 226 return status; 210 227 } 211 228 -
src/add-ons/kernel/drivers/network/3com/pci/if_xl.c
144 144 145 145 #include <pci/if_xlreg.h> 146 146 147 //QQQ 148 149 extern const char *gDeviceNameList[]; 150 147 151 /* 148 152 * TX Checksumming is disabled by default for two reasons: 149 153 * - TX Checksumming will occasionally produce corrupt packets … … 1054 1058 { 1055 1059 struct xl_type *t; 1056 1060 1061 ktrace_printf("3com: xl_probe, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1062 1057 1063 t = xl_devs; 1058 1064 1059 1065 while (t->xl_name != NULL) { … … 1224 1230 int unit, error = 0, rid, res; 1225 1231 uint16_t did; 1226 1232 1233 ktrace_printf("3com: xl_attach: a, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1234 1227 1235 sc = device_get_softc(dev); 1228 1236 sc->xl_dev = dev; 1229 1237 … … 1353 1361 goto fail; 1354 1362 } 1355 1363 ifp->if_softc = sc; 1364 ktrace_printf("3com: xl_attach: b, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1356 1365 if_initname(ifp, device_get_name(dev), device_get_unit(dev)); 1366 ktrace_printf("3com: xl_attach: c, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1357 1367 1358 1368 /* Reset the adapter. */ 1359 1369 XL_LOCK(sc); … … 1363 1373 /* 1364 1374 * Get station address from the EEPROM. 1365 1375 */ 1376 ktrace_printf("3com: xl_attach: d, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1366 1377 if (xl_read_eeprom(sc, (caddr_t)&eaddr, XL_EE_OEM_ADR0, 3, 1)) { 1367 1378 device_printf(dev, "failed to read station address\n"); 1368 1379 error = ENXIO; 1369 1380 goto fail; 1370 1381 } 1382 ktrace_printf("3com: xl_attach: e, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1371 1383 1372 1384 sc->xl_unit = unit; 1373 1385 callout_init_mtx(&sc->xl_stat_callout, &sc->xl_mtx, 0); … … 1614 1626 } 1615 1627 1616 1628 fail: 1629 ktrace_printf("3com: xl_attach: f, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1617 1630 if (error) 1618 1631 xl_detach(dev); 1632 ktrace_printf("3com: xl_attach: g, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1619 1633 1620 1634 return (error); 1621 1635 } … … 1690 1704 sc = device_get_softc(dev); 1691 1705 ifp = sc->xl_ifp; 1692 1706 1707 ktrace_printf("xl_detach: a, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1708 1693 1709 KASSERT(mtx_initialized(&sc->xl_mtx), ("xl mutex not initialized")); 1694 1710 1695 1711 #ifdef DEVICE_POLLING … … 1730 1746 if (sc->xl_res) 1731 1747 bus_release_resource(dev, res, rid, sc->xl_res); 1732 1748 1749 ktrace_printf("xl_detach: aa, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1733 1750 if (ifp) 1734 1751 if_free(ifp); 1752 ktrace_printf("xl_detach: ab, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1735 1753 1736 1754 if (sc->xl_mtag) { 1737 1755 bus_dmamap_destroy(sc->xl_mtag, sc->xl_tmpmap); … … 1754 1772 1755 1773 mtx_destroy(&sc->xl_mtx); 1756 1774 1775 ktrace_printf("xl_detach: b, gDeviceNameList[0]=%s\n", gDeviceNameList[0]); 1757 1776 return (0); 1758 1777 } 1759 1778 -
src/system/kernel/device_manager/devfs.cpp
215 215 { 216 216 struct devfs_vnode* vnode; 217 217 218 if (name[0] < 0) 219 panic("devfs_create_vnode: name[0] < 0"); 220 218 221 vnode = (struct devfs_vnode*)malloc(sizeof(struct devfs_vnode)); 219 222 if (vnode == NULL) 220 223 return NULL; -
src/system/kernel/fs/vfs.cpp
5470 5470 return B_BAD_ADDRESS; 5471 5471 5472 5472 ASSERT(entry->d_reclen >= sizeof(struct dirent)); 5473 ASSERT(entry->d_reclen <= sizeof(buffer)); 5473 5474 5474 5475 if (user_memcpy(entry->d_name, userEntry->d_name, 5475 entry->d_reclen - sizeof(struct dirent) ) != B_OK)5476 entry->d_reclen - sizeof(struct dirent) + 1) != B_OK) 5476 5477 return B_BAD_ADDRESS; 5477 5478 } else 5478 5479 entry = userEntry;