Skip to content

Commit bf8797c

Browse files
committed
DEBUG - genode_c_api USB session releasing - part VII
Issue genodelabs#5500
1 parent c8261fc commit bf8797c

File tree

1 file changed

+25
-2
lines changed
  • repos/dde_linux/src/lib/lx_emul

1 file changed

+25
-2
lines changed

repos/dde_linux/src/lib/lx_emul/usb.c

+25-2
Original file line numberDiff line numberDiff line change
@@ -184,33 +184,56 @@ handle_control_request(genode_usb_request_handle_t handle,
184184
struct usb_host_interface *alt =
185185
iface ? usb_altnum_to_altsetting(iface, ctrl_value) : NULL;
186186

187-
if (iface && iface->cur_altsetting != alt)
187+
if (iface && iface->cur_altsetting != alt) {
188+
printk("%s:%u in\n", __func__, __LINE__);
188189
ret = usb_set_interface(udev, ctrl_index, ctrl_value);
190+
printk("%s:%u in\n", __func__, __LINE__);
191+
}
189192

190193
send_msg = false;
191194
}
192195

196+
printk("%s:%u in\n", __func__, __LINE__);
197+
193198
/* check for set device configuration request */
194199
if (ctrl_request == USB_REQ_SET_CONFIGURATION &&
195200
ctrl_request_type == USB_RECIP_DEVICE) {
196201
if (!(udev->actconfig &&
197-
udev->actconfig->desc.bConfigurationValue == ctrl_value))
202+
udev->actconfig->desc.bConfigurationValue == ctrl_value)) {
203+
204+
printk("%s:%u in\n", __func__, __LINE__);
205+
198206
ret = usb_set_configuration(udev, ctrl_value);
207+
208+
printk("%s:%u in\n", __func__, __LINE__);
209+
}
199210
send_msg = false;
200211
}
201212

213+
printk("%s:%u in\n", __func__, __LINE__);
214+
202215
/* otherwise send control message */
203216
if (send_msg) {
204217
int pipe = (ctrl_request_type & 0x80)
205218
? usb_rcvctrlpipe(udev, 0) : usb_sndctrlpipe(udev, 0);
206219

220+
printk("%s:%u in\n", __func__, __LINE__);
221+
207222
usb_unlock_device(udev);
223+
224+
printk("%s:%u in\n", __func__, __LINE__);
225+
208226
ret = usb_control_msg(udev, pipe, ctrl_request, ctrl_request_type,
209227
ctrl_value, ctrl_index, payload.addr,
210228
payload.size, ctrl_timeout);
229+
230+
printk("%s:%u in\n", __func__, __LINE__);
231+
211232
usb_lock_device(udev);
212233
}
213234

235+
printk("%s:%u in\n", __func__, __LINE__);
236+
214237
size = ret < 0 ? 0 : ret;
215238
genode_usb_ack_request(handle, handle_return_code(ret < 0 ? ret : 0),
216239
&size);

0 commit comments

Comments
 (0)