From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Oliver Neukum <oneukum@suse.com>, Felipe Balbi <balbi@kernel.org>
Cc: Yan Xinyu <sdlyyxy@bupt.edu.cn>,
linux-staging@lists.linux.dev, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH 6/7] USB: gadget: f_acm: use CDC defines
Date: Mon, 25 Jul 2022 09:58:40 +0200 [thread overview]
Message-ID: <20220725075841.1187-7-johan@kernel.org> (raw)
In-Reply-To: <20220725075841.1187-1-johan@kernel.org>
Use the new CDC control-line and serial-state defines.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/gadget/function/f_acm.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
index 411eb489e0ff..cb523f118f04 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -57,18 +57,8 @@ struct f_acm {
/* SetControlLineState request -- CDC 1.1 section 6.2.14 (INPUT) */
u16 port_handshake_bits;
-#define ACM_CTRL_RTS (1 << 1) /* unused with full duplex */
-#define ACM_CTRL_DTR (1 << 0) /* host is ready for data r/w */
-
/* SerialState notification -- CDC 1.1 section 6.3.5 (OUTPUT) */
u16 serial_state;
-#define ACM_CTRL_OVERRUN (1 << 6)
-#define ACM_CTRL_PARITY (1 << 5)
-#define ACM_CTRL_FRAMING (1 << 4)
-#define ACM_CTRL_RI (1 << 3)
-#define ACM_CTRL_BRK (1 << 2)
-#define ACM_CTRL_DSR (1 << 1)
-#define ACM_CTRL_DCD (1 << 0)
};
static inline struct f_acm *func_to_acm(struct usb_function *f)
@@ -387,7 +377,7 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
value = 0;
/* FIXME we should not allow data to flow until the
- * host sets the ACM_CTRL_DTR bit; and when it clears
+ * host sets the USB_CDC_CTRL_DTR bit; and when it clears
* that bit, we should return to that no-flow state.
*/
acm->port_handshake_bits = w_value;
@@ -585,7 +575,7 @@ static void acm_connect(struct gserial *port)
{
struct f_acm *acm = port_to_acm(port);
- acm->serial_state |= ACM_CTRL_DSR | ACM_CTRL_DCD;
+ acm->serial_state |= USB_CDC_SERIAL_STATE_DSR | USB_CDC_SERIAL_STATE_DCD;
acm_notify_serial_state(acm);
}
@@ -593,7 +583,7 @@ static void acm_disconnect(struct gserial *port)
{
struct f_acm *acm = port_to_acm(port);
- acm->serial_state &= ~(ACM_CTRL_DSR | ACM_CTRL_DCD);
+ acm->serial_state &= ~(USB_CDC_SERIAL_STATE_DSR | USB_CDC_SERIAL_STATE_DCD);
acm_notify_serial_state(acm);
}
@@ -603,9 +593,9 @@ static int acm_send_break(struct gserial *port, int duration)
u16 state;
state = acm->serial_state;
- state &= ~ACM_CTRL_BRK;
+ state &= ~USB_CDC_SERIAL_STATE_BREAK;
if (duration)
- state |= ACM_CTRL_BRK;
+ state |= USB_CDC_SERIAL_STATE_BREAK;
acm->serial_state = state;
return acm_notify_serial_state(acm);
--
2.35.1
next prev parent reply other threads:[~2022-07-25 8:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 7:58 [PATCH 0/7] USB: cdc: add control and state defines Johan Hovold
2022-07-25 7:58 ` [PATCH 1/7] USB: cdc: add control-signal defines Johan Hovold
2022-07-25 9:15 ` Oliver Neukum
2022-07-25 7:58 ` [PATCH 2/7] USB: cdc: add serial-state defines Johan Hovold
2022-07-25 9:17 ` Oliver Neukum
2022-07-25 7:58 ` [PATCH 3/7] USB: cdc-acm: use CDC control-line defines Johan Hovold
2022-07-25 9:18 ` Oliver Neukum
2022-07-25 7:58 ` [PATCH 4/7] USB: cdc-acm: use CDC serial-state defines Johan Hovold
2022-07-25 9:20 ` Oliver Neukum
2022-07-25 7:58 ` [PATCH 5/7] staging: gdm724x: drop unused CDC defines Johan Hovold
2022-07-25 7:58 ` Johan Hovold [this message]
2022-07-25 7:58 ` [PATCH 7/7] USB: serial: usb_wwan: replace DTR/RTS magic numbers with macros Johan Hovold
2022-07-25 8:52 ` [PATCH 0/7] USB: cdc: add control and state defines Greg Kroah-Hartman
2022-07-25 8:54 ` Johan Hovold
2022-07-25 14:38 ` Yan Xinyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220725075841.1187-7-johan@kernel.org \
--to=johan@kernel.org \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=sdlyyxy@bupt.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.