Re: awk(1) rshift/lshift on the borders of int

2012-01-17 Thread Jakub Tuček/otaznik
Martin Pelikan  napsal:
> I can't say anything more than 'this solved my problem', which was 
> 
> $ echo | awk '{ printf "%u\n", rshift(int("0xdeff"), 24) }' | bc -e
> 'obase=16' 
> FF80
> vs.
> $ echo | awk '{ printf "%u\n", rshift(int("0xdeff"), 24) }' | bc -e
> 'obase=16'
> DE
> 
> I hope it starts a discussion (at least), but I don't really know what
> the correct way is to these problems.
> 
> --
> Martin Pelikan
> 

Hello Martin,

You reached int boundary, so You received minimal number possible. I do not 
think extending boundary is good solution (that way you will reach it soon 
again).
To demonstrate:
$ awk 'BEGIN { printf("%d\n","0x7fff") }'  
2147483647

$ awk 'BEGIN { printf("%d\n","0x8000") }'  
$ awk 'BEGIN { printf("%d\n","0x8001") }'  
$ awk 'BEGIN { printf("%d\n","0x") }'  
$ awk 'BEGIN { printf("%d\n","0xfeedbeef") }'  
$ awk 'BEGIN { printf("%d\n","0xf") }' 
-2147483648

In my point of view, You should solve the problem elsehow. For example 
splitting that big number to smaller or just trim last six characters (it 
depends on problem you have)

Best regards
-- 
Jakub TuD
ek/otaznik 



Re: Patch for Vertex Wireless VW110L CDMA modem

2011-11-30 Thread Jakub Tuček/otaznik
Wed, 30 Nov 2011 18:55:46 +0100
David Coppa  wrote:

> On Wed, Nov 30, 2011 at 6:09 PM, Jakub TuD
ek/otaznik  wrote:
> 
> > [demime 1.01d removed an attachment of type application/octet-stream which 
> > had a name of GENERIC.dmesg]
> >
> > [demime 1.01d removed an attachment of type application/octet-stream which 
> > had a name of GENERIC.usbdevs]
> >
> > [demime 1.01d removed an attachment of type application/octet-stream which 
> > had a name of VERTEX.dmesg]
> >
> > [demime 1.01d removed an attachment of type application/octet-stream which 
> > had a name of VERTEX.usbdevs]
> >
> > [demime 1.01d removed an attachment of type application/octet-stream which 
> > had a name of vertex.udiff]
> 
> Please resend the diff inline.
> 
> ciao,
> David

Sorry =/ Here is it

Index: umsm.c
===
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.79
diff -u -r1.79 umsm.c
--- umsm.c  22 Jul 2011 11:37:09 -  1.79
+++ umsm.c  29 Nov 2011 10:40:34 -
@@ -152,7 +152,7 @@
{{ USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_KPC650 }, 0},
 
/* XXX Some qualcomm devices are missing */
-   {{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_DRIVER }, DEV_UMASS1},
+   {{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_DRIVER }, DEV_UMASS4},
{{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_HSDPA }, 0},
{{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_HSDPA2 }, 0},
 
@@ -248,6 +248,8 @@
{{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, DEV_UMASS1},
{{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628_DISK }, 0},
{{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CNU680 }, DEV_UMASS1},
+
+   {{ USB_VENDOR_VERTEX, USB_PRODUCT_VERTEX_VW110L }, 0},
 };
 
 #define umsm_lookup(v, p) ((const struct umsm_type *)usb_lookup(umsm_devs, v, 
p))
@@ -341,6 +343,8 @@
sc->sc_dev.dv_xname);
} else if ((sc->sc_flag & DEV_UMASS) && uaa->ifaceno == 0) {
umsm_umass_changemode(sc);
+   printf("%s: umass only mode. need to reattach\n", 
+   sc->sc_dev.dv_xname);
}
 
/*
Index: usbdevs
===
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.551
diff -u -r1.551 usbdevs
--- usbdevs 22 Jul 2011 11:34:17 -  1.551
+++ usbdevs 29 Nov 2011 10:40:36 -
@@ -570,6 +570,7 @@
 vendor METAGEEK0x1dd5  MetaGeek
 vendor MODACOM 0x1eb8  Modacom
 vendor AIRTIES 0x1eda  AirTies
+vendor VERTEX  0x1fe7  Vertex Wireless Co., Ltd.
 vendor DLINK   0x2001  D-Link
 vendor PLANEX2 0x2019  Planex Communications
 vendor ENCORE  0x203d  Encore
@@ -3805,6 +3806,9 @@
 
 /* Velleman products */
 product VELLEMAN K8055 0x5500  K8055 USB Experiment interface board
+
+/* Vertex Wireless products */
+product VERTEX VW110L  0x0100  VW110L - CDMA 1xEVDO Rev.A Modem
 
 /* Moxa products */
 productMOXA UPORT1110  0x1110  UPort 1110



Patch for Vertex Wireless VW110L CDMA modem

2011-11-30 Thread Jakub Tuček/otaznik
Hello,

recently I met Qalcomm based Vertex CDMA Modem VW110L, which was not 
initialized properly by umsm driver. I am sending dmesg and usbdev listing 
before (Generic) and after (Vertex) along with patch to driver and usbdevice 
database.
I am wondering if there is some way how to choose which method of 
initialization will be used instead of hardcoding it. 

Best regards
-- 
Jakub TuD
ek/otaznik 

[demime 1.01d removed an attachment of type application/octet-stream which had 
a name of GENERIC.dmesg]

[demime 1.01d removed an attachment of type application/octet-stream which had 
a name of GENERIC.usbdevs]

[demime 1.01d removed an attachment of type application/octet-stream which had 
a name of VERTEX.dmesg]

[demime 1.01d removed an attachment of type application/octet-stream which had 
a name of VERTEX.usbdevs]

[demime 1.01d removed an attachment of type application/octet-stream which had 
a name of vertex.udiff]