b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Linux rfkill helper functions for driver wrappers |
| 3 | * Copyright (c) 2010, Jouni Malinen <j@w1.fi> |
| 4 | * |
| 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
| 7 | */ |
| 8 | |
| 9 | #ifndef RFKILL_H |
| 10 | #define RFKILL_H |
| 11 | |
| 12 | struct rfkill_data; |
| 13 | |
| 14 | struct rfkill_config { |
| 15 | void *ctx; |
| 16 | char ifname[IFNAMSIZ]; |
| 17 | void (*blocked_cb)(void *ctx); |
| 18 | void (*unblocked_cb)(void *ctx); |
| 19 | }; |
| 20 | |
| 21 | #ifdef CONFIG_RFKILL |
| 22 | struct rfkill_data * rfkill_init(struct rfkill_config *cfg); |
| 23 | void rfkill_deinit(struct rfkill_data *rfkill); |
| 24 | int rfkill_is_blocked(struct rfkill_data *rfkill); |
| 25 | #else |
| 26 | static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg) |
| 27 | { |
| 28 | return (void *) 1; |
| 29 | } |
| 30 | |
| 31 | static inline void rfkill_deinit(struct rfkill_data *rfkill) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | static inline int rfkill_is_blocked(struct rfkill_data *rfkill) |
| 36 | { |
| 37 | return 0; |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | #endif /* RFKILL_H */ |