Netdev List
 help / color / mirror / Atom feed
From: David Chen <david0813@gmail.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	hayeswang@realtek.com, mario.limonciello@dell.com,
	bigeasy@linutronix.de, edumazet@google.com, f.fainelli@gmail.com,
	david.chen7@dell.com, kai.heng.feng@canonical.com,
	zhongjiang@huawei.com
Subject: Re: [PATCH] [V2]r8152: Add support for MAC address pass through on RTL8153-BD
Date: Fri, 22 Feb 2019 13:44:31 +0800	[thread overview]
Message-ID: <507B7885-3219-4C9A-B709-6B85F70F4F6E@gmail.com> (raw)
In-Reply-To: <91332458-c2c1-b7c3-5135-ab0741108020@suse.cz>

Hi Jiri,

Thanks for your comments.  BND_MASK and BD_MASK are defined separately, and I have tested RTL8153-BD and RTL8153-BND devices, both work as expected.

Thanks and Regards,
-David


> Jiri Slaby <jslaby@suse.cz> 於 2019年2月18日 下午10:22 寫道:
> 
>> On 18. 02. 19, 15:00, David Chen wrote:
>> From: David Chen <david.chen7@dell.com>
>> 
>> RTL8153-BD is used in Dell DA300 type-C dongle.
>> It should be added to the whitelist of devices to activate MAC address
>> pass through.
>> 
>> Per confirming with Realtek all devices containing RTL8153-BD should
>> activate MAC pass through and there won't use pass through bit on efuse
>> like in RTL8153-AD.
>> 
>> Signed-off-by: David Chen <david.chen7@dell.com>
>> ---
>> drivers/net/usb/r8152.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
>> index 60dd1ec1665f..86c8c64fbb0f 100644
>> --- a/drivers/net/usb/r8152.c
>> +++ b/drivers/net/usb/r8152.c
>> @@ -557,6 +557,7 @@ enum spd_duplex {
>> /* MAC PASSTHRU */
>> #define AD_MASK            0xfee0
>> #define BND_MASK        0x0004
>> +#define BD_MASK            0x0001
>> #define EFUSE            0xcfdb
>> #define PASS_THRU_MASK        0x1
>> 
>> @@ -1176,9 +1177,9 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
>>            return -ENODEV;
>>        }
>>    } else {
>> -        /* test for RTL8153-BND */
>> +        /* test for RTL8153-BND and RTL8153-BD */
>>        ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
>> -        if ((ocp_data & BND_MASK) == 0) {
>> +        if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) {
> 
> Can you ensure that BND won't have the BD's bit set and vice versa? I.e.
> should the check be something like:
>  if (isBND() && (ocp_data & BND_MASK) == 0 ||
>      isBD() && (ocp_data & BD_MASK) == 0)
> instead?
> 
> thanks,
> -- 
> js
> suse labs

      reply	other threads:[~2019-02-22  5:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 14:00 [PATCH] [V2]r8152: Add support for MAC address pass through on RTL8153-BD David Chen
2019-02-18 14:22 ` Jiri Slaby
2019-02-22  5:44   ` David Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507B7885-3219-4C9A-B709-6B85F70F4F6E@gmail.com \
    --to=david0813@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=david.chen7@dell.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hayeswang@realtek.com \
    --cc=jslaby@suse.cz \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@dell.com \
    --cc=netdev@vger.kernel.org \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox