summaryrefslogtreecommitdiff
path: root/sys/dev/usb/serial/usb_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/serial/usb_serial.c')
-rw-r--r--sys/dev/usb/serial/usb_serial.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c
index 99ec4d6b9927..b5222708a7a6 100644
--- a/sys/dev/usb/serial/usb_serial.c
+++ b/sys/dev/usb/serial/usb_serial.c
@@ -101,15 +101,15 @@ static usb2_proc_callback_t usb2_com_cfg_param;
static uint8_t usb2_com_units_alloc(uint32_t, uint32_t *);
static void usb2_com_units_free(uint32_t, uint32_t);
-static int usb2_com_attach_tty(struct usb2_com_softc *, uint32_t);
-static void usb2_com_detach_tty(struct usb2_com_softc *);
-static void usb2_com_queue_command(struct usb2_com_softc *,
+static int usb2_com_attach_tty(struct ucom_softc *, uint32_t);
+static void usb2_com_detach_tty(struct ucom_softc *);
+static void usb2_com_queue_command(struct ucom_softc *,
usb2_proc_callback_t *, struct termios *pt,
- struct usb2_proc_msg *t0, struct usb2_proc_msg *t1);
-static void usb2_com_shutdown(struct usb2_com_softc *);
-static void usb2_com_break(struct usb2_com_softc *, uint8_t);
-static void usb2_com_dtr(struct usb2_com_softc *, uint8_t);
-static void usb2_com_rts(struct usb2_com_softc *, uint8_t);
+ struct usb_proc_msg *t0, struct usb_proc_msg *t1);
+static void usb2_com_shutdown(struct ucom_softc *);
+static void usb2_com_break(struct ucom_softc *, uint8_t);
+static void usb2_com_dtr(struct ucom_softc *, uint8_t);
+static void usb2_com_rts(struct ucom_softc *, uint8_t);
static tsw_open_t usb2_com_open;
static tsw_close_t usb2_com_close;
@@ -215,9 +215,9 @@ usb2_com_units_free(uint32_t root_unit, uint32_t sub_units)
* before calling into the ucom-layer!
*/
int
-usb2_com_attach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
+usb2_com_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
uint32_t sub_units, void *parent,
- const struct usb2_com_callback *callback, struct mtx *mtx)
+ const struct ucom_callback *callback, struct mtx *mtx)
{
uint32_t n;
uint32_t root_unit;
@@ -265,7 +265,7 @@ usb2_com_attach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
* the structure pointed to by "ssc" and "sc" is zero.
*/
void
-usb2_com_detach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
+usb2_com_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
uint32_t sub_units)
{
uint32_t n;
@@ -287,7 +287,7 @@ usb2_com_detach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
}
static int
-usb2_com_attach_tty(struct usb2_com_softc *sc, uint32_t sub_units)
+usb2_com_attach_tty(struct ucom_softc *sc, uint32_t sub_units)
{
struct tty *tp;
int error = 0;
@@ -335,7 +335,7 @@ done:
}
static void
-usb2_com_detach_tty(struct usb2_com_softc *sc)
+usb2_com_detach_tty(struct ucom_softc *sc)
{
struct tty *tp = sc->sc_tty;
@@ -374,12 +374,12 @@ usb2_com_detach_tty(struct usb2_com_softc *sc)
}
static void
-usb2_com_queue_command(struct usb2_com_softc *sc,
+usb2_com_queue_command(struct ucom_softc *sc,
usb2_proc_callback_t *fn, struct termios *pt,
- struct usb2_proc_msg *t0, struct usb2_proc_msg *t1)
+ struct usb_proc_msg *t0, struct usb_proc_msg *t1)
{
- struct usb2_com_super_softc *ssc = sc->sc_super;
- struct usb2_com_param_task *task;
+ struct ucom_super_softc *ssc = sc->sc_super;
+ struct ucom_param_task *task;
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -392,7 +392,7 @@ usb2_com_queue_command(struct usb2_com_softc *sc,
* "sc_mtx" mutex. It is safe to update fields in the message
* structure after that the message got queued.
*/
- task = (struct usb2_com_param_task *)
+ task = (struct ucom_param_task *)
usb2_proc_msignal(&ssc->sc_tq, t0, t1);
/* Setup callback and softc pointers */
@@ -421,7 +421,7 @@ usb2_com_queue_command(struct usb2_com_softc *sc,
}
static void
-usb2_com_shutdown(struct usb2_com_softc *sc)
+usb2_com_shutdown(struct ucom_softc *sc)
{
struct tty *tp = sc->sc_tty;
@@ -443,19 +443,19 @@ usb2_com_shutdown(struct usb2_com_softc *sc)
* else: taskqueue is draining or gone
*/
uint8_t
-usb2_com_cfg_is_gone(struct usb2_com_softc *sc)
+usb2_com_cfg_is_gone(struct ucom_softc *sc)
{
- struct usb2_com_super_softc *ssc = sc->sc_super;
+ struct ucom_super_softc *ssc = sc->sc_super;
return (usb2_proc_is_gone(&ssc->sc_tq));
}
static void
-usb2_com_cfg_start_transfers(struct usb2_proc_msg *_task)
+usb2_com_cfg_start_transfers(struct usb_proc_msg *_task)
{
- struct usb2_com_cfg_task *task =
- (struct usb2_com_cfg_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_cfg_task *task =
+ (struct ucom_cfg_task *)_task;
+ struct ucom_softc *sc = task->sc;
if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) {
return;
@@ -477,7 +477,7 @@ usb2_com_cfg_start_transfers(struct usb2_proc_msg *_task)
}
static void
-usb2_com_start_transfers(struct usb2_com_softc *sc)
+usb2_com_start_transfers(struct ucom_softc *sc)
{
if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
return;
@@ -495,11 +495,11 @@ usb2_com_start_transfers(struct usb2_com_softc *sc)
}
static void
-usb2_com_cfg_open(struct usb2_proc_msg *_task)
+usb2_com_cfg_open(struct usb_proc_msg *_task)
{
- struct usb2_com_cfg_task *task =
- (struct usb2_com_cfg_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_cfg_task *task =
+ (struct ucom_cfg_task *)_task;
+ struct ucom_softc *sc = task->sc;
DPRINTF("\n");
@@ -523,7 +523,7 @@ usb2_com_cfg_open(struct usb2_proc_msg *_task)
static int
usb2_com_open(struct tty *tp)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
int error;
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -580,11 +580,11 @@ usb2_com_open(struct tty *tp)
}
static void
-usb2_com_cfg_close(struct usb2_proc_msg *_task)
+usb2_com_cfg_close(struct usb_proc_msg *_task)
{
- struct usb2_com_cfg_task *task =
- (struct usb2_com_cfg_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_cfg_task *task =
+ (struct ucom_cfg_task *)_task;
+ struct ucom_softc *sc = task->sc;
DPRINTF("\n");
@@ -600,7 +600,7 @@ usb2_com_cfg_close(struct usb2_proc_msg *_task)
static void
usb2_com_close(struct tty *tp)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -626,7 +626,7 @@ usb2_com_close(struct tty *tp)
static int
usb2_com_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
int error;
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -660,7 +660,7 @@ usb2_com_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
static int
usb2_com_modem(struct tty *tp, int sigon, int sigoff)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
uint8_t onoff;
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -712,11 +712,11 @@ usb2_com_modem(struct tty *tp, int sigon, int sigoff)
}
static void
-usb2_com_cfg_line_state(struct usb2_proc_msg *_task)
+usb2_com_cfg_line_state(struct usb_proc_msg *_task)
{
- struct usb2_com_cfg_task *task =
- (struct usb2_com_cfg_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_cfg_task *task =
+ (struct ucom_cfg_task *)_task;
+ struct ucom_softc *sc = task->sc;
uint8_t notch_bits;
uint8_t any_bits;
uint8_t prev_value;
@@ -771,7 +771,7 @@ usb2_com_cfg_line_state(struct usb2_proc_msg *_task)
}
static void
-usb2_com_line_state(struct usb2_com_softc *sc,
+usb2_com_line_state(struct ucom_softc *sc,
uint8_t set_bits, uint8_t clear_bits)
{
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -795,7 +795,7 @@ usb2_com_line_state(struct usb2_com_softc *sc,
}
static void
-usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff)
+usb2_com_break(struct ucom_softc *sc, uint8_t onoff)
{
DPRINTF("onoff = %d\n", onoff);
@@ -806,7 +806,7 @@ usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff)
}
static void
-usb2_com_dtr(struct usb2_com_softc *sc, uint8_t onoff)
+usb2_com_dtr(struct ucom_softc *sc, uint8_t onoff)
{
DPRINTF("onoff = %d\n", onoff);
@@ -817,7 +817,7 @@ usb2_com_dtr(struct usb2_com_softc *sc, uint8_t onoff)
}
static void
-usb2_com_rts(struct usb2_com_softc *sc, uint8_t onoff)
+usb2_com_rts(struct ucom_softc *sc, uint8_t onoff)
{
DPRINTF("onoff = %d\n", onoff);
@@ -828,11 +828,11 @@ usb2_com_rts(struct usb2_com_softc *sc, uint8_t onoff)
}
static void
-usb2_com_cfg_status_change(struct usb2_proc_msg *_task)
+usb2_com_cfg_status_change(struct usb_proc_msg *_task)
{
- struct usb2_com_cfg_task *task =
- (struct usb2_com_cfg_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_cfg_task *task =
+ (struct ucom_cfg_task *)_task;
+ struct ucom_softc *sc = task->sc;
struct tty *tp;
uint8_t new_msr;
uint8_t new_lsr;
@@ -875,7 +875,7 @@ usb2_com_cfg_status_change(struct usb2_proc_msg *_task)
}
void
-usb2_com_status_change(struct usb2_com_softc *sc)
+usb2_com_status_change(struct ucom_softc *sc)
{
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -890,11 +890,11 @@ usb2_com_status_change(struct usb2_com_softc *sc)
}
static void
-usb2_com_cfg_param(struct usb2_proc_msg *_task)
+usb2_com_cfg_param(struct usb_proc_msg *_task)
{
- struct usb2_com_param_task *task =
- (struct usb2_com_param_task *)_task;
- struct usb2_com_softc *sc = task->sc;
+ struct ucom_param_task *task =
+ (struct ucom_param_task *)_task;
+ struct ucom_softc *sc = task->sc;
if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) {
return;
@@ -912,7 +912,7 @@ usb2_com_cfg_param(struct usb2_proc_msg *_task)
static int
usb2_com_param(struct tty *tp, struct termios *t)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
uint8_t opened;
int error;
@@ -986,7 +986,7 @@ done:
static void
usb2_com_outwakeup(struct tty *tp)
{
- struct usb2_com_softc *sc = tty_softc(tp);
+ struct ucom_softc *sc = tty_softc(tp);
mtx_assert(sc->sc_mtx, MA_OWNED);
@@ -1007,10 +1007,10 @@ usb2_com_outwakeup(struct tty *tp)
* Else: Data is available.
*------------------------------------------------------------------------*/
uint8_t
-usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
+usb2_com_get_data(struct ucom_softc *sc, struct usb_page_cache *pc,
uint32_t offset, uint32_t len, uint32_t *actlen)
{
- struct usb2_page_search res;
+ struct usb_page_search res;
struct tty *tp = sc->sc_tty;
uint32_t cnt;
uint32_t offset_orig;
@@ -1054,10 +1054,10 @@ usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
}
void
-usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
+usb2_com_put_data(struct ucom_softc *sc, struct usb_page_cache *pc,
uint32_t offset, uint32_t len)
{
- struct usb2_page_search res;
+ struct usb_page_search res;
struct tty *tp = sc->sc_tty;
char *buf;
uint32_t cnt;
@@ -1113,7 +1113,7 @@ usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
static void
usb2_com_free(void *xsc)
{
- struct usb2_com_softc *sc = xsc;
+ struct ucom_softc *sc = xsc;
mtx_lock(sc->sc_mtx);
sc->sc_ttyfreed = 1;