Skip to contentSkip to conversation

How to find the phy's associated with a wireless dev

DISCUSSION David Goodenough 4 participants 4 messages Oct 25, 2011 – Oct 26, 2011

lore
Share & tools
lore
#0 lore raw

I notice that if I remove the kernel module for a wireless interface and reload it, that a new phy is defined. This is confusing my script that sets up interfaces, in particular I need to set the distance for a long distance link and that has to be done on the phy not the dev.

I am doing this from a script so I guess it has to be a query using iw, but I can not see which one to use.

David

#1 lore raw
Quoted 8 lines · David Goodenough

I notice that if I remove the kernel module for a wireless interface and reload it, that a new phy is defined. This is confusing my script that sets up interfaces, in particular I need to set the distance for a long distance link and that has to be done on the phy not the dev.

I am doing this from a script so I guess it has to be a query using iw, but I can not see which one to use.

On a recent kernel:
cat /sys/class/net/wlan0/phy80211/name

Thanks,
Ben

Quoted 6 lines

David
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#2 lore raw

Hello Davis,
Maybe is easier for you to create an udev rule to rename your wireless devices always the same way. An example:

file /etc/udev/rules.d/wireless-devices.rules:

KERNEL=="phy*", SYSFS{address}=="00:xx:xx:xx:xx:xx", NAME="phy0" KERNEL=="phy*", SYSFS{address}=="00:xx:xx:xx:xx:xx", NAME="phy1"

You can see more information here
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames?show_comments=1

This works fine for me :)

2011/10/25 Ben Greear <[email protected]>

Quoted 35 lines · David Goodenough
Quoted 9 lines

I notice that if I remove the kernel module for a wireless interface and reload it, that a new phy is defined.  This is confusing my script that sets up interfaces, in particular I need to set the distance for a long distance link and that has to be done on the phy not the dev.

I am doing this from a script so I guess it has to be a query using iw, but I can not see which one to use.

On a recent kernel:
cat /sys/class/net/wlan0/phy80211/name

Thanks,
Ben

Quoted 6 lines

David
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 10 lines · Mariana Gambande

Hello Davis,
Maybe is easier for you to create an udev rule to rename your wireless devices always the same way. An example:

file /etc/udev/rules.d/wireless-devices.rules:

KERNEL=="phy*", SYSFS{address}=="00:xx:xx:xx:xx:xx", NAME="phy0" KERNEL=="phy*", SYSFS{address}=="00:xx:xx:xx:xx:xx", NAME="phy1"

Quoted 22 lines

You can see more information here
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames?show_comments=1

This works fine for me :)

2011/10/25 Ben Greear <[email protected]>

Quoted 15 lines · David Goodenough
Quoted 9 lines

I notice that if I remove the kernel module for a wireless interface and reload it, that a new phy is defined.  This is confusing my script that sets up interfaces, in particular I need to set the distance for a long distance link and that has to be done on the phy not the dev.

I am doing this from a script so I guess it has to be a query using iw, but I can not see which one to use.

On a recent kernel:
cat /sys/class/net/wlan0/phy80211/name

If your kernel does not support it you could just do:
iw phy | grep -o -m1 -e 'phy[0-9]'

Thanks,
Yoni

Quoted 25 lines
Quoted 13 lines

Thanks,
Ben

Quoted 6 lines

David
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html