# 3g speed



## kamikaze (Nov 17, 2008)

Without this little dirty hack my USB 3g modem is unbearably slow:
	
	



```
--- src/sys/dev/usb/ubsa.c.orig	2008-05-02 14:10:18.000000000 +0200
+++ src/sys/dev/usb/ubsa.c	2008-05-02 14:19:21.000000000 +0200
@@ -362,15 +362,15 @@
 		if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
 		    UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT) {
 			sc->sc_intr_number = ed->bEndpointAddress;
-			sc->sc_isize = UGETW(ed->wMaxPacketSize);
+			sc->sc_isize = UGETW(ed->wMaxPacketSize) << 2;
 		} else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
 		    UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
 			ucom->sc_bulkin_no = ed->bEndpointAddress;
-			ucom->sc_ibufsize = UGETW(ed->wMaxPacketSize);
+			ucom->sc_ibufsize = UGETW(ed->wMaxPacketSize) << 2;
 		} else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT &&
 		    UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
 			ucom->sc_bulkout_no = ed->bEndpointAddress;
-			ucom->sc_obufsize = UGETW(ed->wMaxPacketSize);
+			ucom->sc_obufsize = UGETW(ed->wMaxPacketSize) << 2;
 		}
 	}
```

I think it increases the size of a buffer. Obviously it would be better to find out where ed->wMaxPacketSize comes from and address the problem there, but I never bothered to.


----------



## ndenev (Nov 17, 2008)

Have you tried the new u3g driver ? 

http://people.freebsd.org/~n_hibma/u3g.html


----------



## kamikaze (Nov 17, 2008)

Thank you for that one, it's as fast as ubsa with the hack. It also allows me to use the card reader in the modem at the same time.


----------



## kamikaze (Nov 25, 2008)

I did some whining on stable@ and current@ and u3g is going into RELENG_6 and RELENG_7, yay!


----------



## DemoDoG (Jan 12, 2009)

ndenev said:
			
		

> Have you tried the new u3g driver ?
> 
> http://people.freebsd.org/~n_hibma/u3g.html



I donÂ´t understand the instructions, what device name should I write in u3g.c and where is that file located? 
I have googled alot for some other manual for u3g driver but canÂ´t find any. Has anyone here got a little explanation?

I have got my modem to work using the module provided in http://www.shapeshifter.se/2008/10/23/hso-20081023/
but it would be fun to test the u3g driver since IÂ´m running current. My modem is a Globetrotter.


----------



## kamikaze (Jan 12, 2009)

If you're running current you just have to load the module.


----------



## DemoDoG (Jan 12, 2009)

Pardon me for besing stupid but which model and where is it? Or is it something I have to compile first?


----------



## kamikaze (Jan 12, 2009)

`# kldload u3g` should do it. Unplug your UMTS 3G device and plug it back in.


----------



## DemoDoG (Jan 12, 2009)

Okay I will try it.


----------



## Martyn (Feb 4, 2009)

Hello!
Please help.

I'm running PC-BSD 7.0.2 (FreeBSD 7.1 PRERELEASE)

I want to connect my USB 3G HSDPA Modem (HUAWEI 219) to PC (VAIO).
I installed hso driver, but can't switch device to modem.
Tride typing in the terminal:


> #camcontrol cmd cd1 -c "01 00 00 00 00 00" -i 1 i1


But it answers:


> #camcontrol: error sending command



What should I do?


----------



## kamikaze (Feb 5, 2009)

a) This doesn't belong into this thread. It's about performance.

b) I've got no idea what hso is, this thread discusses the ubsa and u3g drivers.

c) You cannot turn off USB functionality on the SCSI layer.


----------

