Thursday, June 25, 2009

wireless drivers that support Mesh Point mode

Here's a little script that I developed to query your Linux PC for information about mesh-capable wireless drivers, if any. It prints the relevant phy names, MAC addresses, and driver name. It just requires a recent version of iw. For example:


$ ./lsmesh.sh
phy1 00:1f:c6:20:c1:71 rt73usb
phy0 00:ff:f3:a0:24:bd ath5k


You then know what phy to use with iw (and what driver supports your device, if you're curious). Here's the script:


#!/bin/bash

PHYS=`iw list | grep Wiphy | cut -d ' ' -f 2`

for phy in $PHYS; do
iw phy $phy info | grep "mesh point" >/dev/null
if [ "$?" = "0" ]; then
MAC="`cat /sys/class/ieee80211/$phy/macaddress`"
DRIVER="`ls /sys/class/ieee80211/$phy/device/driver/module/drivers/ 2>/dev/null | cut -d ':' -f 2`"

echo "$phy $MAC $DRIVER"
fi
done

No comments: