From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: [PATCH net-next 11/13] net: dsa: mv88e6xxx: link mv88e6xxx_port to mv88e6xxx_chip Date: Thu, 9 Aug 2018 15:38:47 +0200 Message-ID: <1533821929-20071-12-git-send-email-andrew@lunn.ch> References: <1533821929-20071-1-git-send-email-andrew@lunn.ch> Cc: netdev , Russell King , Florian Fainelli , nikita.yoush@cogentembedded.com, Chris Healy , marek.behun@nic.cz, Andrew Lunn To: David Miller Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:59877 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730090AbeHIQLE (ORCPT ); Thu, 9 Aug 2018 12:11:04 -0400 In-Reply-To: <1533821929-20071-1-git-send-email-andrew@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: An up coming change will register interrupts for individual switch ports, using the mv88e6xxx_port as the interrupt context information. Add members to the mv88e6xxx_port structure so we can link it back to the mv88e6xxx_chip member the port belongs to and the port number of the port. Signed-off-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 3 +++ drivers/net/dsa/mv88e6xxx/chip.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 66e0281604df..5845cbf7f096 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2173,6 +2173,9 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) int err; u16 reg; + chip->ports[port].chip = chip; + chip->ports[port].port = port; + /* MAC Forcing register: don't force link, speed, duplex or flow control * state to any particular values on physical ports, but force the CPU * port and all DSA ports to their maximum bandwidth and full duplex. diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 08c74c88dbde..577398fe36df 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -191,6 +191,8 @@ struct mv88e6xxx_port_hwtstamp { }; struct mv88e6xxx_port { + struct mv88e6xxx_chip *chip; + int port; u64 serdes_stats[2]; u64 atu_member_violation; u64 atu_miss_violation; -- 2.18.0