[PATCH v3 2/2] USB: serial: Another Infineon flash loader USB ID

2015-11-22 Thread Jonas Jonsson
The flash loader has been seen on a Telit UE910 modem. The flash loader
is a bit special, it presents both an ACM and CDC Data interface but
only the latter is useful. Unless a magic string is sent to the device
it will disappear and the regular modem device appears instead.

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
Tested-by: Daniele Palmas <dnl...@gmail.com>
---
 drivers/usb/serial/usb-serial-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/usb-serial-simple.c 
b/drivers/usb/serial/usb-serial-simple.c
index 3658662..6783cf8 100644
--- a/drivers/usb/serial/usb-serial-simple.c
+++ b/drivers/usb/serial/usb-serial-simple.c
@@ -53,7 +53,9 @@ DEVICE(funsoft, FUNSOFT_IDS);
 
 /* Infineon Flashloader driver */
 #define FLASHLOADER_IDS()  \
-   { USB_DEVICE(0x8087, 0x0716) }
+   { USB_DEVICE(0x8087, 0x0716) }, \
+   { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }
+
 DEVICE(flashloader, FLASHLOADER_IDS);
 
 /* Google Serial USB SubClass */
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-22 Thread Jonas Jonsson
Some modems, such as the Telit UE910, are using an Infineon Flash Loader
utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
Data). The latter can be used as a serial interface to upgrade the
firmware of the modem. However, that isn't possible when the cdc-acm
driver takes control of the device.

The following is an explanation of the behaviour by Daniele Palmas during
discussion on linux-usb.

"This is what happens when the device is turned on (without modifying
the drivers):

[155492.352031] usb 1-3: new high-speed USB device number 27 using ehci-pci
[155492.485429] usb 1-3: config 1 interface 0 altsetting 0 endpoint 0x81 has an 
invalid bInterval 255, changing to 11
[155492.485436] usb 1-3: New USB device found, idVendor=058b, idProduct=0041
[155492.485439] usb 1-3: New USB device strings: Mfr=0, Product=0, 
SerialNumber=0
[155492.485952] cdc_acm 1-3:1.0: ttyACM0: USB ACM device

This is the flashing device that is caught by the cdc-acm driver. Once
the ttyACM appears, the application starts sending a magic string
(simple write on the file descriptor) to keep the device in flashing
mode. If this magic string is not properly received in a certain time
interval, the modem goes on in normal operative mode:

[155493.748094] usb 1-3: USB disconnect, device number 27
[155494.916025] usb 1-3: new high-speed USB device number 28 using ehci-pci
[155495.059978] usb 1-3: New USB device found, idVendor=1bc7, idProduct=0021
[155495.059983] usb 1-3: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[155495.059986] usb 1-3: Product: 6 CDC-ACM + 1 CDC-ECM
[155495.059989] usb 1-3: Manufacturer: Telit
[155495.059992] usb 1-3: SerialNumber: 359658044004697
[155495.138958] cdc_acm 1-3:1.0: ttyACM0: USB ACM device
[155495.140832] cdc_acm 1-3:1.2: ttyACM1: USB ACM device
[155495.142827] cdc_acm 1-3:1.4: ttyACM2: USB ACM device
[155495.144462] cdc_acm 1-3:1.6: ttyACM3: USB ACM device
[155495.145967] cdc_acm 1-3:1.8: ttyACM4: USB ACM device
[155495.147588] cdc_acm 1-3:1.10: ttyACM5: USB ACM device
[155495.154322] cdc_ether 1-3:1.12 wwan0: register 'cdc_ether' at 
usb-:00:1a.7-3, Mobile Broadband Network Device, 00:00:11:12:13:14

Using the cdc-acm driver, the string, though being sent in the same way
than using the usb-serial-simple driver (I can confirm that the data is
passing properly since I used an hw usb sniffer), does not make the
device to stay in flashing mode."

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
Tested-by: Daniele Palmas <dnl...@gmail.com>
---
 drivers/usb/class/cdc-acm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b30e742..26ca4f9 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1838,6 +1838,11 @@ static const struct usb_device_id acm_ids[] = {
},
 #endif
 
