From patchwork Thu Apr 7 00:19:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lech Perczak X-Patchwork-Id: 561489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C055C433EF for ; Thu, 7 Apr 2022 00:20:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230316AbiDGAWq (ORCPT ); Wed, 6 Apr 2022 20:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbiDGAWo (ORCPT ); Wed, 6 Apr 2022 20:22:44 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83E3E10F6F3; Wed, 6 Apr 2022 17:20:45 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id e16so6842644lfc.13; Wed, 06 Apr 2022 17:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=meELFVGsIZ7ITOZMel7kaWLUHtDI0l/3uOe9GNIVnpQ=; b=M3Ujmkm3lO07wEUxLOvaypCM3bi0KoGurf8CGrTURpjMs0Js87YaR4PvwegVHXdvFs 2o543gaFqr9/gXPbriC9B92s/gOYaKmMfqOKyJK9kf9hjqRTJj+D5ItJntSOTlRDIlN2 EYkovAmD5esTvEZXqQyGbHvRImY3lgb2UUkihXGUD1XxZZXmRZQr+rpO1/e/dInQg520 qSTQXsJ+hyUDC8Ghqv4d0LM1Q7/SZzMaRvdwpKQPI2HifWiC06IlRGomIn4JjCa677xY tNf5+Gn3w6kygyMHGvAAAxkdTtLWlwTDI9yhYyJOuSmj5AuwB/wbTO5rrlDQic3gOLag 7LlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=meELFVGsIZ7ITOZMel7kaWLUHtDI0l/3uOe9GNIVnpQ=; b=hTFZ511kgib8x48xS/Lk98XtEPLdA8MKBYNB3Wr5NVJ80xW8MandEw7E6Qx7QrGYfD os2zhAT1XF28EUIU3CbLwj8o/lTYHsSRih5pb4oxsY2DiWDQKmDQPy36hqQNpeovWAUU sp3Tt78lqJqfzP8qIC8eifMpJcNiLbQKa01aJwKQ1CEjHsv+gr6+hZBOUCvcbi4TwJkk JwTKaLvaReFjH2hbkhGwiscvo+s7ydlw9bt/e4/m9xlFv7eVAj5ss18Gnd2DUGVLsSSq BKH+ao+6qS9z8TpGXuYO4lxg6IU3/ytoNh1xGJOkvFNBoZvly6pDYiXl2+B3kzcXpw6l hNPQ== X-Gm-Message-State: AOAM533/M6erBSa1KCrjTi3s+kMlZQAiP19dTYG1PiWlV+spka188KNN aerFqKAdI2gTNNCT94fzk6tfn2lTKSo= X-Google-Smtp-Source: ABdhPJz4JLr3WN6abCNhtxhVntWe+IKRxstx3m8m2hABS4qYWUDmgTdyiJTjRYbVabrK9m96ymRWqA== X-Received: by 2002:a05:6512:3d8e:b0:44a:3ad1:8bae with SMTP id k14-20020a0565123d8e00b0044a3ad18baemr7398233lfv.231.1649290843702; Wed, 06 Apr 2022 17:20:43 -0700 (PDT) Received: from rafiki.local ([2001:470:6180::c8d]) by smtp.gmail.com with ESMTPSA id n12-20020a2e86cc000000b0024b121fbb2csm1413879ljj.46.2022.04.06.17.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 17:20:43 -0700 (PDT) From: Lech Perczak To: netdev@vger.kernel.org, linux-usb@vger.kernel.org Cc: Lech Perczak , Kristian Evensen , =?utf-8?q?Bj=C3=B8rn_Mork?= , Oliver Neukum Subject: [PATCH 1/3] cdc_ether: export usbnet_cdc_zte_rx_fixup Date: Thu, 7 Apr 2022 02:19:24 +0200 Message-Id: <20220407001926.11252-2-lech.perczak@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220407001926.11252-1-lech.perczak@gmail.com> References: <20220407001926.11252-1-lech.perczak@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") introduces a workaround for certain ZTE modems reporting invalid MAC addresses over CDC-ECM. The same issue was present on their RNDIS interface,which was fixed in commit a5a18bdf7453 ("rndis_host: Set valid random MAC on buggy devices"). However, internal modem of ZTE MF286R router, on its RNDIS interface, also exhibits a second issue fixed already in CDC-ECM,of the device not respecting configured random MAC address. In order to share the fixup for this with rndis_host driver, export the workaround function, which will be re-used in the following commit in rndis_host. Cc: Kristian Evensen Cc: Bjørn Mork Cc: Oliver Neukum Signed-off-by: Lech Perczak --- drivers/net/usb/cdc_ether.c | 3 ++- include/linux/usb/usbnet.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 9b4dfa3001d6..2de09ad5bac0 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c @@ -479,7 +479,7 @@ static int usbnet_cdc_zte_bind(struct usbnet *dev, struct usb_interface *intf) * device MAC address has been updated). Always set MAC address to that of the * device. */ -static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) { if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02)) return 1; @@ -489,6 +489,7 @@ static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) return 1; } +EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup); /* Ensure correct link state * diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 8336e86ce606..1b4d72d5e891 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -214,6 +214,7 @@ extern int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf) extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *); extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *); extern void usbnet_cdc_status(struct usbnet *, struct urb *); +extern int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb); /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ From patchwork Thu Apr 7 00:19:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lech Perczak X-Patchwork-Id: 558755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DD10C433FE for ; Thu, 7 Apr 2022 00:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbiDGAWt (ORCPT ); Wed, 6 Apr 2022 20:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbiDGAWo (ORCPT ); Wed, 6 Apr 2022 20:22:44 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34C3910FADE; Wed, 6 Apr 2022 17:20:46 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id b17so6926751lfv.3; Wed, 06 Apr 2022 17:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=00Hbk/0CidWttLq2MxZDyxIW9qLxajk7I76V56fwuVM=; b=FXEDV1gzXsqcLwR7v+J9+xAJz5qrkNi8cjuXkTVNIbrFDlEyKJwNwLtRvCkoOpx/CA JFCugI0MvygP9U33Qs7ps27MCd1N0Jvq3OeLU15bNuTj7Fal/Kb5Jh+LgL+yRfrmPyWE dbBBmiBF3LeBf6RNlo81mSUQQd6+XRJXaSme3uOPKcafS0Epq4kjQOntkMB4OsrlVp7P SuZIdGSVavcrx38jmzs+kDKyuIvo3KqTmbrfOH3PQSx8XVR+EgX7mHWB0wyI+sA+5Ywc aczyq664quY2ZWGnyFcH7DUdHD4Ex6YND+FUaeENzfmab9vXhC53kOl0O7pg0+PjFl8+ P4yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=00Hbk/0CidWttLq2MxZDyxIW9qLxajk7I76V56fwuVM=; b=kp0Xp4OOaJ25JgAMfGq4/KPk06zi+AEto54vaTN0eFSzyRAe70mgKjBpUcnoTi/Vub DTbn0cLyMn/FeK1/KG9aV53Q40NrNzvpwdW/R6NoaunKT3zfhl3VvLcokeQ6TQK9JSmW U5C3dGyfs7wI+Lou3BZQG6JaOLNtRj6caiZbUK77RURkIcYkryfkJX6JsuoABnqNR4uG cQO5NX13yUCccZy5Z6gg5WKQbyeDMe5CESfA9pXJIdiQkgoxI4xd0/ofPsj8xaZSbtpr WsCd7hxXj9L+jajvXHJc2Lbf3YGGiAPFX4yQJ9xzcPT/w8ChK5JUc/I6Bl4jxV4fyMK1 B1iw== X-Gm-Message-State: AOAM531MLVZ0CxdL7p24htIQE72RylMi9YtyJvKG6+GtrbpzhCTxMe2y Vmf5lCpf49V1wiedf/oRgGGt6bOlnvk= X-Google-Smtp-Source: ABdhPJz87rNyQmthxWbh6mUxn/7oViulh+uFXYdzZKeziL6198Dd9SPuMbYEWqXsYDOPdAEgtsJnSQ== X-Received: by 2002:a05:6512:1153:b0:44a:3b47:4f88 with SMTP id m19-20020a056512115300b0044a3b474f88mr7372702lfg.447.1649290844529; Wed, 06 Apr 2022 17:20:44 -0700 (PDT) Received: from rafiki.local ([2001:470:6180::c8d]) by smtp.gmail.com with ESMTPSA id n12-20020a2e86cc000000b0024b121fbb2csm1413879ljj.46.2022.04.06.17.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 17:20:44 -0700 (PDT) From: Lech Perczak To: netdev@vger.kernel.org, linux-usb@vger.kernel.org Cc: Lech Perczak , Kristian Evensen , =?utf-8?q?Bj=C3=B8rn_Mork?= , Oliver Neukum Subject: [PATCH 2/3] rndis_host: enable the bogus MAC fixup for ZTE devices from cdc_ether Date: Thu, 7 Apr 2022 02:19:25 +0200 Message-Id: <20220407001926.11252-3-lech.perczak@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220407001926.11252-1-lech.perczak@gmail.com> References: <20220407001926.11252-1-lech.perczak@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Certain ZTE modems, namely: MF823. MF831, MF910, built-in modem from MF286R, expose both CDC-ECM and RNDIS network interfaces. They have a trait of ignoring the locally-administered MAC address configured on the interface both in CDC-ECM and RNDIS part, and this leads to dropping of incoming traffic by the host. However, the workaround was only present in CDC-ECM, and MF286R explicitly requires it in RNDIS mode. Re-use the workaround in rndis_host as well, to fix operation of MF286R module, some versions of which expose only the RNDIS interface. Apply the workaround to both "flavors" of RNDIS interfaces, as older ZTE modems, like MF823 found in the wild, report the USB_CLASS_COMM class interfaces, while MF286R reports USB_CLASS_WIRELESS_CONTROLLER. Cc: Kristian Evensen Cc: Bjørn Mork Cc: Oliver Neukum Signed-off-by: Lech Perczak --- drivers/net/usb/rndis_host.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 247f58cb0f84..a7eb032115e8 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -578,6 +578,10 @@ rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) } EXPORT_SYMBOL_GPL(rndis_tx_fixup); +static int zte_rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +{ + return rndis_rx_fixup(dev, skb) && usbnet_cdc_zte_rx_fixup(dev, skb); +} static const struct driver_info rndis_info = { .description = "RNDIS device", @@ -600,6 +604,16 @@ static const struct driver_info rndis_poll_status_info = { .tx_fixup = rndis_tx_fixup, }; +static const struct driver_info zte_rndis_info = { + .description = "ZTE RNDIS device", + .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, + .bind = rndis_bind, + .unbind = rndis_unbind, + .status = rndis_status, + .rx_fixup = zte_rndis_rx_fixup, + .tx_fixup = rndis_tx_fixup, +}; + /*-------------------------------------------------------------------------*/ static const struct usb_device_id products [] = { @@ -613,6 +627,16 @@ static const struct usb_device_id products [] = { USB_VENDOR_AND_INTERFACE_INFO(0x238b, USB_CLASS_COMM, 2 /* ACM */, 0x0ff), .driver_info = (unsigned long)&rndis_info, +}, { + /* ZTE WWAN modules */ + USB_VENDOR_AND_INTERFACE_INFO(0x19d2, + USB_CLASS_WIRELESS_CONTROLLER, 1, 3), + .driver_info = (unsigned long)&zte_rndis_info, +}, { + /* ZTE WWAN modules, ACM flavour */ + USB_VENDOR_AND_INTERFACE_INFO(0x19d2, + USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long)&zte_rndis_info, }, { /* RNDIS is MSFT's un-official variant of CDC ACM */ USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff), From patchwork Thu Apr 7 00:19:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lech Perczak X-Patchwork-Id: 561488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A287CC4332F for ; Thu, 7 Apr 2022 00:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbiDGAWv (ORCPT ); Wed, 6 Apr 2022 20:22:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbiDGAWo (ORCPT ); Wed, 6 Apr 2022 20:22:44 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0427310FDC0; Wed, 6 Apr 2022 17:20:47 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id m12so5421163ljp.8; Wed, 06 Apr 2022 17:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NWtJUufTgUTljvZ4DozO/AYXP9ooRGM/t22SC5y7uYA=; b=bLQrgQZODjMU1wcMWA5gBZOJuqUE9bcHLDl/d/BAt0fQ94wmNB9i743jzJXSE+ITsd Ee8BwbyGo46OtYPTZksNesNtCBpuA2em1uujIYf5jD/AddIkxSkPqlVQYr0PSYsHwjDB bSG3n+3/96s3Bf+5iCNNRK7AmHivyyJ3azBcg/vr9FvUXVWXLjuzjngvqYJH9ZHu4xOu +oOy3n9oMju699yuttQuk6hfXZtcaBUZQuDhacSp2IVk6PUyUSvkz7Dbss052b3Lc3Oz KxFhINxQVmt7opgfGvGY7hKcs4QZiPS4zJbxrxZmKj8d0gZzutGU6FMIU/jMLlGxxeN6 oWUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NWtJUufTgUTljvZ4DozO/AYXP9ooRGM/t22SC5y7uYA=; b=VZRM406GiSjlUNUt3tK4T7Egg0pgUd3okuhYs64Hkpesy3ShrGRBc98BKk6/JSJKiT g5hWSn4Fo4kvm5YP50kZseAEYNtDyzzGppzikL3NZSlPiOlZytn43LyBBWXXIEBq9O5n CT8r3NxXTfAK6AkFJD0YXRdogWcrfp6sts43BHgXR4fNi2haad+UCBjfUTAx8Js8NbUt DTmrbbUvcT99J1TkRlfqJnV0lHroOyZy37L+i/Kxrooy26bDquz0B51dW/6BYMzSq2df TDNIyfYRK9+fdToVoQptj0p+RDd/3wkuE1sVq8i6blCvud7eaxWNIUZImH0oJ3mfpjEs ZBPg== X-Gm-Message-State: AOAM531D2LIwxSPkoTIdLvNgbtZ+NcFmmILSRZB+VtdGk9Z7KdQYtz9t 7P2kO32GicGywIVqfqqdc5iZgrcNBD8= X-Google-Smtp-Source: ABdhPJy5yX1EG2vjtAEvuN/327uGdZseybjoWauMDvgf211zsKE6iR2ite/LlZiapQ6bE4QTYRFGMw== X-Received: by 2002:a2e:b94b:0:b0:249:6181:468a with SMTP id 11-20020a2eb94b000000b002496181468amr7023837ljs.113.1649290845324; Wed, 06 Apr 2022 17:20:45 -0700 (PDT) Received: from rafiki.local ([2001:470:6180::c8d]) by smtp.gmail.com with ESMTPSA id n12-20020a2e86cc000000b0024b121fbb2csm1413879ljj.46.2022.04.06.17.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 17:20:45 -0700 (PDT) From: Lech Perczak To: netdev@vger.kernel.org, linux-usb@vger.kernel.org Cc: Lech Perczak , Kristian Evensen , =?utf-8?q?Bj=C3=B8rn_Mork?= , Oliver Neukum Subject: [PATCH 3/3] rndis_host: limit scope of bogus MAC address detection to ZTE devices Date: Thu, 7 Apr 2022 02:19:26 +0200 Message-Id: <20220407001926.11252-4-lech.perczak@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220407001926.11252-1-lech.perczak@gmail.com> References: <20220407001926.11252-1-lech.perczak@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Reporting of bogus MAC addresses and ignoring configuration of new destination address wasn't observed outside of a range of ZTE devices, among which this seems to be the common bug. Align rndis_host driver with implementation found in cdc_ether, which also limits this workaround to ZTE devices. Cc: Kristian Evensen Suggested-by: Bjørn Mork Cc: Oliver Neukum Signed-off-by: Lech Perczak --- drivers/net/usb/rndis_host.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index a7eb032115e8..55ff0461d39b 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -418,10 +418,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) goto halt_fail_and_release; } - if (bp[0] & 0x02) - eth_hw_addr_random(net); - else - eth_hw_addr_set(net, bp); + eth_hw_addr_set(net, bp); /* set a nonzero filter to enable data transfers */ memset(u.set, 0, sizeof *u.set); @@ -463,6 +460,16 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) return generic_rndis_bind(dev, intf, FLAG_RNDIS_PHYM_NOT_WIRELESS); } +static int zte_rndis_bind(struct usbnet *dev, struct usb_interface *intf) +{ + int status = rndis_bind(dev, intf); + + if (!status && (dev->net->dev_addr[0] & 0x02)) + eth_hw_addr_random(dev->net); + + return status; +} + void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) { struct rndis_halt *halt; @@ -607,7 +614,7 @@ static const struct driver_info rndis_poll_status_info = { static const struct driver_info zte_rndis_info = { .description = "ZTE RNDIS device", .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, - .bind = rndis_bind, + .bind = zte_rndis_bind, .unbind = rndis_unbind, .status = rndis_status, .rx_fixup = zte_rndis_rx_fixup,