[PATCH 03/05] Update USB Serial Driver for use with RTEMS

Kevin Kirspel kevin-kirspel at idexx.com
Fri Apr 7 20:13:48 UTC 2017


---
 freebsd/sys/dev/usb/serial/usb_serial.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/freebsd/sys/dev/usb/serial/usb_serial.c b/freebsd/sys/dev/usb/serial/usb_serial.c
index b5d7ef7..f494b10 100644
--- a/freebsd/sys/dev/usb/serial/usb_serial.c
+++ b/freebsd/sys/dev/usb/serial/usb_serial.c
@@ -82,7 +82,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/priv.h>
 #include <sys/cons.h>

+#ifndef __rtems__
 #include <dev/uart/uart_ppstypes.h>
+#endif /* __rtems__ */

 #include <dev/usb/usb.h>
 #include <dev/usb/usbdi.h>
@@ -99,11 +101,13 @@ __FBSDID("$FreeBSD$");

 static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom");

+#ifndef __rtems__
 static int ucom_pps_mode;

 SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN,
     &ucom_pps_mode, 0,
     "pulse capture mode: 0/1/2=disabled/CTS/DCD; add 0x10 to invert");
+#endif /* __rtems__ */

 #ifdef USB_DEBUG
 static int ucom_debug = 0;
@@ -420,10 +424,12 @@ ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc)

 	sc->sc_tty = tp;

+#ifndef __rtems__
 	sc->sc_pps.ppscap = PPS_CAPTUREBOTH;
 	sc->sc_pps.driver_abi = PPS_ABI_VERSION;
 	sc->sc_pps.driver_mtx = sc->sc_mtx;
 	pps_init_abi(&sc->sc_pps);
+#endif /* __rtems__ */

 	DPRINTF("ttycreate: %s\n", buf);

@@ -874,8 +880,10 @@ ucom_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
 		} else {
 			error = ENOIOCTL;
 		}
+#ifndef __rtems__
 		if (error == ENOIOCTL)
 			error = pps_ioctl(cmd, data, &sc->sc_pps);
+#endif /* __rtems__ */
 		break;
 	}
 	return (error);
@@ -1082,7 +1090,9 @@ ucom_cfg_status_change(struct usb_proc_msg *_task)
 	uint8_t new_lsr;
 	uint8_t msr_delta;
 	uint8_t lsr_delta;
+#ifndef __rtems__
 	uint8_t pps_signal;
+#endif /* __rtems__ */

 	tp = sc->sc_tty;

@@ -1111,6 +1121,7 @@ ucom_cfg_status_change(struct usb_proc_msg *_task)
 	sc->sc_msr = new_msr;
 	sc->sc_lsr = new_lsr;

+#ifndef __rtems__
 	/*
 	 * Time pulse counting support.
 	 */
@@ -1135,6 +1146,7 @@ ucom_cfg_status_change(struct usb_proc_msg *_task)
 		pps_event(&sc->sc_pps, onoff ? PPS_CAPTUREASSERT :
 		    PPS_CAPTURECLEAR);
 	}
+#endif /* __rtems__ */

 	if (msr_delta & SER_DCD) {

--
1.9.1



More information about the devel mailing list