+   /* Exclude Infineon Flash Loader utility */
+   { USB_DEVICE(0x058b, 0x0041),
+   .driver_info = IGNORE_DEVICE,
+   },
+
/* control interfaces without any protocol set */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_PROTO_NONE) },
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-22 Thread Jonas Jonsson
In v3:
 - Better explanation of the device behaviour in the commit message.
 - Use USB_CLASS_CDC_DATA instead of 0x0a.

In v2:
 - Include Tested-by: Daniele Palmas .

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-20 Thread Jonas Jonsson
On Thu, Nov 19, 2015 at 11:46:20AM +0100, Johan Hovold wrote:
> On Mon, Nov 16, 2015 at 01:34:14PM +0100, Jonas Jonsson wrote:
> > Some modems, such as the Telit UE910, are using an Infineon Flash Loader
> > utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
> > Data). The latter can be used as a serial interface to upgrade the
> > firmware of the modem. However, that isn't possible when the cdc-acm
> > driver takes control of the device.
> 
> Could you expand the commit message with some more information from the
> thread were Daniele explained how the flash loader works here?
> Specifically, that the device looks like a CDC-ACM device but really is
> not until after the flash loader has timed out.
Sure, I'll include parts of the mail from Daniele since it was a very good
explanation.

/Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] USB: serial: Another Infineon flash loader USB ID

2015-11-20 Thread Jonas Jonsson
On Thu, Nov 19, 2015 at 11:54:06AM +0100, Johan Hovold wrote:
> On Mon, Nov 16, 2015 at 01:34:15PM +0100, Jonas Jonsson wrote:
> > This has been seen on a Telit UE910 modem.
> 
> Please expand this message as well and mention why this is not a CDC
> device so we do not forget.
Sure.


> > +   { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, 0x0a) }
> 
> Please use USB_CLASS_CDC_DATA here.
Indeed. Thanks

/Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-16 Thread Jonas Jonsson
In v2:
 - Include Tested-by: Daniele Palmas .

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-16 Thread Jonas Jonsson
Some modems, such as the Telit UE910, are using an Infineon Flash Loader
utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
Data). The latter can be used as a serial interface to upgrade the
firmware of the modem. However, that isn't possible when the cdc-acm
driver takes control of the device.

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
Tested-by: Daniele Palmas <dnl...@gmail.com>
---
 drivers/usb/class/cdc-acm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b30e742..26ca4f9 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1838,6 +1838,11 @@ static const struct usb_device_id acm_ids[] = {
},
 #endif
 
+   /* Exclude Infineon Flash Loader utility */
+   { USB_DEVICE(0x058b, 0x0041),
+   .driver_info = IGNORE_DEVICE,
+   },
+
/* control interfaces without any protocol set */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_PROTO_NONE) },
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] USB: serial: Another Infineon flash loader USB ID

2015-11-16 Thread Jonas Jonsson
This has been seen on a Telit UE910 modem.

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
Tested-by: Daniele Palmas <dnl...@gmail.com>
---
 drivers/usb/serial/usb-serial-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/usb-serial-simple.c 
b/drivers/usb/serial/usb-serial-simple.c
index 3658662..93ab784 100644
--- a/drivers/usb/serial/usb-serial-simple.c
+++ b/drivers/usb/serial/usb-serial-simple.c
@@ -53,7 +53,9 @@ DEVICE(funsoft, FUNSOFT_IDS);
 
 /* Infineon Flashloader driver */
 #define FLASHLOADER_IDS()  \
-   { USB_DEVICE(0x8087, 0x0716) }
+   { USB_DEVICE(0x8087, 0x0716) }, \
+   { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, 0x0a) }
+
 DEVICE(flashloader, FLASHLOADER_IDS);
 
 /* Google Serial USB SubClass */
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-16 Thread Jonas Jonsson
Hi,

On Fri, Nov 13, 2015 at 03:56:22PM +0100, Johan Hovold wrote:
...

> I'll take a look at these patches when 4.4-rc1 is out.
Thanks. I'll post an update including Daniele Tested-by:.

/Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] cdc_acm: Ignore Infineon Flash Loader utility

2015-11-05 Thread Jonas Jonsson
Some modems, such as the Telit UE910, are using an Infineon Flash Loader
utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
Data). The latter can be used as a serial interface to upgrade the
firmware of the modem. However, that isn't possible when the cdc-acm
driver takes control of the device.

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
---
 drivers/usb/class/cdc-acm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b30e742..26ca4f9 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1838,6 +1838,11 @@ static const struct usb_device_id acm_ids[] = {
},
 #endif
 
