diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-25 10:40:14 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-25 10:40:14 -0400 |
commit | ff877ea80efa2015b6263766f78ee42c2a1b32f9 (patch) | |
tree | 85205005c611ab774702148558321c6fb92f1ccd /include/net | |
parent | 30821fee4f0cb3e6d241d9f7ddc37742212e3eb7 (diff) | |
parent | d37e6bf68fc1eb34a4ad21d9ae8890ed37ea80e7 (diff) |
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Diffstat (limited to 'include/net')
53 files changed, 1085 insertions, 603 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index bbd3d583c6e6..06b28142b3ab 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -121,7 +121,8 @@ static inline int addrconf_finite_timeout(unsigned long timeout) | |||
121 | */ | 121 | */ |
122 | extern int ipv6_addr_label_init(void); | 122 | extern int ipv6_addr_label_init(void); |
123 | extern void ipv6_addr_label_rtnl_register(void); | 123 | extern void ipv6_addr_label_rtnl_register(void); |
124 | extern u32 ipv6_addr_label(const struct in6_addr *addr, | 124 | extern u32 ipv6_addr_label(struct net *net, |
125 | const struct in6_addr *addr, | ||
125 | int type, int ifindex); | 126 | int type, int ifindex); |
126 | 127 | ||
127 | /* | 128 | /* |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 750648df13f4..6f8418bf4241 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -121,6 +121,7 @@ void bt_sock_link(struct bt_sock_list *l, struct sock *s); | |||
121 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 121 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
122 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); | 122 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); |
123 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 123 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); |
124 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | ||
124 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 125 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
125 | 126 | ||
126 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); | 127 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index a8a9eb6af966..3cc294919312 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -72,8 +72,6 @@ enum { | |||
72 | HCI_INQUIRY, | 72 | HCI_INQUIRY, |
73 | 73 | ||
74 | HCI_RAW, | 74 | HCI_RAW, |
75 | |||
76 | HCI_SECMGR | ||
77 | }; | 75 | }; |
78 | 76 | ||
79 | /* HCI ioctl defines */ | 77 | /* HCI ioctl defines */ |
@@ -86,6 +84,7 @@ enum { | |||
86 | #define HCIGETDEVINFO _IOR('H', 211, int) | 84 | #define HCIGETDEVINFO _IOR('H', 211, int) |
87 | #define HCIGETCONNLIST _IOR('H', 212, int) | 85 | #define HCIGETCONNLIST _IOR('H', 212, int) |
88 | #define HCIGETCONNINFO _IOR('H', 213, int) | 86 | #define HCIGETCONNINFO _IOR('H', 213, int) |
87 | #define HCIGETAUTHINFO _IOR('H', 215, int) | ||
89 | 88 | ||
90 | #define HCISETRAW _IOW('H', 220, int) | 89 | #define HCISETRAW _IOW('H', 220, int) |
91 | #define HCISETSCAN _IOW('H', 221, int) | 90 | #define HCISETSCAN _IOW('H', 221, int) |
@@ -97,8 +96,6 @@ enum { | |||
97 | #define HCISETACLMTU _IOW('H', 227, int) | 96 | #define HCISETACLMTU _IOW('H', 227, int) |
98 | #define HCISETSCOMTU _IOW('H', 228, int) | 97 | #define HCISETSCOMTU _IOW('H', 228, int) |
99 | 98 | ||
100 | #define HCISETSECMGR _IOW('H', 230, int) | ||
101 | |||
102 | #define HCIINQUIRY _IOR('H', 240, int) | 99 | #define HCIINQUIRY _IOR('H', 240, int) |
103 | 100 | ||
104 | /* HCI timeouts */ | 101 | /* HCI timeouts */ |
@@ -137,6 +134,8 @@ enum { | |||
137 | #define ESCO_EV4 0x0010 | 134 | #define ESCO_EV4 0x0010 |
138 | #define ESCO_EV5 0x0020 | 135 | #define ESCO_EV5 0x0020 |
139 | 136 | ||
137 | #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) | ||
138 | |||
140 | /* ACL flags */ | 139 | /* ACL flags */ |
141 | #define ACL_CONT 0x01 | 140 | #define ACL_CONT 0x01 |
142 | #define ACL_START 0x02 | 141 | #define ACL_START 0x02 |
@@ -178,6 +177,8 @@ enum { | |||
178 | 177 | ||
179 | #define LMP_SNIFF_SUBR 0x02 | 178 | #define LMP_SNIFF_SUBR 0x02 |
180 | 179 | ||
180 | #define LMP_SIMPLE_PAIR 0x08 | ||
181 | |||
181 | /* Connection modes */ | 182 | /* Connection modes */ |
182 | #define HCI_CM_ACTIVE 0x0000 | 183 | #define HCI_CM_ACTIVE 0x0000 |
183 | #define HCI_CM_HOLD 0x0001 | 184 | #define HCI_CM_HOLD 0x0001 |
@@ -199,6 +200,14 @@ enum { | |||
199 | #define HCI_LM_RELIABLE 0x0010 | 200 | #define HCI_LM_RELIABLE 0x0010 |
200 | #define HCI_LM_SECURE 0x0020 | 201 | #define HCI_LM_SECURE 0x0020 |
201 | 202 | ||
203 | /* Authentication types */ | ||
204 | #define HCI_AT_NO_BONDING 0x00 | ||
205 | #define HCI_AT_NO_BONDING_MITM 0x01 | ||
206 | #define HCI_AT_DEDICATED_BONDING 0x02 | ||
207 | #define HCI_AT_DEDICATED_BONDING_MITM 0x03 | ||
208 | #define HCI_AT_GENERAL_BONDING 0x04 | ||
209 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | ||
210 | |||
202 | /* ----- HCI Commands ---- */ | 211 | /* ----- HCI Commands ---- */ |
203 | #define HCI_OP_INQUIRY 0x0401 | 212 | #define HCI_OP_INQUIRY 0x0401 |
204 | struct hci_cp_inquiry { | 213 | struct hci_cp_inquiry { |
@@ -402,6 +411,17 @@ struct hci_rp_write_link_policy { | |||
402 | __le16 handle; | 411 | __le16 handle; |
403 | } __attribute__ ((packed)); | 412 | } __attribute__ ((packed)); |
404 | 413 | ||
414 | #define HCI_OP_READ_DEF_LINK_POLICY 0x080e | ||
415 | struct hci_rp_read_def_link_policy { | ||
416 | __u8 status; | ||
417 | __le16 policy; | ||
418 | } __attribute__ ((packed)); | ||
419 | |||
420 | #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f | ||
421 | struct hci_cp_write_def_link_policy { | ||
422 | __le16 policy; | ||
423 | } __attribute__ ((packed)); | ||
424 | |||
405 | #define HCI_OP_SNIFF_SUBRATE 0x0811 | 425 | #define HCI_OP_SNIFF_SUBRATE 0x0811 |
406 | struct hci_cp_sniff_subrate { | 426 | struct hci_cp_sniff_subrate { |
407 | __le16 handle; | 427 | __le16 handle; |
@@ -501,6 +521,17 @@ struct hci_cp_host_buffer_size { | |||
501 | __le16 sco_max_pkt; | 521 | __le16 sco_max_pkt; |
502 | } __attribute__ ((packed)); | 522 | } __attribute__ ((packed)); |
503 | 523 | ||
524 | #define HCI_OP_READ_SSP_MODE 0x0c55 | ||
525 | struct hci_rp_read_ssp_mode { | ||
526 | __u8 status; | ||
527 | __u8 mode; | ||
528 | } __attribute__ ((packed)); | ||
529 | |||
530 | #define HCI_OP_WRITE_SSP_MODE 0x0c56 | ||
531 | struct hci_cp_write_ssp_mode { | ||
532 | __u8 mode; | ||
533 | } __attribute__ ((packed)); | ||
534 | |||
504 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 535 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
505 | struct hci_rp_read_local_version { | 536 | struct hci_rp_read_local_version { |
506 | __u8 status; | 537 | __u8 status; |
@@ -696,6 +727,13 @@ struct hci_ev_clock_offset { | |||
696 | __le16 clock_offset; | 727 | __le16 clock_offset; |
697 | } __attribute__ ((packed)); | 728 | } __attribute__ ((packed)); |
698 | 729 | ||
730 | #define HCI_EV_PKT_TYPE_CHANGE 0x1d | ||
731 | struct hci_ev_pkt_type_change { | ||
732 | __u8 status; | ||
733 | __le16 handle; | ||
734 | __le16 pkt_type; | ||
735 | } __attribute__ ((packed)); | ||
736 | |||
699 | #define HCI_EV_PSCAN_REP_MODE 0x20 | 737 | #define HCI_EV_PSCAN_REP_MODE 0x20 |
700 | struct hci_ev_pscan_rep_mode { | 738 | struct hci_ev_pscan_rep_mode { |
701 | bdaddr_t bdaddr; | 739 | bdaddr_t bdaddr; |
@@ -774,6 +812,23 @@ struct extended_inquiry_info { | |||
774 | __u8 data[240]; | 812 | __u8 data[240]; |
775 | } __attribute__ ((packed)); | 813 | } __attribute__ ((packed)); |
776 | 814 | ||
815 | #define HCI_EV_IO_CAPA_REQUEST 0x31 | ||
816 | struct hci_ev_io_capa_request { | ||
817 | bdaddr_t bdaddr; | ||
818 | } __attribute__ ((packed)); | ||
819 | |||
820 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | ||
821 | struct hci_ev_simple_pair_complete { | ||
822 | __u8 status; | ||
823 | bdaddr_t bdaddr; | ||
824 | } __attribute__ ((packed)); | ||
825 | |||
826 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d | ||
827 | struct hci_ev_remote_host_features { | ||
828 | bdaddr_t bdaddr; | ||
829 | __u8 features[8]; | ||
830 | } __attribute__ ((packed)); | ||
831 | |||
777 | /* Internal events generated by Bluetooth stack */ | 832 | /* Internal events generated by Bluetooth stack */ |
778 | #define HCI_EV_STACK_INTERNAL 0xfd | 833 | #define HCI_EV_STACK_INTERNAL 0xfd |
779 | struct hci_ev_stack_internal { | 834 | struct hci_ev_stack_internal { |
@@ -951,6 +1006,11 @@ struct hci_conn_info_req { | |||
951 | struct hci_conn_info conn_info[0]; | 1006 | struct hci_conn_info conn_info[0]; |
952 | }; | 1007 | }; |
953 | 1008 | ||
1009 | struct hci_auth_info_req { | ||
1010 | bdaddr_t bdaddr; | ||
1011 | __u8 type; | ||
1012 | }; | ||
1013 | |||
954 | struct hci_inquiry_req { | 1014 | struct hci_inquiry_req { |
955 | __u16 dev_id; | 1015 | __u16 dev_id; |
956 | __u16 flags; | 1016 | __u16 flags; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ea13baa3851b..cbf751094688 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -40,6 +40,7 @@ struct inquiry_data { | |||
40 | __u8 dev_class[3]; | 40 | __u8 dev_class[3]; |
41 | __le16 clock_offset; | 41 | __le16 clock_offset; |
42 | __s8 rssi; | 42 | __s8 rssi; |
43 | __u8 ssp_mode; | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | struct inquiry_entry { | 46 | struct inquiry_entry { |
@@ -75,6 +76,7 @@ struct hci_dev { | |||
75 | __u8 dev_class[3]; | 76 | __u8 dev_class[3]; |
76 | __u8 features[8]; | 77 | __u8 features[8]; |
77 | __u8 commands[64]; | 78 | __u8 commands[64]; |
79 | __u8 ssp_mode; | ||
78 | __u8 hci_ver; | 80 | __u8 hci_ver; |
79 | __u16 hci_rev; | 81 | __u16 hci_rev; |
80 | __u16 manufacturer; | 82 | __u16 manufacturer; |
@@ -161,9 +163,12 @@ struct hci_conn { | |||
161 | __u8 attempt; | 163 | __u8 attempt; |
162 | __u8 dev_class[3]; | 164 | __u8 dev_class[3]; |
163 | __u8 features[8]; | 165 | __u8 features[8]; |
166 | __u8 ssp_mode; | ||
164 | __u16 interval; | 167 | __u16 interval; |
168 | __u16 pkt_type; | ||
165 | __u16 link_policy; | 169 | __u16 link_policy; |
166 | __u32 link_mode; | 170 | __u32 link_mode; |
171 | __u8 auth_type; | ||
167 | __u8 power_save; | 172 | __u8 power_save; |
168 | unsigned long pend; | 173 | unsigned long pend; |
169 | 174 | ||
@@ -344,7 +349,7 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
344 | if (conn->state == BT_CONNECTED) { | 349 | if (conn->state == BT_CONNECTED) { |
345 | timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); | 350 | timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); |
346 | if (!conn->out) | 351 | if (!conn->out) |
347 | timeo *= 2; | 352 | timeo *= 5; |
348 | } else | 353 | } else |
349 | timeo = msecs_to_jiffies(10); | 354 | timeo = msecs_to_jiffies(10); |
350 | } else | 355 | } else |
@@ -418,6 +423,7 @@ int hci_get_dev_list(void __user *arg); | |||
418 | int hci_get_dev_info(void __user *arg); | 423 | int hci_get_dev_info(void __user *arg); |
419 | int hci_get_conn_list(void __user *arg); | 424 | int hci_get_conn_list(void __user *arg); |
420 | int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | 425 | int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); |
426 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | ||
421 | int hci_inquiry(void __user *arg); | 427 | int hci_inquiry(void __user *arg); |
422 | 428 | ||
423 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 429 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
@@ -459,6 +465,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
459 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 465 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
460 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 466 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) |
461 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 467 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
468 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | ||
462 | 469 | ||
463 | /* ----- HCI protocols ----- */ | 470 | /* ----- HCI protocols ----- */ |
464 | struct hci_proto { | 471 | struct hci_proto { |
@@ -474,7 +481,7 @@ struct hci_proto { | |||
474 | int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); | 481 | int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); |
475 | int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); | 482 | int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); |
476 | int (*auth_cfm) (struct hci_conn *conn, __u8 status); | 483 | int (*auth_cfm) (struct hci_conn *conn, __u8 status); |
477 | int (*encrypt_cfm) (struct hci_conn *conn, __u8 status); | 484 | int (*encrypt_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); |
478 | }; | 485 | }; |
479 | 486 | ||
480 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | 487 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) |
@@ -532,17 +539,17 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status) | |||
532 | hp->auth_cfm(conn, status); | 539 | hp->auth_cfm(conn, status); |
533 | } | 540 | } |
534 | 541 | ||
535 | static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status) | 542 | static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) |
536 | { | 543 | { |
537 | register struct hci_proto *hp; | 544 | register struct hci_proto *hp; |
538 | 545 | ||
539 | hp = hci_proto[HCI_PROTO_L2CAP]; | 546 | hp = hci_proto[HCI_PROTO_L2CAP]; |
540 | if (hp && hp->encrypt_cfm) | 547 | if (hp && hp->encrypt_cfm) |
541 | hp->encrypt_cfm(conn, status); | 548 | hp->encrypt_cfm(conn, status, encrypt); |
542 | 549 | ||
543 | hp = hci_proto[HCI_PROTO_SCO]; | 550 | hp = hci_proto[HCI_PROTO_SCO]; |
544 | if (hp && hp->encrypt_cfm) | 551 | if (hp && hp->encrypt_cfm) |
545 | hp->encrypt_cfm(conn, status); | 552 | hp->encrypt_cfm(conn, status, encrypt); |
546 | } | 553 | } |
547 | 554 | ||
548 | int hci_register_proto(struct hci_proto *hproto); | 555 | int hci_register_proto(struct hci_proto *hproto); |
@@ -579,7 +586,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encr | |||
579 | { | 586 | { |
580 | struct list_head *p; | 587 | struct list_head *p; |
581 | 588 | ||
582 | hci_proto_encrypt_cfm(conn, status); | 589 | hci_proto_encrypt_cfm(conn, status, encrypt); |
583 | 590 | ||
584 | read_lock_bh(&hci_cb_list_lock); | 591 | read_lock_bh(&hci_cb_list_lock); |
585 | list_for_each(p, &hci_cb_list) { | 592 | list_for_each(p, &hci_cb_list) { |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 98ec7a320689..4dc8d92a4638 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -180,7 +180,9 @@ struct rfcomm_dlc { | |||
180 | u8 addr; | 180 | u8 addr; |
181 | u8 priority; | 181 | u8 priority; |
182 | u8 v24_sig; | 182 | u8 v24_sig; |
183 | u8 remote_v24_sig; | ||
183 | u8 mscex; | 184 | u8 mscex; |
185 | u8 out; | ||
184 | 186 | ||
185 | u32 link_mode; | 187 | u32 link_mode; |
186 | 188 | ||
diff --git a/include/net/compat.h b/include/net/compat.h index 164cb682e220..5bbf8bf9efea 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -32,7 +32,7 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | |||
32 | #endif /* defined(CONFIG_COMPAT) */ | 32 | #endif /* defined(CONFIG_COMPAT) */ |
33 | 33 | ||
34 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 34 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
35 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, char *, int); | 35 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); |
36 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); | 36 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); |
37 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); | 37 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); |
38 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 38 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
diff --git a/include/net/dst.h b/include/net/dst.h index 002500e631f5..c5c318a628f8 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -128,6 +128,18 @@ static inline u32 dst_mtu(const struct dst_entry *dst) | |||
128 | return mtu; | 128 | return mtu; |
129 | } | 129 | } |
130 | 130 | ||
131 | /* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */ | ||
132 | static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric) | ||
133 | { | ||
134 | return msecs_to_jiffies(dst_metric(dst, metric)); | ||
135 | } | ||
136 | |||
137 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | ||
138 | unsigned long rtt) | ||
139 | { | ||
140 | dst->metrics[metric-1] = jiffies_to_msecs(rtt); | ||
141 | } | ||
142 | |||
131 | static inline u32 | 143 | static inline u32 |
132 | dst_allfrag(const struct dst_entry *dst) | 144 | dst_allfrag(const struct dst_entry *dst) |
133 | { | 145 | { |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index a5c6ccc5bb19..c2bb5cae6515 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -62,7 +62,7 @@ struct fib_rules_ops | |||
62 | 62 | ||
63 | /* Called after modifications to the rules set, must flush | 63 | /* Called after modifications to the rules set, must flush |
64 | * the route cache if one exists. */ | 64 | * the route cache if one exists. */ |
65 | void (*flush_cache)(void); | 65 | void (*flush_cache)(struct fib_rules_ops *ops); |
66 | 66 | ||
67 | int nlgroup; | 67 | int nlgroup; |
68 | const struct nla_policy *policy; | 68 | const struct nla_policy *policy; |
diff --git a/include/net/garp.h b/include/net/garp.h new file mode 100644 index 000000000000..825f172caba9 --- /dev/null +++ b/include/net/garp.h | |||
@@ -0,0 +1,128 @@ | |||
1 | #ifndef _NET_GARP_H | ||
2 | #define _NET_GARP_H | ||
3 | |||
4 | #include <net/stp.h> | ||
5 | |||
6 | #define GARP_PROTOCOL_ID 0x1 | ||
7 | #define GARP_END_MARK 0x0 | ||
8 | |||
9 | struct garp_pdu_hdr { | ||
10 | __be16 protocol; | ||
11 | }; | ||
12 | |||
13 | struct garp_msg_hdr { | ||
14 | u8 attrtype; | ||
15 | }; | ||
16 | |||
17 | enum garp_attr_event { | ||
18 | GARP_LEAVE_ALL, | ||
19 | GARP_JOIN_EMPTY, | ||
20 | GARP_JOIN_IN, | ||
21 | GARP_LEAVE_EMPTY, | ||
22 | GARP_LEAVE_IN, | ||
23 | GARP_EMPTY, | ||
24 | }; | ||
25 | |||
26 | struct garp_attr_hdr { | ||
27 | u8 len; | ||
28 | u8 event; | ||
29 | u8 data[]; | ||
30 | }; | ||
31 | |||
32 | struct garp_skb_cb { | ||
33 | u8 cur_type; | ||
34 | }; | ||
35 | |||
36 | static inline struct garp_skb_cb *garp_cb(struct sk_buff *skb) | ||
37 | { | ||
38 | BUILD_BUG_ON(sizeof(struct garp_skb_cb) > | ||
39 | FIELD_SIZEOF(struct sk_buff, cb)); | ||
40 | return (struct garp_skb_cb *)skb->cb; | ||
41 | } | ||
42 | |||
43 | enum garp_applicant_state { | ||
44 | GARP_APPLICANT_INVALID, | ||
45 | GARP_APPLICANT_VA, | ||
46 | GARP_APPLICANT_AA, | ||
47 | GARP_APPLICANT_QA, | ||
48 | GARP_APPLICANT_LA, | ||
49 | GARP_APPLICANT_VP, | ||
50 | GARP_APPLICANT_AP, | ||
51 | GARP_APPLICANT_QP, | ||
52 | GARP_APPLICANT_VO, | ||
53 | GARP_APPLICANT_AO, | ||
54 | GARP_APPLICANT_QO, | ||
55 | __GARP_APPLICANT_MAX | ||
56 | }; | ||
57 | #define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1) | ||
58 | |||
59 | enum garp_event { | ||
60 | GARP_EVENT_REQ_JOIN, | ||
61 | GARP_EVENT_REQ_LEAVE, | ||
62 | GARP_EVENT_R_JOIN_IN, | ||
63 | GARP_EVENT_R_JOIN_EMPTY, | ||
64 | GARP_EVENT_R_EMPTY, | ||
65 | GARP_EVENT_R_LEAVE_IN, | ||
66 | GARP_EVENT_R_LEAVE_EMPTY, | ||
67 | GARP_EVENT_TRANSMIT_PDU, | ||
68 | __GARP_EVENT_MAX | ||
69 | }; | ||
70 | #define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1) | ||
71 | |||
72 | enum garp_action { | ||
73 | GARP_ACTION_NONE, | ||
74 | GARP_ACTION_S_JOIN_IN, | ||
75 | GARP_ACTION_S_LEAVE_EMPTY, | ||
76 | }; | ||
77 | |||
78 | struct garp_attr { | ||
79 | struct rb_node node; | ||
80 | enum garp_applicant_state state; | ||
81 | u8 type; | ||
82 | u8 dlen; | ||
83 | unsigned char data[]; | ||
84 | }; | ||
85 | |||
86 | enum garp_applications { | ||
87 | GARP_APPLICATION_GVRP, | ||
88 | __GARP_APPLICATION_MAX | ||
89 | }; | ||
90 | #define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1) | ||
91 | |||
92 | struct garp_application { | ||
93 | enum garp_applications type; | ||
94 | unsigned int maxattr; | ||
95 | struct stp_proto proto; | ||
96 | }; | ||
97 | |||
98 | struct garp_applicant { | ||
99 | struct garp_application *app; | ||
100 | struct net_device *dev; | ||
101 | struct timer_list join_timer; | ||
102 | |||
103 | spinlock_t lock; | ||
104 | struct sk_buff_head queue; | ||
105 | struct sk_buff *pdu; | ||
106 | struct rb_root gid; | ||
107 | }; | ||
108 | |||
109 | struct garp_port { | ||
110 | struct garp_applicant *applicants[GARP_APPLICATION_MAX + 1]; | ||
111 | }; | ||
112 | |||
113 | extern int garp_register_application(struct garp_application *app); | ||
114 | extern void garp_unregister_application(struct garp_application *app); | ||
115 | |||
116 | extern int garp_init_applicant(struct net_device *dev, | ||
117 | struct garp_application *app); | ||
118 | extern void garp_uninit_applicant(struct net_device *dev, | ||
119 | struct garp_application *app); | ||
120 | |||
121 | extern int garp_request_join(const struct net_device *dev, | ||
122 | const struct garp_application *app, | ||
123 | const void *data, u8 len, u8 type); | ||
124 | extern void garp_request_leave(const struct net_device *dev, | ||
125 | const struct garp_application *app, | ||
126 | const void *data, u8 len, u8 type); | ||
127 | |||
128 | #endif /* _NET_GARP_H */ | ||
diff --git a/include/net/icmp.h b/include/net/icmp.h index dddb839ff4b5..dfa72d4e8907 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
@@ -29,27 +29,21 @@ struct icmp_err { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | extern struct icmp_err icmp_err_convert[]; | 31 | extern struct icmp_err icmp_err_convert[]; |
32 | DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics); | 32 | #define ICMP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmp_statistics, field) |
33 | DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); | 33 | #define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmp_statistics, field) |
34 | #define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field) | 34 | #define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmpmsg_statistics, field+256) |
35 | #define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field) | 35 | #define ICMPMSGIN_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmpmsg_statistics, field) |
36 | #define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field) | ||
37 | #define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field+256) | ||
38 | #define ICMPMSGOUT_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field+256) | ||
39 | #define ICMPMSGOUT_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field+256) | ||
40 | #define ICMPMSGIN_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field) | ||
41 | #define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field) | ||
42 | #define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field) | ||
43 | 36 | ||
44 | struct dst_entry; | 37 | struct dst_entry; |
45 | struct net_proto_family; | 38 | struct net_proto_family; |
46 | struct sk_buff; | 39 | struct sk_buff; |
40 | struct net; | ||
47 | 41 | ||
48 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); | 42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); |
49 | extern int icmp_rcv(struct sk_buff *skb); | 43 | extern int icmp_rcv(struct sk_buff *skb); |
50 | extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 44 | extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
51 | extern int icmp_init(void); | 45 | extern int icmp_init(void); |
52 | extern void icmp_out_count(unsigned char type); | 46 | extern void icmp_out_count(struct net *net, unsigned char type); |
53 | 47 | ||
54 | /* Move into dst.h ? */ | 48 | /* Move into dst.h ? */ |
55 | extern int xrlim_allow(struct dst_entry *dst, int timeout); | 49 | extern int xrlim_allow(struct dst_entry *dst, int timeout); |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 529816bfbc52..b31399e1fd83 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -1262,9 +1262,6 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee); | |||
1262 | /* ieee80211_tx.c */ | 1262 | /* ieee80211_tx.c */ |
1263 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); | 1263 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); |
1264 | extern void ieee80211_txb_free(struct ieee80211_txb *); | 1264 | extern void ieee80211_txb_free(struct ieee80211_txb *); |
1265 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | ||
1266 | struct ieee80211_hdr *frame, int hdr_len, | ||
1267 | int total_len, int encrypt_mpdu); | ||
1268 | 1265 | ||
1269 | /* ieee80211_rx.c */ | 1266 | /* ieee80211_rx.c */ |
1270 | extern void ieee80211_rx_any(struct ieee80211_device *ieee, | 1267 | extern void ieee80211_rx_any(struct ieee80211_device *ieee, |
@@ -1312,14 +1309,6 @@ extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, | |||
1312 | extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, | 1309 | extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, |
1313 | struct iw_request_info *info, | 1310 | struct iw_request_info *info, |
1314 | union iwreq_data *wrqu, char *extra); | 1311 | union iwreq_data *wrqu, char *extra); |
1315 | extern int ieee80211_wx_set_auth(struct net_device *dev, | ||
1316 | struct iw_request_info *info, | ||
1317 | union iwreq_data *wrqu, | ||
1318 | char *extra); | ||
1319 | extern int ieee80211_wx_get_auth(struct net_device *dev, | ||
1320 | struct iw_request_info *info, | ||
1321 | union iwreq_data *wrqu, | ||
1322 | char *extra); | ||
1323 | 1312 | ||
1324 | static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) | 1313 | static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) |
1325 | { | 1314 | { |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index b2cfc4927257..c8effa4b1feb 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -148,7 +148,6 @@ struct ifacaddr6 | |||
148 | #define IFA_HOST IPV6_ADDR_LOOPBACK | 148 | #define IFA_HOST IPV6_ADDR_LOOPBACK |
149 | #define IFA_LINK IPV6_ADDR_LINKLOCAL | 149 | #define IFA_LINK IPV6_ADDR_LINKLOCAL |
150 | #define IFA_SITE IPV6_ADDR_SITELOCAL | 150 | #define IFA_SITE IPV6_ADDR_SITELOCAL |
151 | #define IFA_GLOBAL 0x0000U | ||
152 | 151 | ||
153 | struct ipv6_devstat { | 152 | struct ipv6_devstat { |
154 | struct proc_dir_entry *proc_dir_entry; | 153 | struct proc_dir_entry *proc_dir_entry; |
@@ -194,8 +193,6 @@ struct inet6_dev | |||
194 | struct rcu_head rcu; | 193 | struct rcu_head rcu; |
195 | }; | 194 | }; |
196 | 195 | ||
197 | extern struct ipv6_devconf ipv6_devconf; | ||
198 | |||
199 | static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) | 196 | static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) |
200 | { | 197 | { |
201 | /* | 198 | /* |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 62a5b691858e..e48989f04c24 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -24,18 +24,20 @@ | |||
24 | #include <net/inet_sock.h> | 24 | #include <net/inet_sock.h> |
25 | 25 | ||
26 | #include <net/ipv6.h> | 26 | #include <net/ipv6.h> |
27 | #include <net/netns/hash.h> | ||
27 | 28 | ||
28 | struct inet_hashinfo; | 29 | struct inet_hashinfo; |
29 | 30 | ||
30 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ | 31 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ |
31 | static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, | 32 | static inline unsigned int inet6_ehashfn(struct net *net, |
33 | const struct in6_addr *laddr, const u16 lport, | ||
32 | const struct in6_addr *faddr, const __be16 fport) | 34 | const struct in6_addr *faddr, const __be16 fport) |
33 | { | 35 | { |
34 | u32 ports = (lport ^ (__force u16)fport); | 36 | u32 ports = (lport ^ (__force u16)fport); |
35 | 37 | ||
36 | return jhash_3words((__force u32)laddr->s6_addr32[3], | 38 | return jhash_3words((__force u32)laddr->s6_addr32[3], |
37 | (__force u32)faddr->s6_addr32[3], | 39 | (__force u32)faddr->s6_addr32[3], |
38 | ports, inet_ehash_secret); | 40 | ports, inet_ehash_secret + net_hash_mix(net)); |
39 | } | 41 | } |
40 | 42 | ||
41 | static inline int inet6_sk_ehashfn(const struct sock *sk) | 43 | static inline int inet6_sk_ehashfn(const struct sock *sk) |
@@ -46,7 +48,9 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) | |||
46 | const struct in6_addr *faddr = &np->daddr; | 48 | const struct in6_addr *faddr = &np->daddr; |
47 | const __u16 lport = inet->num; | 49 | const __u16 lport = inet->num; |
48 | const __be16 fport = inet->dport; | 50 | const __be16 fport = inet->dport; |
49 | return inet6_ehashfn(laddr, lport, faddr, fport); | 51 | struct net *net = sock_net(sk); |
52 | |||
53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); | ||
50 | } | 54 | } |
51 | 55 | ||
52 | extern void __inet6_hash(struct sock *sk); | 56 | extern void __inet6_hash(struct sock *sk); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 735b926a3497..bb619d80f2e2 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/inet_sock.h> | 29 | #include <net/inet_sock.h> |
30 | #include <net/sock.h> | 30 | #include <net/sock.h> |
31 | #include <net/tcp_states.h> | 31 | #include <net/tcp_states.h> |
32 | #include <net/netns/hash.h> | ||
32 | 33 | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
@@ -201,23 +202,24 @@ extern struct inet_bind_bucket * | |||
201 | extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, | 202 | extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, |
202 | struct inet_bind_bucket *tb); | 203 | struct inet_bind_bucket *tb); |
203 | 204 | ||
204 | static inline int inet_bhashfn(const __u16 lport, const int bhash_size) | 205 | static inline int inet_bhashfn(struct net *net, |
206 | const __u16 lport, const int bhash_size) | ||
205 | { | 207 | { |
206 | return lport & (bhash_size - 1); | 208 | return (lport + net_hash_mix(net)) & (bhash_size - 1); |
207 | } | 209 | } |
208 | 210 | ||
209 | extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, | 211 | extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, |
210 | const unsigned short snum); | 212 | const unsigned short snum); |
211 | 213 | ||
212 | /* These can have wildcards, don't try too hard. */ | 214 | /* These can have wildcards, don't try too hard. */ |
213 | static inline int inet_lhashfn(const unsigned short num) | 215 | static inline int inet_lhashfn(struct net *net, const unsigned short num) |
214 | { | 216 | { |
215 | return num & (INET_LHTABLE_SIZE - 1); | 217 | return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1); |
216 | } | 218 | } |
217 | 219 | ||
218 | static inline int inet_sk_listen_hashfn(const struct sock *sk) | 220 | static inline int inet_sk_listen_hashfn(const struct sock *sk) |
219 | { | 221 | { |
220 | return inet_lhashfn(inet_sk(sk)->num); | 222 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); |
221 | } | 223 | } |
222 | 224 | ||
223 | /* Caller must disable local BH processing. */ | 225 | /* Caller must disable local BH processing. */ |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 9fabe5b38912..643e26be058e 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <net/sock.h> | 25 | #include <net/sock.h> |
26 | #include <net/request_sock.h> | 26 | #include <net/request_sock.h> |
27 | #include <net/route.h> | 27 | #include <net/route.h> |
28 | #include <net/netns/hash.h> | ||
28 | 29 | ||
29 | /** struct ip_options - IP Options | 30 | /** struct ip_options - IP Options |
30 | * | 31 | * |
@@ -171,13 +172,14 @@ extern int inet_sk_rebuild_header(struct sock *sk); | |||
171 | extern u32 inet_ehash_secret; | 172 | extern u32 inet_ehash_secret; |
172 | extern void build_ehash_secret(void); | 173 | extern void build_ehash_secret(void); |
173 | 174 | ||
174 | static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, | 175 | static inline unsigned int inet_ehashfn(struct net *net, |
176 | const __be32 laddr, const __u16 lport, | ||
175 | const __be32 faddr, const __be16 fport) | 177 | const __be32 faddr, const __be16 fport) |
176 | { | 178 | { |
177 | return jhash_3words((__force __u32) laddr, | 179 | return jhash_3words((__force __u32) laddr, |
178 | (__force __u32) faddr, | 180 | (__force __u32) faddr, |
179 | ((__u32) lport) << 16 | (__force __u32)fport, | 181 | ((__u32) lport) << 16 | (__force __u32)fport, |
180 | inet_ehash_secret); | 182 | inet_ehash_secret + net_hash_mix(net)); |
181 | } | 183 | } |
182 | 184 | ||
183 | static inline int inet_sk_ehashfn(const struct sock *sk) | 185 | static inline int inet_sk_ehashfn(const struct sock *sk) |
@@ -187,8 +189,9 @@ static inline int inet_sk_ehashfn(const struct sock *sk) | |||
187 | const __u16 lport = inet->num; | 189 | const __u16 lport = inet->num; |
188 | const __be32 faddr = inet->daddr; | 190 | const __be32 faddr = inet->daddr; |
189 | const __be16 fport = inet->dport; | 191 | const __be16 fport = inet->dport; |
192 | struct net *net = sock_net(sk); | ||
190 | 193 | ||
191 | return inet_ehashfn(laddr, lport, faddr, fport); | 194 | return inet_ehashfn(net, laddr, lport, faddr, fport); |
192 | } | 195 | } |
193 | 196 | ||
194 | 197 | ||
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index ad8404b56113..15e1f8fe4c1f 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * INETPEER - A storage for permanent information about peers | 2 | * INETPEER - A storage for permanent information about peers |
3 | * | 3 | * |
4 | * Version: $Id: inetpeer.h,v 1.2 2002/01/12 07:54:56 davem Exp $ | ||
5 | * | ||
6 | * Authors: Andrey V. Savochkin <saw@msu.ru> | 4 | * Authors: Andrey V. Savochkin <saw@msu.ru> |
7 | */ | 5 | */ |
8 | 6 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 3b40bc2234be..b5862b975207 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -156,17 +156,14 @@ struct ipv4_config | |||
156 | }; | 156 | }; |
157 | 157 | ||
158 | extern struct ipv4_config ipv4_config; | 158 | extern struct ipv4_config ipv4_config; |
159 | DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); | 159 | #define IP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.ip_statistics, field) |
160 | #define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) | 160 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.ip_statistics, field) |
161 | #define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) | 161 | #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH((net)->mib.ip_statistics, field, val) |
162 | #define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) | 162 | #define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) |
163 | #define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val) | 163 | #define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) |
164 | DECLARE_SNMP_STAT(struct linux_mib, net_statistics); | 164 | #define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field) |
165 | #define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) | 165 | #define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) |
166 | #define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) | 166 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) |
167 | #define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field) | ||
168 | #define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd) | ||
169 | #define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) | ||
170 | 167 | ||
171 | extern unsigned long snmp_fold_field(void *mib[], int offt); | 168 | extern unsigned long snmp_fold_field(void *mib[], int offt); |
172 | extern int snmp_mib_init(void *ptr[2], size_t mibsize); | 169 | extern int snmp_mib_init(void *ptr[2], size_t mibsize); |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 9313491e3dad..2f8b3c06a101 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -68,7 +68,7 @@ extern struct rt6_info *rt6_lookup(struct net *net, | |||
68 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | 68 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, |
69 | struct neighbour *neigh, | 69 | struct neighbour *neigh, |
70 | const struct in6_addr *addr); | 70 | const struct in6_addr *addr); |
71 | extern int icmp6_dst_gc(int *more); | 71 | extern int icmp6_dst_gc(void); |
72 | 72 | ||
73 | extern void fib6_force_start_gc(struct net *net); | 73 | extern void fib6_force_start_gc(struct net *net); |
74 | 74 | ||
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 6512d85f11b3..83b4e008b16d 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -1,7 +1,3 @@ | |||
1 | /* | ||
2 | * $Id$ | ||
3 | */ | ||
4 | |||
5 | #ifndef _NET_IP6_TUNNEL_H | 1 | #ifndef _NET_IP6_TUNNEL_H |
6 | #define _NET_IP6_TUNNEL_H | 2 | #define _NET_IP6_TUNNEL_H |
7 | 3 | ||
@@ -19,7 +15,6 @@ | |||
19 | struct ip6_tnl { | 15 | struct ip6_tnl { |
20 | struct ip6_tnl *next; /* next tunnel in list */ | 16 | struct ip6_tnl *next; /* next tunnel in list */ |
21 | struct net_device *dev; /* virtual device associated with tunnel */ | 17 | struct net_device *dev; /* virtual device associated with tunnel */ |
22 | struct net_device_stats stat; /* statistics for tunnel device */ | ||
23 | int recursion; /* depth of hard_start_xmit recursion */ | 18 | int recursion; /* depth of hard_start_xmit recursion */ |
24 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ | 19 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ |
25 | struct flowi fl; /* flowi template for xmit */ | 20 | struct flowi fl; /* flowi template for xmit */ |
diff --git a/include/net/ipconfig.h b/include/net/ipconfig.h index 3924d7d2cb11..c74cc1bd5a02 100644 --- a/include/net/ipconfig.h +++ b/include/net/ipconfig.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: ipconfig.h,v 1.4 2001/04/30 04:51:46 davem Exp $ | ||
3 | * | ||
4 | * Copyright (C) 1997 Martin Mares | 2 | * Copyright (C) 1997 Martin Mares |
5 | * | 3 | * |
6 | * Automatic IP Layer Configuration | 4 | * Automatic IP Layer Configuration |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 633ed4def8e3..a85bda64b852 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -11,7 +11,6 @@ struct ip_tunnel | |||
11 | { | 11 | { |
12 | struct ip_tunnel *next; | 12 | struct ip_tunnel *next; |
13 | struct net_device *dev; | 13 | struct net_device *dev; |
14 | struct net_device_stats stat; | ||
15 | 14 | ||
16 | int recursion; /* Depth of hard_start_xmit recursion */ | 15 | int recursion; /* Depth of hard_start_xmit recursion */ |
17 | int err_count; /* Number of arrived ICMP errors */ | 16 | int err_count; /* Number of arrived ICMP errors */ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index f422f7218e1c..2d5c18514a2d 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -4,8 +4,6 @@ | |||
4 | * Authors: | 4 | * Authors: |
5 | * Pedro Roque <roque@di.fc.ul.pt> | 5 | * Pedro Roque <roque@di.fc.ul.pt> |
6 | * | 6 | * |
7 | * $Id: ipv6.h,v 1.1 2002/05/20 15:13:07 jgrimm Exp $ | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
11 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
@@ -133,7 +131,6 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); | |||
133 | 131 | ||
134 | #define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) | 132 | #define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) |
135 | #define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) | 133 | #define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) |
136 | #define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field) | ||
137 | #define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) | 134 | #define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) |
138 | 135 | ||
139 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | 136 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); |
@@ -141,20 +138,15 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); | |||
141 | 138 | ||
142 | #define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field) | 139 | #define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field) |
143 | #define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field) | 140 | #define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field) |
144 | #define ICMP6_INC_STATS_USER(idev, field) _DEVINC(icmpv6, _USER, idev, field) | ||
145 | 141 | ||
146 | #define ICMP6MSGOUT_INC_STATS(idev, field) \ | 142 | #define ICMP6MSGOUT_INC_STATS(idev, field) \ |
147 | _DEVINC(icmpv6msg, , idev, field +256) | 143 | _DEVINC(icmpv6msg, , idev, field +256) |
148 | #define ICMP6MSGOUT_INC_STATS_BH(idev, field) \ | 144 | #define ICMP6MSGOUT_INC_STATS_BH(idev, field) \ |
149 | _DEVINC(icmpv6msg, _BH, idev, field +256) | 145 | _DEVINC(icmpv6msg, _BH, idev, field +256) |
150 | #define ICMP6MSGOUT_INC_STATS_USER(idev, field) \ | ||
151 | _DEVINC(icmpv6msg, _USER, idev, field +256) | ||
152 | #define ICMP6MSGIN_INC_STATS(idev, field) \ | 146 | #define ICMP6MSGIN_INC_STATS(idev, field) \ |
153 | _DEVINC(icmpv6msg, , idev, field) | 147 | _DEVINC(icmpv6msg, , idev, field) |
154 | #define ICMP6MSGIN_INC_STATS_BH(idev, field) \ | 148 | #define ICMP6MSGIN_INC_STATS_BH(idev, field) \ |
155 | _DEVINC(icmpv6msg, _BH, idev, field) | 149 | _DEVINC(icmpv6msg, _BH, idev, field) |
156 | #define ICMP6MSGIN_INC_STATS_USER(idev, field) \ | ||
157 | _DEVINC(icmpv6msg, _USER, idev, field) | ||
158 | 150 | ||
159 | struct ip6_ra_chain | 151 | struct ip6_ra_chain |
160 | { | 152 | { |
@@ -229,9 +221,7 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl) | |||
229 | atomic_dec(&fl->users); | 221 | atomic_dec(&fl->users); |
230 | } | 222 | } |
231 | 223 | ||
232 | extern int ip6_ra_control(struct sock *sk, int sel, | 224 | extern int ip6_ra_control(struct sock *sk, int sel); |
233 | void (*destructor)(struct sock *)); | ||
234 | |||
235 | 225 | ||
236 | extern int ipv6_parse_hopopts(struct sk_buff *skb); | 226 | extern int ipv6_parse_hopopts(struct sk_buff *skb); |
237 | 227 | ||
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index f70e9b39ebaf..3025ae17ddbe 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
@@ -223,7 +223,7 @@ int irda_device_is_receiving(struct net_device *dev); | |||
223 | /* Interface for internal use */ | 223 | /* Interface for internal use */ |
224 | static inline int irda_device_txqueue_empty(const struct net_device *dev) | 224 | static inline int irda_device_txqueue_empty(const struct net_device *dev) |
225 | { | 225 | { |
226 | return skb_queue_empty(&dev->qdisc->q); | 226 | return qdisc_all_tx_empty(dev); |
227 | } | 227 | } |
228 | int irda_device_set_raw_mode(struct net_device* self, int status); | 228 | int irda_device_set_raw_mode(struct net_device* self, int status); |
229 | struct net_device *alloc_irdadev(int sizeof_priv); | 229 | struct net_device *alloc_irdadev(int sizeof_priv); |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 369d50e08b99..51b9a37de991 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -256,7 +256,7 @@ | |||
256 | #define EIWCOMMIT EINPROGRESS | 256 | #define EIWCOMMIT EINPROGRESS |
257 | 257 | ||
258 | /* Flags available in struct iw_request_info */ | 258 | /* Flags available in struct iw_request_info */ |
259 | #define IW_REQUEST_FLAG_NONE 0x0000 /* No flag so far */ | 259 | #define IW_REQUEST_FLAG_COMPAT 0x0001 /* Compat ioctl call */ |
260 | 260 | ||
261 | /* Type of headers we know about (basically union iwreq_data) */ | 261 | /* Type of headers we know about (basically union iwreq_data) */ |
262 | #define IW_HEADER_TYPE_NULL 0 /* Not available */ | 262 | #define IW_HEADER_TYPE_NULL 0 /* Not available */ |
@@ -478,105 +478,58 @@ extern void wireless_spy_update(struct net_device * dev, | |||
478 | * Function that are so simple that it's more efficient inlining them | 478 | * Function that are so simple that it's more efficient inlining them |
479 | */ | 479 | */ |
480 | 480 | ||
481 | /*------------------------------------------------------------------*/ | 481 | static inline int iwe_stream_lcp_len(struct iw_request_info *info) |
482 | /* | ||
483 | * Wrapper to add an Wireless Event to a stream of events. | ||
484 | */ | ||
485 | static inline char * | ||
486 | iwe_stream_add_event(char * stream, /* Stream of events */ | ||
487 | char * ends, /* End of stream */ | ||
488 | struct iw_event *iwe, /* Payload */ | ||
489 | int event_len) /* Real size of payload */ | ||
490 | { | 482 | { |
491 | /* Check if it's possible */ | 483 | #ifdef CONFIG_COMPAT |
492 | if(likely((stream + event_len) < ends)) { | 484 | if (info->flags & IW_REQUEST_FLAG_COMPAT) |
493 | iwe->len = event_len; | 485 | return IW_EV_COMPAT_LCP_LEN; |
494 | /* Beware of alignement issues on 64 bits */ | 486 | #endif |
495 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 487 | return IW_EV_LCP_LEN; |
496 | memcpy(stream + IW_EV_LCP_LEN, | ||
497 | ((char *) iwe) + IW_EV_LCP_LEN, | ||
498 | event_len - IW_EV_LCP_LEN); | ||
499 | stream += event_len; | ||
500 | } | ||
501 | return stream; | ||
502 | } | 488 | } |
503 | 489 | ||
504 | /*------------------------------------------------------------------*/ | 490 | static inline int iwe_stream_point_len(struct iw_request_info *info) |
505 | /* | ||
506 | * Wrapper to add an short Wireless Event containing a pointer to a | ||
507 | * stream of events. | ||
508 | */ | ||
509 | static inline char * | ||
510 | iwe_stream_add_point(char * stream, /* Stream of events */ | ||
511 | char * ends, /* End of stream */ | ||
512 | struct iw_event *iwe, /* Payload length + flags */ | ||
513 | char * extra) /* More payload */ | ||
514 | { | 491 | { |
515 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | 492 | #ifdef CONFIG_COMPAT |
516 | /* Check if it's possible */ | 493 | if (info->flags & IW_REQUEST_FLAG_COMPAT) |
517 | if(likely((stream + event_len) < ends)) { | 494 | return IW_EV_COMPAT_POINT_LEN; |
518 | iwe->len = event_len; | 495 | #endif |
519 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 496 | return IW_EV_POINT_LEN; |
520 | memcpy(stream + IW_EV_LCP_LEN, | ||
521 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | ||
522 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); | ||
523 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | ||
524 | stream += event_len; | ||
525 | } | ||
526 | return stream; | ||
527 | } | 497 | } |
528 | 498 | ||
529 | /*------------------------------------------------------------------*/ | 499 | static inline int iwe_stream_event_len_adjust(struct iw_request_info *info, |
530 | /* | 500 | int event_len) |
531 | * Wrapper to add a value to a Wireless Event in a stream of events. | ||
532 | * Be careful, this one is tricky to use properly : | ||
533 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). | ||
534 | */ | ||
535 | static inline char * | ||
536 | iwe_stream_add_value(char * event, /* Event in the stream */ | ||
537 | char * value, /* Value in event */ | ||
538 | char * ends, /* End of stream */ | ||
539 | struct iw_event *iwe, /* Payload */ | ||
540 | int event_len) /* Real size of payload */ | ||
541 | { | 501 | { |
542 | /* Don't duplicate LCP */ | 502 | #ifdef CONFIG_COMPAT |
543 | event_len -= IW_EV_LCP_LEN; | 503 | if (info->flags & IW_REQUEST_FLAG_COMPAT) { |
544 | 504 | event_len -= IW_EV_LCP_LEN; | |
545 | /* Check if it's possible */ | 505 | event_len += IW_EV_COMPAT_LCP_LEN; |
546 | if(likely((value + event_len) < ends)) { | ||
547 | /* Add new value */ | ||
548 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | ||
549 | value += event_len; | ||
550 | /* Patch LCP */ | ||
551 | iwe->len = value - event; | ||
552 | memcpy(event, (char *) iwe, IW_EV_LCP_LEN); | ||
553 | } | 506 | } |
554 | return value; | 507 | #endif |
508 | |||
509 | return event_len; | ||
555 | } | 510 | } |
556 | 511 | ||
557 | /*------------------------------------------------------------------*/ | 512 | /*------------------------------------------------------------------*/ |
558 | /* | 513 | /* |
559 | * Wrapper to add an Wireless Event to a stream of events. | 514 | * Wrapper to add an Wireless Event to a stream of events. |
560 | * Same as above, with explicit error check... | ||
561 | */ | 515 | */ |
562 | static inline char * | 516 | static inline char * |
563 | iwe_stream_check_add_event(char * stream, /* Stream of events */ | 517 | iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends, |
564 | char * ends, /* End of stream */ | 518 | struct iw_event *iwe, int event_len) |
565 | struct iw_event *iwe, /* Payload */ | ||
566 | int event_len, /* Size of payload */ | ||
567 | int * perr) /* Error report */ | ||
568 | { | 519 | { |
569 | /* Check if it's possible, set error if not */ | 520 | int lcp_len = iwe_stream_lcp_len(info); |
521 | |||
522 | event_len = iwe_stream_event_len_adjust(info, event_len); | ||
523 | |||
524 | /* Check if it's possible */ | ||
570 | if(likely((stream + event_len) < ends)) { | 525 | if(likely((stream + event_len) < ends)) { |
571 | iwe->len = event_len; | 526 | iwe->len = event_len; |
572 | /* Beware of alignement issues on 64 bits */ | 527 | /* Beware of alignement issues on 64 bits */ |
573 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 528 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
574 | memcpy(stream + IW_EV_LCP_LEN, | 529 | memcpy(stream + lcp_len, &iwe->u, |
575 | ((char *) iwe) + IW_EV_LCP_LEN, | 530 | event_len - lcp_len); |
576 | event_len - IW_EV_LCP_LEN); | ||
577 | stream += event_len; | 531 | stream += event_len; |
578 | } else | 532 | } |
579 | *perr = -E2BIG; | ||
580 | return stream; | 533 | return stream; |
581 | } | 534 | } |
582 | 535 | ||
@@ -584,27 +537,25 @@ iwe_stream_check_add_event(char * stream, /* Stream of events */ | |||
584 | /* | 537 | /* |
585 | * Wrapper to add an short Wireless Event containing a pointer to a | 538 | * Wrapper to add an short Wireless Event containing a pointer to a |
586 | * stream of events. | 539 | * stream of events. |
587 | * Same as above, with explicit error check... | ||
588 | */ | 540 | */ |
589 | static inline char * | 541 | static inline char * |
590 | iwe_stream_check_add_point(char * stream, /* Stream of events */ | 542 | iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends, |
591 | char * ends, /* End of stream */ | 543 | struct iw_event *iwe, char *extra) |
592 | struct iw_event *iwe, /* Payload length + flags */ | ||
593 | char * extra, /* More payload */ | ||
594 | int * perr) /* Error report */ | ||
595 | { | 544 | { |
596 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | 545 | int event_len = iwe_stream_point_len(info) + iwe->u.data.length; |
546 | int point_len = iwe_stream_point_len(info); | ||
547 | int lcp_len = iwe_stream_lcp_len(info); | ||
548 | |||
597 | /* Check if it's possible */ | 549 | /* Check if it's possible */ |
598 | if(likely((stream + event_len) < ends)) { | 550 | if(likely((stream + event_len) < ends)) { |
599 | iwe->len = event_len; | 551 | iwe->len = event_len; |
600 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 552 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
601 | memcpy(stream + IW_EV_LCP_LEN, | 553 | memcpy(stream + lcp_len, |
602 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | 554 | ((char *) &iwe->u) + IW_EV_POINT_OFF, |
603 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); | 555 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); |
604 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | 556 | memcpy(stream + point_len, extra, iwe->u.data.length); |
605 | stream += event_len; | 557 | stream += event_len; |
606 | } else | 558 | } |
607 | *perr = -E2BIG; | ||
608 | return stream; | 559 | return stream; |
609 | } | 560 | } |
610 | 561 | ||
@@ -613,29 +564,25 @@ iwe_stream_check_add_point(char * stream, /* Stream of events */ | |||
613 | * Wrapper to add a value to a Wireless Event in a stream of events. | 564 | * Wrapper to add a value to a Wireless Event in a stream of events. |
614 | * Be careful, this one is tricky to use properly : | 565 | * Be careful, this one is tricky to use properly : |
615 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). | 566 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). |
616 | * Same as above, with explicit error check... | ||
617 | */ | 567 | */ |
618 | static inline char * | 568 | static inline char * |
619 | iwe_stream_check_add_value(char * event, /* Event in the stream */ | 569 | iwe_stream_add_value(struct iw_request_info *info, char *event, char *value, |
620 | char * value, /* Value in event */ | 570 | char *ends, struct iw_event *iwe, int event_len) |
621 | char * ends, /* End of stream */ | ||
622 | struct iw_event *iwe, /* Payload */ | ||
623 | int event_len, /* Size of payload */ | ||
624 | int * perr) /* Error report */ | ||
625 | { | 571 | { |
572 | int lcp_len = iwe_stream_lcp_len(info); | ||
573 | |||
626 | /* Don't duplicate LCP */ | 574 | /* Don't duplicate LCP */ |
627 | event_len -= IW_EV_LCP_LEN; | 575 | event_len -= IW_EV_LCP_LEN; |
628 | 576 | ||
629 | /* Check if it's possible */ | 577 | /* Check if it's possible */ |
630 | if(likely((value + event_len) < ends)) { | 578 | if(likely((value + event_len) < ends)) { |
631 | /* Add new value */ | 579 | /* Add new value */ |
632 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | 580 | memcpy(value, &iwe->u, event_len); |
633 | value += event_len; | 581 | value += event_len; |
634 | /* Patch LCP */ | 582 | /* Patch LCP */ |
635 | iwe->len = value - event; | 583 | iwe->len = value - event; |
636 | memcpy(event, (char *) iwe, IW_EV_LCP_LEN); | 584 | memcpy(event, (char *) iwe, lcp_len); |
637 | } else | 585 | } |
638 | *perr = -E2BIG; | ||
639 | return value; | 586 | return value; |
640 | } | 587 | } |
641 | 588 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bcd1623245cb..4dd3d93e1960 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -42,7 +42,7 @@ | |||
42 | * tasklet function. | 42 | * tasklet function. |
43 | * | 43 | * |
44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also | 44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also |
45 | * use the non-irqsafe functions! | 45 | * use the non-IRQ-safe functions! |
46 | */ | 46 | */ |
47 | 47 | ||
48 | /** | 48 | /** |
@@ -85,7 +85,7 @@ enum ieee80211_notification_types { | |||
85 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics | 85 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics |
86 | * | 86 | * |
87 | * This structure describes most essential parameters needed | 87 | * This structure describes most essential parameters needed |
88 | * to describe 802.11n HT characteristics in a BSS | 88 | * to describe 802.11n HT characteristics in a BSS. |
89 | * | 89 | * |
90 | * @primary_channel: channel number of primery channel | 90 | * @primary_channel: channel number of primery channel |
91 | * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) | 91 | * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) |
@@ -98,77 +98,49 @@ struct ieee80211_ht_bss_info { | |||
98 | }; | 98 | }; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * enum ieee80211_max_queues - maximum number of queues | ||
102 | * | ||
103 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. | ||
104 | * @IEEE80211_MAX_AMPDU_QUEUES: Maximum number of queues usable | ||
105 | * for A-MPDU operation. | ||
106 | */ | ||
107 | enum ieee80211_max_queues { | ||
108 | IEEE80211_MAX_QUEUES = 16, | ||
109 | IEEE80211_MAX_AMPDU_QUEUES = 16, | ||
110 | }; | ||
111 | |||
112 | /** | ||
101 | * struct ieee80211_tx_queue_params - transmit queue configuration | 113 | * struct ieee80211_tx_queue_params - transmit queue configuration |
102 | * | 114 | * |
103 | * The information provided in this structure is required for QoS | 115 | * The information provided in this structure is required for QoS |
104 | * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. | 116 | * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. |
105 | * | 117 | * |
106 | * @aifs: arbitration interface space [0..255, -1: use default] | 118 | * @aifs: arbitration interface space [0..255] |
107 | * @cw_min: minimum contention window [will be a value of the form | 119 | * @cw_min: minimum contention window [a value of the form |
108 | * 2^n-1 in the range 1..1023; 0: use default] | 120 | * 2^n-1 in the range 1..32767] |
109 | * @cw_max: maximum contention window [like @cw_min] | 121 | * @cw_max: maximum contention window [like @cw_min] |
110 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled | 122 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled |
111 | */ | 123 | */ |
112 | struct ieee80211_tx_queue_params { | 124 | struct ieee80211_tx_queue_params { |
113 | s16 aifs; | 125 | u16 txop; |
114 | u16 cw_min; | 126 | u16 cw_min; |
115 | u16 cw_max; | 127 | u16 cw_max; |
116 | u16 txop; | 128 | u8 aifs; |
117 | }; | 129 | }; |
118 | 130 | ||
119 | /** | 131 | /** |
120 | * struct ieee80211_tx_queue_stats_data - transmit queue statistics | 132 | * struct ieee80211_tx_queue_stats - transmit queue statistics |
121 | * | 133 | * |
122 | * @len: number of packets in queue | 134 | * @len: number of packets in queue |
123 | * @limit: queue length limit | 135 | * @limit: queue length limit |
124 | * @count: number of frames sent | 136 | * @count: number of frames sent |
125 | */ | 137 | */ |
126 | struct ieee80211_tx_queue_stats_data { | 138 | struct ieee80211_tx_queue_stats { |
127 | unsigned int len; | 139 | unsigned int len; |
128 | unsigned int limit; | 140 | unsigned int limit; |
129 | unsigned int count; | 141 | unsigned int count; |
130 | }; | 142 | }; |
131 | 143 | ||
132 | /** | ||
133 | * enum ieee80211_tx_queue - transmit queue number | ||
134 | * | ||
135 | * These constants are used with some callbacks that take a | ||
136 | * queue number to set parameters for a queue. | ||
137 | * | ||
138 | * @IEEE80211_TX_QUEUE_DATA0: data queue 0 | ||
139 | * @IEEE80211_TX_QUEUE_DATA1: data queue 1 | ||
140 | * @IEEE80211_TX_QUEUE_DATA2: data queue 2 | ||
141 | * @IEEE80211_TX_QUEUE_DATA3: data queue 3 | ||
142 | * @IEEE80211_TX_QUEUE_DATA4: data queue 4 | ||
143 | * @IEEE80211_TX_QUEUE_SVP: ?? | ||
144 | * @NUM_TX_DATA_QUEUES: number of data queues | ||
145 | * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be | ||
146 | * sent after a beacon | ||
147 | * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames | ||
148 | * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU | ||
149 | */ | ||
150 | enum ieee80211_tx_queue { | ||
151 | IEEE80211_TX_QUEUE_DATA0, | ||
152 | IEEE80211_TX_QUEUE_DATA1, | ||
153 | IEEE80211_TX_QUEUE_DATA2, | ||
154 | IEEE80211_TX_QUEUE_DATA3, | ||
155 | IEEE80211_TX_QUEUE_DATA4, | ||
156 | IEEE80211_TX_QUEUE_SVP, | ||
157 | |||
158 | NUM_TX_DATA_QUEUES, | ||
159 | |||
160 | /* due to stupidity in the sub-ioctl userspace interface, the items in | ||
161 | * this struct need to have fixed values. As soon as it is removed, we can | ||
162 | * fix these entries. */ | ||
163 | IEEE80211_TX_QUEUE_AFTER_BEACON = 6, | ||
164 | IEEE80211_TX_QUEUE_BEACON = 7, | ||
165 | NUM_TX_DATA_QUEUES_AMPDU = 16 | ||
166 | }; | ||
167 | |||
168 | struct ieee80211_tx_queue_stats { | ||
169 | struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU]; | ||
170 | }; | ||
171 | |||
172 | struct ieee80211_low_level_stats { | 144 | struct ieee80211_low_level_stats { |
173 | unsigned int dot11ACKFailureCount; | 145 | unsigned int dot11ACKFailureCount; |
174 | unsigned int dot11RTSFailureCount; | 146 | unsigned int dot11RTSFailureCount; |
@@ -229,91 +201,151 @@ struct ieee80211_bss_conf { | |||
229 | }; | 201 | }; |
230 | 202 | ||
231 | /** | 203 | /** |
232 | * enum mac80211_tx_control_flags - flags to describe Tx configuration for | 204 | * enum mac80211_tx_control_flags - flags to describe transmission information/status |
233 | * the Tx frame | 205 | * |
234 | * | 206 | * These flags are used with the @flags member of &ieee80211_tx_info. |
235 | * These flags are used with the @flags member of &ieee80211_tx_control | 207 | * |
236 | * | 208 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. |
237 | * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. | 209 | * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption; |
238 | * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; | 210 | * e.g., for EAPOL frame |
239 | * e.g., for EAPOL frame | 211 | * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame |
240 | * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame | 212 | * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., |
241 | * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., | 213 | * for combined 802.11g / 802.11b networks) |
242 | * for combined 802.11g / 802.11b networks) | 214 | * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack |
243 | * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack | 215 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD |
244 | * @IEEE80211_TXCTL_RATE_CTRL_PROBE | 216 | * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination |
245 | * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter | 217 | * station |
246 | * for destination station | 218 | * @IEEE80211_TX_CTL_REQUEUE: TBD |
247 | * @IEEE80211_TXCTL_REQUEUE: | 219 | * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame |
248 | * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame | 220 | * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD |
249 | * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the | 221 | * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the |
250 | * through set_retry_limit configured long | 222 | * through set_retry_limit configured long retry value |
251 | * retry value | 223 | * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211 |
252 | * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 | 224 | * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon |
253 | * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon | 225 | * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU |
254 | * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU | 226 | * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number |
255 | * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number | 227 | * of streams when this flag is on can be extracted from antenna_sel_tx, |
256 | * of streams when this flag is on can be extracted | 228 | * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n |
257 | * from antenna_sel_tx, so if 1 antenna is marked | 229 | * antennas marked use MIMO_n. |
258 | * use SISO, 2 antennas marked use MIMO, n antennas | 230 | * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame |
259 | * marked use MIMO_n. | 231 | * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width |
260 | * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame | 232 | * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels |
261 | * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width | 233 | * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval |
262 | * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels | 234 | * @IEEE80211_TX_CTL_INJECTED: TBD |
263 | * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval | 235 | * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted |
236 | * because the destination STA was in powersave mode. | ||
237 | * @IEEE80211_TX_STAT_ACK: Frame was acknowledged | ||
238 | * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status | ||
239 | * is for the whole aggregation. | ||
240 | * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned, | ||
241 | * so consider using block ack request (BAR). | ||
242 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence | ||
243 | * number to this frame, taking care of not overwriting the fragment | ||
244 | * number and increasing the sequence number only when the | ||
245 | * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly | ||
246 | * assign sequence numbers to QoS-data frames but cannot do so correctly | ||
247 | * for non-QoS-data and management frames because beacons need them from | ||
248 | * that counter as well and mac80211 cannot guarantee proper sequencing. | ||
249 | * If this flag is set, the driver should instruct the hardware to | ||
250 | * assign a sequence number to the frame or assign one itself. Cf. IEEE | ||
251 | * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for | ||
252 | * beacons always be clear for frames without a sequence number field. | ||
264 | */ | 253 | */ |
265 | enum mac80211_tx_control_flags { | 254 | enum mac80211_tx_control_flags { |
266 | IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), | 255 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
267 | IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), | 256 | IEEE80211_TX_CTL_DO_NOT_ENCRYPT = BIT(1), |
268 | IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), | 257 | IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2), |
269 | IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), | 258 | IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3), |
270 | IEEE80211_TXCTL_NO_ACK = (1<<4), | 259 | IEEE80211_TX_CTL_NO_ACK = BIT(4), |
271 | IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), | 260 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5), |
272 | IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), | 261 | IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6), |
273 | IEEE80211_TXCTL_REQUEUE = (1<<7), | 262 | IEEE80211_TX_CTL_REQUEUE = BIT(7), |
274 | IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), | 263 | IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8), |
275 | IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), | 264 | IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9), |
276 | IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), | 265 | IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10), |
277 | IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), | 266 | IEEE80211_TX_CTL_EAPOL_FRAME = BIT(11), |
278 | IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), | 267 | IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12), |
279 | IEEE80211_TXCTL_AMPDU = (1<<13), | 268 | IEEE80211_TX_CTL_AMPDU = BIT(13), |
280 | IEEE80211_TXCTL_OFDM_HT = (1<<14), | 269 | IEEE80211_TX_CTL_OFDM_HT = BIT(14), |
281 | IEEE80211_TXCTL_GREEN_FIELD = (1<<15), | 270 | IEEE80211_TX_CTL_GREEN_FIELD = BIT(15), |
282 | IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), | 271 | IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16), |
283 | IEEE80211_TXCTL_DUP_DATA = (1<<17), | 272 | IEEE80211_TX_CTL_DUP_DATA = BIT(17), |
284 | IEEE80211_TXCTL_SHORT_GI = (1<<18), | 273 | IEEE80211_TX_CTL_SHORT_GI = BIT(18), |
274 | IEEE80211_TX_CTL_INJECTED = BIT(19), | ||
275 | IEEE80211_TX_STAT_TX_FILTERED = BIT(20), | ||
276 | IEEE80211_TX_STAT_ACK = BIT(21), | ||
277 | IEEE80211_TX_STAT_AMPDU = BIT(22), | ||
278 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23), | ||
279 | IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24), | ||
285 | }; | 280 | }; |
286 | 281 | ||
287 | /* Transmit control fields. This data structure is passed to low-level driver | ||
288 | * with each TX frame. The low-level driver is responsible for configuring | ||
289 | * the hardware to use given values (depending on what is supported). */ | ||
290 | 282 | ||
291 | struct ieee80211_tx_control { | 283 | #define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ |
292 | struct ieee80211_vif *vif; | 284 | (sizeof(((struct sk_buff *)0)->cb) - 8) |
293 | struct ieee80211_rate *tx_rate; | 285 | #define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ |
294 | 286 | (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) | |
295 | /* Transmit rate for RTS/CTS frame */ | 287 | |
296 | struct ieee80211_rate *rts_cts_rate; | 288 | /** |
297 | 289 | * struct ieee80211_tx_info - skb transmit information | |
298 | /* retry rate for the last retries */ | 290 | * |
299 | struct ieee80211_rate *alt_retry_rate; | 291 | * This structure is placed in skb->cb for three uses: |
300 | 292 | * (1) mac80211 TX control - mac80211 tells the driver what to do | |
301 | u32 flags; /* tx control flags defined above */ | 293 | * (2) driver internal use (if applicable) |
302 | u8 key_idx; /* keyidx from hw->set_key(), undefined if | 294 | * (3) TX status information - driver tells mac80211 what happened |
303 | * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ | 295 | * |
304 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. | 296 | * @flags: transmit info flags, defined above |
305 | * This could be used when set_retry_limit | 297 | * @band: TBD |
306 | * is not implemented by the driver */ | 298 | * @tx_rate_idx: TBD |
307 | u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit | 299 | * @antenna_sel_tx: TBD |
308 | * position represents antenna number used */ | 300 | * @control: union for control data |
309 | u8 icv_len; /* length of the ICV/MIC field in octets */ | 301 | * @status: union for status data |
310 | u8 iv_len; /* length of the IV field in octets */ | 302 | * @driver_data: array of driver_data pointers |
311 | u8 queue; /* hardware queue to use for this frame; | 303 | * @retry_count: number of retries |
312 | * 0 = highest, hw->queues-1 = lowest */ | 304 | * @excessive_retries: set to 1 if the frame was retried many times |
313 | u16 aid; /* Station AID */ | 305 | * but not acknowledged |
314 | int type; /* internal */ | 306 | * @ampdu_ack_len: number of aggregated frames. |
307 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
308 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
309 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
310 | * @ack_signal: signal strength of the ACK frame | ||
311 | */ | ||
312 | struct ieee80211_tx_info { | ||
313 | /* common information */ | ||
314 | u32 flags; | ||
315 | u8 band; | ||
316 | s8 tx_rate_idx; | ||
317 | u8 antenna_sel_tx; | ||
318 | |||
319 | /* 1 byte hole */ | ||
320 | |||
321 | union { | ||
322 | struct { | ||
323 | struct ieee80211_vif *vif; | ||
324 | struct ieee80211_key_conf *hw_key; | ||
325 | unsigned long jiffies; | ||
326 | int ifindex; | ||
327 | u16 aid; | ||
328 | s8 rts_cts_rate_idx, alt_retry_rate_idx; | ||
329 | u8 retry_limit; | ||
330 | u8 icv_len; | ||
331 | u8 iv_len; | ||
332 | } control; | ||
333 | struct { | ||
334 | u64 ampdu_ack_map; | ||
335 | int ack_signal; | ||
336 | u8 retry_count; | ||
337 | bool excessive_retries; | ||
338 | u8 ampdu_ack_len; | ||
339 | } status; | ||
340 | void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS]; | ||
341 | }; | ||
315 | }; | 342 | }; |
316 | 343 | ||
344 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) | ||
345 | { | ||
346 | return (struct ieee80211_tx_info *)skb->cb; | ||
347 | } | ||
348 | |||
317 | 349 | ||
318 | /** | 350 | /** |
319 | * enum mac80211_rx_flags - receive flags | 351 | * enum mac80211_rx_flags - receive flags |
@@ -353,13 +385,16 @@ enum mac80211_rx_flags { | |||
353 | * The low-level driver should provide this information (the subset | 385 | * The low-level driver should provide this information (the subset |
354 | * supported by hardware) to the 802.11 code with each received | 386 | * supported by hardware) to the 802.11 code with each received |
355 | * frame. | 387 | * frame. |
388 | * | ||
356 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function | 389 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
357 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | 390 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. |
358 | * @band: the active band when this frame was received | 391 | * @band: the active band when this frame was received |
359 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz | 392 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
360 | * @ssi: signal strength when receiving this frame | 393 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
361 | * @signal: used as 'qual' in statistics reporting | 394 | * unspecified depending on the hardware capabilities flags |
362 | * @noise: PHY noise when receiving this frame | 395 | * @IEEE80211_HW_SIGNAL_* |
396 | * @noise: noise when receiving this frame, in dBm. | ||
397 | * @qual: overall signal quality indication, in percent (0-100). | ||
363 | * @antenna: antenna used | 398 | * @antenna: antenna used |
364 | * @rate_idx: index of data rate into band's supported rates | 399 | * @rate_idx: index of data rate into band's supported rates |
365 | * @flag: %RX_FLAG_* | 400 | * @flag: %RX_FLAG_* |
@@ -368,64 +403,15 @@ struct ieee80211_rx_status { | |||
368 | u64 mactime; | 403 | u64 mactime; |
369 | enum ieee80211_band band; | 404 | enum ieee80211_band band; |
370 | int freq; | 405 | int freq; |
371 | int ssi; | ||
372 | int signal; | 406 | int signal; |
373 | int noise; | 407 | int noise; |
408 | int qual; | ||
374 | int antenna; | 409 | int antenna; |
375 | int rate_idx; | 410 | int rate_idx; |
376 | int flag; | 411 | int flag; |
377 | }; | 412 | }; |
378 | 413 | ||
379 | /** | 414 | /** |
380 | * enum ieee80211_tx_status_flags - transmit status flags | ||
381 | * | ||
382 | * Status flags to indicate various transmit conditions. | ||
383 | * | ||
384 | * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted | ||
385 | * because the destination STA was in powersave mode. | ||
386 | * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged | ||
387 | * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status | ||
388 | * is for the whole aggregation. | ||
389 | */ | ||
390 | enum ieee80211_tx_status_flags { | ||
391 | IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, | ||
392 | IEEE80211_TX_STATUS_ACK = 1<<1, | ||
393 | IEEE80211_TX_STATUS_AMPDU = 1<<2, | ||
394 | }; | ||
395 | |||
396 | /** | ||
397 | * struct ieee80211_tx_status - transmit status | ||
398 | * | ||
399 | * As much information as possible should be provided for each transmitted | ||
400 | * frame with ieee80211_tx_status(). | ||
401 | * | ||
402 | * @control: a copy of the &struct ieee80211_tx_control passed to the driver | ||
403 | * in the tx() callback. | ||
404 | * @flags: transmit status flags, defined above | ||
405 | * @retry_count: number of retries | ||
406 | * @excessive_retries: set to 1 if the frame was retried many times | ||
407 | * but not acknowledged | ||
408 | * @ampdu_ack_len: number of aggregated frames. | ||
409 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
410 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
411 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
412 | * @ack_signal: signal strength of the ACK frame | ||
413 | * @queue_length: ?? REMOVE | ||
414 | * @queue_number: ?? REMOVE | ||
415 | */ | ||
416 | struct ieee80211_tx_status { | ||
417 | struct ieee80211_tx_control control; | ||
418 | u8 flags; | ||
419 | u8 retry_count; | ||
420 | bool excessive_retries; | ||
421 | u8 ampdu_ack_len; | ||
422 | u64 ampdu_ack_map; | ||
423 | int ack_signal; | ||
424 | int queue_length; | ||
425 | int queue_number; | ||
426 | }; | ||
427 | |||
428 | /** | ||
429 | * enum ieee80211_conf_flags - configuration flags | 415 | * enum ieee80211_conf_flags - configuration flags |
430 | * | 416 | * |
431 | * Flags to define PHY configuration options | 417 | * Flags to define PHY configuration options |
@@ -433,11 +419,13 @@ struct ieee80211_tx_status { | |||
433 | * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time | 419 | * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time |
434 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 420 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) |
435 | * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) | 421 | * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) |
422 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode | ||
436 | */ | 423 | */ |
437 | enum ieee80211_conf_flags { | 424 | enum ieee80211_conf_flags { |
438 | IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), | 425 | IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), |
439 | IEEE80211_CONF_RADIOTAP = (1<<1), | 426 | IEEE80211_CONF_RADIOTAP = (1<<1), |
440 | IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), | 427 | IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), |
428 | IEEE80211_CONF_PS = (1<<3), | ||
441 | }; | 429 | }; |
442 | 430 | ||
443 | /** | 431 | /** |
@@ -553,34 +541,38 @@ struct ieee80211_if_init_conf { | |||
553 | }; | 541 | }; |
554 | 542 | ||
555 | /** | 543 | /** |
544 | * enum ieee80211_if_conf_change - interface config change flags | ||
545 | * | ||
546 | * @IEEE80211_IFCC_BSSID: The BSSID changed. | ||
547 | * @IEEE80211_IFCC_SSID: The SSID changed. | ||
548 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed | ||
549 | * (currently AP and MESH only), use ieee80211_beacon_get(). | ||
550 | */ | ||
551 | enum ieee80211_if_conf_change { | ||
552 | IEEE80211_IFCC_BSSID = BIT(0), | ||
553 | IEEE80211_IFCC_SSID = BIT(1), | ||
554 | IEEE80211_IFCC_BEACON = BIT(2), | ||
555 | }; | ||
556 | |||
557 | /** | ||
556 | * struct ieee80211_if_conf - configuration of an interface | 558 | * struct ieee80211_if_conf - configuration of an interface |
557 | * | 559 | * |
558 | * @type: type of the interface. This is always the same as was specified in | 560 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. |
559 | * &struct ieee80211_if_init_conf. The type of an interface never changes | ||
560 | * during the life of the interface; this field is present only for | ||
561 | * convenience. | ||
562 | * @bssid: BSSID of the network we are associated to/creating. | 561 | * @bssid: BSSID of the network we are associated to/creating. |
563 | * @ssid: used (together with @ssid_len) by drivers for hardware that | 562 | * @ssid: used (together with @ssid_len) by drivers for hardware that |
564 | * generate beacons independently. The pointer is valid only during the | 563 | * generate beacons independently. The pointer is valid only during the |
565 | * config_interface() call, so copy the value somewhere if you need | 564 | * config_interface() call, so copy the value somewhere if you need |
566 | * it. | 565 | * it. |
567 | * @ssid_len: length of the @ssid field. | 566 | * @ssid_len: length of the @ssid field. |
568 | * @beacon: beacon template. Valid only if @host_gen_beacon_template in | ||
569 | * &struct ieee80211_hw is set. The driver is responsible of freeing | ||
570 | * the sk_buff. | ||
571 | * @beacon_control: tx_control for the beacon template, this field is only | ||
572 | * valid when the @beacon field was set. | ||
573 | * | 567 | * |
574 | * This structure is passed to the config_interface() callback of | 568 | * This structure is passed to the config_interface() callback of |
575 | * &struct ieee80211_hw. | 569 | * &struct ieee80211_hw. |
576 | */ | 570 | */ |
577 | struct ieee80211_if_conf { | 571 | struct ieee80211_if_conf { |
578 | int type; | 572 | u32 changed; |
579 | u8 *bssid; | 573 | u8 *bssid; |
580 | u8 *ssid; | 574 | u8 *ssid; |
581 | size_t ssid_len; | 575 | size_t ssid_len; |
582 | struct sk_buff *beacon; | ||
583 | struct ieee80211_tx_control *beacon_control; | ||
584 | }; | 576 | }; |
585 | 577 | ||
586 | /** | 578 | /** |
@@ -597,8 +589,8 @@ enum ieee80211_key_alg { | |||
597 | 589 | ||
598 | /** | 590 | /** |
599 | * enum ieee80211_key_len - key length | 591 | * enum ieee80211_key_len - key length |
600 | * @WEP40: WEP 5 byte long key | 592 | * @LEN_WEP40: WEP 5-byte long key |
601 | * @WEP104: WEP 13 byte long key | 593 | * @LEN_WEP104: WEP 13-byte long key |
602 | */ | 594 | */ |
603 | enum ieee80211_key_len { | 595 | enum ieee80211_key_len { |
604 | LEN_WEP40 = 5, | 596 | LEN_WEP40 = 5, |
@@ -619,11 +611,14 @@ enum ieee80211_key_len { | |||
619 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by | 611 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by |
620 | * the driver for a TKIP key if it requires Michael MIC | 612 | * the driver for a TKIP key if it requires Michael MIC |
621 | * generation in software. | 613 | * generation in software. |
614 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | ||
615 | * that the key is pairwise rather then a shared key. | ||
622 | */ | 616 | */ |
623 | enum ieee80211_key_flags { | 617 | enum ieee80211_key_flags { |
624 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, | 618 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, |
625 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, | 619 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, |
626 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, | 620 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, |
621 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, | ||
627 | }; | 622 | }; |
628 | 623 | ||
629 | /** | 624 | /** |
@@ -639,7 +634,12 @@ enum ieee80211_key_flags { | |||
639 | * @flags: key flags, see &enum ieee80211_key_flags. | 634 | * @flags: key flags, see &enum ieee80211_key_flags. |
640 | * @keyidx: the key index (0-3) | 635 | * @keyidx: the key index (0-3) |
641 | * @keylen: key material length | 636 | * @keylen: key material length |
642 | * @key: key material | 637 | * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) |
638 | * data block: | ||
639 | * - Temporal Encryption Key (128 bits) | ||
640 | * - Temporal Authenticator Tx MIC Key (64 bits) | ||
641 | * - Temporal Authenticator Rx MIC Key (64 bits) | ||
642 | * | ||
643 | */ | 643 | */ |
644 | struct ieee80211_key_conf { | 644 | struct ieee80211_key_conf { |
645 | enum ieee80211_key_alg alg; | 645 | enum ieee80211_key_alg alg; |
@@ -667,7 +667,7 @@ enum set_key_cmd { | |||
667 | * enum sta_notify_cmd - sta notify command | 667 | * enum sta_notify_cmd - sta notify command |
668 | * | 668 | * |
669 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 669 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
670 | * indicates addition and removal of a station to station table | 670 | * indicates addition and removal of a station to station table. |
671 | * | 671 | * |
672 | * @STA_NOTIFY_ADD: a station was added to the station table | 672 | * @STA_NOTIFY_ADD: a station was added to the station table |
673 | * @STA_NOTIFY_REMOVE: a station being removed from the station table | 673 | * @STA_NOTIFY_REMOVE: a station being removed from the station table |
@@ -700,15 +700,6 @@ enum ieee80211_tkip_key_type { | |||
700 | * any particular flags. There are some exceptions to this rule, | 700 | * any particular flags. There are some exceptions to this rule, |
701 | * however, so you are advised to review these flags carefully. | 701 | * however, so you are advised to review these flags carefully. |
702 | * | 702 | * |
703 | * @IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE: | ||
704 | * The device only needs to be supplied with a beacon template. | ||
705 | * If you need the host to generate each beacon then don't use | ||
706 | * this flag and call ieee80211_beacon_get() when you need the | ||
707 | * next beacon frame. Note that if you set this flag, you must | ||
708 | * implement the set_tim() callback for powersave mode to work | ||
709 | * properly. | ||
710 | * This flag is only relevant for access-point mode. | ||
711 | * | ||
712 | * @IEEE80211_HW_RX_INCLUDES_FCS: | 703 | * @IEEE80211_HW_RX_INCLUDES_FCS: |
713 | * Indicates that received frames passed to the stack include | 704 | * Indicates that received frames passed to the stack include |
714 | * the FCS at the end. | 705 | * the FCS at the end. |
@@ -730,6 +721,29 @@ enum ieee80211_tkip_key_type { | |||
730 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: | 721 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: |
731 | * Hardware is not capable of receiving frames with short preamble on | 722 | * Hardware is not capable of receiving frames with short preamble on |
732 | * the 2.4 GHz band. | 723 | * the 2.4 GHz band. |
724 | * | ||
725 | * @IEEE80211_HW_SIGNAL_UNSPEC: | ||
726 | * Hardware can provide signal values but we don't know its units. We | ||
727 | * expect values between 0 and @max_signal. | ||
728 | * If possible please provide dB or dBm instead. | ||
729 | * | ||
730 | * @IEEE80211_HW_SIGNAL_DB: | ||
731 | * Hardware gives signal values in dB, decibel difference from an | ||
732 | * arbitrary, fixed reference. We expect values between 0 and @max_signal. | ||
733 | * If possible please provide dBm instead. | ||
734 | * | ||
735 | * @IEEE80211_HW_SIGNAL_DBM: | ||
736 | * Hardware gives signal values in dBm, decibel difference from | ||
737 | * one milliwatt. This is the preferred method since it is standardized | ||
738 | * between different devices. @max_signal does not need to be set. | ||
739 | * | ||
740 | * @IEEE80211_HW_NOISE_DBM: | ||
741 | * Hardware can provide noise (radio interference) values in units dBm, | ||
742 | * decibel difference from one milliwatt. | ||
743 | * | ||
744 | * @IEEE80211_HW_SPECTRUM_MGMT: | ||
745 | * Hardware supports spectrum management defined in 802.11h | ||
746 | * Measurement, Channel Switch, Quieting, TPC | ||
733 | */ | 747 | */ |
734 | enum ieee80211_hw_flags { | 748 | enum ieee80211_hw_flags { |
735 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, | 749 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, |
@@ -737,6 +751,11 @@ enum ieee80211_hw_flags { | |||
737 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 751 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
738 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 752 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
739 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 753 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
754 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | ||
755 | IEEE80211_HW_SIGNAL_DB = 1<<6, | ||
756 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | ||
757 | IEEE80211_HW_NOISE_DBM = 1<<8, | ||
758 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, | ||
740 | }; | 759 | }; |
741 | 760 | ||
742 | /** | 761 | /** |
@@ -754,8 +773,11 @@ enum ieee80211_hw_flags { | |||
754 | * @conf: &struct ieee80211_conf, device configuration, don't use. | 773 | * @conf: &struct ieee80211_conf, device configuration, don't use. |
755 | * | 774 | * |
756 | * @workqueue: single threaded workqueue available for driver use, | 775 | * @workqueue: single threaded workqueue available for driver use, |
757 | * allocated by mac80211 on registration and flushed on | 776 | * allocated by mac80211 on registration and flushed when an |
758 | * unregistration. | 777 | * interface is removed. |
778 | * NOTICE: All work performed on this workqueue should NEVER | ||
779 | * acquire the RTNL lock (i.e. Don't use the function | ||
780 | * ieee80211_iterate_active_interfaces()) | ||
759 | * | 781 | * |
760 | * @priv: pointer to private area that was allocated for driver use | 782 | * @priv: pointer to private area that was allocated for driver use |
761 | * along with this structure. | 783 | * along with this structure. |
@@ -767,15 +789,18 @@ enum ieee80211_hw_flags { | |||
767 | * | 789 | * |
768 | * @channel_change_time: time (in microseconds) it takes to change channels. | 790 | * @channel_change_time: time (in microseconds) it takes to change channels. |
769 | * | 791 | * |
770 | * @max_rssi: Maximum value for ssi in RX information, use | 792 | * @max_signal: Maximum value for signal (rssi) in RX information, used |
771 | * negative numbers for dBm and 0 to indicate no support. | 793 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB |
772 | * | ||
773 | * @max_signal: like @max_rssi, but for the signal value. | ||
774 | * | ||
775 | * @max_noise: like @max_rssi, but for the noise value. | ||
776 | * | 794 | * |
777 | * @queues: number of available hardware transmit queues for | 795 | * @queues: number of available hardware transmit queues for |
778 | * data packets. WMM/QoS requires at least four. | 796 | * data packets. WMM/QoS requires at least four, these |
797 | * queues need to have configurable access parameters. | ||
798 | * | ||
799 | * @ampdu_queues: number of available hardware transmit queues | ||
800 | * for A-MPDU packets, these have no access parameters | ||
801 | * because they're used only for A-MPDU frames. Note that | ||
802 | * mac80211 will not currently use any of the regular queues | ||
803 | * for aggregation. | ||
779 | * | 804 | * |
780 | * @rate_control_algorithm: rate control algorithm for this hardware. | 805 | * @rate_control_algorithm: rate control algorithm for this hardware. |
781 | * If unset (NULL), the default algorithm will be used. Must be | 806 | * If unset (NULL), the default algorithm will be used. Must be |
@@ -794,10 +819,8 @@ struct ieee80211_hw { | |||
794 | unsigned int extra_tx_headroom; | 819 | unsigned int extra_tx_headroom; |
795 | int channel_change_time; | 820 | int channel_change_time; |
796 | int vif_data_size; | 821 | int vif_data_size; |
797 | u8 queues; | 822 | u16 queues, ampdu_queues; |
798 | s8 max_rssi; | ||
799 | s8 max_signal; | 823 | s8 max_signal; |
800 | s8 max_noise; | ||
801 | }; | 824 | }; |
802 | 825 | ||
803 | /** | 826 | /** |
@@ -822,6 +845,43 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr) | |||
822 | memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); | 845 | memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); |
823 | } | 846 | } |
824 | 847 | ||
848 | static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw) | ||
849 | { | ||
850 | return hw->queues; | ||
851 | } | ||
852 | |||
853 | static inline int ieee80211_num_queues(struct ieee80211_hw *hw) | ||
854 | { | ||
855 | return hw->queues + hw->ampdu_queues; | ||
856 | } | ||
857 | |||
858 | static inline struct ieee80211_rate * | ||
859 | ieee80211_get_tx_rate(const struct ieee80211_hw *hw, | ||
860 | const struct ieee80211_tx_info *c) | ||
861 | { | ||
862 | if (WARN_ON(c->tx_rate_idx < 0)) | ||
863 | return NULL; | ||
864 | return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; | ||
865 | } | ||
866 | |||
867 | static inline struct ieee80211_rate * | ||
868 | ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw, | ||
869 | const struct ieee80211_tx_info *c) | ||
870 | { | ||
871 | if (c->control.rts_cts_rate_idx < 0) | ||
872 | return NULL; | ||
873 | return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx]; | ||
874 | } | ||
875 | |||
876 | static inline struct ieee80211_rate * | ||
877 | ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | ||
878 | const struct ieee80211_tx_info *c) | ||
879 | { | ||
880 | if (c->control.alt_retry_rate_idx < 0) | ||
881 | return NULL; | ||
882 | return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; | ||
883 | } | ||
884 | |||
825 | /** | 885 | /** |
826 | * DOC: Hardware crypto acceleration | 886 | * DOC: Hardware crypto acceleration |
827 | * | 887 | * |
@@ -979,8 +1039,10 @@ enum ieee80211_ampdu_mlme_action { | |||
979 | * @tx: Handler that 802.11 module calls for each transmitted frame. | 1039 | * @tx: Handler that 802.11 module calls for each transmitted frame. |
980 | * skb contains the buffer starting from the IEEE 802.11 header. | 1040 | * skb contains the buffer starting from the IEEE 802.11 header. |
981 | * The low-level driver should send the frame out based on | 1041 | * The low-level driver should send the frame out based on |
982 | * configuration in the TX control data. Must be implemented and | 1042 | * configuration in the TX control data. This handler should, |
983 | * atomic. | 1043 | * preferably, never fail and stop queues appropriately, more |
1044 | * importantly, however, it must never fail for A-MPDU-queues. | ||
1045 | * Must be implemented and atomic. | ||
984 | * | 1046 | * |
985 | * @start: Called before the first netdevice attached to the hardware | 1047 | * @start: Called before the first netdevice attached to the hardware |
986 | * is enabled. This should turn on the hardware and must turn on | 1048 | * is enabled. This should turn on the hardware and must turn on |
@@ -1072,15 +1134,13 @@ enum ieee80211_ampdu_mlme_action { | |||
1072 | * of assocaited station or AP. | 1134 | * of assocaited station or AP. |
1073 | * | 1135 | * |
1074 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1136 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1075 | * bursting) for a hardware TX queue. The @queue parameter uses the | 1137 | * bursting) for a hardware TX queue. Must be atomic. |
1076 | * %IEEE80211_TX_QUEUE_* constants. Must be atomic. | ||
1077 | * | 1138 | * |
1078 | * @get_tx_stats: Get statistics of the current TX queue status. This is used | 1139 | * @get_tx_stats: Get statistics of the current TX queue status. This is used |
1079 | * to get number of currently queued packets (queue length), maximum queue | 1140 | * to get number of currently queued packets (queue length), maximum queue |
1080 | * size (limit), and total number of packets sent using each TX queue | 1141 | * size (limit), and total number of packets sent using each TX queue |
1081 | * (count). This information is used for WMM to find out which TX | 1142 | * (count). The 'stats' pointer points to an array that has hw->queues + |
1082 | * queues have room for more packets and by hostapd to provide | 1143 | * hw->ampdu_queues items. |
1083 | * statistics about the current queueing state to external programs. | ||
1084 | * | 1144 | * |
1085 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, | 1145 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, |
1086 | * this is only used for IBSS mode debugging and, as such, is not a | 1146 | * this is only used for IBSS mode debugging and, as such, is not a |
@@ -1091,17 +1151,6 @@ enum ieee80211_ampdu_mlme_action { | |||
1091 | * function is optional if the firmware/hardware takes full care of | 1151 | * function is optional if the firmware/hardware takes full care of |
1092 | * TSF synchronization. | 1152 | * TSF synchronization. |
1093 | * | 1153 | * |
1094 | * @beacon_update: Setup beacon data for IBSS beacons. Unlike access point, | ||
1095 | * IBSS uses a fixed beacon frame which is configured using this | ||
1096 | * function. | ||
1097 | * If the driver returns success (0) from this callback, it owns | ||
1098 | * the skb. That means the driver is responsible to kfree_skb() it. | ||
1099 | * The control structure is not dynamically allocated. That means the | ||
1100 | * driver does not own the pointer and if it needs it somewhere | ||
1101 | * outside of the context of this function, it must copy it | ||
1102 | * somewhere else. | ||
1103 | * This handler is required only for IBSS mode. | ||
1104 | * | ||
1105 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. | 1154 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. |
1106 | * This is needed only for IBSS mode and the result of this function is | 1155 | * This is needed only for IBSS mode and the result of this function is |
1107 | * used to determine whether to reply to Probe Requests. | 1156 | * used to determine whether to reply to Probe Requests. |
@@ -1116,8 +1165,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1116 | * that TX/RX_STOP can pass NULL for this parameter. | 1165 | * that TX/RX_STOP can pass NULL for this parameter. |
1117 | */ | 1166 | */ |
1118 | struct ieee80211_ops { | 1167 | struct ieee80211_ops { |
1119 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, | 1168 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
1120 | struct ieee80211_tx_control *control); | ||
1121 | int (*start)(struct ieee80211_hw *hw); | 1169 | int (*start)(struct ieee80211_hw *hw); |
1122 | void (*stop)(struct ieee80211_hw *hw); | 1170 | void (*stop)(struct ieee80211_hw *hw); |
1123 | int (*add_interface)(struct ieee80211_hw *hw, | 1171 | int (*add_interface)(struct ieee80211_hw *hw, |
@@ -1154,15 +1202,12 @@ struct ieee80211_ops { | |||
1154 | u32 short_retry, u32 long_retr); | 1202 | u32 short_retry, u32 long_retr); |
1155 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1203 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1156 | enum sta_notify_cmd, const u8 *addr); | 1204 | enum sta_notify_cmd, const u8 *addr); |
1157 | int (*conf_tx)(struct ieee80211_hw *hw, int queue, | 1205 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
1158 | const struct ieee80211_tx_queue_params *params); | 1206 | const struct ieee80211_tx_queue_params *params); |
1159 | int (*get_tx_stats)(struct ieee80211_hw *hw, | 1207 | int (*get_tx_stats)(struct ieee80211_hw *hw, |
1160 | struct ieee80211_tx_queue_stats *stats); | 1208 | struct ieee80211_tx_queue_stats *stats); |
1161 | u64 (*get_tsf)(struct ieee80211_hw *hw); | 1209 | u64 (*get_tsf)(struct ieee80211_hw *hw); |
1162 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1210 | void (*reset_tsf)(struct ieee80211_hw *hw); |
1163 | int (*beacon_update)(struct ieee80211_hw *hw, | ||
1164 | struct sk_buff *skb, | ||
1165 | struct ieee80211_tx_control *control); | ||
1166 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1211 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1167 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1212 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1168 | enum ieee80211_ampdu_mlme_action action, | 1213 | enum ieee80211_ampdu_mlme_action action, |
@@ -1292,7 +1337,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw); | |||
1292 | * | 1337 | * |
1293 | * This function frees everything that was allocated, including the | 1338 | * This function frees everything that was allocated, including the |
1294 | * private data for the driver. You must call ieee80211_unregister_hw() | 1339 | * private data for the driver. You must call ieee80211_unregister_hw() |
1295 | * before calling this function | 1340 | * before calling this function. |
1296 | * | 1341 | * |
1297 | * @hw: the hardware to free | 1342 | * @hw: the hardware to free |
1298 | */ | 1343 | */ |
@@ -1358,16 +1403,12 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1358 | * | 1403 | * |
1359 | * @hw: the hardware the frame was transmitted by | 1404 | * @hw: the hardware the frame was transmitted by |
1360 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1405 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1361 | * @status: status information for this frame; the status pointer need not | ||
1362 | * be valid after this function returns and is not freed by mac80211, | ||
1363 | * it is recommended that it points to a stack area | ||
1364 | */ | 1406 | */ |
1365 | void ieee80211_tx_status(struct ieee80211_hw *hw, | 1407 | void ieee80211_tx_status(struct ieee80211_hw *hw, |
1366 | struct sk_buff *skb, | 1408 | struct sk_buff *skb); |
1367 | struct ieee80211_tx_status *status); | ||
1368 | 1409 | ||
1369 | /** | 1410 | /** |
1370 | * ieee80211_tx_status_irqsafe - irq-safe transmit status callback | 1411 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback |
1371 | * | 1412 | * |
1372 | * Like ieee80211_tx_status() but can be called in IRQ context | 1413 | * Like ieee80211_tx_status() but can be called in IRQ context |
1373 | * (internally defers to a tasklet.) | 1414 | * (internally defers to a tasklet.) |
@@ -1377,13 +1418,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, | |||
1377 | * | 1418 | * |
1378 | * @hw: the hardware the frame was transmitted by | 1419 | * @hw: the hardware the frame was transmitted by |
1379 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1420 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1380 | * @status: status information for this frame; the status pointer need not | ||
1381 | * be valid after this function returns and is not freed by mac80211, | ||
1382 | * it is recommended that it points to a stack area | ||
1383 | */ | 1421 | */ |
1384 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | 1422 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, |
1385 | struct sk_buff *skb, | 1423 | struct sk_buff *skb); |
1386 | struct ieee80211_tx_status *status); | ||
1387 | 1424 | ||
1388 | /** | 1425 | /** |
1389 | * ieee80211_beacon_get - beacon generation function | 1426 | * ieee80211_beacon_get - beacon generation function |
@@ -1399,8 +1436,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
1399 | * is responsible of freeing it. | 1436 | * is responsible of freeing it. |
1400 | */ | 1437 | */ |
1401 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1438 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, |
1402 | struct ieee80211_vif *vif, | 1439 | struct ieee80211_vif *vif); |
1403 | struct ieee80211_tx_control *control); | ||
1404 | 1440 | ||
1405 | /** | 1441 | /** |
1406 | * ieee80211_rts_get - RTS frame generation function | 1442 | * ieee80211_rts_get - RTS frame generation function |
@@ -1408,7 +1444,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1408 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1444 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1409 | * @frame: pointer to the frame that is going to be protected by the RTS. | 1445 | * @frame: pointer to the frame that is going to be protected by the RTS. |
1410 | * @frame_len: the frame length (in octets). | 1446 | * @frame_len: the frame length (in octets). |
1411 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1447 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1412 | * @rts: The buffer where to store the RTS frame. | 1448 | * @rts: The buffer where to store the RTS frame. |
1413 | * | 1449 | * |
1414 | * If the RTS frames are generated by the host system (i.e., not in | 1450 | * If the RTS frames are generated by the host system (i.e., not in |
@@ -1418,7 +1454,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1418 | */ | 1454 | */ |
1419 | void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1455 | void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1420 | const void *frame, size_t frame_len, | 1456 | const void *frame, size_t frame_len, |
1421 | const struct ieee80211_tx_control *frame_txctl, | 1457 | const struct ieee80211_tx_info *frame_txctl, |
1422 | struct ieee80211_rts *rts); | 1458 | struct ieee80211_rts *rts); |
1423 | 1459 | ||
1424 | /** | 1460 | /** |
@@ -1426,7 +1462,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1426 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1462 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1427 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1463 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1428 | * @frame_len: the length of the frame that is going to be protected by the RTS. | 1464 | * @frame_len: the length of the frame that is going to be protected by the RTS. |
1429 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1465 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1430 | * | 1466 | * |
1431 | * If the RTS is generated in firmware, but the host system must provide | 1467 | * If the RTS is generated in firmware, but the host system must provide |
1432 | * the duration field, the low-level driver uses this function to receive | 1468 | * the duration field, the low-level driver uses this function to receive |
@@ -1434,7 +1470,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1434 | */ | 1470 | */ |
1435 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | 1471 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, |
1436 | struct ieee80211_vif *vif, size_t frame_len, | 1472 | struct ieee80211_vif *vif, size_t frame_len, |
1437 | const struct ieee80211_tx_control *frame_txctl); | 1473 | const struct ieee80211_tx_info *frame_txctl); |
1438 | 1474 | ||
1439 | /** | 1475 | /** |
1440 | * ieee80211_ctstoself_get - CTS-to-self frame generation function | 1476 | * ieee80211_ctstoself_get - CTS-to-self frame generation function |
@@ -1442,7 +1478,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | |||
1442 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1478 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1443 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. | 1479 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. |
1444 | * @frame_len: the frame length (in octets). | 1480 | * @frame_len: the frame length (in octets). |
1445 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1481 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1446 | * @cts: The buffer where to store the CTS-to-self frame. | 1482 | * @cts: The buffer where to store the CTS-to-self frame. |
1447 | * | 1483 | * |
1448 | * If the CTS-to-self frames are generated by the host system (i.e., not in | 1484 | * If the CTS-to-self frames are generated by the host system (i.e., not in |
@@ -1453,7 +1489,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | |||
1453 | void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | 1489 | void ieee80211_ctstoself_get(struct ieee80211_hw *hw, |
1454 | struct ieee80211_vif *vif, | 1490 | struct ieee80211_vif *vif, |
1455 | const void *frame, size_t frame_len, | 1491 | const void *frame, size_t frame_len, |
1456 | const struct ieee80211_tx_control *frame_txctl, | 1492 | const struct ieee80211_tx_info *frame_txctl, |
1457 | struct ieee80211_cts *cts); | 1493 | struct ieee80211_cts *cts); |
1458 | 1494 | ||
1459 | /** | 1495 | /** |
@@ -1461,7 +1497,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
1461 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1497 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1462 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1498 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1463 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. | 1499 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. |
1464 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1500 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1465 | * | 1501 | * |
1466 | * If the CTS-to-self is generated in firmware, but the host system must provide | 1502 | * If the CTS-to-self is generated in firmware, but the host system must provide |
1467 | * the duration field, the low-level driver uses this function to receive | 1503 | * the duration field, the low-level driver uses this function to receive |
@@ -1470,7 +1506,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
1470 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | 1506 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, |
1471 | struct ieee80211_vif *vif, | 1507 | struct ieee80211_vif *vif, |
1472 | size_t frame_len, | 1508 | size_t frame_len, |
1473 | const struct ieee80211_tx_control *frame_txctl); | 1509 | const struct ieee80211_tx_info *frame_txctl); |
1474 | 1510 | ||
1475 | /** | 1511 | /** |
1476 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame | 1512 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame |
@@ -1509,8 +1545,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | |||
1509 | * use common code for all beacons. | 1545 | * use common code for all beacons. |
1510 | */ | 1546 | */ |
1511 | struct sk_buff * | 1547 | struct sk_buff * |
1512 | ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1548 | ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
1513 | struct ieee80211_tx_control *control); | ||
1514 | 1549 | ||
1515 | /** | 1550 | /** |
1516 | * ieee80211_get_hdrlen_from_skb - get header length from data | 1551 | * ieee80211_get_hdrlen_from_skb - get header length from data |
@@ -1522,7 +1557,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1522 | * | 1557 | * |
1523 | * @skb: the frame | 1558 | * @skb: the frame |
1524 | */ | 1559 | */ |
1525 | int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | 1560 | unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); |
1526 | 1561 | ||
1527 | /** | 1562 | /** |
1528 | * ieee80211_get_hdrlen - get header length from frame control | 1563 | * ieee80211_get_hdrlen - get header length from frame control |
@@ -1535,6 +1570,12 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
1535 | int ieee80211_get_hdrlen(u16 fc); | 1570 | int ieee80211_get_hdrlen(u16 fc); |
1536 | 1571 | ||
1537 | /** | 1572 | /** |
1573 | * ieee80211_hdrlen - get header length in bytes from frame control | ||
1574 | * @fc: frame control field in little-endian format | ||
1575 | */ | ||
1576 | unsigned int ieee80211_hdrlen(__le16 fc); | ||
1577 | |||
1578 | /** | ||
1538 | * ieee80211_get_tkip_key - get a TKIP rc4 for skb | 1579 | * ieee80211_get_tkip_key - get a TKIP rc4 for skb |
1539 | * | 1580 | * |
1540 | * This function computes a TKIP rc4 key for an skb. It computes | 1581 | * This function computes a TKIP rc4 key for an skb. It computes |
@@ -1545,6 +1586,8 @@ int ieee80211_get_hdrlen(u16 fc); | |||
1545 | * @keyconf: the parameter passed with the set key | 1586 | * @keyconf: the parameter passed with the set key |
1546 | * @skb: the skb for which the key is needed | 1587 | * @skb: the skb for which the key is needed |
1547 | * @rc4key: a buffer to which the key will be written | 1588 | * @rc4key: a buffer to which the key will be written |
1589 | * @type: TBD | ||
1590 | * @key: TBD | ||
1548 | */ | 1591 | */ |
1549 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, | 1592 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, |
1550 | struct sk_buff *skb, | 1593 | struct sk_buff *skb, |
@@ -1568,14 +1611,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue); | |||
1568 | void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); | 1611 | void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); |
1569 | 1612 | ||
1570 | /** | 1613 | /** |
1571 | * ieee80211_start_queues - start all queues | ||
1572 | * @hw: pointer to as obtained from ieee80211_alloc_hw(). | ||
1573 | * | ||
1574 | * Drivers should use this function instead of netif_start_queue. | ||
1575 | */ | ||
1576 | void ieee80211_start_queues(struct ieee80211_hw *hw); | ||
1577 | |||
1578 | /** | ||
1579 | * ieee80211_stop_queues - stop all queues | 1614 | * ieee80211_stop_queues - stop all queues |
1580 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1615 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
1581 | * | 1616 | * |
@@ -1603,7 +1638,7 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
1603 | void ieee80211_scan_completed(struct ieee80211_hw *hw); | 1638 | void ieee80211_scan_completed(struct ieee80211_hw *hw); |
1604 | 1639 | ||
1605 | /** | 1640 | /** |
1606 | * ieee80211_iterate_active_interfaces- iterate active interfaces | 1641 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
1607 | * | 1642 | * |
1608 | * This function iterates over the interfaces associated with a given | 1643 | * This function iterates over the interfaces associated with a given |
1609 | * hardware that are currently active and calls the callback for them. | 1644 | * hardware that are currently active and calls the callback for them. |
@@ -1670,7 +1705,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | |||
1670 | * | 1705 | * |
1671 | * This function must be called by low level driver once it has | 1706 | * This function must be called by low level driver once it has |
1672 | * finished with preparations for the BA session. | 1707 | * finished with preparations for the BA session. |
1673 | * This version of the function is irq safe. | 1708 | * This version of the function is IRQ-safe. |
1674 | */ | 1709 | */ |
1675 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 1710 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, |
1676 | u16 tid); | 1711 | u16 tid); |
@@ -1710,7 +1745,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | |||
1710 | * | 1745 | * |
1711 | * This function must be called by low level driver once it has | 1746 | * This function must be called by low level driver once it has |
1712 | * finished with preparations for the BA session tear down. | 1747 | * finished with preparations for the BA session tear down. |
1713 | * This version of the function is irq safe. | 1748 | * This version of the function is IRQ-safe. |
1714 | */ | 1749 | */ |
1715 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 1750 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, |
1716 | u16 tid); | 1751 | u16 tid); |
@@ -1718,7 +1753,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
1718 | /** | 1753 | /** |
1719 | * ieee80211_notify_mac - low level driver notification | 1754 | * ieee80211_notify_mac - low level driver notification |
1720 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1755 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
1721 | * @notification_types: enum ieee80211_notification_types | 1756 | * @notif_type: enum ieee80211_notification_types |
1722 | * | 1757 | * |
1723 | * This function must be called by low level driver to inform mac80211 of | 1758 | * This function must be called by low level driver to inform mac80211 of |
1724 | * low level driver status change or force mac80211 to re-assoc for low | 1759 | * low level driver status change or force mac80211 to re-assoc for low |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index dc420fecafb9..aa4b708654a4 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -75,7 +75,7 @@ struct neigh_statistics | |||
75 | unsigned long destroys; /* number of destroyed neighs */ | 75 | unsigned long destroys; /* number of destroyed neighs */ |
76 | unsigned long hash_grows; /* number of hash resizes */ | 76 | unsigned long hash_grows; /* number of hash resizes */ |
77 | 77 | ||
78 | unsigned long res_failed; /* nomber of failed resolutions */ | 78 | unsigned long res_failed; /* number of failed resolutions */ |
79 | 79 | ||
80 | unsigned long lookups; /* number of lookups */ | 80 | unsigned long lookups; /* number of lookups */ |
81 | unsigned long hits; /* number of hits (among lookups) */ | 81 | unsigned long hits; /* number of hits (among lookups) */ |
@@ -85,6 +85,8 @@ struct neigh_statistics | |||
85 | 85 | ||
86 | unsigned long periodic_gc_runs; /* number of periodic GC runs */ | 86 | unsigned long periodic_gc_runs; /* number of periodic GC runs */ |
87 | unsigned long forced_gc_runs; /* number of forced GC runs */ | 87 | unsigned long forced_gc_runs; /* number of forced GC runs */ |
88 | |||
89 | unsigned long unres_discards; /* number of unresolved drops */ | ||
88 | }; | 90 | }; |
89 | 91 | ||
90 | #define NEIGH_CACHE_STAT_INC(tbl, field) \ | 92 | #define NEIGH_CACHE_STAT_INC(tbl, field) \ |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index d9dd0f707296..3855620b78a9 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | 10 | ||
11 | #include <net/netns/core.h> | 11 | #include <net/netns/core.h> |
12 | #include <net/netns/mib.h> | ||
12 | #include <net/netns/unix.h> | 13 | #include <net/netns/unix.h> |
13 | #include <net/netns/packet.h> | 14 | #include <net/netns/packet.h> |
14 | #include <net/netns/ipv4.h> | 15 | #include <net/netns/ipv4.h> |
@@ -52,6 +53,7 @@ struct net { | |||
52 | struct sock *rtnl; /* rtnetlink socket */ | 53 | struct sock *rtnl; /* rtnetlink socket */ |
53 | 54 | ||
54 | struct netns_core core; | 55 | struct netns_core core; |
56 | struct netns_mib mib; | ||
55 | struct netns_packet packet; | 57 | struct netns_packet packet; |
56 | struct netns_unix unx; | 58 | struct netns_unix unx; |
57 | struct netns_ipv4 ipv4; | 59 | struct netns_ipv4 ipv4; |
@@ -212,8 +214,11 @@ extern void unregister_pernet_gen_device(int id, struct pernet_operations *); | |||
212 | struct ctl_path; | 214 | struct ctl_path; |
213 | struct ctl_table; | 215 | struct ctl_table; |
214 | struct ctl_table_header; | 216 | struct ctl_table_header; |
217 | |||
215 | extern struct ctl_table_header *register_net_sysctl_table(struct net *net, | 218 | extern struct ctl_table_header *register_net_sysctl_table(struct net *net, |
216 | const struct ctl_path *path, struct ctl_table *table); | 219 | const struct ctl_path *path, struct ctl_table *table); |
220 | extern struct ctl_table_header *register_net_sysctl_rotable( | ||
221 | const struct ctl_path *path, struct ctl_table *table); | ||
217 | extern void unregister_net_sysctl_table(struct ctl_table_header *header); | 222 | extern void unregister_net_sysctl_table(struct ctl_table_header *header); |
218 | 223 | ||
219 | #endif /* __NET_NET_NAMESPACE_H */ | 224 | #endif /* __NET_NET_NAMESPACE_H */ |
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h index 9bf059817aec..7573d52a4346 100644 --- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h +++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #ifndef _NF_CONNTRACK_IPV4_H | 9 | #ifndef _NF_CONNTRACK_IPV4_H |
10 | #define _NF_CONNTRACK_IPV4_H | 10 | #define _NF_CONNTRACK_IPV4_H |
11 | 11 | ||
12 | /* Returns new sk_buff, or NULL */ | ||
13 | struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); | ||
14 | 12 | ||
15 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; | 13 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; |
16 | 14 | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 2dbd6c015b94..0741ad592da0 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -88,7 +88,6 @@ struct nf_conn_help { | |||
88 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; | 88 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | |||
92 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 91 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
93 | #include <net/netfilter/ipv6/nf_conntrack_ipv6.h> | 92 | #include <net/netfilter/ipv6/nf_conntrack_ipv6.h> |
94 | 93 | ||
@@ -111,11 +110,6 @@ struct nf_conn | |||
111 | /* Timer function; drops refcnt when it goes off. */ | 110 | /* Timer function; drops refcnt when it goes off. */ |
112 | struct timer_list timeout; | 111 | struct timer_list timeout; |
113 | 112 | ||
114 | #ifdef CONFIG_NF_CT_ACCT | ||
115 | /* Accounting Information (same cache line as other written members) */ | ||
116 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | ||
117 | #endif | ||
118 | |||
119 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 113 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
120 | u_int32_t mark; | 114 | u_int32_t mark; |
121 | #endif | 115 | #endif |
@@ -223,6 +217,25 @@ static inline void nf_ct_refresh(struct nf_conn *ct, | |||
223 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | 217 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); |
224 | } | 218 | } |
225 | 219 | ||
220 | extern bool __nf_ct_kill_acct(struct nf_conn *ct, | ||
221 | enum ip_conntrack_info ctinfo, | ||
222 | const struct sk_buff *skb, | ||
223 | int do_acct); | ||
224 | |||
225 | /* kill conntrack and do accounting */ | ||
226 | static inline bool nf_ct_kill_acct(struct nf_conn *ct, | ||
227 | enum ip_conntrack_info ctinfo, | ||
228 | const struct sk_buff *skb) | ||
229 | { | ||
230 | return __nf_ct_kill_acct(ct, ctinfo, skb, 1); | ||
231 | } | ||
232 | |||
233 | /* kill conntrack without accounting */ | ||
234 | static inline bool nf_ct_kill(struct nf_conn *ct) | ||
235 | { | ||
236 | return __nf_ct_kill_acct(ct, 0, NULL, 0); | ||
237 | } | ||
238 | |||
226 | /* These are for NAT. Icky. */ | 239 | /* These are for NAT. Icky. */ |
227 | /* Update TCP window tracking data when NAT mangles the packet */ | 240 | /* Update TCP window tracking data when NAT mangles the packet */ |
228 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, | 241 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, |
@@ -239,7 +252,8 @@ nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data), void *data); | |||
239 | extern void nf_conntrack_free(struct nf_conn *ct); | 252 | extern void nf_conntrack_free(struct nf_conn *ct); |
240 | extern struct nf_conn * | 253 | extern struct nf_conn * |
241 | nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, | 254 | nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, |
242 | const struct nf_conntrack_tuple *repl); | 255 | const struct nf_conntrack_tuple *repl, |
256 | gfp_t gfp); | ||
243 | 257 | ||
244 | /* It's confirmed if it is, or has been in the hash table. */ | 258 | /* It's confirmed if it is, or has been in the hash table. */ |
245 | static inline int nf_ct_is_confirmed(struct nf_conn *ct) | 259 | static inline int nf_ct_is_confirmed(struct nf_conn *ct) |
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h new file mode 100644 index 000000000000..5d5ae55d54c4 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_acct.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * (C) 2008 Krzysztof Piotr Oledzki <ole@ans.pl> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef _NF_CONNTRACK_ACCT_H | ||
10 | #define _NF_CONNTRACK_ACCT_H | ||
11 | #include <linux/netfilter/nf_conntrack_common.h> | ||
12 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
13 | #include <net/netfilter/nf_conntrack.h> | ||
14 | #include <net/netfilter/nf_conntrack_extend.h> | ||
15 | |||
16 | struct nf_conn_counter { | ||
17 | u_int64_t packets; | ||
18 | u_int64_t bytes; | ||
19 | }; | ||
20 | |||
21 | extern int nf_ct_acct; | ||
22 | |||
23 | static inline | ||
24 | struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct) | ||
25 | { | ||
26 | return nf_ct_ext_find(ct, NF_CT_EXT_ACCT); | ||
27 | } | ||
28 | |||
29 | static inline | ||
30 | struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) | ||
31 | { | ||
32 | struct nf_conn_counter *acct; | ||
33 | |||
34 | if (!nf_ct_acct) | ||
35 | return NULL; | ||
36 | |||
37 | acct = nf_ct_ext_add(ct, NF_CT_EXT_ACCT, gfp); | ||
38 | if (!acct) | ||
39 | pr_debug("failed to add accounting extension area"); | ||
40 | |||
41 | |||
42 | return acct; | ||
43 | }; | ||
44 | |||
45 | extern unsigned int | ||
46 | seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); | ||
47 | |||
48 | extern int nf_conntrack_acct_init(void); | ||
49 | extern void nf_conntrack_acct_fini(void); | ||
50 | |||
51 | #endif /* _NF_CONNTRACK_ACCT_H */ | ||
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index f80c0ed6d870..da8ee52613a5 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -7,11 +7,13 @@ enum nf_ct_ext_id | |||
7 | { | 7 | { |
8 | NF_CT_EXT_HELPER, | 8 | NF_CT_EXT_HELPER, |
9 | NF_CT_EXT_NAT, | 9 | NF_CT_EXT_NAT, |
10 | NF_CT_EXT_ACCT, | ||
10 | NF_CT_EXT_NUM, | 11 | NF_CT_EXT_NUM, |
11 | }; | 12 | }; |
12 | 13 | ||
13 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help | 14 | #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help |
14 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat | 15 | #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat |
16 | #define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter | ||
15 | 17 | ||
16 | /* Extensions: optional stuff which isn't permanently in struct. */ | 18 | /* Extensions: optional stuff which isn't permanently in struct. */ |
17 | struct nf_ct_ext { | 19 | struct nf_ct_ext { |
diff --git a/include/net/netlink.h b/include/net/netlink.h index dfc3701dfcc3..18024b8cecb8 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -896,6 +896,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
896 | #define NLA_PUT_U64(skb, attrtype, value) \ | 896 | #define NLA_PUT_U64(skb, attrtype, value) \ |
897 | NLA_PUT_TYPE(skb, u64, attrtype, value) | 897 | NLA_PUT_TYPE(skb, u64, attrtype, value) |
898 | 898 | ||
899 | #define NLA_PUT_BE64(skb, attrtype, value) \ | ||
900 | NLA_PUT_TYPE(skb, __be64, attrtype, value) | ||
901 | |||
899 | #define NLA_PUT_STRING(skb, attrtype, value) \ | 902 | #define NLA_PUT_STRING(skb, attrtype, value) \ |
900 | NLA_PUT(skb, attrtype, strlen(value) + 1, value) | 903 | NLA_PUT(skb, attrtype, strlen(value) + 1, value) |
901 | 904 | ||
diff --git a/include/net/netns/hash.h b/include/net/netns/hash.h new file mode 100644 index 000000000000..548d78f2cc47 --- /dev/null +++ b/include/net/netns/hash.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef __NET_NS_HASH_H__ | ||
2 | #define __NET_NS_HASH_H__ | ||
3 | |||
4 | #include <asm/cache.h> | ||
5 | |||
6 | struct net; | ||
7 | |||
8 | static inline unsigned net_hash_mix(struct net *net) | ||
9 | { | ||
10 | #ifdef CONFIG_NET_NS | ||
11 | /* | ||
12 | * shift this right to eliminate bits, that are | ||
13 | * always zeroed | ||
14 | */ | ||
15 | |||
16 | return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT); | ||
17 | #else | ||
18 | return 0; | ||
19 | #endif | ||
20 | } | ||
21 | #endif | ||
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 34ee348a2cf2..a6ed83853dcc 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -18,6 +18,7 @@ struct netns_ipv4 { | |||
18 | struct ctl_table_header *forw_hdr; | 18 | struct ctl_table_header *forw_hdr; |
19 | struct ctl_table_header *frags_hdr; | 19 | struct ctl_table_header *frags_hdr; |
20 | struct ctl_table_header *ipv4_hdr; | 20 | struct ctl_table_header *ipv4_hdr; |
21 | struct ctl_table_header *route_hdr; | ||
21 | #endif | 22 | #endif |
22 | struct ipv4_devconf *devconf_all; | 23 | struct ipv4_devconf *devconf_all; |
23 | struct ipv4_devconf *devconf_dflt; | 24 | struct ipv4_devconf *devconf_dflt; |
@@ -36,6 +37,7 @@ struct netns_ipv4 { | |||
36 | struct xt_table *iptable_mangle; | 37 | struct xt_table *iptable_mangle; |
37 | struct xt_table *iptable_raw; | 38 | struct xt_table *iptable_raw; |
38 | struct xt_table *arptable_filter; | 39 | struct xt_table *arptable_filter; |
40 | struct xt_table *iptable_security; | ||
39 | #endif | 41 | #endif |
40 | 42 | ||
41 | int sysctl_icmp_echo_ignore_all; | 43 | int sysctl_icmp_echo_ignore_all; |
@@ -44,5 +46,8 @@ struct netns_ipv4 { | |||
44 | int sysctl_icmp_ratelimit; | 46 | int sysctl_icmp_ratelimit; |
45 | int sysctl_icmp_ratemask; | 47 | int sysctl_icmp_ratemask; |
46 | int sysctl_icmp_errors_use_inbound_ifaddr; | 48 | int sysctl_icmp_errors_use_inbound_ifaddr; |
49 | |||
50 | struct timer_list rt_secret_timer; | ||
51 | atomic_t rt_genid; | ||
47 | }; | 52 | }; |
48 | #endif | 53 | #endif |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index ac053be6c256..2932721180c0 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -35,10 +35,11 @@ struct netns_ipv6 { | |||
35 | struct xt_table *ip6table_filter; | 35 | struct xt_table *ip6table_filter; |
36 | struct xt_table *ip6table_mangle; | 36 | struct xt_table *ip6table_mangle; |
37 | struct xt_table *ip6table_raw; | 37 | struct xt_table *ip6table_raw; |
38 | struct xt_table *ip6table_security; | ||
38 | #endif | 39 | #endif |
39 | struct rt6_info *ip6_null_entry; | 40 | struct rt6_info *ip6_null_entry; |
40 | struct rt6_statistics *rt6_stats; | 41 | struct rt6_statistics *rt6_stats; |
41 | struct timer_list *ip6_fib_timer; | 42 | struct timer_list ip6_fib_timer; |
42 | struct hlist_head *fib_table_hash; | 43 | struct hlist_head *fib_table_hash; |
43 | struct fib6_table *fib6_main_tbl; | 44 | struct fib6_table *fib6_main_tbl; |
44 | struct dst_ops *ip6_dst_ops; | 45 | struct dst_ops *ip6_dst_ops; |
diff --git a/include/net/netns/mib.h b/include/net/netns/mib.h new file mode 100644 index 000000000000..449147604642 --- /dev/null +++ b/include/net/netns/mib.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __NETNS_MIB_H__ | ||
2 | #define __NETNS_MIB_H__ | ||
3 | |||
4 | #include <net/snmp.h> | ||
5 | |||
6 | struct netns_mib { | ||
7 | DEFINE_SNMP_STAT(struct tcp_mib, tcp_statistics); | ||
8 | DEFINE_SNMP_STAT(struct ipstats_mib, ip_statistics); | ||
9 | DEFINE_SNMP_STAT(struct linux_mib, net_statistics); | ||
10 | DEFINE_SNMP_STAT(struct udp_mib, udp_statistics); | ||
11 | DEFINE_SNMP_STAT(struct udp_mib, udplite_statistics); | ||
12 | DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); | ||
13 | DEFINE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); | ||
14 | }; | ||
15 | |||
16 | #endif | ||
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 46fb4d80c74a..6affcfaa123e 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -72,6 +72,10 @@ extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); | |||
72 | extern struct Qdisc_ops pfifo_qdisc_ops; | 72 | extern struct Qdisc_ops pfifo_qdisc_ops; |
73 | extern struct Qdisc_ops bfifo_qdisc_ops; | 73 | extern struct Qdisc_ops bfifo_qdisc_ops; |
74 | 74 | ||
75 | extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); | ||
76 | extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, | ||
77 | unsigned int limit); | ||
78 | |||
75 | extern int register_qdisc(struct Qdisc_ops *qops); | 79 | extern int register_qdisc(struct Qdisc_ops *qops); |
76 | extern int unregister_qdisc(struct Qdisc_ops *qops); | 80 | extern int unregister_qdisc(struct Qdisc_ops *qops); |
77 | extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); | 81 | extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); |
@@ -79,14 +83,14 @@ extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); | |||
79 | extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, | 83 | extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, |
80 | struct nlattr *tab); | 84 | struct nlattr *tab); |
81 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 85 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
86 | extern void qdisc_put_stab(struct qdisc_size_table *tab); | ||
82 | 87 | ||
83 | extern void __qdisc_run(struct net_device *dev); | 88 | extern void __qdisc_run(struct Qdisc *q); |
84 | 89 | ||
85 | static inline void qdisc_run(struct net_device *dev) | 90 | static inline void qdisc_run(struct Qdisc *q) |
86 | { | 91 | { |
87 | if (!netif_queue_stopped(dev) && | 92 | if (!test_and_set_bit(__QDISC_STATE_RUNNING, &q->state)) |
88 | !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state)) | 93 | __qdisc_run(q); |
89 | __qdisc_run(dev); | ||
90 | } | 94 | } |
91 | 95 | ||
92 | extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, | 96 | extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, |
diff --git a/include/net/rose.h b/include/net/rose.h index e5bb084d8754..cbd5364b2c8a 100644 --- a/include/net/rose.h +++ b/include/net/rose.h | |||
@@ -201,7 +201,7 @@ extern void rose_link_device_down(struct net_device *); | |||
201 | extern struct net_device *rose_dev_first(void); | 201 | extern struct net_device *rose_dev_first(void); |
202 | extern struct net_device *rose_dev_get(rose_address *); | 202 | extern struct net_device *rose_dev_get(rose_address *); |
203 | extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); | 203 | extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); |
204 | extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *); | 204 | extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *, int); |
205 | extern int rose_rt_ioctl(unsigned int, void __user *); | 205 | extern int rose_rt_ioctl(unsigned int, void __user *); |
206 | extern void rose_link_failed(ax25_cb *, int); | 206 | extern void rose_link_failed(ax25_cb *, int); |
207 | extern int rose_route_frame(struct sk_buff *, ax25_cb *); | 207 | extern int rose_route_frame(struct sk_buff *, ax25_cb *); |
diff --git a/include/net/route.h b/include/net/route.h index fc836ff824cc..3140cc500854 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -111,7 +111,7 @@ struct in_device; | |||
111 | extern int ip_rt_init(void); | 111 | extern int ip_rt_init(void); |
112 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 112 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
113 | __be32 src, struct net_device *dev); | 113 | __be32 src, struct net_device *dev); |
114 | extern void rt_cache_flush(int how); | 114 | extern void rt_cache_flush(struct net *net, int how); |
115 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 115 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
116 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 116 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
117 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 117 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a87fc0312edc..b5f40d7ef724 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -23,6 +23,19 @@ struct qdisc_rate_table | |||
23 | int refcnt; | 23 | int refcnt; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | enum qdisc_state_t | ||
27 | { | ||
28 | __QDISC_STATE_RUNNING, | ||
29 | __QDISC_STATE_SCHED, | ||
30 | }; | ||
31 | |||
32 | struct qdisc_size_table { | ||
33 | struct list_head list; | ||
34 | struct tc_sizespec szopts; | ||
35 | int refcnt; | ||
36 | u16 data[]; | ||
37 | }; | ||
38 | |||
26 | struct Qdisc | 39 | struct Qdisc |
27 | { | 40 | { |
28 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); | 41 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); |
@@ -33,21 +46,26 @@ struct Qdisc | |||
33 | #define TCQ_F_INGRESS 4 | 46 | #define TCQ_F_INGRESS 4 |
34 | int padded; | 47 | int padded; |
35 | struct Qdisc_ops *ops; | 48 | struct Qdisc_ops *ops; |
49 | struct qdisc_size_table *stab; | ||
36 | u32 handle; | 50 | u32 handle; |
37 | u32 parent; | 51 | u32 parent; |
38 | atomic_t refcnt; | 52 | atomic_t refcnt; |
53 | unsigned long state; | ||
54 | struct sk_buff *gso_skb; | ||
39 | struct sk_buff_head q; | 55 | struct sk_buff_head q; |
40 | struct net_device *dev; | 56 | struct netdev_queue *dev_queue; |
57 | struct Qdisc *next_sched; | ||
41 | struct list_head list; | 58 | struct list_head list; |
42 | 59 | ||
43 | struct gnet_stats_basic bstats; | 60 | struct gnet_stats_basic bstats; |
44 | struct gnet_stats_queue qstats; | 61 | struct gnet_stats_queue qstats; |
45 | struct gnet_stats_rate_est rate_est; | 62 | struct gnet_stats_rate_est rate_est; |
46 | spinlock_t *stats_lock; | ||
47 | struct rcu_head q_rcu; | 63 | struct rcu_head q_rcu; |
48 | int (*reshape_fail)(struct sk_buff *skb, | 64 | int (*reshape_fail)(struct sk_buff *skb, |
49 | struct Qdisc *q); | 65 | struct Qdisc *q); |
50 | 66 | ||
67 | void *u32_node; | ||
68 | |||
51 | /* This field is deprecated, but it is still used by CBQ | 69 | /* This field is deprecated, but it is still used by CBQ |
52 | * and it will live until better solution will be invented. | 70 | * and it will live until better solution will be invented. |
53 | */ | 71 | */ |
@@ -155,18 +173,96 @@ struct tcf_proto | |||
155 | struct tcf_proto_ops *ops; | 173 | struct tcf_proto_ops *ops; |
156 | }; | 174 | }; |
157 | 175 | ||
176 | struct qdisc_skb_cb { | ||
177 | unsigned int pkt_len; | ||
178 | char data[]; | ||
179 | }; | ||
180 | |||
181 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) | ||
182 | { | ||
183 | return (struct qdisc_skb_cb *)skb->cb; | ||
184 | } | ||
158 | 185 | ||
159 | extern void qdisc_lock_tree(struct net_device *dev); | 186 | static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc) |
160 | extern void qdisc_unlock_tree(struct net_device *dev); | 187 | { |
188 | return &qdisc->q.lock; | ||
189 | } | ||
161 | 190 | ||
162 | #define sch_tree_lock(q) qdisc_lock_tree((q)->dev) | 191 | static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) |
163 | #define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev) | 192 | { |
164 | #define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) | 193 | return qdisc->dev_queue->qdisc; |
165 | #define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) | 194 | } |
195 | |||
196 | static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) | ||
197 | { | ||
198 | struct Qdisc *root = qdisc_root(qdisc); | ||
199 | |||
200 | return qdisc_lock(root); | ||
201 | } | ||
202 | |||
203 | static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) | ||
204 | { | ||
205 | return qdisc->dev_queue->dev; | ||
206 | } | ||
207 | |||
208 | static inline void sch_tree_lock(struct Qdisc *q) | ||
209 | { | ||
210 | spin_lock_bh(qdisc_root_lock(q)); | ||
211 | } | ||
212 | |||
213 | static inline void sch_tree_unlock(struct Qdisc *q) | ||
214 | { | ||
215 | spin_unlock_bh(qdisc_root_lock(q)); | ||
216 | } | ||
217 | |||
218 | #define tcf_tree_lock(tp) sch_tree_lock((tp)->q) | ||
219 | #define tcf_tree_unlock(tp) sch_tree_unlock((tp)->q) | ||
166 | 220 | ||
167 | extern struct Qdisc noop_qdisc; | 221 | extern struct Qdisc noop_qdisc; |
168 | extern struct Qdisc_ops noop_qdisc_ops; | 222 | extern struct Qdisc_ops noop_qdisc_ops; |
169 | 223 | ||
224 | struct Qdisc_class_common | ||
225 | { | ||
226 | u32 classid; | ||
227 | struct hlist_node hnode; | ||
228 | }; | ||
229 | |||
230 | struct Qdisc_class_hash | ||
231 | { | ||
232 | struct hlist_head *hash; | ||
233 | unsigned int hashsize; | ||
234 | unsigned int hashmask; | ||
235 | unsigned int hashelems; | ||
236 | }; | ||
237 | |||
238 | static inline unsigned int qdisc_class_hash(u32 id, u32 mask) | ||
239 | { | ||
240 | id ^= id >> 8; | ||
241 | id ^= id >> 4; | ||
242 | return id & mask; | ||
243 | } | ||
244 | |||
245 | static inline struct Qdisc_class_common * | ||
246 | qdisc_class_find(struct Qdisc_class_hash *hash, u32 id) | ||
247 | { | ||
248 | struct Qdisc_class_common *cl; | ||
249 | struct hlist_node *n; | ||
250 | unsigned int h; | ||
251 | |||
252 | h = qdisc_class_hash(id, hash->hashmask); | ||
253 | hlist_for_each_entry(cl, n, &hash->hash[h], hnode) { | ||
254 | if (cl->classid == id) | ||
255 | return cl; | ||
256 | } | ||
257 | return NULL; | ||
258 | } | ||
259 | |||
260 | extern int qdisc_class_hash_init(struct Qdisc_class_hash *); | ||
261 | extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *); | ||
262 | extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *); | ||
263 | extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *); | ||
264 | extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *); | ||
265 | |||
170 | extern void dev_init_scheduler(struct net_device *dev); | 266 | extern void dev_init_scheduler(struct net_device *dev); |
171 | extern void dev_shutdown(struct net_device *dev); | 267 | extern void dev_shutdown(struct net_device *dev); |
172 | extern void dev_activate(struct net_device *dev); | 268 | extern void dev_activate(struct net_device *dev); |
@@ -174,18 +270,88 @@ extern void dev_deactivate(struct net_device *dev); | |||
174 | extern void qdisc_reset(struct Qdisc *qdisc); | 270 | extern void qdisc_reset(struct Qdisc *qdisc); |
175 | extern void qdisc_destroy(struct Qdisc *qdisc); | 271 | extern void qdisc_destroy(struct Qdisc *qdisc); |
176 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); | 272 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); |
177 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); | 273 | extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, |
274 | struct Qdisc_ops *ops); | ||
178 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | 275 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, |
276 | struct netdev_queue *dev_queue, | ||
179 | struct Qdisc_ops *ops, u32 parentid); | 277 | struct Qdisc_ops *ops, u32 parentid); |
278 | extern void qdisc_calculate_pkt_len(struct sk_buff *skb, | ||
279 | struct qdisc_size_table *stab); | ||
180 | extern void tcf_destroy(struct tcf_proto *tp); | 280 | extern void tcf_destroy(struct tcf_proto *tp); |
181 | extern void tcf_destroy_chain(struct tcf_proto **fl); | 281 | extern void tcf_destroy_chain(struct tcf_proto **fl); |
182 | 282 | ||
283 | /* Reset all TX qdiscs of a device. */ | ||
284 | static inline void qdisc_reset_all_tx(struct net_device *dev) | ||
285 | { | ||
286 | unsigned int i; | ||
287 | for (i = 0; i < dev->num_tx_queues; i++) | ||
288 | qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc); | ||
289 | } | ||
290 | |||
291 | /* Are all TX queues of the device empty? */ | ||
292 | static inline bool qdisc_all_tx_empty(const struct net_device *dev) | ||
293 | { | ||
294 | unsigned int i; | ||
295 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
296 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
297 | const struct Qdisc *q = txq->qdisc; | ||
298 | |||
299 | if (q->q.qlen) | ||
300 | return false; | ||
301 | } | ||
302 | return true; | ||
303 | } | ||
304 | |||
305 | /* Are any of the TX qdiscs changing? */ | ||
306 | static inline bool qdisc_tx_changing(struct net_device *dev) | ||
307 | { | ||
308 | unsigned int i; | ||
309 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
310 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
311 | if (txq->qdisc != txq->qdisc_sleeping) | ||
312 | return true; | ||
313 | } | ||
314 | return false; | ||
315 | } | ||
316 | |||
317 | /* Is the device using the noop qdisc on all queues? */ | ||
318 | static inline bool qdisc_tx_is_noop(const struct net_device *dev) | ||
319 | { | ||
320 | unsigned int i; | ||
321 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
322 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
323 | if (txq->qdisc != &noop_qdisc) | ||
324 | return false; | ||
325 | } | ||
326 | return true; | ||
327 | } | ||
328 | |||
329 | static inline unsigned int qdisc_pkt_len(struct sk_buff *skb) | ||
330 | { | ||
331 | return qdisc_skb_cb(skb)->pkt_len; | ||
332 | } | ||
333 | |||
334 | static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | ||
335 | { | ||
336 | #ifdef CONFIG_NET_SCHED | ||
337 | if (sch->stab) | ||
338 | qdisc_calculate_pkt_len(skb, sch->stab); | ||
339 | #endif | ||
340 | return sch->enqueue(skb, sch); | ||
341 | } | ||
342 | |||
343 | static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) | ||
344 | { | ||
345 | qdisc_skb_cb(skb)->pkt_len = skb->len; | ||
346 | return qdisc_enqueue(skb, sch); | ||
347 | } | ||
348 | |||
183 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 349 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
184 | struct sk_buff_head *list) | 350 | struct sk_buff_head *list) |
185 | { | 351 | { |
186 | __skb_queue_tail(list, skb); | 352 | __skb_queue_tail(list, skb); |
187 | sch->qstats.backlog += skb->len; | 353 | sch->qstats.backlog += qdisc_pkt_len(skb); |
188 | sch->bstats.bytes += skb->len; | 354 | sch->bstats.bytes += qdisc_pkt_len(skb); |
189 | sch->bstats.packets++; | 355 | sch->bstats.packets++; |
190 | 356 | ||
191 | return NET_XMIT_SUCCESS; | 357 | return NET_XMIT_SUCCESS; |
@@ -202,7 +368,7 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch, | |||
202 | struct sk_buff *skb = __skb_dequeue(list); | 368 | struct sk_buff *skb = __skb_dequeue(list); |
203 | 369 | ||
204 | if (likely(skb != NULL)) | 370 | if (likely(skb != NULL)) |
205 | sch->qstats.backlog -= skb->len; | 371 | sch->qstats.backlog -= qdisc_pkt_len(skb); |
206 | 372 | ||
207 | return skb; | 373 | return skb; |
208 | } | 374 | } |
@@ -218,7 +384,7 @@ static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch, | |||
218 | struct sk_buff *skb = __skb_dequeue_tail(list); | 384 | struct sk_buff *skb = __skb_dequeue_tail(list); |
219 | 385 | ||
220 | if (likely(skb != NULL)) | 386 | if (likely(skb != NULL)) |
221 | sch->qstats.backlog -= skb->len; | 387 | sch->qstats.backlog -= qdisc_pkt_len(skb); |
222 | 388 | ||
223 | return skb; | 389 | return skb; |
224 | } | 390 | } |
@@ -232,7 +398,7 @@ static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, | |||
232 | struct sk_buff_head *list) | 398 | struct sk_buff_head *list) |
233 | { | 399 | { |
234 | __skb_queue_head(list, skb); | 400 | __skb_queue_head(list, skb); |
235 | sch->qstats.backlog += skb->len; | 401 | sch->qstats.backlog += qdisc_pkt_len(skb); |
236 | sch->qstats.requeues++; | 402 | sch->qstats.requeues++; |
237 | 403 | ||
238 | return NET_XMIT_SUCCESS; | 404 | return NET_XMIT_SUCCESS; |
@@ -250,7 +416,7 @@ static inline void __qdisc_reset_queue(struct Qdisc *sch, | |||
250 | * We do not know the backlog in bytes of this list, it | 416 | * We do not know the backlog in bytes of this list, it |
251 | * is up to the caller to correct it | 417 | * is up to the caller to correct it |
252 | */ | 418 | */ |
253 | skb_queue_purge(list); | 419 | __skb_queue_purge(list); |
254 | } | 420 | } |
255 | 421 | ||
256 | static inline void qdisc_reset_queue(struct Qdisc *sch) | 422 | static inline void qdisc_reset_queue(struct Qdisc *sch) |
@@ -265,7 +431,7 @@ static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch, | |||
265 | struct sk_buff *skb = __qdisc_dequeue_tail(sch, list); | 431 | struct sk_buff *skb = __qdisc_dequeue_tail(sch, list); |
266 | 432 | ||
267 | if (likely(skb != NULL)) { | 433 | if (likely(skb != NULL)) { |
268 | unsigned int len = skb->len; | 434 | unsigned int len = qdisc_pkt_len(skb); |
269 | kfree_skb(skb); | 435 | kfree_skb(skb); |
270 | return len; | 436 | return len; |
271 | } | 437 | } |
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index ba75c67cb992..b799fb21519a 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -46,9 +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 __u32 sctp_start_cksum(__u8 *buffer, __u16 length) | 49 | static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length) |
50 | { | 50 | { |
51 | __u32 crc = ~(__u32) 0; | 51 | return (__force __be32)crc32c((__force u32)crc, buffer, length); |
52 | } | ||
53 | |||
54 | static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | ||
55 | { | ||
56 | __be32 crc = ~cpu_to_be32(0); | ||
52 | __u8 zero[sizeof(__u32)] = {0}; | 57 | __u8 zero[sizeof(__u32)] = {0}; |
53 | 58 | ||
54 | /* Optimize this routine to be SCTP specific, knowing how | 59 | /* Optimize this routine to be SCTP specific, knowing how |
@@ -56,23 +61,23 @@ static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) | |||
56 | */ | 61 | */ |
57 | 62 | ||
58 | /* Calculate CRC up to the checksum. */ | 63 | /* Calculate CRC up to the checksum. */ |
59 | crc = crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); | 64 | crc = sctp_crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); |
60 | 65 | ||
61 | /* Skip checksum field of the header. */ | 66 | /* Skip checksum field of the header. */ |
62 | crc = crc32c(crc, zero, sizeof(__u32)); | 67 | crc = sctp_crc32c(crc, zero, sizeof(__u32)); |
63 | 68 | ||
64 | /* Calculate the rest of the CRC. */ | 69 | /* Calculate the rest of the CRC. */ |
65 | crc = crc32c(crc, &buffer[sizeof(struct sctphdr)], | 70 | crc = sctp_crc32c(crc, &buffer[sizeof(struct sctphdr)], |
66 | length - sizeof(struct sctphdr)); | 71 | length - sizeof(struct sctphdr)); |
67 | return crc; | 72 | return crc; |
68 | } | 73 | } |
69 | 74 | ||
70 | static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) | 75 | static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) |
71 | { | 76 | { |
72 | return crc32c(crc32, buffer, length); | 77 | return sctp_crc32c(crc32, buffer, length); |
73 | } | 78 | } |
74 | 79 | ||
75 | static inline __u32 sctp_end_cksum(__u32 crc32) | 80 | static inline __be32 sctp_end_cksum(__be32 crc32) |
76 | { | 81 | { |
77 | return ntohl(~crc32); | 82 | return ~crc32; |
78 | } | 83 | } |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 90b1e8d23b16..17b932b8a55a 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -179,6 +179,8 @@ int sctp_eps_proc_init(void); | |||
179 | void sctp_eps_proc_exit(void); | 179 | void sctp_eps_proc_exit(void); |
180 | int sctp_assocs_proc_init(void); | 180 | int sctp_assocs_proc_init(void); |
181 | void sctp_assocs_proc_exit(void); | 181 | void sctp_assocs_proc_exit(void); |
182 | int sctp_remaddr_proc_init(void); | ||
183 | void sctp_remaddr_proc_exit(void); | ||
182 | 184 | ||
183 | 185 | ||
184 | /* | 186 | /* |
@@ -218,8 +220,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; | |||
218 | #define sctp_release_sock(sk) release_sock(sk) | 220 | #define sctp_release_sock(sk) release_sock(sk) |
219 | #define sctp_bh_lock_sock(sk) bh_lock_sock(sk) | 221 | #define sctp_bh_lock_sock(sk) bh_lock_sock(sk) |
220 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) | 222 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) |
221 | #define SCTP_SOCK_SLEEP_PRE(sk) SOCK_SLEEP_PRE(sk) | ||
222 | #define SCTP_SOCK_SLEEP_POST(sk) SOCK_SLEEP_POST(sk) | ||
223 | 223 | ||
224 | /* SCTP SNMP MIB stats handlers */ | 224 | /* SCTP SNMP MIB stats handlers */ |
225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | 225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 7f25195f9855..535a18f57a13 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -300,6 +300,7 @@ struct sctp_sock { | |||
300 | 300 | ||
301 | /* The default SACK delay timeout for new associations. */ | 301 | /* The default SACK delay timeout for new associations. */ |
302 | __u32 sackdelay; | 302 | __u32 sackdelay; |
303 | __u32 sackfreq; | ||
303 | 304 | ||
304 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ | 305 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ |
305 | __u32 param_flags; | 306 | __u32 param_flags; |
@@ -826,7 +827,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *, | |||
826 | __u16 sport, __u16 dport); | 827 | __u16 sport, __u16 dport); |
827 | struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); | 828 | struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); |
828 | sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, | 829 | sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, |
829 | struct sctp_chunk *); | 830 | struct sctp_chunk *, int); |
830 | sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, | 831 | sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, |
831 | struct sctp_chunk *); | 832 | struct sctp_chunk *); |
832 | int sctp_packet_transmit(struct sctp_packet *); | 833 | int sctp_packet_transmit(struct sctp_packet *); |
@@ -946,6 +947,7 @@ struct sctp_transport { | |||
946 | 947 | ||
947 | /* SACK delay timeout */ | 948 | /* SACK delay timeout */ |
948 | unsigned long sackdelay; | 949 | unsigned long sackdelay; |
950 | __u32 sackfreq; | ||
949 | 951 | ||
950 | /* When was the last time (in jiffies) that we heard from this | 952 | /* When was the last time (in jiffies) that we heard from this |
951 | * transport? We use this to pick new active and retran paths. | 953 | * transport? We use this to pick new active and retran paths. |
@@ -1159,7 +1161,6 @@ void sctp_outq_init(struct sctp_association *, struct sctp_outq *); | |||
1159 | void sctp_outq_teardown(struct sctp_outq *); | 1161 | void sctp_outq_teardown(struct sctp_outq *); |
1160 | void sctp_outq_free(struct sctp_outq*); | 1162 | void sctp_outq_free(struct sctp_outq*); |
1161 | int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); | 1163 | int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); |
1162 | int sctp_outq_flush(struct sctp_outq *, int); | ||
1163 | int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *); | 1164 | int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *); |
1164 | int sctp_outq_is_empty(const struct sctp_outq *); | 1165 | int sctp_outq_is_empty(const struct sctp_outq *); |
1165 | void sctp_outq_restart(struct sctp_outq *); | 1166 | void sctp_outq_restart(struct sctp_outq *); |
@@ -1209,6 +1210,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, | |||
1209 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); | 1210 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); |
1210 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, | 1211 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, |
1211 | struct sctp_sock *); | 1212 | struct sctp_sock *); |
1213 | int sctp_bind_addr_conflict(struct sctp_bind_addr *, const union sctp_addr *, | ||
1214 | struct sctp_sock *, struct sctp_sock *); | ||
1212 | int sctp_bind_addr_state(const struct sctp_bind_addr *bp, | 1215 | int sctp_bind_addr_state(const struct sctp_bind_addr *bp, |
1213 | const union sctp_addr *addr); | 1216 | const union sctp_addr *addr); |
1214 | union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, | 1217 | union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, |
@@ -1553,6 +1556,7 @@ struct sctp_association { | |||
1553 | * : SACK's are not delayed (see Section 6). | 1556 | * : SACK's are not delayed (see Section 6). |
1554 | */ | 1557 | */ |
1555 | __u8 sack_needed; /* Do we need to sack the peer? */ | 1558 | __u8 sack_needed; /* Do we need to sack the peer? */ |
1559 | __u32 sack_cnt; | ||
1556 | 1560 | ||
1557 | /* These are capabilities which our peer advertised. */ | 1561 | /* These are capabilities which our peer advertised. */ |
1558 | __u8 ecn_capable; /* Can peer do ECN? */ | 1562 | __u8 ecn_capable; /* Can peer do ECN? */ |
@@ -1662,6 +1666,7 @@ struct sctp_association { | |||
1662 | 1666 | ||
1663 | /* SACK delay timeout */ | 1667 | /* SACK delay timeout */ |
1664 | unsigned long sackdelay; | 1668 | unsigned long sackdelay; |
1669 | __u32 sackfreq; | ||
1665 | 1670 | ||
1666 | 1671 | ||
1667 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; | 1672 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 9619b9d35c9e..f205b10f0ab9 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -93,8 +93,9 @@ enum sctp_optname { | |||
93 | #define SCTP_STATUS SCTP_STATUS | 93 | #define SCTP_STATUS SCTP_STATUS |
94 | SCTP_GET_PEER_ADDR_INFO, | 94 | SCTP_GET_PEER_ADDR_INFO, |
95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO | 95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO |
96 | SCTP_DELAYED_ACK_TIME, | 96 | SCTP_DELAYED_ACK, |
97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME | 97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK |
98 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK | ||
98 | SCTP_CONTEXT, /* Receive Context */ | 99 | SCTP_CONTEXT, /* Receive Context */ |
99 | #define SCTP_CONTEXT SCTP_CONTEXT | 100 | #define SCTP_CONTEXT SCTP_CONTEXT |
100 | SCTP_FRAGMENT_INTERLEAVE, | 101 | SCTP_FRAGMENT_INTERLEAVE, |
@@ -136,12 +137,14 @@ enum sctp_optname { | |||
136 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD | 137 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD |
137 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ | 138 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ |
138 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD | 139 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD |
139 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | 140 | SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */ |
140 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | 141 | #define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD |
141 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ | 142 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ |
142 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS | 143 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS |
143 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ | 144 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ |
144 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS | 145 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS |
146 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | ||
147 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | ||
145 | }; | 148 | }; |
146 | 149 | ||
147 | /* | 150 | /* |
@@ -618,13 +621,26 @@ struct sctp_authkeyid { | |||
618 | }; | 621 | }; |
619 | 622 | ||
620 | 623 | ||
621 | /* 7.1.23. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) | 624 | /* |
625 | * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK) | ||
622 | * | 626 | * |
623 | * This options will get or set the delayed ack timer. The time is set | 627 | * This option will effect the way delayed acks are performed. This |
624 | * in milliseconds. If the assoc_id is 0, then this sets or gets the | 628 | * option allows you to get or set the delayed ack time, in |
625 | * endpoints default delayed ack timer value. If the assoc_id field is | 629 | * milliseconds. It also allows changing the delayed ack frequency. |
626 | * non-zero, then the set or get effects the specified association. | 630 | * Changing the frequency to 1 disables the delayed sack algorithm. If |
631 | * the assoc_id is 0, then this sets or gets the endpoints default | ||
632 | * values. If the assoc_id field is non-zero, then the set or get | ||
633 | * effects the specified association for the one to many model (the | ||
634 | * assoc_id field is ignored by the one to one model). Note that if | ||
635 | * sack_delay or sack_freq are 0 when setting this option, then the | ||
636 | * current values will remain unchanged. | ||
627 | */ | 637 | */ |
638 | struct sctp_sack_info { | ||
639 | sctp_assoc_t sack_assoc_id; | ||
640 | uint32_t sack_delay; | ||
641 | uint32_t sack_freq; | ||
642 | }; | ||
643 | |||
628 | struct sctp_assoc_value { | 644 | struct sctp_assoc_value { |
629 | sctp_assoc_t assoc_id; | 645 | sctp_assoc_t assoc_id; |
630 | uint32_t assoc_value; | 646 | uint32_t assoc_value; |
diff --git a/include/net/snmp.h b/include/net/snmp.h index ce2f48507510..57c93628695f 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -14,8 +14,6 @@ | |||
14 | * as published by the Free Software Foundation; either version | 14 | * as published by the Free Software Foundation; either version |
15 | * 2 of the License, or (at your option) any later version. | 15 | * 2 of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * $Id: snmp.h,v 1.19 2001/06/14 13:40:46 davem Exp $ | ||
18 | * | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | #ifndef _SNMP_H | 19 | #ifndef _SNMP_H |
diff --git a/include/net/sock.h b/include/net/sock.h index dc42b44c2aa1..06c5259aff30 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -166,7 +166,7 @@ struct sock_common { | |||
166 | * @sk_err: last error | 166 | * @sk_err: last error |
167 | * @sk_err_soft: errors that don't cause failure but are the cause of a | 167 | * @sk_err_soft: errors that don't cause failure but are the cause of a |
168 | * persistent failure not just 'timed out' | 168 | * persistent failure not just 'timed out' |
169 | * @sk_drops: raw drops counter | 169 | * @sk_drops: raw/udp drops counter |
170 | * @sk_ack_backlog: current listen backlog | 170 | * @sk_ack_backlog: current listen backlog |
171 | * @sk_max_ack_backlog: listen backlog set in listen() | 171 | * @sk_max_ack_backlog: listen backlog set in listen() |
172 | * @sk_priority: %SO_PRIORITY setting | 172 | * @sk_priority: %SO_PRIORITY setting |
@@ -524,7 +524,7 @@ struct proto { | |||
524 | int (*ioctl)(struct sock *sk, int cmd, | 524 | int (*ioctl)(struct sock *sk, int cmd, |
525 | unsigned long arg); | 525 | unsigned long arg); |
526 | int (*init)(struct sock *sk); | 526 | int (*init)(struct sock *sk); |
527 | int (*destroy)(struct sock *sk); | 527 | void (*destroy)(struct sock *sk); |
528 | void (*shutdown)(struct sock *sk, int how); | 528 | void (*shutdown)(struct sock *sk, int how); |
529 | int (*setsockopt)(struct sock *sk, int level, | 529 | int (*setsockopt)(struct sock *sk, int level, |
530 | int optname, char __user *optval, | 530 | int optname, char __user *optval, |
@@ -565,7 +565,7 @@ struct proto { | |||
565 | #endif | 565 | #endif |
566 | 566 | ||
567 | /* Memory pressure */ | 567 | /* Memory pressure */ |
568 | void (*enter_memory_pressure)(void); | 568 | void (*enter_memory_pressure)(struct sock *sk); |
569 | atomic_t *memory_allocated; /* Current allocated memory. */ | 569 | atomic_t *memory_allocated; /* Current allocated memory. */ |
570 | atomic_t *sockets_allocated; /* Current number of sockets. */ | 570 | atomic_t *sockets_allocated; /* Current number of sockets. */ |
571 | /* | 571 | /* |
@@ -990,6 +990,11 @@ static inline void sock_put(struct sock *sk) | |||
990 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, | 990 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, |
991 | const int nested); | 991 | const int nested); |
992 | 992 | ||
993 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) | ||
994 | { | ||
995 | sk->sk_socket = sock; | ||
996 | } | ||
997 | |||
993 | /* Detach socket from process context. | 998 | /* Detach socket from process context. |
994 | * Announce socket dead, detach it from wait queue and inode. | 999 | * Announce socket dead, detach it from wait queue and inode. |
995 | * Note that parent inode held reference count on this struct sock, | 1000 | * Note that parent inode held reference count on this struct sock, |
@@ -1001,7 +1006,7 @@ static inline void sock_orphan(struct sock *sk) | |||
1001 | { | 1006 | { |
1002 | write_lock_bh(&sk->sk_callback_lock); | 1007 | write_lock_bh(&sk->sk_callback_lock); |
1003 | sock_set_flag(sk, SOCK_DEAD); | 1008 | sock_set_flag(sk, SOCK_DEAD); |
1004 | sk->sk_socket = NULL; | 1009 | sk_set_socket(sk, NULL); |
1005 | sk->sk_sleep = NULL; | 1010 | sk->sk_sleep = NULL; |
1006 | write_unlock_bh(&sk->sk_callback_lock); | 1011 | write_unlock_bh(&sk->sk_callback_lock); |
1007 | } | 1012 | } |
@@ -1011,7 +1016,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) | |||
1011 | write_lock_bh(&sk->sk_callback_lock); | 1016 | write_lock_bh(&sk->sk_callback_lock); |
1012 | sk->sk_sleep = &parent->wait; | 1017 | sk->sk_sleep = &parent->wait; |
1013 | parent->sk = sk; | 1018 | parent->sk = sk; |
1014 | sk->sk_socket = parent; | 1019 | sk_set_socket(sk, parent); |
1015 | security_sock_graft(sk, parent); | 1020 | security_sock_graft(sk, parent); |
1016 | write_unlock_bh(&sk->sk_callback_lock); | 1021 | write_unlock_bh(&sk->sk_callback_lock); |
1017 | } | 1022 | } |
@@ -1205,7 +1210,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk) | |||
1205 | 1210 | ||
1206 | page = alloc_pages(sk->sk_allocation, 0); | 1211 | page = alloc_pages(sk->sk_allocation, 0); |
1207 | if (!page) { | 1212 | if (!page) { |
1208 | sk->sk_prot->enter_memory_pressure(); | 1213 | sk->sk_prot->enter_memory_pressure(sk); |
1209 | sk_stream_moderate_sndbuf(sk); | 1214 | sk_stream_moderate_sndbuf(sk); |
1210 | } | 1215 | } |
1211 | return page; | 1216 | return page; |
@@ -1331,30 +1336,6 @@ extern int net_msg_warn; | |||
1331 | #define LIMIT_NETDEBUG(fmt, args...) \ | 1336 | #define LIMIT_NETDEBUG(fmt, args...) \ |
1332 | do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0) | 1337 | do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0) |
1333 | 1338 | ||
1334 | /* | ||
1335 | * Macros for sleeping on a socket. Use them like this: | ||
1336 | * | ||
1337 | * SOCK_SLEEP_PRE(sk) | ||
1338 | * if (condition) | ||
1339 | * schedule(); | ||
1340 | * SOCK_SLEEP_POST(sk) | ||
1341 | * | ||
1342 | * N.B. These are now obsolete and were, afaik, only ever used in DECnet | ||
1343 | * and when the last use of them in DECnet has gone, I'm intending to | ||
1344 | * remove them. | ||
1345 | */ | ||
1346 | |||
1347 | #define SOCK_SLEEP_PRE(sk) { struct task_struct *tsk = current; \ | ||
1348 | DECLARE_WAITQUEUE(wait, tsk); \ | ||
1349 | tsk->state = TASK_INTERRUPTIBLE; \ | ||
1350 | add_wait_queue((sk)->sk_sleep, &wait); \ | ||
1351 | release_sock(sk); | ||
1352 | |||
1353 | #define SOCK_SLEEP_POST(sk) tsk->state = TASK_RUNNING; \ | ||
1354 | remove_wait_queue((sk)->sk_sleep, &wait); \ | ||
1355 | lock_sock(sk); \ | ||
1356 | } | ||
1357 | |||
1358 | extern __u32 sysctl_wmem_max; | 1339 | extern __u32 sysctl_wmem_max; |
1359 | extern __u32 sysctl_rmem_max; | 1340 | extern __u32 sysctl_rmem_max; |
1360 | 1341 | ||
diff --git a/include/net/stp.h b/include/net/stp.h new file mode 100644 index 000000000000..ad447f105417 --- /dev/null +++ b/include/net/stp.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _NET_STP_H | ||
2 | #define _NET_STP_H | ||
3 | |||
4 | struct stp_proto { | ||
5 | unsigned char group_address[ETH_ALEN]; | ||
6 | void (*rcv)(const struct stp_proto *, struct sk_buff *, | ||
7 | struct net_device *); | ||
8 | void *data; | ||
9 | }; | ||
10 | |||
11 | extern int stp_proto_register(const struct stp_proto *proto); | ||
12 | extern void stp_proto_unregister(const struct stp_proto *proto); | ||
13 | |||
14 | #endif /* _NET_STP_H */ | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index cf54034019d9..8983386356a5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -50,6 +50,7 @@ extern atomic_t tcp_orphan_count; | |||
50 | extern void tcp_time_wait(struct sock *sk, int state, int timeo); | 50 | extern void tcp_time_wait(struct sock *sk, int state, int timeo); |
51 | 51 | ||
52 | #define MAX_TCP_HEADER (128 + MAX_HEADER) | 52 | #define MAX_TCP_HEADER (128 + MAX_HEADER) |
53 | #define MAX_TCP_OPTION_SPACE 40 | ||
53 | 54 | ||
54 | /* | 55 | /* |
55 | * Never offer a window over 32767 without using window scaling. Some | 56 | * Never offer a window over 32767 without using window scaling. Some |
@@ -184,6 +185,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
184 | #define TCPOLEN_SACK_BASE_ALIGNED 4 | 185 | #define TCPOLEN_SACK_BASE_ALIGNED 4 |
185 | #define TCPOLEN_SACK_PERBLOCK 8 | 186 | #define TCPOLEN_SACK_PERBLOCK 8 |
186 | #define TCPOLEN_MD5SIG_ALIGNED 20 | 187 | #define TCPOLEN_MD5SIG_ALIGNED 20 |
188 | #define TCPOLEN_MSS_ALIGNED 4 | ||
187 | 189 | ||
188 | /* Flags in tp->nonagle */ | 190 | /* Flags in tp->nonagle */ |
189 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ | 191 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ |
@@ -265,13 +267,10 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num) | |||
265 | 267 | ||
266 | extern struct proto tcp_prot; | 268 | extern struct proto tcp_prot; |
267 | 269 | ||
268 | DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); | 270 | #define TCP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.tcp_statistics, field) |
269 | #define TCP_INC_STATS(field) SNMP_INC_STATS(tcp_statistics, field) | 271 | #define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) |
270 | #define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field) | 272 | #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) |
271 | #define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field) | 273 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
272 | #define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field) | ||
273 | #define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val) | ||
274 | #define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val) | ||
275 | 274 | ||
276 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 275 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
277 | 276 | ||
@@ -398,6 +397,8 @@ extern void tcp_parse_options(struct sk_buff *skb, | |||
398 | struct tcp_options_received *opt_rx, | 397 | struct tcp_options_received *opt_rx, |
399 | int estab); | 398 | int estab); |
400 | 399 | ||
400 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | ||
401 | |||
401 | /* | 402 | /* |
402 | * TCP v4 functions exported for the inet6 API | 403 | * TCP v4 functions exported for the inet6 API |
403 | */ | 404 | */ |
@@ -894,7 +895,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
894 | 895 | ||
895 | while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { | 896 | while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { |
896 | sk->sk_backlog_rcv(sk, skb1); | 897 | sk->sk_backlog_rcv(sk, skb1); |
897 | NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED); | 898 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED); |
898 | } | 899 | } |
899 | 900 | ||
900 | tp->ucopy.memory = 0; | 901 | tp->ucopy.memory = 0; |
@@ -975,7 +976,7 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
975 | ireq->rmt_port = tcp_hdr(skb)->source; | 976 | ireq->rmt_port = tcp_hdr(skb)->source; |
976 | } | 977 | } |
977 | 978 | ||
978 | extern void tcp_enter_memory_pressure(void); | 979 | extern void tcp_enter_memory_pressure(struct sock *sk); |
979 | 980 | ||
980 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) | 981 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |
981 | { | 982 | { |
@@ -1024,13 +1025,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int | |||
1024 | 1025 | ||
1025 | #define TCP_CHECK_TIMER(sk) do { } while (0) | 1026 | #define TCP_CHECK_TIMER(sk) do { } while (0) |
1026 | 1027 | ||
1027 | static inline void tcp_mib_init(void) | 1028 | static inline void tcp_mib_init(struct net *net) |
1028 | { | 1029 | { |
1029 | /* See RFC 2012 */ | 1030 | /* See RFC 2012 */ |
1030 | TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1); | 1031 | TCP_ADD_STATS_USER(net, TCP_MIB_RTOALGORITHM, 1); |
1031 | TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ); | 1032 | TCP_ADD_STATS_USER(net, TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ); |
1032 | TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ); | 1033 | TCP_ADD_STATS_USER(net, TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ); |
1033 | TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1); | 1034 | TCP_ADD_STATS_USER(net, TCP_MIB_MAXCONN, -1); |
1034 | } | 1035 | } |
1035 | 1036 | ||
1036 | /* from STCP */ | 1037 | /* from STCP */ |
@@ -1113,14 +1114,12 @@ struct tcp_md5sig_pool { | |||
1113 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | 1114 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ |
1114 | 1115 | ||
1115 | /* - functions */ | 1116 | /* - functions */ |
1116 | extern int tcp_v4_calc_md5_hash(char *md5_hash, | 1117 | extern int tcp_v4_md5_hash_skb(char *md5_hash, |
1117 | struct tcp_md5sig_key *key, | 1118 | struct tcp_md5sig_key *key, |
1118 | struct sock *sk, | 1119 | struct sock *sk, |
1119 | struct dst_entry *dst, | 1120 | struct request_sock *req, |
1120 | struct request_sock *req, | 1121 | struct sk_buff *skb); |
1121 | struct tcphdr *th, | 1122 | |
1122 | int protocol, | ||
1123 | unsigned int tcplen); | ||
1124 | extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, | 1123 | extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, |
1125 | struct sock *addr_sk); | 1124 | struct sock *addr_sk); |
1126 | 1125 | ||
@@ -1132,11 +1131,26 @@ extern int tcp_v4_md5_do_add(struct sock *sk, | |||
1132 | extern int tcp_v4_md5_do_del(struct sock *sk, | 1131 | extern int tcp_v4_md5_do_del(struct sock *sk, |
1133 | __be32 addr); | 1132 | __be32 addr); |
1134 | 1133 | ||
1134 | #ifdef CONFIG_TCP_MD5SIG | ||
1135 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ | ||
1136 | &(struct tcp_md5sig_key) { \ | ||
1137 | .key = (twsk)->tw_md5_key, \ | ||
1138 | .keylen = (twsk)->tw_md5_keylen, \ | ||
1139 | } : NULL) | ||
1140 | #else | ||
1141 | #define tcp_twsk_md5_key(twsk) NULL | ||
1142 | #endif | ||
1143 | |||
1135 | extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); | 1144 | extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); |
1136 | extern void tcp_free_md5sig_pool(void); | 1145 | extern void tcp_free_md5sig_pool(void); |
1137 | 1146 | ||
1138 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); | 1147 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); |
1139 | extern void __tcp_put_md5sig_pool(void); | 1148 | extern void __tcp_put_md5sig_pool(void); |
1149 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); | ||
1150 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, | ||
1151 | unsigned header_len); | ||
1152 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | ||
1153 | struct tcp_md5sig_key *key); | ||
1140 | 1154 | ||
1141 | static inline | 1155 | static inline |
1142 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) | 1156 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) |
@@ -1348,7 +1362,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo); | |||
1348 | extern struct request_sock_ops tcp_request_sock_ops; | 1362 | extern struct request_sock_ops tcp_request_sock_ops; |
1349 | extern struct request_sock_ops tcp6_request_sock_ops; | 1363 | extern struct request_sock_ops tcp6_request_sock_ops; |
1350 | 1364 | ||
1351 | extern int tcp_v4_destroy_sock(struct sock *sk); | 1365 | extern void tcp_v4_destroy_sock(struct sock *sk); |
1352 | 1366 | ||
1353 | extern int tcp_v4_gso_send_check(struct sk_buff *skb); | 1367 | extern int tcp_v4_gso_send_check(struct sk_buff *skb); |
1354 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); | 1368 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); |
@@ -1366,11 +1380,8 @@ struct tcp_sock_af_ops { | |||
1366 | int (*calc_md5_hash) (char *location, | 1380 | int (*calc_md5_hash) (char *location, |
1367 | struct tcp_md5sig_key *md5, | 1381 | struct tcp_md5sig_key *md5, |
1368 | struct sock *sk, | 1382 | struct sock *sk, |
1369 | struct dst_entry *dst, | ||
1370 | struct request_sock *req, | 1383 | struct request_sock *req, |
1371 | struct tcphdr *th, | 1384 | struct sk_buff *skb); |
1372 | int protocol, | ||
1373 | unsigned int len); | ||
1374 | int (*md5_add) (struct sock *sk, | 1385 | int (*md5_add) (struct sock *sk, |
1375 | struct sock *addr_sk, | 1386 | struct sock *addr_sk, |
1376 | u8 *newkey, | 1387 | u8 *newkey, |
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h index 11105bcc4457..c54917cbfa48 100644 --- a/include/net/tipc/tipc_port.h +++ b/include/net/tipc/tipc_port.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports | 2 | * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports |
3 | * | 3 | * |
4 | * Copyright (c) 1994-2007, Ericsson AB | 4 | * Copyright (c) 1994-2007, Ericsson AB |
5 | * Copyright (c) 2005-2007, Wind River Systems | 5 | * Copyright (c) 2005-2008, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
@@ -75,13 +75,7 @@ struct tipc_port { | |||
75 | }; | 75 | }; |
76 | 76 | ||
77 | 77 | ||
78 | /** | 78 | struct tipc_port *tipc_createport_raw(void *usr_handle, |
79 | * tipc_createport_raw - create a native TIPC port and return it's reference | ||
80 | * | ||
81 | * Note: 'dispatcher' and 'wakeup' deliver a locked port. | ||
82 | */ | ||
83 | |||
84 | u32 tipc_createport_raw(void *usr_handle, | ||
85 | u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), | 79 | u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), |
86 | void (*wakeup)(struct tipc_port *), | 80 | void (*wakeup)(struct tipc_port *), |
87 | const u32 importance); | 81 | const u32 importance); |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 112934a3288d..876b6f2bb4fd 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net, | |||
53 | */ | 53 | */ |
54 | extern struct inet_connection_sock_af_ops ipv4_specific; | 54 | extern struct inet_connection_sock_af_ops ipv4_specific; |
55 | 55 | ||
56 | extern int inet6_destroy_sock(struct sock *sk); | 56 | extern void inet6_destroy_sock(struct sock *sk); |
57 | 57 | ||
58 | #endif | 58 | #endif |
59 | 59 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index ccce83707046..addcdc67234c 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -148,27 +148,25 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | |||
148 | char __user *optval, int optlen, | 148 | char __user *optval, int optlen, |
149 | int (*push_pending_frames)(struct sock *)); | 149 | int (*push_pending_frames)(struct sock *)); |
150 | 150 | ||
151 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); | ||
152 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); | 151 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); |
153 | 152 | ||
154 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ | 153 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ |
155 | DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics); | ||
156 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | 154 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); |
157 | 155 | ||
158 | /* | 156 | /* |
159 | * SNMP statistics for UDP and UDP-Lite | 157 | * SNMP statistics for UDP and UDP-Lite |
160 | */ | 158 | */ |
161 | #define UDP_INC_STATS_USER(field, is_udplite) do { \ | 159 | #define UDP_INC_STATS_USER(net, field, is_udplite) do { \ |
162 | if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ | 160 | if (is_udplite) SNMP_INC_STATS_USER((net)->mib.udplite_statistics, field); \ |
163 | else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) | 161 | else SNMP_INC_STATS_USER((net)->mib.udp_statistics, field); } while(0) |
164 | #define UDP_INC_STATS_BH(field, is_udplite) do { \ | 162 | #define UDP_INC_STATS_BH(net, field, is_udplite) do { \ |
165 | if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ | 163 | if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_statistics, field); \ |
166 | else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) | 164 | else SNMP_INC_STATS_BH((net)->mib.udp_statistics, field); } while(0) |
167 | 165 | ||
168 | #define UDP6_INC_STATS_BH(field, is_udplite) do { \ | 166 | #define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \ |
169 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ | 167 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ |
170 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) | 168 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) |
171 | #define UDP6_INC_STATS_USER(field, is_udplite) do { \ | 169 | #define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \ |
172 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ | 170 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ |
173 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) | 171 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) |
174 | 172 | ||
@@ -176,12 +174,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | |||
176 | #define UDPX_INC_STATS_BH(sk, field) \ | 174 | #define UDPX_INC_STATS_BH(sk, field) \ |
177 | do { \ | 175 | do { \ |
178 | if ((sk)->sk_family == AF_INET) \ | 176 | if ((sk)->sk_family == AF_INET) \ |
179 | UDP_INC_STATS_BH(field, 0); \ | 177 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ |
180 | else \ | 178 | else \ |
181 | UDP6_INC_STATS_BH(field, 0); \ | 179 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ |
182 | } while (0); | 180 | } while (0); |
183 | #else | 181 | #else |
184 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0) | 182 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) |
185 | #endif | 183 | #endif |
186 | 184 | ||
187 | /* /proc */ | 185 | /* /proc */ |
@@ -196,8 +194,8 @@ struct udp_seq_afinfo { | |||
196 | struct udp_iter_state { | 194 | struct udp_iter_state { |
197 | struct seq_net_private p; | 195 | struct seq_net_private p; |
198 | sa_family_t family; | 196 | sa_family_t family; |
199 | struct hlist_head *hashtable; | ||
200 | int bucket; | 197 | int bucket; |
198 | struct hlist_head *hashtable; | ||
201 | }; | 199 | }; |
202 | 200 | ||
203 | #ifdef CONFIG_PROC_FS | 201 | #ifdef CONFIG_PROC_FS |
diff --git a/include/net/wext.h b/include/net/wext.h index 80b31d826b7a..6d76a39a9c5b 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
@@ -12,6 +12,8 @@ extern int wext_proc_init(struct net *net); | |||
12 | extern void wext_proc_exit(struct net *net); | 12 | extern void wext_proc_exit(struct net *net); |
13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
14 | void __user *arg); | 14 | void __user *arg); |
15 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | ||
16 | unsigned long arg); | ||
15 | #else | 17 | #else |
16 | static inline int wext_proc_init(struct net *net) | 18 | static inline int wext_proc_init(struct net *net) |
17 | { | 19 | { |
@@ -26,6 +28,11 @@ static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned | |||
26 | { | 28 | { |
27 | return -EINVAL; | 29 | return -EINVAL; |
28 | } | 30 | } |
31 | static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | ||
32 | unsigned long arg) | ||
33 | { | ||
34 | return -EINVAL; | ||
35 | } | ||
29 | #endif | 36 | #endif |
30 | 37 | ||
31 | #endif /* __NET_WEXT_H */ | 38 | #endif /* __NET_WEXT_H */ |
diff --git a/include/net/wireless.h b/include/net/wireless.h index 667b4080d30f..9324f8dd183e 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h | |||
@@ -39,12 +39,18 @@ enum ieee80211_band { | |||
39 | * on this channel. | 39 | * on this channel. |
40 | * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. | 40 | * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. |
41 | * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. | 41 | * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. |
42 | * @IEEE80211_CHAN_NO_FAT_ABOVE: extension channel above this channel | ||
43 | * is not permitted. | ||
44 | * @IEEE80211_CHAN_NO_FAT_BELOW: extension channel below this channel | ||
45 | * is not permitted. | ||
42 | */ | 46 | */ |
43 | enum ieee80211_channel_flags { | 47 | enum ieee80211_channel_flags { |
44 | IEEE80211_CHAN_DISABLED = 1<<0, | 48 | IEEE80211_CHAN_DISABLED = 1<<0, |
45 | IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, | 49 | IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, |
46 | IEEE80211_CHAN_NO_IBSS = 1<<2, | 50 | IEEE80211_CHAN_NO_IBSS = 1<<2, |
47 | IEEE80211_CHAN_RADAR = 1<<3, | 51 | IEEE80211_CHAN_RADAR = 1<<3, |
52 | IEEE80211_CHAN_NO_FAT_ABOVE = 1<<4, | ||
53 | IEEE80211_CHAN_NO_FAT_BELOW = 1<<5, | ||
48 | }; | 54 | }; |
49 | 55 | ||
50 | /** | 56 | /** |