Skip to content

Commit

Permalink
boot: Update USB CDC Ethernet gadget to use NCM
Browse files Browse the repository at this point in the history
The USB CDC Ethernet gadget is currently configured to use the ECM
protocol.  Unfortunately this protocol is no longer supported by
MacOS hosts.  However, the newer NCM protocol is supported.
The NCM protocol is also supported by Linux hosts.

This patch updates the USB CDC Ethernet gadget configuration scripts
to use the NCM protcol instead of teh ECM protocol.

The patch has been tested on MacOS 10.15.4 using a pocketbeagle.
It is untested on other beagle hardware.

Signed-off-by: James Kelly <vk3jpk@gmail.com>
  • Loading branch information
vk3jpk authored and RobertCNelson committed Apr 9, 2020
1 parent b39ec67 commit b61125c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions boot/am335x_evm.sh
Expand Up @@ -481,11 +481,11 @@ run_libcomposite () {
fi

if [ ! "x${USB_NETWORK_CDC_DISABLED}" = "xyes" ]; then
mkdir -p functions/ecm.usb0
echo ${cpsw_4_mac} > functions/ecm.usb0/host_addr
echo ${cpsw_5_mac} > functions/ecm.usb0/dev_addr
mkdir -p functions/ncm.usb0
echo ${cpsw_4_mac} > functions/ncm.usb0/host_addr
echo ${cpsw_5_mac} > functions/ncm.usb0/dev_addr

ln -s functions/ecm.usb0 configs/c.1/
ln -s functions/ncm.usb0 configs/c.1/
usb1="enable"
fi

Expand Down
8 changes: 4 additions & 4 deletions boot/bbai.sh
Expand Up @@ -269,12 +269,12 @@ run_libcomposite_start () {
fi

if [ ! "x${USB_NETWORK_DISABLED}" = "xyes" ]; then
mkdir -p functions/ecm.usb0
echo ${cpsw_3_mac} > functions/ecm.usb0/host_addr
echo ${cpsw_4_mac} > functions/ecm.usb0/dev_addr
mkdir -p functions/ncm.usb0
echo ${cpsw_3_mac} > functions/ncm.usb0/host_addr
echo ${cpsw_4_mac} > functions/ncm.usb0/dev_addr

#if [ ! "x${USB_NETWORK_DISABLED}" = "xyes" ]; then
ln -s functions/ecm.usb0 configs/c.1/
ln -s functions/ncm.usb0 configs/c.1/
#fi

fi
Expand Down
8 changes: 4 additions & 4 deletions boot/bbai_usb_gadget.sh
Expand Up @@ -230,9 +230,9 @@ fi
echo 1 > functions/rndis.usb0/os_desc/interface.rndis/Label/type
echo "BeagleBone USB Ethernet" > functions/rndis.usb0/os_desc/interface.rndis/Label/data

mkdir -p functions/ecm.usb0
echo ${cpsw_3_mac} > functions/ecm.usb0/host_addr
echo ${cpsw_4_mac} > functions/ecm.usb0/dev_addr
mkdir -p functions/ncm.usb0
echo ${cpsw_3_mac} > functions/ncm.usb0/host_addr
echo ${cpsw_4_mac} > functions/ncm.usb0/dev_addr
fi

mkdir -p functions/acm.usb0
Expand All @@ -248,7 +248,7 @@ fi

if [ ! "x${USB_NETWORK_DISABLED}" = "xyes" ]; then
ln -s functions/rndis.usb0 configs/c.1/
ln -s functions/ecm.usb0 configs/c.1/
ln -s functions/ncm.usb0 configs/c.1/
fi

ln -s functions/acm.usb0 configs/c.1/
Expand Down
8 changes: 4 additions & 4 deletions boot/beagle_x15.sh
Expand Up @@ -260,9 +260,9 @@ run_libcomposite () {
echo 01 > functions/rndis.usb0/protocol
fi

mkdir -p functions/ecm.usb0
echo ${cpsw_4_mac} > functions/ecm.usb0/host_addr
echo ${cpsw_5_mac} > functions/ecm.usb0/dev_addr
mkdir -p functions/ncm.usb0
echo ${cpsw_4_mac} > functions/ncm.usb0/host_addr
echo ${cpsw_5_mac} > functions/ncm.usb0/dev_addr

mkdir -p functions/acm.usb0

Expand All @@ -283,7 +283,7 @@ run_libcomposite () {
echo 500 > configs/c.1/MaxPower

ln -s functions/rndis.usb0 configs/c.1/
ln -s functions/ecm.usb0 configs/c.1/
ln -s functions/ncm.usb0 configs/c.1/
ln -s functions/acm.usb0 configs/c.1/
if [ "x${has_img_file}" = "xtrue" ] ; then
ln -s functions/mass_storage.usb0 configs/c.1/
Expand Down

0 comments on commit b61125c

Please sign in to comment.