From: Subrata <sub...@us...> - 2009-02-26 13:19:17
|
Update of /cvsroot/ltp/ltp/testcases/kernel/device-drivers/pci/tpci In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4515/ltp/testcases/kernel/device-drivers/pci/tpci Modified Files: tpci.c Log Message: Clear Trailing Whitespace. Signed-off-by: Michal Simek <mo...@mo...>. Index: tpci.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/device-drivers/pci/tpci/tpci.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tpci.c 9 Jan 2006 19:17:16 -0000 1.4 --- tpci.c 26 Feb 2009 12:02:10 -0000 1.5 *************** *** 18,36 **** * ! * This pci and pci-express testing kernel module will allow test calls ! * to be driven through various ioctl calls in a * user space program that has attained the appropriate * file descriptor for this device. For the functions of ! * this module to work correctly there must be a pci / pci-express ! * device somewhere in the system. The tests do not need ! * a specific device, and the first pci device available * will be grabbed. * * author: Sean Ruyle (sr...@us...) ! * date: 5/20/2003 ! * PCI-Express test scripts author: Amit Khanna (ami...@in...) * date: 8/20/2004 * ! * file: tpci.c, * module: tpci */ --- 18,36 ---- * ! * This pci and pci-express testing kernel module will allow test calls ! * to be driven through various ioctl calls in a * user space program that has attained the appropriate * file descriptor for this device. For the functions of ! * this module to work correctly there must be a pci / pci-express ! * device somewhere in the system. The tests do not need ! * a specific device, and the first pci device available * will be grabbed. * * author: Sean Ruyle (sr...@us...) ! * date: 5/20/2003 ! * PCI-Express test scripts author: Amit Khanna (ami...@in...) * date: 8/20/2004 * ! * file: tpci.c, * module: tpci */ *************** *** 83,87 **** /* ! * File operations struct, to use operations find the * correct file descriptor */ --- 83,87 ---- /* ! * File operations struct, to use operations find the * correct file descriptor */ *************** *** 107,116 **** /* * tpci_ioctl: ! * a user space program can drive the test functions ! * through a call to ioctl once the correct file * descriptor has been attained * * calls functions: ! * */ static int tpci_ioctl(struct inode *ino, struct file *f, --- 107,116 ---- /* * tpci_ioctl: ! * a user space program can drive the test functions ! * through a call to ioctl once the correct file * descriptor has been attained * * calls functions: ! * */ static int tpci_ioctl(struct inode *ino, struct file *f, *************** *** 161,165 **** case PCI_PROBE: rc = probe_pci_dev(); break; case PCI_ENABLE: rc = pci_enable(); break; ! case PCI_DISABLE: rc = pci_disable(); break; case FIND_BUS: rc = test_find_bus(); break; case FIND_CLASS: rc = test_find_class(); break; --- 161,165 ---- case PCI_PROBE: rc = probe_pci_dev(); break; case PCI_ENABLE: rc = pci_enable(); break; ! case PCI_DISABLE: rc = pci_disable(); break; case FIND_BUS: rc = test_find_bus(); break; case FIND_CLASS: rc = test_find_class(); break; *************** *** 170,177 **** case BUS_ADD_DEVICES: rc = test_bus_add_devices(); break; case ENABLE_BRIDGES: rc = test_enable_bridges(); break; ! case MATCH_DEVICE: rc = test_match_device(); break; case REG_DRIVER: rc = test_reg_driver(); break; case UNREG_DRIVER: rc = test_unreg_driver(); break; ! case PCI_RESOURCES: rc = test_assign_resources(); break; case SAVE_STATE: rc = test_save_state(); break; case RESTORE_STATE: rc = test_restore_state(); break; --- 170,177 ---- case BUS_ADD_DEVICES: rc = test_bus_add_devices(); break; case ENABLE_BRIDGES: rc = test_enable_bridges(); break; ! case MATCH_DEVICE: rc = test_match_device(); break; case REG_DRIVER: rc = test_reg_driver(); break; case UNREG_DRIVER: rc = test_unreg_driver(); break; ! case PCI_RESOURCES: rc = test_assign_resources(); break; case SAVE_STATE: rc = test_save_state(); break; case RESTORE_STATE: rc = test_restore_state(); break; *************** *** 225,230 **** /* * probe_pci_dev ! * find a pci device that can be used for other test ! * calls in this kernel module, select first device * that finds for use, do not need a specific device */ --- 225,230 ---- /* * probe_pci_dev ! * find a pci device that can be used for other test ! * calls in this kernel module, select first device * that finds for use, do not need a specific device */ *************** *** 268,272 **** /* * pci_enable ! * enable a pci device so that it may be used in * later testing in the user test program */ --- 268,272 ---- /* * pci_enable ! * enable a pci device so that it may be used in * later testing in the user test program */ *************** *** 312,316 **** pci_disable_device(dev); ! if (dev->current_state == 4 || dev->current_state == 3) { printk("tpci: disabled pci device\n"); --- 312,316 ---- pci_disable_device(dev); ! if (dev->current_state == 4 || dev->current_state == 3) { printk("tpci: disabled pci device\n"); *************** *** 327,332 **** /* * find_bus ! * call to pci_find_bus, use values from bus ! * pointer in ltp_pci, make sure that returns * bus with same values */ --- 327,332 ---- /* * find_bus ! * call to pci_find_bus, use values from bus ! * pointer in ltp_pci, make sure that returns * bus with same values */ *************** *** 356,360 **** /* * find_class ! * call to pci_find_class, using values from the * pci_dev pointer in ltp_pci structure */ --- 356,360 ---- /* * find_class ! * call to pci_find_class, using values from the * pci_dev pointer in ltp_pci structure */ *************** *** 380,385 **** /* * find_device ! * call to pci_find_device, using values for ! * parameters from pci_dev pointer in the * ltp_pci structure */ --- 380,385 ---- /* * find_device ! * call to pci_find_device, using values for ! * parameters from pci_dev pointer in the * ltp_pci structure */ *************** *** 406,410 **** /* * find_subsys ! * call to pci_find_subsys, use valued from * pci_dev pointer in ltp_pci structure to * find pci_dev from subsys info --- 406,410 ---- /* * find_subsys ! * call to pci_find_subsys, use valued from * pci_dev pointer in ltp_pci structure to * find pci_dev from subsys info *************** *** 434,441 **** /* * test_scan_bus ! * call to pci_do_scan_bus, which takes ! * a struct pci_bus pointer, which will ! * return a an integer for how far the ! * function got in scanning bus */ static int test_scan_bus() { --- 434,441 ---- /* * test_scan_bus ! * call to pci_do_scan_bus, which takes ! * a struct pci_bus pointer, which will ! * return a an integer for how far the ! * function got in scanning bus */ static int test_scan_bus() { *************** *** 446,450 **** /* ! * check if returned number is greater than * max number of bus or less than 0 */ --- 446,450 ---- /* ! * check if returned number is greater than * max number of bus or less than 0 */ *************** *** 463,472 **** /* * test_slot_scan ! * make call to pci_scan_slot, which will ! * find the device pointer and setup the * device info */ static int test_slot_scan() { ! int rc, ret; int num = ltp_pci.dev->devfn; struct pci_bus *bus = ltp_pci.bus; --- 463,472 ---- /* * test_slot_scan ! * make call to pci_scan_slot, which will ! * find the device pointer and setup the * device info */ static int test_slot_scan() { ! int rc, ret; int num = ltp_pci.dev->devfn; struct pci_bus *bus = ltp_pci.bus; *************** *** 490,498 **** * make call to pci_bus_add_devices, * which will check the device pointer ! * that is passed in for more devices * that it can add */ static int test_bus_add_devices() { ! int rc; struct pci_bus *bus = ltp_pci.bus; --- 490,498 ---- * make call to pci_bus_add_devices, * which will check the device pointer ! * that is passed in for more devices * that it can add */ static int test_bus_add_devices() { ! int rc; struct pci_bus *bus = ltp_pci.bus; *************** *** 513,522 **** /* * test_enable_bridges ! * make call to pci_enable_bridges, ! * use bus pointer from the ltp_pci * structure */ static int test_enable_bridges() { ! int rc; struct pci_bus *bus = ltp_pci.bus; --- 513,522 ---- /* * test_enable_bridges ! * make call to pci_enable_bridges, ! * use bus pointer from the ltp_pci * structure */ static int test_enable_bridges() { ! int rc; struct pci_bus *bus = ltp_pci.bus; *************** *** 538,542 **** /* * test_match_device ! * make call to pci_match_device, returns a * pci_device_id pointer */ --- 538,542 ---- /* * test_match_device ! * make call to pci_match_device, returns a * pci_device_id pointer */ *************** *** 569,576 **** ! /* * test_reg_driver * make call to pci_register_driver, which will ! * register the driver for a device with the * system */ --- 569,576 ---- ! /* * test_reg_driver * make call to pci_register_driver, which will ! * register the driver for a device with the * system */ *************** *** 585,589 **** /* copy in structure of tmp, reset some fields */ drv->name = "Tmod_driver"; ! drv->driver = tmp->driver; /* copy structure into ltp_pci.drv */ --- 585,589 ---- /* copy in structure of tmp, reset some fields */ drv->name = "Tmod_driver"; ! drv->driver = tmp->driver; /* copy structure into ltp_pci.drv */ *************** *** 598,607 **** ret = pci_register_driver(drv); ! if(ret) { printk("tpci: Success driver register\n"); rc = 0; } else { ! rc = 1; printk("tpci: unsuccessful registering pci driver\n"); } --- 598,607 ---- ret = pci_register_driver(drv); ! if(ret) { printk("tpci: Success driver register\n"); rc = 0; } else { ! rc = 1; printk("tpci: unsuccessful registering pci driver\n"); } *************** *** 617,621 **** static int test_unreg_driver() { int rc; ! struct pci_driver *drv = ltp_pci.drv; if(!drv) { --- 617,621 ---- static int test_unreg_driver() { int rc; ! struct pci_driver *drv = ltp_pci.drv; if(!drv) { *************** *** 640,644 **** * test_assign_resources * make calls to pci_assign_resource, will need ! * to setup a dev pointer and resource pointer, */ static int test_assign_resources() { --- 640,644 ---- * test_assign_resources * make calls to pci_assign_resource, will need ! * to setup a dev pointer and resource pointer, */ static int test_assign_resources() { *************** *** 653,658 **** } ! /* ! * enable device after call to assign resource * because might error if (!r->start && r->end) */ --- 653,658 ---- } ! /* ! * enable device after call to assign resource * because might error if (!r->start && r->end) */ *************** *** 674,678 **** rc = pci_save_state(dev, buffer); ! if(rc) printk("tpci: Failed save state\n"); else --- 674,678 ---- rc = pci_save_state(dev, buffer); ! if(rc) printk("tpci: Failed save state\n"); else *************** *** 684,688 **** /* * test_restore_state ! * make call to pci_restore_state, get the state buffer * should have been previously filled out by save state */ --- 684,688 ---- /* * test_restore_state ! * make call to pci_restore_state, get the state buffer * should have been previously filled out by save state */ *************** *** 707,711 **** */ static int test_max_bus() { ! int rc, ret; ret = pci_max_busnr(); --- 707,711 ---- */ static int test_max_bus() { ! int rc, ret; ret = pci_max_busnr(); *************** *** 724,729 **** /* * test_find_cap ! * make call to pci_find_capability, which ! * will determine if a device has a certain * capability, use second parameter to specify * which capability you are looking for --- 724,729 ---- /* * test_find_cap ! * make call to pci_find_capability, which ! * will determine if a device has a certain * capability, use second parameter to specify * which capability you are looking for *************** *** 735,739 **** rc = pci_find_capability(dev, PCI_CAP_ID_PM); if(rc) ! printk("tpci: Does not have tested capability\n"); else printk("tpci: Device has PM capability\n"); --- 735,739 ---- rc = pci_find_capability(dev, PCI_CAP_ID_PM); if(rc) ! printk("tpci: Does not have tested capability\n"); else printk("tpci: Device has PM capability\n"); *************** *** 761,776 **** } ! /* * test_read_pci_exp_config ! * make call to pci_config_read and determine if ! * the PCI-Express enhanced config space of this * device can be read successfully. */ ! static int test_read_pci_exp_config() { int rc; int reg= 100, len= 4; /*PCI-Exp enhanced config register 0x100, 4 implies dword access*/ struct pci_dev *dev = ltp_pci.dev; ! u32 data, *value; --- 761,776 ---- } ! /* * test_read_pci_exp_config ! * make call to pci_config_read and determine if ! * the PCI-Express enhanced config space of this * device can be read successfully. */ ! static int test_read_pci_exp_config() { int rc; int reg= 100, len= 4; /*PCI-Exp enhanced config register 0x100, 4 implies dword access*/ struct pci_dev *dev = ltp_pci.dev; ! u32 data, *value; *************** *** 794,799 **** /* * tpci_init_module ! * set the owner of tpci_fops, register the module ! * as a char device, and perform any necessary * initialization for pci devices */ --- 794,799 ---- /* * tpci_init_module ! * set the owner of tpci_fops, register the module ! * as a char device, and perform any necessary * initialization for pci devices */ *************** *** 819,823 **** /* * tpci_exit_module ! * unregister the device and any necessary * operations to close for pci devices */ --- 819,823 ---- /* * tpci_exit_module ! * unregister the device and any necessary * operations to close for pci devices */ *************** *** 830,834 **** rc = unregister_chrdev(Major, DEVICE_NAME); ! if (rc < 0) printk("tpci: unregister failed\n"); else --- 830,834 ---- rc = unregister_chrdev(Major, DEVICE_NAME); ! if (rc < 0) printk("tpci: unregister failed\n"); else *************** *** 843,846 **** ! --- 843,846 ---- ! |