67 #include <linux/rfkill.h>
68 #include <linux/export.h>
71 #define D_SUBMODULE op_rfkill
97 struct device *
dev = wimax_dev_to_dev(wimax_dev);
100 d_fnstart(3, dev,
"(wimax_dev %p state %u)\n", wimax_dev, state);
105 result = wimax_dev_is_ready(wimax_dev);
107 goto error_not_ready;
109 if (state != wimax_dev->
rf_hw) {
124 d_fnend(3, dev,
"(wimax_dev %p state %u) = void [%d]\n",
125 wimax_dev, state, result);
153 struct device *
dev = wimax_dev_to_dev(wimax_dev);
156 d_fnstart(3, dev,
"(wimax_dev %p state %u)\n", wimax_dev, state);
161 result = wimax_dev_is_ready(wimax_dev);
163 goto error_not_ready;
165 if (state != wimax_dev->
rf_sw) {
177 d_fnend(3, dev,
"(wimax_dev %p state %u) = void [%d]\n",
178 wimax_dev, state, result);
210 struct device *
dev = wimax_dev_to_dev(wimax_dev);
214 d_fnstart(3, dev,
"(wimax_dev %p state %u)\n", wimax_dev, state);
215 if (wimax_dev->
rf_sw == state)
231 d_fnend(3, dev,
"(wimax_dev %p state %u) = %d\n",
232 wimax_dev, state, result);
249 static int wimax_rfkill_set_radio_block(
void *
data,
bool blocked)
252 struct wimax_dev *wimax_dev =
data;
253 struct device *dev = wimax_dev_to_dev(wimax_dev);
256 d_fnstart(3, dev,
"(wimax_dev %p blocked %u)\n", wimax_dev, blocked);
264 result = __wimax_rf_toggle_radio(wimax_dev, rf_state);
266 d_fnend(3, dev,
"(wimax_dev %p blocked %u) = %d\n",
267 wimax_dev, blocked, result);
271 static const struct rfkill_ops wimax_rfkill_ops = {
272 .set_block = wimax_rfkill_set_radio_block,
304 struct device *dev = wimax_dev_to_dev(wimax_dev);
306 d_fnstart(3, dev,
"(wimax_dev %p state %u)\n", wimax_dev, state);
308 result = wimax_dev_is_ready(wimax_dev);
316 goto error_not_ready;
321 result = __wimax_rf_toggle_radio(wimax_dev, state);
332 result = wimax_dev->
rf_sw << 1 | wimax_dev->
rf_hw;
336 d_fnend(3, dev,
"(wimax_dev %p state %u) = %d\n",
337 wimax_dev, state, result);
352 struct device *dev = wimax_dev_to_dev(wimax_dev);
354 d_fnstart(3, dev,
"(wimax_dev %p)\n", wimax_dev);
358 &wimax_rfkill_ops, wimax_dev);
360 goto error_rfkill_allocate;
362 d_printf(1, dev,
"rfkill %p\n", rfkill);
364 wimax_dev->
rfkill = rfkill;
369 goto error_rfkill_register;
375 d_fnend(3, dev,
"(wimax_dev %p) = 0\n", wimax_dev);
378 error_rfkill_register:
380 error_rfkill_allocate:
381 d_fnend(3, dev,
"(wimax_dev %p) = %d\n", wimax_dev, result);
396 struct device *dev = wimax_dev_to_dev(wimax_dev);
397 d_fnstart(3, dev,
"(wimax_dev %p)\n", wimax_dev);
400 d_fnend(3, dev,
"(wimax_dev %p)\n", wimax_dev);
428 struct wimax_dev *wimax_dev;
437 goto error_no_wimax_dev;
441 if (wimax_dev ==
NULL)
442 goto error_no_wimax_dev;
443 dev = wimax_dev_to_dev(wimax_dev);
446 dev_err(dev,
"WIMAX_GNL_RFKILL: can't find RFKILL_STATE "
457 d_fnend(3,
NULL,
"(skb %p info %p) = %d\n", skb, info, result);
465 .policy = wimax_gnl_rfkill_policy,
466 .doit = wimax_gnl_doit_rfkill,