Discuss EVDO PC Cards, ExpressCards, EVDO USB, PDAs, Phones, Coverage and Mobile Broadband Cards. Discuss Verizon and Sprint Coverage. CradlePoint CTR350 / PHS300/ MBR1000 & Kyocera KR1 / KR2 & LinkSys WRT54G3G-ST Forums!
EVDOforums.com
Discussion forum for EVDO users
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Our sites Include: EVDO Info :: EVDO Forums :: EVDO Maps :: EVDO Blog :: 3Gstore.com

To purchase your EVDO Card / Antenna / Amplifier / Router from the EVDO Experts, just contact us!

Fix for Upload Issue (Linksys WRT54G3G-ST)

Goto page 1, 2, 3  Next  
Post new topic   Reply to topic    EVDOforums.com Forum Index -> LinkSys 3G Router WRT54G3G-ST Support Forum
View previous topic :: View next topic  
Author Message
evdo-wizard
EVDO Heavy User


Joined: 21 Apr 2007
Posts: 125

PostPosted: Wed May 09, 2007 9:27 pm    Post subject: Fix for Upload Issue (Linksys WRT54G3G-ST) Reply with quote

Download fixed 2.0.0.9 firmware:
Temporarily removed, will be back up after several select people have tested it.
There shouldn't be any risk in upgrading to this firmware, though if you are skeptical you can wait until others test it.

I've already updated my router with this firmware, but I'm not sure whether it fixes the upload issue or not. With the card in my laptop, I got speeds of 319 down / 37 up. With the card in the router with this firmware, I got 507 down / 54 up. My signal strength right now simply isn't strong enough to know whether this patched firmware works. This firmware may also help with disconnection issues; more fixes for that later.




FOR DEVELOPERS:
Listed below are all of the changes that I made to the source code to compile the firmware above, in patch format. Feel free to review them for errors, etc.


/release/src/linux/linux/drivers/usb/usbserial.c
Code:
--- /drivers/usb/usbserial.c.bak     2006-05-12 02:09:50.000000000 +0000
+++ /drivers/usb/usbserial.c    2007-05-13 18:30:32.000000000 +0000
@@ -332,7 +332,7 @@
 static __u16   vendor  = 0x05f9;
 static __u16   product = 0xffff;

-static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
+static struct usb_device_id generic_device_ids[10]; /* Initially all zeroes. */

 /* All of the device info needed for the Generic Serial Converter */
 static struct usb_serial_device_type generic_device = {
@@ -1254,11 +1254,9 @@
                        err("No free urbs available");
                        goto probe_error;
                }
-//Amin marked          buffer_size = endpoint->wMaxPacketSize;
-// ===> 20060310 Amin modify for improve EVDO and HSDPA Card
-               buffer_size = 2048;
-               printk("KERNEL DEBUG => USBSERIAL.O buffer_size = 2048");
-// <=== 20060310 Amin modify for improve EVDO and HSDPA Card
+       /* Fix for EVDO/HSDPA/3G download speeds */
+//             buffer_size = endpoint->wMaxPacketSize;
+               buffer_size = 4096;
                port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
                port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
                if (!port->bulk_in_buffer) {
@@ -1283,7 +1281,9 @@
                        err("No free urbs available");
                        goto probe_error;
                }
-               buffer_size = endpoint->wMaxPacketSize;
+       /* Fix for EVDO/HSDPA/3G upload speeds */
+//             buffer_size = endpoint->wMaxPacketSize;
+               buffer_size = 1024;
                port->bulk_out_size = buffer_size;
                port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
                port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);
@@ -1527,6 +1527,42 @@
        generic_device_ids[0].idVendor = vendor;
        generic_device_ids[0].idProduct = product;
        generic_device_ids[0].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Sierra Wireless AirCard 875 */
+       generic_device_ids[1].idVendor = 0x1199;
+       generic_device_ids[1].idProduct = 0x6820;
+       generic_device_ids[1].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Audiovox PC5740 */
+       generic_device_ids[2].idVendor = 0x106c;
+       generic_device_ids[2].idProduct = 0x3701;
+       generic_device_ids[2].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Pantech PX-500 and PC5750 */
+       generic_device_ids[3].idVendor = 0x106c;
+       generic_device_ids[3].idProduct = 0x3702;
+       generic_device_ids[3].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Sierra Wireless Aircard 595 */
+       generic_device_ids[4].idVendor = 0x1199;
+       generic_device_ids[4].idProduct = 0x0019;
+       generic_device_ids[4].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Novatel Wireless S720 */
+       generic_device_ids[5].idVendor = 0x1410;
+       generic_device_ids[5].idProduct = 0x1130;
+       generic_device_ids[5].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Sierra Wireless Aircard 580 */
+       generic_device_ids[6].idVendor = 0x1199;
+       generic_device_ids[6].idProduct = 0x0112;
+       generic_device_ids[6].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Kyocera Wireless KPC650 */
+       generic_device_ids[7].idVendor = 0x0c88;
+       generic_device_ids[7].idProduct = 0x17da;
+       generic_device_ids[7].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* Novatel Wireless V620 */
+       generic_device_ids[8].idVendor = 0x1410;
+       generic_device_ids[8].idProduct = 0x1110;
+       generic_device_ids[8].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
+       /* AirPrime 5220 */
+       generic_device_ids[9].idVendor = 0xf3d0;
+       generic_device_ids[9].idProduct = 0x0112;
+       generic_device_ids[9].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
        /* register our generic driver with ourselves */
        usb_serial_register (&generic_device);
 #endif