+   /* Exclude Infineon Flash Loader utility */
+   { USB_DEVICE(0x058b, 0x0041),
+   .driver_info = IGNORE_DEVICE,
+   },
+
/* control interfaces without any protocol set */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_PROTO_NONE) },
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] USB: serial: Another Infineon flash loader USB ID

2015-11-05 Thread Jonas Jonsson
This has been seen on a Telit UE910 modem.

Signed-off-by: Jonas Jonsson <jo...@ludd.ltu.se>
---
 drivers/usb/serial/usb-serial-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/usb-serial-simple.c 
b/drivers/usb/serial/usb-serial-simple.c
index 3658662..93ab784 100644
--- a/drivers/usb/serial/usb-serial-simple.c
+++ b/drivers/usb/serial/usb-serial-simple.c
@@ -53,7 +53,9 @@ DEVICE(funsoft, FUNSOFT_IDS);
 
 /* Infineon Flashloader driver */
 #define FLASHLOADER_IDS()  \
-   { USB_DEVICE(0x8087, 0x0716) }
+   { USB_DEVICE(0x8087, 0x0716) }, \
+   { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, 0x0a) }
+
 DEVICE(flashloader, FLASHLOADER_IDS);
 
 /* Google Serial USB SubClass */
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


HP EC372S (Yuan DVB ExpressCard) crash in 3.18.3

2015-02-02 Thread Jonas Jonsson

Hi,

