meta-google: google-usb-network: Use EEM instead of ECM

This about doubles the performance of the network interface over USB2

Change-Id: Id8f79435b9cb7f02fa9094bf50e90023dfe188a8
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network.service.m4 b/meta-google/recipes-google/networking/google-usb-network/usb_network.service.m4
index 581c29b..14f0d68 100644
--- a/meta-google/recipes-google/networking/google-usb-network/usb_network.service.m4
+++ b/meta-google/recipes-google/networking/google-usb-network/usb_network.service.m4
@@ -10,18 +10,18 @@
 divert(0)dnl
 dnl
 [Unit]
-Description=USB ECM Gadget
+Description=USB Gadget
 After=phosphor-ipmi-host.service
 
 [Service]
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=M_SCRIPT_INSTALL_DIR/usb_network.sh \
-    --product-id "M_BMC_USB_ECM_PRODUCT_ID" \
-    --product-name "M_BMC_USB_ECM_PRODUCT_NAME" \
-    HOST_MAC_ARG(M_BMC_USB_ECM_HOST_MAC) \
-    DEV_MAC_ARG(M_BMC_USB_ECM_DEV_MAC) \
-    --bind-device "M_BMC_USB_ECM_BIND_DEV"
+    --product-id "M_BMC_USB_PRODUCT_ID" \
+    --product-name "M_BMC_USB_PRODUCT_NAME" \
+    HOST_MAC_ARG(M_BMC_USB_HOST_MAC) \
+    DEV_MAC_ARG(M_BMC_USB_DEV_MAC) \
+    --bind-device "M_BMC_USB_BIND_DEV"
 ExecStop=M_SCRIPT_INSTALL_DIR/usb_network.sh stop
 
 [Install]
diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh
index 08f9ad2..06707c4 100755
--- a/meta-google/recipes-google/networking/google-usb-network/usb_network.sh
+++ b/meta-google/recipes-google/networking/google-usb-network/usb_network.sh
@@ -57,9 +57,9 @@
     mkdir -p "${config_dir}"
     echo 100 > "${config_dir}/MaxPower"
     mkdir -p "${config_dir}/strings/0x409"
-    echo "ECM" > "${config_dir}/strings/0x409/configuration"
+    echo "EEM" > "${config_dir}/strings/0x409/configuration"
 
-    local func_dir="${gadget_dir}/functions/ecm.${IFACE_NAME}"
+    local func_dir="${gadget_dir}/functions/eem.${IFACE_NAME}"
     mkdir -p "${func_dir}"
 
     if [[ -n $HOST_MAC_ADDR ]]; then
@@ -77,11 +77,11 @@
 
 gadget_stop() {
     local gadget_dir="${CONFIGFS_HOME}/usb_gadget/${GADGET_DIR_NAME}"
-    rm -f ${gadget_dir}/configs/c.1/ecm.${IFACE_NAME}
+    rm -f ${gadget_dir}/configs/c.1/eem.${IFACE_NAME}
     rm -rf ${gadget_dir}/configs/c.1/strings/0x409
     rm -rf ${gadget_dir}/configs/c.1
     rm -rf ${gadget_dir}/strings/0x409
-    rm -rf ${gadget_dir}/functions/ecm.${IFACE_NAME}
+    rm -rf ${gadget_dir}/functions/eem.${IFACE_NAME}
     rm -rf ${gadget_dir}
 }
 
diff --git a/meta-google/recipes-google/networking/google-usb-network/usb_network_test.sh b/meta-google/recipes-google/networking/google-usb-network/usb_network_test.sh
index e589433..acbd23a 100755
--- a/meta-google/recipes-google/networking/google-usb-network/usb_network_test.sh
+++ b/meta-google/recipes-google/networking/google-usb-network/usb_network_test.sh
@@ -94,21 +94,21 @@
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/manufacturer "Google"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/product "${product_name}"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/MaxPower "100"
-    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "ECM"
-    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0/dev_addr "${dev_mac}"
-    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0/host_addr "${host_mac}"
+    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "EEM"
+    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0/dev_addr "${dev_mac}"
+    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0/host_addr "${host_mac}"
 
-    if ! test -d ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0; then
+    if ! test -d ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0; then
         test_fail "Function directory was not created"
     fi
 
-    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/ecm.usb0"
+    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/ee.usb0"
     if ! test -L "${func_link}"; then
         test_fail "Symlink to the function was not created in the config"
     fi
 
     local link_dest=$(realpath ${func_link})
