diff --git a/dwc2.ko b/dwc2.ko new file mode 100644 index 0000000..c43ba24 Binary files /dev/null and b/dwc2.ko differ diff --git a/gadget.patch b/gadget.patch new file mode 100644 index 0000000..015c8ee --- /dev/null +++ b/gadget.patch @@ -0,0 +1,10 @@ +1210,1218d1209 +< /* Prints setup requests */ +< printk("USB DWC2 REQ %02x %02x %04x %04x %04x\n", +< ctrl->bRequestType, +< ctrl->bRequest, +< ctrl->wValue, +< ctrl->wIndex, +< ctrl->wLength); +< +< diff --git a/usbreq.sh b/usbreq.sh new file mode 100644 index 0000000..2a9b905 --- /dev/null +++ b/usbreq.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# s means Setup, +# 80 means device to host (bmRequestType), +# 06 means get descriptors (bRequest), +# 03xx means string descriptors (wValue) +#WLENGTHS=`cat /tmp/0.mon.out | grep "s 80 06 03" | cut -d " " -f 10` +WLENGTHS=`dmesg | grep "USB DWC2 REQ 80 06 03" | tee /home/pi/umap/usbreq.log | cut -d "]" -f 2 | cut -d " " -f 9` +TOTAL=0 +COUNTER=0 +for i in $WLENGTHS; do + if [ "$i" = "00ff" ]; then + let COUNTER=COUNTER+1 + fi + let TOTAL=TOTAL+1 + #echo wLength: $i +done +#echo $COUNTER +if [ $TOTAL -eq 0 ]; then + echo Unknown + exit +fi +#echo $COUNTER +if [ $COUNTER -eq 0 ]; then + echo MacOs +#elif [ $COUNTER -eq $TOTAL ]; then +# echo Linux +else + echo Other +# echo Windows +fi +