int main() { int rc; /* open the bioule */ rc = tbioopen(); if (rc) { printf("Test bio Driver may not be loaded\n"); exit(1); } if (ki_generic(tbio_fd , LTP_TBIO_ALLOC)) printf("Failed on LTP_TBIO_ALLOC test\n"); else printf("Success on LTP_TBIO_ALLOC test\n"); if (ki_generic(tbio_fd , LTP_TBIO_CLONE)) printf("Failed on LTP_TBIO_CLONE test\n"); else printf("Success on LTP_TBIO_CLONE test\n"); if (ki_generic(tbio_fd , LTP_TBIO_GET_NR_VECS)) printf("Failed on LTP_TBIO_GET_NR_VECS test\n"); else printf("Success on LTP_TBIO_GET_NR_VECS test\n"); if (ki_generic(tbio_fd , LTP_TBIO_ADD_PAGE)) printf("Failed on LTP_TBIO_ADD_PAGE test\n"); else printf("Success on LTP_TBIO_ADD_PAGE test\n"); if (tbio_split_to_dev(tbio_fd , LTP_TBIO_SPLIT)) printf("Failed on LTP_TBIO_SPLIT:write to dev\n"); else printf("Success on LTP_TBIO_SPLIT:write to dev\n"); if (tbio_to_dev(tbio_fd , LTP_TBIO_DO_IO)) printf("Failed on LTP_TBIO_DO_IO:write to dev\n"); else printf("Success on LTP_TBIO_DO_IO:write to dev\n"); if (tbio_from_dev(tbio_fd , LTP_TBIO_DO_IO)) printf("Failed on LTP_TBIO_DO_IO:read from dev\n"); else printf("Success on LTP_TBIO_DO_IO:read from dev\n"); if (ki_generic(tbio_fd , LTP_TBIO_PUT)) printf("Failed on LTP_TBIO_PUT test\n"); else printf("Success on LTP_TBIO_PUT test\n"); /* close the bioule */ rc = tbioclose(); if (rc) { printf("Test bio Driver may not be closed\n"); exit(1); } return 0; }
int main(void) { setup(); if (ki_generic(tbio_fd, LTP_TBIO_ALLOC)) tst_resm(TFAIL, "failed on LTP_TBIO_ALLOC test"); else tst_resm(TPASS, "success on LTP_TBIO_ALLOC test"); if (ki_generic(tbio_fd, LTP_TBIO_CLONE)) tst_resm(TFAIL, "failed on LTP_TBIO_CLONE test"); else tst_resm(TPASS, "success on LTP_TBIO_CLONE test"); if (ki_generic(tbio_fd, LTP_TBIO_GET_NR_VECS)) tst_resm(TFAIL, "failed on LTP_TBIO_GET_NR_VECS test"); else tst_resm(TPASS, "success on LTP_TBIO_GET_NR_VECS test"); if (ki_generic(tbio_fd, LTP_TBIO_ADD_PAGE)) tst_resm(TFAIL, "failed on LTP_TBIO_ADD_PAGE test"); else tst_resm(TPASS, "success on LTP_TBIO_ADD_PAGE test"); if (tbio_split_to_dev(tbio_fd, LTP_TBIO_SPLIT)) tst_resm(TFAIL, "failed on LTP_TBIO_SPLIT:write to dev"); else tst_resm(TPASS, "success on LTP_TBIO_SPLIT:write to dev"); if (tbio_to_dev(tbio_fd, LTP_TBIO_DO_IO)) tst_resm(TFAIL, "failed on LTP_TBIO_DO_IO:write to dev"); else tst_resm(TPASS, "success on LTP_TBIO_DO_IO:write to dev"); if (tbio_from_dev(tbio_fd, LTP_TBIO_DO_IO)) tst_resm(TFAIL, "failed on LTP_TBIO_DO_IO:read from dev"); else tst_resm(TPASS, "success on LTP_TBIO_DO_IO:read from dev"); if (ki_generic(tbio_fd, LTP_TBIO_PUT)) tst_resm(TFAIL, "failed on LTP_TBIO_PUT test"); else tst_resm(TPASS, "success on LTP_TBIO_PUT test"); cleanup(); tst_exit(); }
int main() { int rc; /* open the module */ rc = tmodopen(); if (rc) { printf("Test MOD Driver may not be loaded\n"); exit(1); } /* make test calls */ if (ki_generic(tmod_fd, LTP_OPTION1)) printf("Failed on option 1 test\n"); else printf("Success on option 1 test\n"); /* close the module */ rc = tmodclose(); if (rc) { printf("Test MOD Driver may not be closed\n"); exit(1); } return 0; }
int main() { int rc = 0; rc = tusbopen(); if( rc ) { printf("tusb driver may not be loaded\n"); exit(1); } /* test find device pointer */ if(ki_generic(tusb_fd, FIND_DEV)) printf("Failed to find usb device pointer\n"); else printf("Found usb device pointer\n"); /* test find usb hostcontroller */ if(ki_generic(tusb_fd, TEST_FIND_HCD)) printf("Failed to find usb hcd pointer\n"); else printf("Found usb hcd pointer\n"); /* test hcd probe */ if(ki_generic(tusb_fd, TEST_HCD_PROBE)) printf("Failed on hcd probe call\n"); else printf("Success hcd probe\n"); /* test hcd suspend */ if(ki_generic(tusb_fd, TEST_HCD_SUSPEND)) printf("Failed on hcd suspend call\n"); else printf("Success hcd suspend\n"); /* test hcd resume */ if(ki_generic(tusb_fd, TEST_HCD_RESUME)) printf("Failed on hcd resume call\n"); else printf("Success hcd resume\n"); #if 0 /* test hcd remove */ if(ki_generic(tusb_fd, TEST_HCD_REMOVE)) printf("Failed on hcd remove call\n"); else printf("Success hcd remove\n"); #endif tusbclose(); return 0; }
int main() { int rc; /* open the module */ rc = tbaseopen(); if (rc) { printf("Test MOD Driver may not be loaded\n"); exit(1); } /* test bus rescan */ if (ki_generic(tbase_fd, BUS_RESCAN)) printf("Failed on bus rescan\n"); else printf("Success on bus rescan\n"); /* test get driver */ if (ki_generic(tbase_fd, GET_DRV)) printf("Failed on get driver\n"); else printf("Success on get driver\n"); /* test put driver */ if (ki_generic(tbase_fd, PUT_DRV)) printf("Failed on put driver\n"); else printf("Success on put driver\n"); /* test register firmware, should return not 0 */ if (ki_generic(tbase_fd, REG_FIRM)) printf("Failed on register firmware\n\tPossibly because parent nodes already set\n"); else printf("Success on register firmware\n"); /* test create driver file sysfs */ if (ki_generic(tbase_fd, CREATE_FILE)) printf("Failed on creating driver file\n"); else printf("Success on creating driver file\n"); /* test device suspend and resume */ if (ki_generic(tbase_fd, DEV_SUSPEND)) printf("Failed on suspending device\n"); else printf("Success on suspending device\n"); /* test device create file sysfs */ if (ki_generic(tbase_fd, DEV_FILE)) printf("Failed on creating device file\n"); else printf("Success on creating device file\n"); /* test bus create file sysfs */ if (ki_generic(tbase_fd, BUS_FILE)) printf("Failed on creating bus file\n"); else printf("Success on creating bus file\n"); /* test register class */ if (ki_generic(tbase_fd, CLASS_REG)) printf("Failed on registering class\n"); else printf("Success on registering class\n"); /* test get class */ if (ki_generic(tbase_fd, CLASS_GET)) printf("Failed on get class\n"); else printf("Success on get class\n"); /* test class create file sysfs */ if (ki_generic(tbase_fd, CLASS_FILE)) printf("Failed on creating class file\n"); else printf("Success on creating class file\n"); /* test unregistering class */ if (ki_generic(tbase_fd, CLASS_UNREG)) printf("Failed on unregistering class\n"); else printf("Success on unregistering class\n"); /* test register class device */ if (ki_generic(tbase_fd, CLASSDEV_REG)) printf("Failed on registering class device and creating sysfs file\n"); else printf("Success on registering class device and creating sysfs file\n"); /* test register class interface */ if (ki_generic(tbase_fd, CLASSINT_REG)) printf("Failed on registering class interface\n"); else printf("Success on registering class interface\n"); /* test register sysdev_class */ if (ki_generic(tbase_fd, SYSDEV_CLS_REG)) printf("Failed on registering sysdev_class\n"); else printf("Success on registering sysdev_class\n"); /* test register sysdev */ if (ki_generic(tbase_fd, SYSDEV_REG)) printf("Failed on registering sysdev\n"); else printf("Success on registering sysdev\n"); /* test unregister sysdev */ if (ki_generic(tbase_fd, SYSDEV_UNREG)) printf("Failed on unregistering sysdev\n"); else printf("Success on unregistering sysdev\n"); /* test unregister sysdev_class */ if (ki_generic(tbase_fd, SYSDEV_CLS_UNREG)) printf("Failed on unregistering sysdev_class\n"); else printf("Success on unregistering sysdev_class\n"); /* close the module */ rc = tbaseclose(); if (rc) { printf("Test MOD Driver may not be closed\n"); exit(1); } return 0; }
int main() { int rc; if(agpgart_io_test()) printf("Test agpgart io failed\n"); else printf("Test agpgart io success\n"); /* open the module */ rc = tagpopen(); if (rc ) { printf("Test AGP Driver may not be loaded\n"); exit(1); } /* make test calls for pci_find_device*/ if(ki_generic(tagp_fd, TEST_PCI_FIND_DEV)) printf("Success: Expected failure for pci_find_dev test\n"); else printf("Fail on pci_find_dev test\n"); /* make test calls for agp_backend_acquier */ if(ki_generic(tagp_fd, TEST_BACKEND_ACQUIRE)) printf("Fail on agp_backend_acquier\n"); else printf("Success on agp_backend_acquier\n"); /* make test calls for agp_backend_release */ if(ki_generic(tagp_fd, TEST_BACKEND_RELEASE)) printf("Fail on agp_backend_release\n"); else printf("Success on agp_backend_release\n"); /* make test calls for agp_alloc_bridge */ if(ki_generic(tagp_fd, TEST_ALLOC_BRIDGE)) printf("Fail on agp_alloc_bridge \n"); else printf("Success on agp_alloc_bridge\n"); /* make test calls for and agp_put_bridge */ if(ki_generic(tagp_fd, TEST_PUT_BRIDGE)) printf("Fail on agp_put_bridge\n"); else printf("Success on agp_put_bridge\n"); /* make test calls for agp_create_memory and agp_free_memory */ if(ki_generic(tagp_fd, TEST_CREATE_AND_FREE_MEMORY)) printf("Fail on agp_create_memory \n"); else printf("Success on agp_create_memory\n"); /* if(ki_generic(tagp_fd, TEST_FREE_MEMORY)) printf("Fail on agp_free_memory\n"); else printf("Success on agp_free_memory\n"); */ /////////////////////////////////////////////////////////////////////// /* make test calls for agp_num_entries */ if(ki_generic(tagp_fd, TEST_NUM_ENTRIES)) printf("Fail on agp_num_entries\n"); else printf("Success on agp_num_entries\n"); /* make test calls for agp_copy_info */ if(ki_generic(tagp_fd, TEST_COPY_INFO)) printf("Fail on agp_copy_info\n"); else printf("Success on agp_copy_info\n"); /* make test calls for agp_alloc_memory */ // if(ki_generic(tagp_fd, TEST_ALLOC_MEMORY_AND_BAND_UNBAND)) // printf("Fail on agp_alloc_memory_and_band_unband\n"); // else // printf("Success on agp_alloc_memory_and_band_unband\n"); /* make test calls for agp_get_version */ if(ki_generic(tagp_fd, TEST_GET_VERSION)) printf("Fail on agp_get_version\n"); else printf("Success on agp_get_version\n"); /* make test calls for agp_generic_enable */ if(ki_generic(tagp_fd, TEST_GENERIC_ENABLE)) printf("Fail on agp_generic_enable\n"); else printf("Success on agp_generic_enable\n"); /* make test calls for agp_generic_create_gatt_table */ if(ki_generic(tagp_fd, TEST_GENERIC_CREATE_GATT_TABLE)) printf("Fail on agp_generic_create_gatt_table\n"); else printf("Success on agp_generic_create_gatt_table\n"); /* make test calls for agp_generic_free_gatt_table */ if(ki_generic(tagp_fd, TEST_GENERIC_FREE_GATT_TABLE)) printf("Fail on agp_generic_free_gatt_table\n"); else printf("Success on agp_generic_free_gatt_table\n"); /* make test calls for agp_generic_insert_memory */ if(ki_generic(tagp_fd, TEST_GENERIC_INSERT_MEMROY)) printf("Fail on agp_generic_insert_memory\n"); else printf("Success on agp_generic_insert_memory\n"); /* make test calls for agp_generic_alloc_by_type */ if(ki_generic(tagp_fd, TEST_GENERIC_ALLOC_BY_TYPE)) printf("Fail on agp_generic_alloc_by_type\n"); else printf("Success on agp_generic_alloc_by_type\n"); /* make test calls for agp_generic_alloc_page */ if(ki_generic(tagp_fd, TEST_GENERIC_ALLOC_PAGE)) printf("Fail on agp_generic_alloc_page\n"); else printf("Success on agp_generic_alloc_page\n"); /* make test calls for agp_generic_destory_page */ if(ki_generic(tagp_fd, TEST_GENERIC_ALLOC_PAGE)) printf("Fail on agp_generic_destory_page\n"); else printf("Success on agp_generic_destory_page\n"); /* make test calls for agp_enable */ if(ki_generic(tagp_fd, TEST_ENABLE)) printf("Fail on agp_enable\n"); else printf("Success on agp_enable\n"); /* make test calls for agp_global_cache_flush */ if(ki_generic(tagp_fd, TEST_GLOBAL_CACHE_FLUSH)) printf("Fail on agp_global_cache_flush\n"); else printf("Success on agp_gloabl_cache_flush\n"); /* make test calls for agp_generic_mask_memory */ if(ki_generic(tagp_fd, TEST_GENERIC_MASK_MEMORY)) printf("Fail on agp_generic_mask_memory\n"); else printf("Success on agp_generic_mask_memory\n"); /* close the module */ rc = tagpclose(); if (rc ) { printf("Test AGP Driver may not be closed\n"); exit(1); } return 0; }