-    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0 ]]; then
+    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0 ]]; then
         test_fail "Symlink points to the wrong file/dir"
     fi
 
@@ -167,23 +167,23 @@
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/manufacturer "Google"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/product "${product_name}"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/MaxPower "100"
-    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "ECM"
+    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "EEM"
 
-    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0/dev_addr; then
+    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0/dev_addr; then
         test_fail "dev_addr should not be set"
     fi
 
-    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0/host_addr; then
+    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0/host_addr; then
         test_fail "host_addr should not be set"
     fi
 
-    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/ecm.usb0"
+    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/eem.usb0"
     if ! test -L "${func_link}"; then
         test_fail "Symlink to the function was not created in the config"
     fi
 
     local link_dest=$(realpath ${func_link})
-    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.usb0 ]]; then
+    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.usb0 ]]; then
         test_fail "Symlink points to the wrong file/dir"
     fi
 
@@ -214,27 +214,27 @@
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/manufacturer "Google"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/strings/0x409/product "${product_name}"
     check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/MaxPower "100"
-    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "ECM"
+    check_file_content ${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/strings/0x409/configuration "EEM"
 
-    if ! test -d ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.${iface_name}; then
+    if ! test -d ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.${iface_name}; then
         test_fail "Function directory was not created"
     fi
 
-    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.${iface_name}/dev_addr; then
+    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.${iface_name}/dev_addr; then
         test_fail "dev_addr should not be set"
     fi
 
-    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.${iface_name}/host_addr; then
+    if test -e ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.${iface_name}/host_addr; then
         test_fail "host_addr should not be set"
     fi
 
-    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/ecm.${iface_name}"
+    local func_link="${FAKE_GADGETFS}/${gadget_dir}/configs/c.1/eem.${iface_name}"
     if ! test -L "${func_link}"; then
         test_fail "Symlink to the function was not created in the config"
     fi
 
     local link_dest=$(realpath ${func_link})
-    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/ecm.${iface_name} ]]; then
+    if [[ $link_dest != ${FAKE_GADGETFS}/${gadget_dir}/functions/eem.${iface_name} ]]; then
         test_fail "Symlink points to the wrong file/dir"
     fi
 
diff --git a/meta-google/recipes-google/networking/google-usb-network_git.bb b/meta-google/recipes-google/networking/google-usb-network_git.bb
index f0d15b9..eb07959 100644
--- a/meta-google/recipes-google/networking/google-usb-network_git.bb
+++ b/meta-google/recipes-google/networking/google-usb-network_git.bb
@@ -1,5 +1,5 @@
-SUMMARY = "Google USB ECM Gadget Configuration Script"
-DESCRIPTION = "Google USB ECM Gadget Configuration Script"
+SUMMARY = "Google USB EEM Gadget Configuration Script"
+DESCRIPTION = "Google USB EEM Gadget Configuration Script"
 PR = "r1"
 PV = "0.2"
 
@@ -42,11 +42,11 @@
     test "X${BMC_USB_ECM_BIND_DEV}" != "X" || bberror "Please define BMC_USB_ECM_BIND_DEV"
 
     m4 \
-        -DM_BMC_USB_ECM_PRODUCT_ID="${BMC_USB_ECM_PRODUCT_ID}" \
-        -DM_BMC_USB_ECM_PRODUCT_NAME="${BMC_USB_ECM_PRODUCT_NAME}" \
-        -DM_BMC_USB_ECM_HOST_MAC="${BMC_USB_ECM_HOST_MAC}" \
-        -DM_BMC_USB_ECM_DEV_MAC="${BMC_USB_ECM_DEV_MAC}" \
-        -DM_BMC_USB_ECM_BIND_DEV="${BMC_USB_ECM_BIND_DEV}" \
+        -DM_BMC_USB_PRODUCT_ID="${BMC_USB_ECM_PRODUCT_ID}" \
+        -DM_BMC_USB_PRODUCT_NAME="${BMC_USB_ECM_PRODUCT_NAME}" \
+        -DM_BMC_USB_HOST_MAC="${BMC_USB_ECM_HOST_MAC}" \
+        -DM_BMC_USB_DEV_MAC="${BMC_USB_ECM_DEV_MAC}" \
+        -DM_BMC_USB_BIND_DEV="${BMC_USB_ECM_BIND_DEV}" \
         -DM_SCRIPT_INSTALL_DIR="${bindir}" \
         ${WORKDIR}/usb_network.service.m4 > ${S}/usb_network.service
 }