From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D14C66A566; Wed, 22 Sep 2021 13:02:38 +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 4HDz3d31cDz3DRZ; Wed, 22 Sep 2021 13:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D582418320; Wed, 22 Sep 2021 13:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18MD2aMC013157; Wed, 22 Sep 2021 13:02:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2ah1013156; Wed, 22 Sep 2021 13:02:36 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:36 GMT Message-Id: <202109221302.18MD2ah1013156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e4cbb47700bc - stable/13 - Cleanup unused USB enums. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4cbb47700bc91538b69b78c0b5009dfae69176b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2021 13:02:38 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e4cbb47700bc91538b69b78c0b5009dfae69176b commit e4cbb47700bc91538b69b78c0b5009dfae69176b Author: Hans Petter Selasky AuthorDate: 2021-07-15 10:38:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 Cleanup unused USB enums. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/usb_transfer.h | 117 +++------------------------------------------ 1 file changed, 7 insertions(+), 110 deletions(-) diff --git a/sys/dev/usb/usb_transfer.h b/sys/dev/usb/usb_transfer.h index c6b97e1ab3c5..0dd750c33c0d 100644 --- a/sys/dev/usb/usb_transfer.h +++ b/sys/dev/usb/usb_transfer.h @@ -30,119 +30,16 @@ #define _USB_TRANSFER_H_ /* - * Definition of internal USB transfer states: - * =========================================== + * A few words about USB transfer states: + * ====================================== * - * The main reason there are many USB states is that we are allowed to - * cancel USB transfers, then start the USB transfer again and that - * this state transaction cannot always be done in a single atomic - * operation without blocking the calling thread. One reason for this - * is that the USB hardware sometimes needs to wait for DMA - * controllers to finish which is done asynchronously and grows the - * statemachine. - * - * When extending the following statemachine there are basically two - * things you should think about: Which states should be executed or - * modified in case of USB transfer stop and which states should be - * executed or modified in case of USB transfer start. Also respect - * the "can_cancel_immed" flag which basically tells if you can go - * directly from a wait state to the cancelling states. + * USB transfers can have multiple states, because they can be + * cancelled and started again and this cannot always be done + * atomically under a mutex. One reason for this is that the USB + * hardware sometimes needs to wait for DMA controllers to finish + * which is done asynchronously and grows the statemachine. */ -enum { - /* XFER start execute state */ - - /* USB_ST_SETUP = 0 (already defined) */ - - /* XFER transferred execute state */ - - /* USB_ST_TRANSFERRED = 1 (already defined) */ - - /* XFER error execute state */ - - /* USB_ST_ERROR = 2 (already defined) */ - - /* XFER restart after error execute state */ - - USB_ST_RESTART = 8, - - /* XFER transfer idle state */ - - USB_ST_WAIT_SETUP, - - /* Other XFER execute states */ - - USB_ST_PIPE_OPEN = 16, - USB_ST_PIPE_OPEN_ERROR, - USB_ST_PIPE_OPEN_RESTART, - - USB_ST_BDMA_LOAD, - USB_ST_BDMA_LOAD_ERROR, - USB_ST_BDMA_LOAD_RESTART, - - USB_ST_IVAL_DLY, - USB_ST_IVAL_DLY_ERROR, - USB_ST_IVAL_DLY_RESTART, - - USB_ST_PIPE_STALL, - USB_ST_PIPE_STALL_ERROR, - USB_ST_PIPE_STALL_RESTART, - - USB_ST_ENTER, - USB_ST_ENTER_ERROR, - USB_ST_ENTER_RESTART, - - USB_ST_START, - USB_ST_START_ERROR, - USB_ST_START_RESTART, - - USB_ST_PIPE_CLOSE, - USB_ST_PIPE_CLOSE_ERROR, - USB_ST_PIPE_CLOSE_RESTART, - - USB_ST_BDMA_DLY, - USB_ST_BDMA_DLY_ERROR, - USB_ST_BDMA_DLY_RESTART, - - /* XFER transfer wait states */ - - USB_ST_WAIT_PIPE_OPEN = 64, - USB_ST_WAIT_PIPE_OPEN_ERROR, - USB_ST_WAIT_PIPE_OPEN_RESTART, - - USB_ST_WAIT_BDMA_LOAD, - USB_ST_WAIT_BDMA_LOAD_ERROR, - USB_ST_WAIT_BDMA_LOAD_RESTART, - - USB_ST_WAIT_IVAL_DLY, - USB_ST_WAIT_IVAL_DLY_ERROR, - USB_ST_WAIT_IVAL_DLY_RESTART, - - USB_ST_WAIT_PIPE_STALL, - USB_ST_WAIT_PIPE_STALL_ERROR, - USB_ST_WAIT_PIPE_STALL_RESTART, - - USB_ST_WAIT_ENTER, - USB_ST_WAIT_ENTER_ERROR, - USB_ST_WAIT_ENTER_RESTART, - - USB_ST_WAIT_START, - USB_ST_WAIT_START_ERROR, - USB_ST_WAIT_START_RESTART, - - USB_ST_WAIT_PIPE_CLOSE, - USB_ST_WAIT_PIPE_CLOSE_ERROR, - USB_ST_WAIT_PIPE_CLOSE_RESTART, - - USB_ST_WAIT_BDMA_DLY, - USB_ST_WAIT_BDMA_DLY_ERROR, - USB_ST_WAIT_BDMA_DLY_RESTART, - - USB_ST_WAIT_TRANSFERRED, - USB_ST_WAIT_TRANSFERRED_ERROR, - USB_ST_WAIT_TRANSFERRED_RESTART, -}; - /* * The following structure defines the messages that is used to signal * the "done_p" USB process.