diff options
Diffstat (limited to 'include')
68 files changed, 2078 insertions, 372 deletions
diff --git a/include/asm-frv/socket.h b/include/asm-frv/socket.h index e51ca67b9356..57c3d4054e8b 100644 --- a/include/asm-frv/socket.h +++ b/include/asm-frv/socket.h | |||
@@ -54,5 +54,8 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_SOCKET_H */ | 60 | #endif /* _ASM_SOCKET_H */ |
58 | 61 | ||
diff --git a/include/asm-m32r/socket.h b/include/asm-m32r/socket.h index 9a0e20012224..be7ed589af5c 100644 --- a/include/asm-m32r/socket.h +++ b/include/asm-m32r/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_M32R_SOCKET_H */ | 60 | #endif /* _ASM_M32R_SOCKET_H */ |
diff --git a/include/asm-mn10300/socket.h b/include/asm-mn10300/socket.h index 80af9c4ccad7..fb5daf438ec9 100644 --- a/include/asm-mn10300/socket.h +++ b/include/asm-mn10300/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_SOCKET_H */ | 60 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index a1916078fd08..cd4bcb6989ce 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
@@ -235,8 +235,6 @@ struct Outgoing { | |||
235 | 235 | ||
236 | 236 | ||
237 | struct arcnet_local { | 237 | struct 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 | ||
336 | void arcnet_unregister_proto(struct ArcProto *proto); | 334 | void arcnet_unregister_proto(struct ArcProto *proto); |
337 | irqreturn_t arcnet_interrupt(int irq, void *dev_id); | 335 | irqreturn_t arcnet_interrupt(int irq, void *dev_id); |
338 | struct net_device *alloc_arcdev(char *name); | 336 | struct net_device *alloc_arcdev(const char *name); |
337 | |||
338 | int arcnet_open(struct net_device *dev); | ||
339 | int arcnet_close(struct net_device *dev); | ||
340 | int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev); | ||
341 | void 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 000000000000..b847fc7b93f9 --- /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 | |||
24 | struct 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/clocksource.h b/include/linux/clocksource.h index f88d32f8ff7c..573819ef4cc0 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -22,8 +22,109 @@ typedef u64 cycle_t; | |||
22 | struct clocksource; | 22 | struct clocksource; |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * struct cyclecounter - hardware abstraction for a free running counter | ||
26 | * Provides completely state-free accessors to the underlying hardware. | ||
27 | * Depending on which hardware it reads, the cycle counter may wrap | ||
28 | * around quickly. Locking rules (if necessary) have to be defined | ||
29 | * by the implementor and user of specific instances of this API. | ||
30 | * | ||
31 | * @read: returns the current cycle value | ||
32 | * @mask: bitmask for two's complement | ||
33 | * subtraction of non 64 bit counters, | ||
34 | * see CLOCKSOURCE_MASK() helper macro | ||
35 | * @mult: cycle to nanosecond multiplier | ||
36 | * @shift: cycle to nanosecond divisor (power of two) | ||
37 | */ | ||
38 | struct cyclecounter { | ||
39 | cycle_t (*read)(const struct cyclecounter *cc); | ||
40 | cycle_t mask; | ||
41 | u32 mult; | ||
42 | u32 shift; | ||
43 | }; | ||
44 | |||
45 | /** | ||
46 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
47 | * Contains the state needed by timecounter_read() to detect | ||
48 | * cycle counter wrap around. Initialize with | ||
49 | * timecounter_init(). Also used to convert cycle counts into the | ||
50 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
51 | * of this code are responsible for initializing the underlying | ||
52 | * cycle counter hardware, locking issues and reading the time | ||
53 | * more often than the cycle counter wraps around. The nanosecond | ||
54 | * counter will only wrap around after ~585 years. | ||
55 | * | ||
56 | * @cc: the cycle counter used by this instance | ||
57 | * @cycle_last: most recent cycle counter value seen by | ||
58 | * timecounter_read() | ||
59 | * @nsec: continuously increasing count | ||
60 | */ | ||
61 | struct timecounter { | ||
62 | const struct cyclecounter *cc; | ||
63 | cycle_t cycle_last; | ||
64 | u64 nsec; | ||
65 | }; | ||
66 | |||
67 | /** | ||
68 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
69 | * @tc: Pointer to cycle counter. | ||
70 | * @cycles: Cycles | ||
71 | * | ||
72 | * XXX - This could use some mult_lxl_ll() asm optimization. Same code | ||
73 | * as in cyc2ns, but with unsigned result. | ||
74 | */ | ||
75 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
76 | cycle_t cycles) | ||
77 | { | ||
78 | u64 ret = (u64)cycles; | ||
79 | ret = (ret * cc->mult) >> cc->shift; | ||
80 | return ret; | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * timecounter_init - initialize a time counter | ||
85 | * @tc: Pointer to time counter which is to be initialized/reset | ||
86 | * @cc: A cycle counter, ready to be used. | ||
87 | * @start_tstamp: Arbitrary initial time stamp. | ||
88 | * | ||
89 | * After this call the current cycle register (roughly) corresponds to | ||
90 | * the initial time stamp. Every call to timecounter_read() increments | ||
91 | * the time stamp counter by the number of elapsed nanoseconds. | ||
92 | */ | ||
93 | extern void timecounter_init(struct timecounter *tc, | ||
94 | const struct cyclecounter *cc, | ||
95 | u64 start_tstamp); | ||
96 | |||
97 | /** | ||
98 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
99 | * plus the initial time stamp | ||
100 | * @tc: Pointer to time counter. | ||
101 | * | ||
102 | * In other words, keeps track of time since the same epoch as | ||
103 | * the function which generated the initial time stamp. | ||
104 | */ | ||
105 | extern u64 timecounter_read(struct timecounter *tc); | ||
106 | |||
107 | /** | ||
108 | * timecounter_cyc2time - convert a cycle counter to same | ||
109 | * time base as values returned by | ||
110 | * timecounter_read() | ||
111 | * @tc: Pointer to time counter. | ||
112 | * @cycle: a value returned by tc->cc->read() | ||
113 | * | ||
114 | * Cycle counts that are converted correctly as long as they | ||
115 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
116 | * with "max cycle count" == cs->mask+1. | ||
117 | * | ||
118 | * This allows conversion of cycle counter values which were generated | ||
119 | * in the past. | ||
120 | */ | ||
121 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
122 | cycle_t cycle_tstamp); | ||
123 | |||
124 | /** | ||
25 | * struct clocksource - hardware abstraction for a free running counter | 125 | * struct clocksource - hardware abstraction for a free running counter |
26 | * Provides mostly state-free accessors to the underlying hardware. | 126 | * Provides mostly state-free accessors to the underlying hardware. |
127 | * This is the structure used for system time. | ||
27 | * | 128 | * |
28 | * @name: ptr to clocksource name | 129 | * @name: ptr to clocksource name |
29 | * @list: list head for registration | 130 | * @list: list head for registration |
diff --git a/include/linux/com20020.h b/include/linux/com20020.h index ac6d9a43e085..5dcfb944b6ce 100644 --- a/include/linux/com20020.h +++ b/include/linux/com20020.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | int com20020_check(struct net_device *dev); | 30 | int com20020_check(struct net_device *dev); |
31 | int com20020_found(struct net_device *dev, int shared); | 31 | int com20020_found(struct net_device *dev, int shared); |
32 | extern 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 34f2789d9b9b..fc65d219d88c 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); | |||
164 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); | 170 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
165 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 171 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
166 | 172 | ||
173 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); | ||
174 | |||
167 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 175 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
168 | void cn_queue_free_dev(struct cn_queue_dev *dev); | 176 | void cn_queue_free_dev(struct cn_queue_dev *dev); |
169 | 177 | ||
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 61734e27abb7..7434a8353e23 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 | */ | ||
375 | struct dccp_minisock { | ||
376 | __u64 dccpms_sequence_window; | ||
377 | struct list_head dccpms_pending; | ||
378 | struct list_head dccpms_conf; | ||
379 | }; | ||
380 | |||
381 | struct dccp_opt_conf { | ||
382 | __u8 *dccpoc_val; | ||
383 | __u8 dccpoc_len; | ||
384 | }; | ||
385 | |||
386 | struct 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 | |||
396 | extern 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 | ||
549 | static inline struct dccp_minisock *dccp_msk(const struct sock *sk) | ||
550 | { | ||
551 | return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock; | ||
552 | } | ||
553 | |||
554 | static inline const char *dccp_role(const struct sock *sk) | 511 | static 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/errqueue.h b/include/linux/errqueue.h index ceb1454b6977..ec12cc74366f 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
@@ -18,6 +18,7 @@ struct sock_extended_err | |||
18 | #define SO_EE_ORIGIN_LOCAL 1 | 18 | #define SO_EE_ORIGIN_LOCAL 1 |
19 | #define SO_EE_ORIGIN_ICMP 2 | 19 | #define SO_EE_ORIGIN_ICMP 2 |
20 | #define SO_EE_ORIGIN_ICMP6 3 | 20 | #define SO_EE_ORIGIN_ICMP6 3 |
21 | #define SO_EE_ORIGIN_TIMESTAMPING 4 | ||
21 | 22 | ||
22 | #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) | 23 | #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) |
23 | 24 | ||
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 1cb0f0b90926..a1f17abba7dc 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 | |||
199 | static 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/ethtool.h b/include/linux/ethtool.h index 27c67a542235..131b127b70f8 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -7,6 +7,7 @@ | |||
7 | * Portions Copyright 2002 Intel (eli.kupermann@intel.com, | 7 | * Portions Copyright 2002 Intel (eli.kupermann@intel.com, |
8 | * christopher.leech@intel.com, | 8 | * christopher.leech@intel.com, |
9 | * scott.feldman@intel.com) | 9 | * scott.feldman@intel.com) |
10 | * Portions Copyright (C) Sun Microsystems 2008 | ||
10 | */ | 11 | */ |
11 | 12 | ||
12 | #ifndef _LINUX_ETHTOOL_H | 13 | #ifndef _LINUX_ETHTOOL_H |
@@ -287,10 +288,75 @@ enum ethtool_flags { | |||
287 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 288 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
288 | }; | 289 | }; |
289 | 290 | ||
290 | struct ethtool_rxnfc { | 291 | /* The following structures are for supporting RX network flow |
291 | __u32 cmd; | 292 | * classification configuration. Note, all multibyte fields, e.g., |
293 | * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network | ||
294 | * byte order. | ||
295 | */ | ||
296 | struct ethtool_tcpip4_spec { | ||
297 | __be32 ip4src; | ||
298 | __be32 ip4dst; | ||
299 | __be16 psrc; | ||
300 | __be16 pdst; | ||
301 | __u8 tos; | ||
302 | }; | ||
303 | |||
304 | struct ethtool_ah_espip4_spec { | ||
305 | __be32 ip4src; | ||
306 | __be32 ip4dst; | ||
307 | __be32 spi; | ||
308 | __u8 tos; | ||
309 | }; | ||
310 | |||
311 | struct ethtool_rawip4_spec { | ||
312 | __be32 ip4src; | ||
313 | __be32 ip4dst; | ||
314 | __u8 hdata[64]; | ||
315 | }; | ||
316 | |||
317 | struct ethtool_ether_spec { | ||
318 | __be16 ether_type; | ||
319 | __u8 frame_size; | ||
320 | __u8 eframe[16]; | ||
321 | }; | ||
322 | |||
323 | #define ETH_RX_NFC_IP4 1 | ||
324 | #define ETH_RX_NFC_IP6 2 | ||
325 | |||
326 | struct ethtool_usrip4_spec { | ||
327 | __be32 ip4src; | ||
328 | __be32 ip4dst; | ||
329 | __be32 l4_4_bytes; | ||
330 | __u8 tos; | ||
331 | __u8 ip_ver; | ||
332 | __u8 proto; | ||
333 | }; | ||
334 | |||
335 | struct ethtool_rx_flow_spec { | ||
292 | __u32 flow_type; | 336 | __u32 flow_type; |
293 | __u64 data; | 337 | union { |
338 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
339 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
340 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
341 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
342 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
343 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
344 | struct ethtool_ether_spec ether_spec; | ||
345 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
346 | __u8 hdata[64]; | ||
347 | } h_u, m_u; /* entry, mask */ | ||
348 | __u64 ring_cookie; | ||
349 | __u32 location; | ||
350 | }; | ||
351 | |||
352 | struct ethtool_rxnfc { | ||
353 | __u32 cmd; | ||
354 | __u32 flow_type; | ||
355 | /* The rx flow hash value or the rule DB size */ | ||
356 | __u64 data; | ||
357 | struct ethtool_rx_flow_spec fs; | ||
358 | __u32 rule_cnt; | ||
359 | __u32 rule_locs[0]; | ||
294 | }; | 360 | }; |
295 | 361 | ||
296 | #ifdef __KERNEL__ | 362 | #ifdef __KERNEL__ |
@@ -417,8 +483,8 @@ struct ethtool_ops { | |||
417 | /* the following hooks are obsolete */ | 483 | /* the following hooks are obsolete */ |
418 | int (*self_test_count)(struct net_device *);/* use get_sset_count */ | 484 | int (*self_test_count)(struct net_device *);/* use get_sset_count */ |
419 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ | 485 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ |
420 | int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *); | 486 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); |
421 | int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *); | 487 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
422 | }; | 488 | }; |
423 | #endif /* __KERNEL__ */ | 489 | #endif /* __KERNEL__ */ |
424 | 490 | ||
@@ -469,6 +535,12 @@ struct ethtool_ops { | |||
469 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 535 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
470 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ | 536 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ |
471 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ | 537 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ |
538 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ | ||
539 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ | ||
540 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ | ||
541 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | ||
542 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | ||
543 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | ||
472 | 544 | ||
473 | /* compatibility with older code */ | 545 | /* compatibility with older code */ |
474 | #define SPARC_ETH_GSET ETHTOOL_GSET | 546 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -565,9 +637,13 @@ struct ethtool_ops { | |||
565 | #define UDP_V6_FLOW 0x06 | 637 | #define UDP_V6_FLOW 0x06 |
566 | #define SCTP_V6_FLOW 0x07 | 638 | #define SCTP_V6_FLOW 0x07 |
567 | #define AH_ESP_V6_FLOW 0x08 | 639 | #define AH_ESP_V6_FLOW 0x08 |
640 | #define AH_V4_FLOW 0x09 | ||
641 | #define ESP_V4_FLOW 0x0a | ||
642 | #define AH_V6_FLOW 0x0b | ||
643 | #define ESP_V6_FLOW 0x0c | ||
644 | #define IP_USER_FLOW 0x0d | ||
568 | 645 | ||
569 | /* L3-L4 network traffic flow hash options */ | 646 | /* L3-L4 network traffic flow hash options */ |
570 | #define RXH_DEV_PORT (1 << 0) | ||
571 | #define RXH_L2DA (1 << 1) | 647 | #define RXH_L2DA (1 << 1) |
572 | #define RXH_VLAN (1 << 2) | 648 | #define RXH_VLAN (1 << 2) |
573 | #define RXH_L3_PROTO (1 << 3) | 649 | #define RXH_L3_PROTO (1 << 3) |
@@ -577,5 +653,6 @@ struct ethtool_ops { | |||
577 | #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */ | 653 | #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */ |
578 | #define RXH_DISCARD (1 << 31) | 654 | #define RXH_DISCARD (1 << 31) |
579 | 655 | ||
656 | #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL | ||
580 | 657 | ||
581 | #endif /* _LINUX_ETHTOOL_H */ | 658 | #endif /* _LINUX_ETHTOOL_H */ |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index fd47a151665e..6a6e701f1631 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) | |||
102 | int hdlc_open(struct net_device *dev); | 103 | int 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 */ |
104 | void hdlc_close(struct net_device *dev); | 105 | void hdlc_close(struct net_device *dev); |
106 | /* May be used by hardware driver */ | ||
107 | int 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 */ | ||
109 | int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); | ||
105 | 110 | ||
106 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | 111 | int 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 bf6302f6b5f8..c010b4a785b8 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h | |||
@@ -215,7 +215,7 @@ struct hdlcdrv_state { | |||
215 | 215 | ||
216 | struct hdlcdrv_hdlctx { | 216 | struct hdlcdrv_hdlctx { |
217 | struct hdlcdrv_hdlcbuffer hbuf; | 217 | struct hdlcdrv_hdlcbuffer hbuf; |
218 | long in_hdlc_tx; | 218 | unsigned long in_hdlc_tx; |
219 | /* | 219 | /* |
220 | * 0 = send flags | 220 | * 0 = send flags |
221 | * 1 = send txtail (flags) | 221 | * 1 = send txtail (flags) |
@@ -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 1c7a0dd5536a..06695b74d405 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 c4e6ca1a6306..b1bb817d1427 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 | |||
530 | struct ieee80211_mgmt { | 532 | struct 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) */ | ||
665 | struct 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 */ |
659 | struct ieee80211_rts { | 674 | struct 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 | ||
1129 | enum 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 */ |
1108 | enum ieee80211_back_actioncode { | 1136 | enum 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 */ | ||
1150 | enum 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 | */ | ||
1228 | static 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 | */ | ||
1260 | static 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 | */ | ||
1275 | static 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 | */ | ||
1290 | static 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 | */ | ||
1309 | static 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 | */ | ||
1341 | static 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 | */ | ||
1360 | static 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 2a6e29620a96..1108f3e099e3 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 7f3c735f422b..0216e1bdbc56 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 | ||
113 | struct ethhdr { | 113 | struct 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 30c88b2245ff..90b5fae5d714 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 | ||
109 | struct pppoe_hdr { | 109 | struct 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 8529f57ba263..049d6c9428db 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 82c43624c067..5a9aae4adb44 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 | ||
28 | struct ip_tunnel_parm | 28 | struct ip_tunnel_parm |
29 | { | 29 | { |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 06fcdb45106b..acef2a770b6b 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 | ||
112 | struct in_ifaddr | 113 | struct in_ifaddr |
113 | { | 114 | { |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 8a455694d682..0d45b4e8d367 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -193,6 +193,9 @@ struct vif_device | |||
193 | struct mfc_cache | 193 | struct 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 | ||
221 | static inline | ||
222 | struct net *mfc_net(const struct mfc_cache *mfc) | ||
223 | { | ||
224 | return read_pnet(&mfc->mfc_net); | ||
225 | } | ||
226 | |||
227 | static inline | ||
228 | void 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__ |
243 | struct rtmsg; | 258 | struct rtmsg; |
244 | extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | 259 | extern 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 f56a696a7cc6..cddaa48fb182 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/net_tstamp.h b/include/linux/net_tstamp.h new file mode 100644 index 000000000000..a3b8546354ac --- /dev/null +++ b/include/linux/net_tstamp.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Userspace API for hardware time stamping of network packets | ||
3 | * | ||
4 | * Copyright (C) 2008,2009 Intel Corporation | ||
5 | * Author: Patrick Ohly <patrick.ohly@intel.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _NET_TIMESTAMPING_H | ||
10 | #define _NET_TIMESTAMPING_H | ||
11 | |||
12 | #include <linux/socket.h> /* for SO_TIMESTAMPING */ | ||
13 | |||
14 | /* SO_TIMESTAMPING gets an integer bit field comprised of these values */ | ||
15 | enum { | ||
16 | SOF_TIMESTAMPING_TX_HARDWARE = (1<<0), | ||
17 | SOF_TIMESTAMPING_TX_SOFTWARE = (1<<1), | ||
18 | SOF_TIMESTAMPING_RX_HARDWARE = (1<<2), | ||
19 | SOF_TIMESTAMPING_RX_SOFTWARE = (1<<3), | ||
20 | SOF_TIMESTAMPING_SOFTWARE = (1<<4), | ||
21 | SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5), | ||
22 | SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6), | ||
23 | SOF_TIMESTAMPING_MASK = | ||
24 | (SOF_TIMESTAMPING_RAW_HARDWARE - 1) | | ||
25 | SOF_TIMESTAMPING_RAW_HARDWARE | ||
26 | }; | ||
27 | |||
28 | /** | ||
29 | * struct hwtstamp_config - %SIOCSHWTSTAMP parameter | ||
30 | * | ||
31 | * @flags: no flags defined right now, must be zero | ||
32 | * @tx_type: one of HWTSTAMP_TX_* | ||
33 | * @rx_type: one of one of HWTSTAMP_FILTER_* | ||
34 | * | ||
35 | * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to | ||
36 | * this structure. dev_ifsioc() in the kernel takes care of the | ||
37 | * translation between 32 bit userspace and 64 bit kernel. The | ||
38 | * structure is intentionally chosen so that it has the same layout on | ||
39 | * 32 and 64 bit systems, don't break this! | ||
40 | */ | ||
41 | struct hwtstamp_config { | ||
42 | int flags; | ||
43 | int tx_type; | ||
44 | int rx_filter; | ||
45 | }; | ||
46 | |||
47 | /* possible values for hwtstamp_config->tx_type */ | ||
48 | enum { | ||
49 | /* | ||
50 | * No outgoing packet will need hardware time stamping; | ||
51 | * should a packet arrive which asks for it, no hardware | ||
52 | * time stamping will be done. | ||
53 | */ | ||
54 | HWTSTAMP_TX_OFF, | ||
55 | |||
56 | /* | ||
57 | * Enables hardware time stamping for outgoing packets; | ||
58 | * the sender of the packet decides which are to be | ||
59 | * time stamped by setting %SOF_TIMESTAMPING_TX_SOFTWARE | ||
60 | * before sending the packet. | ||
61 | */ | ||
62 | HWTSTAMP_TX_ON, | ||
63 | }; | ||
64 | |||
65 | /* possible values for hwtstamp_config->rx_filter */ | ||
66 | enum { | ||
67 | /* time stamp no incoming packet at all */ | ||
68 | HWTSTAMP_FILTER_NONE, | ||
69 | |||
70 | /* time stamp any incoming packet */ | ||
71 | HWTSTAMP_FILTER_ALL, | ||
72 | |||
73 | /* return value: time stamp all packets requested plus some others */ | ||
74 | HWTSTAMP_FILTER_SOME, | ||
75 | |||
76 | /* PTP v1, UDP, any kind of event packet */ | ||
77 | HWTSTAMP_FILTER_PTP_V1_L4_EVENT, | ||
78 | /* PTP v1, UDP, Sync packet */ | ||
79 | HWTSTAMP_FILTER_PTP_V1_L4_SYNC, | ||
80 | /* PTP v1, UDP, Delay_req packet */ | ||
81 | HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ, | ||
82 | /* PTP v2, UDP, any kind of event packet */ | ||
83 | HWTSTAMP_FILTER_PTP_V2_L4_EVENT, | ||
84 | /* PTP v2, UDP, Sync packet */ | ||
85 | HWTSTAMP_FILTER_PTP_V2_L4_SYNC, | ||
86 | /* PTP v2, UDP, Delay_req packet */ | ||
87 | HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ, | ||
88 | |||
89 | /* 802.AS1, Ethernet, any kind of event packet */ | ||
90 | HWTSTAMP_FILTER_PTP_V2_L2_EVENT, | ||
91 | /* 802.AS1, Ethernet, Sync packet */ | ||
92 | HWTSTAMP_FILTER_PTP_V2_L2_SYNC, | ||
93 | /* 802.AS1, Ethernet, Delay_req packet */ | ||
94 | HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ, | ||
95 | |||
96 | /* PTP v2/802.AS1, any layer, any kind of event packet */ | ||
97 | HWTSTAMP_FILTER_PTP_V2_EVENT, | ||
98 | /* PTP v2/802.AS1, any layer, Sync packet */ | ||
99 | HWTSTAMP_FILTER_PTP_V2_SYNC, | ||
100 | /* PTP v2/802.AS1, any layer, Delay_req packet */ | ||
101 | HWTSTAMP_FILTER_PTP_V2_DELAY_REQ, | ||
102 | }; | ||
103 | |||
104 | #endif /* _NET_TIMESTAMPING_H */ | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ec54785d34f9..bd8b4ca85a2a 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 | ||
128 | struct net_device_stats | 128 | struct 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 | */ |
290 | struct netdev_boot_setup { | 290 | struct 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, | |||
984 | void netif_napi_del(struct napi_struct *napi); | 987 | void netif_napi_del(struct napi_struct *napi); |
985 | 988 | ||
986 | struct napi_gro_cb { | 989 | struct 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 |
1088 | extern int netpoll_trap(void); | 1094 | extern int netpoll_trap(void); |
1089 | #endif | 1095 | #endif |
1096 | extern void *skb_gro_header(struct sk_buff *skb, unsigned int hlen); | ||
1097 | extern int skb_gro_receive(struct sk_buff **head, | ||
1098 | struct sk_buff *skb); | ||
1099 | |||
1100 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) | ||
1101 | { | ||
1102 | return NAPI_GRO_CB(skb)->data_offset; | ||
1103 | } | ||
1104 | |||
1105 | static inline unsigned int skb_gro_len(const struct sk_buff *skb) | ||
1106 | { | ||
1107 | return skb->len - NAPI_GRO_CB(skb)->data_offset; | ||
1108 | } | ||
1109 | |||
1110 | static inline void skb_gro_pull(struct sk_buff *skb, unsigned int len) | ||
1111 | { | ||
1112 | NAPI_GRO_CB(skb)->data_offset += len; | ||
1113 | } | ||
1114 | |||
1115 | static inline void skb_gro_reset_offset(struct sk_buff *skb) | ||
1116 | { | ||
1117 | NAPI_GRO_CB(skb)->data_offset = 0; | ||
1118 | } | ||
1119 | |||
1120 | static 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 | ||
1091 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 1127 | static 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); | |||
1375 | extern void napi_gro_flush(struct napi_struct *napi); | 1411 | extern void napi_gro_flush(struct napi_struct *napi); |
1376 | extern int dev_gro_receive(struct napi_struct *napi, | 1412 | extern int dev_gro_receive(struct napi_struct *napi, |
1377 | struct sk_buff *skb); | 1413 | struct sk_buff *skb); |
1414 | extern int napi_skb_finish(int ret, struct sk_buff *skb); | ||
1378 | extern int napi_gro_receive(struct napi_struct *napi, | 1415 | extern int napi_gro_receive(struct napi_struct *napi, |
1379 | struct sk_buff *skb); | 1416 | struct sk_buff *skb); |
1380 | extern void napi_reuse_skb(struct napi_struct *napi, | 1417 | extern void napi_reuse_skb(struct napi_struct *napi, |
1381 | struct sk_buff *skb); | 1418 | struct sk_buff *skb); |
1382 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, | 1419 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, |
1383 | struct napi_gro_fraginfo *info); | 1420 | struct napi_gro_fraginfo *info); |
1421 | extern int napi_frags_finish(struct napi_struct *napi, | ||
1422 | struct sk_buff *skb, int ret); | ||
1384 | extern int napi_gro_frags(struct napi_struct *napi, | 1423 | extern int napi_gro_frags(struct napi_struct *napi, |
1385 | struct napi_gro_fraginfo *info); | 1424 | struct napi_gro_fraginfo *info); |
1386 | extern void netif_nit_deliver(struct sk_buff *skb); | 1425 | extern 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 */ | ||
1578 | static 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 | */ | ||
1586 | static 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 | |||
1593 | static 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(). */ | ||
1600 | static 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 | */ | ||
1612 | static 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 | */ | ||
1622 | static inline void netif_rx_complete(struct napi_struct *napi) | ||
1623 | { | ||
1624 | napi_complete(napi); | ||
1625 | } | ||
1626 | |||
1627 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) | 1616 | static 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 499aa9375901..f8105e54716a 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) | |||
59 | static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) | 59 | static 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/netlink.h b/include/linux/netlink.h index 51b09a1f46c3..1e6bf995435c 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -103,6 +103,7 @@ struct nlmsgerr | |||
103 | #define NETLINK_ADD_MEMBERSHIP 1 | 103 | #define NETLINK_ADD_MEMBERSHIP 1 |
104 | #define NETLINK_DROP_MEMBERSHIP 2 | 104 | #define NETLINK_DROP_MEMBERSHIP 2 |
105 | #define NETLINK_PKTINFO 3 | 105 | #define NETLINK_PKTINFO 3 |
106 | #define NETLINK_BROADCAST_ERROR 4 | ||
106 | 107 | ||
107 | struct nl_pktinfo | 108 | struct nl_pktinfo |
108 | { | 109 | { |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index e86ed59f9ad5..8802d1bda382 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 | */ |
416 | enum nl80211_sta_flags { | 476 | enum 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 | */ | ||
893 | enum 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 aca8c458aa8a..3f9687a71e32 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 |
@@ -1971,6 +1973,8 @@ | |||
1971 | 1973 | ||
1972 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 1974 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
1973 | 1975 | ||
1976 | #define PCI_VENDOR_ID_AMBIT 0x1468 | ||
1977 | |||
1974 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 1978 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |
1975 | 1979 | ||
1976 | #define PCI_VENDOR_ID_TITAN 0x14D2 | 1980 | #define PCI_VENDOR_ID_TITAN 0x14D2 |
@@ -2215,6 +2219,8 @@ | |||
2215 | 2219 | ||
2216 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 | 2220 | #define PCI_VENDOR_ID_TOPSPIN 0x1867 |
2217 | 2221 | ||
2222 | #define PCI_VENDOR_ID_SILAN 0x1904 | ||
2223 | |||
2218 | #define PCI_VENDOR_ID_TDI 0x192E | 2224 | #define PCI_VENDOR_ID_TDI 0x192E |
2219 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2225 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
2220 | 2226 | ||
diff --git a/include/linux/pim.h b/include/linux/pim.h index 1ba0661561a4..252bf6644c51 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 */ |
17 | struct pimreghdr | 17 | struct pimreghdr |
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h index a942892d6dfe..9d64bdf14770 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 | ||
26 | struct ppp_channel; | 27 | struct 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. */ |
57 | extern void ppp_input_error(struct ppp_channel *, int code); | 58 | extern void ppp_input_error(struct ppp_channel *, int code); |
58 | 59 | ||
60 | /* Attach a channel to a given PPP unit in specified net. */ | ||
61 | extern 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. */ |
60 | extern int ppp_register_channel(struct ppp_channel *); | 64 | extern int ppp_register_channel(struct ppp_channel *); |
61 | 65 | ||
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 8ba1c320f975..c2731bfe04d8 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -60,7 +60,7 @@ typedef struct sctphdr { | |||
60 | __be16 source; | 60 | __be16 source; |
61 | __be16 dest; | 61 | __be16 dest; |
62 | __be32 vtag; | 62 | __be32 vtag; |
63 | __be32 checksum; | 63 | __le32 checksum; |
64 | } __attribute__((packed)) sctp_sctphdr_t; | 64 | } __attribute__((packed)) sctp_sctphdr_t; |
65 | 65 | ||
66 | #ifdef __KERNEL__ | 66 | #ifdef __KERNEL__ |
@@ -172,35 +172,35 @@ typedef struct sctp_paramhdr { | |||
172 | typedef enum { | 172 | typedef 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 | */ |
214 | typedef enum { | 214 | typedef 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 | ||
221 | enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), }; | 221 | enum { 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 | */ |
458 | typedef enum { | 458 | typedef 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 9dcf956ad18a..61ce97a8b868 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 |
@@ -135,6 +132,57 @@ struct skb_frag_struct { | |||
135 | __u32 size; | 132 | __u32 size; |
136 | }; | 133 | }; |
137 | 134 | ||
135 | #define HAVE_HW_TIME_STAMP | ||
136 | |||
137 | /** | ||
138 | * skb_shared_hwtstamps - hardware time stamps | ||
139 | * | ||
140 | * @hwtstamp: hardware time stamp transformed into duration | ||
141 | * since arbitrary point in time | ||
142 | * @syststamp: hwtstamp transformed to system time base | ||
143 | * | ||
144 | * Software time stamps generated by ktime_get_real() are stored in | ||
145 | * skb->tstamp. The relation between the different kinds of time | ||
146 | * stamps is as follows: | ||
147 | * | ||
148 | * syststamp and tstamp can be compared against each other in | ||
149 | * arbitrary combinations. The accuracy of a | ||
150 | * syststamp/tstamp/"syststamp from other device" comparison is | ||
151 | * limited by the accuracy of the transformation into system time | ||
152 | * base. This depends on the device driver and its underlying | ||
153 | * hardware. | ||
154 | * | ||
155 | * hwtstamps can only be compared against other hwtstamps from | ||
156 | * the same device. | ||
157 | * | ||
158 | * This structure is attached to packets as part of the | ||
159 | * &skb_shared_info. Use skb_hwtstamps() to get a pointer. | ||
160 | */ | ||
161 | struct skb_shared_hwtstamps { | ||
162 | ktime_t hwtstamp; | ||
163 | ktime_t syststamp; | ||
164 | }; | ||
165 | |||
166 | /** | ||
167 | * skb_shared_tx - instructions for time stamping of outgoing packets | ||
168 | * | ||
169 | * @hardware: generate hardware time stamp | ||
170 | * @software: generate software time stamp | ||
171 | * @in_progress: device driver is going to provide | ||
172 | * hardware time stamp | ||
173 | * | ||
174 | * These flags are attached to packets as part of the | ||
175 | * &skb_shared_info. Use skb_tx() to get a pointer. | ||
176 | */ | ||
177 | union skb_shared_tx { | ||
178 | struct { | ||
179 | __u8 hardware:1, | ||
180 | software:1, | ||
181 | in_progress:1; | ||
182 | }; | ||
183 | __u8 flags; | ||
184 | }; | ||
185 | |||
138 | /* This data is invariant across clones and lives at | 186 | /* This data is invariant across clones and lives at |
139 | * the end of the header data, ie. at skb->end. | 187 | * the end of the header data, ie. at skb->end. |
140 | */ | 188 | */ |
@@ -146,10 +194,12 @@ struct skb_shared_info { | |||
146 | unsigned short gso_segs; | 194 | unsigned short gso_segs; |
147 | unsigned short gso_type; | 195 | unsigned short gso_type; |
148 | __be32 ip6_frag_id; | 196 | __be32 ip6_frag_id; |
197 | union skb_shared_tx tx_flags; | ||
149 | #ifdef CONFIG_HAS_DMA | 198 | #ifdef CONFIG_HAS_DMA |
150 | unsigned int num_dma_maps; | 199 | unsigned int num_dma_maps; |
151 | #endif | 200 | #endif |
152 | struct sk_buff *frag_list; | 201 | struct sk_buff *frag_list; |
202 | struct skb_shared_hwtstamps hwtstamps; | ||
153 | skb_frag_t frags[MAX_SKB_FRAGS]; | 203 | skb_frag_t frags[MAX_SKB_FRAGS]; |
154 | #ifdef CONFIG_HAS_DMA | 204 | #ifdef CONFIG_HAS_DMA |
155 | dma_addr_t dma_maps[MAX_SKB_FRAGS + 1]; | 205 | dma_addr_t dma_maps[MAX_SKB_FRAGS + 1]; |
@@ -459,6 +509,16 @@ static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | |||
459 | /* Internal */ | 509 | /* Internal */ |
460 | #define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB))) | 510 | #define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB))) |
461 | 511 | ||
512 | static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) | ||
513 | { | ||
514 | return &skb_shinfo(skb)->hwtstamps; | ||
515 | } | ||
516 | |||
517 | static inline union skb_shared_tx *skb_tx(struct sk_buff *skb) | ||
518 | { | ||
519 | return &skb_shinfo(skb)->tx_flags; | ||
520 | } | ||
521 | |||
462 | /** | 522 | /** |
463 | * skb_queue_empty - check if a queue is empty | 523 | * skb_queue_empty - check if a queue is empty |
464 | * @list: queue head | 524 | * @list: queue head |
@@ -1278,7 +1338,7 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1278 | * The networking layer reserves some headroom in skb data (via | 1338 | * The networking layer reserves some headroom in skb data (via |
1279 | * dev_alloc_skb). This is used to avoid having to reallocate skb data when | 1339 | * dev_alloc_skb). This is used to avoid having to reallocate skb data when |
1280 | * the header has to grow. In the default case, if the header has to grow | 1340 | * the header has to grow. In the default case, if the header has to grow |
1281 | * 16 bytes or less we avoid the reallocation. | 1341 | * 32 bytes or less we avoid the reallocation. |
1282 | * | 1342 | * |
1283 | * Unfortunately this headroom changes the DMA alignment of the resulting | 1343 | * Unfortunately this headroom changes the DMA alignment of the resulting |
1284 | * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive | 1344 | * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive |
@@ -1286,11 +1346,11 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1286 | * perhaps setting it to a cacheline in size (since that will maintain | 1346 | * perhaps setting it to a cacheline in size (since that will maintain |
1287 | * cacheline alignment of the DMA). It must be a power of 2. | 1347 | * cacheline alignment of the DMA). It must be a power of 2. |
1288 | * | 1348 | * |
1289 | * Various parts of the networking layer expect at least 16 bytes of | 1349 | * Various parts of the networking layer expect at least 32 bytes of |
1290 | * headroom, you should not reduce this. | 1350 | * headroom, you should not reduce this. |
1291 | */ | 1351 | */ |
1292 | #ifndef NET_SKB_PAD | 1352 | #ifndef NET_SKB_PAD |
1293 | #define NET_SKB_PAD 16 | 1353 | #define NET_SKB_PAD 32 |
1294 | #endif | 1354 | #endif |
1295 | 1355 | ||
1296 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | 1356 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); |
@@ -1678,8 +1738,6 @@ extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | |||
1678 | int shiftlen); | 1738 | int shiftlen); |
1679 | 1739 | ||
1680 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); | 1740 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1681 | extern int skb_gro_receive(struct sk_buff **head, | ||
1682 | struct sk_buff *skb); | ||
1683 | 1741 | ||
1684 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1742 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1685 | int len, void *buffer) | 1743 | int len, void *buffer) |
@@ -1726,6 +1784,11 @@ static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb, | |||
1726 | 1784 | ||
1727 | extern void skb_init(void); | 1785 | extern void skb_init(void); |
1728 | 1786 | ||
1787 | static inline ktime_t skb_get_ktime(const struct sk_buff *skb) | ||
1788 | { | ||
1789 | return skb->tstamp; | ||
1790 | } | ||
1791 | |||
1729 | /** | 1792 | /** |
1730 | * skb_get_timestamp - get timestamp from a skb | 1793 | * skb_get_timestamp - get timestamp from a skb |
1731 | * @skb: skb to get stamp from | 1794 | * @skb: skb to get stamp from |
@@ -1735,11 +1798,18 @@ extern void skb_init(void); | |||
1735 | * This function converts the offset back to a struct timeval and stores | 1798 | * This function converts the offset back to a struct timeval and stores |
1736 | * it in stamp. | 1799 | * it in stamp. |
1737 | */ | 1800 | */ |
1738 | static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) | 1801 | static inline void skb_get_timestamp(const struct sk_buff *skb, |
1802 | struct timeval *stamp) | ||
1739 | { | 1803 | { |
1740 | *stamp = ktime_to_timeval(skb->tstamp); | 1804 | *stamp = ktime_to_timeval(skb->tstamp); |
1741 | } | 1805 | } |
1742 | 1806 | ||
1807 | static inline void skb_get_timestampns(const struct sk_buff *skb, | ||
1808 | struct timespec *stamp) | ||
1809 | { | ||
1810 | *stamp = ktime_to_timespec(skb->tstamp); | ||
1811 | } | ||
1812 | |||
1743 | static inline void __net_timestamp(struct sk_buff *skb) | 1813 | static inline void __net_timestamp(struct sk_buff *skb) |
1744 | { | 1814 | { |
1745 | skb->tstamp = ktime_get_real(); | 1815 | skb->tstamp = ktime_get_real(); |
@@ -1755,6 +1825,20 @@ static inline ktime_t net_invalid_timestamp(void) | |||
1755 | return ktime_set(0, 0); | 1825 | return ktime_set(0, 0); |
1756 | } | 1826 | } |
1757 | 1827 | ||
1828 | /** | ||
1829 | * skb_tstamp_tx - queue clone of skb with send time stamps | ||
1830 | * @orig_skb: the original outgoing packet | ||
1831 | * @hwtstamps: hardware time stamps, may be NULL if not available | ||
1832 | * | ||
1833 | * If the skb has a socket associated, then this function clones the | ||
1834 | * skb (thus sharing the actual data and optional structures), stores | ||
1835 | * the optional hardware time stamping information (if non NULL) or | ||
1836 | * generates a software time stamp (otherwise), then queues the clone | ||
1837 | * to the error queue of the socket. Errors are silently ignored. | ||
1838 | */ | ||
1839 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, | ||
1840 | struct skb_shared_hwtstamps *hwtstamps); | ||
1841 | |||
1758 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 1842 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
1759 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 1843 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
1760 | 1844 | ||
@@ -1895,6 +1979,21 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu | |||
1895 | to->queue_mapping = from->queue_mapping; | 1979 | to->queue_mapping = from->queue_mapping; |
1896 | } | 1980 | } |
1897 | 1981 | ||
1982 | static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue) | ||
1983 | { | ||
1984 | skb->queue_mapping = rx_queue + 1; | ||
1985 | } | ||
1986 | |||
1987 | static inline u16 skb_get_rx_queue(struct sk_buff *skb) | ||
1988 | { | ||
1989 | return skb->queue_mapping - 1; | ||
1990 | } | ||
1991 | |||
1992 | static inline bool skb_rx_queue_recorded(struct sk_buff *skb) | ||
1993 | { | ||
1994 | return (skb->queue_mapping != 0); | ||
1995 | } | ||
1996 | |||
1898 | #ifdef CONFIG_XFRM | 1997 | #ifdef CONFIG_XFRM |
1899 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | 1998 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) |
1900 | { | 1999 | { |
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h index 1cbf0313adde..b32725075d71 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/sockios.h b/include/linux/sockios.h index abef7596655a..241f179347d9 100644 --- a/include/linux/sockios.h +++ b/include/linux/sockios.h | |||
@@ -122,6 +122,9 @@ | |||
122 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ | 122 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ |
123 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ | 123 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ |
124 | 124 | ||
125 | /* hardware time stamping: parameters in linux/net_tstamp.h */ | ||
126 | #define SIOCSHWTSTAMP 0x89b0 | ||
127 | |||
125 | /* Device private ioctl calls */ | 128 | /* Device private ioctl calls */ |
126 | 129 | ||
127 | /* | 130 | /* |
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h new file mode 100644 index 000000000000..79506f5f9e67 --- /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 | |||
14 | struct spi_device; | ||
15 | |||
16 | struct 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 7d7e03dcf77c..d3b1d18922f2 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 @@ | |||
353 | struct ssb_device; | 553 | struct ssb_device; |
354 | struct ssb_serial_port; | 554 | struct 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 | */ | ||
559 | struct ssb_chipcommon_pmu { | ||
560 | u8 rev; /* PMU revision */ | ||
561 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ | ||
562 | }; | ||
563 | |||
356 | struct ssb_chipcommon { | 564 | struct 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 | ||
363 | static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) | 572 | static 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 | |||
368 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); | 588 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); |
369 | 589 | ||
370 | extern void ssb_chipco_suspend(struct ssb_chipcommon *cc); | 590 | extern 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 */ | ||
630 | extern 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 99a0f991e850..a01b982b5783 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 */ |
331 | enum { | 367 | enum { |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 39d471d1163b..e76d3b22a466 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 fe77e1499ab7..0cd99e6baca5 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 | ||
71 | enum { | 71 | enum { |
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/timecompare.h b/include/linux/timecompare.h new file mode 100644 index 000000000000..546e2234e4b3 --- /dev/null +++ b/include/linux/timecompare.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * Utility code which helps transforming between two different time | ||
3 | * bases, called "source" and "target" time in this code. | ||
4 | * | ||
5 | * Source time has to be provided via the timecounter API while target | ||
6 | * time is accessed via a function callback whose prototype | ||
7 | * intentionally matches ktime_get() and ktime_get_real(). These | ||
8 | * interfaces where chosen like this so that the code serves its | ||
9 | * initial purpose without additional glue code. | ||
10 | * | ||
11 | * This purpose is synchronizing a hardware clock in a NIC with system | ||
12 | * time, in order to implement the Precision Time Protocol (PTP, | ||
13 | * IEEE1588) with more accurate hardware assisted time stamping. In | ||
14 | * that context only synchronization against system time (= | ||
15 | * ktime_get_real()) is currently needed. But this utility code might | ||
16 | * become useful in other situations, which is why it was written as | ||
17 | * general purpose utility code. | ||
18 | * | ||
19 | * The source timecounter is assumed to return monotonically | ||
20 | * increasing time (but this code does its best to compensate if that | ||
21 | * is not the case) whereas target time may jump. | ||
22 | * | ||
23 | * The target time corresponding to a source time is determined by | ||
24 | * reading target time, reading source time, reading target time | ||
25 | * again, then assuming that average target time corresponds to source | ||
26 | * time. In other words, the assumption is that reading the source | ||
27 | * time is slow and involves equal time for sending the request and | ||
28 | * receiving the reply, whereas reading target time is assumed to be | ||
29 | * fast. | ||
30 | * | ||
31 | * Copyright (C) 2009 Intel Corporation. | ||
32 | * Author: Patrick Ohly <patrick.ohly@intel.com> | ||
33 | * | ||
34 | * This program is free software; you can redistribute it and/or modify it | ||
35 | * under the terms and conditions of the GNU General Public License, | ||
36 | * version 2, as published by the Free Software Foundation. | ||
37 | * | ||
38 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
40 | * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for | ||
41 | * more details. | ||
42 | * | ||
43 | * You should have received a copy of the GNU General Public License along with | ||
44 | * this program; if not, write to the Free Software Foundation, Inc., | ||
45 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
46 | */ | ||
47 | #ifndef _LINUX_TIMECOMPARE_H | ||
48 | #define _LINUX_TIMECOMPARE_H | ||
49 | |||
50 | #include <linux/clocksource.h> | ||
51 | #include <linux/ktime.h> | ||
52 | |||
53 | /** | ||
54 | * struct timecompare - stores state and configuration for the two clocks | ||
55 | * | ||
56 | * Initialize to zero, then set source/target/num_samples. | ||
57 | * | ||
58 | * Transformation between source time and target time is done with: | ||
59 | * target_time = source_time + offset + | ||
60 | * (source_time - last_update) * skew / | ||
61 | * TIMECOMPARE_SKEW_RESOLUTION | ||
62 | * | ||
63 | * @source: used to get source time stamps via timecounter_read() | ||
64 | * @target: function returning target time (for example, ktime_get | ||
65 | * for monotonic time, or ktime_get_real for wall clock) | ||
66 | * @num_samples: number of times that source time and target time are to | ||
67 | * be compared when determining their offset | ||
68 | * @offset: (target time - source time) at the time of the last update | ||
69 | * @skew: average (target time - source time) / delta source time * | ||
70 | * TIMECOMPARE_SKEW_RESOLUTION | ||
71 | * @last_update: last source time stamp when time offset was measured | ||
72 | */ | ||
73 | struct timecompare { | ||
74 | struct timecounter *source; | ||
75 | ktime_t (*target)(void); | ||
76 | int num_samples; | ||
77 | |||
78 | s64 offset; | ||
79 | s64 skew; | ||
80 | u64 last_update; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * timecompare_transform - transform source time stamp into target time base | ||
85 | * @sync: context for time sync | ||
86 | * @source_tstamp: the result of timecounter_read() or | ||
87 | * timecounter_cyc2time() | ||
88 | */ | ||
89 | extern ktime_t timecompare_transform(struct timecompare *sync, | ||
90 | u64 source_tstamp); | ||
91 | |||
92 | /** | ||
93 | * timecompare_offset - measure current (target time - source time) offset | ||
94 | * @sync: context for time sync | ||
95 | * @offset: average offset during sample period returned here | ||
96 | * @source_tstamp: average source time during sample period returned here | ||
97 | * | ||
98 | * Returns number of samples used. Might be zero (= no result) in the | ||
99 | * unlikely case that target time was monotonically decreasing for all | ||
100 | * samples (= broken). | ||
101 | */ | ||
102 | extern int timecompare_offset(struct timecompare *sync, | ||
103 | s64 *offset, | ||
104 | u64 *source_tstamp); | ||
105 | |||
106 | extern void __timecompare_update(struct timecompare *sync, | ||
107 | u64 source_tstamp); | ||
108 | |||
109 | /** | ||
110 | * timecompare_update - update offset and skew by measuring current offset | ||
111 | * @sync: context for time sync | ||
112 | * @source_tstamp: the result of timecounter_read() or | ||
113 | * timecounter_cyc2time(), pass zero to force update | ||
114 | * | ||
115 | * Updates are only done at most once per second. | ||
116 | */ | ||
117 | static inline void timecompare_update(struct timecompare *sync, | ||
118 | u64 source_tstamp) | ||
119 | { | ||
120 | if (!source_tstamp || | ||
121 | (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC) | ||
122 | __timecompare_update(sync, source_tstamp); | ||
123 | } | ||
124 | |||
125 | #endif /* _LINUX_TIMECOMPARE_H */ | ||
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 0a6e6d4b929a..37836b937d97 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 | ||
95 | struct rndis_data_hdr { | 92 | struct 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 3efa86c3ecb3..242348bb3766 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 | ||
26 | struct virtio_net_config | 32 | struct 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 | */ | ||
72 | struct virtio_net_ctrl_hdr { | ||
73 | __u8 class; | ||
74 | __u8 cmd; | ||
75 | } __attribute__((packed)); | ||
76 | |||
77 | typedef __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 | */ | ||
107 | struct 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 d7958f9b52cb..cb24204851f7 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 b5a51a7bb364..467c531b8a7e 100644 --- a/include/net/atmclip.h +++ b/include/net/atmclip.h | |||
@@ -50,7 +50,6 @@ struct atmarp_entry { | |||
50 | struct clip_priv { | 50 | struct 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 23c0ab74ded6..c0d1f5b708c5 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 | */ |
116 | enum station_flags { | 121 | enum 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 | */ | ||
371 | enum 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 | */ | ||
400 | struct 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 | |||
358 | struct ieee80211_freq_range { | 409 | struct 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 | */ | ||
499 | struct 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 */ |
435 | struct wiphy; | 506 | struct wiphy; |
436 | 507 | ||
@@ -438,6 +509,85 @@ struct wiphy; | |||
438 | struct ieee80211_channel; | 509 | struct ieee80211_channel; |
439 | 510 | ||
440 | /** | 511 | /** |
512 | * struct cfg80211_ssid - SSID description | ||
513 | * @ssid: the SSID | ||
514 | * @ssid_len: length of the ssid | ||
515 | */ | ||
516 | struct 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 | */ | ||
531 | struct 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 | */ | ||
549 | enum 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 | */ | ||
573 | struct 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 | */ |
501 | struct cfg80211_ops { | 663 | struct 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); |
575 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | 750 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, |
576 | u32 *mode, char *extra); | 751 | u32 *mode, char *extra); |
752 | int cfg80211_wext_siwscan(struct net_device *dev, | ||
753 | struct iw_request_info *info, | ||
754 | union iwreq_data *wrqu, char *extra); | ||
755 | int 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 | */ | ||
766 | void 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 | */ | ||
778 | struct cfg80211_bss* | ||
779 | cfg80211_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 | |||
785 | struct 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); | ||
790 | static inline struct cfg80211_bss * | ||
791 | cfg80211_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 | |||
799 | struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy, | ||
800 | struct ieee80211_channel *channel, | ||
801 | const u8 *meshid, size_t meshidlen, | ||
802 | const u8 *meshcfg); | ||
803 | void 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 | */ | ||
814 | void 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 7040a782c656..9b5d08f4f6e8 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) | |||
113 | static inline int INET_ECN_set_ce(struct sk_buff *skb) | 113 | static 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 d0a043153cc6..a44e2248b2ef 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 | ||
155 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | 157 | static inline struct inet_ehash_bucket *inet_ehash_bucket( |
diff --git a/include/net/ip.h b/include/net/ip.h index 10868139e656..4ac7577f98d0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -55,6 +55,7 @@ struct ipcm_cookie | |||
55 | __be32 addr; | 55 | __be32 addr; |
56 | int oif; | 56 | int oif; |
57 | struct ip_options *opt; | 57 | struct ip_options *opt; |
58 | union skb_shared_tx shtx; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 61 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ab9b003ab671..bbae1e87efcd 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 6d5b58a1c743..c1f16fc49ade 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 | ||
202 | struct ipv6_fl_socklist | 202 | struct ipv6_fl_socklist |
203 | { | 203 | { |
diff --git a/include/net/ipx.h b/include/net/ipx.h index 4cc0b4eca948..a14121dd1932 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -27,7 +27,7 @@ struct ipx_address { | |||
27 | 27 | ||
28 | struct ipxhdr { | 28 | struct 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 559422fc0943..88fa3e03e3e9 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 | */ | ||
265 | enum mac80211_rate_control_flags { | 285 | enum 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 | ||
510 | struct 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 | */ |
528 | enum ieee80211_conf_changed { | 543 | enum 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 { | |||
559 | struct ieee80211_conf { | 575 | struct 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 | */ |
634 | enum ieee80211_if_conf_change { | 651 | enum 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 | */ |
648 | struct ieee80211_if_conf { | 668 | struct 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 | */ |
659 | enum ieee80211_key_alg { | 681 | enum 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 | */ |
692 | enum ieee80211_key_flags { | 718 | enum 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 | */ |
720 | struct ieee80211_key_conf { | 747 | struct 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 | */ |
761 | struct ieee80211_sta { | 788 | struct 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 | */ |
862 | enum ieee80211_hw_flags { | 892 | enum 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 | */ | ||
996 | struct 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 | */ |
1290 | struct ieee80211_ops { | 1381 | struct 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 | */ |
1756 | void ieee80211_scan_completed(struct ieee80211_hw *hw); | 1850 | void 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, | |||
1962 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 2056 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
1963 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 2057 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
1964 | 2058 | ||
2059 | static inline bool | ||
2060 | conf_is_ht20(struct ieee80211_conf *conf) | ||
2061 | { | ||
2062 | return conf->channel_type == NL80211_CHAN_HT20; | ||
2063 | } | ||
2064 | |||
2065 | static inline bool | ||
2066 | conf_is_ht40_minus(struct ieee80211_conf *conf) | ||
2067 | { | ||
2068 | return conf->channel_type == NL80211_CHAN_HT40MINUS; | ||
2069 | } | ||
2070 | |||
2071 | static inline bool | ||
2072 | conf_is_ht40_plus(struct ieee80211_conf *conf) | ||
2073 | { | ||
2074 | return conf->channel_type == NL80211_CHAN_HT40PLUS; | ||
2075 | } | ||
2076 | |||
2077 | static inline bool | ||
2078 | conf_is_ht40(struct ieee80211_conf *conf) | ||
2079 | { | ||
2080 | return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf); | ||
2081 | } | ||
2082 | |||
2083 | static inline bool | ||
2084 | conf_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/net_namespace.h b/include/net/net_namespace.h index 6fc13d905c5f..ded434b032a4 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -109,11 +109,6 @@ extern struct list_head net_namespace_list; | |||
109 | #ifdef CONFIG_NET_NS | 109 | #ifdef CONFIG_NET_NS |
110 | extern void __put_net(struct net *net); | 110 | extern void __put_net(struct net *net); |
111 | 111 | ||
112 | static inline int net_alive(struct net *net) | ||
113 | { | ||
114 | return net && atomic_read(&net->count); | ||
115 | } | ||
116 | |||
117 | static inline struct net *get_net(struct net *net) | 112 | static inline struct net *get_net(struct net *net) |
118 | { | 113 | { |
119 | atomic_inc(&net->count); | 114 | atomic_inc(&net->count); |
@@ -145,11 +140,6 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
145 | } | 140 | } |
146 | #else | 141 | #else |
147 | 142 | ||
148 | static inline int net_alive(struct net *net) | ||
149 | { | ||
150 | return 1; | ||
151 | } | ||
152 | |||
153 | static inline struct net *get_net(struct net *net) | 143 | static inline struct net *get_net(struct net *net) |
154 | { | 144 | { |
155 | return net; | 145 | return net; |
@@ -234,6 +224,23 @@ struct pernet_operations { | |||
234 | void (*exit)(struct net *net); | 224 | void (*exit)(struct net *net); |
235 | }; | 225 | }; |
236 | 226 | ||
227 | /* | ||
228 | * Use these carefully. If you implement a network device and it | ||
229 | * needs per network namespace operations use device pernet operations, | ||
230 | * otherwise use pernet subsys operations. | ||
231 | * | ||
232 | * This is critically important. Most of the network code cleanup | ||
233 | * runs with the assumption that dev_remove_pack has been called so no | ||
234 | * new packets will arrive during and after the cleanup functions have | ||
235 | * been called. dev_remove_pack is not per namespace so instead the | ||
236 | * guarantee of no more packets arriving in a network namespace is | ||
237 | * provided by ensuring that all network devices and all sockets have | ||
238 | * left the network namespace before the cleanup methods are called. | ||
239 | * | ||
240 | * For the longest time the ipv4 icmp code was registered as a pernet | ||
241 | * device which caused kernel oops, and panics during network | ||
242 | * namespace cleanup. So please don't get this wrong. | ||
243 | */ | ||
237 | extern int register_pernet_subsys(struct pernet_operations *); | 244 | extern int register_pernet_subsys(struct pernet_operations *); |
238 | extern void unregister_pernet_subsys(struct pernet_operations *); | 245 | extern void unregister_pernet_subsys(struct pernet_operations *); |
239 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); | 246 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 977f482d97a9..2eb3814d6258 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 f06852bba62a..15696b1fd30f 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 | ||
62 | struct nr_private { | ||
63 | struct net_device_stats stats; | ||
64 | }; | ||
65 | |||
66 | struct nr_sock { | 62 | struct 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 057b0a8a2885..d43f71b5ec00 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 | ||
106 | int phonet_sysctl_init(void); | 106 | int phonet_sysctl_init(void); |
107 | void phonet_sysctl_exit(void); | 107 | void phonet_sysctl_exit(void); |
108 | void phonet_netlink_register(void); | ||
109 | int isi_register(void); | 108 | int isi_register(void); |
110 | void isi_unregister(void); | 109 | void isi_unregister(void); |
111 | 110 | ||
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index aa1c59a1d33f..5054dc5ea2c2 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 | ||
31 | extern struct phonet_device_list pndevs; | 31 | struct phonet_device_list *phonet_device_list(struct net *net); |
32 | 32 | ||
33 | struct phonet_device { | 33 | struct 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 | ||
39 | void phonet_device_init(void); | 39 | int phonet_device_init(void); |
40 | void phonet_device_exit(void); | 40 | void phonet_device_exit(void); |
41 | int phonet_netlink_register(void); | ||
41 | struct net_device *phonet_device_get(struct net *net); | 42 | struct net_device *phonet_device_get(struct net *net); |
42 | 43 | ||
43 | int phonet_address_add(struct net_device *dev, u8 addr); | 44 | int phonet_address_add(struct net_device *dev, u8 addr); |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 4082f39f5079..e37fe3129c17 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); |
86 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 86 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
87 | extern void qdisc_put_stab(struct qdisc_size_table *tab); | 87 | extern void qdisc_put_stab(struct qdisc_size_table *tab); |
88 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); | ||
88 | 89 | ||
89 | extern void __qdisc_run(struct Qdisc *q); | 90 | extern void __qdisc_run(struct Qdisc *q); |
90 | 91 | ||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f8c47429044a..3d78a4d22460 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/sctp/checksum.h b/include/net/sctp/checksum.h index 2fec3c366e81..befc8d2a1b9f 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -46,14 +46,14 @@ | |||
46 | #include <net/sctp/sctp.h> | 46 | #include <net/sctp/sctp.h> |
47 | #include <linux/crc32c.h> | 47 | #include <linux/crc32c.h> |
48 | 48 | ||
49 | static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length) | 49 | static inline __u32 sctp_crc32c(__u32 crc, u8 *buffer, u16 length) |
50 | { | 50 | { |
51 | return (__force __be32)crc32c((__force u32)crc, buffer, length); | 51 | return crc32c(crc, buffer, length); |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | 54 | static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) |
55 | { | 55 | { |
56 | __be32 crc = ~cpu_to_be32(0); | 56 | __u32 crc = ~(__u32)0; |
57 | __u8 zero[sizeof(__u32)] = {0}; | 57 | __u8 zero[sizeof(__u32)] = {0}; |
58 | 58 | ||
59 | /* Optimize this routine to be SCTP specific, knowing how | 59 | /* Optimize this routine to be SCTP specific, knowing how |
@@ -72,12 +72,12 @@ static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | |||
72 | return crc; | 72 | return crc; |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) | 75 | static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) |
76 | { | 76 | { |
77 | return sctp_crc32c(crc32, buffer, length); | 77 | return sctp_crc32c(crc32, buffer, length); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline __be32 sctp_end_cksum(__be32 crc32) | 80 | static inline __le32 sctp_end_cksum(__be32 crc32) |
81 | { | 81 | { |
82 | return (__force __be32)~cpu_to_le32((__force u32)crc32); | 82 | return cpu_to_le32(~crc32); |
83 | } | 83 | } |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index bbb7742195b0..9e226be3be69 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -138,6 +138,8 @@ void sctp_write_space(struct sock *sk); | |||
138 | unsigned int sctp_poll(struct file *file, struct socket *sock, | 138 | unsigned int sctp_poll(struct file *file, struct socket *sock, |
139 | poll_table *wait); | 139 | poll_table *wait); |
140 | void sctp_sock_rfree(struct sk_buff *skb); | 140 | void sctp_sock_rfree(struct sk_buff *skb); |
141 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, | ||
142 | struct sctp_association *asoc); | ||
141 | extern struct percpu_counter sctp_sockets_allocated; | 143 | extern struct percpu_counter sctp_sockets_allocated; |
142 | 144 | ||
143 | /* | 145 | /* |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 9661d7b765f0..23f08fe1d50a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -218,6 +218,10 @@ extern struct sctp_globals { | |||
218 | 218 | ||
219 | /* Flag to idicate if SCTP-AUTH is enabled */ | 219 | /* Flag to idicate if SCTP-AUTH is enabled */ |
220 | int auth_enable; | 220 | int auth_enable; |
221 | |||
222 | /* Flag to indicate whether computing and verifying checksum | ||
223 | * is disabled. */ | ||
224 | int checksum_disable; | ||
221 | } sctp_globals; | 225 | } sctp_globals; |
222 | 226 | ||
223 | #define sctp_rto_initial (sctp_globals.rto_initial) | 227 | #define sctp_rto_initial (sctp_globals.rto_initial) |
@@ -252,6 +256,7 @@ extern struct sctp_globals { | |||
252 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) | 256 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) |
253 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 257 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
254 | #define sctp_auth_enable (sctp_globals.auth_enable) | 258 | #define sctp_auth_enable (sctp_globals.auth_enable) |
259 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | ||
255 | 260 | ||
256 | /* SCTP Socket type: UDP or TCP style. */ | 261 | /* SCTP Socket type: UDP or TCP style. */ |
257 | typedef enum { | 262 | typedef enum { |
@@ -905,8 +910,10 @@ struct sctp_transport { | |||
905 | * should be set. Every time the RTT | 910 | * should be set. Every time the RTT |
906 | * calculation completes (i.e. the DATA chunk | 911 | * calculation completes (i.e. the DATA chunk |
907 | * is SACK'd) clear this flag. | 912 | * is SACK'd) clear this flag. |
913 | * hb_sent : a flag that signals that we have a pending heartbeat. | ||
908 | */ | 914 | */ |
909 | __u8 rto_pending; | 915 | __u8 rto_pending; |
916 | __u8 hb_sent; | ||
910 | 917 | ||
911 | /* Flag to track the current fast recovery state */ | 918 | /* Flag to track the current fast recovery state */ |
912 | __u8 fast_recovery; | 919 | __u8 fast_recovery; |
diff --git a/include/net/sock.h b/include/net/sock.h index eefeeaf7fc46..4bb1ff9fd15b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -158,7 +158,7 @@ struct sock_common { | |||
158 | * @sk_allocation: allocation mode | 158 | * @sk_allocation: allocation mode |
159 | * @sk_sndbuf: size of send buffer in bytes | 159 | * @sk_sndbuf: size of send buffer in bytes |
160 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, | 160 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, |
161 | * %SO_OOBINLINE settings | 161 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings |
162 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 162 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
163 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 163 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
164 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) | 164 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) |
@@ -488,6 +488,13 @@ enum sock_flags { | |||
488 | SOCK_RCVTSTAMPNS, /* %SO_TIMESTAMPNS setting */ | 488 | SOCK_RCVTSTAMPNS, /* %SO_TIMESTAMPNS setting */ |
489 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ | 489 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ |
490 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 490 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
491 | SOCK_TIMESTAMPING_TX_HARDWARE, /* %SOF_TIMESTAMPING_TX_HARDWARE */ | ||
492 | SOCK_TIMESTAMPING_TX_SOFTWARE, /* %SOF_TIMESTAMPING_TX_SOFTWARE */ | ||
493 | SOCK_TIMESTAMPING_RX_HARDWARE, /* %SOF_TIMESTAMPING_RX_HARDWARE */ | ||
494 | SOCK_TIMESTAMPING_RX_SOFTWARE, /* %SOF_TIMESTAMPING_RX_SOFTWARE */ | ||
495 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ | ||
496 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ | ||
497 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ | ||
491 | }; | 498 | }; |
492 | 499 | ||
493 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 500 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
@@ -944,6 +951,11 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |||
944 | unsigned long size, | 951 | unsigned long size, |
945 | int noblock, | 952 | int noblock, |
946 | int *errcode); | 953 | int *errcode); |
954 | extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, | ||
955 | unsigned long header_len, | ||
956 | unsigned long data_len, | ||
957 | int noblock, | ||
958 | int *errcode); | ||
947 | extern void *sock_kmalloc(struct sock *sk, int size, | 959 | extern void *sock_kmalloc(struct sock *sk, int size, |
948 | gfp_t priority); | 960 | gfp_t priority); |
949 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 961 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
@@ -1340,14 +1352,45 @@ static __inline__ void | |||
1340 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 1352 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
1341 | { | 1353 | { |
1342 | ktime_t kt = skb->tstamp; | 1354 | ktime_t kt = skb->tstamp; |
1355 | struct skb_shared_hwtstamps *hwtstamps = skb_hwtstamps(skb); | ||
1343 | 1356 | ||
1344 | if (sock_flag(sk, SOCK_RCVTSTAMP)) | 1357 | /* |
1358 | * generate control messages if | ||
1359 | * - receive time stamping in software requested (SOCK_RCVTSTAMP | ||
1360 | * or SOCK_TIMESTAMPING_RX_SOFTWARE) | ||
1361 | * - software time stamp available and wanted | ||
1362 | * (SOCK_TIMESTAMPING_SOFTWARE) | ||
1363 | * - hardware time stamps available and wanted | ||
1364 | * (SOCK_TIMESTAMPING_SYS_HARDWARE or | ||
1365 | * SOCK_TIMESTAMPING_RAW_HARDWARE) | ||
1366 | */ | ||
1367 | if (sock_flag(sk, SOCK_RCVTSTAMP) || | ||
1368 | sock_flag(sk, SOCK_TIMESTAMPING_RX_SOFTWARE) || | ||
1369 | (kt.tv64 && sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE)) || | ||
1370 | (hwtstamps->hwtstamp.tv64 && | ||
1371 | sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE)) || | ||
1372 | (hwtstamps->syststamp.tv64 && | ||
1373 | sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE))) | ||
1345 | __sock_recv_timestamp(msg, sk, skb); | 1374 | __sock_recv_timestamp(msg, sk, skb); |
1346 | else | 1375 | else |
1347 | sk->sk_stamp = kt; | 1376 | sk->sk_stamp = kt; |
1348 | } | 1377 | } |
1349 | 1378 | ||
1350 | /** | 1379 | /** |
1380 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | ||
1381 | * @msg: outgoing packet | ||
1382 | * @sk: socket sending this packet | ||
1383 | * @shtx: filled with instructions for time stamping | ||
1384 | * | ||
1385 | * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if | ||
1386 | * parameters are invalid. | ||
1387 | */ | ||
1388 | extern int sock_tx_timestamp(struct msghdr *msg, | ||
1389 | struct sock *sk, | ||
1390 | union skb_shared_tx *shtx); | ||
1391 | |||
1392 | |||
1393 | /** | ||
1351 | * sk_eat_skb - Release a skb if it is no longer needed | 1394 | * sk_eat_skb - Release a skb if it is no longer needed |
1352 | * @sk: socket to eat this skb from | 1395 | * @sk: socket to eat this skb from |
1353 | * @skb: socket buffer to eat | 1396 | * @skb: socket buffer to eat |
@@ -1415,7 +1458,7 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb) | |||
1415 | return NULL; | 1458 | return NULL; |
1416 | } | 1459 | } |
1417 | 1460 | ||
1418 | extern void sock_enable_timestamp(struct sock *sk); | 1461 | extern void sock_enable_timestamp(struct sock *sk, int flag); |
1419 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 1462 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |
1420 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); | 1463 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); |
1421 | 1464 | ||
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 876b6f2bb4fd..bfb240c6cf79 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 21c5d966142d..1c6285eb1666 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 | */ |
191 | struct wiphy { | 204 | struct 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 | */ |
362 | struct ieee80211_rate * | 382 | struct ieee80211_rate * |
363 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, | 383 | ieee80211_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); | |||
395 | extern void regulatory_hint_11d(struct wiphy *wiphy, | 415 | extern 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 | */ | ||
431 | extern 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 | */ | ||
456 | extern 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 936e333e7ce5..c179318edd92 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 | ||
393 | enum ib_ah_flags { | 393 | enum ib_ah_flags { |
394 | IB_AH_GRH = 1 | 394 | IB_AH_GRH = 1 |