0

我的问题类似于以下 url 问题。 复合 USB CDC 小工具不适用于 Windows 主机

我有一个带有 USB 设备接口的嵌入式 Linux 5.4(OpenSTLinux)系统

Window10 主机只检测 RNDIS 接口,忽略 ACM 接口。RNDIS 运行良好。

已应用以下设置

回声“0xEF”> ${d}/bDeviceClass

回声“0x02”> ${d}/bDeviceSubClass

回声“0x01”> ${d}/bDeviceProtocol

mkdir "${d}"
echo ${idVendor} > "${d}/idVendor"
echo ${idProduct} > "${d}/idProduct"
echo ${bcdUSB} > "${d}/bcdUSB"
echo ${bDeviceClass} > "${d}/bDeviceClass"
echo ${bDeviceSubClass} > "${d}/bDeviceSubClass"
echo ${bDeviceProtocol} > "${d}/bDeviceProtocol"
echo ${bcdDevice} > "${d}/bcdDevice"

mkdir -p "${d}/strings/${ENGLISH}"
echo ${manufacturer} > "${d}/strings/${ENGLISH}/manufacturer"
echo ${product} > "${d}/strings/${ENGLISH}/product"

# Config for rndis
mkdir -p "${d}/configs/${c1}"
mkdir -p "${d}/configs/${c1}/strings/${ENGLISH}"
echo ${MaxPower} > "${d}/configs/${c1}/MaxPower"
echo ${bmAttributes} > "${d}/configs/${c1}/bmAttributes" # self powered device

# Config for CDCECM
mkdir -p "${d}/configs/${c2}"
mkdir -p "${d}/configs/${c2}/strings/${ENGLISH}"
echo ${MaxPower} > "${d}/configs/${c2}/MaxPower"
echo ${bmAttributes} > "${d}/configs/${c2}/bmAttributes" # self powered device

# Windows extension to force RNDIS config
mkdir -p "${d}/os_desc"
echo "1" > "${d}/os_desc/use"
echo "0xbc" > "${d}/os_desc/b_vendor_code"
echo "MSFT100" > "${d}/os_desc/qw_sign"

mkdir -p "${d}/functions/${func_eth}"
mkdir -p "${d}/functions/${func_ecm}"
mkdir -p "${d}/functions/${func_acm0}"
mkdir -p "${d}/functions/${func_acm1}"
mkdir -p "${d}/functions/${func_eth}/os_desc/interface.rndis"
echo "RNDIS" > "${d}/functions/${func_eth}/os_desc/interface.rndis/compatible_id"
echo "5162001" > "${d}/functions/${func_eth}/os_desc/interface.rndis/sub_compatible_id"

if [ "${MAC_HOST_CUST}" != "" ]; then
    echo ${MAC_HOST_CUST} > "${d}/functions/${func_eth}/host_addr"
    echo ${MAC_HOST_CUST} > "${d}/functions/${func_ecm}/host_addr"
fi

# Setup RNDIS first in one configration
ln -s "${d}/configs/${c1}" "${d}/os_desc"
ln -s "${d}/functions/${func_eth}" "${d}/configs/${c1}"
ln -s "${d}/functions/${func_acm0}" "${d}/configs/${c1}"
ln -s "${d}/functions/${func_ecm}" "${d}/configs/${c2}"
ln -s "${d}/functions/${func_acm1}" "${d}/configs/${c2}"

echo "${udc}" > "${d}/UDC"

如果您知道问题的原因,请告诉我。

4

0 回答 0