diff options
Diffstat (limited to 'include/net')
28 files changed, 450 insertions, 177 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 4d40c4d0230b..958d2749b7a9 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -175,20 +175,32 @@ extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | |||
175 | extern int register_inet6addr_notifier(struct notifier_block *nb); | 175 | extern int register_inet6addr_notifier(struct notifier_block *nb); |
176 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); | 176 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); |
177 | 177 | ||
178 | static inline struct inet6_dev * | 178 | /** |
179 | __in6_dev_get(struct net_device *dev) | 179 | * __in6_dev_get - get inet6_dev pointer from netdevice |
180 | * @dev: network device | ||
181 | * | ||
182 | * Caller must hold rcu_read_lock or RTNL, because this function | ||
183 | * does not take a reference on the inet6_dev. | ||
184 | */ | ||
185 | static inline struct inet6_dev *__in6_dev_get(const struct net_device *dev) | ||
180 | { | 186 | { |
181 | return rcu_dereference_check(dev->ip6_ptr, | 187 | return rcu_dereference_rtnl(dev->ip6_ptr); |
182 | rcu_read_lock_held() || | ||
183 | lockdep_rtnl_is_held()); | ||
184 | } | 188 | } |
185 | 189 | ||
186 | static inline struct inet6_dev * | 190 | /** |
187 | in6_dev_get(struct net_device *dev) | 191 | * in6_dev_get - get inet6_dev pointer from netdevice |
192 | * @dev: network device | ||
193 | * | ||
194 | * This version can be used in any context, and takes a reference | ||
195 | * on the inet6_dev. Callers must use in6_dev_put() later to | ||
196 | * release this reference. | ||
197 | */ | ||
198 | static inline struct inet6_dev *in6_dev_get(const struct net_device *dev) | ||
188 | { | 199 | { |
189 | struct inet6_dev *idev = NULL; | 200 | struct inet6_dev *idev; |
201 | |||
190 | rcu_read_lock(); | 202 | rcu_read_lock(); |
191 | idev = __in6_dev_get(dev); | 203 | idev = rcu_dereference(dev->ip6_ptr); |
192 | if (idev) | 204 | if (idev) |
193 | atomic_inc(&idev->refcnt); | 205 | atomic_inc(&idev->refcnt); |
194 | rcu_read_unlock(); | 206 | rcu_read_unlock(); |
@@ -197,16 +209,21 @@ in6_dev_get(struct net_device *dev) | |||
197 | 209 | ||
198 | extern void in6_dev_finish_destroy(struct inet6_dev *idev); | 210 | extern void in6_dev_finish_destroy(struct inet6_dev *idev); |
199 | 211 | ||
200 | static inline void | 212 | static inline void in6_dev_put(struct inet6_dev *idev) |
201 | in6_dev_put(struct inet6_dev *idev) | ||
202 | { | 213 | { |
203 | if (atomic_dec_and_test(&idev->refcnt)) | 214 | if (atomic_dec_and_test(&idev->refcnt)) |
204 | in6_dev_finish_destroy(idev); | 215 | in6_dev_finish_destroy(idev); |
205 | } | 216 | } |
206 | 217 | ||
207 | #define __in6_dev_put(idev) atomic_dec(&(idev)->refcnt) | 218 | static inline void __in6_dev_put(struct inet6_dev *idev) |
208 | #define in6_dev_hold(idev) atomic_inc(&(idev)->refcnt) | 219 | { |
220 | atomic_dec(&idev->refcnt); | ||
221 | } | ||
209 | 222 | ||
223 | static inline void in6_dev_hold(struct inet6_dev *idev) | ||
224 | { | ||
225 | atomic_inc(&idev->refcnt); | ||
226 | } | ||
210 | 227 | ||
211 | extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); | 228 | extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); |
212 | 229 | ||
@@ -216,9 +233,15 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp) | |||
216 | inet6_ifa_finish_destroy(ifp); | 233 | inet6_ifa_finish_destroy(ifp); |
217 | } | 234 | } |
218 | 235 | ||
219 | #define __in6_ifa_put(ifp) atomic_dec(&(ifp)->refcnt) | 236 | static inline void __in6_ifa_put(struct inet6_ifaddr *ifp) |
220 | #define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) | 237 | { |
238 | atomic_dec(&ifp->refcnt); | ||
239 | } | ||
221 | 240 | ||
241 | static inline void in6_ifa_hold(struct inet6_ifaddr *ifp) | ||
242 | { | ||
243 | atomic_inc(&ifp->refcnt); | ||
244 | } | ||
222 | 245 | ||
223 | 246 | ||
224 | /* | 247 | /* |
@@ -241,23 +264,23 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) | |||
241 | 264 | ||
242 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) | 265 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) |
243 | { | 266 | { |
244 | return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | | 267 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
245 | addr->s6_addr32[1] | addr->s6_addr32[2] | | 268 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
246 | (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0); | 269 | (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0; |
247 | } | 270 | } |
248 | 271 | ||
249 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | 272 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) |
250 | { | 273 | { |
251 | return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | | 274 | return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
252 | addr->s6_addr32[1] | addr->s6_addr32[2] | | 275 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
253 | (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0); | 276 | (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0; |
254 | } | 277 | } |
255 | 278 | ||
256 | extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr); | 279 | extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr); |
257 | 280 | ||
258 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | 281 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) |
259 | { | 282 | { |
260 | return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); | 283 | return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); |
261 | } | 284 | } |
262 | 285 | ||
263 | #ifdef CONFIG_PROC_FS | 286 | #ifdef CONFIG_PROC_FS |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 4568b938ca35..ebec8c9a929d 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -233,7 +233,7 @@ static inline void inquiry_cache_init(struct hci_dev *hdev) | |||
233 | static inline int inquiry_cache_empty(struct hci_dev *hdev) | 233 | static inline int inquiry_cache_empty(struct hci_dev *hdev) |
234 | { | 234 | { |
235 | struct inquiry_cache *c = &hdev->inq_cache; | 235 | struct inquiry_cache *c = &hdev->inq_cache; |
236 | return (c->list == NULL); | 236 | return c->list == NULL; |
237 | } | 237 | } |
238 | 238 | ||
239 | static inline long inquiry_cache_age(struct hci_dev *hdev) | 239 | static inline long inquiry_cache_age(struct hci_dev *hdev) |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 6c241444f902..c819c8bf9b68 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -414,7 +414,7 @@ static inline int l2cap_tx_window_full(struct sock *sk) | |||
414 | if (sub < 0) | 414 | if (sub < 0) |
415 | sub += 64; | 415 | sub += 64; |
416 | 416 | ||
417 | return (sub == pi->remote_tx_win); | 417 | return sub == pi->remote_tx_win; |
418 | } | 418 | } |
419 | 419 | ||
420 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 | 420 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2fd06c60ffbb..a0613ff62c97 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -25,6 +25,43 @@ | |||
25 | #include <linux/wireless.h> | 25 | #include <linux/wireless.h> |
26 | 26 | ||
27 | 27 | ||
28 | /** | ||
29 | * DOC: Introduction | ||
30 | * | ||
31 | * cfg80211 is the configuration API for 802.11 devices in Linux. It bridges | ||
32 | * userspace and drivers, and offers some utility functionality associated | ||
33 | * with 802.11. cfg80211 must, directly or indirectly via mac80211, be used | ||
34 | * by all modern wireless drivers in Linux, so that they offer a consistent | ||
35 | * API through nl80211. For backward compatibility, cfg80211 also offers | ||
36 | * wireless extensions to userspace, but hides them from drivers completely. | ||
37 | * | ||
38 | * Additionally, cfg80211 contains code to help enforce regulatory spectrum | ||
39 | * use restrictions. | ||
40 | */ | ||
41 | |||
42 | |||
43 | /** | ||
44 | * DOC: Device registration | ||
45 | * | ||
46 | * In order for a driver to use cfg80211, it must register the hardware device | ||
47 | * with cfg80211. This happens through a number of hardware capability structs | ||
48 | * described below. | ||
49 | * | ||
50 | * The fundamental structure for each device is the 'wiphy', of which each | ||
51 | * instance describes a physical wireless device connected to the system. Each | ||
52 | * such wiphy can have zero, one, or many virtual interfaces associated with | ||
53 | * it, which need to be identified as such by pointing the network interface's | ||
54 | * @ieee80211_ptr pointer to a &struct wireless_dev which further describes | ||
55 | * the wireless part of the interface, normally this struct is embedded in the | ||
56 | * network interface's private data area. Drivers can optionally allow creating | ||
57 | * or destroying virtual interfaces on the fly, but without at least one or the | ||
58 | * ability to create some the wireless device isn't useful. | ||
59 | * | ||
60 | * Each wiphy structure contains device capability information, and also has | ||
61 | * a pointer to the various operations the driver offers. The definitions and | ||
62 | * structures here describe these capabilities in detail. | ||
63 | */ | ||
64 | |||
28 | /* | 65 | /* |
29 | * wireless hardware capability structures | 66 | * wireless hardware capability structures |
30 | */ | 67 | */ |
@@ -205,6 +242,21 @@ struct ieee80211_supported_band { | |||
205 | */ | 242 | */ |
206 | 243 | ||
207 | /** | 244 | /** |
245 | * DOC: Actions and configuration | ||
246 | * | ||
247 | * Each wireless device and each virtual interface offer a set of configuration | ||
248 | * operations and other actions that are invoked by userspace. Each of these | ||
249 | * actions is described in the operations structure, and the parameters these | ||
250 | * operations use are described separately. | ||
251 | * | ||
252 | * Additionally, some operations are asynchronous and expect to get status | ||
253 | * information via some functions that drivers need to call. | ||
254 | * | ||
255 | * Scanning and BSS list handling with its associated functionality is described | ||
256 | * in a separate chapter. | ||
257 | */ | ||
258 | |||
259 | /** | ||
208 | * struct vif_params - describes virtual interface parameters | 260 | * struct vif_params - describes virtual interface parameters |
209 | * @mesh_id: mesh ID to use | 261 | * @mesh_id: mesh ID to use |
210 | * @mesh_id_len: length of the mesh ID | 262 | * @mesh_id_len: length of the mesh ID |
@@ -570,8 +622,28 @@ struct ieee80211_txq_params { | |||
570 | /* from net/wireless.h */ | 622 | /* from net/wireless.h */ |
571 | struct wiphy; | 623 | struct wiphy; |
572 | 624 | ||
573 | /* from net/ieee80211.h */ | 625 | /** |
574 | struct ieee80211_channel; | 626 | * DOC: Scanning and BSS list handling |
627 | * | ||
628 | * The scanning process itself is fairly simple, but cfg80211 offers quite | ||
629 | * a bit of helper functionality. To start a scan, the scan operation will | ||
630 | * be invoked with a scan definition. This scan definition contains the | ||
631 | * channels to scan, and the SSIDs to send probe requests for (including the | ||
632 | * wildcard, if desired). A passive scan is indicated by having no SSIDs to | ||
633 | * probe. Additionally, a scan request may contain extra information elements | ||
634 | * that should be added to the probe request. The IEs are guaranteed to be | ||
635 | * well-formed, and will not exceed the maximum length the driver advertised | ||
636 | * in the wiphy structure. | ||
637 | * | ||
638 | * When scanning finds a BSS, cfg80211 needs to be notified of that, because | ||
639 | * it is responsible for maintaining the BSS list; the driver should not | ||
640 | * maintain a list itself. For this notification, various functions exist. | ||
641 | * | ||
642 | * Since drivers do not maintain a BSS list, there are also a number of | ||
643 | * functions to search for a BSS and obtain information about it from the | ||
644 | * BSS structure cfg80211 maintains. The BSS list is also made available | ||
645 | * to userspace. | ||
646 | */ | ||
575 | 647 | ||
576 | /** | 648 | /** |
577 | * struct cfg80211_ssid - SSID description | 649 | * struct cfg80211_ssid - SSID description |
@@ -691,6 +763,10 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | |||
691 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | 763 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is |
692 | * required to assume that the port is unauthorized until authorized by | 764 | * required to assume that the port is unauthorized until authorized by |
693 | * user space. Otherwise, port is marked authorized by default. | 765 | * user space. Otherwise, port is marked authorized by default. |
766 | * @control_port_ethertype: the control port protocol that should be | ||
767 | * allowed through even on unauthorized ports | ||
768 | * @control_port_no_encrypt: TRUE to prevent encryption of control port | ||
769 | * protocol frames. | ||
694 | */ | 770 | */ |
695 | struct cfg80211_crypto_settings { | 771 | struct cfg80211_crypto_settings { |
696 | u32 wpa_versions; | 772 | u32 wpa_versions; |
@@ -700,6 +776,8 @@ struct cfg80211_crypto_settings { | |||
700 | int n_akm_suites; | 776 | int n_akm_suites; |
701 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; | 777 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; |
702 | bool control_port; | 778 | bool control_port; |
779 | __be16 control_port_ethertype; | ||
780 | bool control_port_no_encrypt; | ||
703 | }; | 781 | }; |
704 | 782 | ||
705 | /** | 783 | /** |
@@ -1020,7 +1098,7 @@ struct cfg80211_pmksa { | |||
1020 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1098 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
1021 | * This allows the operation to be terminated prior to timeout based on | 1099 | * This allows the operation to be terminated prior to timeout based on |
1022 | * the duration value. | 1100 | * the duration value. |
1023 | * @action: Transmit an action frame | 1101 | * @mgmt_tx: Transmit a management frame |
1024 | * | 1102 | * |
1025 | * @testmode_cmd: run a test mode command | 1103 | * @testmode_cmd: run a test mode command |
1026 | * | 1104 | * |
@@ -1172,7 +1250,7 @@ struct cfg80211_ops { | |||
1172 | struct net_device *dev, | 1250 | struct net_device *dev, |
1173 | u64 cookie); | 1251 | u64 cookie); |
1174 | 1252 | ||
1175 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | 1253 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
1176 | struct ieee80211_channel *chan, | 1254 | struct ieee80211_channel *chan, |
1177 | enum nl80211_channel_type channel_type, | 1255 | enum nl80211_channel_type channel_type, |
1178 | bool channel_type_valid, | 1256 | bool channel_type_valid, |
@@ -1221,21 +1299,29 @@ struct cfg80211_ops { | |||
1221 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station | 1299 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station |
1222 | * on a VLAN interface) | 1300 | * on a VLAN interface) |
1223 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station | 1301 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station |
1302 | * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the | ||
1303 | * control port protocol ethertype. The device also honours the | ||
1304 | * control_port_no_encrypt flag. | ||
1224 | */ | 1305 | */ |
1225 | enum wiphy_flags { | 1306 | enum wiphy_flags { |
1226 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1307 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
1227 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), | 1308 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), |
1228 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), | 1309 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), |
1229 | WIPHY_FLAG_NETNS_OK = BIT(3), | 1310 | WIPHY_FLAG_NETNS_OK = BIT(3), |
1230 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), | 1311 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), |
1231 | WIPHY_FLAG_4ADDR_AP = BIT(5), | 1312 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
1232 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1313 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
1314 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | ||
1233 | }; | 1315 | }; |
1234 | 1316 | ||
1235 | struct mac_address { | 1317 | struct mac_address { |
1236 | u8 addr[ETH_ALEN]; | 1318 | u8 addr[ETH_ALEN]; |
1237 | }; | 1319 | }; |
1238 | 1320 | ||
1321 | struct ieee80211_txrx_stypes { | ||
1322 | u16 tx, rx; | ||
1323 | }; | ||
1324 | |||
1239 | /** | 1325 | /** |
1240 | * struct wiphy - wireless hardware description | 1326 | * struct wiphy - wireless hardware description |
1241 | * @reg_notifier: the driver's regulatory notification callback | 1327 | * @reg_notifier: the driver's regulatory notification callback |
@@ -1286,6 +1372,10 @@ struct mac_address { | |||
1286 | * @privid: a pointer that drivers can use to identify if an arbitrary | 1372 | * @privid: a pointer that drivers can use to identify if an arbitrary |
1287 | * wiphy is theirs, e.g. in global notifiers | 1373 | * wiphy is theirs, e.g. in global notifiers |
1288 | * @bands: information about bands/channels supported by this device | 1374 | * @bands: information about bands/channels supported by this device |
1375 | * | ||
1376 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | ||
1377 | * transmitted through nl80211, points to an array indexed by interface | ||
1378 | * type | ||
1289 | */ | 1379 | */ |
1290 | struct wiphy { | 1380 | struct wiphy { |
1291 | /* assign these fields before you register the wiphy */ | 1381 | /* assign these fields before you register the wiphy */ |
@@ -1294,9 +1384,12 @@ struct wiphy { | |||
1294 | u8 perm_addr[ETH_ALEN]; | 1384 | u8 perm_addr[ETH_ALEN]; |
1295 | u8 addr_mask[ETH_ALEN]; | 1385 | u8 addr_mask[ETH_ALEN]; |
1296 | 1386 | ||
1297 | u16 n_addresses; | ||
1298 | struct mac_address *addresses; | 1387 | struct mac_address *addresses; |
1299 | 1388 | ||
1389 | const struct ieee80211_txrx_stypes *mgmt_stypes; | ||
1390 | |||
1391 | u16 n_addresses; | ||
1392 | |||
1300 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1393 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
1301 | u16 interface_modes; | 1394 | u16 interface_modes; |
1302 | 1395 | ||
@@ -1492,8 +1585,8 @@ struct cfg80211_cached_keys; | |||
1492 | * set by driver (if supported) on add_interface BEFORE registering the | 1585 | * set by driver (if supported) on add_interface BEFORE registering the |
1493 | * netdev and may otherwise be used by driver read-only, will be update | 1586 | * netdev and may otherwise be used by driver read-only, will be update |
1494 | * by cfg80211 on change_interface | 1587 | * by cfg80211 on change_interface |
1495 | * @action_registrations: list of registrations for action frames | 1588 | * @mgmt_registrations: list of registrations for management frames |
1496 | * @action_registrations_lock: lock for the list | 1589 | * @mgmt_registrations_lock: lock for the list |
1497 | * @mtx: mutex used to lock data in this struct | 1590 | * @mtx: mutex used to lock data in this struct |
1498 | * @cleanup_work: work struct used for cleanup that can't be done directly | 1591 | * @cleanup_work: work struct used for cleanup that can't be done directly |
1499 | */ | 1592 | */ |
@@ -1505,8 +1598,8 @@ struct wireless_dev { | |||
1505 | struct list_head list; | 1598 | struct list_head list; |
1506 | struct net_device *netdev; | 1599 | struct net_device *netdev; |
1507 | 1600 | ||
1508 | struct list_head action_registrations; | 1601 | struct list_head mgmt_registrations; |
1509 | spinlock_t action_registrations_lock; | 1602 | spinlock_t mgmt_registrations_lock; |
1510 | 1603 | ||
1511 | struct mutex mtx; | 1604 | struct mutex mtx; |
1512 | 1605 | ||
@@ -1563,8 +1656,10 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
1563 | return wiphy_priv(wdev->wiphy); | 1656 | return wiphy_priv(wdev->wiphy); |
1564 | } | 1657 | } |
1565 | 1658 | ||
1566 | /* | 1659 | /** |
1567 | * Utility functions | 1660 | * DOC: Utility functions |
1661 | * | ||
1662 | * cfg80211 offers a number of utility functions that can be useful. | ||
1568 | */ | 1663 | */ |
1569 | 1664 | ||
1570 | /** | 1665 | /** |
@@ -1715,7 +1810,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
1715 | * ieee80211_hdrlen - get header length in bytes from frame control | 1810 | * ieee80211_hdrlen - get header length in bytes from frame control |
1716 | * @fc: frame control field in little-endian format | 1811 | * @fc: frame control field in little-endian format |
1717 | */ | 1812 | */ |
1718 | unsigned int ieee80211_hdrlen(__le16 fc); | 1813 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
1814 | |||
1815 | /** | ||
1816 | * DOC: Data path helpers | ||
1817 | * | ||
1818 | * In addition to generic utilities, cfg80211 also offers | ||
1819 | * functions that help implement the data path for devices | ||
1820 | * that do not do the 802.11/802.3 conversion on the device. | ||
1821 | */ | ||
1719 | 1822 | ||
1720 | /** | 1823 | /** |
1721 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 | 1824 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 |
@@ -1777,8 +1880,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
1777 | */ | 1880 | */ |
1778 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | 1881 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
1779 | 1882 | ||
1780 | /* | 1883 | /** |
1781 | * Regulatory helper functions for wiphys | 1884 | * DOC: Regulatory enforcement infrastructure |
1885 | * | ||
1886 | * TODO | ||
1782 | */ | 1887 | */ |
1783 | 1888 | ||
1784 | /** | 1889 | /** |
@@ -2181,6 +2286,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
2181 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); | 2286 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); |
2182 | 2287 | ||
2183 | /** | 2288 | /** |
2289 | * DOC: RFkill integration | ||
2290 | * | ||
2291 | * RFkill integration in cfg80211 is almost invisible to drivers, | ||
2292 | * as cfg80211 automatically registers an rfkill instance for each | ||
2293 | * wireless device it knows about. Soft kill is also translated | ||
2294 | * into disconnecting and turning all interfaces off, drivers are | ||
2295 | * expected to turn off the device when all interfaces are down. | ||
2296 | * | ||
2297 | * However, devices may have a hard RFkill line, in which case they | ||
2298 | * also need to interact with the rfkill subsystem, via cfg80211. | ||
2299 | * They can do this with a few helper functions documented here. | ||
2300 | */ | ||
2301 | |||
2302 | /** | ||
2184 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state | 2303 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state |
2185 | * @wiphy: the wiphy | 2304 | * @wiphy: the wiphy |
2186 | * @blocked: block status | 2305 | * @blocked: block status |
@@ -2201,6 +2320,17 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | |||
2201 | 2320 | ||
2202 | #ifdef CONFIG_NL80211_TESTMODE | 2321 | #ifdef CONFIG_NL80211_TESTMODE |
2203 | /** | 2322 | /** |
2323 | * DOC: Test mode | ||
2324 | * | ||
2325 | * Test mode is a set of utility functions to allow drivers to | ||
2326 | * interact with driver-specific tools to aid, for instance, | ||
2327 | * factory programming. | ||
2328 | * | ||
2329 | * This chapter describes how drivers interact with it, for more | ||
2330 | * information see the nl80211 book's chapter on it. | ||
2331 | */ | ||
2332 | |||
2333 | /** | ||
2204 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply | 2334 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply |
2205 | * @wiphy: the wiphy | 2335 | * @wiphy: the wiphy |
2206 | * @approxlen: an upper bound of the length of the data that will | 2336 | * @approxlen: an upper bound of the length of the data that will |
@@ -2373,38 +2503,39 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
2373 | struct station_info *sinfo, gfp_t gfp); | 2503 | struct station_info *sinfo, gfp_t gfp); |
2374 | 2504 | ||
2375 | /** | 2505 | /** |
2376 | * cfg80211_rx_action - notification of received, unprocessed Action frame | 2506 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
2377 | * @dev: network device | 2507 | * @dev: network device |
2378 | * @freq: Frequency on which the frame was received in MHz | 2508 | * @freq: Frequency on which the frame was received in MHz |
2379 | * @buf: Action frame (header + body) | 2509 | * @buf: Management frame (header + body) |
2380 | * @len: length of the frame data | 2510 | * @len: length of the frame data |
2381 | * @gfp: context flags | 2511 | * @gfp: context flags |
2382 | * Returns %true if a user space application is responsible for rejecting the | 2512 | * |
2383 | * unrecognized Action frame; %false if no such application is registered | 2513 | * Returns %true if a user space application has registered for this frame. |
2384 | * (i.e., the driver is responsible for rejecting the unrecognized Action | 2514 | * For action frames, that makes it responsible for rejecting unrecognized |
2385 | * frame) | 2515 | * action frames; %false otherwise, in which case for action frames the |
2516 | * driver is responsible for rejecting the frame. | ||
2386 | * | 2517 | * |
2387 | * This function is called whenever an Action frame is received for a station | 2518 | * This function is called whenever an Action frame is received for a station |
2388 | * mode interface, but is not processed in kernel. | 2519 | * mode interface, but is not processed in kernel. |
2389 | */ | 2520 | */ |
2390 | bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, | 2521 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, |
2391 | size_t len, gfp_t gfp); | 2522 | size_t len, gfp_t gfp); |
2392 | 2523 | ||
2393 | /** | 2524 | /** |
2394 | * cfg80211_action_tx_status - notification of TX status for Action frame | 2525 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
2395 | * @dev: network device | 2526 | * @dev: network device |
2396 | * @cookie: Cookie returned by cfg80211_ops::action() | 2527 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() |
2397 | * @buf: Action frame (header + body) | 2528 | * @buf: Management frame (header + body) |
2398 | * @len: length of the frame data | 2529 | * @len: length of the frame data |
2399 | * @ack: Whether frame was acknowledged | 2530 | * @ack: Whether frame was acknowledged |
2400 | * @gfp: context flags | 2531 | * @gfp: context flags |
2401 | * | 2532 | * |
2402 | * This function is called whenever an Action frame was requested to be | 2533 | * This function is called whenever a management frame was requested to be |
2403 | * transmitted with cfg80211_ops::action() to report the TX status of the | 2534 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the |
2404 | * transmission attempt. | 2535 | * transmission attempt. |
2405 | */ | 2536 | */ |
2406 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, | 2537 | void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, |
2407 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 2538 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
2408 | 2539 | ||
2409 | 2540 | ||
2410 | /** | 2541 | /** |
@@ -2427,49 +2558,36 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2427 | /* wiphy_printk helpers, similar to dev_printk */ | 2558 | /* wiphy_printk helpers, similar to dev_printk */ |
2428 | 2559 | ||
2429 | #define wiphy_printk(level, wiphy, format, args...) \ | 2560 | #define wiphy_printk(level, wiphy, format, args...) \ |
2430 | printk(level "%s: " format, wiphy_name(wiphy), ##args) | 2561 | dev_printk(level, &(wiphy)->dev, format, ##args) |
2431 | #define wiphy_emerg(wiphy, format, args...) \ | 2562 | #define wiphy_emerg(wiphy, format, args...) \ |
2432 | wiphy_printk(KERN_EMERG, wiphy, format, ##args) | 2563 | dev_emerg(&(wiphy)->dev, format, ##args) |
2433 | #define wiphy_alert(wiphy, format, args...) \ | 2564 | #define wiphy_alert(wiphy, format, args...) \ |
2434 | wiphy_printk(KERN_ALERT, wiphy, format, ##args) | 2565 | dev_alert(&(wiphy)->dev, format, ##args) |
2435 | #define wiphy_crit(wiphy, format, args...) \ | 2566 | #define wiphy_crit(wiphy, format, args...) \ |
2436 | wiphy_printk(KERN_CRIT, wiphy, format, ##args) | 2567 | dev_crit(&(wiphy)->dev, format, ##args) |
2437 | #define wiphy_err(wiphy, format, args...) \ | 2568 | #define wiphy_err(wiphy, format, args...) \ |
2438 | wiphy_printk(KERN_ERR, wiphy, format, ##args) | 2569 | dev_err(&(wiphy)->dev, format, ##args) |
2439 | #define wiphy_warn(wiphy, format, args...) \ | 2570 | #define wiphy_warn(wiphy, format, args...) \ |
2440 | wiphy_printk(KERN_WARNING, wiphy, format, ##args) | 2571 | dev_warn(&(wiphy)->dev, format, ##args) |
2441 | #define wiphy_notice(wiphy, format, args...) \ | 2572 | #define wiphy_notice(wiphy, format, args...) \ |
2442 | wiphy_printk(KERN_NOTICE, wiphy, format, ##args) | 2573 | dev_notice(&(wiphy)->dev, format, ##args) |
2443 | #define wiphy_info(wiphy, format, args...) \ | 2574 | #define wiphy_info(wiphy, format, args...) \ |
2444 | wiphy_printk(KERN_INFO, wiphy, format, ##args) | 2575 | dev_info(&(wiphy)->dev, format, ##args) |
2445 | |||
2446 | int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | ||
2447 | __attribute__ ((format (printf, 2, 3))); | ||
2448 | 2576 | ||
2449 | #if defined(DEBUG) | 2577 | #define wiphy_debug(wiphy, format, args...) \ |
2450 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2451 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) | 2578 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) |
2452 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 2579 | |
2453 | #define wiphy_dbg(wiphy, format, args...) \ | 2580 | #define wiphy_dbg(wiphy, format, args...) \ |
2454 | dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) | 2581 | dev_dbg(&(wiphy)->dev, format, ##args) |
2455 | #else | ||
2456 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2457 | ({ \ | ||
2458 | if (0) \ | ||
2459 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2460 | 0; \ | ||
2461 | }) | ||
2462 | #endif | ||
2463 | 2582 | ||
2464 | #if defined(VERBOSE_DEBUG) | 2583 | #if defined(VERBOSE_DEBUG) |
2465 | #define wiphy_vdbg wiphy_dbg | 2584 | #define wiphy_vdbg wiphy_dbg |
2466 | #else | 2585 | #else |
2467 | |||
2468 | #define wiphy_vdbg(wiphy, format, args...) \ | 2586 | #define wiphy_vdbg(wiphy, format, args...) \ |
2469 | ({ \ | 2587 | ({ \ |
2470 | if (0) \ | 2588 | if (0) \ |
2471 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | 2589 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ |
2472 | 0; \ | 2590 | 0; \ |
2473 | }) | 2591 | }) |
2474 | #endif | 2592 | #endif |
2475 | 2593 | ||
diff --git a/include/net/gre.h b/include/net/gre.h new file mode 100644 index 000000000000..82665474bcb7 --- /dev/null +++ b/include/net/gre.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef __LINUX_GRE_H | ||
2 | #define __LINUX_GRE_H | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | |||
6 | #define GREPROTO_CISCO 0 | ||
7 | #define GREPROTO_PPTP 1 | ||
8 | #define GREPROTO_MAX 2 | ||
9 | |||
10 | struct gre_protocol { | ||
11 | int (*handler)(struct sk_buff *skb); | ||
12 | void (*err_handler)(struct sk_buff *skb, u32 info); | ||
13 | }; | ||
14 | |||
15 | int gre_add_protocol(const struct gre_protocol *proto, u8 version); | ||
16 | int gre_del_protocol(const struct gre_protocol *proto, u8 version); | ||
17 | |||
18 | #endif | ||
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index b6d3b55da19b..e4f494b42e06 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -125,6 +125,7 @@ struct inet_connection_sock { | |||
125 | int probe_size; | 125 | int probe_size; |
126 | } icsk_mtup; | 126 | } icsk_mtup; |
127 | u32 icsk_ca_priv[16]; | 127 | u32 icsk_ca_priv[16]; |
128 | u32 icsk_user_timeout; | ||
128 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) | 129 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) |
129 | }; | 130 | }; |
130 | 131 | ||
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index 9b5d08f4f6e8..88bdd010d65d 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -27,7 +27,7 @@ static inline int INET_ECN_is_not_ect(__u8 dsfield) | |||
27 | 27 | ||
28 | static inline int INET_ECN_is_capable(__u8 dsfield) | 28 | static inline int INET_ECN_is_capable(__u8 dsfield) |
29 | { | 29 | { |
30 | return (dsfield & INET_ECN_ECT_0); | 30 | return dsfield & INET_ECN_ECT_0; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | 33 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) |
diff --git a/include/net/ip.h b/include/net/ip.h index 890f9725d681..dbee3fe260e1 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -53,7 +53,7 @@ struct ipcm_cookie { | |||
53 | __be32 addr; | 53 | __be32 addr; |
54 | int oif; | 54 | int oif; |
55 | struct ip_options *opt; | 55 | struct ip_options *opt; |
56 | union skb_shared_tx shtx; | 56 | __u8 tx_flags; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 59 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
@@ -238,9 +238,9 @@ int ip_decrease_ttl(struct iphdr *iph) | |||
238 | static inline | 238 | static inline |
239 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | 239 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) |
240 | { | 240 | { |
241 | return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || | 241 | return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || |
242 | (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && | 242 | (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && |
243 | !(dst_metric_locked(dst, RTAX_MTU)))); | 243 | !(dst_metric_locked(dst, RTAX_MTU))); |
244 | } | 244 | } |
245 | 245 | ||
246 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); | 246 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 1f8412410998..4a3cd2cd2f5e 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -262,7 +262,7 @@ static inline int ipv6_addr_scope(const struct in6_addr *addr) | |||
262 | 262 | ||
263 | static inline int __ipv6_addr_src_scope(int type) | 263 | static inline int __ipv6_addr_src_scope(int type) |
264 | { | 264 | { |
265 | return (type == IPV6_ADDR_ANY ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16)); | 265 | return (type == IPV6_ADDR_ANY) ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16); |
266 | } | 266 | } |
267 | 267 | ||
268 | static inline int ipv6_addr_src_scope(const struct in6_addr *addr) | 268 | static inline int ipv6_addr_src_scope(const struct in6_addr *addr) |
@@ -279,10 +279,10 @@ static inline int | |||
279 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | 279 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, |
280 | const struct in6_addr *a2) | 280 | const struct in6_addr *a2) |
281 | { | 281 | { |
282 | return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | | 282 | return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | |
283 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | | 283 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | |
284 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | | 284 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | |
285 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]))); | 285 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])); |
286 | } | 286 | } |
287 | 287 | ||
288 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 288 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
@@ -317,10 +317,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr, | |||
317 | static inline int ipv6_addr_equal(const struct in6_addr *a1, | 317 | static inline int ipv6_addr_equal(const struct in6_addr *a1, |
318 | const struct in6_addr *a2) | 318 | const struct in6_addr *a2) |
319 | { | 319 | { |
320 | return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | | 320 | return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | |
321 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | | 321 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | |
322 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | | 322 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | |
323 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0); | 323 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 326 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, |
@@ -373,20 +373,20 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a); | |||
373 | 373 | ||
374 | static inline int ipv6_addr_any(const struct in6_addr *a) | 374 | static inline int ipv6_addr_any(const struct in6_addr *a) |
375 | { | 375 | { |
376 | return ((a->s6_addr32[0] | a->s6_addr32[1] | | 376 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
377 | a->s6_addr32[2] | a->s6_addr32[3] ) == 0); | 377 | a->s6_addr32[2] | a->s6_addr32[3]) == 0; |
378 | } | 378 | } |
379 | 379 | ||
380 | static inline int ipv6_addr_loopback(const struct in6_addr *a) | 380 | static inline int ipv6_addr_loopback(const struct in6_addr *a) |
381 | { | 381 | { |
382 | return ((a->s6_addr32[0] | a->s6_addr32[1] | | 382 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
383 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0); | 383 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; |
384 | } | 384 | } |
385 | 385 | ||
386 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 386 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) |
387 | { | 387 | { |
388 | return ((a->s6_addr32[0] | a->s6_addr32[1] | | 388 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
389 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0); | 389 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; |
390 | } | 390 | } |
391 | 391 | ||
392 | /* | 392 | /* |
@@ -395,8 +395,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | |||
395 | */ | 395 | */ |
396 | static inline int ipv6_addr_orchid(const struct in6_addr *a) | 396 | static inline int ipv6_addr_orchid(const struct in6_addr *a) |
397 | { | 397 | { |
398 | return ((a->s6_addr32[0] & htonl(0xfffffff0)) | 398 | return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010); |
399 | == htonl(0x20010010)); | ||
400 | } | 399 | } |
401 | 400 | ||
402 | static inline void ipv6_addr_set_v4mapped(const __be32 addr, | 401 | static inline void ipv6_addr_set_v4mapped(const __be32 addr, |
@@ -441,7 +440,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a | |||
441 | * if returned value is greater than prefix length. | 440 | * if returned value is greater than prefix length. |
442 | * --ANK (980803) | 441 | * --ANK (980803) |
443 | */ | 442 | */ |
444 | return (addrlen << 5); | 443 | return addrlen << 5; |
445 | } | 444 | } |
446 | 445 | ||
447 | static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) | 446 | static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) |
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h index 73cacb3ac16c..0af8b8dfbc22 100644 --- a/include/net/irda/irlan_common.h +++ b/include/net/irda/irlan_common.h | |||
@@ -171,7 +171,6 @@ struct irlan_cb { | |||
171 | int magic; | 171 | int magic; |
172 | struct list_head dev_list; | 172 | struct list_head dev_list; |
173 | struct net_device *dev; /* Ethernet device structure*/ | 173 | struct net_device *dev; /* Ethernet device structure*/ |
174 | struct net_device_stats stats; | ||
175 | 174 | ||
176 | __u32 saddr; /* Source device address */ | 175 | __u32 saddr; /* Source device address */ |
177 | __u32 daddr; /* Destination device address */ | 176 | __u32 daddr; /* Destination device address */ |
diff --git a/include/net/irda/irlan_event.h b/include/net/irda/irlan_event.h index 6d9539f05806..018b5a77e610 100644 --- a/include/net/irda/irlan_event.h +++ b/include/net/irda/irlan_event.h | |||
@@ -67,7 +67,7 @@ typedef enum { | |||
67 | IRLAN_WATCHDOG_TIMEOUT, | 67 | IRLAN_WATCHDOG_TIMEOUT, |
68 | } IRLAN_EVENT; | 68 | } IRLAN_EVENT; |
69 | 69 | ||
70 | extern char *irlan_state[]; | 70 | extern const char * const irlan_state[]; |
71 | 71 | ||
72 | void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, | 72 | void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, |
73 | struct sk_buff *skb); | 73 | struct sk_buff *skb); |
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index 9d0c78ea92f5..17fcd964f9d9 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h | |||
@@ -282,7 +282,7 @@ static inline int irlap_is_primary(struct irlap_cb *self) | |||
282 | default: | 282 | default: |
283 | ret = -1; | 283 | ret = -1; |
284 | } | 284 | } |
285 | return(ret); | 285 | return ret; |
286 | } | 286 | } |
287 | 287 | ||
288 | /* Clear a pending IrLAP disconnect. - Jean II */ | 288 | /* Clear a pending IrLAP disconnect. - Jean II */ |
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index 3ffc1d0f93d6..fff11b7fe8a4 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h | |||
@@ -274,7 +274,7 @@ static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self) | |||
274 | if (self->lap->irlap == NULL) | 274 | if (self->lap->irlap == NULL) |
275 | return 0; | 275 | return 0; |
276 | 276 | ||
277 | return(IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD); | 277 | return IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD; |
278 | } | 278 | } |
279 | 279 | ||
280 | /* After doing a irlmp_dup(), this get one of the two socket back into | 280 | /* After doing a irlmp_dup(), this get one of the two socket back into |
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h index 11aee7a2972a..af4b87721d13 100644 --- a/include/net/irda/irttp.h +++ b/include/net/irda/irttp.h | |||
@@ -204,7 +204,7 @@ static inline int irttp_is_primary(struct tsap_cb *self) | |||
204 | (self->lsap->lap == NULL) || | 204 | (self->lsap->lap == NULL) || |
205 | (self->lsap->lap->irlap == NULL)) | 205 | (self->lsap->lap->irlap == NULL)) |
206 | return -2; | 206 | return -2; |
207 | return(irlap_is_primary(self->lsap->lap->irlap)); | 207 | return irlap_is_primary(self->lsap->lap->irlap); |
208 | } | 208 | } |
209 | 209 | ||
210 | #endif /* IRTTP_H */ | 210 | #endif /* IRTTP_H */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b0787a1dea90..12a49f0ba32c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -149,6 +149,7 @@ struct ieee80211_low_level_stats { | |||
149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. | 149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. |
150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | 150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note |
151 | * that it is only ever disabled for station mode. | 151 | * that it is only ever disabled for station mode. |
152 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | ||
152 | */ | 153 | */ |
153 | enum ieee80211_bss_change { | 154 | enum ieee80211_bss_change { |
154 | BSS_CHANGED_ASSOC = 1<<0, | 155 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -165,6 +166,7 @@ enum ieee80211_bss_change { | |||
165 | BSS_CHANGED_IBSS = 1<<11, | 166 | BSS_CHANGED_IBSS = 1<<11, |
166 | BSS_CHANGED_ARP_FILTER = 1<<12, | 167 | BSS_CHANGED_ARP_FILTER = 1<<12, |
167 | BSS_CHANGED_QOS = 1<<13, | 168 | BSS_CHANGED_QOS = 1<<13, |
169 | BSS_CHANGED_IDLE = 1<<14, | ||
168 | 170 | ||
169 | /* when adding here, make sure to change ieee80211_reconfig */ | 171 | /* when adding here, make sure to change ieee80211_reconfig */ |
170 | }; | 172 | }; |
@@ -223,6 +225,9 @@ enum ieee80211_bss_change { | |||
223 | * hardware must not perform any ARP filtering. Note, that the filter will | 225 | * hardware must not perform any ARP filtering. Note, that the filter will |
224 | * be enabled also in promiscuous mode. | 226 | * be enabled also in promiscuous mode. |
225 | * @qos: This is a QoS-enabled BSS. | 227 | * @qos: This is a QoS-enabled BSS. |
228 | * @idle: This interface is idle. There's also a global idle flag in the | ||
229 | * hardware config which may be more appropriate depending on what | ||
230 | * your driver/device needs to do. | ||
226 | */ | 231 | */ |
227 | struct ieee80211_bss_conf { | 232 | struct ieee80211_bss_conf { |
228 | const u8 *bssid; | 233 | const u8 *bssid; |
@@ -247,6 +252,7 @@ struct ieee80211_bss_conf { | |||
247 | u8 arp_addr_cnt; | 252 | u8 arp_addr_cnt; |
248 | bool arp_filter_enabled; | 253 | bool arp_filter_enabled; |
249 | bool qos; | 254 | bool qos; |
255 | bool idle; | ||
250 | }; | 256 | }; |
251 | 257 | ||
252 | /** | 258 | /** |
@@ -763,6 +769,8 @@ struct ieee80211_channel_switch { | |||
763 | * @bss_conf: BSS configuration for this interface, either our own | 769 | * @bss_conf: BSS configuration for this interface, either our own |
764 | * or the BSS we're associated to | 770 | * or the BSS we're associated to |
765 | * @addr: address of this interface | 771 | * @addr: address of this interface |
772 | * @p2p: indicates whether this AP or STA interface is a p2p | ||
773 | * interface, i.e. a GO or p2p-sta respectively | ||
766 | * @drv_priv: data area for driver use, will always be aligned to | 774 | * @drv_priv: data area for driver use, will always be aligned to |
767 | * sizeof(void *). | 775 | * sizeof(void *). |
768 | */ | 776 | */ |
@@ -770,6 +778,7 @@ struct ieee80211_vif { | |||
770 | enum nl80211_iftype type; | 778 | enum nl80211_iftype type; |
771 | struct ieee80211_bss_conf bss_conf; | 779 | struct ieee80211_bss_conf bss_conf; |
772 | u8 addr[ETH_ALEN]; | 780 | u8 addr[ETH_ALEN]; |
781 | bool p2p; | ||
773 | /* must be last */ | 782 | /* must be last */ |
774 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 783 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
775 | }; | 784 | }; |
@@ -783,20 +792,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
783 | } | 792 | } |
784 | 793 | ||
785 | /** | 794 | /** |
786 | * enum ieee80211_key_alg - key algorithm | ||
787 | * @ALG_WEP: WEP40 or WEP104 | ||
788 | * @ALG_TKIP: TKIP | ||
789 | * @ALG_CCMP: CCMP (AES) | ||
790 | * @ALG_AES_CMAC: AES-128-CMAC | ||
791 | */ | ||
792 | enum ieee80211_key_alg { | ||
793 | ALG_WEP, | ||
794 | ALG_TKIP, | ||
795 | ALG_CCMP, | ||
796 | ALG_AES_CMAC, | ||
797 | }; | ||
798 | |||
799 | /** | ||
800 | * enum ieee80211_key_flags - key flags | 795 | * enum ieee80211_key_flags - key flags |
801 | * | 796 | * |
802 | * These flags are used for communication about keys between the driver | 797 | * These flags are used for communication about keys between the driver |
@@ -833,7 +828,7 @@ enum ieee80211_key_flags { | |||
833 | * @hw_key_idx: To be set by the driver, this is the key index the driver | 828 | * @hw_key_idx: To be set by the driver, this is the key index the driver |
834 | * wants to be given when a frame is transmitted and needs to be | 829 | * wants to be given when a frame is transmitted and needs to be |
835 | * encrypted in hardware. | 830 | * encrypted in hardware. |
836 | * @alg: The key algorithm. | 831 | * @cipher: The key's cipher suite selector. |
837 | * @flags: key flags, see &enum ieee80211_key_flags. | 832 | * @flags: key flags, see &enum ieee80211_key_flags. |
838 | * @keyidx: the key index (0-3) | 833 | * @keyidx: the key index (0-3) |
839 | * @keylen: key material length | 834 | * @keylen: key material length |
@@ -846,7 +841,7 @@ enum ieee80211_key_flags { | |||
846 | * @iv_len: The IV length for this key type | 841 | * @iv_len: The IV length for this key type |
847 | */ | 842 | */ |
848 | struct ieee80211_key_conf { | 843 | struct ieee80211_key_conf { |
849 | enum ieee80211_key_alg alg; | 844 | u32 cipher; |
850 | u8 icv_len; | 845 | u8 icv_len; |
851 | u8 iv_len; | 846 | u8 iv_len; |
852 | u8 hw_key_idx; | 847 | u8 hw_key_idx; |
@@ -1102,6 +1097,10 @@ enum ieee80211_hw_flags { | |||
1102 | * | 1097 | * |
1103 | * @max_rates: maximum number of alternate rate retry stages | 1098 | * @max_rates: maximum number of alternate rate retry stages |
1104 | * @max_rate_tries: maximum number of tries for each stage | 1099 | * @max_rate_tries: maximum number of tries for each stage |
1100 | * | ||
1101 | * @napi_weight: weight used for NAPI polling. You must specify an | ||
1102 | * appropriate value here if a napi_poll operation is provided | ||
1103 | * by your driver. | ||
1105 | */ | 1104 | */ |
1106 | struct ieee80211_hw { | 1105 | struct ieee80211_hw { |
1107 | struct ieee80211_conf conf; | 1106 | struct ieee80211_conf conf; |
@@ -1113,6 +1112,7 @@ struct ieee80211_hw { | |||
1113 | int channel_change_time; | 1112 | int channel_change_time; |
1114 | int vif_data_size; | 1113 | int vif_data_size; |
1115 | int sta_data_size; | 1114 | int sta_data_size; |
1115 | int napi_weight; | ||
1116 | u16 queues; | 1116 | u16 queues; |
1117 | u16 max_listen_interval; | 1117 | u16 max_listen_interval; |
1118 | s8 max_signal; | 1118 | s8 max_signal; |
@@ -1245,8 +1245,8 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1245 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in | 1245 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in |
1246 | * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused | 1246 | * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused |
1247 | * with hardware wakeup and sleep states. Driver is responsible for waking | 1247 | * with hardware wakeup and sleep states. Driver is responsible for waking |
1248 | * up the hardware before issueing commands to the hardware and putting it | 1248 | * up the hardware before issuing commands to the hardware and putting it |
1249 | * back to sleep at approriate times. | 1249 | * back to sleep at appropriate times. |
1250 | * | 1250 | * |
1251 | * When PS is enabled, hardware needs to wakeup for beacons and receive the | 1251 | * When PS is enabled, hardware needs to wakeup for beacons and receive the |
1252 | * buffered multicast/broadcast frames after the beacon. Also it must be | 1252 | * buffered multicast/broadcast frames after the beacon. Also it must be |
@@ -1267,7 +1267,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1267 | * there's data traffic and still saving significantly power in idle | 1267 | * there's data traffic and still saving significantly power in idle |
1268 | * periods. | 1268 | * periods. |
1269 | * | 1269 | * |
1270 | * Dynamic powersave is supported by simply mac80211 enabling and disabling | 1270 | * Dynamic powersave is simply supported by mac80211 enabling and disabling |
1271 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS | 1271 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS |
1272 | * flag and mac80211 will handle everything automatically. Additionally, | 1272 | * flag and mac80211 will handle everything automatically. Additionally, |
1273 | * hardware having support for the dynamic PS feature may set the | 1273 | * hardware having support for the dynamic PS feature may set the |
@@ -1540,6 +1540,12 @@ enum ieee80211_ampdu_mlme_action { | |||
1540 | * negative error code (which will be seen in userspace.) | 1540 | * negative error code (which will be seen in userspace.) |
1541 | * Must be implemented and can sleep. | 1541 | * Must be implemented and can sleep. |
1542 | * | 1542 | * |
1543 | * @change_interface: Called when a netdevice changes type. This callback | ||
1544 | * is optional, but only if it is supported can interface types be | ||
1545 | * switched while the interface is UP. The callback may sleep. | ||
1546 | * Note that while an interface is being switched, it will not be | ||
1547 | * found by the interface iteration callbacks. | ||
1548 | * | ||
1543 | * @remove_interface: Notifies a driver that an interface is going down. | 1549 | * @remove_interface: Notifies a driver that an interface is going down. |
1544 | * The @stop callback is called after this if it is the last interface | 1550 | * The @stop callback is called after this if it is the last interface |
1545 | * and no monitor interfaces are present. | 1551 | * and no monitor interfaces are present. |
@@ -1687,6 +1693,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1687 | * switch operation for CSAs received from the AP may implement this | 1693 | * switch operation for CSAs received from the AP may implement this |
1688 | * callback. They must then call ieee80211_chswitch_done() to indicate | 1694 | * callback. They must then call ieee80211_chswitch_done() to indicate |
1689 | * completion of the channel switch. | 1695 | * completion of the channel switch. |
1696 | * | ||
1697 | * @napi_poll: Poll Rx queue for incoming data frames. | ||
1690 | */ | 1698 | */ |
1691 | struct ieee80211_ops { | 1699 | struct ieee80211_ops { |
1692 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1700 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1694,6 +1702,9 @@ struct ieee80211_ops { | |||
1694 | void (*stop)(struct ieee80211_hw *hw); | 1702 | void (*stop)(struct ieee80211_hw *hw); |
1695 | int (*add_interface)(struct ieee80211_hw *hw, | 1703 | int (*add_interface)(struct ieee80211_hw *hw, |
1696 | struct ieee80211_vif *vif); | 1704 | struct ieee80211_vif *vif); |
1705 | int (*change_interface)(struct ieee80211_hw *hw, | ||
1706 | struct ieee80211_vif *vif, | ||
1707 | enum nl80211_iftype new_type, bool p2p); | ||
1697 | void (*remove_interface)(struct ieee80211_hw *hw, | 1708 | void (*remove_interface)(struct ieee80211_hw *hw, |
1698 | struct ieee80211_vif *vif); | 1709 | struct ieee80211_vif *vif); |
1699 | int (*config)(struct ieee80211_hw *hw, u32 changed); | 1710 | int (*config)(struct ieee80211_hw *hw, u32 changed); |
@@ -1752,6 +1763,7 @@ struct ieee80211_ops { | |||
1752 | void (*flush)(struct ieee80211_hw *hw, bool drop); | 1763 | void (*flush)(struct ieee80211_hw *hw, bool drop); |
1753 | void (*channel_switch)(struct ieee80211_hw *hw, | 1764 | void (*channel_switch)(struct ieee80211_hw *hw, |
1754 | struct ieee80211_channel_switch *ch_switch); | 1765 | struct ieee80211_channel_switch *ch_switch); |
1766 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | ||
1755 | }; | 1767 | }; |
1756 | 1768 | ||
1757 | /** | 1769 | /** |
@@ -1897,6 +1909,22 @@ void ieee80211_free_hw(struct ieee80211_hw *hw); | |||
1897 | */ | 1909 | */ |
1898 | void ieee80211_restart_hw(struct ieee80211_hw *hw); | 1910 | void ieee80211_restart_hw(struct ieee80211_hw *hw); |
1899 | 1911 | ||
1912 | /** ieee80211_napi_schedule - schedule NAPI poll | ||
1913 | * | ||
1914 | * Use this function to schedule NAPI polling on a device. | ||
1915 | * | ||
1916 | * @hw: the hardware to start polling | ||
1917 | */ | ||
1918 | void ieee80211_napi_schedule(struct ieee80211_hw *hw); | ||
1919 | |||
1920 | /** ieee80211_napi_complete - complete NAPI polling | ||
1921 | * | ||
1922 | * Use this function to finish NAPI polling on a device. | ||
1923 | * | ||
1924 | * @hw: the hardware to stop polling | ||
1925 | */ | ||
1926 | void ieee80211_napi_complete(struct ieee80211_hw *hw); | ||
1927 | |||
1900 | /** | 1928 | /** |
1901 | * ieee80211_rx - receive frame | 1929 | * ieee80211_rx - receive frame |
1902 | * | 1930 | * |
@@ -2252,7 +2280,8 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
2252 | * | 2280 | * |
2253 | * When hardware scan offload is used (i.e. the hw_scan() callback is | 2281 | * When hardware scan offload is used (i.e. the hw_scan() callback is |
2254 | * assigned) this function needs to be called by the driver to notify | 2282 | * assigned) this function needs to be called by the driver to notify |
2255 | * mac80211 that the scan finished. | 2283 | * mac80211 that the scan finished. This function can be called from |
2284 | * any context, including hardirq context. | ||
2256 | * | 2285 | * |
2257 | * @hw: the hardware that finished the scan | 2286 | * @hw: the hardware that finished the scan |
2258 | * @aborted: set to true if scan was aborted | 2287 | * @aborted: set to true if scan was aborted |
@@ -2267,6 +2296,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); | |||
2267 | * This function allows the iterator function to sleep, when the iterator | 2296 | * This function allows the iterator function to sleep, when the iterator |
2268 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 2297 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
2269 | * be used. | 2298 | * be used. |
2299 | * Does not iterate over a new interface during add_interface() | ||
2270 | * | 2300 | * |
2271 | * @hw: the hardware struct of which the interfaces should be iterated over | 2301 | * @hw: the hardware struct of which the interfaces should be iterated over |
2272 | * @iterator: the iterator function to call | 2302 | * @iterator: the iterator function to call |
@@ -2284,6 +2314,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
2284 | * hardware that are currently active and calls the callback for them. | 2314 | * hardware that are currently active and calls the callback for them. |
2285 | * This function requires the iterator callback function to be atomic, | 2315 | * This function requires the iterator callback function to be atomic, |
2286 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 2316 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
2317 | * Does not iterate over a new interface during add_interface() | ||
2287 | * | 2318 | * |
2288 | * @hw: the hardware struct of which the interfaces should be iterated over | 2319 | * @hw: the hardware struct of which the interfaces should be iterated over |
2289 | * @iterator: the iterator function to call, cannot sleep | 2320 | * @iterator: the iterator function to call, cannot sleep |
@@ -2442,7 +2473,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2442 | * | 2473 | * |
2443 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2474 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
2444 | * | 2475 | * |
2445 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and | 2476 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and |
2446 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2477 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
2447 | * hardware is not receiving beacons with this function. | 2478 | * hardware is not receiving beacons with this function. |
2448 | */ | 2479 | */ |
@@ -2453,7 +2484,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif); | |||
2453 | * | 2484 | * |
2454 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2485 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
2455 | * | 2486 | * |
2456 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and | 2487 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and |
2457 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | 2488 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver |
2458 | * needs to inform if the connection to the AP has been lost. | 2489 | * needs to inform if the connection to the AP has been lost. |
2459 | * | 2490 | * |
@@ -2518,6 +2549,18 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
2518 | */ | 2549 | */ |
2519 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); | 2550 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); |
2520 | 2551 | ||
2552 | /** | ||
2553 | * ieee80211_request_smps - request SM PS transition | ||
2554 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2555 | * @smps_mode: new SM PS mode | ||
2556 | * | ||
2557 | * This allows the driver to request an SM PS transition in managed | ||
2558 | * mode. This is useful when the driver has more information than | ||
2559 | * the stack about possible interference, for example by bluetooth. | ||
2560 | */ | ||
2561 | void ieee80211_request_smps(struct ieee80211_vif *vif, | ||
2562 | enum ieee80211_smps_mode smps_mode); | ||
2563 | |||
2521 | /* Rate control API */ | 2564 | /* Rate control API */ |
2522 | 2565 | ||
2523 | /** | 2566 | /** |
@@ -2681,4 +2724,26 @@ conf_is_ht(struct ieee80211_conf *conf) | |||
2681 | return conf->channel_type != NL80211_CHAN_NO_HT; | 2724 | return conf->channel_type != NL80211_CHAN_NO_HT; |
2682 | } | 2725 | } |
2683 | 2726 | ||
2727 | static inline enum nl80211_iftype | ||
2728 | ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p) | ||
2729 | { | ||
2730 | if (p2p) { | ||
2731 | switch (type) { | ||
2732 | case NL80211_IFTYPE_STATION: | ||
2733 | return NL80211_IFTYPE_P2P_CLIENT; | ||
2734 | case NL80211_IFTYPE_AP: | ||
2735 | return NL80211_IFTYPE_P2P_GO; | ||
2736 | default: | ||
2737 | break; | ||
2738 | } | ||
2739 | } | ||
2740 | return type; | ||
2741 | } | ||
2742 | |||
2743 | static inline enum nl80211_iftype | ||
2744 | ieee80211_vif_type_p2p(struct ieee80211_vif *vif) | ||
2745 | { | ||
2746 | return ieee80211_iftype_p2p(vif->type, vif->p2p); | ||
2747 | } | ||
2748 | |||
2684 | #endif /* MAC80211_H */ | 2749 | #endif /* MAC80211_H */ |
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h index 35672b1cf44a..37f23dc05de8 100644 --- a/include/net/phonet/pep.h +++ b/include/net/phonet/pep.h | |||
@@ -77,6 +77,11 @@ static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb) | |||
77 | #define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) | 77 | #define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) |
78 | 78 | ||
79 | enum { | 79 | enum { |
80 | PNS_PIPE_CREATE_REQ = 0x00, | ||
81 | PNS_PIPE_CREATE_RESP, | ||
82 | PNS_PIPE_REMOVE_REQ, | ||
83 | PNS_PIPE_REMOVE_RESP, | ||
84 | |||
80 | PNS_PIPE_DATA = 0x20, | 85 | PNS_PIPE_DATA = 0x20, |
81 | PNS_PIPE_ALIGNED_DATA, | 86 | PNS_PIPE_ALIGNED_DATA, |
82 | 87 | ||
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h index 7b114079a51b..d5df797f9540 100644 --- a/include/net/phonet/phonet.h +++ b/include/net/phonet/phonet.h | |||
@@ -54,6 +54,11 @@ void pn_sock_hash(struct sock *sk); | |||
54 | void pn_sock_unhash(struct sock *sk); | 54 | void pn_sock_unhash(struct sock *sk); |
55 | int pn_sock_get_port(struct sock *sk, unsigned short sport); | 55 | int pn_sock_get_port(struct sock *sk, unsigned short sport); |
56 | 56 | ||
57 | struct sock *pn_find_sock_by_res(struct net *net, u8 res); | ||
58 | int pn_sock_bind_res(struct sock *sock, u8 res); | ||
59 | int pn_sock_unbind_res(struct sock *sk, u8 res); | ||
60 | void pn_sock_unbind_all_res(struct sock *sk); | ||
61 | |||
57 | int pn_skb_send(struct sock *sk, struct sk_buff *skb, | 62 | int pn_skb_send(struct sock *sk, struct sk_buff *skb, |
58 | const struct sockaddr_pn *target); | 63 | const struct sockaddr_pn *target); |
59 | 64 | ||
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 2d16783d5e20..13649eb57413 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -57,5 +57,6 @@ struct net_device *phonet_route_output(struct net *net, u8 daddr); | |||
57 | #define PN_NO_ADDR 0xff | 57 | #define PN_NO_ADDR 0xff |
58 | 58 | ||
59 | extern const struct file_operations pn_sock_seq_fops; | 59 | extern const struct file_operations pn_sock_seq_fops; |
60 | extern const struct file_operations pn_res_seq_fops; | ||
60 | 61 | ||
61 | #endif | 62 | #endif |
diff --git a/include/net/raw.h b/include/net/raw.h index 43c57502659b..42ce6fe7a2d5 100644 --- a/include/net/raw.h +++ b/include/net/raw.h | |||
@@ -45,7 +45,10 @@ struct raw_iter_state { | |||
45 | struct raw_hashinfo *h; | 45 | struct raw_hashinfo *h; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | #define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private) | 48 | static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq) |
49 | { | ||
50 | return seq->private; | ||
51 | } | ||
49 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); | 52 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); |
50 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); | 53 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); |
51 | void raw_seq_stop(struct seq_file *seq, void *v); | 54 | void raw_seq_stop(struct seq_file *seq, void *v); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 3c8728aaab4e..eda8808fdacd 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -601,7 +601,7 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen) | |||
601 | slot = 0; | 601 | slot = 0; |
602 | slot >>= rtab->rate.cell_log; | 602 | slot >>= rtab->rate.cell_log; |
603 | if (slot > 255) | 603 | if (slot > 255) |
604 | return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]); | 604 | return rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]; |
605 | return rtab->data[slot]; | 605 | return rtab->data[slot]; |
606 | } | 606 | } |
607 | 607 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 65946bc43d00..505845ddb0be 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -275,24 +275,35 @@ struct sctp_mib { | |||
275 | /* Print debugging messages. */ | 275 | /* Print debugging messages. */ |
276 | #if SCTP_DEBUG | 276 | #if SCTP_DEBUG |
277 | extern int sctp_debug_flag; | 277 | extern int sctp_debug_flag; |
278 | #define SCTP_DEBUG_PRINTK(whatever...) \ | 278 | #define SCTP_DEBUG_PRINTK(fmt, args...) \ |
279 | ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) | 279 | do { \ |
280 | #define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ | 280 | if (sctp_debug_flag) \ |
281 | if (sctp_debug_flag) { \ | 281 | printk(KERN_DEBUG pr_fmt(fmt), ##args); \ |
282 | if (saddr->sa.sa_family == AF_INET6) { \ | 282 | } while (0) |
283 | printk(KERN_DEBUG \ | 283 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \ |
284 | lead "%pI6" trail, \ | 284 | do { \ |
285 | leadparm, \ | 285 | if (sctp_debug_flag) \ |
286 | &saddr->v6.sin6_addr, \ | 286 | pr_cont(fmt, ##args); \ |
287 | otherparms); \ | 287 | } while (0) |
288 | } else { \ | 288 | #define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ |
289 | printk(KERN_DEBUG \ | 289 | args_lead, saddr, args_trail...) \ |
290 | lead "%pI4" trail, \ | 290 | do { \ |
291 | leadparm, \ | 291 | if (sctp_debug_flag) { \ |
292 | &saddr->v4.sin_addr.s_addr, \ | 292 | if (saddr->sa.sa_family == AF_INET6) { \ |
293 | otherparms); \ | 293 | printk(KERN_DEBUG \ |
294 | } \ | 294 | pr_fmt(fmt_lead "%pI6" fmt_trail), \ |
295 | } | 295 | args_lead, \ |
296 | &saddr->v6.sin6_addr, \ | ||
297 | args_trail); \ | ||
298 | } else { \ | ||
299 | printk(KERN_DEBUG \ | ||
300 | pr_fmt(fmt_lead "%pI4" fmt_trail), \ | ||
301 | args_lead, \ | ||
302 | &saddr->v4.sin_addr.s_addr, \ | ||
303 | args_trail); \ | ||
304 | } \ | ||
305 | } \ | ||
306 | } while (0) | ||
296 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } | 307 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } |
297 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } | 308 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } |
298 | 309 | ||
@@ -306,6 +317,7 @@ extern int sctp_debug_flag; | |||
306 | #else /* SCTP_DEBUG */ | 317 | #else /* SCTP_DEBUG */ |
307 | 318 | ||
308 | #define SCTP_DEBUG_PRINTK(whatever...) | 319 | #define SCTP_DEBUG_PRINTK(whatever...) |
320 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) | ||
309 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) | 321 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) |
310 | #define SCTP_ENABLE_DEBUG | 322 | #define SCTP_ENABLE_DEBUG |
311 | #define SCTP_DISABLE_DEBUG | 323 | #define SCTP_DISABLE_DEBUG |
@@ -393,7 +405,7 @@ static inline void sctp_v6_del_protocol(void) { return; } | |||
393 | /* Map an association to an assoc_id. */ | 405 | /* Map an association to an assoc_id. */ |
394 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) | 406 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) |
395 | { | 407 | { |
396 | return (asoc?asoc->assoc_id:0); | 408 | return asoc ? asoc->assoc_id : 0; |
397 | } | 409 | } |
398 | 410 | ||
399 | /* Look up the association by its id. */ | 411 | /* Look up the association by its id. */ |
@@ -461,7 +473,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
461 | /* Tests if the list has one and only one entry. */ | 473 | /* Tests if the list has one and only one entry. */ |
462 | static inline int sctp_list_single_entry(struct list_head *head) | 474 | static inline int sctp_list_single_entry(struct list_head *head) |
463 | { | 475 | { |
464 | return ((head->next != head) && (head->next == head->prev)); | 476 | return (head->next != head) && (head->next == head->prev); |
465 | } | 477 | } |
466 | 478 | ||
467 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ | 479 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ |
@@ -619,13 +631,13 @@ static inline int sctp_sanity_check(void) | |||
619 | /* This is the hash function for the SCTP port hash table. */ | 631 | /* This is the hash function for the SCTP port hash table. */ |
620 | static inline int sctp_phashfn(__u16 lport) | 632 | static inline int sctp_phashfn(__u16 lport) |
621 | { | 633 | { |
622 | return (lport & (sctp_port_hashsize - 1)); | 634 | return lport & (sctp_port_hashsize - 1); |
623 | } | 635 | } |
624 | 636 | ||
625 | /* This is the hash function for the endpoint hash table. */ | 637 | /* This is the hash function for the endpoint hash table. */ |
626 | static inline int sctp_ep_hashfn(__u16 lport) | 638 | static inline int sctp_ep_hashfn(__u16 lport) |
627 | { | 639 | { |
628 | return (lport & (sctp_ep_hashsize - 1)); | 640 | return lport & (sctp_ep_hashsize - 1); |
629 | } | 641 | } |
630 | 642 | ||
631 | /* This is the hash function for the association hash table. */ | 643 | /* This is the hash function for the association hash table. */ |
@@ -633,7 +645,7 @@ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) | |||
633 | { | 645 | { |
634 | int h = (lport << 16) + rport; | 646 | int h = (lport << 16) + rport; |
635 | h ^= h>>8; | 647 | h ^= h>>8; |
636 | return (h & (sctp_assoc_hashsize - 1)); | 648 | return h & (sctp_assoc_hashsize - 1); |
637 | } | 649 | } |
638 | 650 | ||
639 | /* This is the hash function for the association hash table. This is | 651 | /* This is the hash function for the association hash table. This is |
@@ -644,7 +656,7 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) | |||
644 | { | 656 | { |
645 | int h = (lport << 16) + rport; | 657 | int h = (lport << 16) + rport; |
646 | h ^= vtag; | 658 | h ^= vtag; |
647 | return (h & (sctp_assoc_hashsize-1)); | 659 | return h & (sctp_assoc_hashsize - 1); |
648 | } | 660 | } |
649 | 661 | ||
650 | #define sctp_for_each_hentry(epb, node, head) \ | 662 | #define sctp_for_each_hentry(epb, node, head) \ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 4088c89a9055..9352d12f02de 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -345,12 +345,12 @@ enum { | |||
345 | 345 | ||
346 | static inline int TSN_lt(__u32 s, __u32 t) | 346 | static inline int TSN_lt(__u32 s, __u32 t) |
347 | { | 347 | { |
348 | return (((s) - (t)) & TSN_SIGN_BIT); | 348 | return ((s) - (t)) & TSN_SIGN_BIT; |
349 | } | 349 | } |
350 | 350 | ||
351 | static inline int TSN_lte(__u32 s, __u32 t) | 351 | static inline int TSN_lte(__u32 s, __u32 t) |
352 | { | 352 | { |
353 | return (((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT)); | 353 | return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT); |
354 | } | 354 | } |
355 | 355 | ||
356 | /* Compare two SSNs */ | 356 | /* Compare two SSNs */ |
@@ -369,12 +369,12 @@ enum { | |||
369 | 369 | ||
370 | static inline int SSN_lt(__u16 s, __u16 t) | 370 | static inline int SSN_lt(__u16 s, __u16 t) |
371 | { | 371 | { |
372 | return (((s) - (t)) & SSN_SIGN_BIT); | 372 | return ((s) - (t)) & SSN_SIGN_BIT; |
373 | } | 373 | } |
374 | 374 | ||
375 | static inline int SSN_lte(__u16 s, __u16 t) | 375 | static inline int SSN_lte(__u16 s, __u16 t) |
376 | { | 376 | { |
377 | return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); | 377 | return ((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT); |
378 | } | 378 | } |
379 | 379 | ||
380 | /* | 380 | /* |
@@ -388,7 +388,7 @@ enum { | |||
388 | 388 | ||
389 | static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) | 389 | static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) |
390 | { | 390 | { |
391 | return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); | 391 | return ((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT); |
392 | } | 392 | } |
393 | 393 | ||
394 | /* Check VTAG of the packet matches the sender's own tag. */ | 394 | /* Check VTAG of the packet matches the sender's own tag. */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index f9e7473613bd..69fef4fb79c0 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -847,7 +847,7 @@ void sctp_packet_free(struct sctp_packet *); | |||
847 | 847 | ||
848 | static inline int sctp_packet_empty(struct sctp_packet *packet) | 848 | static inline int sctp_packet_empty(struct sctp_packet *packet) |
849 | { | 849 | { |
850 | return (packet->size == packet->overhead); | 850 | return packet->size == packet->overhead; |
851 | } | 851 | } |
852 | 852 | ||
853 | /* This represents a remote transport address. | 853 | /* This represents a remote transport address. |
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 4aabc5a96cf6..e7728bc14ccf 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h | |||
@@ -157,7 +157,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map); | |||
157 | /* Is there a gap in the TSN map? */ | 157 | /* Is there a gap in the TSN map? */ |
158 | static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) | 158 | static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) |
159 | { | 159 | { |
160 | return (map->cumulative_tsn_ack_point != map->max_tsn_seen); | 160 | return map->cumulative_tsn_ack_point != map->max_tsn_seen; |
161 | } | 161 | } |
162 | 162 | ||
163 | /* Mark a duplicate TSN. Note: limit the storage of duplicate TSN | 163 | /* Mark a duplicate TSN. Note: limit the storage of duplicate TSN |
diff --git a/include/net/sock.h b/include/net/sock.h index adab9dc58183..73a4f9702a65 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1558,7 +1558,11 @@ static inline void sk_wake_async(struct sock *sk, int how, int band) | |||
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | #define SOCK_MIN_SNDBUF 2048 | 1560 | #define SOCK_MIN_SNDBUF 2048 |
1561 | #define SOCK_MIN_RCVBUF 256 | 1561 | /* |
1562 | * Since sk_rmem_alloc sums skb->truesize, even a small frame might need | ||
1563 | * sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak | ||
1564 | */ | ||
1565 | #define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff)) | ||
1562 | 1566 | ||
1563 | static inline void sk_stream_moderate_sndbuf(struct sock *sk) | 1567 | static inline void sk_stream_moderate_sndbuf(struct sock *sk) |
1564 | { | 1568 | { |
@@ -1670,17 +1674,13 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | |||
1670 | 1674 | ||
1671 | /** | 1675 | /** |
1672 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 1676 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
1673 | * @msg: outgoing packet | ||
1674 | * @sk: socket sending this packet | 1677 | * @sk: socket sending this packet |
1675 | * @shtx: filled with instructions for time stamping | 1678 | * @tx_flags: filled with instructions for time stamping |
1676 | * | 1679 | * |
1677 | * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if | 1680 | * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if |
1678 | * parameters are invalid. | 1681 | * parameters are invalid. |
1679 | */ | 1682 | */ |
1680 | extern int sock_tx_timestamp(struct msghdr *msg, | 1683 | extern int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); |
1681 | struct sock *sk, | ||
1682 | union skb_shared_tx *shtx); | ||
1683 | |||
1684 | 1684 | ||
1685 | /** | 1685 | /** |
1686 | * sk_eat_skb - Release a skb if it is no longer needed | 1686 | * sk_eat_skb - Release a skb if it is no longer needed |
diff --git a/include/net/tc_act/tc_csum.h b/include/net/tc_act/tc_csum.h new file mode 100644 index 000000000000..9e8710be7a04 --- /dev/null +++ b/include/net/tc_act/tc_csum.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __NET_TC_CSUM_H | ||
2 | #define __NET_TC_CSUM_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <net/act_api.h> | ||
6 | |||
7 | struct tcf_csum { | ||
8 | struct tcf_common common; | ||
9 | |||
10 | u32 update_flags; | ||
11 | }; | ||
12 | #define to_tcf_csum(pc) \ | ||
13 | container_of(pc,struct tcf_csum,common) | ||
14 | |||
15 | #endif /* __NET_TC_CSUM_H */ | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 3e4b33e36602..914a60c7ad62 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -803,6 +803,15 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
803 | /* Use define here intentionally to get WARN_ON location shown at the caller */ | 803 | /* Use define here intentionally to get WARN_ON location shown at the caller */ |
804 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) | 804 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
805 | 805 | ||
806 | /* | ||
807 | * Convert RFC 3390 larger initial window into an equivalent number of packets. | ||
808 | * This is based on the numbers specified in RFC 5681, 3.1. | ||
809 | */ | ||
810 | static inline u32 rfc3390_bytes_to_packets(const u32 smss) | ||
811 | { | ||
812 | return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3); | ||
813 | } | ||
814 | |||
806 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 815 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
807 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); | 816 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); |
808 | 817 | ||
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h index 2e159a812f83..ffe50b4e7b93 100644 --- a/include/net/tipc/tipc_msg.h +++ b/include/net/tipc/tipc_msg.h | |||
@@ -107,7 +107,7 @@ static inline u32 msg_hdr_sz(struct tipc_msg *m) | |||
107 | 107 | ||
108 | static inline int msg_short(struct tipc_msg *m) | 108 | static inline int msg_short(struct tipc_msg *m) |
109 | { | 109 | { |
110 | return (msg_hdr_sz(m) == 24); | 110 | return msg_hdr_sz(m) == 24; |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline u32 msg_size(struct tipc_msg *m) | 113 | static inline u32 msg_size(struct tipc_msg *m) |
@@ -117,7 +117,7 @@ static inline u32 msg_size(struct tipc_msg *m) | |||
117 | 117 | ||
118 | static inline u32 msg_data_sz(struct tipc_msg *m) | 118 | static inline u32 msg_data_sz(struct tipc_msg *m) |
119 | { | 119 | { |
120 | return (msg_size(m) - msg_hdr_sz(m)); | 120 | return msg_size(m) - msg_hdr_sz(m); |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline unchar *msg_data(struct tipc_msg *m) | 123 | static inline unchar *msg_data(struct tipc_msg *m) |
@@ -132,17 +132,17 @@ static inline u32 msg_type(struct tipc_msg *m) | |||
132 | 132 | ||
133 | static inline u32 msg_named(struct tipc_msg *m) | 133 | static inline u32 msg_named(struct tipc_msg *m) |
134 | { | 134 | { |
135 | return (msg_type(m) == TIPC_NAMED_MSG); | 135 | return msg_type(m) == TIPC_NAMED_MSG; |
136 | } | 136 | } |
137 | 137 | ||
138 | static inline u32 msg_mcast(struct tipc_msg *m) | 138 | static inline u32 msg_mcast(struct tipc_msg *m) |
139 | { | 139 | { |
140 | return (msg_type(m) == TIPC_MCAST_MSG); | 140 | return msg_type(m) == TIPC_MCAST_MSG; |
141 | } | 141 | } |
142 | 142 | ||
143 | static inline u32 msg_connected(struct tipc_msg *m) | 143 | static inline u32 msg_connected(struct tipc_msg *m) |
144 | { | 144 | { |
145 | return (msg_type(m) == TIPC_CONN_MSG); | 145 | return msg_type(m) == TIPC_CONN_MSG; |
146 | } | 146 | } |
147 | 147 | ||
148 | static inline u32 msg_errcode(struct tipc_msg *m) | 148 | static inline u32 msg_errcode(struct tipc_msg *m) |