/* causes rfkill_start() to be called */
error = input_register_handle(handle);
---- a/net/wireless/core.c 2009-07-06 18:49:45.482199823 -0700
-+++ b/net/wireless/core.c 2009-07-06 18:49:46.295190798 -0700
-@@ -260,7 +260,11 @@
- struct cfg80211_registered_device *drv;
+--- a/net/wireless/core.c 2009-07-07 13:38:34.043690488 -0700
++++ b/net/wireless/core.c 2009-07-07 13:55:32.547465059 -0700
+@@ -254,7 +254,11 @@
+ struct cfg80211_registered_device *rdev;
- drv = container_of(work, struct cfg80211_registered_device, rfkill_sync);
+ rdev = container_of(work, struct cfg80211_registered_device, rfkill_sync);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- cfg80211_rfkill_set_block(drv, rfkill_blocked(drv->rfkill));
+ cfg80211_rfkill_set_block(rdev, rfkill_blocked(rdev->rfkill));
+#else
+ cfg80211_rfkill_set_block(drv, backport_rfkill_blocked(drv->rfkill));
+#endif
}
- /* exported functions */
-@@ -311,9 +315,15 @@
- drv->wiphy.dev.platform_data = drv;
+ static void cfg80211_process_events(struct wireless_dev *wdev)
+@@ -376,9 +380,15 @@
+ rdev->wiphy.dev.platform_data = rdev;
- drv->rfkill_ops.set_block = cfg80211_rfkill_set_block;
+ rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- drv->rfkill = rfkill_alloc(dev_name(&drv->wiphy.dev),
- &drv->wiphy.dev, RFKILL_TYPE_WLAN,
- &drv->rfkill_ops, drv);
+ rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev),
+ &rdev->wiphy.dev, RFKILL_TYPE_WLAN,
+ &rdev->rfkill_ops, rdev);
+#else
+ drv->rfkill = backport_rfkill_alloc(dev_name(&drv->wiphy.dev),
-+ &drv->wiphy.dev, RFKILL_TYPE_WLAN,
-+ &drv->rfkill_ops, drv);
++ &drv->wiphy.dev, RFKILL_TYPE_WLAN,
++ &drv->rfkill_ops, drv);
+#endif
- if (!drv->rfkill) {
- kfree(drv);
-@@ -397,7 +407,11 @@
+ if (!rdev->rfkill) {
+ kfree(rdev);
+@@ -463,7 +473,11 @@
if (res)
return res;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- res = rfkill_register(drv->rfkill);
+ res = rfkill_register(rdev->rfkill);
+#else
+ res = backport_rfkill_register(drv->rfkill);
+#endif
if (res)
goto out_rm_dev;
-@@ -445,7 +459,11 @@
- if (!drv->ops->rfkill_poll)
+@@ -511,7 +525,11 @@
+ if (!rdev->ops->rfkill_poll)
return;
- drv->rfkill_ops.poll = cfg80211_rfkill_poll;
+ rdev->rfkill_ops.poll = cfg80211_rfkill_poll;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- rfkill_resume_polling(drv->rfkill);
+ rfkill_resume_polling(rdev->rfkill);
+#else
+ backport_rfkill_resume_polling(drv->rfkill);
+#endif
}
EXPORT_SYMBOL(wiphy_rfkill_start_polling);
-@@ -453,7 +471,11 @@
+@@ -519,7 +537,11 @@
{
- struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- rfkill_pause_polling(drv->rfkill);
+ rfkill_pause_polling(rdev->rfkill);
+#else
+ backport_rfkill_pause_polling(drv->rfkill);
+#endif
}
EXPORT_SYMBOL(wiphy_rfkill_stop_polling);
-@@ -461,7 +483,11 @@
+@@ -527,7 +549,11 @@
{
- struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- rfkill_unregister(drv->rfkill);
+ rfkill_unregister(rdev->rfkill);
+#else
+ backport_rfkill_unregister(drv->rfkill);
+#endif
/* protect the device list */
mutex_lock(&cfg80211_mutex);
-@@ -501,7 +527,11 @@
- void cfg80211_dev_free(struct cfg80211_registered_device *drv)
+@@ -570,7 +596,11 @@
+ void cfg80211_dev_free(struct cfg80211_registered_device *rdev)
{
struct cfg80211_internal_bss *scan, *tmp;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- rfkill_destroy(drv->rfkill);
+ rfkill_destroy(rdev->rfkill);
+#else
+ backport_rfkill_destroy(drv->rfkill);
+#endif
- mutex_destroy(&drv->mtx);
- mutex_destroy(&drv->devlist_mtx);
- list_for_each_entry_safe(scan, tmp, &drv->bss_list, list)
-@@ -519,7 +549,11 @@
+ mutex_destroy(&rdev->mtx);
+ mutex_destroy(&rdev->devlist_mtx);
+ list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list)
+@@ -588,7 +618,11 @@
{
- struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
- if (rfkill_set_hw_state(drv->rfkill, blocked))
+ if (rfkill_set_hw_state(rdev->rfkill, blocked))
+#else
+ if (backport_rfkill_set_hw_state(drv->rfkill, blocked))
+#endif
- schedule_work(&drv->rfkill_sync);
+ schedule_work(&rdev->rfkill_sync);
}
EXPORT_SYMBOL(wiphy_rfkill_set_hw_state);
-@@ -616,7 +650,11 @@
- mutex_unlock(&rdev->devlist_mtx);
- break;
+@@ -694,7 +728,11 @@
case NETDEV_PRE_UP:
+ if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
+ return notifier_from_errno(-EOPNOTSUPP);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
if (rfkill_blocked(rdev->rfkill))
+#else