From patchwork Mon Oct 12 15:20:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 7376161 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5838C9F1D5 for ; Mon, 12 Oct 2015 15:05:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97CD220734 for ; Mon, 12 Oct 2015 15:05:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C290208CA for ; Mon, 12 Oct 2015 15:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbbJLPFd (ORCPT ); Mon, 12 Oct 2015 11:05:33 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:11754 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752036AbbJLPF3 (ORCPT ); Mon, 12 Oct 2015 11:05:29 -0400 Received: from 172.24.1.51 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUB61523; Mon, 12 Oct 2015 23:05:12 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 23:05:01 +0800 From: John Garry To: CC: , , , , , , , , , John Garry Subject: [PATCH 09/25] scsi: hisi_sas: add phy SAS ADDR initialization Date: Mon, 12 Oct 2015 23:20:21 +0800 Message-ID: <1444663237-238302-10-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444663237-238302-1-git-send-email-john.garry@huawei.com> References: <1444663237-238302-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This SAS ID is chosen as Huawei IEEE id: 001882 Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_init.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_init.c b/drivers/scsi/hisi_sas/hisi_sas_init.c index 44fc524..c295c39 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_init.c +++ b/drivers/scsi/hisi_sas/hisi_sas_init.c @@ -283,6 +283,19 @@ err_out: return NULL; } +static void hisi_sas_init_add(struct hisi_hba *hisi_hba) +{ + u8 i; + + /* Huawei IEEE id (001882) */ + for (i = 0; i < hisi_hba->n_phy; i++) + hisi_hba->phy[i].dev_sas_addr = + cpu_to_be64(0x5001882016072015ULL); + + memcpy(hisi_hba->sas_addr, &hisi_hba->phy[0].dev_sas_addr, + SAS_ADDR_SIZE); +} + static int hisi_sas_probe(struct platform_device *pdev) { struct Scsi_Host *shost; @@ -339,6 +352,8 @@ static int hisi_sas_probe(struct platform_device *pdev) sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy; sha->sas_port[i] = &hisi_hba->port[i].sas_port; } + + hisi_sas_init_add(hisi_hba); rc = scsi_add_host(shost, &pdev->dev); if (rc) goto err_out_ha;