usb_serial.h (185948) | usb_serial.h (187176) |
---|---|
1/* $NetBSD: ucomvar.h,v 1.9 2001/01/23 21:56:17 augustss Exp $ */ | 1/* $NetBSD: ucomvar.h,v 1.9 2001/01/23 21:56:17 augustss Exp $ */ |
2/* $FreeBSD: head/sys/dev/usb2/serial/usb2_serial.h 185948 2008-12-11 23:13:02Z thompsa $ */ | 2/* $FreeBSD: head/sys/dev/usb2/serial/usb2_serial.h 187176 2009-01-13 19:03:47Z thompsa $ */ |
3 4/*- 5 * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 103 unchanged lines hidden (view full) --- 114#define ULSR_TXRDY 0x20 /* Transmitter buffer empty */ 115#define ULSR_BI 0x10 /* Break detected */ 116#define ULSR_FE 0x08 /* Framing error: bad stop bit */ 117#define ULSR_PE 0x04 /* Parity error */ 118#define ULSR_OE 0x02 /* Overrun, lost incoming byte */ 119#define ULSR_RXRDY 0x01 /* Byte ready in Receive Buffer */ 120#define ULSR_RCV_MASK 0x1f /* Mask for incoming data or error */ 121 | 3 4/*- 5 * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: --- 103 unchanged lines hidden (view full) --- 114#define ULSR_TXRDY 0x20 /* Transmitter buffer empty */ 115#define ULSR_BI 0x10 /* Break detected */ 116#define ULSR_FE 0x08 /* Framing error: bad stop bit */ 117#define ULSR_PE 0x04 /* Parity error */ 118#define ULSR_OE 0x02 /* Overrun, lost incoming byte */ 119#define ULSR_RXRDY 0x01 /* Byte ready in Receive Buffer */ 120#define ULSR_RCV_MASK 0x1f /* Mask for incoming data or error */ 121 |
122/* 123 * List of serial adapter commands or deferred function calls: 124 */ 125enum { 126 USB_COM_CFG_START_TRANSFERS, 127 USB_COM_CFG_OPEN, 128 USB_COM_CFG_CLOSE, 129 USB_COM_CFG_BREAK_ON, 130 USB_COM_CFG_BREAK_OFF, 131 USB_COM_CFG_DTR_ON, 132 USB_COM_CFG_DTR_OFF, 133 USB_COM_CFG_RTS_ON, 134 USB_COM_CFG_RTS_OFF, 135 USB_COM_CFG_STATUS_CHANGE, 136 USB_COM_CFG_PARAM, 137 USB_COM_CFG_MAX, 138}; 139 140struct usb2_com_command_msg { 141 struct usb2_proc_msg hdr; /* must be first */ 142 struct usb2_com_softc *cc_softc; 143}; 144 |
|
122struct usb2_com_super_softc { | 145struct usb2_com_super_softc { |
123 struct usb2_config_td sc_config_td; | 146 struct usb2_process sc_config_td; |
124}; 125 126struct usb2_com_softc { | 147}; 148 149struct usb2_com_softc { |
150 struct usb2_com_command_msg sc_cmds[2*USB_COM_CFG_MAX]; |
|
127 struct termios sc_termios_copy; 128 struct cv sc_cv; 129 const struct usb2_com_callback *sc_callback; 130 struct usb2_com_super_softc *sc_super; 131 struct tty *sc_tty; 132 struct mtx *sc_parent_mtx; 133 void *sc_parent; 134 uint32_t sc_unit; --- 6 unchanged lines hidden (view full) --- 141#define UCOM_FLAG_GP_DATA 0x08 /* set if get and put data is possible */ 142#define UCOM_FLAG_WR_START 0x10 /* set if write start was issued */ 143#define UCOM_FLAG_LL_READY 0x20 /* set if low layer is ready */ 144#define UCOM_FLAG_HL_READY 0x40 /* set if high layer is ready */ 145 uint8_t sc_lsr; 146 uint8_t sc_msr; 147 uint8_t sc_mcr; 148 uint8_t sc_ttyfreed; /* set when TTY has been freed */ | 151 struct termios sc_termios_copy; 152 struct cv sc_cv; 153 const struct usb2_com_callback *sc_callback; 154 struct usb2_com_super_softc *sc_super; 155 struct tty *sc_tty; 156 struct mtx *sc_parent_mtx; 157 void *sc_parent; 158 uint32_t sc_unit; --- 6 unchanged lines hidden (view full) --- 165#define UCOM_FLAG_GP_DATA 0x08 /* set if get and put data is possible */ 166#define UCOM_FLAG_WR_START 0x10 /* set if write start was issued */ 167#define UCOM_FLAG_LL_READY 0x20 /* set if low layer is ready */ 168#define UCOM_FLAG_HL_READY 0x40 /* set if high layer is ready */ 169 uint8_t sc_lsr; 170 uint8_t sc_msr; 171 uint8_t sc_mcr; 172 uint8_t sc_ttyfreed; /* set when TTY has been freed */ |
173 uint8_t sc_last_cmd_flag[USB_COM_CFG_MAX]; |
|
149}; 150 151int usb2_com_attach(struct usb2_com_super_softc *ssc, 152 struct usb2_com_softc *sc, uint32_t sub_units, void *parent, 153 const struct usb2_com_callback *callback, struct mtx *p_mtx); 154void usb2_com_detach(struct usb2_com_super_softc *ssc, 155 struct usb2_com_softc *sc, uint32_t sub_units); 156void usb2_com_status_change(struct usb2_com_softc *); 157uint8_t usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc, 158 uint32_t offset, uint32_t len, uint32_t *actlen); 159void usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc, 160 uint32_t offset, uint32_t len); 161uint8_t usb2_com_cfg_sleep(struct usb2_com_softc *sc, uint32_t timeout); 162uint8_t usb2_com_cfg_is_gone(struct usb2_com_softc *sc); 163 164#endif /* _USB2_SERIAL_H_ */ | 174}; 175 176int usb2_com_attach(struct usb2_com_super_softc *ssc, 177 struct usb2_com_softc *sc, uint32_t sub_units, void *parent, 178 const struct usb2_com_callback *callback, struct mtx *p_mtx); 179void usb2_com_detach(struct usb2_com_super_softc *ssc, 180 struct usb2_com_softc *sc, uint32_t sub_units); 181void usb2_com_status_change(struct usb2_com_softc *); 182uint8_t usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc, 183 uint32_t offset, uint32_t len, uint32_t *actlen); 184void usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc, 185 uint32_t offset, uint32_t len); 186uint8_t usb2_com_cfg_sleep(struct usb2_com_softc *sc, uint32_t timeout); 187uint8_t usb2_com_cfg_is_gone(struct usb2_com_softc *sc); 188 189#endif /* _USB2_SERIAL_H_ */ |