Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4353113pxb; Tue, 25 Jan 2022 08:37:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJy12Y3Uu5mZvUP8/sHxFNrXWOmXou02SODbJeXLSVc97xzzPu/ow/8qWEyC6fEqIU2I+CB4 X-Received: by 2002:a17:907:8a08:: with SMTP id sc8mr10342556ejc.362.1643128627340; Tue, 25 Jan 2022 08:37:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643128627; cv=none; d=google.com; s=arc-20160816; b=rTTkOKaE1o2KsO4LXZN0xnZgbhE/efT2tqbM0B73sfifAF5Q/u/1eZiGt9irRlV6uy BnyUWIEMY0ryTuX2X+yTqPXetqBZa31KL8qB3U4Bc61FrKAVugDpZVLr8IGJgfbRljns 61DQL75ocpVfZDri2+9PJZDuWwlOzxE34K9OmVgIAB/cChIzXsXqhymQPfrP6irN1BVZ ydY8igyvE8A1ubMI1AGW04h/ux5s/aPeKHQvpKmrQ5SQmi9pWuys7Pcl+TXzb5gz+afU AKTPCfMzSaUdC5CpocwtAi7J5csRCU4rPxKzfN7Yto30/FKk5ThRP+lHorRzKKUxPcbs prWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=R/61sYPB7MdG+DdsGoP6V6yvkfAif8uiugekgD+DiX0=; b=yqttkrB6oV9lHNK1kJ1AI26a2HdlZdwIf3RaGishJ29FWRQPQd9kZ675Uy9QxiYu/M wVQd0o8G9bsHYH4GrdBDzNwLmKm2rwdlhxEYUJw/R8LupoGXCMU3cRlwnxdfwwvCyzG0 Bm1MGsHUiKmWjDV/TCXi2UbkGQOJSupVr9TsQvH1u5GgT8eZMgMvowscgWsC5z/djIEb RnZ79WLuRoq3clp605yC5e9DEW6IUMKTJJVBoFRz7Qt9ISvvnQwwOSqxIAt5/1H2rgaw iNoa+brCySJL370pEckGOhff0YUdM7Az2ua0Jfg3HjhP9Yktf+Gq0inKePVl9z/yM2sO U+3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si1202566ejv.960.2022.01.25.08.36.38; Tue, 25 Jan 2022 08:37:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383171AbiAYLn7 (ORCPT + 99 others); Tue, 25 Jan 2022 06:43:59 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4500 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382389AbiAYLi6 (ORCPT ); Tue, 25 Jan 2022 06:38:58 -0500 Received: from fraeml702-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JjlGt32kGz6864m; Tue, 25 Jan 2022 19:38:30 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml702-chm.china.huawei.com (10.206.15.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Tue, 25 Jan 2022 12:38:52 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 11:38:48 +0000 From: John Garry To: , , , , , CC: , , , , , , , , John Garry Subject: [PATCH 08/16] scsi: libsas: Add sas_execute_ssp_tmf() Date: Tue, 25 Jan 2022 19:32:44 +0800 Message-ID: <1643110372-85470-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1643110372-85470-1-git-send-email-john.garry@huawei.com> References: <1643110372-85470-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a function to issue an SSP TMF. Add a temp prototype to keep make W=1 happy. Signed-off-by: John Garry --- drivers/scsi/libsas/sas_scsi_host.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 93ca6da63104..cfdf4a031be0 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -938,6 +938,11 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, task->dev = device; task->task_proto = device->tproto; + if (dev_is_sata(device)) { + } else { + memcpy(&task->ssp_task, parameter, para_len); + } + task->task_done = sas_task_internal_done; task->tmf = tmf; @@ -1023,6 +1028,21 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, return res; } +int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun, + struct sas_tmf_task *tmf); +int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun, + struct sas_tmf_task *tmf) +{ + struct sas_ssp_task ssp_task; + + if (!(device->tproto & SAS_PROTOCOL_SSP)) + return TMF_RESP_FUNC_ESUPP; + + memcpy(ssp_task.LUN, lun, 8); + + return sas_execute_tmf(device, &ssp_task, sizeof(ssp_task), -1, tmf); +} + /* * Tell an upper layer that it needs to initiate an abort for a given task. * This should only ever be called by an LLDD. -- 2.26.2