The mac80211 component allows for multiple virtual interfaces on the same hardware. Although in many/most cases the additional interfaces must be monitor interfaces, that is still quite useful. Since RHEL5 doesn't have the iw tool (which would normally be used to add/remove virtual interfaces), there is currently no means to add/delete those interfaces in RHEL5. We carried (a version of) this patch in Fedora in the F-8 timeframe and earlier. I would like to see it in RHEL5.5. BZ545121 --- linux-2.6.18.noarch/net/wireless/sysfs.c.orig 2009-12-03 12:49:01.000000000 -0500 +++ linux-2.6.18.noarch/net/wireless/sysfs.c 2009-12-03 13:12:17.000000000 -0500 @@ -34,9 +34,66 @@ static ssize_t name ## _show(struct devi SHOW_FMT(index, "%d", wiphy_idx); SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); +static ssize_t _store_add_iface(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct cfg80211_registered_device *rdev = dev_to_rdev(dev); + int res; + + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + if (len > IFNAMSIZ) + return -EINVAL; + if (!rdev->ops->add_virtual_intf) + return -ENOSYS; + + rtnl_lock(); + res = rdev->ops->add_virtual_intf(&rdev->wiphy, (char*)buf, + NL80211_IFTYPE_MONITOR, + NULL, NULL); + rtnl_unlock(); + + return res ? res : len; +} + +static ssize_t _store_remove_iface(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct cfg80211_registered_device *rdev = dev_to_rdev(dev); + int res, ifidx; + struct net_device *netdev; + + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + if (len > IFNAMSIZ) + return -EINVAL; + if (!rdev->ops->del_virtual_intf) + return -ENOSYS; + +#if 0 /* Not in RHEL5... */ + netdev = dev_get_by_name(&init_net, buf); +#else + netdev = dev_get_by_name(buf); +#endif + if (!netdev) + return -ENODEV; + ifidx = netdev->ifindex; + dev_put(netdev); + + rtnl_lock(); + res = rdev->ops->del_virtual_intf(&rdev->wiphy, netdev); + rtnl_unlock(); + + return res ? res : len; +} + static struct device_attribute ieee80211_dev_attrs[] = { __ATTR_RO(index), __ATTR_RO(macaddress), + __ATTR(add_iface, S_IWUGO, NULL, _store_add_iface), + __ATTR(remove_iface, S_IWUGO, NULL, _store_remove_iface), {} };