Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp109529pxm; Tue, 22 Feb 2022 07:14:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJztnBYDfsriXmBSvFoKK3y39+iY8v0MfrUAieIep0jIaw2O1i8zF5pdCUSER/EeyrQp+v0c X-Received: by 2002:a17:906:f293:b0:6b6:bc93:f01f with SMTP id gu19-20020a170906f29300b006b6bc93f01fmr18373574ejb.743.1645542884708; Tue, 22 Feb 2022 07:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645542884; cv=none; d=google.com; s=arc-20160816; b=XGF0G0u5AixTyY6fcDtqTtSX3mvas+kDU6zUFuxTufmtcFdoeMf8DSiDh7dFADBpXw flDvY+awe7N+TDZ3yu7u2JlL8xw1hFisA3v5x09KR4c65N9k3WLI5RtJxUKKYWLPNp9D GHCKl+9imDTmCsrSUfj5+taG/slnjaqNka3NKyuzCJc6NHIyoxDg5JTAorNv8GVOjHpy OhVMrI1uh1W0OxqzHoT2fNQHABEvTy2Lbp3/87rhuF5u9UURQF6mfTXxqHQ1gE33/xFX h+3tN89uyh17tMeKhisleiYMqz8LrWfTW6nMJ1oR6diacWe2aMQ+ZIIPlT5RNAV6pVAI e8oQ== 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=dFdKV9Rz/7pN6g89qfR2MWInZ+0RtcAmB7edxmcqrmw=; b=mtTYwuormXN7n+qxY7rRKae8dp4UHGBWd/KbKDM6QWGpjVejNY2h6KnDGbTq8wjQHr KCbQpEv+i+jN8lkhupOs2u+9jelpzOSHrz0OG4tahW657SV40dbq6iAOMalVf8bSuK1B pPr2W/ZSS7yyBSkiigG2mryt9seHAOaEkVvP5rLUHqiQJhimGUmBTUGfz6ume6aKd0Mb iafCyjJ0yW1Kf0jsDaewyb+iOqENlLXN+T6VJTwKZIeb3xwU5uejYHtPLsCF2RYUZECu 1cpdlTtNGadOjBll85GRBvbLhfX4OXH5bLU2LYLfxfZXIo8wF+cua9pRdESi30qIWrc1 zR/g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5si10140971ejn.517.2022.02.22.07.14.21; Tue, 22 Feb 2022 07:14:44 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232054AbiBVNAA (ORCPT + 99 others); Tue, 22 Feb 2022 08:00:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbiBVM5w (ORCPT ); Tue, 22 Feb 2022 07:57:52 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFEEAB45B; Tue, 22 Feb 2022 04:57:12 -0800 (PST) Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K2zbG4J3Yz67KmH; Tue, 22 Feb 2022 20:52:26 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Feb 2022 13:57:11 +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, 22 Feb 2022 12:57:07 +0000 From: John Garry To: , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v3 10/18] scsi: libsas: Add sas_execute_ssp_tmf() Date: Tue, 22 Feb 2022 20:50:51 +0800 Message-ID: <1645534259-27068-11-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1645534259-27068-1-git-send-email-john.garry@huawei.com> References: <1645534259-27068-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: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 a function to issue an SSP TMF. Add a temp prototype to keep make W=1 happy. Signed-off-by: John Garry Tested-by: Yihang Li Tested-by: Damien Le Moal --- drivers/scsi/libsas/sas_scsi_host.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index d04002180be3..af2dd95a2b28 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -937,6 +937,9 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, task->dev = device; task->task_proto = device->tproto; + if (!dev_is_sata(device)) + memcpy(&task->ssp_task, parameter, para_len); + task->task_done = sas_task_internal_done; task->tmf = tmf; @@ -1022,6 +1025,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