void OgreApp::setupDemoScene() { globals.initPaths(); globals.VendorID = getVendorID(); globals.initGlobalSettingsPath(); globals.saveGlobalSettings(globals.globalPath); #if defined(OGRE_IS_IOS) && defined(NETWORKING) //syncConfig(); #endif seed = time(0); srand(seed); std::cout << "SEED: " << seed << std::endl; // create font resources ResourcePtr resourceText1 = OgreFramework::getSingletonPtr()->m_pFontMgr->create("MainSmall", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); resourceText1->setParameter("type", "truetype"); //resourceText1->setParameter("source", "C64_User_Mono_v1.0-STYLE.ttf"); resourceText1->setParameter("source", "NEUROPOLX.ttf"); resourceText1->setParameter("size", "16"); resourceText1->setParameter("resolution", "96"); resourceText1->load(); ResourcePtr resourceText2 = OgreFramework::getSingletonPtr()->m_pFontMgr->create("MainBig", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); resourceText2->setParameter("type", "truetype"); resourceText2->setParameter("source", "Philosopher-Bold.ttf"); resourceText2->setParameter("size", "16"); resourceText2->setParameter("resolution", "256"); resourceText2->load(); Util::createDefaultSegments(OgreFramework::getSingletonPtr()->m_pSceneMgrMain); OgreFramework::getSingletonPtr()->m_pCameraMain->setPosition(Vector3::ZERO); OgreFramework::getSingletonPtr()->m_pCameraMain->lookAt(Vector3::ZERO); player = new Player( globals.playerName, OgreFramework::getSingletonPtr()->m_pCameraMain->getPosition(), OgreFramework::getSingletonPtr()->m_pCameraMain->getOrientation(), globals.initCamSpeed, globals.vineTOffset, seed, "vinezors" + Util::toStringInt(seed) + ".csv"); player->setSounds(); if (!player->loadProgress(globals.savePath)) std::cout << "WARNING: Save File could not be loaded correctly" << std::endl; player->feedLevelRequestFromSchedule(); engineStateMgr = new EngineStateManager(); engineStateMgr->requestPushEngine(ENGINE_MAIN_MENU, player); #if defined(OGRE_IS_IOS) && defined(NETWORKING) if (globals.syncDataToServer) syncLogs(); #endif }
uint32_t Cap1188_touch::getDeviceInfo(void){ uint32_t data; data = getProductID(); data <<= 8; data |= getMFGID(); data <<= 8; data |= getRevision(); data <<= 8; data |= getVendorID(); return data; }
void PCI::scan_devices() { int device_count = 0; for (uint32_t bus = 0; bus < 256; bus++) { for (uint32_t slot = 0; slot < 32; slot++) { for (uint32_t function = 0; function < 8; function++) { //根据配置空间的第0个寄存器是否返回0FFFFH值来判断是否存在该PCI设备 uint32_t vendor = getVendorID(bus, slot, function); if (vendor == 0xffff) break; uint32_t device = getDeviceID(bus, slot, function); uint32_t baseclass = getBaseClass(bus, slot, function); uint32_t subclass = getSubClass(bus, slot, function); uint32_t progif = getProgIF(bus, slot, function); PCI_IDS* pci_ids = get_device_ids(vendor, device, 0, 0); PCI_DEVICE_CLASS* pci_class = get_device_class(baseclass, subclass, progif); if (pci_ids != NULL) { printf("%d %02X:%02X:%X device: %s\n", device_count++, bus, slot, function, pci_ids->device_name); } else { printf("%d %02X:%02X:%X vendor: %x device: %x class: %x subclass: %x \n", device_count++, bus, slot, function, vendor, device, baseclass, subclass); } uint32_t header_type = getHeaderType(bus, slot, function); if ( (header_type & 0x80) == 0) break; /*pci_device *pdev = (pci_device *)malloc(sizeof(pci_device)); pdev->vendor = vendor; pdev->device = device; pdev->func = function; pdev->driver = 0; add_pci_device(pdev);*/ } } } }
URI osxHIDPointingDevice::getURI(bool expanded, bool crossplatform) const { URI uri; if (crossplatform) { uri.scheme = "any"; int vendorId, productId; if ((vendorId = getVendorID())) URI::addQueryArg(uri.query, "vendor", vendorId) ; if ((productId = getProductID())) URI::addQueryArg(uri.query, "product", productId) ; } else { uri = hiddev->getURI(expanded) ; // FIXME: query args for modes (report and queue) are useless as // long as they are not both fully supported if (primaryUsagePage!=OSX_DEFAULT_USAGEPAGE) URI::addQueryArg(uri.query, "usagePage", primaryUsagePage) ; if (primaryUsage!=OSX_DEFAULT_USAGE) URI::addQueryArg(uri.query, "usage", primaryUsage) ; } if (expanded || hiddev->debugLevel) URI::addQueryArg(uri.query, "debugLevel", hiddev->debugLevel) ; if (expanded || forced_cpi>0) URI::addQueryArg(uri.query, "cpi", getResolution()) ; if (expanded || forced_hz>0) URI::addQueryArg(uri.query, "hz", getUpdateFrequency()) ; return uri ; }
void pci_probe() { for(uint32_t bus = 0; bus < 256; bus++) { for(uint32_t slot = 0; slot < 32; slot++) { for(uint32_t function = 0; function < 8; function++) { uint16_t vendor = getVendorID(bus, slot, function); if(vendor == 0xffff) continue; uint16_t device = getDeviceID(bus, slot, function); mprint("vendor: 0x%x device: 0x%x\n", vendor, device); pci_device *pdev = (pci_device *)malloc(sizeof(pci_device)); pdev->vendor = vendor; pdev->device = device; pdev->func = function; pdev->driver = 0; add_pci_device(pdev); } } } }
static int gser_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_composite_dev *cdev = c->cdev; struct f_gser *gser = func_to_gser(f); int status; struct usb_ep *ep; #ifdef CONFIG_PANTECH_ANDROID_USB ushort vid; #endif /* allocate instance-specific interface IDs */ #ifdef CONFIG_PANTECH_ANDROID_USB vid = getVendorID(); if(vid == 0x05C6){ //printk("^^^^ It's Qualcomm gser\n"); status = usb_interface_id(c, f); if (status < 0) goto fail; gser->data_id = status; gser_interface_desc.bInterfaceNumber = status; }else{ //printk("^^^^ It's SKY gser\n"); status = usb_interface_id(c, f); if (status < 0) goto fail; gser->data_id = status; //data_id : cdc interface number gser_acm_cdc_interface_desc.bInterfaceNumber = status; //acm interface status = usb_interface_id(c, f); if (status < 0) goto fail; gser_acm_data_interface_desc.bInterfaceNumber = status; } #else status = usb_interface_id(c, f); if (status < 0) goto fail; gser->data_id = status; gser_interface_desc.bInterfaceNumber = status; #endif status = -ENODEV; /* allocate instance-specific endpoints */ ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_in_desc); if (!ep) goto fail; gser->port.in = ep; ep->driver_data = cdev; /* claim */ ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_out_desc); if (!ep) goto fail; gser->port.out = ep; ep->driver_data = cdev; /* claim */ #ifdef CONFIG_MODEM_SUPPORT ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_notify_desc); if (!ep) goto fail; gser->notify = ep; ep->driver_data = cdev; /* claim */ /* allocate notification */ gser->notify_req = gs_alloc_req(ep, sizeof(struct usb_cdc_notification) + 2, GFP_KERNEL); if (!gser->notify_req) goto fail; gser->notify_req->complete = gser_notify_complete; gser->notify_req->context = gser; #endif /* copy descriptors, and track endpoint copies */ #ifdef CONFIG_PANTECH_ANDROID_USB vid = getVendorID(); if( vid == 0x05C6){ f->descriptors = usb_copy_descriptors(gser_fs_function); }else{ f->descriptors = usb_copy_descriptors(pantech_gser_fs_function); } #else f->descriptors = usb_copy_descriptors(gser_fs_function); #endif if (!f->descriptors) goto fail; /* support all relevant hardware speeds... we expect that when * hardware is dual speed, all bulk-capable endpoints work at * both speeds */ if (gadget_is_dualspeed(c->cdev->gadget)) { gser_hs_in_desc.bEndpointAddress = gser_fs_in_desc.bEndpointAddress; gser_hs_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; #ifdef CONFIG_MODEM_SUPPORT gser_hs_notify_desc.bEndpointAddress = gser_fs_notify_desc.bEndpointAddress; #endif /* copy descriptors, and track endpoint copies */ #ifdef CONFIG_PANTECH_ANDROID_USB if( vid == 0x05C6){ f->hs_descriptors = usb_copy_descriptors(gser_hs_function); }else{ f->hs_descriptors = usb_copy_descriptors(pantech_gser_hs_function); } #else f->hs_descriptors = usb_copy_descriptors(gser_hs_function); #endif if (!f->hs_descriptors) goto fail; } if (gadget_is_superspeed(c->cdev->gadget)) { gser_ss_in_desc.bEndpointAddress = gser_fs_in_desc.bEndpointAddress; gser_ss_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; /* copy descriptors, and track endpoint copies */ f->ss_descriptors = usb_copy_descriptors(gser_ss_function); if (!f->ss_descriptors) goto fail; } DBG(cdev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n", gser->port_num, gadget_is_superspeed(c->cdev->gadget) ? "super" : gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", gser->port.in->name, gser->port.out->name); return 0; fail: if (f->descriptors) usb_free_descriptors(f->descriptors); #ifdef CONFIG_MODEM_SUPPORT if (gser->notify_req) gs_free_req(gser->notify, gser->notify_req); /* we might as well release our claims on endpoints */ if (gser->notify) gser->notify->driver_data = NULL; #endif /* we might as well release our claims on endpoints */ if (gser->port.out) gser->port.out->driver_data = NULL; if (gser->port.in) gser->port.in->driver_data = NULL; ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); return status; }