From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932405AbdJJPOd convert rfc822-to-8bit (ORCPT ); Tue, 10 Oct 2017 11:14:33 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:18102 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932367AbdJJPOa (ORCPT ); Tue, 10 Oct 2017 11:14:30 -0400 X-IronPort-AV: E=Sophos;i="5.42,505,1500966000"; d="scan'208";a="7745248" From: To: , , , , , Subject: RE: [PATCH v2 net-next 1/2] net: dsa: lan9303: Move tag setup to new lan9303_setup_tagging Thread-Topic: [PATCH v2 net-next 1/2] net: dsa: lan9303: Move tag setup to new lan9303_setup_tagging Thread-Index: AQHTQcZ53hZuvJZOKkWy6iLYvoiTz6LdMGTQ Date: Tue, 10 Oct 2017 15:14:30 +0000 Message-ID: <9235D6609DB808459E95D78E17F2E43D40B48C3D@CHN-SV-EXMX02.mchp-main.com> References: <20171010124953.386-1-privat@egil-hjelmeland.no> <20171010124953.386-2-privat@egil-hjelmeland.no> In-Reply-To: <20171010124953.386-2-privat@egil-hjelmeland.no> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.76.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 > +/* forward special tagged packets from port 0 to port 1 *or* port 2 */ > +static int lan9303_setup_tagging(struct lan9303 *chip) > +{ > + int ret; > + u32 val; > + /* enable defining the destination port via special VLAN tagging > + * for port 0 > + */ > + ret = lan9303_write_switch_reg(chip, > LAN9303_SWE_INGRESS_PORT_TYPE, > + > LAN9303_SWE_INGRESS_PORT_TYPE_VLAN); > + if (ret) > + return ret; > + > + /* tag incoming packets at port 1 and 2 on their way to port 0 to be > + * able to discover their source port > + */ > + val = LAN9303_BM_EGRSS_PORT_TYPE_SPECIAL_TAG_PORT0; > + return lan9303_write_switch_reg(chip, > LAN9303_BM_EGRSS_PORT_TYPE, val); Specific reason to use val then using LAN9303_BM_EGRSS_PORT_TYPE_SPECIAL_TAG_PORT0 like previous line? > @@ -644,6 +648,10 @@ static int lan9303_setup(struct dsa_switch *ds) > return -EINVAL; > } > > + ret = lan9303_setup_tagging(chip); > + if (ret) > + dev_err(chip->dev, "failed to setup port tagging %d\n", ret); > + Still move on when error happens? > ret = lan9303_separate_ports(chip); > if (ret) > dev_err(chip->dev, "failed to separate ports %d\n", ret); > -- > 2.11.0 - Woojung