Last edited by evdo-wizard on Thu May 17, 2007 8:21 pm; edited 7 times in total
Back to top
View user's profile Send private message
josw
EVDO User


Joined: 06 Feb 2007
Posts: 68

PostPosted: Wed May 09, 2007 9:44 pm    Post subject: Reply with quote

That would be great ! Thanks
Back to top
View user's profile Send private message
glacierjima
EVDO Heavy User


Joined: 25 Jan 2007
Posts: 113
Location: North. Kentucky

PostPosted: Wed May 09, 2007 9:46 pm    Post subject: Reply with quote

That is all you did was download, apply a patch? Can you tell if that patch is just missing from the current firmware version?
Back to top
View user's profile Send private message
evdo-wizard
EVDO Heavy User


Joined: 21 Apr 2007
Posts: 125

PostPosted: Thu May 10, 2007 2:04 pm    Post subject: Reply with quote

Quote:
That is all you did was download, apply a patch? Can you tell if that patch is just missing from the current firmware version?


No.. I made the patch myself, and it is applied by re-compiling the firmware. The source code for the WRT54G3G-ST is available at Linksys.com here (2.00.9 with toolchain). The linksys firmware uses the Linux 2.4 kernel. I think that the cause for the upload issue in this router is in usb-serial (part of the linux kernel) which was originally meant for slow speed devices. Linksys did apply a patch for the download buffer, but what I'm thinking is that they never patched the upload buffer.

I wrote this patch for OpenWrt, but theoretically it should also work for the standard Linksys firmware, since it uses the same Linux 2.4 kernel. This is the patch that I wrote:

Code:
--- linux.old/drivers/usb/serial/usbserial.c    2006-08-19 18:48:07.000000000 +0200
+++ linux.dev/drivers/usb/serial/usbserial.c    2006-08-19 18:46:02.000000000 +0200
@@ -1359,7 +1359,7 @@
     wake_up_interruptible(&tty->write_wait);
 }
 
-
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
 static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,
                    const struct usb_device_id *id)
 {
@@ -1512,7 +1512,8 @@
             err("No free urbs available");
             goto probe_error;
         }
-        buffer_size = endpoint->wMaxPacketSize;
+        /* Minimum "download" buffer size for EVDO and HSDPA cards */
+        buffer_size = MIN(4096,endpoint->wMaxPacketSize);
         port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
         port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
         if (!port->bulk_in_buffer) {
@@ -1537,7 +1537,8 @@
             err("No free urbs available");
             goto probe_error;
         }
-        buffer_size = endpoint->wMaxPacketSize;
+        /* Minimum "upload" buffer size for EVDO and HSDPA cards */
+        buffer_size = MIN(4096,endpoint->wMaxPacketSize);
         port->bulk_out_size = buffer_size;
         port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
         port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);


Some minor modification to this patch will be necessary, but it should work with the standard Linksys firmware.

When I get the time I will compile the patched firmware and post it up for download.
Back to top
View user's profile Send private message
Llama
EVDO Junkie


Joined: 02 Feb 2007
Posts: 182

PostPosted: Thu May 10, 2007 4:51 pm    Post subject: Reply with quote

Cool, I was going to take a look at their source tarball, but just kept blowing it off. Now to see if I've got the guts to flash this over to my router. Very Happy
_________________
--Larry
Back to top
View user's profile Send private message
Michael
Site Admin


Joined: 13 Jan 2005
Posts: 5045
Location: Cary, IL

PostPosted: Thu May 10, 2007 4:59 pm    Post subject: Reply with quote

We have a bunch we use for testing and support. We can try and if it gets hosed, get it replaced and let this thread know the outcome.

Let us test anything first, a hosed router won't kill us.
_________________
EVDO :: EVDO News :: EVDO Antennas :: Buy Verizon :: Buy Sprint :: EVDO Amplifier
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
evdo-wizard
EVDO Heavy User


Joined: 21 Apr 2007
Posts: 125

PostPosted: Fri May 11, 2007 3:07 pm    Post subject: Reply with quote

Well, as I suspected, Linksys just forgot to patch the upload buffer in usb-serial.c. This is from the linksys source:
Code:
      endpoint = bulk_in_endpoint[i];
      port = &serial->port[i];
      port->read_urb = usb_alloc_urb (0);
      if (!port->read_urb) {
         err("No free urbs available");
         goto probe_error;
      }
