RK3588平台的RNDIS配置可以参考以下,给足权限以后先手动运行,看是否有报错,运行成功无异常以后再加入开机启动中:
#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir -p pi4
cd pi4
echo 0x0955 > idVendor
echo 0x7020 > idProduct
echo 0x0001 > bcdDevice
echo 0x0200 > bcdUSB
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol
mkdir -p strings/0x409
echo "abcdefg1234567890" > strings/0x409/serialnumber
echo "raspberry" > strings/0x409/manufacturer
echo "PI4" > strings/0x409/product
cfg=configs/c.1
mkdir -p "${cfg}"
echo 0x80 > ${cfg}/bmAttributes
echo 250 > ${cfg}/MaxPower
cfg_str=""
udc_dev=fe980000.usb
net_ip=192.168.55.1
net_mask=255.255.255.0
enable_rndis=1
if [ ${enable_rndis} -eq 1 ]; then
cfg_str="${cfg_str}+RNDIS"
func=functions/rndis.usb0
mkdir -p "${func}"
ln -sf "${func}" "${cfg}"
echo 1 > os_desc/use
echo 0xcd > os_desc/b_vendor_code
echo MSFT100 > os_desc/qw_sign
echo RNDIS > "${func}/os_desc/interface.rndis/compatible_id"
echo 5162001 > "${func}/os_desc/interface.rndis/sub_compatible_id"
ln -sf "${cfg}" os_desc
fi
mkdir -p "${cfg}/strings/0x409"
echo "${cfg_str:1}" > "${cfg}/strings/0x409/configuration"
#udevadm settle -t 5 || :
#ls /sys/class/udc > UDC
/sbin/brctl addbr pi4br0
/sbin/ifconfig pi4br0 ${net_ip} netmask ${net_mask} up
if [ ${enable_rndis} -eq 1 ]; then
/sbin/brctl addif pi4br0 usb0
/sbin/ifconfig usb0 down
/sbin/ifconfig usb0 up
fi
exit 0
评论
1 条评论
这个脚本你跑通了吗
请登录写评论。