[PATCH] agrsm-2.1.80 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have tried to compile the agrsm-2.1.80-4mdv2009.0.tgz driver for the 11c11040
chip that I have in my Toshiba Satellite L40 notebook, under Linux 2.6.27-rc9.
I got the following error message:

<<<<
ndz@toshi:~/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0$ make module
make -C /lib/modules/`uname -r`/build/
SUBDIRS=/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0 modules
make[1]: Entering directory `/home/ndz/linux-2.6.27-rc9-build'
make -C /home/ndz/linux-2.6.27-rc9 O=/home/ndz/linux-2.6.27-rc9-build/. modules
  CC [M]  /home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/HDA.o
/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/HDA.c:361: error:
redefinition of `snd_hda_power_up'
/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/hda_codec.h:756: error:
previous definition of `snd_hda_power_up' was here
/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/HDA.c:366: error:
redefinition of `snd_hda_power_down'
/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/hda_codec.h:757: error:
previous definition of `snd_hda_power_down' was here
make[4]: *** [/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0/HDA.o] Error 1
make[3]: *** [_module_/home/ndz/SOURCES/modem/tmp/agrsm-2.1.80-4mdv2009.0] Error
2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ndz/linux-2.6.27-rc9-build'
make: *** [module] Error 2
>>>>

I suggest a patch here that fixes the error and some other cosmetic
issues/warnings. Some smaller patches for the same problem have been suggested
by other people on this list. I include them too.  Also, I don't think the
C_FLAGS definitions in the Makefile are relevant, but I am not 100% sure.

After the patch, minicom initializes the modem successfully, but I cannot
test it any further (I don't have a phone line).

-- 
WBR, Nikolay Zhuravlev

diff -Naur tmp/agrsm-2.1.80-4mdv2009.0/agrsoftmodem.c agrsm-2.1.80-4mdv2009.0/agrsoftmodem.c
--- tmp/agrsm-2.1.80-4mdv2009.0/agrsoftmodem.c	2008-12-08 16:03:33.000000000 +0300
+++ agrsm-2.1.80-4mdv2009.0/agrsoftmodem.c	2009-04-17 03:41:39.000000000 +0400
@@ -132,6 +132,8 @@
 };
 MODULE_DEVICE_TABLE (usb, uss_table);
 
+#ifdef USB_MODEM
+#ifdef NONGPL
 static struct usb_driver uss_driver = { 
 //bala-dbg
 //	.owner		= THIS_MODULE, 
@@ -140,6 +142,8 @@
 	.disconnect 	= uss_disconnect, 
 	.id_table   	= uss_table, 
 };  
+#endif
+#endif
 
 struct usb_uss *dev = NULL;
 extern unsigned char IsCmdCompleted;
@@ -454,8 +458,7 @@
 	INIT_TQUEUE(x_tqueue, func, data);
 #else
 	struct work_struct *x_tqueue = (struct work_struct *) task_x;
-
-    INIT_WORK(x_tqueue, wrap_LXHardwareBottomHalf);
+    INIT_WORK(x_tqueue, (work_func_t)wrap_LXHardwareBottomHalf);
 #endif
 }
 
@@ -466,7 +469,7 @@
 	INIT_TQUEUE(x_tqueue, func, data);
 #else
 	struct work_struct *x_tqueue = (struct work_struct *) task_x;
-	INIT_WORK(x_tqueue, func);   
+	INIT_WORK(x_tqueue, (work_func_t)func);   
 #endif
 }
 
@@ -493,7 +496,7 @@
 #ifdef USB_MODEM
 
 #define to_uss_dev(d) container_of(d, struct usb_uss, kref)
-fnatr void *xkmalloc(d) { return kmalloc(d, GFP_KERNEL); }
+fnatr void *xkmalloc(size_t d) { return kmalloc(d, GFP_KERNEL); }
 fnatr void *kmalloc_dev(void) {
 	dev = kmalloc(sizeof(struct usb_uss), GFP_KERNEL);
     	if(dev) memset(dev, 0x00, sizeof(struct usb_uss));
@@ -519,7 +522,7 @@
 fnatr void *get_iface_desc(void *p) 	{return  (((struct usb_interface *)p)->cur_altsetting);}
 fnatr int  get_num_endpoints(void *p) 	{return (((struct usb_host_interface *)p)->desc.bNumEndpoints);}
 fnatr void x_kref_put(void *p) 		{if (dev)  kref_put(&dev->kref, p); }
-fnatr void x_kref_init()		{kref_init(&dev->kref);}
+fnatr void x_kref_init(void)		{kref_init(&dev->kref);}
 fnatr int  IsDirIn(int addr) 		{return (addr & USB_DIR_IN);}
 fnatr int  IsBulkXfer(int attr) 	{return ((attr & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK);}
 fnatr int  x_le16_to_cpu(int d) 	{return le16_to_cpu(d);}
@@ -529,14 +532,14 @@
 fnatr int  get_urb_status(void *p) 	{return (((struct urb *)p)->status);}
 fnatr void *get_urb_context(void *p) 	{return (((struct urb *)p)->context);}
 fnatr void *get_dev(void) 		{return dev;}
-fnatr void *x_usb_alloc_urb_kernel() 	{
+fnatr void *x_usb_alloc_urb_kernel(void) 	{
 	#ifdef NONGPL
 	return usb_alloc_urb(0, GFP_KERNEL);
 	#else 
 	return 0;
 	#endif
 }
-fnatr void *x_usb_alloc_urb_atomic() 	{
+fnatr void *x_usb_alloc_urb_atomic(void) 	{
 	#ifdef NONGPL
 	return usb_alloc_urb(0, GFP_ATOMIC);
 	#else
diff -Naur tmp/agrsm-2.1.80-4mdv2009.0/HDA.c agrsm-2.1.80-4mdv2009.0/HDA.c
--- tmp/agrsm-2.1.80-4mdv2009.0/HDA.c	2008-12-08 16:03:33.000000000 +0300
+++ agrsm-2.1.80-4mdv2009.0/HDA.c	2009-04-23 00:58:35.000000000 +0400
@@ -246,7 +246,7 @@
 temp = (unsigned long *) chip_temp->remap_addr;
 for (i=0; i<(0x1A0/4);)
 {
-	snd_printk(KERN_ERR"HDA register %04X %08X %08X %08X %08X\n",i*4,(unsigned int)temp[i],(unsigned int)temp[i+1],(unsigned int)temp[i+2],(unsigned int)temp[i+3]);
+	snd_printk(KERN_ERR"HDA register %04X %08lX %08lX %08lX %08lX\n",i*4,temp[i],temp[i+1],temp[i+2],temp[i+3]);
 	i = i+4;
 }
 }
@@ -357,6 +357,7 @@
 return rvalue;
 }
 
+#ifdef CONFIG_SND_HDA_POWER_SAVE
 void snd_hda_power_up(struct hda_codec *codec)
 {
   return;
@@ -366,6 +367,7 @@
 {
   return;
 }
+#endif
 
 /**
  * snd_hda_codec_write - send a single command without waiting for response
diff -Naur tmp/agrsm-2.1.80-4mdv2009.0/Makefile agrsm-2.1.80-4mdv2009.0/Makefile
--- tmp/agrsm-2.1.80-4mdv2009.0/Makefile	2008-06-05 16:43:34.000000000 +0400
+++ agrsm-2.1.80-4mdv2009.0/Makefile	2009-04-17 02:05:54.000000000 +0400
@@ -8,7 +8,8 @@
 #   - Modem Serail Interface driver module
 #
 # Usage:
-#   make install: to make and install the driver modules
+#   make module: to build the driver modules
+#   make install: to build and install the driver modules
 #   make uninstall: to uninstall the driver modules
 #
 # Revision History:
@@ -19,63 +20,41 @@
 KERNEL_DIR = /lib/modules/`uname -r`/build/
 #KERNEL_DIR = /usr/src/linux-`uname -r | sed -e 's,\-default,,'`/
 #KERNEL_DIR = /usr/src/linux-`uname -r | sed -e 's,\-.*,,'`/
-KERNEL_DIR1 = /usr/src/linux-`uname -r`/include
-KERNEL_DIR2 = /usr/src/linux-`uname -r | sed -e 's,\-.*,,'`/include
-KERNEL_DIR5 = /usr/src/linux-`uname -r | sed -e 's,\-.*,,'`/include/asm/mach-default
-KERNEL_DIR3 = /usr/src/linux-`uname -r | sed -e 's,\..*,,'`.`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'`/include
-KERNEL_DIR4 = /usr/src/linux-`uname -r | sed -e 's,\-.*,,'`.SuSE/include
-
-I_FLAGS =  -I$(KERNEL_DIR1) -I$(KERNEL_DIR2) -I$(KERNEL_DIR5) -I$(KERNEL_DIR3) -I$(KERNEL_DIR4)/include
-
-#C_FLAGS = -Wall -Wno-unused -O2 -fomit-frame-pointer -fno-strength-reduce  -pipe\
-#		-mcpu=i486 -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
-#		-DMODULE -D__KERNEL__ -DLT_KER_24 -DLT_KER_26 -DKERNEL_DIR -DNO_EEPROM
-
-C_FLAGS = -Wall	-Wno-unused -O1 -fomit-frame-pointer -fno-strength-reduce -pipe \
-		-fno-gcse-after-reload \
-		-falign-loops=2 -falign-jumps=2 -falign-functions=2 \
-		-DMODULE -D__KERNEL__ -DLT_KER_24 -DLT_KER_26 -DNO_EEPROM $(I_FLAGS)
 