//Amin marked      buffer_size = endpoint->wMaxPacketSize;
// ===> 20060310 Amin modify for improve EVDO and HSDPA Card
      buffer_size = 2048;
      printk("KERNEL DEBUG => USBSERIAL.O buffer_size = 2048");
// <=== 20060310 Amin modify for improve EVDO and HSDPA Card


As we all know, this sucessfully fixes the download speeds with our cards, but notice the bulk_in_endpoint at the top of the code. This only patches the IN endpoint, not the OUT endpoint. Here is the unmodified OUT buffer found in the Linksys source:
Code:
      endpoint = bulk_out_endpoint[i];
      port = &serial->port[i];
      port->write_urb = usb_alloc_urb(0);
      if (!port->write_urb) {
         err("No free urbs available");
         goto probe_error;
      }
      buffer_size = endpoint->wMaxPacketSize;
      port->bulk_out_size = buffer_size;
      port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
      port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);
      if (!port->bulk_out_buffer) {
         err("Couldn't allocate bulk_out_buffer");
         goto probe_error;
      }


I have already made a patch for this, and I also patched another file (acm.c) for speeds. I've compiled the firmware already and updated my router, I just haven't had the time to test the speeds yet. I will probably have the firmware hosted sometime this weekend.
Back to top
View user's profile Send private message
Fox McCloud
EVDO Junkie


Joined: 02 Dec 2006
Posts: 599

PostPosted: Fri May 11, 2007 8:13 pm    Post subject: Reply with quote

ok, thanks for looking at this! Once you get the results, be sure to post them here, also, if this does work, I can't wait to download the patched firmware; finally I'll be getting all my money's worth for the connection.
Back to top
View user's profile Send private message
Easystreet
EVDO User


Joined: 08 Dec 2006
Posts: 37

PostPosted: Sat May 12, 2007 2:18 pm    Post subject: Reply with quote

If you can fix the upload issue, that would be FANTASTIC!
Back to top
View user's profile Send private message
jackrodgers
EVDO Addict


Joined: 23 Mar 2006
Posts: 1131

PostPosted: Sat May 12, 2007 6:06 pm    Post subject: Reply with quote

Have you dropped a note to the proper folks to inform them of what you found? Sometimes the pros get to entangled in the problem to see everything clearly, human nature.
Back to top
View user's profile Send private message
Fl00d_Pr0z
EVDO Junkie


Joined: 08 Dec 2006
Posts: 218

PostPosted: Sat May 12, 2007 6:59 pm    Post subject: Reply with quote

The "pros" don't admit there is a problem... That's the problem, LoL
Back to top
View user's profile Send private message
jackrodgers
EVDO Addict


Joined: 23 Mar 2006
Posts: 1131

PostPosted: Sat May 12, 2007 8:42 pm    Post subject: Reply with quote

Fl00d_Pr0z wrote:
The "pros" don't admit there is a problem... That's the problem, LoL


Haven't I read here that they are asking for certain info and trying to find the answer. Simply not finding the answer sufficiently fast to keep everyone happy is not an indication of not admiting there is a problem.

Of course, if you have an email from them stating "There is no problem." then I stand corrected. Laughing
Back to top
View user's profile Send private message
petervann
EVDO Newbie


Joined: 21 Apr 2007
Posts: 2

PostPosted: Sun May 13, 2007 4:19 pm    Post subject: Where do we modify the code Reply with quote

Can you tell us where the modification goes in the code?
Back to top
View user's profile Send private message
evdo-wizard
EVDO Heavy User


Joined: 21 Apr 2007
Posts: 125

PostPosted: Sun May 13, 2007 6:44 pm    Post subject: Re: Where do we modify the code Reply with quote

petervann wrote:
Can you tell us where the modification goes in the code?


All of the modifications to the source code are now listed in the first post... and the firmware also is up for download.
Back to top
View user's profile Send private message
Fox McCloud
EVDO Junkie


Joined: 02 Dec 2006
Posts: 599

PostPosted: Mon May 14, 2007 12:41 am    Post subject: Reply with quote

Thanks for posting, EVDO-Wizard; once I can get the better upload speeds, browsing will probably be slightly more snappy.

it also means better quality calls with VoIP applications, too.

Either way, be sure to let us know when you get it hosted; I'd be willing to risk it, since I think my routers needs replaced anyway (it'll drop the connection once in a while for no reason).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EVDOforums.com Forum Index -> LinkSys 3G Router WRT54G3G-ST Support Forum All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum








Sprint Rev A USB: Compass 597



Sprint Rev A ExpressCard: Merlin EX720


Purchase an V740 Rev A ExpressCard


Sprint U727


CTR350 Router


CradlePoint PHS300


Purchase a MBR1000


Purchase an EVDO Booster Antenna

Purchase a LinkSys 3G Router



Purchase an EVDO Amplifier


Your Mac EVDO Experts









EVDO Antenna Booster





Digg Us :: del.icio.us :: technorati :: furl

4G :: 4G Forums :: PHS300 :: MBR1000 :: KR2