Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2007 18:44:12 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        "no@spam@mgedv.net" <nospam@mgedv.net>
Cc:        freebsd-questions@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: huawei e220 hsdpa on freebsd 6.3-BETA2
Message-ID:  <200712071844.13529.hselasky@c2i.net>
In-Reply-To: <001101c838b4$b7153bf0$14b1a8c0@bstandard.lan>
References:  <006701c8380d$e12ecc50$14b1a8c0@bstandard.lan> <200712062018.50262.hselasky@c2i.net> <001101c838b4$b7153bf0$14b1a8c0@bstandard.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 07 December 2007, no@spam@mgedv.net wrote:
> > Your HSDPA modem presented itself like a mass storage device, probably
> > with
> > some autorun and virus like drivers intended for the Windows operating
> > system :-)
>
> unfortunately, this is the "intended" behaviour. this device has the
> ability to present itself as "mass storage" which will show up as a
> cd-rom device where the windows drivers are stored on.
>
> this is the way it works under windows:
> - plug it in first time
> - (auto)run the setup on the device for the win-driver
> - as soon as the driver is loaded, the cd device disappears and a modem is
> detected
>
> but when loading the ucom/ubsa stuff before umass, the device will
> not be recognised as /dev/cdX and show up as a communication device
> (ucom).
>
> of course there must be a way for getting the serial device working,
> because this is one of the most sold umts/hsdpa modems across eu and
> many people run it under linux as well (there are no drivers from
> the vendor provided except windows and mac).
> i'm pretty sure there is some "message" or anything else which will
> render this device switching to serial mode.
> there is some code, which i found (doesn't compile/run under freebsd)
> which "puts" this device in pure serial mode. maybe someone out there
> is able to tell me, how/if this can be done on freebsd as well?
> (btw, i'm not a c-guru)
>
> do you (or anybody else reading this) have an idea, how to get this
> device working and put it in serial mode "completely" ?
>

Hi,

You can try the following test program and see what happens. You need to run 
it like super-user:

#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <dev/usb/usb.h>

int main(int argc, char **argv)
{
  struct usb_ctl_request ucr = { /* zero */ };
  int f;

  if (argc < 3) {
      printf("Usage: %s /dev/usb1 <addr>\n", argv[0]);
      return 1;
  }

  f = open(argv[1], O_RDWR);
  if (f < 0) {
      return 1;
  }

  ucr.ucr_addr = atoi(argv[2]);
  ucr.ucr_request.bmRequestType = 0;
  ucr.ucr_request.bRequest = 3; /* SET_FEATURE */
  ucr.ucr_request.wValue[0] = 1;

  if (ioctl(f, USB_REQUEST, &ucr)) {
      printf("Error!\n");
  }

  close (f);

  return 0;
}

Use "usbdevs -v" to get the parameters. Don't forget to load "umodem".

If my program doesn't work, I suggest that you contact the manufacturer of 
your modem, and tell them the truth, that the device is a mass-storage device 
and that you want the money back! You paid for a modem, but got a 
mass-storage device. You can tell them that FreeBSD USB experts have looked 
at your device. There is no doubt about it that you've been fooled :-)

--HPS

HINT: HINT: Buy a HDSPA modem that comes with a CD-ROM. Then there is a 
greater chance that they did not put the drivers on the device itself.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712071844.13529.hselasky>