diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/if_vlan.h | 5 | ||||
-rw-r--r-- | include/linux/ratelimit.h | 40 | ||||
-rw-r--r-- | include/linux/rfkill-gpio.h | 43 |
3 files changed, 88 insertions, 0 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 290bd8ac94cf..dc01681fbb42 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -110,6 +110,11 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline int is_vlan_dev(struct net_device *dev) | ||
114 | { | ||
115 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
116 | } | ||
117 | |||
113 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 118 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
114 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 119 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
115 | 120 | ||
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 03ff67b0cdf5..2f007157fab9 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -41,4 +41,44 @@ extern struct ratelimit_state printk_ratelimit_state; | |||
41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | 41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); |
42 | #define __ratelimit(state) ___ratelimit(state, __func__) | 42 | #define __ratelimit(state) ___ratelimit(state, __func__) |
43 | 43 | ||
44 | #ifdef CONFIG_PRINTK | ||
45 | |||
46 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
47 | WARN_ON((condition) && __ratelimit(state)) | ||
48 | |||
49 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
50 | ({ \ | ||
51 | int rtn = 0; \ | ||
52 | if (unlikely(__ratelimit(state))) \ | ||
53 | rtn = WARN(condition, format); \ | ||
54 | rtn; \ | ||
55 | }) | ||
56 | |||
57 | #define WARN_RATELIMIT(condition, format...) \ | ||
58 | ({ \ | ||
59 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
60 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
61 | DEFAULT_RATELIMIT_BURST); \ | ||
62 | __WARN_RATELIMIT(condition, &_rs, format); \ | ||
63 | }) | ||
64 | |||
65 | #else | ||
66 | |||
67 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
68 | WARN_ON(condition) | ||
69 | |||
70 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
71 | ({ \ | ||
72 | int rtn = WARN(condition, format); \ | ||
73 | rtn; \ | ||
74 | }) | ||
75 | |||
76 | #define WARN_RATELIMIT(condition, format...) \ | ||
77 | ({ \ | ||
78 | int rtn = WARN(condition, format); \ | ||
79 | rtn; \ | ||
80 | }) | ||
81 | |||
82 | #endif | ||
83 | |||
44 | #endif /* _LINUX_RATELIMIT_H */ | 84 | #endif /* _LINUX_RATELIMIT_H */ |
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h new file mode 100644 index 000000000000..a175d0598033 --- /dev/null +++ b/include/linux/rfkill-gpio.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, NVIDIA Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | |||
20 | #ifndef __RFKILL_GPIO_H | ||
21 | #define __RFKILL_GPIO_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/rfkill.h> | ||
25 | |||
26 | /** | ||
27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. | ||
28 | * for unused gpio's, the expected value is -1. | ||
29 | * @name: name for the gpio rf kill instance | ||
30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | ||
31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | ||
32 | * @power_clk_name: [optional] name of clk to turn off while blocked | ||
33 | */ | ||
34 | |||
35 | struct rfkill_gpio_platform_data { | ||
36 | char *name; | ||
37 | int reset_gpio; | ||
38 | int shutdown_gpio; | ||
39 | const char *power_clk_name; | ||
40 | enum rfkill_type type; | ||
41 | }; | ||
42 | |||
43 | #endif /* __RFKILL_GPIO_H */ | ||