Closed Kogotoro closed 1 year ago
If you really want to improve usbip client, consider following repo. This project is stagnating.
The author was working on UDE driver, so VHCI driver is abandoned twice.
Regarding your question, read about integral promotions in C. In expression intf_num << 8 a compiler promotes UCHAR to int and does shift.
Regarding your question, read about integral promotions in C. In expression intf_num << 8 a compiler promotes UCHAR to int and does shift.
thx
/driver/vhci/vhci_devconf.c function setup_intf(...)
intf->InterfaceHandle = TO_INTF_HANDLE(intf->InterfaceNumber, intf->AlternateSetting);
considering what `define TO_INTF_HANDLE(intf_num, altsetting) ((USBD_INTERFACE_HANDLE)((intf_num << 8) + altsetting))
and
intf->InterfaceNumber, intf->AlternateSetting` both UCHAR (ie 8bits and there 8 bits left shift on first of them?)its eq to
intf->InterfaceHandle = (USBD_INTERFACE_HANDLE)(intf->AlternateSetting);
???