aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/bug.h37
-rw-r--r--include/linux/if_vlan.h5
-rw-r--r--include/linux/rfkill-gpio.h43
-rw-r--r--include/net/cfg80211.h8
-rw-r--r--include/net/dst.h2
5 files changed, 93 insertions, 2 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index e5a3f5880001..91784841e407 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -162,9 +162,46 @@ extern void warn_slowpath_null(const char *file, const int line);
162 unlikely(__ret_warn_once); \ 162 unlikely(__ret_warn_once); \
163}) 163})
164 164
165#ifdef CONFIG_PRINTK
166
165#define WARN_ON_RATELIMIT(condition, state) \ 167#define WARN_ON_RATELIMIT(condition, state) \
166 WARN_ON((condition) && __ratelimit(state)) 168 WARN_ON((condition) && __ratelimit(state))
167 169
170#define __WARN_RATELIMIT(condition, state, format...) \
171({ \
172 int rtn = 0; \
173 if (unlikely(__ratelimit(state))) \
174 rtn = WARN(condition, format); \
175 rtn; \
176})
177
178#define WARN_RATELIMIT(condition, format...) \
179({ \
180 static DEFINE_RATELIMIT_STATE(_rs, \
181 DEFAULT_RATELIMIT_INTERVAL, \
182 DEFAULT_RATELIMIT_BURST); \
183 __WARN_RATELIMIT(condition, &_rs, format); \
184})
185
186#else
187
188#define WARN_ON_RATELIMIT(condition, state) \
189 WARN_ON(condition)
190
191#define __WARN_RATELIMIT(condition, state, format...) \
192({ \
193 int rtn = WARN(condition, format); \
194 rtn; \
195})
196
197#define WARN_RATELIMIT(condition, format...) \
198({ \
199 int rtn = WARN(condition, format); \
200 rtn; \
201})
202
203#endif
204
168/* 205/*
169 * WARN_ON_SMP() is for cases that the warning is either 206 * WARN_ON_SMP() is for cases that the warning is either
170 * meaningless for !SMP or may even cause failures. 207 * meaningless for !SMP or may even cause failures.
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
113static 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/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
35struct 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 */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bfd6557946be..0589f554788a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -531,6 +531,7 @@ struct sta_bss_parameters {
531 * @tx_retries: cumulative retry counts 531 * @tx_retries: cumulative retry counts
532 * @tx_failed: number of failed transmissions (retries exceeded, no ACK) 532 * @tx_failed: number of failed transmissions (retries exceeded, no ACK)
533 * @rx_dropped_misc: Dropped for un-specified reason. 533 * @rx_dropped_misc: Dropped for un-specified reason.
534 * @bss_param: current BSS parameters
534 * @generation: generation number for nl80211 dumps. 535 * @generation: generation number for nl80211 dumps.
535 * This number should increase every time the list of stations 536 * This number should increase every time the list of stations
536 * changes, i.e. when a station is added or removed, so that 537 * changes, i.e. when a station is added or removed, so that
@@ -1537,7 +1538,7 @@ struct cfg80211_ops {
1537 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. 1538 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
1538 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing 1539 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
1539 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. 1540 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
1540 * @WIPHY_FLAG_SCHED_SCAN: The device supports scheduled scans. 1541 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans.
1541 */ 1542 */
1542enum wiphy_flags { 1543enum wiphy_flags {
1543 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1544 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2878,6 +2879,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
2878 * cfg80211_roamed - notify cfg80211 of roaming 2879 * cfg80211_roamed - notify cfg80211 of roaming
2879 * 2880 *
2880 * @dev: network device 2881 * @dev: network device
2882 * @channel: the channel of the new AP
2881 * @bssid: the BSSID of the new AP 2883 * @bssid: the BSSID of the new AP
2882 * @req_ie: association request IEs (maybe be %NULL) 2884 * @req_ie: association request IEs (maybe be %NULL)
2883 * @req_ie_len: association request IEs length 2885 * @req_ie_len: association request IEs length
@@ -2888,7 +2890,9 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
2888 * It should be called by the underlying driver whenever it roamed 2890 * It should be called by the underlying driver whenever it roamed
2889 * from one AP to another while connected. 2891 * from one AP to another while connected.
2890 */ 2892 */
2891void cfg80211_roamed(struct net_device *dev, const u8 *bssid, 2893void cfg80211_roamed(struct net_device *dev,
2894 struct ieee80211_channel *channel,
2895 const u8 *bssid,
2892 const u8 *req_ie, size_t req_ie_len, 2896 const u8 *req_ie, size_t req_ie_len,
2893 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); 2897 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp);
2894 2898
diff --git a/include/net/dst.h b/include/net/dst.h
index 07a0402c52e6..7d15d238b6ec 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -111,6 +111,8 @@ static inline u32 *dst_metrics_write_ptr(struct dst_entry *dst)
111{ 111{
112 unsigned long p = dst->_metrics; 112 unsigned long p = dst->_metrics;
113 113
114 BUG_ON(!p);
115
114 if (p & DST_METRICS_READ_ONLY) 116 if (p & DST_METRICS_READ_ONLY)
115 return dst->ops->cow_metrics(dst, p); 117 return dst->ops->cow_metrics(dst, p);
116 return __DST_METRICS_PTR(p); 118 return __DST_METRICS_PTR(p);