Subrata Modak wrote:
> Thanks for keeping LTP updated with your releases. Did you find time to
> pursue further to investigate the other Device Drivers tests in LTP ?

I had a look on testcases/kernel/device-drivers/usb/tusb and deleted what is
no longer supported by Linux 2.6.28, for example struct usb_operations,
http://lwn.net/Articles/196429/ .

The result is that nearly nothing left which would test any pieces of the USB
code. I attached the patch, but I don't know if it is worth to keep the "tusb"
directory at all.

Regards,

        Márton Németh

diff -uprN ltp/testcases/kernel/device-drivers/usb/tusb.orig/Makefile ltp/testcases/kernel/device-drivers/usb/tusb/Makefile
--- ltp/testcases/kernel/device-drivers/usb/tusb.orig/Makefile	2003-06-10 22:07:42.000000000 +0200
+++ ltp/testcases/kernel/device-drivers/usb/tusb/Makefile	2009-02-23 16:36:30.000000000 +0100
@@ -3,7 +3,7 @@
 #
 
 #KERNELDIR := /usr/src/linux-2.5.64-gcov
-CFLAGS := $(CFLAGS) -Wall
+EXTRA_CFLAGS := -Wall -Wextra -Wno-unused-parameter
 
 ifneq ($(KERNELRELEASE),)
 
@@ -15,8 +15,15 @@ PWD	:= $(shell pwd)
 default:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
 #	$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules
-endif
 
 clean:
-	rm -f tusb.o 2>/dev/null || true
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
+	rm -f modules.order
+
+help:
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) help
 
+modules_install:
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install
+
+endif
diff -uprN ltp/testcases/kernel/device-drivers/usb/tusb.orig/README ltp/testcases/kernel/device-drivers/usb/tusb/README
--- ltp/testcases/kernel/device-drivers/usb/tusb.orig/README	1970-01-01 01:00:00.000000000 +0100
+++ ltp/testcases/kernel/device-drivers/usb/tusb/README	2009-02-18 22:34:48.000000000 +0100
@@ -0,0 +1 @@
+http://lwn.net/Articles/196429/
diff -uprN ltp/testcases/kernel/device-drivers/usb/tusb.orig/st_tusb.h ltp/testcases/kernel/device-drivers/usb/tusb/st_tusb.h
--- ltp/testcases/kernel/device-drivers/usb/tusb.orig/st_tusb.h	2006-01-09 20:17:17.000000000 +0100
+++ ltp/testcases/kernel/device-drivers/usb/tusb/st_tusb.h	2009-02-19 06:52:09.000000000 +0100
@@ -17,7 +17,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
 */
-extern struct usb_bus *usb_alloc_bus(struct usb_operations *);
+//extern struct usb_bus *usb_alloc_bus(struct usb_operations *);
 extern void usb_connect(struct usb_device *dev);
 extern int usb_new_device(struct usb_device *dev);
 extern void usb_free_bus(struct usb_bus *bus);
diff -uprN ltp/testcases/kernel/device-drivers/usb/tusb.orig/tusb.c ltp/testcases/kernel/device-drivers/usb/tusb/tusb.c
--- ltp/testcases/kernel/device-drivers/usb/tusb.orig/tusb.c	2006-01-09 20:17:17.000000000 +0100
+++ ltp/testcases/kernel/device-drivers/usb/tusb/tusb.c	2009-02-23 16:38:42.000000000 +0100
@@ -38,7 +38,7 @@
  * tusb.c
  */
 	
-#include <linux/config.h>
+#include <linux/autoconf.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/ioctl.h>
@@ -140,6 +140,7 @@ static struct usb_driver test_usb_driver
 	id_table:	tusb_id_table,
 };
 
+#if 0
 static int test_alloc_dev(struct usb_device *dev) {
 	printk("Entered test_alloc_dev\n");
 	return 0;
@@ -172,8 +173,7 @@ static struct usb_operations test_device
 	.submit_urb = 			test_submit_urb,
 	.unlink_urb = 			test_unlink_urb,
 };
-
-
+#endif
 
 static int tusb_ioctl(struct inode *ino, struct file *f, 
 			unsigned int cmd, unsigned long l) {
@@ -285,6 +285,7 @@ static int test_find_usbdev() {
 	ltp_usb.dev = udev;
 	
 	/* allocate the usb_bus pointer */
+#if 0
 	bus = usb_alloc_bus(&test_device_operations);
 	if(!bus) {
 		printk("tusb: Did not allocate a bus\n");
@@ -310,6 +311,7 @@ static int test_find_usbdev() {
 	/* connect the new device and setup pointers */
 	usb_connect(udev);
 	usb_new_device(udev);
+#endif
 
 	return 0;
 }
@@ -328,6 +330,7 @@ static int test_find_hcd() {
 
 	ltp_usb.pdev = pdev;
 
+#if 0
 	/* try and get a usb hostcontroller if possible */
 	pdev = pci_find_class(PCI_CLASS_SERIAL_USB << 8, NULL);
 	if(pdev) {
@@ -346,6 +349,9 @@ static int test_find_hcd() {
 		printk("tusb: Check kernel options enabled\n");
 		return 1;
 	}
+#else
+	return 1;
+#endif
 
 }
 		
@@ -499,16 +505,14 @@ static int tusb_init_module(void) {
 }
 
 static void tusb_exit_module(void) {
-	int rc;
 
 	kfree(ltp_usb.dev);
+
+#if 0
 	usb_free_bus(ltp_usb.bus);
+#endif
 
-	rc = unregister_chrdev(Major, DEVICE_NAME);
-	if(rc < 0) 
-		printk("tusb: unregister failed\n");
-	else
-		printk("tusb: unregister success\n");
+	unregister_chrdev(Major, DEVICE_NAME);
 
 	usb_deregister(&test_usb_driver);
 }
diff -uprN ltp/testcases/kernel/device-drivers/usb/tusb.orig/tusb.mod.c ltp/testcases/kernel/device-drivers/usb/tusb/tusb.mod.c
--- ltp/testcases/kernel/device-drivers/usb/tusb.orig/tusb.mod.c	2006-01-09 20:17:17.000000000 +0100
+++ ltp/testcases/kernel/device-drivers/usb/tusb/tusb.mod.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
-*/
-#include <linux/module.h>
-#include <linux/vermagic.h>
-#include <linux/compiler.h>
-
-const char vermagic[]
-__attribute__((section("__vermagic"))) =
-VERMAGIC_STRING;
-
-static const char __module_depends[]
-__attribute_used__
-__attribute__((section(".modinfo"))) =
-"depends=";
-
-MODULE_ALIAS("usb:v*p*dl*dh*dc*dsc*dp*ic03isc01ip01*");
-MODULE_ALIAS("usb:v*p*dl*dh*dc*dsc*dp*ic03isc01ip02*");
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to