FreeBSD Bugzilla – Attachment 212329 Details for
Bug 244718
[patch] WMT driver usb framelength
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
dont_restrict_transfer_size_to_wMaxPacketSize.patch
wmt.patch (text/plain), 2.17 KB, created by
Vladimir Kondratyev
on 2020-03-11 11:26:34 UTC
(
hide
)
Description:
dont_restrict_transfer_size_to_wMaxPacketSize.patch
Filename:
MIME Type:
Creator:
Vladimir Kondratyev
Created:
2020-03-11 11:26:34 UTC
Size:
2.17 KB
patch
obsolete
>diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c >index 35b306a6f3f2..c9b10214d4e4 100644 >--- a/sys/dev/usb/input/wmt.c >+++ b/sys/dev/usb/input/wmt.c >@@ -201,6 +201,7 @@ struct wmt_softc > uint32_t caps; > uint32_t isize; > uint32_t nconts_max; >+ uint32_t report_len; > uint8_t report_id; > > struct hid_location cont_max_loc; >@@ -251,7 +252,7 @@ static const struct usb_config wmt_config[WMT_N_TRANSFER] = { > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_IN, > .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, >- .bufsize = 0, /* use wMaxPacketSize */ >+ .bufsize = WMT_BSIZE, > .callback = &wmt_intr_callback, > }, > }; >@@ -492,10 +493,11 @@ wmt_intr_callback(struct usb_xfer *xfer, usb_error_t error) > > DPRINTFN(6, "sc=%p actlen=%d\n", sc, len); > >- if (len >= (int)sc->isize || (len > 0 && sc->report_id != 0)) { >+ if (len >= (int)sc->report_len || >+ (len > 0 && sc->report_id != 0)) { > /* Limit report length to the maximum */ >- if (len > (int)sc->isize) >- len = sc->isize; >+ if (len > (int)sc->report_len) >+ len = sc->report_len; > > usbd_copy_out(pc, 0, buf, len); > >@@ -504,8 +506,8 @@ wmt_intr_callback(struct usb_xfer *xfer, usb_error_t error) > goto tr_ignore; > > /* Make sure we don't process old data */ >- if (len < sc->isize) >- bzero(buf + len, sc->isize - len); >+ if (len < sc->report_len) >+ bzero(buf + len, sc->report_len - len); > > /* Strip leading "report ID" byte */ > if (sc->report_id) { >@@ -521,7 +523,7 @@ wmt_intr_callback(struct usb_xfer *xfer, usb_error_t error) > > case USB_ST_SETUP: > tr_setup: >- usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); >+ usbd_xfer_set_frame_len(xfer, 0, sc->isize); > usbd_transfer_submit(xfer); > break; > default: >@@ -807,7 +809,9 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) > sc->ai[WMT_ORIENTATION].max = 1; > } > >- sc->isize = wmt_hid_report_size(d_ptr, d_len, hid_input, report_id); >+ sc->isize = hid_report_size(d_ptr, d_len, hid_input, NULL); >+ sc->report_len = wmt_hid_report_size(d_ptr, d_len, hid_input, >+ report_id); > sc->cont_max_rlen = wmt_hid_report_size(d_ptr, d_len, hid_feature, > cont_max_rid); > if (thqa_cert_rid > 0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244718
:
212306
| 212329