Re: [zd1211-devs] Experiments with the vendor driver
On 1/1/07, Giulio Bottazzi <[EMAIL PROTECTED]> wrote: > On Mon, 1 Jan 2007 09:01:38 -0500 > "Jon Smirl" <[EMAIL PROTECTED]> wrote: > > > The INIT work changes went into 2.6.20+, they aren't in 2.6.18. It > > shouldn't be too hard to fix up the code to work on both releases. > > You just need to remove the INIT work changes and revert to the prior > > code. > > Thanks Jon. I did it (just reverted to the three arguments version of > INIT_WORK) and I managed to compile the driver. Sadly, it does not > work. This is the dmesg output > > _ _ > |__ / _| _ \ / \ / ___| > / / | | | | | |/ _ \ \___ \ > / /| |_| | |_| / ___ \ ___) | > /\__, |/_/ \_\/ > |___/ > zd1211 - version 2.16.0.0 > zd1211 1-4:1.0: usb_probe_interface > zd1211 1-4:1.0: usb_probe_interface - got id > vendor_id = 07b8 > product_id = 6001 > USB 2.0 Host > Release Ver = 4330 > zd1211:bulk out: wMaxPacketSize = 200 > zd1211:bulk in: wMaxPacketSize = 200 > zd1211:interrupt in: wMaxPacketSize = 40 > zd1211:interrupt in: int_interval = 1 > zd1211:interrupt out: wMaxPacketSize = 40 > EEPORM Ver = 4330 > zd1211:uImgLength = 1400 > zd1211:translen = 1000 > zd1211:uCodeOfst = ee00 > zd1211:result = 1000 > zd1211:translen = 400 > zd1211:uCodeOfst = f600 > zd1211:result = 400 > Finsih download Firmware. Ready to reboot > zd1211:FIRMWARE_CONFIRM = 1 > zd1211:USB Download Boot code success > usb 1-4: modprobe timed out on ep0out len=0/0 > usb_set_configuration() failed > zd1211: probe of 1-4:1.0 failed with error -5 > usbcore: registered new driver zd1211 > > > moreover, when I download the driver the device h8ings, and I have to > unplug/replug the cable. > > > I am using gcc 4.1.2. The code compiles clean with 2.6.20-rc2. > > inspecting the code, it seems that all the warning generated by my > version of gcc are related to the (u32) or (u8) explicit castings. Is it > maybe related with the fact that I'm in a 64 bits environment? If you > are interested I can send the gcc output. I don't own any 64b capable hardware. When you reverted the INIT_WORK changes, did you revert the event functions too? The old work queue functions pass their parameters differently. That may caused the error you are seeing. > > Regards, > Giulio. > -- Jon Smirl [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Zd1211-devs mailing list - http://zd1211.ath.cx/ Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs
Re: [zd1211-devs] Experiments with the vendor driver
On Mon, 1 Jan 2007 09:01:38 -0500 "Jon Smirl" <[EMAIL PROTECTED]> wrote: > The INIT work changes went into 2.6.20+, they aren't in 2.6.18. It > shouldn't be too hard to fix up the code to work on both releases. > You just need to remove the INIT work changes and revert to the prior > code. Thanks Jon. I did it (just reverted to the three arguments version of INIT_WORK) and I managed to compile the driver. Sadly, it does not work. This is the dmesg output _ _ |__ / _| _ \ / \ / ___| / / | | | | | |/ _ \ \___ \ / /| |_| | |_| / ___ \ ___) | /\__, |/_/ \_\/ |___/ zd1211 - version 2.16.0.0 zd1211 1-4:1.0: usb_probe_interface zd1211 1-4:1.0: usb_probe_interface - got id vendor_id = 07b8 product_id = 6001 USB 2.0 Host Release Ver = 4330 zd1211:bulk out: wMaxPacketSize = 200 zd1211:bulk in: wMaxPacketSize = 200 zd1211:interrupt in: wMaxPacketSize = 40 zd1211:interrupt in: int_interval = 1 zd1211:interrupt out: wMaxPacketSize = 40 EEPORM Ver = 4330 zd1211:uImgLength = 1400 zd1211:translen = 1000 zd1211:uCodeOfst = ee00 zd1211:result = 1000 zd1211:translen = 400 zd1211:uCodeOfst = f600 zd1211:result = 400 Finsih download Firmware. Ready to reboot zd1211:FIRMWARE_CONFIRM = 1 zd1211:USB Download Boot code success usb 1-4: modprobe timed out on ep0out len=0/0 usb_set_configuration() failed zd1211: probe of 1-4:1.0 failed with error -5 usbcore: registered new driver zd1211 moreover, when I download the driver the device h8ings, and I have to unplug/replug the cable. > I am using gcc 4.1.2. The code compiles clean with 2.6.20-rc2. inspecting the code, it seems that all the warning generated by my version of gcc are related to the (u32) or (u8) explicit castings. Is it maybe related with the fact that I'm in a 64 bits environment? If you are interested I can send the gcc output. Regards, Giulio. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Zd1211-devs mailing list - http://zd1211.ath.cx/ Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs
Re: [zd1211-devs] Experiments with the vendor driver
On 1/1/07, Giulio Bottazzi <[EMAIL PROTECTED]> wrote: > On Sun, 31 Dec 2006 18:56:11 -0500 > "Jon Smirl" <[EMAIL PROTECTED]> wrote: > > > Patch to make the vendor driver, ZD1211LnxDrv_2_16_0_0, build on > > 2.6.20-rc20. It also fixes what looks to be some definite problems > > with uninitialized variables. > > Hi Jon, > I tried to compile with your patch. The situation seems improved (the > original driver did not work) but I still get an error: > > zd1211.c:1846:33: error: macro "INIT_WORK" requires 3 arguments, but only 2 > given > zd1211.c: In function 'zd1211_InitSetup': > zd1211.c:1846: error: 'INIT_WORK' undeclared (first use in this function) > zd1211.c:1846: error: (Each undeclared identifier is reported only once > zd1211.c:1846: error: for each function it appears in.) > zd1211.c:1847:51: error: macro "INIT_WORK" requires 3 arguments, but only 2 > given The INIT work changes went into 2.6.20+, they aren't in 2.6.18. It shouldn't be too hard to fix up the code to work on both releases. You just need to remove the INIT work changes and revert to the prior code. > plus I'm flooded by a number of "cast from pointer to integer of different > size" > warnings. My spec: I am using gcc 4.1.2. The code compiles clean with 2.6.20-rc2. > > kernel 2.6.18 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux > gcc version 4.1.1 (Gentoo 4.1.1-r1) > libc ver 2.4 > > Best, > Giulio. > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Zd1211-devs mailing list - http://zd1211.ath.cx/ > Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs > -- Jon Smirl [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Zd1211-devs mailing list - http://zd1211.ath.cx/ Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs
Re: [zd1211-devs] Experiments with the vendor driver
On Sun, 31 Dec 2006 18:56:11 -0500 "Jon Smirl" <[EMAIL PROTECTED]> wrote: > Patch to make the vendor driver, ZD1211LnxDrv_2_16_0_0, build on > 2.6.20-rc20. It also fixes what looks to be some definite problems > with uninitialized variables. Hi Jon, I tried to compile with your patch. The situation seems improved (the original driver did not work) but I still get an error: zd1211.c:1846:33: error: macro "INIT_WORK" requires 3 arguments, but only 2 given zd1211.c: In function 'zd1211_InitSetup': zd1211.c:1846: error: 'INIT_WORK' undeclared (first use in this function) zd1211.c:1846: error: (Each undeclared identifier is reported only once zd1211.c:1846: error: for each function it appears in.) zd1211.c:1847:51: error: macro "INIT_WORK" requires 3 arguments, but only 2 given plus I'm flooded by a number of "cast from pointer to integer of different size" warnings. My spec: kernel 2.6.18 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux gcc version 4.1.1 (Gentoo 4.1.1-r1) libc ver 2.4 Best, Giulio. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Zd1211-devs mailing list - http://zd1211.ath.cx/ Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs
Re: [zd1211-devs] Experiments with the vendor driver
Patch to make the vendor driver, ZD1211LnxDrv_2_16_0_0, build on 2.6.20-rc20. It also fixes what looks to be some definite problems with uninitialized variables. -- Jon Smirl [EMAIL PROTECTED] diff --git a/Makefile b/Makefile index 2118ac3..624b912 100755 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ rM=rm -f -r # if the kernel is 2.6.x, trun on this KERN_26=y -KERNEL_SOURCE=/usr/src/linux-2.6.9 +KERNEL_SOURCE=/lib/modules/`uname -r`/build # if the kernel is 2.4.x, trun on this #KERN_24=y @@ -254,9 +254,9 @@ install: @echo "'make install' isn't required" else install: all - mkdir -p $(MODPATH)/net - cp $(MODULE) $(MODPATH)/net - depmod -a + sudo mkdir -p $(MODPATH)/kernel/drivers/net/wireless + sudo cp $(MODULE) $(MODPATH)/kernel/drivers/net/wireless + sudo depmod -a endif debug: diff --git a/src/zd1205.c b/src/zd1205.c index b4253c4..8e33730 100755 --- a/src/zd1205.c +++ b/src/zd1205.c @@ -31,7 +31,7 @@ * */ #define __KERNEL_SYSCALLS__ -#include +#include #include #include #include @@ -202,7 +202,6 @@ u8 CalculateQuality(struct zd1205_privat void zd1205_initCAM(struct zd1205_private *macp); int zd1205_CheckOverlapBss(struct zd1205_private *macp, plcp_wla_Header_t *pWlanHdr, u8 *pMacBody, u32 bodyLen); void zd1205_HandleQosRequest(struct zd1205_private *macp); -void zd1205_SetRatesInfo(struct zd1205_private *macp); u8 X_To_dB(u32 X, u8 rate); u16 ZDLog10multiply100(int data); @@ -446,7 +445,7 @@ struct iw_handler_def p80211wext_handler private: (iw_handler *) zd1205_private_handler, private_args: (struct iw_priv_args *) zd1205_private_args, #if WIRELESS_EXT > 18 -get_wireless_stats: (struct iw_statistics * )zd1205_iw_getstats +get_wireless_stats: zd1205_iw_getstats #endif }; #endif @@ -476,10 +475,10 @@ static void wait_ms(unsigned int ms) mdelay(ms); } -asmlinkage _syscall3(int,write,int,fd,const char *,buf,off_t,count) -asmlinkage _syscall3(int,read,int,fd,char *,buf,off_t,count) -asmlinkage _syscall3(int,open,const char *,file,int,flag,int,mode) -asmlinkage _syscall1(int,close,int,fd) +//asmlinkage _syscall3(int,write,int,fd,const char *,buf,off_t,count) +//asmlinkage _syscall3(int,read,int,fd,char *,buf,off_t,count) +//asmlinkage _syscall3(int,open,const char *,file,int,flag,int,mode) +//asmlinkage _syscall1(int,close,int,fd) #endif const U16 dot11A_Channel[]={36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,184,188,192,196,8,12,16,34,38,42,46,149,153,157,161,165}; const U16 dot11A_Channel_Amount=sizeof(dot11A_Channel)/sizeof(U16); @@ -5002,6 +5001,9 @@ zd1205_xmit_frame(struct sk_buff *skb, s int rc = 0; int notify_stop = false; struct zd1205_private *macp = dev->priv; +#if 03_FIX == 1 +struct sk_buff *new_skb = NULL; +#endif u16 TypeLen; u8 *pHdr = skb->data; @@ -5022,7 +5024,6 @@ zd1205_xmit_frame(struct sk_buff *skb, s BOOLEAN bHashSearchResult; ZENTER(2); #if 03_FIX == 1 -struct skb_buff *new_skb = NULL; new_skb = skb_copy(skb, GFP_ATOMIC); while(!new_skb) printk("new skb is NULL\n"); dev_kfree_skb_irq(skb); @@ -8269,8 +8270,14 @@ #ifdef ZDCONF_MENUDBG } zd1205_lock(macp); zd1205_zd_dbg2_ioctl(macp, &zdreq,&ret); -copy_from_user(&in,((struct zdap_ioctl *)(ifr->ifr_data))->data,4); -copy_to_user(((struct zdap_ioctl *)(ifr->ifr_data))->data, &ret, sizeof(ret)); +if (copy_from_user(&in,((struct zdap_ioctl *)(ifr->ifr_data))->data,4)){ + zd1205_unlock(macp); +return -EFAULT; +} +if(copy_to_user(((struct zdap_ioctl *)(ifr->ifr_data))->data, &ret, sizeof(ret))){ + zd1205_unlock(macp); +return -EFAULT; +} zd1205_unlock(macp); err = 0; } @@ -8684,7 +8691,8 @@ #endif void zd1205_load_card_setting(struct zd1205_private *macp, u8 bInit) { - int ifp; + //int ifp; + struct file *filp = NULL; int bcount = 0; mm_segment_t fs; unsigned int file_length; @@ -8705,12 +8713,17 @@ void zd1205_load_card_setting(struct zd1 set_fs(KERNEL_DS); // open the file with the firmware for uploading - if (ifp = open(config_filename, O_RDONLY, 0 ), ifp < 0){ + //if (ifp = open(config_filename, O_RDONLY, 0 ), ifp < 0){ + filp = filp_open(config_filename, O_RDONLY, 0); +printk("Filp is %p, %s\n", filp, config_filename); + if (IS_ERR_VALUE(PTR_ERR(filp))){ // error opening the file - ZD1211DEBUG(0, "File opening did not success\n"); + ZD1211DEBUG(0, "File opening did not success %lu\n", PTR_ERR(filp)); set_fs(fs); return; } +printk("Filp->f_op is %p\n", filp->f_op); + get_file(filp); /* Get information about the file. */ //fstat (ifp, &file_info); @@ -8722,11 +8735,13 @@ void zd1205_load_card_setting(struct zd1 old_buffer = buffer; /* Read the file into the buffer. */ - bcount = rea