I posted a bug on kernel.org 
(https://bugzilla.kernel.org/show_bug.cgi?id=92301 ) and was asked to 
sent it to this mail-address.



Jan 29 21:26:51 plattpcn kernel: [   17.322493] input: UVC Camera (05ca:1812) 
as /devices/pci:00/:00:1d.7/usb2/2-4/2-4:1.0/input/input10
Jan 29 21:26:51 plattpcn kernel: [   17.322621] usbcore: registered new 
interface driver uvcvideo
Jan 29 21:26:51 plattpcn kernel: [   17.322623] USB Video Class driver (1.1.1)
Jan 29 21:26:51 plattpcn kernel: [   17.583002] input: HP WMI hotkeys as 
/devices/virtual/input/input11
Jan 29 21:26:51 plattpcn kernel: [   18.108106] iwl4965 :02:00.0: loaded 
firmware version 228.61.2.24
Jan 29 21:26:51 plattpcn kernel: [   18.360154] ieee80211 phy0: Selected rate 
control algorithm 'iwl-4965-rs'
Jan 29 21:26:51 plattpcn kernel: [   18.620404] dvb-usb: found a 'Yuan EC372S' 
in cold state, will try to load a firmware
Jan 29 21:26:51 plattpcn kernel: [   18.993039] dvb-usb: downloading firmware 
from file 'dvb-usb-dib0700-1.20.fw'
Jan 29 21:26:51 plattpcn kernel: [   19.194634] dib0700: firmware started 
successfully.
Jan 29 21:26:51 plattpcn kernel: [   19.695174] dvb-usb: found a 'Yuan EC372S' 
in warm state.
Jan 29 21:26:51 plattpcn kernel: [   19.695448] dvb-usb: will pass the complete 
MPEG2 transport stream to the software demuxer.
Jan 29 21:26:51 plattpcn kernel: [   19.695527] DVB: registering new adapter 
(Yuan EC372S)
Jan 29 21:26:51 plattpcn kernel: [   20.090809] BUG: unable to handle kernel 
NULL pointer dereference at 0080
Jan 29 21:26:51 plattpcn kernel: [   20.090987] IP: [a057b061] 
dib7000p_attach+0x11/0xa0 [dib7000p]
Jan 29 21:26:51 plattpcn kernel: [   20.091007] PGD 36893067 PUD b95b0067 PMD 0
Jan 29 21:26:51 plattpcn kernel: [   20.091007] Oops: 0002 [#1] SMP
Jan 29 21:26:51 plattpcn kernel: [   20.091007] Modules linked in: dib7000p(E) 
dvb_usb_dib0700(E+) dib7000m(E) arc4(E) dib0090(E) dib0070(E) dib3000mc(E) 
dibx000_common(E) dvb_usb(E) dvb_core(E) coretemp(E) hp_wmi(E) rc_core(E) 
sparse_keymap(E) uvcvideo(E) iwl4965(E) videobuf2_vmalloc(E) 
snd_hda_codec_si3054(E) kvm(E) iwlegacy(E) snd_hda_codec_realtek(E) 
videobuf2_memops(E) mac80211(E) videobuf2_core(E) snd_hda_codec_generic(E) 
v4l2_common(E) videodev(E) snd_hda_intel(E) joydev(E) snd_hda_controller(E) 
serio_raw(E) snd_hda_codec(E) snd_hwdep(E) r852(E) cfg80211(E) snd_pcm(E) 
sm_common(E) btusb(E) nand(E) snd_seq_midi(E) nand_ecc(E) snd_seq_midi_event(E) 
bluetooth(E) snd_rawmidi(E) nand_bch(E) snd_seq(E) bch(E) r592(E) 
snd_seq_device(E) nand_ids(E) snd_timer(E) mtd(E) memstick(E) drm(E) snd(E) 
soundcore(E) lpc_ich(E) wmi(E) video(E) mac_hid(E) parport_pc(E) ppdev(E) lp(E) 
parport(E) psmouse(E) ahci(E) libahci(E) firewire_ohci(E) firewire_core(E) 
sdhci_pci(E) crc_itu_t(E) sdhci(E) r8169(E) mii(E)
Jan 29 21:26:51 plattpcn kernel: [   20.091007] CPU: 0 PID: 442 Comm: 
systemd-udevd Tainted: GE  3.18.3jonas #1
Jan 29 21:26:51 plattpcn kernel: [   20.091007] Hardware name: Hewlett-Packard 
HP Pavilion dv9700 Notebook PC/30CB, BIOS F.59  11/25/2008
Jan 29 21:26:51 plattpcn kernel: [   20.091007] task: 8800b8f68000 ti: 
8800b9148000 task.ti: 8800b9148000
Jan 29 21:26:51 plattpcn kernel: [   20.091007] RIP: 0010:[a057b061]  
[a057b061] dib7000p_attach+0x11/0xa0 [dib7000p]
Jan 29 21:26:51 plattpcn kernel: [   20.091007] RSP: 0018:8800b914ba88  
EFLAGS: 00010202
Jan 29 21:26:51 plattpcn kernel: [   20.091007] RAX: 0010 RBX: 
8800ba9d1278 RCX: a0581040
Jan 29 21:26:51 plattpcn kernel: [   20.091007] RDX: a0581040 RSI: 
a0581c2b RDI: 0010
Jan 29 21:26:51 plattpcn kernel: [   20.091007] RBP: 8800b914ba88 R08: 
810e47a0 R09: 0001802a0029
Jan 29 21:26:51 plattpcn kernel: [   20.091007] R10: ea0002ed9fc0 R11: 
8107cf84 R12: 
Jan 29 21:26:51 plattpcn kernel: [   20.091007] R13: 0010 R14: 
8800ba9d1278 R15: 8800ba9d1398
Jan 29 21:26:51 plattpcn kernel: [   20.091007] FS:  7fd441492880() 
GS:88013fc0() knlGS:
Jan 29 21:26:51 plattpcn kernel: [   20.091007] CS:  0010 DS:  ES:  
CR0: 8005003b
Jan 29 21:26:51 plattpcn kernel: [   20.091007] CR2: 0080 CR3: 
36892000 CR4: 07f0
Jan 29 21:26:51 plattpcn kernel: [   20.091007] Stack:
Jan 29 21:26:51 plattpcn kernel: [   20.091007]  8800b914bab8 
a055adab 8800ba9d1278 8800ba9d1278
Jan 29 21:26:51 plattpcn kernel: [   20.091007]  8800ba9d1278 
 8800b914baf8 a04776b8
Jan 29 21:26:51 plattpcn kernel: [   20.091007]  8800ba9d 
 8800ba9d1278 8800ba9d
Jan 29 21:26:51 plattpcn kernel: [   20.091007] Call Trace:
Jan 29 21:26:51 plattpcn kernel: [   20.091007]  [a055adab] 
stk7700P2_frontend_attach+0x3b/0x1f0 [dvb_usb_dib0700]
Jan 29 21:26:51 plattpcn kernel: [