Enrico Mioso <mrkiko.rs@xxxxxxxxx> writes: > Hi! > I read your mail from the wwan0 interface :) . > This time I was able to understand the "netif" thing by re-reading the code. > The device works in ncm mode - the wdm device has became inaccessible, and any > attempt to write to it results in a LOT of unknown notifications, obviously. > > My dmesg: > ... > [ 124.508433] cdc_ncm 1-2:1.1: unknown notification 42 received: index 1 len 8 > [ 137.673907] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready > [ 137.674431] usb 1-2: NCM: unexpected notification 0x01! > [ 137.674594] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready > [ 215.212011] usb 1-2: NCM: unexpected notification 0x01! > [ 215.338349] usb 1-2: NCM: unexpected notification 0x01! > [ 215.556161] usb 1-2: NCM: unexpected notification 0x01! Ok, you've obviously ended up with cdc_ncm listening on the notification endpoint instead of cdc-wdm here. Expect a crash coming up :) The simple test approach does of course need some cleanup before it is ready for production. But you have proved the important parts: - the network function is standard CDC NCM, except that there doesn't seem to be any USB_CDC_NOTIFY_NETWORK_CONNECTION notification (which is mandatory in NCM) - there is a USB_CDC_NOTIFY_SPEED_CHANGE notification - the embedded management protocol is Huawei specific AT commands >From here, I believe you should start looking at how to create a driver supporting this. Factoring out the parts of cdc_ncm you need and creating a separate driver for these devices seems cleanest to me, but that's only my opinion before trying it. I could be wrong. It is also possible to add the support to cdc_ncm as a new driver template with the necessary functions supporting it. >From the look of it, I believe you only need cdc_ncm_rx_fixup and cdc_ncm_tx_fixup in addition to the functions already exported. And maybe also factor out and export the handling of the two NCM notifications from cdc_ncm_status so they can be shared. Other than that, the driver can be simple bind/unbind/suspend/resume/ manage_power boiler-plate code from cdc_mbim and/or qmi_wwan. The hardest part is probably extending the cdc-wdm API. If you google for the pre-cdc_mbim discussions, I believe Oliver Neukum had some nice thoughts on that then. We originally thought that we had to extend the API with network function notification support for cdc_mbim, but it turned out we didn't. Still, the discussions from then are relevant to this case. There were some code examples circulating too. Bjørn -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html