Re: ZTE MF636 USB u3g modem

2009-05-05 Thread Mike Tancsa

At 01:41 PM 5/5/2009, Mike Tancsa wrote:
Has anyone had any luck getting this modem to work under FreeBSD ? I 
have been trying to modify the driver to get it to recognize and 
send the unit into modem mode, but no luck. I even tried setting the 
unit into permanent modem mode first from Windows as referenced in

http://www.matt-barrett.com/?p=5
but no luck yet

usbdevs shows it as
port 2 addr 2: high speed, power 500 mA, config 1, ZTE CDMA 
Technologies MSM(0x2000), ZTE, Incorporated(0x19d2), rev 0.00



u3g0: sending CD eject command to change to modem mode
u3g0: sent command to change to modem mode
u3g0: read back CSW



OK, some progress! It now comes up as

u3g0: 2.00/0.00, addr 2> on uhub1

u3g0: changing CMOTECH modem to modem mode
u3g0: sent command to change to modem mode
u3g0: failed to read back CSW: 13
u3g0: at uhub1 port 2 (addr 2) disconnected
u3g0: detached
ucom0: 2.00/0.00, addr 2> on uhub1

ucom0: port=0 iface=3 in=0x85 out=0x4
ucom0: configured 1 serial ports (U0.%d)
ucom1: 2.00/0.00, addr 2> on uhub1

ucom1: configured 0 serial ports (U1.%d)
ucom2: 2.00/0.00, addr 2> on uhub1

ucom2: configured 0 serial ports (U2.%d)


Looking through the modemswitch code, I grabbed out the string that 
it sends the modem.  Googling around, I found 2 different versions. 
Both seem to work, however, the secondary ports do not with either 
string. Not sure what it exactly does however.


--- /home/mdtancsa/u3g.c2009-05-05 16:48:46.0 -0400
+++ u3g.c   2009-05-05 17:12:29.0 -0400
@@ -126,6 +126,8 @@
 #define U3GFL_STUB_WAIT0x80// Device 
reappears after a short delay

 };

+#define U3GINIT_NONE0
+#define U3GINIT_EJECT   2
 // Note: The entries marked with XXX should be checked for the correct speed
 // indication to set the buffer sizes.
 static const struct u3g_dev_type_s u3g_devs[] = {
@@ -137,8 +139,10 @@
{{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA 
},  U3GSP_HSDPA,U3GFL_NONE },
{{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G 
},U3GSP_UMTS, U3GFL_NONE },

/* OEM: Qualcomm, Inc. */
-   {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR 
},  U3GSP_CDMA, U3GFL_SCSI_EJECT },
-   {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM 
},  U3GSP_CDMA, U3GFL_SCSI_EJECT },

+/* OEM: Qualcomm, Inc. */
+{{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR 
},  U3GSP_CDMA, 0x08},
+{{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM 
},  U3GSP_CDMA, U3GINIT_EJECT },
+{{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_MSM 
},   U3GSP_CDMA, 2 }, // after switch

/* OEM: Huawei */
{{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE 
},  U3GSP_HSDPA,U3GFL_HUAWEI_INIT },
{{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 
},U3GSP_HSPA, U3GFL_HUAWEI_INIT },

@@ -262,6 +266,7 @@
if (uaa->ifaces[i] == NULL)
continue;