-EXTRA_CFLAGS += -Wall -DLT_KER_24 -DLT_KER_26 -DNO_EEPROM 
+EXTRA_CFLAGS += -Wall -DLT_KER_26
 
 EXTRA_LDFLAGS := -d
     
 help :
 	@echo ''
+	@echo 'Run "make module" to build Agere Systems Soft Modem.'
 	@echo 'Run "make install" to install Agere Systems Soft Modem on your system.'
 	@echo 'Run "make uninstall" to remove a previously installed modem.'
 	@echo ''
 
+obj-m := agrmodem.o agrserial.o
+
 agrmodem-objs := \
         agrsoftmodem.o agrmodemlib.o HDA.o
 
 agrserial-objs := \
 	serial26.o
 
-obj-m += agrmodem.o agrserial.o
-
 module:
 #	cp ../../build/Linux/dbg-agr-linux-fedora-6-0/bin/AGRSMDM_lib.o agrmodemlib.o
 
-	make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
+	make -C $(KERNEL_DIR) M=$(PWD) modules
 
 $(obj)/agrmodemlib.o:
 	cp $(src)/agrmodemlib.o $(obj)/agrmodemlib.o
 
 clean:
-	rm -f *.a
-	rm -f *~
 	rm -f agrmodem.o
-	rm -f agrmodem.ko
-	rm -f agrmodem.mod.o
-	rm -f agrmodem.mod.c
 	rm -f agrserial.o
-	rm -f agrserial.ko
-	rm -f agrserial.mod.o
-	rm -f agrserial.mod.c
 	rm -f agrsoftmodem.o
 	rm -f serial26.o
 	rm -f HDA.o
+	rm -fr *.mod.c *.mod.o .*.cmd *.ko *~ .??* modules.order Module.symvers
 
 install:
 	./agrinst

[Index of Archives]     [Linux Media Development]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Fedora Women]     [Linux USB]

  Powered by Linux