summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortakawata <takawata@FreeBSD.org>2008-09-14 16:49:51 +0000
committertakawata <takawata@FreeBSD.org>2008-09-14 16:49:51 +0000
commitb934eafe5ec762456704ad6aa2df68ebb8f9d18c (patch)
tree393eb52058dc060fafb6ffa50a1dc505b5ad9032 /sys
parentead754945e1303f4902bb9c1d2f3da9dcc13c967 (diff)
downloadFreeBSD-src-b934eafe5ec762456704ad6aa2df68ebb8f9d18c.zip
FreeBSD-src-b934eafe5ec762456704ad6aa2df68ebb8f9d18c.tar.gz
Recover handsfree port support.(Almost all changes are done on previous commit).
Don't send serial line emulation request for OBEX port.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ufoma.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/usb/ufoma.c b/sys/dev/usb/ufoma.c
index 99100db..cc71735 100644
--- a/sys/dev/usb/ufoma.c
+++ b/sys/dev/usb/ufoma.c
@@ -1,5 +1,5 @@
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
-
+#define UFOMA_HANDSFREE
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -547,7 +547,9 @@ static int ufoma_activate_state(struct ufoma_softc *sc, int state)
err = usbd_do_request(ucom->sc_udev, &req, NULL);
if(err){
- printf("%s:ACTIVATE:%s\n", device_get_nameunit(ucom->sc_dev), usbd_errstr(err));
+ printf("%s:ACTIVATE(%x):%s\n",
+ device_get_nameunit(ucom->sc_dev), state,
+ usbd_errstr(err));
return EIO;
}
@@ -776,7 +778,7 @@ static void ufoma_outwakeup(struct tty *tp)
usbd_do_request(ucom->sc_udev, &req, &c);
}
}
- ucom->sc_state |= UCS_TXBUSY;
+ ucom->sc_state &= ~(UCS_TXBUSY);
}
#endif
@@ -876,11 +878,17 @@ ufoma_set_line_state(struct ufoma_softc *sc)
usb_device_request_t req;
struct ucom_softc *ucom = &sc->sc_ucom;
int ls;
+ int err;
if(!sc->sc_isopen){
return ; /*Set it later*/
}
-
+
+ /*Don't send line state emulation request for OBEX port*/
+ if(sc->sc_currentmode == UMCPC_ACM_MODE_OBEX){
+ return;
+ }
+
ls = (sc->sc_dtr ? UCDC_LINE_DTR : 0) |
(sc->sc_rts ? UCDC_LINE_RTS : 0);
req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
@@ -889,7 +897,11 @@ ufoma_set_line_state(struct ufoma_softc *sc)
USETW(req.wIndex, sc->sc_ctl_iface_no);
USETW(req.wLength, 0);
- (void)usbd_do_request(ucom->sc_udev, &req, 0);
+ err = usbd_do_request(ucom->sc_udev, &req, 0);
+ if(err){
+ printf("LINE_STATE:%s\n", usbd_errstr(err));
+ }
+
}
@@ -928,6 +940,7 @@ ufoma_set_line_coding(struct ufoma_softc *sc, usb_cdc_line_state_t *state)
sc->sc_line_state_init = *state;
return (USBD_NORMAL_COMPLETION);
}
+
DPRINTF(("ufoma_set_line_coding: rate=%d fmt=%d parity=%d bits=%d\n",
UGETDW(state->dwDTERate), state->bCharFormat,
state->bParityType, state->bDataBits));
@@ -939,6 +952,12 @@ ufoma_set_line_coding(struct ufoma_softc *sc, usb_cdc_line_state_t *state)
return (USBD_NORMAL_COMPLETION);
}
+ /*Don't send line state emulation request for OBEX port*/
+ if(sc->sc_currentmode == UMCPC_ACM_MODE_OBEX){
+ sc->sc_line_state = *state;
+ return (USBD_NORMAL_COMPLETION);
+ }
+
req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
req.bRequest = UCDC_SET_LINE_CODING;
USETW(req.wValue, 0);
OpenPOWER on IntegriCloud