// SPDX-License-Identifier: GPL-2.0-only /* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as * transport layer. * Copyright (C) 2013 Enrico Mioso <mrkiko.rs@gmail.com> * * ABSTRACT: * This driver handles devices resembling the CDC NCM standard, but * encapsulating another protocol inside it. An example are some Huawei 3G * devices, exposing an embedded AT channel where you can set up the NCM * connection. * This code has been heavily inspired by the cdc_mbim.c driver, which is * Copyright (c) 2012 Smith Micro Software, Inc. * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
*/
/* altsetting should always be 1 for NCM devices - so we hard-coded * it here. Some huawei devices will need the NDP part of the NCM package to * be at the end of the frame.
*/
drvflags |= CDC_NCM_FLAG_NDP_TO_END;
/* For many Huawei devices the NTB32 mode is the default and the best mode * they work with. Huawei E5785 and E5885 devices refuse to work in NTB16 mode at all.
*/
drvflags |= CDC_NCM_FLAG_PREFER_NTB32;
ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags); if (ret) goto err;
ctx = drvstate->ctx;
if (usbnet_dev->status) /* The wMaxCommand buffer must be big enough to hold * any message from the modem. Experience has shown * that some replies are more than 256 bytes long
*/
subdriver = usb_cdc_wdm_register(ctx->control,
&usbnet_dev->status->desc,
1024, /* wMaxCommand */
WWAN_PORT_AT,
huawei_cdc_ncm_wdm_manage_power); if (IS_ERR(subdriver)) {
ret = PTR_ERR(subdriver);
cdc_ncm_unbind(usbnet_dev, intf); goto err;
}
/* Prevent usbnet from using the status descriptor */
usbnet_dev->status = NULL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.