summaryrefslogtreecommitdiffstats
path: root/meta-quanta/meta-gsj/recipes-gsj/usb-network/files/usb_network.sh
blob: 45fa888bea2c313789eaebd509fe7101bc9ecb3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

cd /sys/kernel/config/usb_gadget

if [ ! -f "g1" ]; then
    mkdir g1
    cd g1

    echo 0x1d6b > idVendor  # Linux foundation
    echo 0x0104 > idProduct # Multifunction composite gadget
    mkdir -p strings/0x409
    echo "Linux" > strings/0x409/manufacturer
    echo "Ethernet/RNDIS gadget" > strings/0x409/product
    
    mkdir -p configs/c.1
    echo 100 > configs/c.1/MaxPower
    mkdir -p configs/c.1/strings/0x409
    echo "RNDIS" > configs/c.1/strings/0x409/configuration
    
    mkdir -p functions/rndis.usb0 
    
    ln -s functions/rndis.usb0 configs/c.1
    
    echo f0839000.udc > UDC

fi
exit 0
OpenPOWER on IntegriCloud