From: =?utf-8?Q?Bj=C3=B8rn_Mork?= Subject: Re: [PATCH v2 2/3] net: usb: cdc_enc: New driver exposing USB CDC encapsulated protocols Date: Sun, 15 Jan 2012 20:52:38 +0100 Message-ID: <87ehv0eoah.fsf@nemi.mork.no> References: <201201151436.29794.oliver@neukum.org> <87lip9dp11.fsf@nemi.mork.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org, Dan Williams , Thomas =?utf-8?Q?Sch=C3=A4fer?= To: Oliver Neukum Return-path: Received: from canardo.mork.no ([148.122.252.1]:51207 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778Ab2AOTwr convert rfc822-to-8bit (ORCPT ); Sun, 15 Jan 2012 14:52:47 -0500 In-Reply-To: <87lip9dp11.fsf@nemi.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Sun, 15 Jan 2012 15:22:02 +0100") Sender: netdev-owner@vger.kernel.org List-ID: Bj=C3=B8rn Mork writes: > Oliver Neukum writes: >> Am Sonntag, 15. Januar 2012, 07:40:36 schrieb Bj=C3=B8rn Mork: >>> USB CDC Ethernet devices may encapsulate vendor specific protocols = inside >>> USB_CDC_SEND_ENCAPSULATED_COMMAND +USB_CDC_GET_ENCAPSULATED_RESPONS= E >>> control messages. Devices based on Qualcomm MSM >>> chipsets are known to use this for exporting the Qualcomm >>> MSM Interface (QMI) protocol. Examples of such devices are >>> the Huawei E392 and E398 LTE modems. >> >> The problem is that this is another version of the code already >> in cdc-wdm, which is tested well. > > Huh? I thought that was something entirely different. Isn't it? I should look at things before asking. I see what you mean. The cdc-wdm code is very similar, and should be fairly easy to adapt. Why didn't I just research that from the start? Well, you learn more from doing such mistakes ;-) There is one fundamental design issue which worries me though: cdc-wdm doesn't support multiple simultaneous readers/writers. This is sort of a blocker for my use case, as I will need to keep a reader/writer for the driver internal wwan management at all times. So two simultaneous clients are necessary to actually have something available for userspace at all. Are there any reasons for this choice, and do you think it's feasible changing it without destroying the advantage of the well tested code? = I seem to remember that cdc-wdm allowed simultaneous reading/writing in the past, but this changed somewhere between 2.6.32 and 3.0. I have an Ericsson modem with two such AT command speaking interfaces, and I use = a simple shell script to configure it. At one point I had to switch from using /dev/cdc-wdm0 to /dev/ttyACM0 because the former started hanging on constructs like this: while read x; do case "$x" in foo) echo -e "AT+bar\r" >/dev/cdc-wdm0 ;; ... esac done