From patchwork Mon Oct 26 14:14:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 55551 Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1223665lbq; Mon, 26 Oct 2015 07:06:39 -0700 (PDT) X-Received: by 10.66.216.1 with SMTP id om1mr13292449pac.124.1445868399535; Mon, 26 Oct 2015 07:06:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qk3si3757713pbb.256.2015.10.26.07.06.39; Mon, 26 Oct 2015 07:06:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932460AbbJZOGh (ORCPT + 28 others); Mon, 26 Oct 2015 10:06:37 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:6732 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932225AbbJZOBw (ORCPT ); Mon, 26 Oct 2015 10:01:52 -0400 Received: from 172.24.1.47 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BPR32589; Mon, 26 Oct 2015 22:01:39 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Mon, 26 Oct 2015 22:01:27 +0800 From: John Garry To: , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v2 14/32] scsi: hisi_sas: add hisi sas device type Date: Mon, 26 Oct 2015 22:14:45 +0800 Message-ID: <1445868903-183817-15-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445868903-183817-1-git-send-email-john.garry@huawei.com> References: <1445868903-183817-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.562E3243.036B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 32b44fbf2cc19a119c4ff25925019295 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Include initialisation. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 12 ++++++++++++ drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++++ 2 files changed, 18 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 424d693..f2757cd 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -38,6 +38,11 @@ #define HISI_SAS_NAME_LEN 32 #define HISI_SAS_CTRL_REG_CNT 5 + +enum dev_status { + HISI_SAS_DEV_NORMAL, + HISI_SAS_DEV_EH, +}; struct hisi_sas_phy { struct asd_sas_phy sas_phy; u64 dev_sas_addr; @@ -52,6 +57,12 @@ struct hisi_sas_cq { int id; }; +struct hisi_sas_device { + enum sas_device_type dev_type; + u64 device_id; + u8 dev_status; +}; + struct hisi_sas_slot { }; @@ -89,6 +100,7 @@ struct hisi_hba { char *int_names; struct dma_pool *sge_page_pool; + struct hisi_sas_device devices[HISI_SAS_MAX_DEVICES]; struct dma_pool *command_table_pool; struct dma_pool *status_buffer_pool; struct hisi_sas_cmd_hdr *cmd_hdr[HISI_SAS_MAX_QUEUES]; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index fb83233..57fd9e0 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -58,6 +58,12 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost) struct device *dev = &pdev->dev; + for (i = 0; i < HISI_SAS_MAX_DEVICES; i++) { + hisi_hba->devices[i].dev_type = SAS_PHY_UNUSED; + hisi_hba->devices[i].device_id = i; + hisi_hba->devices[i].dev_status = HISI_SAS_DEV_NORMAL; + } + for (i = 0; i < hisi_hba->queue_count; i++) { struct hisi_sas_cq *cq = &hisi_hba->cq[i];