From nobody Wed Jul 19 01:20:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5J012g3nz4dbTs; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5J0129t8z4DKS; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=shsnryYdXbDbFrVaEardrfx+N4Njtn+nvhNIbCDKZqUTjfF/+0cDJ0nLkMZBWu6zDGZfvH mpmKFOVqXCdntxT0QNxokkvh5qex3LnI/nLw3gHS5V/rS4mV6kkVb3YTHmmjjmw30OyJ+E k5AUQ7ahgJfUV8eeTQEJ/EYAt7TAK8ujdIv9szzg3EhqUkjMkCSeQsg31LJdmDFSvqBwu+ fqCSG99YyjLibnajdtt9qrrlWpKtmosvDhnwFqDzTuPLtJKc4enP9hN2MrhdWy2CDqzZKw clJpmTk785sihDmWZZpQrczigzpTMWph52T1GkTSQwQs9f+UL3c8Ou6hwo/B+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=RZi/U2zrEfD8pleztQsfhDABlvPm9hRF30uNgcamSiRPMk/90cO7NNR88qdpUKOVIgp28y F/810uc5zVJZ4ciz9hwWzLrHUYXpY2KFxDgGuCOlFTaG3BE+/x+P3hqWoXh8UGWKEx29oP VhS0+fqdiNQ+F9u0S0ZjT+NX76kuIKHFHrDVa44Sj+ShC/lN/CK84iOd1KlCrT/lUurC5l sb1RtLcdnIoIyaoRhgxrv41K1h5ZZ3YuNV0Nf3AakYGBSGa7vFuhoZbNfalhD107FU+WhF lNrsGsQd3o+BdxEryLq+7VEujSx99DmEWb4k/9yrYf2CJ+dlh5f/zgvx1vHM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689729601; a=rsa-sha256; cv=none; b=YY6KuRYrmaYYgJEiW/GvkKntZOjwx4+YTgsg1CMAgDoReTroSJiwhdqVz57MOGPg9+Enir 3rt6AALqsJziaOLbTb+fIYxHIKXIEtBt6slcymT1VQLin6myxcsarxKnxRNt0V9pTTx0eW UWBitnLesoMkn9263Iw+LFwfVm1+lZlWXl6L+Pxpvi3mm4FNi5xGZN8oF9MUHCYUSrwgpK l8dDNQLXaf0GRVFGvUK9VIraFMOBYdYgUg1kL3wLWqfEkjhLn4jhptIp8GlSVcbzE2OLcW A/vfGzQWo09k57BY6vzcQlrpTkQ01Ts5jNR/kt/dYJ/PEHjPUWXgvMghlXZf+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5J011FkBzSKk; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J1K1O1011421; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J1K1mQ011397; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git) Date: Wed, 19 Jul 2023 01:20:01 GMT Message-Id: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Author: John Baldwin AuthorDate: 2023-07-19 01:19:27 +0000 Commit: John Baldwin CommitDate: 2023-07-19 01:19:27 +0000 cam: Move bus_dmamap_load_ccb into cam.c. This routine is specific to CAM and no longer assumes any internal bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem. Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41058 --- sys/cam/cam.c | 20 ++++++++++++++++++++ sys/kern/subr_bus_dma.c | 19 ------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/cam/cam.c b/sys/cam/cam.c index ce7dc81b3495..7d9d8602d009 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include +#include #include #include @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) panic("%s: flags 0x%X unimplemented", __func__, ccb_h->flags); } } + +int +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, + bus_dmamap_callback_t *callback, void *callback_arg, + int flags) +{ + struct ccb_hdr *ccb_h; + struct memdesc mem; + + ccb_h = &ccb->ccb_h; + if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { + callback(callback_arg, NULL, 0, 0); + return (0); + } + + mem = memdesc_ccb(ccb); + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, + flags)); +} #endif diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c index da7a2ee4cdc9..683b41d0047c 100644 --- a/sys/kern/subr_bus_dma.c +++ b/sys/kern/subr_bus_dma.c @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, return (error); } -int -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, - bus_dmamap_callback_t *callback, void *callback_arg, - int flags) -{ - struct ccb_hdr *ccb_h; - struct memdesc mem; - - ccb_h = &ccb->ccb_h; - if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { - callback(callback_arg, NULL, 0, 0); - return (0); - } - - mem = memdesc_ccb(ccb); - return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, - flags)); -} - int bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, bus_dmamap_callback_t *callback, void *callback_arg,