Project

General

Profile

Actions

Bug #1324

closed

[PATCH] ugensa.c: better handling of Huawei Modems

Added by bmk about 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Device code for E169 was there (as Huawei Mobile Connect), but it was
showing up as a single mass storage device, so I added it to the E220
re-attach code.

My Patch has no effect. Can anyone tell my why?

Patch follows:
--- ugensa.c.orig 2009-03-28 10:12:26.000000000 1100
++ ugensa.c 2009-03-28 10:24:34.000000000 +1100
@ -131,7 +131,7 @ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881E */ { USB_DEVICE(0x1199, 0x6855) }, /* Sierra Wireless AirCard 880U */ { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881U /
- { USB_DEVICE(0x12d1, 0x1001) }, /
Huawei Mobile Connect /
+ { USB_DEVICE(0x12d1, 0x1001) }, /
Huawei Mobile Connect/E169 */ { USB_DEVICE(0x12d1, 0x1003) }, /* Huawei Mobile E220 */ { USB_DEVICE(0x12d1, 0x1004) }, /* Huawei Mobile E220 */ { USB_DEVICE(0x1410, 0x1100) }, /* Novatel Wireless Merlin
XS620/S640 */
@ -186,7 +186,8 @
*/
id = usbd_get_interface_descriptor(uaa->iface);
if (id NULL || id->bInterfaceClass UICLASS_MASS) {
- if ((uaa->vendor 0x12d1 && uaa->product 0x1003) ||
+ if ((uaa->vendor 0x12d1 && uaa->product 0x1001) ||
+ (uaa->vendor 0x12d1 && uaa->product 0x1003) ||
(uaa->vendor 0x12d1 && uaa->product 0x1004)) {
if (uaa->nifaces == 1)
return UMATCH_VENDOR_IFACESUBCLASS;
@ -219,7 +220,8 @

id = usbd_get_interface_descriptor(ucom->sc_iface);
if (id NULL || id->bInterfaceClass UICLASS_MASS) {
- if ((uaa->vendor 0x12d1 && uaa->product 0x1003) ||
+ if ((uaa->vendor 0x12d1 && uaa->product 0x1001) ||
+ (uaa->vendor 0x12d1 && uaa->product 0x1003) ||
(uaa->vendor 0x12d1 && uaa->product 0x1004)) {
ugensa_e220_changemode(uaa->device);
}

Files

huawei.patch (2.84 KB) huawei.patch alexh, 05/06/2009 07:06 AM
Actions #1

Updated by swildner about 15 years ago

Does anything show in dmesg when running with your patch?

Actions #2

Updated by bmk about 15 years ago

dmesg shows these extra lines when device plugged in:

umass0:
<\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?\M^?
HUAWEI Mobile, class 0/0, rev 1.10/0.00, addr 2> on uhub1
cd1 at umass-sim0 bus 0 target 0 lun 0
cd1: <HUAWEI Mass Storage 2.31> Removable CD-ROM SCSI-2 device
cd1: 1.000MB/s transfers
cd1: Attempt to query device size failed: NOT READY, Medium not present

NOTE_1: dmesg is the same with or without my patch.
NOTE_2: I think the "Medium not present" is the empty MicroSD slot

Actions #3

Updated by bmk about 15 years ago

Also, if anyone wants SSH root access to my box with E169 attached,
please let me know on this bug thread.

Actions #4

Updated by alexh almost 15 years ago

I've been looking a bit into the issue and made a few changes; the diff is
attached. Can you try and see if it helps?

PS: There might be a typo somewhere that doesn't allow to compile; haven't tried
it myself, but if so it should be trivial to fix.

Actions #5

Updated by bmk almost 15 years ago

Thanks Alex!!! Your patch works perfectly.

I am now surfing the net with E169 using pppd via /dev/ucom0.

Please submit/commit this.

Actions #6

Updated by alexh almost 15 years ago

Thanks for testing it.

I will clean it up a bit and then post it in my git repo. Don't commit it just
yet.

Actions #7

Updated by alexh almost 15 years ago

Ok, I've rewritten my fix to be a bit cleaner.
Here it is:
http://gitweb.dragonflybsd.org/~alexh/dragonfly.git/commit/e39cf0de1bdc15127d00a
87fc6daa6b7dd8d3725

bmk, if you can give it a try, I'd be thankful; although it pretty much is the
same, just done differently.

Actions #8

Updated by bmk almost 15 years ago

Hi Alex, version 2 of you patch is not building:

===> dev/usbmisc/ugensa
cc -O -pipe -D_KERNEL -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual -Werror-implicit-function-declaration -std=c99
-DKLD_MODULE -nostdinc -I. -I@ -I/usr/src/sys/compile/GENERIC_p2
-I/usr/src/sys/compile/GENERIC_p2/include -I/usr/include -include
/usr/src/sys/compile/GENERIC_p2/opt_global.h -g -finline-limit=8000
--param inline-unit-growth=100 --param large-function-growth=1000
-fno-common -ffreestanding -mpreferred-stack-boundary=2
-fno-stack-protector -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual
-Werror-implicit-function-declaration -std=c99 -c
/usr/src/sys/dev/usbmisc/ugensa/ugensa.c
/usr/src/sys/dev/usbmisc/ugensa/ugensa.c: In function 'ugensa_match':
/usr/src/sys/dev/usbmisc/ugensa/ugensa.c:186: error: expected ')' before
'{' token
/usr/src/sys/dev/usbmisc/ugensa/ugensa.c:202: error: expected expression
before '}' token
/usr/src/sys/dev/usbmisc/ugensa/ugensa.c:172: warning: unused variable 'id'
  • Error code 1
Stop in /usr/src/sys/dev/usbmisc/ugensa.
  • Error code 1
Stop in /usr/src/sys/dev/usbmisc.
  • Error code 1
Stop in /usr/src/sys/dev.
  • Error code 1
Stop in /usr/src/sys.
  • Error code 1

Stop in /usr/src/sys/compile/GENERIC_p2. #

Actions #9

Updated by alexh almost 15 years ago

ah, I see, small typo. Can you please try compiling with the following change
while I update my git repo?
change: if ((uaa->vendor == 0x12d1) {
to: if (uaa->vendor == 0x12d1) {

Thank you very much for testing it!

Actions #10

Updated by bmk almost 15 years ago

Woops, not sure why but I lost the subject on my bug thread. Just
putting the subject back...

Actions #11

Updated by bmk almost 15 years ago

Hi Alex,

I fixed the typo & it builds & works fine now.

Thanks...

Actions #12

Updated by alexh almost 15 years ago

Thanks for testing, I'll be fixing the typo in my repository in a while so it can
get commited.

Actions #13

Updated by alexh almost 15 years ago

Ok, I've fixed the typo in the repository, it can be found here:
http://gitweb.dragonflybsd.org/~alexh/dragonfly.git/commit/a1dd727dadf2e15512ff1
2f0b4ad23d1b365d37c

As Brendan has already tested this successfully, I think it is ready.

Actions #14

Updated by swildner almost 15 years ago

Committed -> 7ffe1f6754372419182d1b1ab761af18a6d28090

Actions

Also available in: Atom PDF