aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/arcdevice.h9
-rw-r--r--include/linux/ath9k_platform.h28
-rw-r--r--include/linux/com20020.h1
-rw-r--r--include/linux/connector.h8
-rw-r--r--include/linux/dccp.h51
-rw-r--r--include/linux/etherdevice.h21
-rw-r--r--include/linux/hdlc.h5
-rw-r--r--include/linux/hdlcdrv.h1
-rw-r--r--include/linux/ibmtr.h2
-rw-r--r--include/linux/ieee80211.h181
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/if_ether.h8
-rw-r--r--include/linux/if_pppox.h20
-rw-r--r--include/linux/if_tun.h2
-rw-r--r--include/linux/if_tunnel.h16
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/mroute.h18
-rw-r--r--include/linux/ncp_no.h26
-rw-r--r--include/linux/netdevice.h103
-rw-r--r--include/linux/netfilter_bridge.h4
-rw-r--r--include/linux/nl80211.h105
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/pim.h4
-rw-r--r--include/linux/ppp_channel.h4
-rw-r--r--include/linux/sctp.h90
-rw-r--r--include/linux/skbuff.h26
-rw-r--r--include/linux/smsc911x.h3
-rw-r--r--include/linux/spi/libertas_spi.h32
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h224
-rw-r--r--include/linux/ssb/ssb_regs.h36
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/tcp.h20
-rw-r--r--include/linux/usb/rndis_host.h85
-rw-r--r--include/linux/virtio_net.h71
-rw-r--r--include/linux/wireless.h12
-rw-r--r--include/net/atmclip.h1
-rw-r--r--include/net/cfg80211.h238
-rw-r--r--include/net/inet_ecn.h4
-rw-r--r--include/net/inet_hashtables.h4
-rw-r--r--include/net/ip_vs.h4
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/ipx.h2
-rw-r--r--include/net/mac80211.h234
-rw-r--r--include/net/netns/ipv4.h13
-rw-r--r--include/net/netrom.h4
-rw-r--r--include/net/phonet/phonet.h1
-rw-r--r--include/net/phonet/pn_dev.h5
-rw-r--r--include/net/pkt_sched.h1
-rw-r--r--include/net/sch_generic.h7
-rw-r--r--include/net/sock.h5
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/net/wireless.h71
-rw-r--r--include/rdma/ib_verbs.h2
53 files changed, 1484 insertions, 343 deletions
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index a1916078fd0..cd4bcb6989c 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -235,8 +235,6 @@ struct Outgoing {
235 235
236 236
237struct arcnet_local { 237struct arcnet_local {
238 struct net_device_stats stats;
239
240 uint8_t config, /* current value of CONFIG register */ 238 uint8_t config, /* current value of CONFIG register */
241 timeout, /* Extended timeout for COM20020 */ 239 timeout, /* Extended timeout for COM20020 */
242 backplane, /* Backplane flag for COM20020 */ 240 backplane, /* Backplane flag for COM20020 */
@@ -335,7 +333,12 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc);
335 333
336void arcnet_unregister_proto(struct ArcProto *proto); 334void arcnet_unregister_proto(struct ArcProto *proto);
337irqreturn_t arcnet_interrupt(int irq, void *dev_id); 335irqreturn_t arcnet_interrupt(int irq, void *dev_id);
338struct net_device *alloc_arcdev(char *name); 336struct net_device *alloc_arcdev(const char *name);
337
338int arcnet_open(struct net_device *dev);
339int arcnet_close(struct net_device *dev);
340int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
341void arcnet_timeout(struct net_device *dev);
339 342
340#endif /* __KERNEL__ */ 343#endif /* __KERNEL__ */
341#endif /* _LINUX_ARCDEVICE_H */ 344#endif /* _LINUX_ARCDEVICE_H */
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
new file mode 100644
index 00000000000..b847fc7b93f
--- /dev/null
+++ b/include/linux/ath9k_platform.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (c) 2008 Atheros Communications Inc.
3 * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org>
4 * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef _LINUX_ATH9K_PLATFORM_H
20#define _LINUX_ATH9K_PLATFORM_H
21
22#define ATH9K_PLAT_EEP_MAX_WORDS 2048
23
24struct ath9k_platform_data {
25 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
26};
27
28#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/com20020.h b/include/linux/com20020.h
index ac6d9a43e08..5dcfb944b6c 100644
--- a/include/linux/com20020.h
+++ b/include/linux/com20020.h
@@ -29,6 +29,7 @@
29 29
30int com20020_check(struct net_device *dev); 30int com20020_check(struct net_device *dev);
31int com20020_found(struct net_device *dev, int shared); 31int com20020_found(struct net_device *dev, int shared);
32extern const struct net_device_ops com20020_netdev_ops;
32 33
33/* The number of low I/O ports used by the card. */ 34/* The number of low I/O ports used by the card. */
34#define ARCNET_TOTAL_SIZE 8 35#define ARCNET_TOTAL_SIZE 8
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 34f2789d9b9..fc65d219d88 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -109,6 +109,12 @@ struct cn_queue_dev {
109 unsigned char name[CN_CBQ_NAMELEN]; 109 unsigned char name[CN_CBQ_NAMELEN];
110 110
111 struct workqueue_struct *cn_queue; 111 struct workqueue_struct *cn_queue;
112 /* Sent to kevent to create cn_queue only when needed */
113 struct work_struct wq_creation;
114 /* Tell if the wq_creation job is pending/completed */
115 atomic_t wq_requested;
116 /* Wait for cn_queue to be created */
117 wait_queue_head_t wq_created;
112 118
113 struct list_head queue_list; 119 struct list_head queue_list;
114 spinlock_t queue_lock; 120 spinlock_t queue_lock;
@@ -164,6 +170,8 @@ int cn_netlink_send(struct cn_msg *, u32, gfp_t);
164int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); 170int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *));
165void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 171void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
166 172
173int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work);
174
167struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); 175struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *);
168void cn_queue_free_dev(struct cn_queue_dev *dev); 176void cn_queue_free_dev(struct cn_queue_dev *dev);
169 177
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 61734e27abb..7434a8353e2 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -355,46 +355,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
355 return __dccp_hdr_len(dccp_hdr(skb)); 355 return __dccp_hdr_len(dccp_hdr(skb));
356} 356}
357 357
358
359/* initial values for each feature */
360#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
361#define DCCPF_INITIAL_ACK_RATIO 2
362#define DCCPF_INITIAL_CCID DCCPC_CCID2
363/* FIXME: for now we're default to 1 but it should really be 0 */
364#define DCCPF_INITIAL_SEND_NDP_COUNT 1
365
366/**
367 * struct dccp_minisock - Minimal DCCP connection representation
368 *
369 * Will be used to pass the state from dccp_request_sock to dccp_sock.
370 *
371 * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2)
372 * @dccpms_pending - List of features being negotiated
373 * @dccpms_conf -
374 */
375struct dccp_minisock {
376 __u64 dccpms_sequence_window;
377 struct list_head dccpms_pending;
378 struct list_head dccpms_conf;
379};
380
381struct dccp_opt_conf {
382 __u8 *dccpoc_val;
383 __u8 dccpoc_len;
384};
385
386struct dccp_opt_pend {
387 struct list_head dccpop_node;
388 __u8 dccpop_type;
389 __u8 dccpop_feat;
390 __u8 *dccpop_val;
391 __u8 dccpop_len;
392 int dccpop_conf;
393 struct dccp_opt_conf *dccpop_sc;
394};
395
396extern void dccp_minisock_init(struct dccp_minisock *dmsk);
397
398/** 358/**
399 * struct dccp_request_sock - represent DCCP-specific connection request 359 * struct dccp_request_sock - represent DCCP-specific connection request
400 * @dreq_inet_rsk: structure inherited from 360 * @dreq_inet_rsk: structure inherited from
@@ -483,13 +443,14 @@ struct dccp_ackvec;
483 * @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo 443 * @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo
484 * @dccps_l_ack_ratio - feature-local Ack Ratio 444 * @dccps_l_ack_ratio - feature-local Ack Ratio
485 * @dccps_r_ack_ratio - feature-remote Ack Ratio 445 * @dccps_r_ack_ratio - feature-remote Ack Ratio
446 * @dccps_l_seq_win - local Sequence Window (influences ack number validity)
447 * @dccps_r_seq_win - remote Sequence Window (influences seq number validity)
486 * @dccps_pcslen - sender partial checksum coverage (via sockopt) 448 * @dccps_pcslen - sender partial checksum coverage (via sockopt)
487 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) 449 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt)
488 * @dccps_send_ndp_count - local Send NDP Count feature (7.7.2) 450 * @dccps_send_ndp_count - local Send NDP Count feature (7.7.2)
489 * @dccps_ndp_count - number of Non Data Packets since last data packet 451 * @dccps_ndp_count - number of Non Data Packets since last data packet
490 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) 452 * @dccps_mss_cache - current value of MSS (path MTU minus header sizes)
491 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4) 453 * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4)
492 * @dccps_minisock - associated minisock (accessed via dccp_msk)
493 * @dccps_featneg - tracks feature-negotiation state (mostly during handshake) 454 * @dccps_featneg - tracks feature-negotiation state (mostly during handshake)
494 * @dccps_hc_rx_ackvec - rx half connection ack vector 455 * @dccps_hc_rx_ackvec - rx half connection ack vector
495 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) 456 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection)
@@ -523,12 +484,13 @@ struct dccp_sock {
523 __u32 dccps_timestamp_time; 484 __u32 dccps_timestamp_time;
524 __u16 dccps_l_ack_ratio; 485 __u16 dccps_l_ack_ratio;
525 __u16 dccps_r_ack_ratio; 486 __u16 dccps_r_ack_ratio;
487 __u64 dccps_l_seq_win:48;
488 __u64 dccps_r_seq_win:48;
526 __u8 dccps_pcslen:4; 489 __u8 dccps_pcslen:4;
527 __u8 dccps_pcrlen:4; 490 __u8 dccps_pcrlen:4;
528 __u8 dccps_send_ndp_count:1; 491 __u8 dccps_send_ndp_count:1;
529 __u64 dccps_ndp_count:48; 492 __u64 dccps_ndp_count:48;
530 unsigned long dccps_rate_last; 493 unsigned long dccps_rate_last;
531 struct dccp_minisock dccps_minisock;
532 struct list_head dccps_featneg; 494 struct list_head dccps_featneg;
533 struct dccp_ackvec *dccps_hc_rx_ackvec; 495 struct dccp_ackvec *dccps_hc_rx_ackvec;
534 struct ccid *dccps_hc_rx_ccid; 496 struct ccid *dccps_hc_rx_ccid;
@@ -546,11 +508,6 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk)
546 return (struct dccp_sock *)sk; 508 return (struct dccp_sock *)sk;
547} 509}
548 510
549static inline struct dccp_minisock *dccp_msk(const struct sock *sk)
550{
551 return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock;
552}
553
554static inline const char *dccp_role(const struct sock *sk) 511static inline const char *dccp_role(const struct sock *sk)
555{ 512{
556 switch (dccp_sk(sk)->dccps_role) { 513 switch (dccp_sk(sk)->dccps_role) {
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 1cb0f0b9092..a1f17abba7d 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -184,4 +184,25 @@ static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2],
184} 184}
185#endif /* __KERNEL__ */ 185#endif /* __KERNEL__ */
186 186
187/**
188 * compare_ether_header - Compare two Ethernet headers
189 * @a: Pointer to Ethernet header
190 * @b: Pointer to Ethernet header
191 *
192 * Compare two ethernet headers, returns 0 if equal.
193 * This assumes that the network header (i.e., IP header) is 4-byte
194 * aligned OR the platform can handle unaligned access. This is the
195 * case for all packets coming into netif_receive_skb or similar
196 * entry points.
197 */
198
199static inline int compare_ether_header(const void *a, const void *b)
200{
201 u32 *a32 = (u32 *)((u8 *)a + 2);
202 u32 *b32 = (u32 *)((u8 *)b + 2);
203
204 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
205 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
206}
207
187#endif /* _LINUX_ETHERDEVICE_H */ 208#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index fd47a151665..6a6e701f163 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -38,6 +38,7 @@ struct hdlc_proto {
38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb); 40 int (*netif_rx)(struct sk_buff *skb);
41 int (*xmit)(struct sk_buff *skb, struct net_device *dev);
41 struct module *module; 42 struct module *module;
42 struct hdlc_proto *next; /* next protocol in the list */ 43 struct hdlc_proto *next; /* next protocol in the list */
43}; 44};
@@ -102,6 +103,10 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
102int hdlc_open(struct net_device *dev); 103int hdlc_open(struct net_device *dev);
103/* Must be called by hardware driver when HDLC device is being closed */ 104/* Must be called by hardware driver when HDLC device is being closed */
104void hdlc_close(struct net_device *dev); 105void hdlc_close(struct net_device *dev);
106/* May be used by hardware driver */
107int hdlc_change_mtu(struct net_device *dev, int new_mtu);
108/* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */
109int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev);
105 110
106int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 111int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
107 size_t size); 112 size_t size);
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index bf6302f6b5f..0821bac62b8 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -241,7 +241,6 @@ struct hdlcdrv_state {
241 struct hdlcdrv_bitbuffer bitbuf_hdlc; 241 struct hdlcdrv_bitbuffer bitbuf_hdlc;
242#endif /* HDLCDRV_DEBUG */ 242#endif /* HDLCDRV_DEBUG */
243 243
244 struct net_device_stats stats;
245 int ptt_keyed; 244 int ptt_keyed;
246 245
247 /* queued skb for transmission */ 246 /* queued skb for transmission */
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h
index 1c7a0dd5536..06695b74d40 100644
--- a/include/linux/ibmtr.h
+++ b/include/linux/ibmtr.h
@@ -207,7 +207,7 @@ struct tok_info {
207 unsigned short exsap_station_id; 207 unsigned short exsap_station_id;
208 unsigned short global_int_enable; 208 unsigned short global_int_enable;
209 struct sk_buff *current_skb; 209 struct sk_buff *current_skb;
210 struct net_device_stats tr_stats; 210
211 unsigned char auto_speedsave; 211 unsigned char auto_speedsave;
212 open_state open_status, sap_status; 212 open_state open_status, sap_status;
213 enum {MANUAL, AUTOMATIC} open_mode; 213 enum {MANUAL, AUTOMATIC} open_mode;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index c4e6ca1a630..b1bb817d142 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -527,6 +527,8 @@ struct ieee80211_tim_ie {
527 u8 virtual_map[0]; 527 u8 virtual_map[0];
528} __attribute__ ((packed)); 528} __attribute__ ((packed));
529 529
530#define WLAN_SA_QUERY_TR_ID_LEN 16
531
530struct ieee80211_mgmt { 532struct ieee80211_mgmt {
531 __le16 frame_control; 533 __le16 frame_control;
532 __le16 duration; 534 __le16 duration;
@@ -646,6 +648,10 @@ struct ieee80211_mgmt {
646 u8 action_code; 648 u8 action_code;
647 u8 variable[0]; 649 u8 variable[0];
648 } __attribute__((packed)) mesh_action; 650 } __attribute__((packed)) mesh_action;
651 struct {
652 u8 action;
653 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
654 } __attribute__ ((packed)) sa_query;
649 } u; 655 } u;
650 } __attribute__ ((packed)) action; 656 } __attribute__ ((packed)) action;
651 } u; 657 } u;
@@ -655,6 +661,15 @@ struct ieee80211_mgmt {
655#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) 661#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
656 662
657 663
664/* Management MIC information element (IEEE 802.11w) */
665struct ieee80211_mmie {
666 u8 element_id;
667 u8 length;
668 __le16 key_id;
669 u8 sequence_number[6];
670 u8 mic[8];
671} __attribute__ ((packed));
672
658/* Control frames */ 673/* Control frames */
659struct ieee80211_rts { 674struct ieee80211_rts {
660 __le16 frame_control; 675 __le16 frame_control;
@@ -899,6 +914,9 @@ enum ieee80211_statuscode {
899 /* 802.11g */ 914 /* 802.11g */
900 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, 915 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
901 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, 916 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
917 /* 802.11w */
918 WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY = 30,
919 WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
902 /* 802.11i */ 920 /* 802.11i */
903 WLAN_STATUS_INVALID_IE = 40, 921 WLAN_STATUS_INVALID_IE = 40,
904 WLAN_STATUS_INVALID_GROUP_CIPHER = 41, 922 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
@@ -1018,6 +1036,8 @@ enum ieee80211_eid {
1018 WLAN_EID_HT_INFORMATION = 61, 1036 WLAN_EID_HT_INFORMATION = 61,
1019 /* 802.11i */ 1037 /* 802.11i */
1020 WLAN_EID_RSN = 48, 1038 WLAN_EID_RSN = 48,
1039 WLAN_EID_TIMEOUT_INTERVAL = 56,
1040 WLAN_EID_MMIE = 76 /* 802.11w */,
1021 WLAN_EID_WPA = 221, 1041 WLAN_EID_WPA = 221,
1022 WLAN_EID_GENERIC = 221, 1042 WLAN_EID_GENERIC = 221,
1023 WLAN_EID_VENDOR_SPECIFIC = 221, 1043 WLAN_EID_VENDOR_SPECIFIC = 221,
@@ -1030,6 +1050,8 @@ enum ieee80211_category {
1030 WLAN_CATEGORY_QOS = 1, 1050 WLAN_CATEGORY_QOS = 1,
1031 WLAN_CATEGORY_DLS = 2, 1051 WLAN_CATEGORY_DLS = 2,
1032 WLAN_CATEGORY_BACK = 3, 1052 WLAN_CATEGORY_BACK = 3,
1053 WLAN_CATEGORY_PUBLIC = 4,
1054 WLAN_CATEGORY_SA_QUERY = 8,
1033 WLAN_CATEGORY_WMM = 17, 1055 WLAN_CATEGORY_WMM = 17,
1034}; 1056};
1035 1057
@@ -1104,6 +1126,12 @@ struct ieee80211_country_ie_triplet {
1104 }; 1126 };
1105} __attribute__ ((packed)); 1127} __attribute__ ((packed));
1106 1128
1129enum ieee80211_timeout_interval_type {
1130 WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */,
1131 WLAN_TIMEOUT_KEY_LIFETIME = 2 /* 802.11r */,
1132 WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */,
1133};
1134
1107/* BACK action code */ 1135/* BACK action code */
1108enum ieee80211_back_actioncode { 1136enum ieee80211_back_actioncode {
1109 WLAN_ACTION_ADDBA_REQ = 0, 1137 WLAN_ACTION_ADDBA_REQ = 0,
@@ -1118,6 +1146,13 @@ enum ieee80211_back_parties {
1118 WLAN_BACK_TIMER = 2, 1146 WLAN_BACK_TIMER = 2,
1119}; 1147};
1120 1148
1149/* SA Query action */
1150enum ieee80211_sa_query_action {
1151 WLAN_ACTION_SA_QUERY_REQUEST = 0,
1152 WLAN_ACTION_SA_QUERY_RESPONSE = 1,
1153};
1154
1155
1121/* A-MSDU 802.11n */ 1156/* A-MSDU 802.11n */
1122#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 1157#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
1123 1158
@@ -1128,6 +1163,7 @@ enum ieee80211_back_parties {
1128/* reserved: 0x000FAC03 */ 1163/* reserved: 0x000FAC03 */
1129#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 1164#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
1130#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1165#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1166#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1131 1167
1132#define WLAN_MAX_KEY_LEN 32 1168#define WLAN_MAX_KEY_LEN 32
1133 1169
@@ -1185,4 +1221,149 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
1185 return hdr->addr1; 1221 return hdr->addr1;
1186} 1222}
1187 1223
1224/**
1225 * ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
1226 * @hdr: the frame (buffer must include at least the first octet of payload)
1227 */
1228static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
1229{
1230 if (ieee80211_is_disassoc(hdr->frame_control) ||
1231 ieee80211_is_deauth(hdr->frame_control))
1232 return true;
1233
1234 if (ieee80211_is_action(hdr->frame_control)) {
1235 u8 *category;
1236
1237 /*
1238 * Action frames, excluding Public Action frames, are Robust
1239 * Management Frames. However, if we are looking at a Protected
1240 * frame, skip the check since the data may be encrypted and
1241 * the frame has already been found to be a Robust Management
1242 * Frame (by the other end).
1243 */
1244 if (ieee80211_has_protected(hdr->frame_control))
1245 return true;
1246 category = ((u8 *) hdr) + 24;
1247 return *category != WLAN_CATEGORY_PUBLIC;
1248 }
1249
1250 return false;
1251}
1252
1253/**
1254 * ieee80211_fhss_chan_to_freq - get channel frequency
1255 * @channel: the FHSS channel
1256 *
1257 * Convert IEEE802.11 FHSS channel to frequency (MHz)
1258 * Ref IEEE 802.11-2007 section 14.6
1259 */
1260static inline int ieee80211_fhss_chan_to_freq(int channel)
1261{
1262 if ((channel > 1) && (channel < 96))
1263 return channel + 2400;
1264 else
1265 return -1;
1266}
1267
1268/**
1269 * ieee80211_freq_to_fhss_chan - get channel
1270 * @freq: the channels frequency
1271 *
1272 * Convert frequency (MHz) to IEEE802.11 FHSS channel
1273 * Ref IEEE 802.11-2007 section 14.6
1274 */
1275static inline int ieee80211_freq_to_fhss_chan(int freq)
1276{
1277 if ((freq > 2401) && (freq < 2496))
1278 return freq - 2400;
1279 else
1280 return -1;
1281}
1282
1283/**
1284 * ieee80211_dsss_chan_to_freq - get channel center frequency
1285 * @channel: the DSSS channel
1286 *
1287 * Convert IEEE802.11 DSSS channel to the center frequency (MHz).
1288 * Ref IEEE 802.11-2007 section 15.6
1289 */
1290static inline int ieee80211_dsss_chan_to_freq(int channel)
1291{
1292 if ((channel > 0) && (channel < 14))
1293 return 2407 + (channel * 5);
1294 else if (channel == 14)
1295 return 2484;
1296 else
1297 return -1;
1298}
1299
1300/**
1301 * ieee80211_freq_to_dsss_chan - get channel
1302 * @freq: the frequency
1303 *
1304 * Convert frequency (MHz) to IEEE802.11 DSSS channel
1305 * Ref IEEE 802.11-2007 section 15.6
1306 *
1307 * This routine selects the channel with the closest center frequency.
1308 */
1309static inline int ieee80211_freq_to_dsss_chan(int freq)
1310{
1311 if ((freq >= 2410) && (freq < 2475))
1312 return (freq - 2405) / 5;
1313 else if ((freq >= 2482) && (freq < 2487))
1314 return 14;
1315 else
1316 return -1;
1317}
1318
1319/* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back
1320 * Ref IEEE 802.11-2007 section 18.4.6.2
1321 *
1322 * The channels and frequencies are the same as those defined for DSSS
1323 */
1324#define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan)
1325#define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq)
1326
1327/* Convert IEEE802.11 ERP channel to frequency (MHz) and back
1328 * Ref IEEE 802.11-2007 section 19.4.2
1329 */
1330#define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan)
1331#define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq)
1332
1333/**
1334 * ieee80211_ofdm_chan_to_freq - get channel center frequency
1335 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
1336 * @channel: the OFDM channel
1337 *
1338 * Convert IEEE802.11 OFDM channel to center frequency (MHz)
1339 * Ref IEEE 802.11-2007 section 17.3.8.3.2
1340 */
1341static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel)
1342{
1343 if ((channel > 0) && (channel <= 200) &&
1344 (s_freq >= 4000))
1345 return s_freq + (channel * 5);
1346 else
1347 return -1;
1348}
1349
1350/**
1351 * ieee80211_freq_to_ofdm_channel - get channel
1352 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
1353 * @freq: the frequency
1354 *
1355 * Convert frequency (MHz) to IEEE802.11 OFDM channel
1356 * Ref IEEE 802.11-2007 section 17.3.8.3.2
1357 *
1358 * This routine selects the channel with the closest center frequency.
1359 */
1360static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
1361{
1362 if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) &&
1363 (s_freq >= 4000))
1364 return (freq + 2 - s_freq) / 5;
1365 else
1366 return -1;
1367}
1368
1188#endif /* LINUX_IEEE80211_H */ 1369#endif /* LINUX_IEEE80211_H */
diff --git a/include/linux/if.h b/include/linux/if.h
index 2a6e29620a9..1108f3e099e 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -66,6 +66,7 @@
66#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ 66#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
67#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ 67#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */
68#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */ 68#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */
69#define IFF_WAN_HDLC 0x200 /* WAN HDLC device */
69 70
70#define IF_GET_IFACE 0x0001 /* for querying only */ 71#define IF_GET_IFACE 0x0001 /* for querying only */
71#define IF_GET_PROTO 0x0002 72#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 7f3c735f422..0216e1bdbc5 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -17,7 +17,7 @@
17 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20 20
21#ifndef _LINUX_IF_ETHER_H 21#ifndef _LINUX_IF_ETHER_H
22#define _LINUX_IF_ETHER_H 22#define _LINUX_IF_ETHER_H
23 23
@@ -25,7 +25,7 @@
25 25
26/* 26/*
27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
28 * and FCS/CRC (frame check sequence). 28 * and FCS/CRC (frame check sequence).
29 */ 29 */
30 30
31#define ETH_ALEN 6 /* Octets in one ethernet addr */ 31#define ETH_ALEN 6 /* Octets in one ethernet addr */
@@ -83,7 +83,7 @@
83/* 83/*
84 * Non DIX types. Won't clash for 1500 types. 84 * Non DIX types. Won't clash for 1500 types.
85 */ 85 */
86 86
87#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */ 87#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
88#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */ 88#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
89#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */ 89#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
@@ -109,7 +109,7 @@
109/* 109/*
110 * This is an Ethernet frame header. 110 * This is an Ethernet frame header.
111 */ 111 */
112 112
113struct ethhdr { 113struct ethhdr {
114 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 114 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
115 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 115 unsigned char h_source[ETH_ALEN]; /* source ether addr */
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 30c88b2245f..90b5fae5d71 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -95,16 +95,16 @@ struct pppoe_tag {
95} __attribute ((packed)); 95} __attribute ((packed));
96 96
97/* Tag identifiers */ 97/* Tag identifiers */
98#define PTT_EOL __constant_htons(0x0000) 98#define PTT_EOL __cpu_to_be16(0x0000)
99#define PTT_SRV_NAME __constant_htons(0x0101) 99#define PTT_SRV_NAME __cpu_to_be16(0x0101)
100#define PTT_AC_NAME __constant_htons(0x0102) 100#define PTT_AC_NAME __cpu_to_be16(0x0102)
101#define PTT_HOST_UNIQ __constant_htons(0x0103) 101#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
102#define PTT_AC_COOKIE __constant_htons(0x0104) 102#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
103#define PTT_VENDOR __constant_htons(0x0105) 103#define PTT_VENDOR __cpu_to_be16(0x0105)
104#define PTT_RELAY_SID __constant_htons(0x0110) 104#define PTT_RELAY_SID __cpu_to_be16(0x0110)
105#define PTT_SRV_ERR __constant_htons(0x0201) 105#define PTT_SRV_ERR __cpu_to_be16(0x0201)
106#define PTT_SYS_ERR __constant_htons(0x0202) 106#define PTT_SYS_ERR __cpu_to_be16(0x0202)
107#define PTT_GEN_ERR __constant_htons(0x0203) 107#define PTT_GEN_ERR __cpu_to_be16(0x0203)
108 108
109struct pppoe_hdr { 109struct pppoe_hdr {
110#if defined(__LITTLE_ENDIAN_BITFIELD) 110#if defined(__LITTLE_ENDIAN_BITFIELD)
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 8529f57ba26..049d6c9428d 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -46,6 +46,8 @@
46#define TUNSETOFFLOAD _IOW('T', 208, unsigned int) 46#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
47#define TUNSETTXFILTER _IOW('T', 209, unsigned int) 47#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
48#define TUNGETIFF _IOR('T', 210, unsigned int) 48#define TUNGETIFF _IOR('T', 210, unsigned int)
49#define TUNGETSNDBUF _IOR('T', 211, int)
50#define TUNSETSNDBUF _IOW('T', 212, int)
49 51
50/* TUNSETIFF ifr flags */ 52/* TUNSETIFF ifr flags */
51#define IFF_TUN 0x0001 53#define IFF_TUN 0x0001
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 82c43624c06..5a9aae4adb4 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -16,14 +16,14 @@
16#define SIOCDELPRL (SIOCDEVPRIVATE + 6) 16#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
17#define SIOCCHGPRL (SIOCDEVPRIVATE + 7) 17#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
18 18
19#define GRE_CSUM __constant_htons(0x8000) 19#define GRE_CSUM __cpu_to_be16(0x8000)
20#define GRE_ROUTING __constant_htons(0x4000) 20#define GRE_ROUTING __cpu_to_be16(0x4000)
21#define GRE_KEY __constant_htons(0x2000) 21#define GRE_KEY __cpu_to_be16(0x2000)
22#define GRE_SEQ __constant_htons(0x1000) 22#define GRE_SEQ __cpu_to_be16(0x1000)
23#define GRE_STRICT __constant_htons(0x0800) 23#define GRE_STRICT __cpu_to_be16(0x0800)
24#define GRE_REC __constant_htons(0x0700) 24#define GRE_REC __cpu_to_be16(0x0700)
25#define GRE_FLAGS __constant_htons(0x00F8) 25#define GRE_FLAGS __cpu_to_be16(0x00F8)
26#define GRE_VERSION __constant_htons(0x0007) 26#define GRE_VERSION __cpu_to_be16(0x0007)
27 27
28struct ip_tunnel_parm 28struct ip_tunnel_parm
29{ 29{
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 06fcdb45106..acef2a770b6 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -108,6 +108,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
108#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) 108#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
109#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE) 109#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
110#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 110#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
111#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
111 112
112struct in_ifaddr 113struct in_ifaddr
113{ 114{
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 8a455694d68..0d45b4e8d36 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -193,6 +193,9 @@ struct vif_device
193struct mfc_cache 193struct mfc_cache
194{ 194{
195 struct mfc_cache *next; /* Next entry on cache line */ 195 struct mfc_cache *next; /* Next entry on cache line */
196#ifdef CONFIG_NET_NS
197 struct net *mfc_net;
198#endif
196 __be32 mfc_mcastgrp; /* Group the entry belongs to */ 199 __be32 mfc_mcastgrp; /* Group the entry belongs to */
197 __be32 mfc_origin; /* Source of packet */ 200 __be32 mfc_origin; /* Source of packet */
198 vifi_t mfc_parent; /* Source interface */ 201 vifi_t mfc_parent; /* Source interface */
@@ -215,6 +218,18 @@ struct mfc_cache
215 } mfc_un; 218 } mfc_un;
216}; 219};
217 220
221static inline
222struct net *mfc_net(const struct mfc_cache *mfc)
223{
224 return read_pnet(&mfc->mfc_net);
225}
226
227static inline
228void mfc_net_set(struct mfc_cache *mfc, struct net *net)
229{
230 write_pnet(&mfc->mfc_net, hold_net(net));
231}
232
218#define MFC_STATIC 1 233#define MFC_STATIC 1
219#define MFC_NOTIFY 2 234#define MFC_NOTIFY 2
220 235
@@ -241,7 +256,8 @@ struct mfc_cache
241 256
242#ifdef __KERNEL__ 257#ifdef __KERNEL__
243struct rtmsg; 258struct rtmsg;
244extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); 259extern int ipmr_get_route(struct net *net, struct sk_buff *skb,
260 struct rtmsg *rtm, int nowait);
245#endif 261#endif
246 262
247#endif 263#endif
diff --git a/include/linux/ncp_no.h b/include/linux/ncp_no.h
index f56a696a7cc..cddaa48fb18 100644
--- a/include/linux/ncp_no.h
+++ b/include/linux/ncp_no.h
@@ -2,18 +2,18 @@
2#define _NCP_NO 2#define _NCP_NO
3 3
4/* these define the attribute byte as seen by NCP */ 4/* these define the attribute byte as seen by NCP */
5#define aRONLY (__constant_cpu_to_le32(1)) 5#define aRONLY (__cpu_to_le32(1))
6#define aHIDDEN (__constant_cpu_to_le32(2)) 6#define aHIDDEN (__cpu_to_le32(2))
7#define aSYSTEM (__constant_cpu_to_le32(4)) 7#define aSYSTEM (__cpu_to_le32(4))
8#define aEXECUTE (__constant_cpu_to_le32(8)) 8#define aEXECUTE (__cpu_to_le32(8))
9#define aDIR (__constant_cpu_to_le32(0x10)) 9#define aDIR (__cpu_to_le32(0x10))
10#define aARCH (__constant_cpu_to_le32(0x20)) 10#define aARCH (__cpu_to_le32(0x20))
11#define aSHARED (__constant_cpu_to_le32(0x80)) 11#define aSHARED (__cpu_to_le32(0x80))
12#define aDONTSUBALLOCATE (__constant_cpu_to_le32(1L<<11)) 12#define aDONTSUBALLOCATE (__cpu_to_le32(1L<<11))
13#define aTRANSACTIONAL (__constant_cpu_to_le32(1L<<12)) 13#define aTRANSACTIONAL (__cpu_to_le32(1L<<12))
14#define aPURGE (__constant_cpu_to_le32(1L<<16)) 14#define aPURGE (__cpu_to_le32(1L<<16))
15#define aRENAMEINHIBIT (__constant_cpu_to_le32(1L<<17)) 15#define aRENAMEINHIBIT (__cpu_to_le32(1L<<17))
16#define aDELETEINHIBIT (__constant_cpu_to_le32(1L<<18)) 16#define aDELETEINHIBIT (__cpu_to_le32(1L<<18))
17#define aDONTCOMPRESS (__constant_cpu_to_le32(1L<<27)) 17#define aDONTCOMPRESS (__cpu_to_le32(1L<<27))
18 18
19#endif /* _NCP_NO */ 19#endif /* _NCP_NO */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ec54785d34f..bd8b4ca85a2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -96,7 +96,7 @@ struct wireless_dev;
96 * Compute the worst case header length according to the protocols 96 * Compute the worst case header length according to the protocols
97 * used. 97 * used.
98 */ 98 */
99 99
100#if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) 100#if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
101# if defined(CONFIG_MAC80211_MESH) 101# if defined(CONFIG_MAC80211_MESH)
102# define LL_MAX_HEADER 128 102# define LL_MAX_HEADER 128
@@ -124,7 +124,7 @@ struct wireless_dev;
124 * Network device statistics. Akin to the 2.0 ether stats but 124 * Network device statistics. Akin to the 2.0 ether stats but
125 * with byte counters. 125 * with byte counters.
126 */ 126 */
127 127
128struct net_device_stats 128struct net_device_stats
129{ 129{
130 unsigned long rx_packets; /* total packets received */ 130 unsigned long rx_packets; /* total packets received */
@@ -285,7 +285,7 @@ enum netdev_state_t
285 285
286/* 286/*
287 * This structure holds at boot time configured netdevice settings. They 287 * This structure holds at boot time configured netdevice settings. They
288 * are then used in the device probing. 288 * are then used in the device probing.
289 */ 289 */
290struct netdev_boot_setup { 290struct netdev_boot_setup {
291 char name[IFNAMSIZ]; 291 char name[IFNAMSIZ];
@@ -314,6 +314,9 @@ struct napi_struct {
314 spinlock_t poll_lock; 314 spinlock_t poll_lock;
315 int poll_owner; 315 int poll_owner;
316#endif 316#endif
317
318 unsigned int gro_count;
319
317 struct net_device *dev; 320 struct net_device *dev;
318 struct list_head dev_list; 321 struct list_head dev_list;
319 struct sk_buff *gro_list; 322 struct sk_buff *gro_list;
@@ -740,7 +743,7 @@ struct net_device
740 void *dsa_ptr; /* dsa specific data */ 743 void *dsa_ptr; /* dsa specific data */
741#endif 744#endif
742 void *atalk_ptr; /* AppleTalk link */ 745 void *atalk_ptr; /* AppleTalk link */
743 void *ip_ptr; /* IPv4 specific data */ 746 void *ip_ptr; /* IPv4 specific data */
744 void *dn_ptr; /* DECnet specific data */ 747 void *dn_ptr; /* DECnet specific data */
745 void *ip6_ptr; /* IPv6 specific data */ 748 void *ip6_ptr; /* IPv6 specific data */
746 void *ec_ptr; /* Econet specific data */ 749 void *ec_ptr; /* Econet specific data */
@@ -753,7 +756,7 @@ struct net_device
753 */ 756 */
754 unsigned long last_rx; /* Time of last Rx */ 757 unsigned long last_rx; /* Time of last Rx */
755 /* Interface address info used in eth_type_trans() */ 758 /* Interface address info used in eth_type_trans() */
756 unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast 759 unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast
757 because most packets are unicast) */ 760 because most packets are unicast) */
758 761
759 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 762 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
@@ -984,6 +987,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
984void netif_napi_del(struct napi_struct *napi); 987void netif_napi_del(struct napi_struct *napi);
985 988
986struct napi_gro_cb { 989struct napi_gro_cb {
990 /* This indicates where we are processing relative to skb->data. */
991 int data_offset;
992
987 /* This is non-zero if the packet may be of the same flow. */ 993 /* This is non-zero if the packet may be of the same flow. */
988 int same_flow; 994 int same_flow;
989 995
@@ -1087,6 +1093,36 @@ extern int dev_restart(struct net_device *dev);
1087#ifdef CONFIG_NETPOLL_TRAP 1093#ifdef CONFIG_NETPOLL_TRAP
1088extern int netpoll_trap(void); 1094extern int netpoll_trap(void);
1089#endif 1095#endif
1096extern void *skb_gro_header(struct sk_buff *skb, unsigned int hlen);
1097extern int skb_gro_receive(struct sk_buff **head,
1098 struct sk_buff *skb);
1099
1100static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
1101{
1102 return NAPI_GRO_CB(skb)->data_offset;
1103}
1104
1105static inline unsigned int skb_gro_len(const struct sk_buff *skb)
1106{
1107 return skb->len - NAPI_GRO_CB(skb)->data_offset;
1108}
1109
1110static inline void skb_gro_pull(struct sk_buff *skb, unsigned int len)
1111{
1112 NAPI_GRO_CB(skb)->data_offset += len;
1113}
1114
1115static inline void skb_gro_reset_offset(struct sk_buff *skb)
1116{
1117 NAPI_GRO_CB(skb)->data_offset = 0;
1118}
1119
1120static inline void *skb_gro_mac_header(struct sk_buff *skb)
1121{
1122 return skb_mac_header(skb) < skb->data ? skb_mac_header(skb) :
1123 page_address(skb_shinfo(skb)->frags[0].page) +
1124 skb_shinfo(skb)->frags[0].page_offset;
1125}
1090 1126
1091static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 1127static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
1092 unsigned short type, 1128 unsigned short type,
@@ -1375,12 +1411,15 @@ extern int netif_receive_skb(struct sk_buff *skb);
1375extern void napi_gro_flush(struct napi_struct *napi); 1411extern void napi_gro_flush(struct napi_struct *napi);
1376extern int dev_gro_receive(struct napi_struct *napi, 1412extern int dev_gro_receive(struct napi_struct *napi,
1377 struct sk_buff *skb); 1413 struct sk_buff *skb);
1414extern int napi_skb_finish(int ret, struct sk_buff *skb);
1378extern int napi_gro_receive(struct napi_struct *napi, 1415extern int napi_gro_receive(struct napi_struct *napi,
1379 struct sk_buff *skb); 1416 struct sk_buff *skb);
1380extern void napi_reuse_skb(struct napi_struct *napi, 1417extern void napi_reuse_skb(struct napi_struct *napi,
1381 struct sk_buff *skb); 1418 struct sk_buff *skb);
1382extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, 1419extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi,
1383 struct napi_gro_fraginfo *info); 1420 struct napi_gro_fraginfo *info);
1421extern int napi_frags_finish(struct napi_struct *napi,
1422 struct sk_buff *skb, int ret);
1384extern int napi_gro_frags(struct napi_struct *napi, 1423extern int napi_gro_frags(struct napi_struct *napi,
1385 struct napi_gro_fraginfo *info); 1424 struct napi_gro_fraginfo *info);
1386extern void netif_nit_deliver(struct sk_buff *skb); 1425extern void netif_nit_deliver(struct sk_buff *skb);
@@ -1574,56 +1613,6 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
1574 return (1 << debug_value) - 1; 1613 return (1 << debug_value) - 1;
1575} 1614}
1576 1615
1577/* Test if receive needs to be scheduled but only if up */
1578static inline int netif_rx_schedule_prep(struct napi_struct *napi)
1579{
1580 return napi_schedule_prep(napi);
1581}
1582
1583/* Add interface to tail of rx poll list. This assumes that _prep has
1584 * already been called and returned 1.
1585 */
1586static inline void __netif_rx_schedule(struct napi_struct *napi)
1587{
1588 __napi_schedule(napi);
1589}
1590
1591/* Try to reschedule poll. Called by irq handler. */
1592
1593static inline void netif_rx_schedule(struct napi_struct *napi)
1594{
1595 if (netif_rx_schedule_prep(napi))
1596 __netif_rx_schedule(napi);
1597}
1598
1599/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */
1600static inline int netif_rx_reschedule(struct napi_struct *napi)
1601{
1602 if (napi_schedule_prep(napi)) {
1603 __netif_rx_schedule(napi);
1604 return 1;
1605 }
1606 return 0;
1607}
1608
1609/* same as netif_rx_complete, except that local_irq_save(flags)
1610 * has already been issued
1611 */
1612static inline void __netif_rx_complete(struct napi_struct *napi)
1613{
1614 __napi_complete(napi);
1615}
1616
1617/* Remove interface from poll list: it must be in the poll list
1618 * on current cpu. This primitive is called by dev->poll(), when
1619 * it completes the work. The device cannot be out of poll list at this
1620 * moment, it is BUG().
1621 */
1622static inline void netif_rx_complete(struct napi_struct *napi)
1623{
1624 napi_complete(napi);
1625}
1626
1627static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) 1616static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
1628{ 1617{
1629 spin_lock(&txq->_xmit_lock); 1618 spin_lock(&txq->_xmit_lock);
@@ -1874,7 +1863,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
1874 1863
1875 if (dev->priv_flags & IFF_SLAVE_INACTIVE) { 1864 if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
1876 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && 1865 if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
1877 skb->protocol == __constant_htons(ETH_P_ARP)) 1866 skb->protocol == __cpu_to_be16(ETH_P_ARP))
1878 return 0; 1867 return 0;
1879 1868
1880 if (master->priv_flags & IFF_MASTER_ALB) { 1869 if (master->priv_flags & IFF_MASTER_ALB) {
@@ -1883,7 +1872,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
1883 return 0; 1872 return 0;
1884 } 1873 }
1885 if (master->priv_flags & IFF_MASTER_8023AD && 1874 if (master->priv_flags & IFF_MASTER_8023AD &&
1886 skb->protocol == __constant_htons(ETH_P_SLOW)) 1875 skb->protocol == __cpu_to_be16(ETH_P_SLOW))
1887 return 0; 1876 return 0;
1888 1877
1889 return 1; 1878 return 1;
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 499aa937590..f8105e54716 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -59,9 +59,9 @@ static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
59static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) 59static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
60{ 60{
61 switch (skb->protocol) { 61 switch (skb->protocol) {
62 case __constant_htons(ETH_P_8021Q): 62 case __cpu_to_be16(ETH_P_8021Q):
63 return VLAN_HLEN; 63 return VLAN_HLEN;
64 case __constant_htons(ETH_P_PPP_SES): 64 case __cpu_to_be16(ETH_P_PPP_SES):
65 return PPPOE_SES_HLEN; 65 return PPPOE_SES_HLEN;
66 default: 66 default:
67 return 0; 67 return 0;
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index e86ed59f9ad..8802d1bda38 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -47,7 +47,7 @@
47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or 47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, 48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or 49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or
50 * %NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET. 50 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
51 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request 51 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
52 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and 52 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
53 * %NL80211_ATTR_WIPHY_NAME. 53 * %NL80211_ATTR_WIPHY_NAME.
@@ -72,8 +72,8 @@
72 * 72 *
73 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified 73 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
74 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. 74 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
75 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or 75 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
76 * %NL80211_ATTR_KEY_THRESHOLD. 76 * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
77 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, 77 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
78 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER 78 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
79 * attributes. 79 * attributes.
@@ -84,7 +84,7 @@
84 * %NL80222_CMD_NEW_BEACON message) 84 * %NL80222_CMD_NEW_BEACON message)
85 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface 85 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
86 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 86 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
87 * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes. 87 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes.
88 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 88 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
89 * parameters are like for %NL80211_CMD_SET_BEACON. 89 * parameters are like for %NL80211_CMD_SET_BEACON.
90 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it 90 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
@@ -113,6 +113,8 @@
113 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by 113 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
114 * %NL80211_ATTR_IFINDEX. 114 * %NL80211_ATTR_IFINDEX.
115 * 115 *
116 * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
117 * regulatory domain.
116 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command 118 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
117 * after being queried by the kernel. CRDA replies by sending a regulatory 119 * after being queried by the kernel. CRDA replies by sending a regulatory
118 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our 120 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
@@ -133,6 +135,21 @@
133 * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the 135 * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
134 * interface identified by %NL80211_ATTR_IFINDEX 136 * interface identified by %NL80211_ATTR_IFINDEX
135 * 137 *
138 * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
139 * interface is identified with %NL80211_ATTR_IFINDEX and the management
140 * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
141 * added to the end of the specified management frame is specified with
142 * %NL80211_ATTR_IE. If the command succeeds, the requested data will be
143 * added to all specified management frames generated by
144 * kernel/firmware/driver.
145 *
146 * @NL80211_CMD_GET_SCAN: get scan results
147 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
148 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
149 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
150 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
151 * partial scan results may be available
152 *
136 * @NL80211_CMD_MAX: highest used command number 153 * @NL80211_CMD_MAX: highest used command number
137 * @__NL80211_CMD_AFTER_LAST: internal use 154 * @__NL80211_CMD_AFTER_LAST: internal use
138 */ 155 */
@@ -178,6 +195,15 @@ enum nl80211_commands {
178 NL80211_CMD_GET_MESH_PARAMS, 195 NL80211_CMD_GET_MESH_PARAMS,
179 NL80211_CMD_SET_MESH_PARAMS, 196 NL80211_CMD_SET_MESH_PARAMS,
180 197
198 NL80211_CMD_SET_MGMT_EXTRA_IE,
199
200 NL80211_CMD_GET_REG,
201
202 NL80211_CMD_GET_SCAN,
203 NL80211_CMD_TRIGGER_SCAN,
204 NL80211_CMD_NEW_SCAN_RESULTS,
205 NL80211_CMD_SCAN_ABORTED,
206
181 /* add new commands above here */ 207 /* add new commands above here */
182 208
183 /* used to define NL80211_CMD_MAX below */ 209 /* used to define NL80211_CMD_MAX below */
@@ -190,6 +216,7 @@ enum nl80211_commands {
190 * here 216 * here
191 */ 217 */
192#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS 218#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
219#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
193 220
194/** 221/**
195 * enum nl80211_attrs - nl80211 netlink attributes 222 * enum nl80211_attrs - nl80211 netlink attributes
@@ -284,6 +311,24 @@ enum nl80211_commands {
284 * supported interface types, each a flag attribute with the number 311 * supported interface types, each a flag attribute with the number
285 * of the interface mode. 312 * of the interface mode.
286 * 313 *
314 * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
315 * %NL80211_CMD_SET_MGMT_EXTRA_IE.
316 *
317 * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
318 * %NL80211_CMD_SET_MGMT_EXTRA_IE).
319 *
320 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
321 * a single scan request, a wiphy attribute.
322 *
323 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
324 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
325 * scanning and include a zero-length SSID (wildcard) for wildcard scan
326 * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the
327 * scan result list changes (BSS expired or added) so that applications
328 * can verify that they got a single, consistent snapshot (when all dump
329 * messages carried the same generation number)
330 * @NL80211_ATTR_BSS: scan result BSS
331 *
287 * @NL80211_ATTR_MAX: highest attribute number currently defined 332 * @NL80211_ATTR_MAX: highest attribute number currently defined
288 * @__NL80211_ATTR_AFTER_LAST: internal use 333 * @__NL80211_ATTR_AFTER_LAST: internal use
289 */ 334 */
@@ -346,6 +391,18 @@ enum nl80211_attrs {
346 NL80211_ATTR_WIPHY_FREQ, 391 NL80211_ATTR_WIPHY_FREQ,
347 NL80211_ATTR_WIPHY_CHANNEL_TYPE, 392 NL80211_ATTR_WIPHY_CHANNEL_TYPE,
348 393
394 NL80211_ATTR_KEY_DEFAULT_MGMT,
395
396 NL80211_ATTR_MGMT_SUBTYPE,
397 NL80211_ATTR_IE,
398
399 NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
400
401 NL80211_ATTR_SCAN_FREQUENCIES,
402 NL80211_ATTR_SCAN_SSIDS,
403 NL80211_ATTR_SCAN_GENERATION,
404 NL80211_ATTR_BSS,
405
349 /* add attributes here, update the policy in nl80211.c */ 406 /* add attributes here, update the policy in nl80211.c */
350 407
351 __NL80211_ATTR_AFTER_LAST, 408 __NL80211_ATTR_AFTER_LAST,
@@ -360,7 +417,9 @@ enum nl80211_attrs {
360#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES 417#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
361#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS 418#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
362#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ 419#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
363#define NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET 420#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
421#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
422#define NL80211_ATTR_IE NL80211_ATTR_IE
364 423
365#define NL80211_MAX_SUPP_RATES 32 424#define NL80211_MAX_SUPP_RATES 32
366#define NL80211_MAX_SUPP_REG_RULES 32 425#define NL80211_MAX_SUPP_REG_RULES 32
@@ -412,12 +471,14 @@ enum nl80211_iftype {
412 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 471 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
413 * with short barker preamble 472 * with short barker preamble
414 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 473 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
474 * @NL80211_STA_FLAG_MFP: station uses management frame protection
415 */ 475 */
416enum nl80211_sta_flags { 476enum nl80211_sta_flags {
417 __NL80211_STA_FLAG_INVALID, 477 __NL80211_STA_FLAG_INVALID,
418 NL80211_STA_FLAG_AUTHORIZED, 478 NL80211_STA_FLAG_AUTHORIZED,
419 NL80211_STA_FLAG_SHORT_PREAMBLE, 479 NL80211_STA_FLAG_SHORT_PREAMBLE,
420 NL80211_STA_FLAG_WME, 480 NL80211_STA_FLAG_WME,
481 NL80211_STA_FLAG_MFP,
421 482
422 /* keep last */ 483 /* keep last */
423 __NL80211_STA_FLAG_AFTER_LAST, 484 __NL80211_STA_FLAG_AFTER_LAST,
@@ -811,4 +872,38 @@ enum nl80211_channel_type {
811 NL80211_CHAN_HT40MINUS, 872 NL80211_CHAN_HT40MINUS,
812 NL80211_CHAN_HT40PLUS 873 NL80211_CHAN_HT40PLUS
813}; 874};
875
876/**
877 * enum nl80211_bss - netlink attributes for a BSS
878 *
879 * @__NL80211_BSS_INVALID: invalid
880 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
881 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
882 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
883 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
884 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
885 * raw information elements from the probe response/beacon (bin)
886 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
887 * in mBm (100 * dBm) (s32)
888 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
889 * in unspecified units, scaled to 0..100 (u8)
890 * @__NL80211_BSS_AFTER_LAST: internal
891 * @NL80211_BSS_MAX: highest BSS attribute
892 */
893enum nl80211_bss {
894 __NL80211_BSS_INVALID,
895 NL80211_BSS_BSSID,
896 NL80211_BSS_FREQUENCY,
897 NL80211_BSS_TSF,
898 NL80211_BSS_BEACON_INTERVAL,
899 NL80211_BSS_CAPABILITY,
900 NL80211_BSS_INFORMATION_ELEMENTS,
901 NL80211_BSS_SIGNAL_MBM,
902 NL80211_BSS_SIGNAL_UNSPEC,
903
904 /* keep last */
905 __NL80211_BSS_AFTER_LAST,
906 NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
907};
908
814#endif /* __LINUX_NL80211_H */ 909#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 52a9fe08451..966e0233299 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -834,6 +834,8 @@
834#define PCI_DEVICE_ID_PROMISE_20276 0x5275 834#define PCI_DEVICE_ID_PROMISE_20276 0x5275
835#define PCI_DEVICE_ID_PROMISE_20277 0x7275 835#define PCI_DEVICE_ID_PROMISE_20277 0x7275
836 836
837#define PCI_VENDOR_ID_FOXCONN 0x105b
838
837#define PCI_VENDOR_ID_UMC 0x1060 839#define PCI_VENDOR_ID_UMC 0x1060
838#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 840#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
839#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 841#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
@@ -1969,6 +1971,8 @@
1969 1971
1970#define PCI_VENDOR_ID_SAMSUNG 0x144d 1972#define PCI_VENDOR_ID_SAMSUNG 0x144d
1971 1973
1974#define PCI_VENDOR_ID_AMBIT 0x1468
1975
1972#define PCI_VENDOR_ID_MYRICOM 0x14c1 1976#define PCI_VENDOR_ID_MYRICOM 0x14c1
1973 1977
1974#define PCI_VENDOR_ID_TITAN 0x14D2 1978#define PCI_VENDOR_ID_TITAN 0x14D2
@@ -2213,6 +2217,8 @@
2213 2217
2214#define PCI_VENDOR_ID_TOPSPIN 0x1867 2218#define PCI_VENDOR_ID_TOPSPIN 0x1867
2215 2219
2220#define PCI_VENDOR_ID_SILAN 0x1904
2221
2216#define PCI_VENDOR_ID_TDI 0x192E 2222#define PCI_VENDOR_ID_TDI 0x192E
2217#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2223#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2218 2224
diff --git a/include/linux/pim.h b/include/linux/pim.h
index 1ba0661561a..252bf6644c5 100644
--- a/include/linux/pim.h
+++ b/include/linux/pim.h
@@ -4,14 +4,14 @@
4#include <asm/byteorder.h> 4#include <asm/byteorder.h>
5 5
6/* Message types - V1 */ 6/* Message types - V1 */
7#define PIM_V1_VERSION __constant_htonl(0x10000000) 7#define PIM_V1_VERSION cpu_to_be32(0x10000000)
8#define PIM_V1_REGISTER 1 8#define PIM_V1_REGISTER 1
9 9
10/* Message types - V2 */ 10/* Message types - V2 */
11#define PIM_VERSION 2 11#define PIM_VERSION 2
12#define PIM_REGISTER 1 12#define PIM_REGISTER 1
13 13
14#define PIM_NULL_REGISTER __constant_htonl(0x40000000) 14#define PIM_NULL_REGISTER cpu_to_be32(0x40000000)
15 15
16/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ 16/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */
17struct pimreghdr 17struct pimreghdr
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
index a942892d6df..9d64bdf1477 100644
--- a/include/linux/ppp_channel.h
+++ b/include/linux/ppp_channel.h
@@ -22,6 +22,7 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <linux/poll.h> 24#include <linux/poll.h>
25#include <net/net_namespace.h>
25 26
26struct ppp_channel; 27struct ppp_channel;
27 28
@@ -56,6 +57,9 @@ extern void ppp_input(struct ppp_channel *, struct sk_buff *);
56 that we may have missed a packet. */ 57 that we may have missed a packet. */
57extern void ppp_input_error(struct ppp_channel *, int code); 58extern void ppp_input_error(struct ppp_channel *, int code);
58 59
60/* Attach a channel to a given PPP unit in specified net. */
61extern int ppp_register_net_channel(struct net *, struct ppp_channel *);
62
59/* Attach a channel to a given PPP unit. */ 63/* Attach a channel to a given PPP unit. */
60extern int ppp_register_channel(struct ppp_channel *); 64extern int ppp_register_channel(struct ppp_channel *);
61 65
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 8ba1c320f97..bd50b371ffa 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -172,35 +172,35 @@ typedef struct sctp_paramhdr {
172typedef enum { 172typedef enum {
173 173
174 /* RFC 2960 Section 3.3.5 */ 174 /* RFC 2960 Section 3.3.5 */
175 SCTP_PARAM_HEARTBEAT_INFO = __constant_htons(1), 175 SCTP_PARAM_HEARTBEAT_INFO = cpu_to_be16(1),
176 /* RFC 2960 Section 3.3.2.1 */ 176 /* RFC 2960 Section 3.3.2.1 */
177 SCTP_PARAM_IPV4_ADDRESS = __constant_htons(5), 177 SCTP_PARAM_IPV4_ADDRESS = cpu_to_be16(5),
178 SCTP_PARAM_IPV6_ADDRESS = __constant_htons(6), 178 SCTP_PARAM_IPV6_ADDRESS = cpu_to_be16(6),
179 SCTP_PARAM_STATE_COOKIE = __constant_htons(7), 179 SCTP_PARAM_STATE_COOKIE = cpu_to_be16(7),
180 SCTP_PARAM_UNRECOGNIZED_PARAMETERS = __constant_htons(8), 180 SCTP_PARAM_UNRECOGNIZED_PARAMETERS = cpu_to_be16(8),
181 SCTP_PARAM_COOKIE_PRESERVATIVE = __constant_htons(9), 181 SCTP_PARAM_COOKIE_PRESERVATIVE = cpu_to_be16(9),
182 SCTP_PARAM_HOST_NAME_ADDRESS = __constant_htons(11), 182 SCTP_PARAM_HOST_NAME_ADDRESS = cpu_to_be16(11),
183 SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = __constant_htons(12), 183 SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = cpu_to_be16(12),
184 SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000), 184 SCTP_PARAM_ECN_CAPABLE = cpu_to_be16(0x8000),
185 185
186 /* AUTH Extension Section 3 */ 186 /* AUTH Extension Section 3 */
187 SCTP_PARAM_RANDOM = __constant_htons(0x8002), 187 SCTP_PARAM_RANDOM = cpu_to_be16(0x8002),
188 SCTP_PARAM_CHUNKS = __constant_htons(0x8003), 188 SCTP_PARAM_CHUNKS = cpu_to_be16(0x8003),
189 SCTP_PARAM_HMAC_ALGO = __constant_htons(0x8004), 189 SCTP_PARAM_HMAC_ALGO = cpu_to_be16(0x8004),
190 190
191 /* Add-IP: Supported Extensions, Section 4.2 */ 191 /* Add-IP: Supported Extensions, Section 4.2 */
192 SCTP_PARAM_SUPPORTED_EXT = __constant_htons(0x8008), 192 SCTP_PARAM_SUPPORTED_EXT = cpu_to_be16(0x8008),
193 193
194 /* PR-SCTP Sec 3.1 */ 194 /* PR-SCTP Sec 3.1 */
195 SCTP_PARAM_FWD_TSN_SUPPORT = __constant_htons(0xc000), 195 SCTP_PARAM_FWD_TSN_SUPPORT = cpu_to_be16(0xc000),
196 196
197 /* Add-IP Extension. Section 3.2 */ 197 /* Add-IP Extension. Section 3.2 */
198 SCTP_PARAM_ADD_IP = __constant_htons(0xc001), 198 SCTP_PARAM_ADD_IP = cpu_to_be16(0xc001),
199 SCTP_PARAM_DEL_IP = __constant_htons(0xc002), 199 SCTP_PARAM_DEL_IP = cpu_to_be16(0xc002),
200 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), 200 SCTP_PARAM_ERR_CAUSE = cpu_to_be16(0xc003),
201 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), 201 SCTP_PARAM_SET_PRIMARY = cpu_to_be16(0xc004),
202 SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), 202 SCTP_PARAM_SUCCESS_REPORT = cpu_to_be16(0xc005),
203 SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006), 203 SCTP_PARAM_ADAPTATION_LAYER_IND = cpu_to_be16(0xc006),
204 204
205} sctp_param_t; /* enum */ 205} sctp_param_t; /* enum */
206 206
@@ -212,13 +212,13 @@ typedef enum {
212 * 212 *
213 */ 213 */
214typedef enum { 214typedef enum {
215 SCTP_PARAM_ACTION_DISCARD = __constant_htons(0x0000), 215 SCTP_PARAM_ACTION_DISCARD = cpu_to_be16(0x0000),
216 SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000), 216 SCTP_PARAM_ACTION_DISCARD_ERR = cpu_to_be16(0x4000),
217 SCTP_PARAM_ACTION_SKIP = __constant_htons(0x8000), 217 SCTP_PARAM_ACTION_SKIP = cpu_to_be16(0x8000),
218 SCTP_PARAM_ACTION_SKIP_ERR = __constant_htons(0xc000), 218 SCTP_PARAM_ACTION_SKIP_ERR = cpu_to_be16(0xc000),
219} sctp_param_action_t; 219} sctp_param_action_t;
220 220
221enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), }; 221enum { SCTP_PARAM_ACTION_MASK = cpu_to_be16(0xc000), };
222 222
223/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */ 223/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */
224 224
@@ -457,17 +457,17 @@ typedef struct sctp_operr_chunk {
457 */ 457 */
458typedef enum { 458typedef enum {
459 459
460 SCTP_ERROR_NO_ERROR = __constant_htons(0x00), 460 SCTP_ERROR_NO_ERROR = cpu_to_be16(0x00),
461 SCTP_ERROR_INV_STRM = __constant_htons(0x01), 461 SCTP_ERROR_INV_STRM = cpu_to_be16(0x01),
462 SCTP_ERROR_MISS_PARAM = __constant_htons(0x02), 462 SCTP_ERROR_MISS_PARAM = cpu_to_be16(0x02),
463 SCTP_ERROR_STALE_COOKIE = __constant_htons(0x03), 463 SCTP_ERROR_STALE_COOKIE = cpu_to_be16(0x03),
464 SCTP_ERROR_NO_RESOURCE = __constant_htons(0x04), 464 SCTP_ERROR_NO_RESOURCE = cpu_to_be16(0x04),
465 SCTP_ERROR_DNS_FAILED = __constant_htons(0x05), 465 SCTP_ERROR_DNS_FAILED = cpu_to_be16(0x05),
466 SCTP_ERROR_UNKNOWN_CHUNK = __constant_htons(0x06), 466 SCTP_ERROR_UNKNOWN_CHUNK = cpu_to_be16(0x06),
467 SCTP_ERROR_INV_PARAM = __constant_htons(0x07), 467 SCTP_ERROR_INV_PARAM = cpu_to_be16(0x07),
468 SCTP_ERROR_UNKNOWN_PARAM = __constant_htons(0x08), 468 SCTP_ERROR_UNKNOWN_PARAM = cpu_to_be16(0x08),
469 SCTP_ERROR_NO_DATA = __constant_htons(0x09), 469 SCTP_ERROR_NO_DATA = cpu_to_be16(0x09),
470 SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a), 470 SCTP_ERROR_COOKIE_IN_SHUTDOWN = cpu_to_be16(0x0a),
471 471
472 472
473 /* SCTP Implementation Guide: 473 /* SCTP Implementation Guide:
@@ -476,9 +476,9 @@ typedef enum {
476 * 13 Protocol Violation 476 * 13 Protocol Violation
477 */ 477 */
478 478
479 SCTP_ERROR_RESTART = __constant_htons(0x0b), 479 SCTP_ERROR_RESTART = cpu_to_be16(0x0b),
480 SCTP_ERROR_USER_ABORT = __constant_htons(0x0c), 480 SCTP_ERROR_USER_ABORT = cpu_to_be16(0x0c),
481 SCTP_ERROR_PROTO_VIOLATION = __constant_htons(0x0d), 481 SCTP_ERROR_PROTO_VIOLATION = cpu_to_be16(0x0d),
482 482
483 /* ADDIP Section 3.3 New Error Causes 483 /* ADDIP Section 3.3 New Error Causes
484 * 484 *
@@ -493,11 +493,11 @@ typedef enum {
493 * 0x0103 Association Aborted due to illegal ASCONF-ACK 493 * 0x0103 Association Aborted due to illegal ASCONF-ACK
494 * 0x0104 Request refused - no authorization. 494 * 0x0104 Request refused - no authorization.
495 */ 495 */
496 SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), 496 SCTP_ERROR_DEL_LAST_IP = cpu_to_be16(0x0100),
497 SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), 497 SCTP_ERROR_RSRC_LOW = cpu_to_be16(0x0101),
498 SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), 498 SCTP_ERROR_DEL_SRC_IP = cpu_to_be16(0x0102),
499 SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), 499 SCTP_ERROR_ASCONF_ACK = cpu_to_be16(0x0103),
500 SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104), 500 SCTP_ERROR_REQ_REFUSED = cpu_to_be16(0x0104),
501 501
502 /* AUTH Section 4. New Error Cause 502 /* AUTH Section 4. New Error Cause
503 * 503 *
@@ -509,7 +509,7 @@ typedef enum {
509 * -------------------------------------------------------------- 509 * --------------------------------------------------------------
510 * 0x0105 Unsupported HMAC Identifier 510 * 0x0105 Unsupported HMAC Identifier
511 */ 511 */
512 SCTP_ERROR_UNSUP_HMAC = __constant_htons(0x0105) 512 SCTP_ERROR_UNSUP_HMAC = cpu_to_be16(0x0105)
513} sctp_error_t; 513} sctp_error_t;
514 514
515 515
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index cf2cb50f77d..92470084458 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,9 +29,6 @@
29#include <linux/dmaengine.h> 29#include <linux/dmaengine.h>
30#include <linux/hrtimer.h> 30#include <linux/hrtimer.h>
31 31
32#define HAVE_ALLOC_SKB /* For the drivers to know */
33#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
34
35/* Don't change this without changing skb_csum_unnecessary! */ 32/* Don't change this without changing skb_csum_unnecessary! */
36#define CHECKSUM_NONE 0 33#define CHECKSUM_NONE 0
37#define CHECKSUM_UNNECESSARY 1 34#define CHECKSUM_UNNECESSARY 1
@@ -1287,7 +1284,7 @@ static inline int skb_network_offset(const struct sk_buff *skb)
1287 * The networking layer reserves some headroom in skb data (via 1284 * The networking layer reserves some headroom in skb data (via
1288 * dev_alloc_skb). This is used to avoid having to reallocate skb data when 1285 * dev_alloc_skb). This is used to avoid having to reallocate skb data when
1289 * the header has to grow. In the default case, if the header has to grow 1286 * the header has to grow. In the default case, if the header has to grow
1290 * 16 bytes or less we avoid the reallocation. 1287 * 32 bytes or less we avoid the reallocation.
1291 * 1288 *
1292 * Unfortunately this headroom changes the DMA alignment of the resulting 1289 * Unfortunately this headroom changes the DMA alignment of the resulting
1293 * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive 1290 * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive
@@ -1295,11 +1292,11 @@ static inline int skb_network_offset(const struct sk_buff *skb)
1295 * perhaps setting it to a cacheline in size (since that will maintain 1292 * perhaps setting it to a cacheline in size (since that will maintain
1296 * cacheline alignment of the DMA). It must be a power of 2. 1293 * cacheline alignment of the DMA). It must be a power of 2.
1297 * 1294 *
1298 * Various parts of the networking layer expect at least 16 bytes of 1295 * Various parts of the networking layer expect at least 32 bytes of
1299 * headroom, you should not reduce this. 1296 * headroom, you should not reduce this.
1300 */ 1297 */
1301#ifndef NET_SKB_PAD 1298#ifndef NET_SKB_PAD
1302#define NET_SKB_PAD 16 1299#define NET_SKB_PAD 32
1303#endif 1300#endif
1304 1301
1305extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); 1302extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
@@ -1687,8 +1684,6 @@ extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
1687 int shiftlen); 1684 int shiftlen);
1688 1685
1689extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); 1686extern struct sk_buff *skb_segment(struct sk_buff *skb, int features);
1690extern int skb_gro_receive(struct sk_buff **head,
1691 struct sk_buff *skb);
1692 1687
1693static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1688static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1694 int len, void *buffer) 1689 int len, void *buffer)
@@ -1904,6 +1899,21 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
1904 to->queue_mapping = from->queue_mapping; 1899 to->queue_mapping = from->queue_mapping;
1905} 1900}
1906 1901
1902static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue)
1903{
1904 skb->queue_mapping = rx_queue + 1;
1905}
1906
1907static inline u16 skb_get_rx_queue(struct sk_buff *skb)
1908{
1909 return skb->queue_mapping - 1;
1910}
1911
1912static inline bool skb_rx_queue_recorded(struct sk_buff *skb)
1913{
1914 return (skb->queue_mapping != 0);
1915}
1916
1907#ifdef CONFIG_XFRM 1917#ifdef CONFIG_XFRM
1908static inline struct sec_path *skb_sec_path(struct sk_buff *skb) 1918static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1909{ 1919{
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 1cbf0313add..b32725075d7 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -43,5 +43,8 @@ struct smsc911x_platform_config {
43/* Constants for flags */ 43/* Constants for flags */
44#define SMSC911X_USE_16BIT (BIT(0)) 44#define SMSC911X_USE_16BIT (BIT(0))
45#define SMSC911X_USE_32BIT (BIT(1)) 45#define SMSC911X_USE_32BIT (BIT(1))
46#define SMSC911X_FORCE_INTERNAL_PHY (BIT(2))
47#define SMSC911X_FORCE_EXTERNAL_PHY (BIT(3))
48#define SMSC911X_SAVE_MAC_ADDRESS (BIT(4))
46 49
47#endif /* __LINUX_SMSC911X_H__ */ 50#endif /* __LINUX_SMSC911X_H__ */
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h
new file mode 100644
index 00000000000..79506f5f9e6
--- /dev/null
+++ b/include/linux/spi/libertas_spi.h
@@ -0,0 +1,32 @@
1/*
2 * board-specific data for the libertas_spi driver.
3 *
4 * Copyright 2008 Analog Devices Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 */
11#ifndef _LIBERTAS_SPI_H_
12#define _LIBERTAS_SPI_H_
13
14struct spi_device;
15
16struct libertas_spi_platform_data {
17 /* There are two ways to read data from the WLAN module's SPI
18 * interface. Setting 0 or 1 here controls which one is used.
19 *
20 * Usually you want to set use_dummy_writes = 1.
21 * However, if that doesn't work or if you are using a slow SPI clock
22 * speed, you may want to use 0 here. */
23 u16 use_dummy_writes;
24
25 /* GPIO number to use as chip select */
26 u16 gpio_cs;
27
28 /* Board specific setup/teardown */
29 int (*setup)(struct spi_device *spi);
30 int (*teardown)(struct spi_device *spi);
31};
32#endif
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index 7d7e03dcf77..d3b1d18922f 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -181,6 +181,16 @@
181#define SSB_CHIPCO_PROG_WAITCNT 0x0124 181#define SSB_CHIPCO_PROG_WAITCNT 0x0124
182#define SSB_CHIPCO_FLASH_CFG 0x0128 182#define SSB_CHIPCO_FLASH_CFG 0x0128
183#define SSB_CHIPCO_FLASH_WAITCNT 0x012C 183#define SSB_CHIPCO_FLASH_WAITCNT 0x012C
184#define SSB_CHIPCO_CLKCTLST 0x01E0 /* Clock control and status (rev >= 20) */
185#define SSB_CHIPCO_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */
186#define SSB_CHIPCO_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */
187#define SSB_CHIPCO_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */
188#define SSB_CHIPCO_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */
189#define SSB_CHIPCO_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
190#define SSB_CHIPCO_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
191#define SSB_CHIPCO_CLKCTLST_HAVEHT 0x00010000 /* HT available */
192#define SSB_CHIPCO_CLKCTLST_HAVEALP 0x00020000 /* APL available */
193#define SSB_CHIPCO_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
184#define SSB_CHIPCO_UART0_DATA 0x0300 194#define SSB_CHIPCO_UART0_DATA 0x0300
185#define SSB_CHIPCO_UART0_IMR 0x0304 195#define SSB_CHIPCO_UART0_IMR 0x0304
186#define SSB_CHIPCO_UART0_FCR 0x0308 196#define SSB_CHIPCO_UART0_FCR 0x0308
@@ -197,6 +207,196 @@
197#define SSB_CHIPCO_UART1_LSR 0x0414 207#define SSB_CHIPCO_UART1_LSR 0x0414
198#define SSB_CHIPCO_UART1_MSR 0x0418 208#define SSB_CHIPCO_UART1_MSR 0x0418
199#define SSB_CHIPCO_UART1_SCRATCH 0x041C 209#define SSB_CHIPCO_UART1_SCRATCH 0x041C
210/* PMU registers (rev >= 20) */
211#define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */
212#define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */
213#define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16
214#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */
215#define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */
216#define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */
217#define SSB_CHIPCO_PMU_CTL_XTALFREQ 0x0000007C /* Crystal freq */
218#define SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT 2
219#define SSB_CHIPCO_PMU_CTL_ILPDIVEN 0x00000002 /* ILP div enable */
220#define SSB_CHIPCO_PMU_CTL_LPOSEL 0x00000001 /* LPO sel */
221#define SSB_CHIPCO_PMU_CAP 0x0604 /* PMU capabilities */
222#define SSB_CHIPCO_PMU_CAP_REVISION 0x000000FF /* Revision mask */
223#define SSB_CHIPCO_PMU_STAT 0x0608 /* PMU status */
224#define SSB_CHIPCO_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */
225#define SSB_CHIPCO_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */
226#define SSB_CHIPCO_PMU_STAT_HAVEALP 0x00000008 /* ALP available */
227#define SSB_CHIPCO_PMU_STAT_HAVEHT 0x00000004 /* HT available */
228#define SSB_CHIPCO_PMU_STAT_RESINIT 0x00000003 /* Res init */
229#define SSB_CHIPCO_PMU_RES_STAT 0x060C /* PMU res status */
230#define SSB_CHIPCO_PMU_RES_PEND 0x0610 /* PMU res pending */
231#define SSB_CHIPCO_PMU_TIMER 0x0614 /* PMU timer */
232#define SSB_CHIPCO_PMU_MINRES_MSK 0x0618 /* PMU min res mask */
233#define SSB_CHIPCO_PMU_MAXRES_MSK 0x061C /* PMU max res mask */
234#define SSB_CHIPCO_PMU_RES_TABSEL 0x0620 /* PMU res table sel */
235#define SSB_CHIPCO_PMU_RES_DEPMSK 0x0624 /* PMU res dep mask */
236#define SSB_CHIPCO_PMU_RES_UPDNTM 0x0628 /* PMU res updown timer */
237#define SSB_CHIPCO_PMU_RES_TIMER 0x062C /* PMU res timer */
238#define SSB_CHIPCO_PMU_CLKSTRETCH 0x0630 /* PMU clockstretch */
239#define SSB_CHIPCO_PMU_WATCHDOG 0x0634 /* PMU watchdog */
240#define SSB_CHIPCO_PMU_RES_REQTS 0x0640 /* PMU res req timer sel */
241#define SSB_CHIPCO_PMU_RES_REQT 0x0644 /* PMU res req timer */
242#define SSB_CHIPCO_PMU_RES_REQM 0x0648 /* PMU res req mask */
243#define SSB_CHIPCO_CHIPCTL_ADDR 0x0650
244#define SSB_CHIPCO_CHIPCTL_DATA 0x0654
245#define SSB_CHIPCO_REGCTL_ADDR 0x0658
246#define SSB_CHIPCO_REGCTL_DATA 0x065C
247#define SSB_CHIPCO_PLLCTL_ADDR 0x0660
248#define SSB_CHIPCO_PLLCTL_DATA 0x0664
249
250
251
252/** PMU PLL registers */
253
254/* PMU rev 0 PLL registers */
255#define SSB_PMU0_PLLCTL0 0
256#define SSB_PMU0_PLLCTL0_PDIV_MSK 0x00000001
257#define SSB_PMU0_PLLCTL0_PDIV_FREQ 25000 /* kHz */
258#define SSB_PMU0_PLLCTL1 1
259#define SSB_PMU0_PLLCTL1_WILD_IMSK 0xF0000000 /* Wild int mask (low nibble) */
260#define SSB_PMU0_PLLCTL1_WILD_IMSK_SHIFT 28
261#define SSB_PMU0_PLLCTL1_WILD_FMSK 0x0FFFFF00 /* Wild frac mask */
262#define SSB_PMU0_PLLCTL1_WILD_FMSK_SHIFT 8
263#define SSB_PMU0_PLLCTL1_STOPMOD 0x00000040 /* Stop mod */
264#define SSB_PMU0_PLLCTL2 2
265#define SSB_PMU0_PLLCTL2_WILD_IMSKHI 0x0000000F /* Wild int mask (high nibble) */
266#define SSB_PMU0_PLLCTL2_WILD_IMSKHI_SHIFT 0
267
268/* PMU rev 1 PLL registers */
269#define SSB_PMU1_PLLCTL0 0
270#define SSB_PMU1_PLLCTL0_P1DIV 0x00F00000 /* P1 div */
271#define SSB_PMU1_PLLCTL0_P1DIV_SHIFT 20
272#define SSB_PMU1_PLLCTL0_P2DIV 0x0F000000 /* P2 div */
273#define SSB_PMU1_PLLCTL0_P2DIV_SHIFT 24
274#define SSB_PMU1_PLLCTL1 1
275#define SSB_PMU1_PLLCTL1_M1DIV 0x000000FF /* M1 div */
276#define SSB_PMU1_PLLCTL1_M1DIV_SHIFT 0
277#define SSB_PMU1_PLLCTL1_M2DIV 0x0000FF00 /* M2 div */
278#define SSB_PMU1_PLLCTL1_M2DIV_SHIFT 8
279#define SSB_PMU1_PLLCTL1_M3DIV 0x00FF0000 /* M3 div */
280#define SSB_PMU1_PLLCTL1_M3DIV_SHIFT 16
281#define SSB_PMU1_PLLCTL1_M4DIV 0xFF000000 /* M4 div */
282#define SSB_PMU1_PLLCTL1_M4DIV_SHIFT 24
283#define SSB_PMU1_PLLCTL2 2
284#define SSB_PMU1_PLLCTL2_M5DIV 0x000000FF /* M5 div */
285#define SSB_PMU1_PLLCTL2_M5DIV_SHIFT 0
286#define SSB_PMU1_PLLCTL2_M6DIV 0x0000FF00 /* M6 div */
287#define SSB_PMU1_PLLCTL2_M6DIV_SHIFT 8
288#define SSB_PMU1_PLLCTL2_NDIVMODE 0x000E0000 /* NDIV mode */
289#define SSB_PMU1_PLLCTL2_NDIVMODE_SHIFT 17
290#define SSB_PMU1_PLLCTL2_NDIVINT 0x1FF00000 /* NDIV int */
291#define SSB_PMU1_PLLCTL2_NDIVINT_SHIFT 20
292#define SSB_PMU1_PLLCTL3 3
293#define SSB_PMU1_PLLCTL3_NDIVFRAC 0x00FFFFFF /* NDIV frac */
294#define SSB_PMU1_PLLCTL3_NDIVFRAC_SHIFT 0
295#define SSB_PMU1_PLLCTL4 4
296#define SSB_PMU1_PLLCTL5 5
297#define SSB_PMU1_PLLCTL5_CLKDRV 0xFFFFFF00 /* clk drv */
298#define SSB_PMU1_PLLCTL5_CLKDRV_SHIFT 8
299
300/* BCM4312 PLL resource numbers. */
301#define SSB_PMURES_4312_SWITCHER_BURST 0
302#define SSB_PMURES_4312_SWITCHER_PWM 1
303#define SSB_PMURES_4312_PA_REF_LDO 2
304#define SSB_PMURES_4312_CORE_LDO_BURST 3
305#define SSB_PMURES_4312_CORE_LDO_PWM 4
306#define SSB_PMURES_4312_RADIO_LDO 5
307#define SSB_PMURES_4312_ILP_REQUEST 6
308#define SSB_PMURES_4312_BG_FILTBYP 7
309#define SSB_PMURES_4312_TX_FILTBYP 8
310#define SSB_PMURES_4312_RX_FILTBYP 9
311#define SSB_PMURES_4312_XTAL_PU 10
312#define SSB_PMURES_4312_ALP_AVAIL 11
313#define SSB_PMURES_4312_BB_PLL_FILTBYP 12
314#define SSB_PMURES_4312_RF_PLL_FILTBYP 13
315#define SSB_PMURES_4312_HT_AVAIL 14
316
317/* BCM4325 PLL resource numbers. */
318#define SSB_PMURES_4325_BUCK_BOOST_BURST 0
319#define SSB_PMURES_4325_CBUCK_BURST 1
320#define SSB_PMURES_4325_CBUCK_PWM 2
321#define SSB_PMURES_4325_CLDO_CBUCK_BURST 3
322#define SSB_PMURES_4325_CLDO_CBUCK_PWM 4
323#define SSB_PMURES_4325_BUCK_BOOST_PWM 5
324#define SSB_PMURES_4325_ILP_REQUEST 6
325#define SSB_PMURES_4325_ABUCK_BURST 7
326#define SSB_PMURES_4325_ABUCK_PWM 8
327#define SSB_PMURES_4325_LNLDO1_PU 9
328#define SSB_PMURES_4325_LNLDO2_PU 10
329#define SSB_PMURES_4325_LNLDO3_PU 11
330#define SSB_PMURES_4325_LNLDO4_PU 12
331#define SSB_PMURES_4325_XTAL_PU 13
332#define SSB_PMURES_4325_ALP_AVAIL 14
333#define SSB_PMURES_4325_RX_PWRSW_PU 15
334#define SSB_PMURES_4325_TX_PWRSW_PU 16
335#define SSB_PMURES_4325_RFPLL_PWRSW_PU 17
336#define SSB_PMURES_4325_LOGEN_PWRSW_PU 18
337#define SSB_PMURES_4325_AFE_PWRSW_PU 19
338#define SSB_PMURES_4325_BBPLL_PWRSW_PU 20
339#define SSB_PMURES_4325_HT_AVAIL 21
340
341/* BCM4328 PLL resource numbers. */
342#define SSB_PMURES_4328_EXT_SWITCHER_PWM 0
343#define SSB_PMURES_4328_BB_SWITCHER_PWM 1
344#define SSB_PMURES_4328_BB_SWITCHER_BURST 2
345#define SSB_PMURES_4328_BB_EXT_SWITCHER_BURST 3
346#define SSB_PMURES_4328_ILP_REQUEST 4
347#define SSB_PMURES_4328_RADIO_SWITCHER_PWM 5
348#define SSB_PMURES_4328_RADIO_SWITCHER_BURST 6
349#define SSB_PMURES_4328_ROM_SWITCH 7
350#define SSB_PMURES_4328_PA_REF_LDO 8
351#define SSB_PMURES_4328_RADIO_LDO 9
352#define SSB_PMURES_4328_AFE_LDO 10
353#define SSB_PMURES_4328_PLL_LDO 11
354#define SSB_PMURES_4328_BG_FILTBYP 12
355#define SSB_PMURES_4328_TX_FILTBYP 13
356#define SSB_PMURES_4328_RX_FILTBYP 14
357#define SSB_PMURES_4328_XTAL_PU 15
358#define SSB_PMURES_4328_XTAL_EN 16
359#define SSB_PMURES_4328_BB_PLL_FILTBYP 17
360#define SSB_PMURES_4328_RF_PLL_FILTBYP 18
361#define SSB_PMURES_4328_BB_PLL_PU 19
362
363/* BCM5354 PLL resource numbers. */
364#define SSB_PMURES_5354_EXT_SWITCHER_PWM 0
365#define SSB_PMURES_5354_BB_SWITCHER_PWM 1
366#define SSB_PMURES_5354_BB_SWITCHER_BURST 2
367#define SSB_PMURES_5354_BB_EXT_SWITCHER_BURST 3
368#define SSB_PMURES_5354_ILP_REQUEST 4
369#define SSB_PMURES_5354_RADIO_SWITCHER_PWM 5
370#define SSB_PMURES_5354_RADIO_SWITCHER_BURST 6
371#define SSB_PMURES_5354_ROM_SWITCH 7
372#define SSB_PMURES_5354_PA_REF_LDO 8
373#define SSB_PMURES_5354_RADIO_LDO 9
374#define SSB_PMURES_5354_AFE_LDO 10
375#define SSB_PMURES_5354_PLL_LDO 11
376#define SSB_PMURES_5354_BG_FILTBYP 12
377#define SSB_PMURES_5354_TX_FILTBYP 13
378#define SSB_PMURES_5354_RX_FILTBYP 14
379#define SSB_PMURES_5354_XTAL_PU 15
380#define SSB_PMURES_5354_XTAL_EN 16
381#define SSB_PMURES_5354_BB_PLL_FILTBYP 17
382#define SSB_PMURES_5354_RF_PLL_FILTBYP 18
383#define SSB_PMURES_5354_BB_PLL_PU 19
384
385
386
387/** Chip specific Chip-Status register contents. */
388#define SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL 0x00000003
389#define SSB_CHIPCO_CHST_4325_DEFCIS_SEL 0 /* OTP is powered up, use def. CIS, no SPROM */
390#define SSB_CHIPCO_CHST_4325_SPROM_SEL 1 /* OTP is powered up, SPROM is present */
391#define SSB_CHIPCO_CHST_4325_OTP_SEL 2 /* OTP is powered up, no SPROM */
392#define SSB_CHIPCO_CHST_4325_OTP_PWRDN 3 /* OTP is powered down, SPROM is present */
393#define SSB_CHIPCO_CHST_4325_SDIO_USB_MODE 0x00000004
394#define SSB_CHIPCO_CHST_4325_SDIO_USB_MODE_SHIFT 2
395#define SSB_CHIPCO_CHST_4325_RCAL_VALID 0x00000008
396#define SSB_CHIPCO_CHST_4325_RCAL_VALID_SHIFT 3
397#define SSB_CHIPCO_CHST_4325_RCAL_VALUE 0x000001F0
398#define SSB_CHIPCO_CHST_4325_RCAL_VALUE_SHIFT 4
399#define SSB_CHIPCO_CHST_4325_PMUTOP_2B 0x00000200 /* 1 for 2b, 0 for to 2a */
200 400
201 401
202 402
@@ -353,11 +553,20 @@
353struct ssb_device; 553struct ssb_device;
354struct ssb_serial_port; 554struct ssb_serial_port;
355 555
556/* Data for the PMU, if available.
557 * Check availability with ((struct ssb_chipcommon)->capabilities & SSB_CHIPCO_CAP_PMU)
558 */
559struct ssb_chipcommon_pmu {
560 u8 rev; /* PMU revision */
561 u32 crystalfreq; /* The active crystal frequency (in kHz) */
562};
563
356struct ssb_chipcommon { 564struct ssb_chipcommon {
357 struct ssb_device *dev; 565 struct ssb_device *dev;
358 u32 capabilities; 566 u32 capabilities;
359 /* Fast Powerup Delay constant */ 567 /* Fast Powerup Delay constant */
360 u16 fast_pwrup_delay; 568 u16 fast_pwrup_delay;
569 struct ssb_chipcommon_pmu pmu;
361}; 570};
362 571
363static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) 572static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
@@ -365,6 +574,17 @@ static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
365 return (cc->dev != NULL); 574 return (cc->dev != NULL);
366} 575}
367 576
577/* Register access */
578#define chipco_read32(cc, offset) ssb_read32((cc)->dev, offset)
579#define chipco_write32(cc, offset, val) ssb_write32((cc)->dev, offset, val)
580
581#define chipco_mask32(cc, offset, mask) \
582 chipco_write32(cc, offset, chipco_read32(cc, offset) & (mask))
583#define chipco_set32(cc, offset, set) \
584 chipco_write32(cc, offset, chipco_read32(cc, offset) | (set))
585#define chipco_maskset32(cc, offset, mask, set) \
586 chipco_write32(cc, offset, (chipco_read32(cc, offset) & (mask)) | (set))
587
368extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); 588extern void ssb_chipcommon_init(struct ssb_chipcommon *cc);
369 589
370extern void ssb_chipco_suspend(struct ssb_chipcommon *cc); 590extern void ssb_chipco_suspend(struct ssb_chipcommon *cc);
@@ -406,4 +626,8 @@ extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
406 struct ssb_serial_port *ports); 626 struct ssb_serial_port *ports);
407#endif /* CONFIG_SSB_SERIAL */ 627#endif /* CONFIG_SSB_SERIAL */
408 628
629/* PMU support */
630extern void ssb_pmu_init(struct ssb_chipcommon *cc);
631
632
409#endif /* LINUX_SSB_CHIPCO_H_ */ 633#endif /* LINUX_SSB_CHIPCO_H_ */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index 99a0f991e85..a01b982b578 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -326,6 +326,42 @@
326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ 326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */
327#define SSB_SPROM5_GPIOB_P3_SHIFT 8 327#define SSB_SPROM5_GPIOB_P3_SHIFT 8
328 328
329/* SPROM Revision 8 */
330#define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */
331#define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */
332#define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */
333#define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */
334#define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/
335#define SSB_SPROM8_ANTAVAIL_A 0xFF00 /* A-PHY bitfield */
336#define SSB_SPROM8_ANTAVAIL_A_SHIFT 8
337#define SSB_SPROM8_ANTAVAIL_BG 0x00FF /* B-PHY and G-PHY bitfield */
338#define SSB_SPROM8_ANTAVAIL_BG_SHIFT 0
339#define SSB_SPROM8_AGAIN01 0x109E /* Antenna Gain (in dBm Q5.2) */
340#define SSB_SPROM8_AGAIN0 0x00FF /* Antenna 0 */
341#define SSB_SPROM8_AGAIN0_SHIFT 0
342#define SSB_SPROM8_AGAIN1 0xFF00 /* Antenna 1 */
343#define SSB_SPROM8_AGAIN1_SHIFT 8
344#define SSB_SPROM8_AGAIN23 0x10A0
345#define SSB_SPROM8_AGAIN2 0x00FF /* Antenna 2 */
346#define SSB_SPROM8_AGAIN2_SHIFT 0
347#define SSB_SPROM8_AGAIN3 0xFF00 /* Antenna 3 */
348#define SSB_SPROM8_AGAIN3_SHIFT 8
349#define SSB_SPROM8_GPIOA 0x1096 /*Gen. Purpose IO # 0 and 1 */
350#define SSB_SPROM8_GPIOA_P0 0x00FF /* Pin 0 */
351#define SSB_SPROM8_GPIOA_P1 0xFF00 /* Pin 1 */
352#define SSB_SPROM8_GPIOA_P1_SHIFT 8
353#define SSB_SPROM8_GPIOB 0x1098 /* Gen. Purpose IO # 2 and 3 */
354#define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */
355#define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */
356#define SSB_SPROM8_GPIOB_P3_SHIFT 8
357#define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */
358#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */
359#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
360#define SSB_SPROM8_ITSSI_BG_SHIFT 8
361#define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */
362#define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */
363#define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */
364#define SSB_SPROM8_ITSSI_A_SHIFT 8
329 365
330/* Values for SSB_SPROM1_BINF_CCODE */ 366/* Values for SSB_SPROM1_BINF_CCODE */
331enum { 367enum {
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 39d471d1163..e76d3b22a46 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -490,6 +490,7 @@ enum
490 NET_IPV4_CONF_ARP_IGNORE=19, 490 NET_IPV4_CONF_ARP_IGNORE=19,
491 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 491 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
492 NET_IPV4_CONF_ARP_ACCEPT=21, 492 NET_IPV4_CONF_ARP_ACCEPT=21,
493 NET_IPV4_CONF_ARP_NOTIFY=22,
493 __NET_IPV4_CONF_MAX 494 __NET_IPV4_CONF_MAX
494}; 495};
495 496
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index fe77e1499ab..0cd99e6baca 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -69,16 +69,16 @@ union tcp_word_hdr {
69#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 69#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
70 70
71enum { 71enum {
72 TCP_FLAG_CWR = __constant_htonl(0x00800000), 72 TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
73 TCP_FLAG_ECE = __constant_htonl(0x00400000), 73 TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
74 TCP_FLAG_URG = __constant_htonl(0x00200000), 74 TCP_FLAG_URG = __cpu_to_be32(0x00200000),
75 TCP_FLAG_ACK = __constant_htonl(0x00100000), 75 TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
76 TCP_FLAG_PSH = __constant_htonl(0x00080000), 76 TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
77 TCP_FLAG_RST = __constant_htonl(0x00040000), 77 TCP_FLAG_RST = __cpu_to_be32(0x00040000),
78 TCP_FLAG_SYN = __constant_htonl(0x00020000), 78 TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
79 TCP_FLAG_FIN = __constant_htonl(0x00010000), 79 TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
80 TCP_RESERVED_BITS = __constant_htonl(0x0F000000), 80 TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
81 TCP_DATA_OFFSET = __constant_htonl(0xF0000000) 81 TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
82}; 82};
83 83
84/* TCP socket options */ 84/* TCP socket options */
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 0a6e6d4b929..37836b937d9 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -49,48 +49,45 @@ struct rndis_msg_hdr {
49 */ 49 */
50#define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000) 50#define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000)
51 51
52 52#define RNDIS_MSG_COMPLETION cpu_to_le32(0x80000000)
53#define ccpu2 __constant_cpu_to_le32
54
55#define RNDIS_MSG_COMPLETION ccpu2(0x80000000)
56 53
57/* codes for "msg_type" field of rndis messages; 54/* codes for "msg_type" field of rndis messages;
58 * only the data channel uses packet messages (maybe batched); 55 * only the data channel uses packet messages (maybe batched);
59 * everything else goes on the control channel. 56 * everything else goes on the control channel.
60 */ 57 */
61#define RNDIS_MSG_PACKET ccpu2(0x00000001) /* 1-N packets */ 58#define RNDIS_MSG_PACKET cpu_to_le32(0x00000001) /* 1-N packets */
62#define RNDIS_MSG_INIT ccpu2(0x00000002) 59#define RNDIS_MSG_INIT cpu_to_le32(0x00000002)
63#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION) 60#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION)
64#define RNDIS_MSG_HALT ccpu2(0x00000003) 61#define RNDIS_MSG_HALT cpu_to_le32(0x00000003)
65#define RNDIS_MSG_QUERY ccpu2(0x00000004) 62#define RNDIS_MSG_QUERY cpu_to_le32(0x00000004)
66#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION) 63#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION)
67#define RNDIS_MSG_SET ccpu2(0x00000005) 64#define RNDIS_MSG_SET cpu_to_le32(0x00000005)
68#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION) 65#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION)
69#define RNDIS_MSG_RESET ccpu2(0x00000006) 66#define RNDIS_MSG_RESET cpu_to_le32(0x00000006)
70#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION) 67#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION)
71#define RNDIS_MSG_INDICATE ccpu2(0x00000007) 68#define RNDIS_MSG_INDICATE cpu_to_le32(0x00000007)
72#define RNDIS_MSG_KEEPALIVE ccpu2(0x00000008) 69#define RNDIS_MSG_KEEPALIVE cpu_to_le32(0x00000008)
73#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) 70#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
74 71
75/* codes for "status" field of completion messages */ 72/* codes for "status" field of completion messages */
76#define RNDIS_STATUS_SUCCESS ccpu2(0x00000000) 73#define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000)
77#define RNDIS_STATUS_FAILURE ccpu2(0xc0000001) 74#define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001)
78#define RNDIS_STATUS_INVALID_DATA ccpu2(0xc0010015) 75#define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015)
79#define RNDIS_STATUS_NOT_SUPPORTED ccpu2(0xc00000bb) 76#define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb)
80#define RNDIS_STATUS_MEDIA_CONNECT ccpu2(0x4001000b) 77#define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b)
81#define RNDIS_STATUS_MEDIA_DISCONNECT ccpu2(0x4001000c) 78#define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c)
82 79
83/* codes for OID_GEN_PHYSICAL_MEDIUM */ 80/* codes for OID_GEN_PHYSICAL_MEDIUM */
84#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED ccpu2(0x00000000) 81#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000)
85#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN ccpu2(0x00000001) 82#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN cpu_to_le32(0x00000001)
86#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM ccpu2(0x00000002) 83#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM cpu_to_le32(0x00000002)
87#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE ccpu2(0x00000003) 84#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE cpu_to_le32(0x00000003)
88#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE ccpu2(0x00000004) 85#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE cpu_to_le32(0x00000004)
89#define RNDIS_PHYSICAL_MEDIUM_DSL ccpu2(0x00000005) 86#define RNDIS_PHYSICAL_MEDIUM_DSL cpu_to_le32(0x00000005)
90#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL ccpu2(0x00000006) 87#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL cpu_to_le32(0x00000006)
91#define RNDIS_PHYSICAL_MEDIUM_1394 ccpu2(0x00000007) 88#define RNDIS_PHYSICAL_MEDIUM_1394 cpu_to_le32(0x00000007)
92#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN ccpu2(0x00000008) 89#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN cpu_to_le32(0x00000008)
93#define RNDIS_PHYSICAL_MEDIUM_MAX ccpu2(0x00000009) 90#define RNDIS_PHYSICAL_MEDIUM_MAX cpu_to_le32(0x00000009)
94 91
95struct rndis_data_hdr { 92struct rndis_data_hdr {
96 __le32 msg_type; /* RNDIS_MSG_PACKET */ 93 __le32 msg_type; /* RNDIS_MSG_PACKET */
@@ -228,24 +225,24 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
228 * there are gobs more that may optionally be supported. We'll avoid as much 225 * there are gobs more that may optionally be supported. We'll avoid as much
229 * of that mess as possible. 226 * of that mess as possible.
230 */ 227 */
231#define OID_802_3_PERMANENT_ADDRESS ccpu2(0x01010101) 228#define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101)
232#define OID_GEN_MAXIMUM_FRAME_SIZE ccpu2(0x00010106) 229#define OID_GEN_MAXIMUM_FRAME_SIZE cpu_to_le32(0x00010106)
233#define OID_GEN_CURRENT_PACKET_FILTER ccpu2(0x0001010e) 230#define OID_GEN_CURRENT_PACKET_FILTER cpu_to_le32(0x0001010e)
234#define OID_GEN_PHYSICAL_MEDIUM ccpu2(0x00010202) 231#define OID_GEN_PHYSICAL_MEDIUM cpu_to_le32(0x00010202)
235 232
236/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ 233/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
237#define RNDIS_PACKET_TYPE_DIRECTED ccpu2(0x00000001) 234#define RNDIS_PACKET_TYPE_DIRECTED cpu_to_le32(0x00000001)
238#define RNDIS_PACKET_TYPE_MULTICAST ccpu2(0x00000002) 235#define RNDIS_PACKET_TYPE_MULTICAST cpu_to_le32(0x00000002)
239#define RNDIS_PACKET_TYPE_ALL_MULTICAST ccpu2(0x00000004) 236#define RNDIS_PACKET_TYPE_ALL_MULTICAST cpu_to_le32(0x00000004)
240#define RNDIS_PACKET_TYPE_BROADCAST ccpu2(0x00000008) 237#define RNDIS_PACKET_TYPE_BROADCAST cpu_to_le32(0x00000008)
241#define RNDIS_PACKET_TYPE_SOURCE_ROUTING ccpu2(0x00000010) 238#define RNDIS_PACKET_TYPE_SOURCE_ROUTING cpu_to_le32(0x00000010)
242#define RNDIS_PACKET_TYPE_PROMISCUOUS ccpu2(0x00000020) 239#define RNDIS_PACKET_TYPE_PROMISCUOUS cpu_to_le32(0x00000020)
243#define RNDIS_PACKET_TYPE_SMT ccpu2(0x00000040) 240#define RNDIS_PACKET_TYPE_SMT cpu_to_le32(0x00000040)
244#define RNDIS_PACKET_TYPE_ALL_LOCAL ccpu2(0x00000080) 241#define RNDIS_PACKET_TYPE_ALL_LOCAL cpu_to_le32(0x00000080)
245#define RNDIS_PACKET_TYPE_GROUP ccpu2(0x00001000) 242#define RNDIS_PACKET_TYPE_GROUP cpu_to_le32(0x00001000)
246#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL ccpu2(0x00002000) 243#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL cpu_to_le32(0x00002000)
247#define RNDIS_PACKET_TYPE_FUNCTIONAL ccpu2(0x00004000) 244#define RNDIS_PACKET_TYPE_FUNCTIONAL cpu_to_le32(0x00004000)
248#define RNDIS_PACKET_TYPE_MAC_FRAME ccpu2(0x00008000) 245#define RNDIS_PACKET_TYPE_MAC_FRAME cpu_to_le32(0x00008000)
249 246
250/* default filter used with RNDIS devices */ 247/* default filter used with RNDIS devices */
251#define RNDIS_DEFAULT_FILTER ( \ 248#define RNDIS_DEFAULT_FILTER ( \
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 3efa86c3ecb..242348bb376 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -22,11 +22,19 @@
22#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */ 22#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
23#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */ 23#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
24#define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */ 24#define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */
25#define VIRTIO_NET_F_STATUS 16 /* virtio_net_config.status available */
26#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
27#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
28#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
29
30#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
25 31
26struct virtio_net_config 32struct virtio_net_config
27{ 33{
28 /* The config defining mac address (if VIRTIO_NET_F_MAC) */ 34 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
29 __u8 mac[6]; 35 __u8 mac[6];
36 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
37 __u16 status;
30} __attribute__((packed)); 38} __attribute__((packed));
31 39
32/* This is the first element of the scatter-gather list. If you don't 40/* This is the first element of the scatter-gather list. If you don't
@@ -54,4 +62,67 @@ struct virtio_net_hdr_mrg_rxbuf {
54 __u16 num_buffers; /* Number of merged rx buffers */ 62 __u16 num_buffers; /* Number of merged rx buffers */
55}; 63};
56 64
65/*
66 * Control virtqueue data structures
67 *
68 * The control virtqueue expects a header in the first sg entry
69 * and an ack/status response in the last entry. Data for the
70 * command goes in between.
71 */
72struct virtio_net_ctrl_hdr {
73 __u8 class;
74 __u8 cmd;
75} __attribute__((packed));
76
77typedef __u8 virtio_net_ctrl_ack;
78
79#define VIRTIO_NET_OK 0
80#define VIRTIO_NET_ERR 1
81
82/*
83 * Control the RX mode, ie. promisucous and allmulti. PROMISC and
84 * ALLMULTI commands require an "out" sg entry containing a 1 byte
85 * state value, zero = disable, non-zero = enable. These commands
86 * are supported with the VIRTIO_NET_F_CTRL_RX feature.
87 */
88#define VIRTIO_NET_CTRL_RX 0
89 #define VIRTIO_NET_CTRL_RX_PROMISC 0
90 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1
91
92/*
93 * Control the MAC filter table.
94 *
95 * The MAC filter table is managed by the hypervisor, the guest should
96 * assume the size is infinite. Filtering should be considered
97 * non-perfect, ie. based on hypervisor resources, the guest may
98 * received packets from sources not specified in the filter list.
99 *
100 * In addition to the class/cmd header, the TABLE_SET command requires
101 * two out scatterlists. Each contains a 4 byte count of entries followed
102 * by a concatenated byte stream of the ETH_ALEN MAC addresses. The
103 * first sg list contains unicast addresses, the second is for multicast.
104 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
105 * is available.
106 */
107struct virtio_net_ctrl_mac {
108 __u32 entries;
109 __u8 macs[][ETH_ALEN];
110} __attribute__((packed));
111
112#define VIRTIO_NET_CTRL_MAC 1
113 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
114
115/*
116 * Control VLAN filtering
117 *
118 * The VLAN filter table is controlled via a simple ADD/DEL interface.
119 * VLAN IDs not added may be filterd by the hypervisor. Del is the
120 * opposite of add. Both commands expect an out entry containing a 2
121 * byte VLAN ID. VLAN filterting is available with the
122 * VIRTIO_NET_F_CTRL_VLAN feature bit.
123 */
124#define VIRTIO_NET_CTRL_VLAN 2
125 #define VIRTIO_NET_CTRL_VLAN_ADD 0
126 #define VIRTIO_NET_CTRL_VLAN_DEL 1
127
57#endif /* _LINUX_VIRTIO_NET_H */ 128#endif /* _LINUX_VIRTIO_NET_H */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index d7958f9b52c..cb24204851f 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -577,18 +577,22 @@
577#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 577#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
578#define IW_AUTH_ROAMING_CONTROL 9 578#define IW_AUTH_ROAMING_CONTROL 9
579#define IW_AUTH_PRIVACY_INVOKED 10 579#define IW_AUTH_PRIVACY_INVOKED 10
580#define IW_AUTH_CIPHER_GROUP_MGMT 11
581#define IW_AUTH_MFP 12
580 582
581/* IW_AUTH_WPA_VERSION values (bit field) */ 583/* IW_AUTH_WPA_VERSION values (bit field) */
582#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 584#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
583#define IW_AUTH_WPA_VERSION_WPA 0x00000002 585#define IW_AUTH_WPA_VERSION_WPA 0x00000002
584#define IW_AUTH_WPA_VERSION_WPA2 0x00000004 586#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
585 587
586/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */ 588/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
589 * values (bit field) */
587#define IW_AUTH_CIPHER_NONE 0x00000001 590#define IW_AUTH_CIPHER_NONE 0x00000001
588#define IW_AUTH_CIPHER_WEP40 0x00000002 591#define IW_AUTH_CIPHER_WEP40 0x00000002
589#define IW_AUTH_CIPHER_TKIP 0x00000004 592#define IW_AUTH_CIPHER_TKIP 0x00000004
590#define IW_AUTH_CIPHER_CCMP 0x00000008 593#define IW_AUTH_CIPHER_CCMP 0x00000008
591#define IW_AUTH_CIPHER_WEP104 0x00000010 594#define IW_AUTH_CIPHER_WEP104 0x00000010
595#define IW_AUTH_CIPHER_AES_CMAC 0x00000020
592 596
593/* IW_AUTH_KEY_MGMT values (bit field) */ 597/* IW_AUTH_KEY_MGMT values (bit field) */
594#define IW_AUTH_KEY_MGMT_802_1X 1 598#define IW_AUTH_KEY_MGMT_802_1X 1
@@ -604,6 +608,11 @@
604#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming 608#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
605 * control */ 609 * control */
606 610
611/* IW_AUTH_MFP (management frame protection) values */
612#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
613#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
614#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
615
607/* SIOCSIWENCODEEXT definitions */ 616/* SIOCSIWENCODEEXT definitions */
608#define IW_ENCODE_SEQ_MAX_SIZE 8 617#define IW_ENCODE_SEQ_MAX_SIZE 8
609/* struct iw_encode_ext ->alg */ 618/* struct iw_encode_ext ->alg */
@@ -612,6 +621,7 @@
612#define IW_ENCODE_ALG_TKIP 2 621#define IW_ENCODE_ALG_TKIP 2
613#define IW_ENCODE_ALG_CCMP 3 622#define IW_ENCODE_ALG_CCMP 3
614#define IW_ENCODE_ALG_PMK 4 623#define IW_ENCODE_ALG_PMK 4
624#define IW_ENCODE_ALG_AES_CMAC 5
615/* struct iw_encode_ext ->ext_flags */ 625/* struct iw_encode_ext ->ext_flags */
616#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 626#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
617#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 627#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
diff --git a/include/net/atmclip.h b/include/net/atmclip.h
index b5a51a7bb36..467c531b8a7 100644
--- a/include/net/atmclip.h
+++ b/include/net/atmclip.h
@@ -50,7 +50,6 @@ struct atmarp_entry {
50struct clip_priv { 50struct clip_priv {
51 int number; /* for convenience ... */ 51 int number; /* for convenience ... */
52 spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */ 52 spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */
53 struct net_device_stats stats;
54 struct net_device *next; /* next CLIP interface */ 53 struct net_device *next; /* next CLIP interface */
55}; 54};
56 55
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 23c0ab74ded..c0d1f5b708c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4,6 +4,10 @@
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/skbuff.h> 5#include <linux/skbuff.h>
6#include <linux/nl80211.h> 6#include <linux/nl80211.h>
7#include <linux/if_ether.h>
8#include <linux/ieee80211.h>
9#include <linux/wireless.h>
10#include <net/iw_handler.h>
7#include <net/genetlink.h> 11#include <net/genetlink.h>
8/* remove once we remove the wext stuff */ 12/* remove once we remove the wext stuff */
9#include <net/iw_handler.h> 13#include <net/iw_handler.h>
@@ -112,12 +116,14 @@ struct beacon_parameters {
112 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 116 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
113 * with short preambles 117 * with short preambles
114 * @STATION_FLAG_WME: station is WME/QoS capable 118 * @STATION_FLAG_WME: station is WME/QoS capable
119 * @STATION_FLAG_MFP: station uses management frame protection
115 */ 120 */
116enum station_flags { 121enum station_flags {
117 STATION_FLAG_CHANGED = 1<<0, 122 STATION_FLAG_CHANGED = 1<<0,
118 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED, 123 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
119 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE, 124 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
120 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME, 125 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
126 STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP,
121}; 127};
122 128
123/** 129/**
@@ -355,6 +361,51 @@ enum reg_set_by {
355 REGDOM_SET_BY_COUNTRY_IE, 361 REGDOM_SET_BY_COUNTRY_IE,
356}; 362};
357 363
364/**
365 * enum environment_cap - Environment parsed from country IE
366 * @ENVIRON_ANY: indicates country IE applies to both indoor and
367 * outdoor operation.
368 * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
369 * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
370 */
371enum environment_cap {
372 ENVIRON_ANY,
373 ENVIRON_INDOOR,
374 ENVIRON_OUTDOOR,
375};
376
377/**
378 * struct regulatory_request - receipt of last regulatory request
379 *
380 * @wiphy: this is set if this request's initiator is
381 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
382 * can be used by the wireless core to deal with conflicts
383 * and potentially inform users of which devices specifically
384 * cased the conflicts.
385 * @initiator: indicates who sent this request, could be any of
386 * of those set in reg_set_by, %REGDOM_SET_BY_*
387 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
388 * regulatory domain. We have a few special codes:
389 * 00 - World regulatory domain
390 * 99 - built by driver but a specific alpha2 cannot be determined
391 * 98 - result of an intersection between two regulatory domains
392 * @intersect: indicates whether the wireless core should intersect
393 * the requested regulatory domain with the presently set regulatory
394 * domain.
395 * @country_ie_checksum: checksum of the last processed and accepted
396 * country IE
397 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
398 * indoor, or if it doesn't matter
399 */
400struct regulatory_request {
401 struct wiphy *wiphy;
402 enum reg_set_by initiator;
403 char alpha2[2];
404 bool intersect;
405 u32 country_ie_checksum;
406 enum environment_cap country_ie_env;
407};
408
358struct ieee80211_freq_range { 409struct ieee80211_freq_range {
359 u32 start_freq_khz; 410 u32 start_freq_khz;
360 u32 end_freq_khz; 411 u32 end_freq_khz;
@@ -431,6 +482,26 @@ struct ieee80211_txq_params {
431 u8 aifs; 482 u8 aifs;
432}; 483};
433 484
485/**
486 * struct mgmt_extra_ie_params - Extra management frame IE parameters
487 *
488 * Used to add extra IE(s) into management frames. If the driver cannot add the
489 * requested data into all management frames of the specified subtype that are
490 * generated in kernel or firmware/hardware, it must reject the configuration
491 * call. The IE data buffer is added to the end of the specified management
492 * frame body after all other IEs. This addition is not applied to frames that
493 * are injected through a monitor interface.
494 *
495 * @subtype: Management frame subtype
496 * @ies: IE data buffer or %NULL to remove previous data
497 * @ies_len: Length of @ies in octets
498 */
499struct mgmt_extra_ie_params {
500 u8 subtype;
501 u8 *ies;
502 int ies_len;
503};
504
434/* from net/wireless.h */ 505/* from net/wireless.h */
435struct wiphy; 506struct wiphy;
436 507
@@ -438,6 +509,85 @@ struct wiphy;
438struct ieee80211_channel; 509struct ieee80211_channel;
439 510
440/** 511/**
512 * struct cfg80211_ssid - SSID description
513 * @ssid: the SSID
514 * @ssid_len: length of the ssid
515 */
516struct cfg80211_ssid {
517 u8 ssid[IEEE80211_MAX_SSID_LEN];
518 u8 ssid_len;
519};
520
521/**
522 * struct cfg80211_scan_request - scan request description
523 *
524 * @ssids: SSIDs to scan for (active scan only)
525 * @n_ssids: number of SSIDs
526 * @channels: channels to scan on.
527 * @n_channels: number of channels for each band
528 * @wiphy: the wiphy this was for
529 * @ifidx: the interface index
530 */
531struct cfg80211_scan_request {
532 struct cfg80211_ssid *ssids;
533 int n_ssids;
534 struct ieee80211_channel **channels;
535 u32 n_channels;
536
537 /* internal */
538 struct wiphy *wiphy;
539 int ifidx;
540};
541
542/**
543 * enum cfg80211_signal_type - signal type
544 *
545 * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
546 * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm)
547 * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100
548 */
549enum cfg80211_signal_type {
550 CFG80211_SIGNAL_TYPE_NONE,
551 CFG80211_SIGNAL_TYPE_MBM,
552 CFG80211_SIGNAL_TYPE_UNSPEC,
553};
554
555/**
556 * struct cfg80211_bss - BSS description
557 *
558 * This structure describes a BSS (which may also be a mesh network)
559 * for use in scan results and similar.
560 *
561 * @bssid: BSSID of the BSS
562 * @tsf: timestamp of last received update
563 * @beacon_interval: the beacon interval as from the frame
564 * @capability: the capability field in host byte order
565 * @information_elements: the information elements (Note that there
566 * is no guarantee that these are well-formed!)
567 * @len_information_elements: total length of the information elements
568 * @signal: signal strength value
569 * @signal_type: signal type
570 * @free_priv: function pointer to free private data
571 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
572 */
573struct cfg80211_bss {
574 struct ieee80211_channel *channel;
575
576 u8 bssid[ETH_ALEN];
577 u64 tsf;
578 u16 beacon_interval;
579 u16 capability;
580 u8 *information_elements;
581 size_t len_information_elements;
582
583 s32 signal;
584 enum cfg80211_signal_type signal_type;
585
586 void (*free_priv)(struct cfg80211_bss *bss);
587 u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
588};
589
590/**
441 * struct cfg80211_ops - backend description for wireless configuration 591 * struct cfg80211_ops - backend description for wireless configuration
442 * 592 *
443 * This struct is registered by fullmac card drivers and/or wireless stacks 593 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -450,6 +600,9 @@ struct ieee80211_channel;
450 * wireless extensions but this is subject to reevaluation as soon as this 600 * wireless extensions but this is subject to reevaluation as soon as this
451 * code is used more widely and we have a first user without wext. 601 * code is used more widely and we have a first user without wext.
452 * 602 *
603 * @suspend: wiphy device needs to be suspended
604 * @resume: wiphy device needs to be resumed
605 *
453 * @add_virtual_intf: create a new virtual interface with the given name, 606 * @add_virtual_intf: create a new virtual interface with the given name,
454 * must set the struct wireless_dev's iftype. 607 * must set the struct wireless_dev's iftype.
455 * 608 *
@@ -471,6 +624,8 @@ struct ieee80211_channel;
471 * 624 *
472 * @set_default_key: set the default key on an interface 625 * @set_default_key: set the default key on an interface
473 * 626 *
627 * @set_default_mgmt_key: set the default management frame key on an interface
628 *
474 * @add_beacon: Add a beacon with given parameters, @head, @interval 629 * @add_beacon: Add a beacon with given parameters, @head, @interval
475 * and @dtim_period will be valid, @tail is optional. 630 * and @dtim_period will be valid, @tail is optional.
476 * @set_beacon: Change the beacon parameters for an access point mode 631 * @set_beacon: Change the beacon parameters for an access point mode
@@ -497,8 +652,18 @@ struct ieee80211_channel;
497 * @set_txq_params: Set TX queue parameters 652 * @set_txq_params: Set TX queue parameters
498 * 653 *
499 * @set_channel: Set channel 654 * @set_channel: Set channel
655 *
656 * @set_mgmt_extra_ie: Set extra IE data for management frames
657 *
658 * @scan: Request to do a scan. If returning zero, the scan request is given
659 * the driver, and will be valid until passed to cfg80211_scan_done().
660 * For scan results, call cfg80211_inform_bss(); you can call this outside
661 * the scan/scan_done bracket too.
500 */ 662 */
501struct cfg80211_ops { 663struct cfg80211_ops {
664 int (*suspend)(struct wiphy *wiphy);
665 int (*resume)(struct wiphy *wiphy);
666
502 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 667 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
503 enum nl80211_iftype type, u32 *flags, 668 enum nl80211_iftype type, u32 *flags,
504 struct vif_params *params); 669 struct vif_params *params);
@@ -518,6 +683,9 @@ struct cfg80211_ops {
518 int (*set_default_key)(struct wiphy *wiphy, 683 int (*set_default_key)(struct wiphy *wiphy,
519 struct net_device *netdev, 684 struct net_device *netdev,
520 u8 key_index); 685 u8 key_index);
686 int (*set_default_mgmt_key)(struct wiphy *wiphy,
687 struct net_device *netdev,
688 u8 key_index);
521 689
522 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, 690 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev,
523 struct beacon_parameters *info); 691 struct beacon_parameters *info);
@@ -564,6 +732,13 @@ struct cfg80211_ops {
564 int (*set_channel)(struct wiphy *wiphy, 732 int (*set_channel)(struct wiphy *wiphy,
565 struct ieee80211_channel *chan, 733 struct ieee80211_channel *chan,
566 enum nl80211_channel_type channel_type); 734 enum nl80211_channel_type channel_type);
735
736 int (*set_mgmt_extra_ie)(struct wiphy *wiphy,
737 struct net_device *dev,
738 struct mgmt_extra_ie_params *params);
739
740 int (*scan)(struct wiphy *wiphy, struct net_device *dev,
741 struct cfg80211_scan_request *request);
567}; 742};
568 743
569/* temporary wext handlers */ 744/* temporary wext handlers */
@@ -574,5 +749,68 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
574 u32 *mode, char *extra); 749 u32 *mode, char *extra);
575int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, 750int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
576 u32 *mode, char *extra); 751 u32 *mode, char *extra);
752int cfg80211_wext_siwscan(struct net_device *dev,
753 struct iw_request_info *info,
754 union iwreq_data *wrqu, char *extra);
755int cfg80211_wext_giwscan(struct net_device *dev,
756 struct iw_request_info *info,
757 struct iw_point *data, char *extra);
758
759/**
760 * cfg80211_scan_done - notify that scan finished
761 *
762 * @request: the corresponding scan request
763 * @aborted: set to true if the scan was aborted for any reason,
764 * userspace will be notified of that
765 */
766void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
767
768/**
769 * cfg80211_inform_bss - inform cfg80211 of a new BSS
770 *
771 * @wiphy: the wiphy reporting the BSS
772 * @bss: the found BSS
773 * @gfp: context flags
774 *
775 * This informs cfg80211 that BSS information was found and
776 * the BSS should be updated/added.
777 */
778struct cfg80211_bss*
779cfg80211_inform_bss_frame(struct wiphy *wiphy,
780 struct ieee80211_channel *channel,
781 struct ieee80211_mgmt *mgmt, size_t len,
782 s32 signal, enum cfg80211_signal_type sigtype,
783 gfp_t gfp);
784
785struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
786 struct ieee80211_channel *channel,
787 const u8 *bssid,
788 const u8 *ssid, size_t ssid_len,
789 u16 capa_mask, u16 capa_val);
790static inline struct cfg80211_bss *
791cfg80211_get_ibss(struct wiphy *wiphy,
792 struct ieee80211_channel *channel,
793 const u8 *ssid, size_t ssid_len)
794{
795 return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
796 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
797}
798
799struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
800 struct ieee80211_channel *channel,
801 const u8 *meshid, size_t meshidlen,
802 const u8 *meshcfg);
803void cfg80211_put_bss(struct cfg80211_bss *bss);
804/**
805 * cfg80211_unlink_bss - unlink BSS from internal data structures
806 * @wiphy: the wiphy
807 * @bss: the bss to remove
808 *
809 * This function removes the given BSS from the internal data structures
810 * thereby making it no longer show up in scan results etc. Use this
811 * function when you detect a BSS is gone. Normally BSSes will also time
812 * out, so it is not necessary to use this function at all.
813 */
814void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
577 815
578#endif /* __NET_CFG80211_H */ 816#endif /* __NET_CFG80211_H */
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 7040a782c65..9b5d08f4f6e 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -113,12 +113,12 @@ static inline void ipv6_copy_dscp(unsigned int dscp, struct ipv6hdr *inner)
113static inline int INET_ECN_set_ce(struct sk_buff *skb) 113static inline int INET_ECN_set_ce(struct sk_buff *skb)
114{ 114{
115 switch (skb->protocol) { 115 switch (skb->protocol) {
116 case __constant_htons(ETH_P_IP): 116 case cpu_to_be16(ETH_P_IP):
117 if (skb->network_header + sizeof(struct iphdr) <= skb->tail) 117 if (skb->network_header + sizeof(struct iphdr) <= skb->tail)
118 return IP_ECN_set_ce(ip_hdr(skb)); 118 return IP_ECN_set_ce(ip_hdr(skb));
119 break; 119 break;
120 120
121 case __constant_htons(ETH_P_IPV6): 121 case cpu_to_be16(ETH_P_IPV6):
122 if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail) 122 if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail)
123 return IP6_ECN_set_ce(ipv6_hdr(skb)); 123 return IP6_ECN_set_ce(ipv6_hdr(skb));
124 break; 124 break;
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index d0a043153cc..a44e2248b2e 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -82,6 +82,7 @@ struct inet_bind_bucket {
82#endif 82#endif
83 unsigned short port; 83 unsigned short port;
84 signed short fastreuse; 84 signed short fastreuse;
85 int num_owners;
85 struct hlist_node node; 86 struct hlist_node node;
86 struct hlist_head owners; 87 struct hlist_head owners;
87}; 88};
@@ -133,7 +134,7 @@ struct inet_hashinfo {
133 struct inet_bind_hashbucket *bhash; 134 struct inet_bind_hashbucket *bhash;
134 135
135 unsigned int bhash_size; 136 unsigned int bhash_size;
136 /* Note : 4 bytes padding on 64 bit arches */ 137 /* 4 bytes hole on 64 bit */
137 138
138 struct kmem_cache *bind_bucket_cachep; 139 struct kmem_cache *bind_bucket_cachep;
139 140
@@ -150,6 +151,7 @@ struct inet_hashinfo {
150 struct inet_listen_hashbucket listening_hash[INET_LHTABLE_SIZE] 151 struct inet_listen_hashbucket listening_hash[INET_LHTABLE_SIZE]
151 ____cacheline_aligned_in_smp; 152 ____cacheline_aligned_in_smp;
152 153
154 atomic_t bsockets;
153}; 155};
154 156
155static inline struct inet_ehash_bucket *inet_ehash_bucket( 157static inline struct inet_ehash_bucket *inet_ehash_bucket(
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index ab9b003ab67..bbae1e87efc 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -184,8 +184,8 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
184/* 184/*
185 * The port number of FTP service (in network order). 185 * The port number of FTP service (in network order).
186 */ 186 */
187#define FTPPORT __constant_htons(21) 187#define FTPPORT cpu_to_be16(21)
188#define FTPDATA __constant_htons(20) 188#define FTPDATA cpu_to_be16(20)
189 189
190/* 190/*
191 * TCP State Values 191 * TCP State Values
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6d5b58a1c74..c1f16fc49ad 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -196,8 +196,8 @@ struct ip6_flowlabel
196 struct net *fl_net; 196 struct net *fl_net;
197}; 197};
198 198
199#define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF) 199#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
200#define IPV6_FLOWLABEL_MASK __constant_htonl(0x000FFFFF) 200#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
201 201
202struct ipv6_fl_socklist 202struct ipv6_fl_socklist
203{ 203{
diff --git a/include/net/ipx.h b/include/net/ipx.h
index 4cc0b4eca94..a14121dd193 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -27,7 +27,7 @@ struct ipx_address {
27 27
28struct ipxhdr { 28struct ipxhdr {
29 __be16 ipx_checksum __attribute__ ((packed)); 29 __be16 ipx_checksum __attribute__ ((packed));
30#define IPX_NO_CHECKSUM __constant_htons(0xFFFF) 30#define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF)
31 __be16 ipx_pktsize __attribute__ ((packed)); 31 __be16 ipx_pktsize __attribute__ ((packed));
32 __u8 ipx_tctrl; 32 __u8 ipx_tctrl;
33 __u8 ipx_type; 33 __u8 ipx_type;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 559422fc094..88fa3e03e3e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -207,7 +207,7 @@ struct ieee80211_bss_conf {
207 u16 beacon_int; 207 u16 beacon_int;
208 u16 assoc_capability; 208 u16 assoc_capability;
209 u64 timestamp; 209 u64 timestamp;
210 u64 basic_rates; 210 u32 basic_rates;
211 struct ieee80211_bss_ht_conf ht; 211 struct ieee80211_bss_ht_conf ht;
212}; 212};
213 213
@@ -262,6 +262,26 @@ enum mac80211_tx_control_flags {
262 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 262 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
263}; 263};
264 264
265/**
266 * enum mac80211_rate_control_flags - per-rate flags set by the
267 * Rate Control algorithm.
268 *
269 * These flags are set by the Rate control algorithm for each rate during tx,
270 * in the @flags member of struct ieee80211_tx_rate.
271 *
272 * @IEEE80211_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate.
273 * @IEEE80211_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required.
274 * This is set if the current BSS requires ERP protection.
275 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
276 * @IEEE80211_TX_RC_MCS: HT rate.
277 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in
278 * Greenfield mode.
279 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz.
280 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the
281 * adjacent 20 MHz channels, if the current channel type is
282 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
283 * @IEEE80211_TX_RC_SHORT_GI: Short Guard interval should be used for this rate.
284 */
265enum mac80211_rate_control_flags { 285enum mac80211_rate_control_flags {
266 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0), 286 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0),
267 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), 287 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
@@ -507,11 +527,6 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
507} 527}
508#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME()) 528#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
509 529
510struct ieee80211_ht_conf {
511 bool enabled;
512 enum nl80211_channel_type channel_type;
513};
514
515/** 530/**
516 * enum ieee80211_conf_changed - denotes which configuration changed 531 * enum ieee80211_conf_changed - denotes which configuration changed
517 * 532 *
@@ -520,10 +535,10 @@ struct ieee80211_ht_conf {
520 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed 535 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
521 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed 536 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
522 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed 537 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
538 * @IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT: the dynamic PS timeout changed
523 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed 539 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
524 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed 540 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
525 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 541 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
526 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
527 */ 542 */
528enum ieee80211_conf_changed { 543enum ieee80211_conf_changed {
529 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), 544 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
@@ -531,10 +546,10 @@ enum ieee80211_conf_changed {
531 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 546 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
532 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), 547 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
533 IEEE80211_CONF_CHANGE_PS = BIT(4), 548 IEEE80211_CONF_CHANGE_PS = BIT(4),
534 IEEE80211_CONF_CHANGE_POWER = BIT(5), 549 IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT = BIT(5),
535 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 550 IEEE80211_CONF_CHANGE_POWER = BIT(6),
536 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), 551 IEEE80211_CONF_CHANGE_CHANNEL = BIT(7),
537 IEEE80211_CONF_CHANGE_HT = BIT(8), 552 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(8),
538}; 553};
539 554
540/** 555/**
@@ -547,8 +562,9 @@ enum ieee80211_conf_changed {
547 * @listen_interval: listen interval in units of beacon interval 562 * @listen_interval: listen interval in units of beacon interval
548 * @flags: configuration flags defined above 563 * @flags: configuration flags defined above
549 * @power_level: requested transmit power (in dBm) 564 * @power_level: requested transmit power (in dBm)
565 * @dynamic_ps_timeout: dynamic powersave timeout (in ms)
550 * @channel: the channel to tune to 566 * @channel: the channel to tune to
551 * @ht: the HT configuration for the device 567 * @channel_type: the channel (HT) type
552 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 568 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
553 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 569 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
554 * but actually means the number of transmissions not the number of retries 570 * but actually means the number of transmissions not the number of retries
@@ -559,7 +575,7 @@ enum ieee80211_conf_changed {
559struct ieee80211_conf { 575struct ieee80211_conf {
560 int beacon_int; 576 int beacon_int;
561 u32 flags; 577 u32 flags;
562 int power_level; 578 int power_level, dynamic_ps_timeout;
563 579
564 u16 listen_interval; 580 u16 listen_interval;
565 bool radio_enabled; 581 bool radio_enabled;
@@ -567,7 +583,7 @@ struct ieee80211_conf {
567 u8 long_frame_max_tx_count, short_frame_max_tx_count; 583 u8 long_frame_max_tx_count, short_frame_max_tx_count;
568 584
569 struct ieee80211_channel *channel; 585 struct ieee80211_channel *channel;
570 struct ieee80211_ht_conf ht; 586 enum nl80211_channel_type channel_type;
571}; 587};
572 588
573/** 589/**
@@ -630,10 +646,12 @@ struct ieee80211_if_init_conf {
630 * @IEEE80211_IFCC_BSSID: The BSSID changed. 646 * @IEEE80211_IFCC_BSSID: The BSSID changed.
631 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 647 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
632 * (currently AP and MESH only), use ieee80211_beacon_get(). 648 * (currently AP and MESH only), use ieee80211_beacon_get().
649 * @IEEE80211_IFCC_BEACON_ENABLED: The enable_beacon value changed.
633 */ 650 */
634enum ieee80211_if_conf_change { 651enum ieee80211_if_conf_change {
635 IEEE80211_IFCC_BSSID = BIT(0), 652 IEEE80211_IFCC_BSSID = BIT(0),
636 IEEE80211_IFCC_BEACON = BIT(1), 653 IEEE80211_IFCC_BEACON = BIT(1),
654 IEEE80211_IFCC_BEACON_ENABLED = BIT(2),
637}; 655};
638 656
639/** 657/**
@@ -641,13 +659,16 @@ enum ieee80211_if_conf_change {
641 * 659 *
642 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 660 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
643 * @bssid: BSSID of the network we are associated to/creating. 661 * @bssid: BSSID of the network we are associated to/creating.
662 * @enable_beacon: Indicates whether beacons can be sent.
663 * This is valid only for AP/IBSS/MESH modes.
644 * 664 *
645 * This structure is passed to the config_interface() callback of 665 * This structure is passed to the config_interface() callback of
646 * &struct ieee80211_hw. 666 * &struct ieee80211_hw.
647 */ 667 */
648struct ieee80211_if_conf { 668struct ieee80211_if_conf {
649 u32 changed; 669 u32 changed;
650 u8 *bssid; 670 const u8 *bssid;
671 bool enable_beacon;
651}; 672};
652 673
653/** 674/**
@@ -655,11 +676,13 @@ struct ieee80211_if_conf {
655 * @ALG_WEP: WEP40 or WEP104 676 * @ALG_WEP: WEP40 or WEP104
656 * @ALG_TKIP: TKIP 677 * @ALG_TKIP: TKIP
657 * @ALG_CCMP: CCMP (AES) 678 * @ALG_CCMP: CCMP (AES)
679 * @ALG_AES_CMAC: AES-128-CMAC
658 */ 680 */
659enum ieee80211_key_alg { 681enum ieee80211_key_alg {
660 ALG_WEP, 682 ALG_WEP,
661 ALG_TKIP, 683 ALG_TKIP,
662 ALG_CCMP, 684 ALG_CCMP,
685 ALG_AES_CMAC,
663}; 686};
664 687
665/** 688/**
@@ -688,12 +711,16 @@ enum ieee80211_key_len {
688 * generation in software. 711 * generation in software.
689 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates 712 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
690 * that the key is pairwise rather then a shared key. 713 * that the key is pairwise rather then a shared key.
714 * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a
715 * CCMP key if it requires CCMP encryption of management frames (MFP) to
716 * be done in software.
691 */ 717 */
692enum ieee80211_key_flags { 718enum ieee80211_key_flags {
693 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 719 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
694 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 720 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
695 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 721 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
696 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, 722 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
723 IEEE80211_KEY_FLAG_SW_MGMT = 1<<4,
697}; 724};
698 725
699/** 726/**
@@ -714,8 +741,8 @@ enum ieee80211_key_flags {
714 * - Temporal Encryption Key (128 bits) 741 * - Temporal Encryption Key (128 bits)
715 * - Temporal Authenticator Tx MIC Key (64 bits) 742 * - Temporal Authenticator Tx MIC Key (64 bits)
716 * - Temporal Authenticator Rx MIC Key (64 bits) 743 * - Temporal Authenticator Rx MIC Key (64 bits)
717 * @icv_len: FIXME 744 * @icv_len: The ICV length for this key type
718 * @iv_len: FIXME 745 * @iv_len: The IV length for this key type
719 */ 746 */
720struct ieee80211_key_conf { 747struct ieee80211_key_conf {
721 enum ieee80211_key_alg alg; 748 enum ieee80211_key_alg alg;
@@ -759,7 +786,7 @@ enum set_key_cmd {
759 * sizeof(void *), size is determined in hw information. 786 * sizeof(void *), size is determined in hw information.
760 */ 787 */
761struct ieee80211_sta { 788struct ieee80211_sta {
762 u64 supp_rates[IEEE80211_NUM_BANDS]; 789 u32 supp_rates[IEEE80211_NUM_BANDS];
763 u8 addr[ETH_ALEN]; 790 u8 addr[ETH_ALEN];
764 u16 aid; 791 u16 aid;
765 struct ieee80211_sta_ht_cap ht_cap; 792 struct ieee80211_sta_ht_cap ht_cap;
@@ -833,11 +860,6 @@ enum ieee80211_tkip_key_type {
833 * expect values between 0 and @max_signal. 860 * expect values between 0 and @max_signal.
834 * If possible please provide dB or dBm instead. 861 * If possible please provide dB or dBm instead.
835 * 862 *
836 * @IEEE80211_HW_SIGNAL_DB:
837 * Hardware gives signal values in dB, decibel difference from an
838 * arbitrary, fixed reference. We expect values between 0 and @max_signal.
839 * If possible please provide dBm instead.
840 *
841 * @IEEE80211_HW_SIGNAL_DBM: 863 * @IEEE80211_HW_SIGNAL_DBM:
842 * Hardware gives signal values in dBm, decibel difference from 864 * Hardware gives signal values in dBm, decibel difference from
843 * one milliwatt. This is the preferred method since it is standardized 865 * one milliwatt. This is the preferred method since it is standardized
@@ -854,10 +876,18 @@ enum ieee80211_tkip_key_type {
854 * @IEEE80211_HW_AMPDU_AGGREGATION: 876 * @IEEE80211_HW_AMPDU_AGGREGATION:
855 * Hardware supports 11n A-MPDU aggregation. 877 * Hardware supports 11n A-MPDU aggregation.
856 * 878 *
857 * @IEEE80211_HW_NO_STACK_DYNAMIC_PS: 879 * @IEEE80211_HW_SUPPORTS_PS:
858 * Hardware which has dynamic power save support, meaning 880 * Hardware has power save support (i.e. can go to sleep).
859 * that power save is enabled in idle periods, and don't need support 881 *
860 * from stack. 882 * @IEEE80211_HW_PS_NULLFUNC_STACK:
883 * Hardware requires nullfunc frame handling in stack, implies
884 * stack support for dynamic PS.
885 *
886 * @IEEE80211_HW_SUPPORTS_DYNAMIC_PS:
887 * Hardware has support for dynamic PS.
888 *
889 * @IEEE80211_HW_MFP_CAPABLE:
890 * Hardware supports management frame protection (MFP, IEEE 802.11w).
861 */ 891 */
862enum ieee80211_hw_flags { 892enum ieee80211_hw_flags {
863 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 893 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
@@ -865,12 +895,14 @@ enum ieee80211_hw_flags {
865 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 895 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
866 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 896 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
867 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, 897 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
868 IEEE80211_HW_SIGNAL_DB = 1<<6, 898 IEEE80211_HW_SIGNAL_DBM = 1<<6,
869 IEEE80211_HW_SIGNAL_DBM = 1<<7, 899 IEEE80211_HW_NOISE_DBM = 1<<7,
870 IEEE80211_HW_NOISE_DBM = 1<<8, 900 IEEE80211_HW_SPECTRUM_MGMT = 1<<8,
871 IEEE80211_HW_SPECTRUM_MGMT = 1<<9, 901 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9,
872 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10, 902 IEEE80211_HW_SUPPORTS_PS = 1<<10,
873 IEEE80211_HW_NO_STACK_DYNAMIC_PS = 1<<11, 903 IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11,
904 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
905 IEEE80211_HW_MFP_CAPABLE = 1<<13,
874}; 906};
875 907
876/** 908/**
@@ -890,9 +922,8 @@ enum ieee80211_hw_flags {
890 * @workqueue: single threaded workqueue available for driver use, 922 * @workqueue: single threaded workqueue available for driver use,
891 * allocated by mac80211 on registration and flushed when an 923 * allocated by mac80211 on registration and flushed when an
892 * interface is removed. 924 * interface is removed.
893 * NOTICE: All work performed on this workqueue should NEVER 925 * NOTICE: All work performed on this workqueue must not
894 * acquire the RTNL lock (i.e. Don't use the function 926 * acquire the RTNL lock.
895 * ieee80211_iterate_active_interfaces())
896 * 927 *
897 * @priv: pointer to private area that was allocated for driver use 928 * @priv: pointer to private area that was allocated for driver use
898 * along with this structure. 929 * along with this structure.
@@ -952,6 +983,19 @@ struct ieee80211_hw {
952}; 983};
953 984
954/** 985/**
986 * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy
987 *
988 * @wiphy: the &struct wiphy which we want to query
989 *
990 * mac80211 drivers can use this to get to their respective
991 * &struct ieee80211_hw. Drivers wishing to get to their own private
992 * structure can then access it via hw->priv. Note that mac802111 drivers should
993 * not use wiphy_priv() to try to get their private driver structure as this
994 * is already used internally by mac80211.
995 */
996struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy);
997
998/**
955 * SET_IEEE80211_DEV - set device for 802.11 hardware 999 * SET_IEEE80211_DEV - set device for 802.11 hardware
956 * 1000 *
957 * @hw: the &struct ieee80211_hw to set the device for 1001 * @hw: the &struct ieee80211_hw to set the device for
@@ -1018,16 +1062,12 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1018 * 1062 *
1019 * The set_key() callback in the &struct ieee80211_ops for a given 1063 * The set_key() callback in the &struct ieee80211_ops for a given
1020 * device is called to enable hardware acceleration of encryption and 1064 * device is called to enable hardware acceleration of encryption and
1021 * decryption. The callback takes an @address parameter that will be 1065 * decryption. The callback takes a @sta parameter that will be NULL
1022 * the broadcast address for default keys, the other station's hardware 1066 * for default keys or keys used for transmission only, or point to
1023 * address for individual keys or the zero address for keys that will 1067 * the station information for the peer for individual keys.
1024 * be used only for transmission.
1025 * Multiple transmission keys with the same key index may be used when 1068 * Multiple transmission keys with the same key index may be used when
1026 * VLANs are configured for an access point. 1069 * VLANs are configured for an access point.
1027 * 1070 *
1028 * The @local_address parameter will always be set to our own address,
1029 * this is only relevant if you support multiple local addresses.
1030 *
1031 * When transmitting, the TX control data will use the @hw_key_idx 1071 * When transmitting, the TX control data will use the @hw_key_idx
1032 * selected by the driver by modifying the &struct ieee80211_key_conf 1072 * selected by the driver by modifying the &struct ieee80211_key_conf
1033 * pointed to by the @key parameter to the set_key() function. 1073 * pointed to by the @key parameter to the set_key() function.
@@ -1061,6 +1101,42 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1061 */ 1101 */
1062 1102
1063/** 1103/**
1104 * DOC: Powersave support
1105 *
1106 * mac80211 has support for various powersave implementations.
1107 *
1108 * First, it can support hardware that handles all powersaving by
1109 * itself, such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS
1110 * hardware flag. In that case, it will be told about the desired
1111 * powersave mode depending on the association status, and the driver
1112 * must take care of sending nullfunc frames when necessary, i.e. when
1113 * entering and leaving powersave mode. The driver is required to look at
1114 * the AID in beacons and signal to the AP that it woke up when it finds
1115 * traffic directed to it. This mode supports dynamic PS by simply
1116 * enabling/disabling PS.
1117 *
1118 * Additionally, such hardware may set the %IEEE80211_HW_SUPPORTS_DYNAMIC_PS
1119 * flag to indicate that it can support dynamic PS mode itself (see below).
1120 *
1121 * Other hardware designs cannot send nullfunc frames by themselves and also
1122 * need software support for parsing the TIM bitmap. This is also supported
1123 * by mac80211 by combining the %IEEE80211_HW_SUPPORTS_PS and
1124 * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still
1125 * required to pass up beacons. Additionally, in this case, mac80211 will
1126 * wake up the hardware when multicast traffic is announced in the beacon.
1127 *
1128 * FIXME: I don't think we can be fast enough in software when we want to
1129 * receive multicast traffic?
1130 *
1131 * Dynamic powersave mode is an extension to normal powersave mode in which
1132 * the hardware stays awake for a user-specified period of time after sending
1133 * a frame so that reply frames need not be buffered and therefore delayed
1134 * to the next wakeup. This can either be supported by hardware, in which case
1135 * the driver needs to look at the @dynamic_ps_timeout hardware configuration
1136 * value, or by the stack if all nullfunc handling is in the stack.
1137 */
1138
1139/**
1064 * DOC: Frame filtering 1140 * DOC: Frame filtering
1065 * 1141 *
1066 * mac80211 requires to see many management frames for proper 1142 * mac80211 requires to see many management frames for proper
@@ -1172,6 +1248,8 @@ enum ieee80211_ampdu_mlme_action {
1172 * configuration in the TX control data. This handler should, 1248 * configuration in the TX control data. This handler should,
1173 * preferably, never fail and stop queues appropriately, more 1249 * preferably, never fail and stop queues appropriately, more
1174 * importantly, however, it must never fail for A-MPDU-queues. 1250 * importantly, however, it must never fail for A-MPDU-queues.
1251 * This function should return NETDEV_TX_OK except in very
1252 * limited cases.
1175 * Must be implemented and atomic. 1253 * Must be implemented and atomic.
1176 * 1254 *
1177 * @start: Called before the first netdevice attached to the hardware 1255 * @start: Called before the first netdevice attached to the hardware
@@ -1212,9 +1290,12 @@ enum ieee80211_ampdu_mlme_action {
1212 * 1290 *
1213 * @config: Handler for configuration requests. IEEE 802.11 code calls this 1291 * @config: Handler for configuration requests. IEEE 802.11 code calls this
1214 * function to change hardware configuration, e.g., channel. 1292 * function to change hardware configuration, e.g., channel.
1293 * This function should never fail but returns a negative error code
1294 * if it does.
1215 * 1295 *
1216 * @config_interface: Handler for configuration requests related to interfaces 1296 * @config_interface: Handler for configuration requests related to interfaces
1217 * (e.g. BSSID changes.) 1297 * (e.g. BSSID changes.)
1298 * Returns a negative error code which will be seen in userspace.
1218 * 1299 *
1219 * @bss_info_changed: Handler for configuration requests related to BSS 1300 * @bss_info_changed: Handler for configuration requests related to BSS
1220 * parameters that may vary during BSS's lifespan, and may affect low 1301 * parameters that may vary during BSS's lifespan, and may affect low
@@ -1232,8 +1313,9 @@ enum ieee80211_ampdu_mlme_action {
1232 * 1313 *
1233 * @set_key: See the section "Hardware crypto acceleration" 1314 * @set_key: See the section "Hardware crypto acceleration"
1234 * This callback can sleep, and is only called between add_interface 1315 * This callback can sleep, and is only called between add_interface
1235 * and remove_interface calls, i.e. while the interface with the 1316 * and remove_interface calls, i.e. while the given virtual interface
1236 * given local_address is enabled. 1317 * is enabled.
1318 * Returns a negative error code if the key can't be added.
1237 * 1319 *
1238 * @update_tkip_key: See the section "Hardware crypto acceleration" 1320 * @update_tkip_key: See the section "Hardware crypto acceleration"
1239 * This callback will be called in the context of Rx. Called for drivers 1321 * This callback will be called in the context of Rx. Called for drivers
@@ -1245,8 +1327,10 @@ enum ieee80211_ampdu_mlme_action {
1245 * bands. When the scan finishes, ieee80211_scan_completed() must be 1327 * bands. When the scan finishes, ieee80211_scan_completed() must be
1246 * called; note that it also must be called when the scan cannot finish 1328 * called; note that it also must be called when the scan cannot finish
1247 * because the hardware is turned off! Anything else is a bug! 1329 * because the hardware is turned off! Anything else is a bug!
1330 * Returns a negative error code which will be seen in userspace.
1248 * 1331 *
1249 * @get_stats: return low-level statistics 1332 * @get_stats: Return low-level statistics.
1333 * Returns zero if statistics are available.
1250 * 1334 *
1251 * @get_tkip_seq: If your device implements TKIP encryption in hardware this 1335 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
1252 * callback should be provided to read the TKIP transmit IVs (both IV32 1336 * callback should be provided to read the TKIP transmit IVs (both IV32
@@ -1260,6 +1344,7 @@ enum ieee80211_ampdu_mlme_action {
1260 * 1344 *
1261 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1345 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1262 * bursting) for a hardware TX queue. 1346 * bursting) for a hardware TX queue.
1347 * Returns a negative error code on failure.
1263 * 1348 *
1264 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1349 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1265 * to get number of currently queued packets (queue length), maximum queue 1350 * to get number of currently queued packets (queue length), maximum queue
@@ -1268,8 +1353,12 @@ enum ieee80211_ampdu_mlme_action {
1268 * hw->ampdu_queues items. 1353 * hw->ampdu_queues items.
1269 * 1354 *
1270 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1355 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1271 * this is only used for IBSS mode debugging and, as such, is not a 1356 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1272 * required function. Must be atomic. 1357 * required function.
1358 *
1359 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1360 * Currently, this is only used for IBSS mode debugging. Is not a
1361 * required function.
1273 * 1362 *
1274 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1363 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
1275 * with other STAs in the IBSS. This is only used in IBSS mode. This 1364 * with other STAs in the IBSS. This is only used in IBSS mode. This
@@ -1279,13 +1368,15 @@ enum ieee80211_ampdu_mlme_action {
1279 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1368 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1280 * This is needed only for IBSS mode and the result of this function is 1369 * This is needed only for IBSS mode and the result of this function is
1281 * used to determine whether to reply to Probe Requests. 1370 * used to determine whether to reply to Probe Requests.
1371 * Returns non-zero if this device sent the last beacon.
1282 * 1372 *
1283 * @ampdu_action: Perform a certain A-MPDU action 1373 * @ampdu_action: Perform a certain A-MPDU action
1284 * The RA/TID combination determines the destination and TID we want 1374 * The RA/TID combination determines the destination and TID we want
1285 * the ampdu action to be performed for. The action is defined through 1375 * the ampdu action to be performed for. The action is defined through
1286 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) 1376 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1287 * is the first frame we expect to perform the action on. notice 1377 * is the first frame we expect to perform the action on. Notice
1288 * that TX/RX_STOP can pass NULL for this parameter. 1378 * that TX/RX_STOP can pass NULL for this parameter.
1379 * Returns a negative error code on failure.
1289 */ 1380 */
1290struct ieee80211_ops { 1381struct ieee80211_ops {
1291 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1382 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1310,12 +1401,13 @@ struct ieee80211_ops {
1310 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1401 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1311 bool set); 1402 bool set);
1312 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1403 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1313 const u8 *local_address, const u8 *address, 1404 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
1314 struct ieee80211_key_conf *key); 1405 struct ieee80211_key_conf *key);
1315 void (*update_tkip_key)(struct ieee80211_hw *hw, 1406 void (*update_tkip_key)(struct ieee80211_hw *hw,
1316 struct ieee80211_key_conf *conf, const u8 *address, 1407 struct ieee80211_key_conf *conf, const u8 *address,
1317 u32 iv32, u16 *phase1key); 1408 u32 iv32, u16 *phase1key);
1318 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); 1409 int (*hw_scan)(struct ieee80211_hw *hw,
1410 struct cfg80211_scan_request *req);
1319 int (*get_stats)(struct ieee80211_hw *hw, 1411 int (*get_stats)(struct ieee80211_hw *hw,
1320 struct ieee80211_low_level_stats *stats); 1412 struct ieee80211_low_level_stats *stats);
1321 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, 1413 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
@@ -1328,6 +1420,7 @@ struct ieee80211_ops {
1328 int (*get_tx_stats)(struct ieee80211_hw *hw, 1420 int (*get_tx_stats)(struct ieee80211_hw *hw,
1329 struct ieee80211_tx_queue_stats *stats); 1421 struct ieee80211_tx_queue_stats *stats);
1330 u64 (*get_tsf)(struct ieee80211_hw *hw); 1422 u64 (*get_tsf)(struct ieee80211_hw *hw);
1423 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf);
1331 void (*reset_tsf)(struct ieee80211_hw *hw); 1424 void (*reset_tsf)(struct ieee80211_hw *hw);
1332 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1425 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1333 int (*ampdu_action)(struct ieee80211_hw *hw, 1426 int (*ampdu_action)(struct ieee80211_hw *hw,
@@ -1752,8 +1845,9 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1752 * mac80211 that the scan finished. 1845 * mac80211 that the scan finished.
1753 * 1846 *
1754 * @hw: the hardware that finished the scan 1847 * @hw: the hardware that finished the scan
1848 * @aborted: set to true if scan was aborted
1755 */ 1849 */
1756void ieee80211_scan_completed(struct ieee80211_hw *hw); 1850void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted);
1757 1851
1758/** 1852/**
1759 * ieee80211_iterate_active_interfaces - iterate active interfaces 1853 * ieee80211_iterate_active_interfaces - iterate active interfaces
@@ -1962,4 +2056,34 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
1962int ieee80211_rate_control_register(struct rate_control_ops *ops); 2056int ieee80211_rate_control_register(struct rate_control_ops *ops);
1963void ieee80211_rate_control_unregister(struct rate_control_ops *ops); 2057void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
1964 2058
2059static inline bool
2060conf_is_ht20(struct ieee80211_conf *conf)
2061{
2062 return conf->channel_type == NL80211_CHAN_HT20;
2063}
2064
2065static inline bool
2066conf_is_ht40_minus(struct ieee80211_conf *conf)
2067{
2068 return conf->channel_type == NL80211_CHAN_HT40MINUS;
2069}
2070
2071static inline bool
2072conf_is_ht40_plus(struct ieee80211_conf *conf)
2073{
2074 return conf->channel_type == NL80211_CHAN_HT40PLUS;
2075}
2076
2077static inline bool
2078conf_is_ht40(struct ieee80211_conf *conf)
2079{
2080 return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf);
2081}
2082
2083static inline bool
2084conf_is_ht(struct ieee80211_conf *conf)
2085{
2086 return conf->channel_type != NL80211_CHAN_NO_HT;
2087}
2088
1965#endif /* MAC80211_H */ 2089#endif /* MAC80211_H */
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 977f482d97a..2eb3814d625 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -54,5 +54,18 @@ struct netns_ipv4 {
54 54
55 struct timer_list rt_secret_timer; 55 struct timer_list rt_secret_timer;
56 atomic_t rt_genid; 56 atomic_t rt_genid;
57
58#ifdef CONFIG_IP_MROUTE
59 struct sock *mroute_sk;
60 struct mfc_cache **mfc_cache_array;
61 struct vif_device *vif_table;
62 int maxvif;
63 atomic_t cache_resolve_queue_len;
64 int mroute_do_assert;
65 int mroute_do_pim;
66#if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2)
67 int mroute_reg_vif_num;
68#endif
69#endif
57}; 70};
58#endif 71#endif
diff --git a/include/net/netrom.h b/include/net/netrom.h
index f06852bba62..15696b1fd30 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -59,10 +59,6 @@ enum {
59#define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ 59#define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */
60#define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ 60#define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */
61 61
62struct nr_private {
63 struct net_device_stats stats;
64};
65
66struct nr_sock { 62struct nr_sock {
67 struct sock sock; 63 struct sock sock;
68 ax25_address user_addr, source_addr, dest_addr; 64 ax25_address user_addr, source_addr, dest_addr;
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 057b0a8a288..d43f71b5ec0 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -105,7 +105,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp);
105 105
106int phonet_sysctl_init(void); 106int phonet_sysctl_init(void);
107void phonet_sysctl_exit(void); 107void phonet_sysctl_exit(void);
108void phonet_netlink_register(void);
109int isi_register(void); 108int isi_register(void);
110void isi_unregister(void); 109void isi_unregister(void);
111 110
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index aa1c59a1d33..5054dc5ea2c 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -28,7 +28,7 @@ struct phonet_device_list {
28 spinlock_t lock; 28 spinlock_t lock;
29}; 29};
30 30
31extern struct phonet_device_list pndevs; 31struct phonet_device_list *phonet_device_list(struct net *net);
32 32
33struct phonet_device { 33struct phonet_device {
34 struct list_head list; 34 struct list_head list;
@@ -36,8 +36,9 @@ struct phonet_device {
36 DECLARE_BITMAP(addrs, 64); 36 DECLARE_BITMAP(addrs, 64);
37}; 37};
38 38
39void phonet_device_init(void); 39int phonet_device_init(void);
40void phonet_device_exit(void); 40void phonet_device_exit(void);
41int phonet_netlink_register(void);
41struct net_device *phonet_device_get(struct net *net); 42struct net_device *phonet_device_get(struct net *net);
42 43
43int phonet_address_add(struct net_device *dev, u8 addr); 44int phonet_address_add(struct net_device *dev, u8 addr);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 4082f39f507..e37fe3129c1 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -85,6 +85,7 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
85 struct nlattr *tab); 85 struct nlattr *tab);
86extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 86extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
87extern void qdisc_put_stab(struct qdisc_size_table *tab); 87extern void qdisc_put_stab(struct qdisc_size_table *tab);
88extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
88 89
89extern void __qdisc_run(struct Qdisc *q); 90extern void __qdisc_run(struct Qdisc *q);
90 91
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index f8c47429044..3d78a4d2246 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -42,9 +42,10 @@ struct Qdisc
42 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 42 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
43 struct sk_buff * (*dequeue)(struct Qdisc *dev); 43 struct sk_buff * (*dequeue)(struct Qdisc *dev);
44 unsigned flags; 44 unsigned flags;
45#define TCQ_F_BUILTIN 1 45#define TCQ_F_BUILTIN 1
46#define TCQ_F_THROTTLED 2 46#define TCQ_F_THROTTLED 2
47#define TCQ_F_INGRESS 4 47#define TCQ_F_INGRESS 4
48#define TCQ_F_WARN_NONWC (1 << 16)
48 int padded; 49 int padded;
49 struct Qdisc_ops *ops; 50 struct Qdisc_ops *ops;
50 struct qdisc_size_table *stab; 51 struct qdisc_size_table *stab;
diff --git a/include/net/sock.h b/include/net/sock.h
index ce3b5b62268..ded6854e3e4 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -945,6 +945,11 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk,
945 unsigned long size, 945 unsigned long size,
946 int noblock, 946 int noblock,
947 int *errcode); 947 int *errcode);
948extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
949 unsigned long header_len,
950 unsigned long data_len,
951 int noblock,
952 int *errcode);
948extern void *sock_kmalloc(struct sock *sk, int size, 953extern void *sock_kmalloc(struct sock *sk, int size,
949 gfp_t priority); 954 gfp_t priority);
950extern void sock_kfree_s(struct sock *sk, void *mem, int size); 955extern void sock_kfree_s(struct sock *sk, void *mem, int size);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 876b6f2bb4f..bfb240c6cf7 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -46,7 +46,7 @@ extern int datagram_send_ctl(struct net *net,
46 struct ipv6_txoptions *opt, 46 struct ipv6_txoptions *opt,
47 int *hlimit, int *tclass); 47 int *hlimit, int *tclass);
48 48
49#define LOOPBACK4_IPV6 __constant_htonl(0x7f000006) 49#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
50 50
51/* 51/*
52 * address family specific functions 52 * address family specific functions
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 21c5d966142..1c6285eb166 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,12 +181,25 @@ struct ieee80211_supported_band {
181 * struct wiphy - wireless hardware description 181 * struct wiphy - wireless hardware description
182 * @idx: the wiphy index assigned to this item 182 * @idx: the wiphy index assigned to this item
183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device 184 * @custom_regulatory: tells us the driver for this device
185 * has its own regulatory solution and cannot identify the 185 * has its own custom regulatory domain and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the 187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE). 188 * initiator is %REGDOM_SET_BY_CORE).
189 * @strict_regulatory: tells us the driver for this device will ignore
190 * regulatory domain settings until it gets its own regulatory domain
191 * via its regulatory_hint(). After its gets its own regulatory domain
192 * it will only allow further regulatory domain settings to further
193 * enhance compliance. For example if channel 13 and 14 are disabled
194 * by this regulatory domain no user regulatory domain can enable these
195 * channels at a later time. This can be used for devices which do not
196 * have calibration information gauranteed for frequencies or settings
197 * outside of its regulatory domain.
189 * @reg_notifier: the driver's regulatory notification callback 198 * @reg_notifier: the driver's regulatory notification callback
199 * @regd: the driver's regulatory domain, if one was requested via
200 * the regulatory_hint() API. This can be used by the driver
201 * on the reg_notifier() if it chooses to ignore future
202 * regulatory domain changes caused by other drivers.
190 */ 203 */
191struct wiphy { 204struct wiphy {
192 /* assign these fields before you register the wiphy */ 205 /* assign these fields before you register the wiphy */
@@ -197,7 +210,11 @@ struct wiphy {
197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 210 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
198 u16 interface_modes; 211 u16 interface_modes;
199 212
200 bool fw_handles_regulatory; 213 bool custom_regulatory;
214 bool strict_regulatory;
215
216 int bss_priv_size;
217 u8 max_scan_ssids;
201 218
202 /* If multiple wiphys are registered and you're handed e.g. 219 /* If multiple wiphys are registered and you're handed e.g.
203 * a regular netdev with assigned ieee80211_ptr, you won't 220 * a regular netdev with assigned ieee80211_ptr, you won't
@@ -209,10 +226,13 @@ struct wiphy {
209 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 226 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
210 227
211 /* Lets us get back the wiphy on the callback */ 228 /* Lets us get back the wiphy on the callback */
212 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); 229 int (*reg_notifier)(struct wiphy *wiphy,
230 struct regulatory_request *request);
213 231
214 /* fields below are read-only, assigned by cfg80211 */ 232 /* fields below are read-only, assigned by cfg80211 */
215 233
234 const struct ieee80211_regdomain *regd;
235
216 /* the item in /sys/class/ieee80211/ points to this, 236 /* the item in /sys/class/ieee80211/ points to this,
217 * you need use set_wiphy_dev() (see below) */ 237 * you need use set_wiphy_dev() (see below) */
218 struct device dev; 238 struct device dev;
@@ -361,7 +381,7 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
361 */ 381 */
362struct ieee80211_rate * 382struct ieee80211_rate *
363ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 383ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
364 u64 basic_rates, int bitrate); 384 u32 basic_rates, int bitrate);
365 385
366/** 386/**
367 * regulatory_hint - driver hint to the wireless core a regulatory domain 387 * regulatory_hint - driver hint to the wireless core a regulatory domain
@@ -395,4 +415,45 @@ extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
395extern void regulatory_hint_11d(struct wiphy *wiphy, 415extern void regulatory_hint_11d(struct wiphy *wiphy,
396 u8 *country_ie, 416 u8 *country_ie,
397 u8 country_ie_len); 417 u8 country_ie_len);
418
419/**
420 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
421 * @wiphy: the wireless device we want to process the regulatory domain on
422 * @regd: the custom regulatory domain to use for this wiphy
423 *
424 * Drivers can sometimes have custom regulatory domains which do not apply
425 * to a specific country. Drivers can use this to apply such custom regulatory
426 * domains. This routine must be called prior to wiphy registration. The
427 * custom regulatory domain will be trusted completely and as such previous
428 * default channel settings will be disregarded. If no rule is found for a
429 * channel on the regulatory domain the channel will be disabled.
430 */
431extern void wiphy_apply_custom_regulatory(
432 struct wiphy *wiphy,
433 const struct ieee80211_regdomain *regd);
434
435/**
436 * freq_reg_info - get regulatory information for the given frequency
437 * @wiphy: the wiphy for which we want to process this rule for
438 * @center_freq: Frequency in KHz for which we want regulatory information for
439 * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
440 * you can set this to 0. If this frequency is allowed we then set
441 * this value to the maximum allowed bandwidth.
442 * @reg_rule: the regulatory rule which we have for this frequency
443 *
444 * Use this function to get the regulatory rule for a specific frequency on
445 * a given wireless device. If the device has a specific regulatory domain
446 * it wants to follow we respect that unless a country IE has been received
447 * and processed already.
448 *
449 * Returns 0 if it was able to find a valid regulatory rule which does
450 * apply to the given center_freq otherwise it returns non-zero. It will
451 * also return -ERANGE if we determine the given center_freq does not even have
452 * a regulatory rule for a frequency range in the center_freq's band. See
453 * freq_in_rule_band() for our current definition of a band -- this is purely
454 * subjective and right now its 802.11 specific.
455 */
456extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
457 const struct ieee80211_reg_rule **reg_rule);
458
398#endif /* __NET_WIRELESS_H */ 459#endif /* __NET_WIRELESS_H */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 936e333e7ce..c179318edd9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -388,7 +388,7 @@ enum {
388 IB_MULTICAST_QPN = 0xffffff 388 IB_MULTICAST_QPN = 0xffffff
389}; 389};
390 390
391#define IB_LID_PERMISSIVE __constant_htons(0xFFFF) 391#define IB_LID_PERMISSIVE cpu_to_be16(0xFFFF)
392 392
393enum ib_ah_flags { 393enum ib_ah_flags {
394 IB_AH_GRH = 1 394 IB_AH_GRH = 1