From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbcFCPIT (ORCPT ); Fri, 3 Jun 2016 11:08:19 -0400 Received: from ausxippc101.us.dell.com ([143.166.85.207]:4758 "EHLO ausxippc101.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbcFCPIR convert rfc822-to-8bit (ORCPT ); Fri, 3 Jun 2016 11:08:17 -0400 DomainKey-Signature: s=smtpout; d=dell.com; c=nofws; q=dns; h=X-LoopCount0:X-IronPort-AV:From:To:CC:Subject: Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language: X-MS-Has-Attach:X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader:x-originating-ip: Content-Type:Content-Transfer-Encoding:MIME-Version: Return-Path; b=d5dWaI8JcFgiPTuDhEITa1eZpGO3b3M8BSf0mf7OteTyWXp2GiDetX5j yzIaRTKgizF24AHXacJTuk9EDd25dc0ZhXAP2erckENNX6FF0O3ltpwEV UpVfn2QE/tupyTuAy7pBMFpHKT7/zT7S+0WFMovZT85CbEYQU5nuCoWk7 0=; X-LoopCount0: from 10.170.28.40 X-IronPort-AV: E=Sophos;i="5.26,412,1459832400"; d="scan'208";a="807266456" From: To: CC: , , , , , Subject: RE: [PATCH v2] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Topic: [PATCH v2] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Index: AQHRvO/4qOkaZaVerUSL1iyCPJzWv5/WudCAgAEY7YCAAAM5wA== Date: Fri, 3 Jun 2016 15:08:14 +0000 Message-ID: References: <1464886687-16284-1-git-send-email-mario_limonciello@dell.com> <1464886687-16284-2-git-send-email-mario_limonciello@dell.com> <0835B3720019904CB8F7AA43166CEEB2FED9B5@RTITMBSV03.realtek.com.tw> In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2FED9B5@RTITMBSV03.realtek.com.tw> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.11.181.4] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Hayes Wang [mailto:hayeswang@realtek.com] > Sent: Friday, June 3, 2016 4:44 AM > To: Limonciello, Mario > Cc: LKML ; Netdev > ; Linux USB ; > pali.rohar@gmail.com; anthony.wong@canonical.com; Greg KH > > Subject: RE: [PATCH v2] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > Mario Limonciello [mailto:mario_limonciello@dell.com] > > Sent: Friday, June 03, 2016 12:58 AM > [...] > > @@ -500,6 +502,7 @@ enum rtl8152_flags { > > SELECTIVE_SUSPEND, > > PHY_RESET, > > SCHEDULE_NAPI, > > + MAC_PASSTHRU = 0, > > I don't think you have to give this a value. > > > }; > > > [...] > > static int set_ethernet_addr(struct r8152 *tp) > > { > > struct net_device *dev = tp->netdev; > > @@ -1041,6 +1088,10 @@ static int set_ethernet_addr(struct r8152 *tp) > > else > > ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data); > > > > + /* if system provides auxiliary MAC address */ > > + if (get_auxiliary_addr(tp, &sa)) > > + ret = 0; > > It still has problem when tp->version == RTL_VER_01. > First, you would read the current MAC address (MAC1) to sa.sa_data. > Then sa.sa_data may be modified by MAC2 after get_auxiliary_addr(). > However, the MAC2 wouldn't be set to the device, because > > if (tp->version == RTL_VER_01) > ether_addr_copy(dev->dev_addr, sa.sa_data); > > Therefore, you would find that dev_addr is MAC2, and the device > uses MAC1. > > Best Regards, > Hayes > Hayes, >>From the information that I got that this is only a valid thing to do on RTL-8153-AD (when dock bit set), should this only match with tp->version >= RTL_VER_03? How can I confirm that the chip is 8153-AD specifically? I didn't see something obvious in driver to tell this. Thanks,