+   DPRINTF("MDTATTACH i = %d\n",i);
id = usbd_get_interface_descriptor(uaa->ifaces[i]);
if (id && id->bInterfaceClass == UICLASS_MASS) {
/* We attach to the interface instead of the device as
@@ -289,6 +294,7 @@
 && 
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK)

bulkout_no = ed->bEndpointAddress;

+   DPRINTF("MDTATTACH bulkout and in = %d 
%d\n",bulkout_no, bulkin_no);

/* If we have found a pair of bulk-in/-out endpoints
 * create a serial port for it. Note: We assume that
 * the bulk-in and bulk-out endpoints appear in pairs.
@@ -474,26 +480,53 @@

 /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c
  * in sys/cam/scsi/scsi_all.h .
- */
-static unsigned char cmotech_cmd[31] = {
+ 
*  555342431234567824008c850024 
- from u3g modem switch

+ *  555342431234567820008c85010101180101010101 - from url
+ *  555342431234567820 00 00 00 80 00 0c 85 01 01 01 18 01 01 01 01 
01 00 00 - from url
+ *  555342431234567824 00 00 00 80 00 0c 85 00 00 00 24 


+*/
+#if 0
+static unsigned char cmotech_cmd[32] = {
 0x55, 0x53, 0x42, 0x43,/* 0..3: Command Block Wrapper (CBW) 
signature */

-0x01, 0x00, 0x00, 0x00,/* 4..7: CBW Tag, unique 32-bit number */
-0x00, 0x00, 0x00, 0x00,/* 8..11: CBW Transfer Length, no data here */
+0x12, 0x34, 0x56, 0x78,/* 4..7: CBW Tag, unique 32-bit number */
+0x20, 0x00, 0x00, 0x00,/* 8..11: CBW Transfer Length, no data here */
 0x80,  /* 12: CBW Flag: output, so 0 */
 0x00,  /* 13: CBW Lun */
-0x08,  /* 14: CBW Length */
+0x0c,   

ZTE MF636 USB u3g modem

2009-05-05 Thread Mike Tancsa
Has anyone had any luck getting this modem to work under FreeBSD ? I 
have been trying to modify the driver to get it to recognize and send 
the unit into modem mode, but no luck. I even tried setting the unit 
into permanent modem mode first from Windows as referenced in

http://www.matt-barrett.com/?p=5
but no luck yet

usbdevs shows it as
port 2 addr 2: high speed, power 500 mA, config 1, ZTE CDMA 
Technologies MSM(0x2000), ZTE, Incorporated(0x19d2), rev 0.00



u3g0: sending CD eject command to change to modem mode
u3g0: sent command to change to modem mode
u3g0: read back CSW


---Mike



Mike Tancsa,  tel +1 519 651 3400
Sentex Communications,m...@sentex.net
Providing Internet since 1994www.sentex.net
Cambridge, Ontario Canada www.sentex.net/mike

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/133896: [cdce] [newusb] panic when disconnecting cdce device just before powering off PC

2009-05-05 Thread brucec
Synopsis: [cdce] [newusb] panic when disconnecting cdce device just before 
powering off PC

State-Changed-From-To: open->closed 
State-Changed-By: brucec
State-Changed-When: Tue May 5 16:48:24 UTC 2009
State-Changed-Why: 
Fixed in -current.

http://www.freebsd.org/cgi/query-pr.cgi?pr=133896
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/133896: commit references a PR

2009-05-05 Thread dfilter service
The following reply was made to PR usb/133896; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/133896: commit references a PR
Date: Tue,  5 May 2009 15:39:45 + (UTC)

 Author: thompsa
 Date: Tue May  5 15:39:29 2009
 New Revision: 191825
 URL: http://svn.freebsd.org/changeset/base/191825
 
 Log:
   Remove USB shutdown methods from device drivers as its the host controllers
   responsibility to detach the bus.
   
   PR:  usb/133896
   Submitted by:Hans Petter Selasky
 
 Modified:
   head/sys/dev/usb/net/if_aue.c
   head/sys/dev/usb/net/if_axe.c
   head/sys/dev/usb/net/if_cdce.c
   head/sys/dev/usb/net/if_cue.c
   head/sys/dev/usb/net/if_kue.c
   head/sys/dev/usb/net/if_rue.c
   head/sys/dev/usb/net/if_udav.c
   head/sys/dev/usb/net/usb_ethernet.c
   head/sys/dev/usb/net/usb_ethernet.h
   head/sys/dev/usb/storage/ustorage_fs.c
   head/sys/dev/usb/usb_compat_linux.c
   head/sys/dev/usb/usb_hub.c
 
 Modified: head/sys/dev/usb/net/if_aue.c
 ==
 --- head/sys/dev/usb/net/if_aue.c  Tue May  5 15:36:23 2009
(r191824)
 +++ head/sys/dev/usb/net/if_aue.c  Tue May  5 15:39:29 2009
(r191825)
 @@ -173,7 +173,6 @@ static const struct usb2_device_id aue_d
  static device_probe_t aue_probe;
  static device_attach_t aue_attach;
  static device_detach_t aue_detach;
 -static device_shutdown_t aue_shutdown;
  static miibus_readreg_t aue_miibus_readreg;
  static miibus_writereg_t aue_miibus_writereg;
  static miibus_statchg_t aue_miibus_statchg;
 @@ -239,7 +238,6 @@ static device_method_t aue_methods[] = {
DEVMETHOD(device_probe, aue_probe),
DEVMETHOD(device_attach, aue_attach),
DEVMETHOD(device_detach, aue_detach),
 -  DEVMETHOD(device_shutdown, aue_shutdown),
  
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
 @@ -1038,17 +1036,3 @@ aue_stop(struct usb2_ether *ue)
aue_csr_write_1(sc, AUE_CTL1, 0);
aue_reset(sc);
  }
 -
 -/*
 - * Stop all chip I/O so that the kernel's probe routines don't
 - * get confused by errant DMAs when rebooting.
 - */
 -static int
 -aue_shutdown(device_t dev)
 -{
 -  struct aue_softc *sc = device_get_softc(dev);
 -
 -  usb2_ether_ifshutdown(&sc->sc_ue);
 -
 -  return (0);
 -}
 
 Modified: head/sys/dev/usb/net/if_axe.c
 ==
 --- head/sys/dev/usb/net/if_axe.c  Tue May  5 15:36:23 2009
(r191824)
 +++ head/sys/dev/usb/net/if_axe.c  Tue May  5 15:39:29 2009
(r191825)
 @@ -151,7 +151,6 @@ static const struct usb2_device_id axe_d
  static device_probe_t axe_probe;
  static device_attach_t axe_attach;
  static device_detach_t axe_detach;
 -static device_shutdown_t axe_shutdown;
  
  static usb2_callback_t axe_intr_callback;
  static usb2_callback_t axe_bulk_read_callback;
 @@ -216,7 +215,6 @@ static device_method_t axe_methods[] = {
DEVMETHOD(device_probe, axe_probe),
DEVMETHOD(device_attach, axe_attach),
DEVMETHOD(device_detach, axe_detach),
 -  DEVMETHOD(device_shutdown, axe_shutdown),
  
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
 @@ -1060,17 +1058,3 @@ axe_stop(struct usb2_ether *ue)
  
axe_reset(sc);
  }
 -
 -/*
 - * Stop all chip I/O so that the kernel's probe routines don't
 - * get confused by errant DMAs when rebooting.
 - */
 -static int
 -axe_shutdown(device_t dev)
 -{
 -  struct axe_softc *sc = device_get_softc(dev);
 -
 -  usb2_ether_ifshutdown(&sc->sc_ue);
 -
 -  return (0);
 -}
 
 Modified: head/sys/dev/usb/net/if_cdce.c
 ==
 --- head/sys/dev/usb/net/if_cdce.c Tue May  5 15:36:23 2009
(r191824)
 +++ head/sys/dev/usb/net/if_cdce.c Tue May  5 15:39:29 2009
(r191825)
 @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
  static device_probe_t cdce_probe;
  static device_attach_t cdce_attach;
  static device_detach_t cdce_detach;
 -static device_shutdown_t cdce_shutdown;
  static device_suspend_t cdce_suspend;
  static device_resume_t cdce_resume;
  static usb_handle_request_t cdce_handle_request;
 @@ -157,7 +156,6 @@ static device_method_t cdce_methods[] = 
DEVMETHOD(device_detach, cdce_detach),
DEVMETHOD(device_suspend, cdce_suspend),
DEVMETHOD(device_resume, cdce_resume),
 -  DEVMETHOD(device_shutdown, cdce_shutdown),
  
{0, 0}
  };
 @@ -596,16 +594,6 @@ cdce_setpromisc(struct usb2_ether *ue)
  }
  
  static int
 -cdce_shutdown(device_t dev)
 -{
 -  struct cdce_softc *sc = device_get_softc(dev);
 -
 -  usb2_ether_ifshutdown(&sc->sc_ue);
 -
 -  return (0);
 -}
 -
 -static int
  cdce_suspend(device_t dev)
  {
device_printf(dev, "Suspending\n");
 
 Modified: head/sys/dev/usb/net/