#define device_release_driver LINUX_BACKPORT(device_release_driver)
#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+#define DEVICE_ATTR_RO(_name) \
+struct device_attribute dev_attr_ ## _name = __ATTR_RO(_name);
+
+#define ATTRIBUTE_GROUPS(_name) \
+static struct BP_ATTR_GRP_STRUCT _name##_dev_attrs[ARRAY_SIZE(_name##_attrs)];\
+static void init_##_name##_attrs(void) \
+{ \
+ int i; \
+ for (i = 0; _name##_attrs[i]; i++) \
+ _name##_dev_attrs[i] = \
+ *container_of(_name##_attrs[i], \
+ struct BP_ATTR_GRP_STRUCT, \
+ attr); \
+}
+#else
+#undef ATTRIBUTE_GROUPS
+#define ATTRIBUTE_GROUPS(_name) \
+static const struct attribute_group _name##_group = { \
+ .attrs = _name##_attrs, \
+}; \
+static inline void init_##_name##_attrs(void) {} \
+__ATTRIBUTE_GROUPS(_name)
+#endif
+
#endif /* __BACKPORT_DEVICE_H */
--- /dev/null
+--- a/net/wireless/sysfs.c
++++ b/net/wireless/sysfs.c
+@@ -71,6 +71,7 @@ static struct attribute *ieee80211_attrs
+ &dev_attr_name.attr,
+ NULL,
+ };
++#define BP_ATTR_GRP_STRUCT device_attribute
+ ATTRIBUTE_GROUPS(ieee80211);
+
+ static void wiphy_dev_release(struct device *dev)
+@@ -151,7 +152,11 @@ struct class ieee80211_class = {
+ .name = "ieee80211",
+ .owner = THIS_MODULE,
+ .dev_release = wiphy_dev_release,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
+ .dev_groups = ieee80211_groups,
++#else
++ .dev_attrs = ieee80211_dev_attrs,
++#endif
+ .dev_uevent = wiphy_uevent,
+ #ifdef CONFIG_PM
+ .suspend = wiphy_suspend,
+@@ -165,6 +170,7 @@ struct class ieee80211_class = {
+
+ int wiphy_sysfs_init(void)
+ {
++ init_ieee80211_attrs();
+ return class_register(&ieee80211_class);
+ }
+