Skip to content

Commit

Permalink
lime-hwd-usbradio: wait for primary_interface to be ready at boot, do
Browse files Browse the repository at this point in the history
not depend on ath9k_htc as this module can support usb dongle based on
other drivers too
  • Loading branch information
frank95 committed Aug 10, 2014
1 parent 8e76c94 commit 456a4dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/lime-hwd-usbradio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define Package/$(PKG_NAME)
TITLE:=LiMe hardware detection usb radio support
CATEGORY:=LiMe
URL:=http://libre-mesh.org
DEPENDS:=+lime-system +lua +libuci-lua +kmod-ath9k-htc
DEPENDS:=+lime-system +lua +libuci-lua
endef

define Build/Compile
Expand Down
10 changes: 5 additions & 5 deletions packages/lime-hwd-usbradio/src/hotplug-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ burstStopFile="/tmp/lime-hotplug-usbradio-burst-check"
#[Doc] In the case burstStopFile exists the following code will be not executed
[ -e "${burstStopFile}" ] ||
{
#[Doc] Prepare Lua table with the hotplug parameters
lua_hotplug_args="hotplug_hook_args = { action='${ACTION}', devicename='${DEVICENAME}', devname='${DEVNAME}', devpath='${DEVPATH}', product='${PRODUCT}', type='${TYPE}', interface='${INTERFACE}' }"

#[Doc] Create burstStopFile; Write the date just for debugging
date > "${burstStopFile}"

#[Doc] Wait for the radio to be ready
#[Doc] Prepare Lua table with the hotplug parameters
lua_hotplug_args="hotplug_hook_args = { action='${ACTION}', devicename='${DEVICENAME}', devname='${DEVNAME}', devpath='${DEVPATH}', product='${PRODUCT}', type='${TYPE}', interface='${INTERFACE}' }"

#[Doc] Wait for lime primary_interface and the plugged radio to be ready
#[Doc] Configure the device calling lime-config but first execute lua_hotplug_args to pass hotplug parameters
#[Doc] Finally remove burstStopFile
((sleep 2s ; lua -e"${lua_hotplug_args}" /usr/bin/lime-config ; rm -rf "${burstStopFile}")&)
((sleep 2s ; rm -rf "${burstStopFile}" ; find /sys/${DEVPATH} | grep -q ieee80211 && ( while [ $(awk '{print $1}' /proc/uptime | awk -F. '{print $1}') -lt 90 ] ; do sleep 2s; done ; lua -e"${lua_hotplug_args}" /usr/bin/lime-config ))&)
}

0 comments on commit 456a4dd

Please sign in to comment.