cfg80211: keep track of supported interface modes (at76)

It is obviously good for userspace to know up front which
interface modes a given piece of hardware might support (even
if adding such an interface might fail later because of
concurrency issues), so let's make cfg80211 aware of that.
For good measure, disallow adding interfaces in all other
modes so drivers don't forget to announce support for one mode
when they add it.

Signed-off-by: Johannes Berg <>
Signed-off-by: Stephen Blackheath <>
Signed-off-by: Ivo van Doorn <>
Signed-off-by: Luis R. Rodriguez <>
Signed-off-by: John W. Linville <>
diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index 29ebdd2..7533fb2 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -2547,6 +2547,8 @@
 		priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
+	priv->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
 	SET_IEEE80211_DEV(priv->hw, &interface->dev);
 	SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);