From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941232AbcIHND5 (ORCPT ); Thu, 8 Sep 2016 09:03:57 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:34708 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751697AbcIHNDz (ORCPT ); Thu, 8 Sep 2016 09:03:55 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.56 with qID u88D21Oa023653, This message is accepted by code: ctloc85258 From: Hayes Wang To: =?utf-8?B?QmrDuHJuIE1vcms=?= CC: "netdev@vger.kernel.org" , nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , Oliver Neukum Subject: RE: [PATCH net-next 0/3] r8152: configuration setting Thread-Topic: [PATCH net-next 0/3] r8152: configuration setting Thread-Index: AQHSCaZH43gBpiy8s02vT+E0mWBxw6Bvi0Cw Date: Thu, 8 Sep 2016 13:02:01 +0000 Message-ID: <0835B3720019904CB8F7AA43166CEEB201026170@RTITMBSV03.realtek.com.tw> References: <1394712342-15778-215-Taiwan-albertk@realtek.com> <87h99rizsi.fsf@miraculix.mork.no> <0835B3720019904CB8F7AA43166CEEB2010259B5@RTITMBSV03.realtek.com.tw> <87vay6hlmc.fsf@miraculix.mork.no> In-Reply-To: <87vay6hlmc.fsf@miraculix.mork.no> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.177.128] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u88D44St025361 Bjørn Mork [mailto:bjorn@mork.no] > Sent: Thursday, September 08, 2016 3:55 PM [...] > Yes, I see that. But is that strictly necessary? Couldn't you just say: > "CDC ECM is supported by cdc_ether and therefore limited to the features > implemented by cdc_ether. If you want feature X, then please use our > vendor specific mode with the r8152 driver?" My customs have a case that they must force the speed to 100M for some reasons. I also wish to implement the driver as simple as possible, but I don't think I could determine this. I accept you reject my patches. However, I couldn't deny the requests from the boss or customs without doing anything. I must prove the way is unacceptable. [...] > Each USB configuation comes with a set of descriptors identifying the > functions, and USB interface drivers attach to the functions they > support. The user can dynamically switch the device from e.g. cfg #1 to > cfg #3 by writing "3" to /sys/bus/usb/devices//bConfigurationValue > This will cause the ECM and ACM USB interfaces to disappear, and the > associated class drivers will unbind, and new vendor specific USB > interfaces appear instead, causing a matching vendor specific driver to > load and bind. > > Naturally, end users will not switch configurations all the time. They > will select the configuration providing the set of functions they want. > If this is different from the default configuration selected by the > Linux USB core, then that's a simple udev rule to update the > bConfigurationValue sysfs attribute on device disceovery. I tested above method before. And I found that the cdc_ether was loaded before switching the configuration. The behavior of loading one driver and changing to another driver has opportunity to let our some previous chips become abnormal. To switch configuration is fine. However, it may have problem to switch driver. That is why the current kernel only supports vendor mode. If the method works fine, I have no trouble now. Best Regards, Hayes