Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1528923rwl; Wed, 12 Apr 2023 14:32:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZlbdxV5toMIuAVaQ8+f9xwQqIpCxPfRPPdn3EWqg7t8nMS9DUph7wpcmTOv0/ai7e4GKFg X-Received: by 2002:aa7:d3d1:0:b0:4fb:953d:c3d0 with SMTP id o17-20020aa7d3d1000000b004fb953dc3d0mr127564edr.20.1681335173738; Wed, 12 Apr 2023 14:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681335173; cv=none; d=google.com; s=arc-20160816; b=j1DzPHMCBvw+r/7B/loTjQLaQGWWmPXuip6hfrAFZDqKnd3cuydPykxR0yYgUWxnVI dARmyIQWc/m6J+pGP/z7rYUc0wS4FsgPF6LjgIKHDZJW2B5kYJNtGigynFHRHrFgUopm L9K09WjnHlR/RcuoAQCdaenF9edXPqgWahf6pGatRzNHt3w3oR3gZ0ECHmdJ0f5mxsdL 2Fe2tt1E9tMyi57Pai3XSUQvFtrrPN6rcG795IfxlNAItwFHlToiSlNqwAPSsfhWwCrf Uu8kReptNjJwqS472UNsrV5pJZBdbssoKmYDaIZEJQLfldX/a1yM4WsTtR/pjFtyrmWD yaww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qp6LyIaTjuBGZ4eQdu84T77cz5sFNOTq+6H0iaPWSIo=; b=eycv6ke0DjMCnDjFp1qnxDckpwh1RvxRMG6g4ttsQbjdpJzwP36ZkeCiRAlPSepr2K mN9hCfdDMpDfHP6hWGzV0huiPNeWcaumayRWVZN6t7w38N/o5fA+DsPYe5cEF5xx/TOJ g6npUeQXRJgRrNw2+rnVnR1HoHguVUZet0GkSJh1LanbNB6PFHkB1QTOIJYw67ykFYiU +XYLEVKsHeC8B3tgAmBpBqOhmdvXcrQfg3JhP4BYpgEUozeCPqkPHjm4C+0nIWM0ieQF 1yBgFawch9VHoM5t9Yg+jv2zH8P2Oe/v8z1z/POPuxwAX2MSTdiC8zbnXEWryOh54t6G V7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=U+rLnvmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020aa7d54c000000b00504921b0826si3353019edr.314.2023.04.12.14.32.29; Wed, 12 Apr 2023 14:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=U+rLnvmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjDLV3a (ORCPT + 99 others); Wed, 12 Apr 2023 17:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbjDLV3Y (ORCPT ); Wed, 12 Apr 2023 17:29:24 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B9297EC1; Wed, 12 Apr 2023 14:29:19 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id by8so13157137ljb.13; Wed, 12 Apr 2023 14:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681334958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qp6LyIaTjuBGZ4eQdu84T77cz5sFNOTq+6H0iaPWSIo=; b=U+rLnvmAKOQNiK3Ab8LtIRiH+ieLN/gC1CsMYe3pl996C9JvK1LbXg2npsOx7mZTds OgftBb1HigpM71CRbeyBo6L9B/v58rp6GQhQvSfBma8O69e8K7nXhaKhfd6MrKK6USdb Na0pTQi4GqDuNCwxFjWQqcHAmdVVfQbDLNZnMR1IxXmJifqiU9UqDaOpzqYlcSPETrMS 51b/tT/389zSyIos+o7mt0NAFTHlkprcf/7EpbTU3RVKvJOUgucS/5aQADUTjldWoZFJ 5E6wco7U95XgEQCeh+lF6qBwwOlkM6a7ZOVeyTO8fUmVTQ+PKcnohH7zlsHly9TQR4/X dm/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681334958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qp6LyIaTjuBGZ4eQdu84T77cz5sFNOTq+6H0iaPWSIo=; b=lP4tr5vKW2blERy9tL5fdmXK6x4OyBBV82JRAh5lZe/Sj6ZmYoGJh+n+Pjb8lF65D5 MK6EquGJA8cwkmX+sUx1fXSFVpd4QkaXFoomtE9zzinP6oOU7vqb3aWZEkvXJ7PPhcah FASXHjB1NONqvaUn2YkzXvN4lEEtOViozTOs5TA83dVCNXXfLmEEIajId7f02GRBDtft wy5ndFN82p0HEq4YbEDC/X69PBo1vLHw5tevFREVRLZY3qVJ1fnaD9e3prFgKY/uL++/ BosqNqlTwqvndjXVweNTIn76M5xHQSuaH2Og2QRcFjwjP1cfEnIAUqwWpUUqWtAVE/Y6 Mxfw== X-Gm-Message-State: AAQBX9cfuw7Cbj9utzgK0RLNVqlsdaW836I/o10nooSEHiXYXhrRg2vf KG1wwe2F3LpUhPf6wK6XJGQ= X-Received: by 2002:a2e:7006:0:b0:2a7:6f97:51bb with SMTP id l6-20020a2e7006000000b002a76f9751bbmr24003ljc.31.1681334958253; Wed, 12 Apr 2023 14:29:18 -0700 (PDT) Received: from localhost.localdomain (93-80-67-75.broadband.corbina.ru. [93.80.67.75]) by smtp.googlemail.com with ESMTPSA id p14-20020a2e804e000000b002a7758b13c9sm1882481ljg.52.2023.04.12.14.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 14:29:17 -0700 (PDT) From: Ivan Mikhaylov To: Samuel Mendoza-Jonas , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Mikhaylov Subject: [PATCH 4/4] net/ncsi: add shift MAC address property Date: Thu, 13 Apr 2023 00:29:05 +0000 Message-Id: <20230413002905.5513-5-fr0st61te@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230413002905.5513-1-fr0st61te@gmail.com> References: <20230413002905.5513-1-fr0st61te@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the shift MAC address property for GMA command which provides which shift should be used but keep old one values for backward compatibility. Signed-off-by: Ivan Mikhaylov --- net/ncsi/ncsi-rsp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 069c2659074b..1f108db34d85 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include @@ -616,9 +618,12 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id) { struct ncsi_dev_priv *ndp = nr->ndp; struct net_device *ndev = ndp->ndev.dev; + struct platform_device *pdev; struct ncsi_rsp_oem_pkt *rsp; struct sockaddr saddr; u32 mac_addr_off = 0; + s32 shift_mac_addr = 0; + u64 mac_addr; int ret = 0; /* Get the response header */ @@ -635,7 +640,17 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id) memcpy(saddr.sa_data, &rsp->data[mac_addr_off], ETH_ALEN); if (mfr_id == NCSI_OEM_MFR_BCM_ID || mfr_id == NCSI_OEM_MFR_INTEL_ID) - eth_addr_inc((u8 *)saddr.sa_data); + shift_mac_addr = 1; + + pdev = to_platform_device(ndev->dev.parent); + if (pdev) + of_property_read_s32(pdev->dev.of_node, + "mac-address-increment", &shift_mac_addr); + + /* Increase mac address by shift value for BMC's address */ + mac_addr = ether_addr_to_u64((u8 *)saddr.sa_data); + mac_addr += shift_mac_addr; + u64_to_ether_addr(mac_addr, (u8 *)saddr.sa_data); if (!is_valid_ether_addr((const u8 *)saddr.sa_data)) return -ENXIO; -- 2.40.0