--- net.eth0 2004-02-25 14:40:52.000000000 +0000 +++ net.wlan0 2004-02-25 14:38:23.421886792 +0000 @@ -29,6 +29,8 @@ # No reason to check these multiple times in the file iface="${1/\./_}" iface_IFACE="$(eval echo \$\{iface_${iface}\})" + wlan_IFACE="$(eval echo \$\{wlan_${iface}\})" + iwpriv_IFACE="$(eval echo \$\{iwpriv_${iface}\})" dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})" inet6_IFACE="$(eval echo \$\{inet6_${iface}\})" alias_IFACE="$(eval echo \$\{alias_${iface}\})" @@ -57,6 +59,55 @@ eend ${retval} "Failed to bring ${IFACE} up" return ${retval} } + + # Deal with the wireless-specific parameters. Note that + # these don't need dealing with in stop(). + + echo "iface = ${IFACE}" + echo "iface_IFACE = ${iface_IFACE}" + echo "wlan_IFACE = ${wlan_IFACE}" + echo "iwpriv_IFACE = ${iwpriv_IFACE}" + + # Are we dealing with a wlan interface? + if [ -n "${wlan_IFACE}" ] + then + ebegin "Setting wireless parameters for ${IFACE}" + + # Do we have wireless-tools installed? + if [ ! -x /usr/sbin/iwconfig ] + then + eerror "wlan_${IFACE} was set, but iwconfig was not found or not executable." + eerror "emerge wireless-tools to fix this." + eend 1 "Failed to set wireless parameters for ${IFACE}" + return 1 + fi + + /usr/sbin/iwconfig ${IFACE} ${wlan_IFACE} || { + retval=$? + eend ${retval} "Failed to set wireless parameters for ${IFACE}" + return ${retval} + } + fi + + # Do we have to deal with iwpriv? + if [ -n "${iwpriv_IFACE}" ] + then + ebegin "Setting iwpriv parameters for ${IFACE}" + + if [ ! -x /usr/sbin/iwpriv ] + then + eerror "iwpriv_${IFACE} was set, but iwpriv was not found or not executable." + eerror "emerge wireless-tools to fix this." + eend 1 "Failed to set iwpriv parameters for ${IFACE}" + return 1 + fi + + /usr/sbin/iwpriv ${IFACE} ${iwpriv_IFACE} || { + retval=$? + eend ${retval} "Failed to set iwpriv parameters for ${IFACE}" + return ${retval} + } + fi else # Check that eth0 was not brough up by the kernel ... if [ "${status_IFACE}" != "up" ]