| View previous topic :: View next topic |
| Author |
Message |
evdo-wizard EVDO Heavy User
Joined: 21 Apr 2007 Posts: 125
|
Posted: Wed May 09, 2007 9:27 pm Post subject: Fix for Upload Issue (Linksys WRT54G3G-ST) |
|
|
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 |
|
 |
josw EVDO User
Joined: 06 Feb 2007 Posts: 68
|
Posted: Wed May 09, 2007 9:44 pm Post subject: |
|
|
| That would be great ! Thanks |
|
| Back to top |
|
 |
glacierjima EVDO Heavy User
Joined: 25 Jan 2007 Posts: 113 Location: North. Kentucky
|
Posted: Wed May 09, 2007 9:46 pm Post subject: |
|
|
| 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 |
|
 |
evdo-wizard EVDO Heavy User
Joined: 21 Apr 2007 Posts: 125
|
Posted: Thu May 10, 2007 2:04 pm Post subject: |
|
|
| 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 |
|
 |
Llama EVDO Junkie
Joined: 02 Feb 2007 Posts: 182
|
Posted: Thu May 10, 2007 4:51 pm Post subject: |
|
|
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.  _________________ --Larry |
|
| Back to top |
|
 |
Michael Site Admin
Joined: 13 Jan 2005 Posts: 5045 Location: Cary, IL
|
Posted: Thu May 10, 2007 4:59 pm Post subject: |
|
|
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 |
|
 |
evdo-wizard EVDO Heavy User
Joined: 21 Apr 2007 Posts: 125
|
Posted: Fri May 11, 2007 3:07 pm Post subject: |
|
|
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 |
|
 |
Fox McCloud EVDO Junkie
Joined: 02 Dec 2006 Posts: 599
|
Posted: Fri May 11, 2007 8:13 pm Post subject: |
|
|
| 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 |
|
 |
Easystreet EVDO User
Joined: 08 Dec 2006 Posts: 37
|
Posted: Sat May 12, 2007 2:18 pm Post subject: |
|
|
| If you can fix the upload issue, that would be FANTASTIC! |
|
| Back to top |
|
 |
jackrodgers EVDO Addict
Joined: 23 Mar 2006 Posts: 1131
|
Posted: Sat May 12, 2007 6:06 pm Post subject: |
|
|
| 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 |
|
 |
Fl00d_Pr0z EVDO Junkie
Joined: 08 Dec 2006 Posts: 218
|
Posted: Sat May 12, 2007 6:59 pm Post subject: |
|
|
| The "pros" don't admit there is a problem... That's the problem, LoL |
|
| Back to top |
|
 |
jackrodgers EVDO Addict
Joined: 23 Mar 2006 Posts: 1131
|
Posted: Sat May 12, 2007 8:42 pm Post subject: |
|
|
| 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.  |
|
| Back to top |
|
 |
petervann EVDO Newbie
Joined: 21 Apr 2007 Posts: 2
|
Posted: Sun May 13, 2007 4:19 pm Post subject: Where do we modify the code |
|
|
| Can you tell us where the modification goes in the code? |
|
| Back to top |
|
 |
evdo-wizard EVDO Heavy User
Joined: 21 Apr 2007 Posts: 125
|
Posted: Sun May 13, 2007 6:44 pm Post subject: Re: Where do we modify the code |
|
|
| 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 |
|
 |
Fox McCloud EVDO Junkie
Joined: 02 Dec 2006 Posts: 599
|
Posted: Mon May 14, 2007 12:41 am Post subject: |
|
|
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 |
|
 |
|
|
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
|