diff options
Diffstat (limited to 'include/net')
57 files changed, 1540 insertions, 447 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 757a17638b1b..f2b801c4b555 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -92,7 +92,7 @@ extern void addrconf_leave_solict(struct inet6_dev *idev, | |||
| 92 | const struct in6_addr *addr); | 92 | const struct in6_addr *addr); |
| 93 | 93 | ||
| 94 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, | 94 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, |
| 95 | unsigned unit) | 95 | unsigned int unit) |
| 96 | { | 96 | { |
| 97 | if (timeout == 0xffffffff) | 97 | if (timeout == 0xffffffff) |
| 98 | return ~0UL; | 98 | return ~0UL; |
| @@ -131,9 +131,9 @@ extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, | |||
| 131 | extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, | 131 | extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, |
| 132 | const struct in6_addr *addr); | 132 | const struct in6_addr *addr); |
| 133 | extern void ipv6_sock_mc_close(struct sock *sk); | 133 | extern void ipv6_sock_mc_close(struct sock *sk); |
| 134 | extern int inet6_mc_check(struct sock *sk, | 134 | extern bool inet6_mc_check(struct sock *sk, |
| 135 | const struct in6_addr *mc_addr, | 135 | const struct in6_addr *mc_addr, |
| 136 | const struct in6_addr *src_addr); | 136 | const struct in6_addr *src_addr); |
| 137 | 137 | ||
| 138 | extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); | 138 | extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); |
| 139 | extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 139 | extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
| @@ -146,10 +146,10 @@ extern void ipv6_mc_init_dev(struct inet6_dev *idev); | |||
| 146 | extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); | 146 | extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); |
| 147 | extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); | 147 | extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); |
| 148 | 148 | ||
| 149 | extern int ipv6_chk_mcast_addr(struct net_device *dev, | 149 | extern bool ipv6_chk_mcast_addr(struct net_device *dev, |
| 150 | const struct in6_addr *group, | 150 | const struct in6_addr *group, |
| 151 | const struct in6_addr *src_addr); | 151 | const struct in6_addr *src_addr); |
| 152 | extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); | 152 | extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr); |
| 153 | 153 | ||
| 154 | extern void addrconf_prefix_rcv(struct net_device *dev, | 154 | extern void addrconf_prefix_rcv(struct net_device *dev, |
| 155 | u8 *opt, int len, bool sllao); | 155 | u8 *opt, int len, bool sllao); |
| @@ -163,8 +163,8 @@ extern void ipv6_sock_ac_close(struct sock *sk); | |||
| 163 | 163 | ||
| 164 | extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); | 164 | extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); |
| 165 | extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 165 | extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
| 166 | extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | 166 | extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, |
| 167 | const struct in6_addr *addr); | 167 | const struct in6_addr *addr); |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | /* Device notifier */ | 170 | /* Device notifier */ |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index ca68e2cef230..2ee33da36a7a 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -22,7 +22,7 @@ extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; | |||
| 22 | struct unix_address { | 22 | struct unix_address { |
| 23 | atomic_t refcnt; | 23 | atomic_t refcnt; |
| 24 | int len; | 24 | int len; |
| 25 | unsigned hash; | 25 | unsigned int hash; |
| 26 | struct sockaddr_un name[0]; | 26 | struct sockaddr_un name[0]; |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
diff --git a/include/net/ax25.h b/include/net/ax25.h index 94e09d361bb1..5d2352154cf6 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
| @@ -215,7 +215,7 @@ typedef struct ax25_dev { | |||
| 215 | struct ax25_dev *next; | 215 | struct ax25_dev *next; |
| 216 | struct net_device *dev; | 216 | struct net_device *dev; |
| 217 | struct net_device *forward; | 217 | struct net_device *forward; |
| 218 | struct ctl_table *systable; | 218 | struct ctl_table_header *sysheader; |
| 219 | int values[AX25_MAX_VALUES]; | 219 | int values[AX25_MAX_VALUES]; |
| 220 | #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER) | 220 | #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER) |
| 221 | ax25_dama_info dama; | 221 | ax25_dama_info dama; |
| @@ -441,11 +441,11 @@ extern void ax25_uid_free(void); | |||
| 441 | 441 | ||
| 442 | /* sysctl_net_ax25.c */ | 442 | /* sysctl_net_ax25.c */ |
| 443 | #ifdef CONFIG_SYSCTL | 443 | #ifdef CONFIG_SYSCTL |
| 444 | extern void ax25_register_sysctl(void); | 444 | extern int ax25_register_dev_sysctl(ax25_dev *ax25_dev); |
| 445 | extern void ax25_unregister_sysctl(void); | 445 | extern void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); |
| 446 | #else | 446 | #else |
| 447 | static inline void ax25_register_sysctl(void) {}; | 447 | static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } |
| 448 | static inline void ax25_unregister_sysctl(void) {}; | 448 | static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} |
| 449 | #endif /* CONFIG_SYSCTL */ | 449 | #endif /* CONFIG_SYSCTL */ |
| 450 | 450 | ||
| 451 | #endif | 451 | #endif |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 262ebd1747d4..a65910bda381 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -191,6 +191,7 @@ struct bt_sock { | |||
| 191 | struct list_head accept_q; | 191 | struct list_head accept_q; |
| 192 | struct sock *parent; | 192 | struct sock *parent; |
| 193 | u32 defer_setup; | 193 | u32 defer_setup; |
| 194 | bool suspended; | ||
| 194 | }; | 195 | }; |
| 195 | 196 | ||
| 196 | struct bt_sock_list { | 197 | struct bt_sock_list { |
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index 6db8ecf52aa2..439dadc8102f 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
| @@ -123,12 +123,21 @@ struct cfhsi_rx_state { | |||
| 123 | bool piggy_desc; | 123 | bool piggy_desc; |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | /* Priority mapping */ | ||
| 127 | enum { | ||
| 128 | CFHSI_PRIO_CTL = 0, | ||
| 129 | CFHSI_PRIO_VI, | ||
| 130 | CFHSI_PRIO_VO, | ||
| 131 | CFHSI_PRIO_BEBK, | ||
| 132 | CFHSI_PRIO_LAST, | ||
| 133 | }; | ||
| 134 | |||
| 126 | /* Structure implemented by CAIF HSI drivers. */ | 135 | /* Structure implemented by CAIF HSI drivers. */ |
| 127 | struct cfhsi { | 136 | struct cfhsi { |
| 128 | struct caif_dev_common cfdev; | 137 | struct caif_dev_common cfdev; |
| 129 | struct net_device *ndev; | 138 | struct net_device *ndev; |
| 130 | struct platform_device *pdev; | 139 | struct platform_device *pdev; |
| 131 | struct sk_buff_head qhead; | 140 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; |
| 132 | struct cfhsi_drv drv; | 141 | struct cfhsi_drv drv; |
| 133 | struct cfhsi_dev *dev; | 142 | struct cfhsi_dev *dev; |
| 134 | int tx_state; | 143 | int tx_state; |
| @@ -151,8 +160,14 @@ struct cfhsi { | |||
| 151 | wait_queue_head_t wake_up_wait; | 160 | wait_queue_head_t wake_up_wait; |
| 152 | wait_queue_head_t wake_down_wait; | 161 | wait_queue_head_t wake_down_wait; |
| 153 | wait_queue_head_t flush_fifo_wait; | 162 | wait_queue_head_t flush_fifo_wait; |
| 154 | struct timer_list timer; | 163 | struct timer_list inactivity_timer; |
| 155 | struct timer_list rx_slowpath_timer; | 164 | struct timer_list rx_slowpath_timer; |
| 165 | |||
| 166 | /* TX aggregation */ | ||
| 167 | unsigned long aggregation_timeout; | ||
| 168 | int aggregation_len; | ||
| 169 | struct timer_list aggregation_timer; | ||
| 170 | |||
| 156 | unsigned long bits; | 171 | unsigned long bits; |
| 157 | }; | 172 | }; |
| 158 | 173 | ||
diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h index 6bd200a4754a..83a89ba3005b 100644 --- a/include/net/caif/cfpkt.h +++ b/include/net/caif/cfpkt.h | |||
| @@ -188,11 +188,18 @@ struct cfpkt *cfpkt_fromnative(enum caif_direction dir, void *nativepkt); | |||
| 188 | */ | 188 | */ |
| 189 | void *cfpkt_tonative(struct cfpkt *pkt); | 189 | void *cfpkt_tonative(struct cfpkt *pkt); |
| 190 | 190 | ||
| 191 | |||
| 192 | /* | 191 | /* |
| 193 | * Returns packet information for a packet. | 192 | * Returns packet information for a packet. |
| 194 | * pkt Packet to get info from; | 193 | * pkt Packet to get info from; |
| 195 | * @return Packet information | 194 | * @return Packet information |
| 196 | */ | 195 | */ |
| 197 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); | 196 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); |
| 197 | |||
| 198 | /** cfpkt_set_prio - set priority for a CAIF packet. | ||
| 199 | * | ||
| 200 | * @pkt: The CAIF packet to be adjusted. | ||
| 201 | * @prio: one of TC_PRIO_ constants. | ||
| 202 | */ | ||
| 203 | void cfpkt_set_prio(struct cfpkt *pkt, int prio); | ||
| 204 | |||
| 198 | #endif /* CFPKT_H_ */ | 205 | #endif /* CFPKT_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 83d800c31e3c..adb2320bccdf 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -521,6 +521,7 @@ struct station_parameters { | |||
| 521 | * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled | 521 | * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled |
| 522 | * @STATION_INFO_STA_FLAGS: @sta_flags filled | 522 | * @STATION_INFO_STA_FLAGS: @sta_flags filled |
| 523 | * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled | 523 | * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled |
| 524 | * @STATION_INFO_T_OFFSET: @t_offset filled | ||
| 524 | */ | 525 | */ |
| 525 | enum station_info_flags { | 526 | enum station_info_flags { |
| 526 | STATION_INFO_INACTIVE_TIME = 1<<0, | 527 | STATION_INFO_INACTIVE_TIME = 1<<0, |
| @@ -542,7 +543,8 @@ enum station_info_flags { | |||
| 542 | STATION_INFO_CONNECTED_TIME = 1<<16, | 543 | STATION_INFO_CONNECTED_TIME = 1<<16, |
| 543 | STATION_INFO_ASSOC_REQ_IES = 1<<17, | 544 | STATION_INFO_ASSOC_REQ_IES = 1<<17, |
| 544 | STATION_INFO_STA_FLAGS = 1<<18, | 545 | STATION_INFO_STA_FLAGS = 1<<18, |
| 545 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19 | 546 | STATION_INFO_BEACON_LOSS_COUNT = 1<<19, |
| 547 | STATION_INFO_T_OFFSET = 1<<20, | ||
| 546 | }; | 548 | }; |
| 547 | 549 | ||
| 548 | /** | 550 | /** |
| @@ -643,6 +645,7 @@ struct sta_bss_parameters { | |||
| 643 | * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. | 645 | * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. |
| 644 | * @sta_flags: station flags mask & values | 646 | * @sta_flags: station flags mask & values |
| 645 | * @beacon_loss_count: Number of times beacon loss event has triggered. | 647 | * @beacon_loss_count: Number of times beacon loss event has triggered. |
| 648 | * @t_offset: Time offset of the station relative to this host. | ||
| 646 | */ | 649 | */ |
| 647 | struct station_info { | 650 | struct station_info { |
| 648 | u32 filled; | 651 | u32 filled; |
| @@ -671,6 +674,7 @@ struct station_info { | |||
| 671 | size_t assoc_req_ies_len; | 674 | size_t assoc_req_ies_len; |
| 672 | 675 | ||
| 673 | u32 beacon_loss_count; | 676 | u32 beacon_loss_count; |
| 677 | s64 t_offset; | ||
| 674 | 678 | ||
| 675 | /* | 679 | /* |
| 676 | * Note: Add a new enum station_info_flags value for each new field and | 680 | * Note: Add a new enum station_info_flags value for each new field and |
| @@ -798,6 +802,8 @@ struct mesh_config { | |||
| 798 | /* ttl used in path selection information elements */ | 802 | /* ttl used in path selection information elements */ |
| 799 | u8 element_ttl; | 803 | u8 element_ttl; |
| 800 | bool auto_open_plinks; | 804 | bool auto_open_plinks; |
| 805 | /* neighbor offset synchronization */ | ||
| 806 | u32 dot11MeshNbrOffsetMaxNeighbor; | ||
| 801 | /* HWMP parameters */ | 807 | /* HWMP parameters */ |
| 802 | u8 dot11MeshHWMPmaxPREQretries; | 808 | u8 dot11MeshHWMPmaxPREQretries; |
| 803 | u32 path_refresh_time; | 809 | u32 path_refresh_time; |
| @@ -815,12 +821,14 @@ struct mesh_config { | |||
| 815 | bool dot11MeshGateAnnouncementProtocol; | 821 | bool dot11MeshGateAnnouncementProtocol; |
| 816 | bool dot11MeshForwarding; | 822 | bool dot11MeshForwarding; |
| 817 | s32 rssi_threshold; | 823 | s32 rssi_threshold; |
| 824 | u16 ht_opmode; | ||
| 818 | }; | 825 | }; |
| 819 | 826 | ||
| 820 | /** | 827 | /** |
| 821 | * struct mesh_setup - 802.11s mesh setup configuration | 828 | * struct mesh_setup - 802.11s mesh setup configuration |
| 822 | * @mesh_id: the mesh ID | 829 | * @mesh_id: the mesh ID |
| 823 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 830 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
| 831 | * @sync_method: which synchronization method to use | ||
| 824 | * @path_sel_proto: which path selection protocol to use | 832 | * @path_sel_proto: which path selection protocol to use |
| 825 | * @path_metric: which metric to use | 833 | * @path_metric: which metric to use |
| 826 | * @ie: vendor information elements (optional) | 834 | * @ie: vendor information elements (optional) |
| @@ -834,8 +842,9 @@ struct mesh_config { | |||
| 834 | struct mesh_setup { | 842 | struct mesh_setup { |
| 835 | const u8 *mesh_id; | 843 | const u8 *mesh_id; |
| 836 | u8 mesh_id_len; | 844 | u8 mesh_id_len; |
| 837 | u8 path_sel_proto; | 845 | u8 sync_method; |
| 838 | u8 path_metric; | 846 | u8 path_sel_proto; |
| 847 | u8 path_metric; | ||
| 839 | const u8 *ie; | 848 | const u8 *ie; |
| 840 | u8 ie_len; | 849 | u8 ie_len; |
| 841 | bool is_authenticated; | 850 | bool is_authenticated; |
| @@ -845,7 +854,7 @@ struct mesh_setup { | |||
| 845 | 854 | ||
| 846 | /** | 855 | /** |
| 847 | * struct ieee80211_txq_params - TX queue parameters | 856 | * struct ieee80211_txq_params - TX queue parameters |
| 848 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) | 857 | * @ac: AC identifier |
| 849 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled | 858 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled |
| 850 | * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range | 859 | * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range |
| 851 | * 1..32767] | 860 | * 1..32767] |
| @@ -854,7 +863,7 @@ struct mesh_setup { | |||
| 854 | * @aifs: Arbitration interframe space [0..255] | 863 | * @aifs: Arbitration interframe space [0..255] |
| 855 | */ | 864 | */ |
| 856 | struct ieee80211_txq_params { | 865 | struct ieee80211_txq_params { |
| 857 | enum nl80211_txq_q queue; | 866 | enum nl80211_ac ac; |
| 858 | u16 txop; | 867 | u16 txop; |
| 859 | u16 cwmin; | 868 | u16 cwmin; |
| 860 | u16 cwmax; | 869 | u16 cwmax; |
| @@ -1336,6 +1345,9 @@ struct cfg80211_gtk_rekey_data { | |||
| 1336 | * be %NULL or contain the enabled Wake-on-Wireless triggers that are | 1345 | * be %NULL or contain the enabled Wake-on-Wireless triggers that are |
| 1337 | * configured for the device. | 1346 | * configured for the device. |
| 1338 | * @resume: wiphy device needs to be resumed | 1347 | * @resume: wiphy device needs to be resumed |
| 1348 | * @set_wakeup: Called when WoWLAN is enabled/disabled, use this callback | ||
| 1349 | * to call device_set_wakeup_enable() to enable/disable wakeup from | ||
| 1350 | * the device. | ||
| 1339 | * | 1351 | * |
| 1340 | * @add_virtual_intf: create a new virtual interface with the given name, | 1352 | * @add_virtual_intf: create a new virtual interface with the given name, |
| 1341 | * must set the struct wireless_dev's iftype. Beware: You must create | 1353 | * must set the struct wireless_dev's iftype. Beware: You must create |
| @@ -1503,10 +1515,21 @@ struct cfg80211_gtk_rekey_data { | |||
| 1503 | * later passes to cfg80211_probe_status(). | 1515 | * later passes to cfg80211_probe_status(). |
| 1504 | * | 1516 | * |
| 1505 | * @set_noack_map: Set the NoAck Map for the TIDs. | 1517 | * @set_noack_map: Set the NoAck Map for the TIDs. |
| 1518 | * | ||
| 1519 | * @get_et_sset_count: Ethtool API to get string-set count. | ||
| 1520 | * See @ethtool_ops.get_sset_count | ||
| 1521 | * | ||
| 1522 | * @get_et_stats: Ethtool API to get a set of u64 stats. | ||
| 1523 | * See @ethtool_ops.get_ethtool_stats | ||
| 1524 | * | ||
| 1525 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | ||
| 1526 | * and perhaps other supported types of ethtool data-sets. | ||
| 1527 | * See @ethtool_ops.get_strings | ||
| 1506 | */ | 1528 | */ |
| 1507 | struct cfg80211_ops { | 1529 | struct cfg80211_ops { |
| 1508 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1530 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
| 1509 | int (*resume)(struct wiphy *wiphy); | 1531 | int (*resume)(struct wiphy *wiphy); |
| 1532 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); | ||
| 1510 | 1533 | ||
| 1511 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, | 1534 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
| 1512 | char *name, | 1535 | char *name, |
| @@ -1698,7 +1721,15 @@ struct cfg80211_ops { | |||
| 1698 | struct net_device *dev, | 1721 | struct net_device *dev, |
| 1699 | u16 noack_map); | 1722 | u16 noack_map); |
| 1700 | 1723 | ||
| 1701 | struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy); | 1724 | struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy, |
| 1725 | enum nl80211_channel_type *type); | ||
| 1726 | |||
| 1727 | int (*get_et_sset_count)(struct wiphy *wiphy, | ||
| 1728 | struct net_device *dev, int sset); | ||
| 1729 | void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1730 | struct ethtool_stats *stats, u64 *data); | ||
| 1731 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1732 | u32 sset, u8 *data); | ||
| 1702 | }; | 1733 | }; |
| 1703 | 1734 | ||
| 1704 | /* | 1735 | /* |
| @@ -1732,10 +1763,6 @@ struct cfg80211_ops { | |||
| 1732 | * hints read the documenation for regulatory_hint_found_beacon() | 1763 | * hints read the documenation for regulatory_hint_found_beacon() |
| 1733 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this | 1764 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this |
| 1734 | * wiphy at all | 1765 | * wiphy at all |
| 1735 | * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface | ||
| 1736 | * combinations for this device. This flag is used for backward | ||
| 1737 | * compatibility only until all drivers advertise combinations and | ||
| 1738 | * they will always be enforced. | ||
| 1739 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled | 1766 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled |
| 1740 | * by default -- this flag will be set depending on the kernel's default | 1767 | * by default -- this flag will be set depending on the kernel's default |
| 1741 | * on wiphy_new(), but can be changed by the driver if it has a good | 1768 | * on wiphy_new(), but can be changed by the driver if it has a good |
| @@ -1780,7 +1807,7 @@ enum wiphy_flags { | |||
| 1780 | WIPHY_FLAG_IBSS_RSN = BIT(8), | 1807 | WIPHY_FLAG_IBSS_RSN = BIT(8), |
| 1781 | WIPHY_FLAG_MESH_AUTH = BIT(10), | 1808 | WIPHY_FLAG_MESH_AUTH = BIT(10), |
| 1782 | WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), | 1809 | WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), |
| 1783 | WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), | 1810 | /* use hole at 12 */ |
| 1784 | WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), | 1811 | WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), |
| 1785 | WIPHY_FLAG_AP_UAPSD = BIT(14), | 1812 | WIPHY_FLAG_AP_UAPSD = BIT(14), |
| 1786 | WIPHY_FLAG_SUPPORTS_TDLS = BIT(15), | 1813 | WIPHY_FLAG_SUPPORTS_TDLS = BIT(15), |
| @@ -3343,6 +3370,17 @@ int cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | |||
| 3343 | enum nl80211_channel_type channel_type); | 3370 | enum nl80211_channel_type channel_type); |
| 3344 | 3371 | ||
| 3345 | /* | 3372 | /* |
| 3373 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | ||
| 3374 | * @dev: the device which switched channels | ||
| 3375 | * @freq: new channel frequency (in MHz) | ||
| 3376 | * @type: channel type | ||
| 3377 | * | ||
| 3378 | * Acquires wdev_lock, so must only be called from sleepable driver context! | ||
| 3379 | */ | ||
| 3380 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | ||
| 3381 | enum nl80211_channel_type type); | ||
| 3382 | |||
| 3383 | /* | ||
| 3346 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3384 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
| 3347 | * @rate: given rate_info to calculate bitrate from | 3385 | * @rate: given rate_info to calculate bitrate from |
| 3348 | * | 3386 | * |
diff --git a/include/net/codel.h b/include/net/codel.h new file mode 100644 index 000000000000..550debfc2403 --- /dev/null +++ b/include/net/codel.h | |||
| @@ -0,0 +1,342 @@ | |||
| 1 | #ifndef __NET_SCHED_CODEL_H | ||
| 2 | #define __NET_SCHED_CODEL_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Codel - The Controlled-Delay Active Queue Management algorithm | ||
| 6 | * | ||
| 7 | * Copyright (C) 2011-2012 Kathleen Nichols <nichols@pollere.com> | ||
| 8 | * Copyright (C) 2011-2012 Van Jacobson <van@pollere.net> | ||
| 9 | * Copyright (C) 2012 Michael D. Taht <dave.taht@bufferbloat.net> | ||
| 10 | * Copyright (C) 2012 Eric Dumazet <edumazet@google.com> | ||
| 11 | * | ||
| 12 | * Redistribution and use in source and binary forms, with or without | ||
| 13 | * modification, are permitted provided that the following conditions | ||
| 14 | * are met: | ||
| 15 | * 1. Redistributions of source code must retain the above copyright | ||
| 16 | * notice, this list of conditions, and the following disclaimer, | ||
| 17 | * without modification. | ||
| 18 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 19 | * notice, this list of conditions and the following disclaimer in the | ||
| 20 | * documentation and/or other materials provided with the distribution. | ||
| 21 | * 3. The names of the authors may not be used to endorse or promote products | ||
| 22 | * derived from this software without specific prior written permission. | ||
| 23 | * | ||
| 24 | * Alternatively, provided that this notice is retained in full, this | ||
| 25 | * software may be distributed under the terms of the GNU General | ||
| 26 | * Public License ("GPL") version 2, in which case the provisions of the | ||
| 27 | * GPL apply INSTEAD OF those given above. | ||
| 28 | * | ||
| 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 32 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 33 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 34 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 35 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 36 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 37 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 38 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 39 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
| 40 | * DAMAGE. | ||
| 41 | * | ||
| 42 | */ | ||
| 43 | |||
| 44 | #include <linux/types.h> | ||
| 45 | #include <linux/ktime.h> | ||
| 46 | #include <linux/skbuff.h> | ||
| 47 | #include <net/pkt_sched.h> | ||
| 48 | #include <net/inet_ecn.h> | ||
| 49 | #include <linux/reciprocal_div.h> | ||
| 50 | |||
| 51 | /* Controlling Queue Delay (CoDel) algorithm | ||
| 52 | * ========================================= | ||
| 53 | * Source : Kathleen Nichols and Van Jacobson | ||
| 54 | * http://queue.acm.org/detail.cfm?id=2209336 | ||
| 55 | * | ||
| 56 | * Implemented on linux by Dave Taht and Eric Dumazet | ||
| 57 | */ | ||
| 58 | |||
| 59 | |||
| 60 | /* CoDel uses a 1024 nsec clock, encoded in u32 | ||
| 61 | * This gives a range of 2199 seconds, because of signed compares | ||
| 62 | */ | ||
| 63 | typedef u32 codel_time_t; | ||
| 64 | typedef s32 codel_tdiff_t; | ||
| 65 | #define CODEL_SHIFT 10 | ||
| 66 | #define MS2TIME(a) ((a * NSEC_PER_MSEC) >> CODEL_SHIFT) | ||
| 67 | |||
| 68 | static inline codel_time_t codel_get_time(void) | ||
| 69 | { | ||
| 70 | u64 ns = ktime_to_ns(ktime_get()); | ||
| 71 | |||
| 72 | return ns >> CODEL_SHIFT; | ||
| 73 | } | ||
| 74 | |||
| 75 | #define codel_time_after(a, b) ((s32)(a) - (s32)(b) > 0) | ||
| 76 | #define codel_time_after_eq(a, b) ((s32)(a) - (s32)(b) >= 0) | ||
| 77 | #define codel_time_before(a, b) ((s32)(a) - (s32)(b) < 0) | ||
| 78 | #define codel_time_before_eq(a, b) ((s32)(a) - (s32)(b) <= 0) | ||
| 79 | |||
| 80 | /* Qdiscs using codel plugin must use codel_skb_cb in their own cb[] */ | ||
| 81 | struct codel_skb_cb { | ||
| 82 | codel_time_t enqueue_time; | ||
| 83 | }; | ||
| 84 | |||
| 85 | static struct codel_skb_cb *get_codel_cb(const struct sk_buff *skb) | ||
| 86 | { | ||
| 87 | qdisc_cb_private_validate(skb, sizeof(struct codel_skb_cb)); | ||
| 88 | return (struct codel_skb_cb *)qdisc_skb_cb(skb)->data; | ||
| 89 | } | ||
| 90 | |||
| 91 | static codel_time_t codel_get_enqueue_time(const struct sk_buff *skb) | ||
| 92 | { | ||
| 93 | return get_codel_cb(skb)->enqueue_time; | ||
| 94 | } | ||
| 95 | |||
| 96 | static void codel_set_enqueue_time(struct sk_buff *skb) | ||
| 97 | { | ||
| 98 | get_codel_cb(skb)->enqueue_time = codel_get_time(); | ||
| 99 | } | ||
| 100 | |||
| 101 | static inline u32 codel_time_to_us(codel_time_t val) | ||
| 102 | { | ||
| 103 | u64 valns = ((u64)val << CODEL_SHIFT); | ||
| 104 | |||
| 105 | do_div(valns, NSEC_PER_USEC); | ||
| 106 | return (u32)valns; | ||
| 107 | } | ||
| 108 | |||
| 109 | /** | ||
| 110 | * struct codel_params - contains codel parameters | ||
| 111 | * @target: target queue size (in time units) | ||
| 112 | * @interval: width of moving time window | ||
| 113 | * @ecn: is Explicit Congestion Notification enabled | ||
| 114 | */ | ||
| 115 | struct codel_params { | ||
| 116 | codel_time_t target; | ||
| 117 | codel_time_t interval; | ||
| 118 | bool ecn; | ||
| 119 | }; | ||
| 120 | |||
| 121 | /** | ||
| 122 | * struct codel_vars - contains codel variables | ||
| 123 | * @count: how many drops we've done since the last time we | ||
| 124 | * entered dropping state | ||
| 125 | * @lastcount: count at entry to dropping state | ||
| 126 | * @dropping: set to true if in dropping state | ||
| 127 | * @rec_inv_sqrt: reciprocal value of sqrt(count) >> 1 | ||
| 128 | * @first_above_time: when we went (or will go) continuously above target | ||
| 129 | * for interval | ||
| 130 | * @drop_next: time to drop next packet, or when we dropped last | ||
| 131 | * @ldelay: sojourn time of last dequeued packet | ||
| 132 | */ | ||
| 133 | struct codel_vars { | ||
| 134 | u32 count; | ||
| 135 | u32 lastcount; | ||
| 136 | bool dropping; | ||
| 137 | u16 rec_inv_sqrt; | ||
| 138 | codel_time_t first_above_time; | ||
| 139 | codel_time_t drop_next; | ||
| 140 | codel_time_t ldelay; | ||
| 141 | }; | ||
| 142 | |||
| 143 | #define REC_INV_SQRT_BITS (8 * sizeof(u16)) /* or sizeof_in_bits(rec_inv_sqrt) */ | ||
| 144 | /* needed shift to get a Q0.32 number from rec_inv_sqrt */ | ||
| 145 | #define REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS) | ||
| 146 | |||
| 147 | /** | ||
| 148 | * struct codel_stats - contains codel shared variables and stats | ||
| 149 | * @maxpacket: largest packet we've seen so far | ||
| 150 | * @drop_count: temp count of dropped packets in dequeue() | ||
| 151 | * ecn_mark: number of packets we ECN marked instead of dropping | ||
| 152 | */ | ||
| 153 | struct codel_stats { | ||
| 154 | u32 maxpacket; | ||
| 155 | u32 drop_count; | ||
| 156 | u32 ecn_mark; | ||
| 157 | }; | ||
| 158 | |||
| 159 | static void codel_params_init(struct codel_params *params) | ||
| 160 | { | ||
| 161 | params->interval = MS2TIME(100); | ||
| 162 | params->target = MS2TIME(5); | ||
| 163 | params->ecn = false; | ||
| 164 | } | ||
| 165 | |||
| 166 | static void codel_vars_init(struct codel_vars *vars) | ||
| 167 | { | ||
| 168 | memset(vars, 0, sizeof(*vars)); | ||
| 169 | } | ||
| 170 | |||
| 171 | static void codel_stats_init(struct codel_stats *stats) | ||
| 172 | { | ||
| 173 | stats->maxpacket = 256; | ||
| 174 | } | ||
| 175 | |||
| 176 | /* | ||
| 177 | * http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Iterative_methods_for_reciprocal_square_roots | ||
| 178 | * new_invsqrt = (invsqrt / 2) * (3 - count * invsqrt^2) | ||
| 179 | * | ||
| 180 | * Here, invsqrt is a fixed point number (< 1.0), 32bit mantissa, aka Q0.32 | ||
| 181 | */ | ||
| 182 | static void codel_Newton_step(struct codel_vars *vars) | ||
| 183 | { | ||
| 184 | u32 invsqrt = ((u32)vars->rec_inv_sqrt) << REC_INV_SQRT_SHIFT; | ||
| 185 | u32 invsqrt2 = ((u64)invsqrt * invsqrt) >> 32; | ||
| 186 | u64 val = (3LL << 32) - ((u64)vars->count * invsqrt2); | ||
| 187 | |||
| 188 | val >>= 2; /* avoid overflow in following multiply */ | ||
| 189 | val = (val * invsqrt) >> (32 - 2 + 1); | ||
| 190 | |||
| 191 | vars->rec_inv_sqrt = val >> REC_INV_SQRT_SHIFT; | ||
| 192 | } | ||
| 193 | |||
| 194 | /* | ||
| 195 | * CoDel control_law is t + interval/sqrt(count) | ||
| 196 | * We maintain in rec_inv_sqrt the reciprocal value of sqrt(count) to avoid | ||
| 197 | * both sqrt() and divide operation. | ||
| 198 | */ | ||
| 199 | static codel_time_t codel_control_law(codel_time_t t, | ||
| 200 | codel_time_t interval, | ||
| 201 | u32 rec_inv_sqrt) | ||
| 202 | { | ||
| 203 | return t + reciprocal_divide(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); | ||
| 204 | } | ||
| 205 | |||
| 206 | |||
| 207 | static bool codel_should_drop(const struct sk_buff *skb, | ||
| 208 | struct Qdisc *sch, | ||
| 209 | struct codel_vars *vars, | ||
| 210 | struct codel_params *params, | ||
| 211 | struct codel_stats *stats, | ||
| 212 | codel_time_t now) | ||
| 213 | { | ||
| 214 | bool ok_to_drop; | ||
| 215 | |||
| 216 | if (!skb) { | ||
| 217 | vars->first_above_time = 0; | ||
| 218 | return false; | ||
| 219 | } | ||
| 220 | |||
| 221 | vars->ldelay = now - codel_get_enqueue_time(skb); | ||
| 222 | sch->qstats.backlog -= qdisc_pkt_len(skb); | ||
| 223 | |||
| 224 | if (unlikely(qdisc_pkt_len(skb) > stats->maxpacket)) | ||
| 225 | stats->maxpacket = qdisc_pkt_len(skb); | ||
| 226 | |||
| 227 | if (codel_time_before(vars->ldelay, params->target) || | ||
| 228 | sch->qstats.backlog <= stats->maxpacket) { | ||
| 229 | /* went below - stay below for at least interval */ | ||
| 230 | vars->first_above_time = 0; | ||
| 231 | return false; | ||
| 232 | } | ||
| 233 | ok_to_drop = false; | ||
| 234 | if (vars->first_above_time == 0) { | ||
| 235 | /* just went above from below. If we stay above | ||
| 236 | * for at least interval we'll say it's ok to drop | ||
| 237 | */ | ||
| 238 | vars->first_above_time = now + params->interval; | ||
| 239 | } else if (codel_time_after(now, vars->first_above_time)) { | ||
| 240 | ok_to_drop = true; | ||
| 241 | } | ||
| 242 | return ok_to_drop; | ||
| 243 | } | ||
| 244 | |||
| 245 | typedef struct sk_buff * (*codel_skb_dequeue_t)(struct codel_vars *vars, | ||
| 246 | struct Qdisc *sch); | ||
| 247 | |||
| 248 | static struct sk_buff *codel_dequeue(struct Qdisc *sch, | ||
| 249 | struct codel_params *params, | ||
| 250 | struct codel_vars *vars, | ||
| 251 | struct codel_stats *stats, | ||
| 252 | codel_skb_dequeue_t dequeue_func) | ||
| 253 | { | ||
| 254 | struct sk_buff *skb = dequeue_func(vars, sch); | ||
| 255 | codel_time_t now; | ||
| 256 | bool drop; | ||
| 257 | |||
| 258 | if (!skb) { | ||
| 259 | vars->dropping = false; | ||
| 260 | return skb; | ||
| 261 | } | ||
| 262 | now = codel_get_time(); | ||
| 263 | drop = codel_should_drop(skb, sch, vars, params, stats, now); | ||
| 264 | if (vars->dropping) { | ||
| 265 | if (!drop) { | ||
| 266 | /* sojourn time below target - leave dropping state */ | ||
| 267 | vars->dropping = false; | ||
| 268 | } else if (codel_time_after_eq(now, vars->drop_next)) { | ||
| 269 | /* It's time for the next drop. Drop the current | ||
| 270 | * packet and dequeue the next. The dequeue might | ||
| 271 | * take us out of dropping state. | ||
| 272 | * If not, schedule the next drop. | ||
| 273 | * A large backlog might result in drop rates so high | ||
| 274 | * that the next drop should happen now, | ||
| 275 | * hence the while loop. | ||
| 276 | */ | ||
| 277 | while (vars->dropping && | ||
| 278 | codel_time_after_eq(now, vars->drop_next)) { | ||
| 279 | vars->count++; /* dont care of possible wrap | ||
| 280 | * since there is no more divide | ||
| 281 | */ | ||
| 282 | codel_Newton_step(vars); | ||
| 283 | if (params->ecn && INET_ECN_set_ce(skb)) { | ||
| 284 | stats->ecn_mark++; | ||
| 285 | vars->drop_next = | ||
| 286 | codel_control_law(vars->drop_next, | ||
| 287 | params->interval, | ||
| 288 | vars->rec_inv_sqrt); | ||
| 289 | goto end; | ||
| 290 | } | ||
| 291 | qdisc_drop(skb, sch); | ||
| 292 | stats->drop_count++; | ||
| 293 | skb = dequeue_func(vars, sch); | ||
| 294 | if (!codel_should_drop(skb, sch, | ||
| 295 | vars, params, stats, now)) { | ||
| 296 | /* leave dropping state */ | ||
| 297 | vars->dropping = false; | ||
| 298 | } else { | ||
| 299 | /* and schedule the next drop */ | ||
| 300 | vars->drop_next = | ||
| 301 | codel_control_law(vars->drop_next, | ||
| 302 | params->interval, | ||
| 303 | vars->rec_inv_sqrt); | ||
| 304 | } | ||
| 305 | } | ||
| 306 | } | ||
| 307 | } else if (drop) { | ||
| 308 | if (params->ecn && INET_ECN_set_ce(skb)) { | ||
| 309 | stats->ecn_mark++; | ||
| 310 | } else { | ||
| 311 | qdisc_drop(skb, sch); | ||
| 312 | stats->drop_count++; | ||
| 313 | |||
| 314 | skb = dequeue_func(vars, sch); | ||
| 315 | drop = codel_should_drop(skb, sch, vars, params, | ||
| 316 | stats, now); | ||
| 317 | } | ||
| 318 | vars->dropping = true; | ||
| 319 | /* if min went above target close to when we last went below it | ||
| 320 | * assume that the drop rate that controlled the queue on the | ||
| 321 | * last cycle is a good starting point to control it now. | ||
| 322 | */ | ||
| 323 | if (codel_time_before(now - vars->drop_next, | ||
| 324 | 16 * params->interval)) { | ||
| 325 | vars->count = (vars->count - vars->lastcount) | 1; | ||
| 326 | /* we dont care if rec_inv_sqrt approximation | ||
| 327 | * is not very precise : | ||
| 328 | * Next Newton steps will correct it quadratically. | ||
| 329 | */ | ||
| 330 | codel_Newton_step(vars); | ||
| 331 | } else { | ||
| 332 | vars->count = 1; | ||
| 333 | vars->rec_inv_sqrt = ~0U >> REC_INV_SQRT_SHIFT; | ||
| 334 | } | ||
| 335 | vars->lastcount = vars->count; | ||
| 336 | vars->drop_next = codel_control_law(now, params->interval, | ||
| 337 | vars->rec_inv_sqrt); | ||
| 338 | } | ||
| 339 | end: | ||
| 340 | return skb; | ||
| 341 | } | ||
| 342 | #endif | ||
diff --git a/include/net/compat.h b/include/net/compat.h index a974ae92d182..6e9565324989 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
| @@ -42,12 +42,12 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | |||
| 42 | 42 | ||
| 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
| 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr_storage *, int); | 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr_storage *, int); |
| 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); | 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned int); |
| 46 | extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, | 46 | extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, |
| 47 | unsigned, unsigned); | 47 | unsigned int, unsigned int); |
| 48 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); | 48 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned int); |
| 49 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, | 49 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, |
| 50 | unsigned, unsigned, | 50 | unsigned int, unsigned int, |
| 51 | struct compat_timespec __user *); | 51 | struct compat_timespec __user *); |
| 52 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 52 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
| 53 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 53 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index f55c980d8e23..fc5d5dcebb00 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops { | |||
| 48 | /* IEEE 802.1Qaz std */ | 48 | /* IEEE 802.1Qaz std */ |
| 49 | int (*ieee_getets) (struct net_device *, struct ieee_ets *); | 49 | int (*ieee_getets) (struct net_device *, struct ieee_ets *); |
| 50 | int (*ieee_setets) (struct net_device *, struct ieee_ets *); | 50 | int (*ieee_setets) (struct net_device *, struct ieee_ets *); |
| 51 | int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *); | ||
| 52 | int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *); | ||
| 51 | int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); | 53 | int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); |
| 52 | int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); | 54 | int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); |
| 53 | int (*ieee_getapp) (struct net_device *, struct dcb_app *); | 55 | int (*ieee_getapp) (struct net_device *, struct dcb_app *); |
diff --git a/include/net/dn.h b/include/net/dn.h index 814af0b9387d..c88bf4ebd330 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
| @@ -199,7 +199,7 @@ static inline void dn_sk_ports_copy(struct flowidn *fld, struct dn_scp *scp) | |||
| 199 | fld->fld_dport = scp->addrrem; | 199 | fld->fld_dport = scp->addrrem; |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | 202 | extern unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu); |
| 203 | 203 | ||
| 204 | #define DN_MENUVER_ACC 0x01 | 204 | #define DN_MENUVER_ACC 0x01 |
| 205 | #define DN_MENUVER_USR 0x02 | 205 | #define DN_MENUVER_USR 0x02 |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index 782ef7cb4930..1ee9d4bda30d 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
| @@ -31,7 +31,7 @@ struct dn_fib_res { | |||
| 31 | 31 | ||
| 32 | struct dn_fib_nh { | 32 | struct dn_fib_nh { |
| 33 | struct net_device *nh_dev; | 33 | struct net_device *nh_dev; |
| 34 | unsigned nh_flags; | 34 | unsigned int nh_flags; |
| 35 | unsigned char nh_scope; | 35 | unsigned char nh_scope; |
| 36 | int nh_weight; | 36 | int nh_weight; |
| 37 | int nh_power; | 37 | int nh_power; |
| @@ -45,7 +45,7 @@ struct dn_fib_info { | |||
| 45 | int fib_treeref; | 45 | int fib_treeref; |
| 46 | atomic_t fib_clntref; | 46 | atomic_t fib_clntref; |
| 47 | int fib_dead; | 47 | int fib_dead; |
| 48 | unsigned fib_flags; | 48 | unsigned int fib_flags; |
| 49 | int fib_protocol; | 49 | int fib_protocol; |
| 50 | __le16 fib_prefsrc; | 50 | __le16 fib_prefsrc; |
| 51 | __u32 fib_priority; | 51 | __u32 fib_priority; |
| @@ -140,7 +140,7 @@ extern void dn_fib_table_cleanup(void); | |||
| 140 | */ | 140 | */ |
| 141 | extern void dn_fib_rules_init(void); | 141 | extern void dn_fib_rules_init(void); |
| 142 | extern void dn_fib_rules_cleanup(void); | 142 | extern void dn_fib_rules_cleanup(void); |
| 143 | extern unsigned dnet_addr_type(__le16 addr); | 143 | extern unsigned int dnet_addr_type(__le16 addr); |
| 144 | extern int dn_fib_lookup(struct flowidn *fld, struct dn_fib_res *res); | 144 | extern int dn_fib_lookup(struct flowidn *fld, struct dn_fib_res *res); |
| 145 | 145 | ||
| 146 | extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); | 146 | extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb); |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 81712cfa1ddf..c507e05d172f 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
| @@ -76,8 +76,8 @@ struct dn_route { | |||
| 76 | __le16 rt_src_map; | 76 | __le16 rt_src_map; |
| 77 | __le16 rt_dst_map; | 77 | __le16 rt_dst_map; |
| 78 | 78 | ||
| 79 | unsigned rt_flags; | 79 | unsigned int rt_flags; |
| 80 | unsigned rt_type; | 80 | unsigned int rt_type; |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | static inline bool dn_is_input_route(struct dn_route *rt) | 83 | static inline bool dn_is_input_route(struct dn_route *rt) |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index e1c2ee0eef47..3682a0a076c1 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
| @@ -12,7 +12,7 @@ struct sk_buff; | |||
| 12 | struct dst_ops { | 12 | struct dst_ops { |
| 13 | unsigned short family; | 13 | unsigned short family; |
| 14 | __be16 protocol; | 14 | __be16 protocol; |
| 15 | unsigned gc_thresh; | 15 | unsigned int gc_thresh; |
| 16 | 16 | ||
| 17 | int (*gc)(struct dst_ops *ops); | 17 | int (*gc)(struct dst_ops *ops); |
| 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); |
diff --git a/include/net/icmp.h b/include/net/icmp.h index 75d615649071..9ac2524d1402 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | struct icmp_err { | 26 | struct icmp_err { |
| 27 | int errno; | 27 | int errno; |
| 28 | unsigned fatal:1; | 28 | unsigned int fatal:1; |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | extern const struct icmp_err icmp_err_convert[]; | 31 | extern const struct icmp_err icmp_err_convert[]; |
| @@ -41,7 +41,6 @@ struct net; | |||
| 41 | 41 | ||
| 42 | 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); |
| 43 | extern int icmp_rcv(struct sk_buff *skb); | 43 | extern int icmp_rcv(struct sk_buff *skb); |
| 44 | extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); | ||
| 45 | extern int icmp_init(void); | 44 | extern int icmp_init(void); |
| 46 | extern void icmp_out_count(struct net *net, unsigned char type); | 45 | extern void icmp_out_count(struct net *net, unsigned char type); |
| 47 | 46 | ||
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 57430555487a..d104c882fc29 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * An interface between IEEE802.15.4 device and rest of the kernel. | 2 | * An interface between IEEE802.15.4 device and rest of the kernel. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007, 2008, 2009 Siemens AG | 4 | * Copyright (C) 2007-2012 Siemens AG |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 | 7 | * it under the terms of the GNU General Public License version 2 |
| @@ -21,11 +21,14 @@ | |||
| 21 | * Maxim Gorbachyov <maxim.gorbachev@siemens.com> | 21 | * Maxim Gorbachyov <maxim.gorbachev@siemens.com> |
| 22 | * Maxim Osipov <maxim.osipov@siemens.com> | 22 | * Maxim Osipov <maxim.osipov@siemens.com> |
| 23 | * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 23 | * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 24 | * Alexander Smirnov <alex.bluesman.smirnov@gmail.com> | ||
| 24 | */ | 25 | */ |
| 25 | 26 | ||
| 26 | #ifndef IEEE802154_NETDEVICE_H | 27 | #ifndef IEEE802154_NETDEVICE_H |
| 27 | #define IEEE802154_NETDEVICE_H | 28 | #define IEEE802154_NETDEVICE_H |
| 28 | 29 | ||
| 30 | #include <net/af_ieee802154.h> | ||
| 31 | |||
| 29 | /* | 32 | /* |
| 30 | * A control block of skb passed between the ARPHRD_IEEE802154 device | 33 | * A control block of skb passed between the ARPHRD_IEEE802154 device |
| 31 | * and other stack parts. | 34 | * and other stack parts. |
| @@ -110,12 +113,26 @@ struct ieee802154_mlme_ops { | |||
| 110 | u8 (*get_bsn)(const struct net_device *dev); | 113 | u8 (*get_bsn)(const struct net_device *dev); |
| 111 | }; | 114 | }; |
| 112 | 115 | ||
| 113 | static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( | 116 | /* The IEEE 802.15.4 standard defines 2 type of the devices: |
| 114 | const struct net_device *dev) | 117 | * - FFD - full functionality device |
| 118 | * - RFD - reduce functionality device | ||
| 119 | * | ||
| 120 | * So 2 sets of mlme operations are needed | ||
| 121 | */ | ||
| 122 | struct ieee802154_reduced_mlme_ops { | ||
| 123 | struct wpan_phy *(*get_phy)(const struct net_device *dev); | ||
| 124 | }; | ||
| 125 | |||
| 126 | static inline struct ieee802154_mlme_ops * | ||
| 127 | ieee802154_mlme_ops(const struct net_device *dev) | ||
| 115 | { | 128 | { |
| 116 | return dev->ml_priv; | 129 | return dev->ml_priv; |
| 117 | } | 130 | } |
| 118 | 131 | ||
| 119 | #endif | 132 | static inline struct ieee802154_reduced_mlme_ops * |
| 120 | 133 | ieee802154_reduced_mlme_ops(const struct net_device *dev) | |
| 134 | { | ||
| 135 | return dev->ml_priv; | ||
| 136 | } | ||
| 121 | 137 | ||
| 138 | #endif | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 51a7031b4aa3..93563221d29a 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -120,7 +120,7 @@ struct ifmcaddr6 { | |||
| 120 | unsigned char mca_crcount; | 120 | unsigned char mca_crcount; |
| 121 | unsigned long mca_sfcount[2]; | 121 | unsigned long mca_sfcount[2]; |
| 122 | struct timer_list mca_timer; | 122 | struct timer_list mca_timer; |
| 123 | unsigned mca_flags; | 123 | unsigned int mca_flags; |
| 124 | int mca_users; | 124 | int mca_users; |
| 125 | atomic_t mca_refcnt; | 125 | atomic_t mca_refcnt; |
| 126 | spinlock_t mca_lock; | 126 | spinlock_t mca_lock; |
| @@ -209,60 +209,6 @@ static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf) | |||
| 209 | memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); | 209 | memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | static inline void ipv6_tr_mc_map(const struct in6_addr *addr, char *buf) | ||
| 213 | { | ||
| 214 | /* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */ | ||
| 215 | |||
| 216 | if (((addr->s6_addr[0] == 0xFF) && | ||
| 217 | ((addr->s6_addr[1] == 0x01) || (addr->s6_addr[1] == 0x02)) && | ||
| 218 | (addr->s6_addr16[1] == 0) && | ||
| 219 | (addr->s6_addr32[1] == 0) && | ||
| 220 | (addr->s6_addr32[2] == 0) && | ||
| 221 | (addr->s6_addr16[6] == 0) && | ||
| 222 | (addr->s6_addr[15] == 1)) || | ||
| 223 | ((addr->s6_addr[0] == 0xFF) && | ||
| 224 | (addr->s6_addr[1] == 0x02) && | ||
| 225 | (addr->s6_addr16[1] == 0) && | ||
| 226 | (addr->s6_addr32[1] == 0) && | ||
| 227 | (addr->s6_addr16[4] == 0) && | ||
| 228 | (addr->s6_addr[10] == 0) && | ||
| 229 | (addr->s6_addr[11] == 1) && | ||
| 230 | (addr->s6_addr[12] == 0xff))) | ||
| 231 | { | ||
| 232 | buf[0]=0xC0; | ||
| 233 | buf[1]=0x00; | ||
| 234 | buf[2]=0x01; | ||
| 235 | buf[3]=0x00; | ||
| 236 | buf[4]=0x00; | ||
| 237 | buf[5]=0x00; | ||
| 238 | /* All routers FF0x::2 */ | ||
| 239 | } else if ((addr->s6_addr[0] ==0xff) && | ||
| 240 | ((addr->s6_addr[1] & 0xF0) == 0) && | ||
| 241 | (addr->s6_addr16[1] == 0) && | ||
| 242 | (addr->s6_addr32[1] == 0) && | ||
| 243 | (addr->s6_addr32[2] == 0) && | ||
| 244 | (addr->s6_addr16[6] == 0) && | ||
| 245 | (addr->s6_addr[15] == 2)) | ||
| 246 | { | ||
| 247 | buf[0]=0xC0; | ||
| 248 | buf[1]=0x00; | ||
| 249 | buf[2]=0x02; | ||
| 250 | buf[3]=0x00; | ||
| 251 | buf[4]=0x00; | ||
| 252 | buf[5]=0x00; | ||
| 253 | } else { | ||
| 254 | unsigned char i ; | ||
| 255 | |||
| 256 | i = addr->s6_addr[15] & 7 ; | ||
| 257 | buf[0]=0xC0; | ||
| 258 | buf[1]=0x00; | ||
| 259 | buf[2]=0x00; | ||
| 260 | buf[3]=0x01 << i ; | ||
| 261 | buf[4]=0x00; | ||
| 262 | buf[5]=0x00; | ||
| 263 | } | ||
| 264 | } | ||
| 265 | |||
| 266 | static inline void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf) | 212 | static inline void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf) |
| 267 | { | 213 | { |
| 268 | buf[0] = 0x00; | 214 | buf[0] = 0x00; |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index 3207e58ee019..1866a676c810 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -23,7 +23,7 @@ struct sock; | |||
| 23 | struct sockaddr; | 23 | struct sockaddr; |
| 24 | 24 | ||
| 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, | 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, |
| 26 | const struct inet_bind_bucket *tb); | 26 | const struct inet_bind_bucket *tb, bool relax); |
| 27 | 27 | ||
| 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, |
| 29 | const struct request_sock *req); | 29 | const struct request_sock *req); |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index dbf9aab34c82..7d83f90f203f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -45,6 +45,7 @@ struct inet_connection_sock_af_ops { | |||
| 45 | struct dst_entry *dst); | 45 | struct dst_entry *dst); |
| 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); | 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); |
| 47 | u16 net_header_len; | 47 | u16 net_header_len; |
| 48 | u16 net_frag_header_len; | ||
| 48 | u16 sockaddr_len; | 49 | u16 sockaddr_len; |
| 49 | int (*setsockopt)(struct sock *sk, int level, int optname, | 50 | int (*setsockopt)(struct sock *sk, int level, int optname, |
| 50 | char __user *optval, unsigned int optlen); | 51 | char __user *optval, unsigned int optlen); |
| @@ -60,7 +61,7 @@ struct inet_connection_sock_af_ops { | |||
| 60 | #endif | 61 | #endif |
| 61 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | 62 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); |
| 62 | int (*bind_conflict)(const struct sock *sk, | 63 | int (*bind_conflict)(const struct sock *sk, |
| 63 | const struct inet_bind_bucket *tb); | 64 | const struct inet_bind_bucket *tb, bool relax); |
| 64 | }; | 65 | }; |
| 65 | 66 | ||
| 66 | /** inet_connection_sock - INET connection oriented sock | 67 | /** inet_connection_sock - INET connection oriented sock |
| @@ -245,7 +246,7 @@ extern struct request_sock *inet_csk_search_req(const struct sock *sk, | |||
| 245 | const __be32 raddr, | 246 | const __be32 raddr, |
| 246 | const __be32 laddr); | 247 | const __be32 laddr); |
| 247 | extern int inet_csk_bind_conflict(const struct sock *sk, | 248 | extern int inet_csk_bind_conflict(const struct sock *sk, |
| 248 | const struct inet_bind_bucket *tb); | 249 | const struct inet_bind_bucket *tb, bool relax); |
| 249 | extern int inet_csk_get_port(struct sock *sk, unsigned short snum); | 250 | extern int inet_csk_get_port(struct sock *sk, unsigned short snum); |
| 250 | 251 | ||
| 251 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, | 252 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 16ff29a7bb30..2431cf83aeca 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
| @@ -46,8 +46,7 @@ struct inet_frags { | |||
| 46 | void *arg); | 46 | void *arg); |
| 47 | void (*destructor)(struct inet_frag_queue *); | 47 | void (*destructor)(struct inet_frag_queue *); |
| 48 | void (*skb_free)(struct sk_buff *); | 48 | void (*skb_free)(struct sk_buff *); |
| 49 | int (*match)(struct inet_frag_queue *q, | 49 | bool (*match)(struct inet_frag_queue *q, void *arg); |
| 50 | void *arg); | ||
| 51 | void (*frag_expire)(unsigned long data); | 50 | void (*frag_expire)(unsigned long data); |
| 52 | }; | 51 | }; |
| 53 | 52 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index b53d65f24f7b..83e0619f59d0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -141,23 +141,6 @@ static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) | |||
| 141 | extern int ip4_datagram_connect(struct sock *sk, | 141 | extern int ip4_datagram_connect(struct sock *sk, |
| 142 | struct sockaddr *uaddr, int addr_len); | 142 | struct sockaddr *uaddr, int addr_len); |
| 143 | 143 | ||
| 144 | /* | ||
| 145 | * Map a multicast IP onto multicast MAC for type Token Ring. | ||
| 146 | * This conforms to RFC1469 Option 2 Multicasting i.e. | ||
| 147 | * using a functional address to transmit / receive | ||
| 148 | * multicast packets. | ||
| 149 | */ | ||
| 150 | |||
| 151 | static inline void ip_tr_mc_map(__be32 addr, char *buf) | ||
| 152 | { | ||
| 153 | buf[0]=0xC0; | ||
| 154 | buf[1]=0x00; | ||
| 155 | buf[2]=0x00; | ||
| 156 | buf[3]=0x04; | ||
| 157 | buf[4]=0x00; | ||
| 158 | buf[5]=0x00; | ||
| 159 | } | ||
| 160 | |||
| 161 | struct ip_reply_arg { | 144 | struct ip_reply_arg { |
| 162 | struct kvec iov[1]; | 145 | struct kvec iov[1]; |
| 163 | int flags; | 146 | int flags; |
| @@ -222,9 +205,6 @@ static inline int inet_is_reserved_local_port(int port) | |||
| 222 | 205 | ||
| 223 | extern int sysctl_ip_nonlocal_bind; | 206 | extern int sysctl_ip_nonlocal_bind; |
| 224 | 207 | ||
| 225 | extern struct ctl_path net_core_path[]; | ||
| 226 | extern struct ctl_path net_ipv4_ctl_path[]; | ||
| 227 | |||
| 228 | /* From inetpeer.c */ | 208 | /* From inetpeer.c */ |
| 229 | extern int inet_peer_threshold; | 209 | extern int inet_peer_threshold; |
| 230 | extern int inet_peer_minttl; | 210 | extern int inet_peer_minttl; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 2ad92ca4e6f3..37c1a1ed82c1 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -146,7 +146,7 @@ struct rt6_rtnl_dump_arg { | |||
| 146 | 146 | ||
| 147 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); | 147 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); |
| 148 | extern void rt6_ifdown(struct net *net, struct net_device *dev); | 148 | extern void rt6_ifdown(struct net *net, struct net_device *dev); |
| 149 | extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); | 149 | extern void rt6_mtu_change(struct net_device *dev, unsigned int mtu); |
| 150 | extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); | 150 | extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); |
| 151 | 151 | ||
| 152 | 152 | ||
| @@ -175,7 +175,7 @@ static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, | |||
| 175 | spin_unlock(&sk->sk_dst_lock); | 175 | spin_unlock(&sk->sk_dst_lock); |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static inline int ipv6_unicast_destination(struct sk_buff *skb) | 178 | static inline bool ipv6_unicast_destination(const struct sk_buff *skb) |
| 179 | { | 179 | { |
| 180 | struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); | 180 | struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); |
| 181 | 181 | ||
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 10422ef14e28..78df0866cc38 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -49,7 +49,7 @@ struct fib_nh { | |||
| 49 | struct net_device *nh_dev; | 49 | struct net_device *nh_dev; |
| 50 | struct hlist_node nh_hash; | 50 | struct hlist_node nh_hash; |
| 51 | struct fib_info *nh_parent; | 51 | struct fib_info *nh_parent; |
| 52 | unsigned nh_flags; | 52 | unsigned int nh_flags; |
| 53 | unsigned char nh_scope; | 53 | unsigned char nh_scope; |
| 54 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 54 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
| 55 | int nh_weight; | 55 | int nh_weight; |
| @@ -74,7 +74,7 @@ struct fib_info { | |||
| 74 | struct net *fib_net; | 74 | struct net *fib_net; |
| 75 | int fib_treeref; | 75 | int fib_treeref; |
| 76 | atomic_t fib_clntref; | 76 | atomic_t fib_clntref; |
| 77 | unsigned fib_flags; | 77 | unsigned int fib_flags; |
| 78 | unsigned char fib_dead; | 78 | unsigned char fib_dead; |
| 79 | unsigned char fib_protocol; | 79 | unsigned char fib_protocol; |
| 80 | unsigned char fib_scope; | 80 | unsigned char fib_scope; |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 72522f087375..d6146b4811c2 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #include <asm/types.h> /* for __uXX types */ | 11 | #include <asm/types.h> /* for __uXX types */ |
| 12 | 12 | ||
| 13 | #include <linux/sysctl.h> /* for ctl_path */ | ||
| 14 | #include <linux/list.h> /* for struct list_head */ | 13 | #include <linux/list.h> /* for struct list_head */ |
| 15 | #include <linux/spinlock.h> /* for struct rwlock_t */ | 14 | #include <linux/spinlock.h> /* for struct rwlock_t */ |
| 16 | #include <linux/atomic.h> /* for struct atomic_t */ | 15 | #include <linux/atomic.h> /* for struct atomic_t */ |
| @@ -505,6 +504,7 @@ struct ip_vs_conn { | |||
| 505 | * state transition triggerd | 504 | * state transition triggerd |
| 506 | * synchronization | 505 | * synchronization |
| 507 | */ | 506 | */ |
| 507 | unsigned long sync_endtime; /* jiffies + sent_retries */ | ||
| 508 | 508 | ||
| 509 | /* Control members */ | 509 | /* Control members */ |
| 510 | struct ip_vs_conn *control; /* Master control connection */ | 510 | struct ip_vs_conn *control; /* Master control connection */ |
| @@ -580,8 +580,8 @@ struct ip_vs_service_user_kern { | |||
| 580 | /* virtual service options */ | 580 | /* virtual service options */ |
| 581 | char *sched_name; | 581 | char *sched_name; |
| 582 | char *pe_name; | 582 | char *pe_name; |
| 583 | unsigned flags; /* virtual service flags */ | 583 | unsigned int flags; /* virtual service flags */ |
| 584 | unsigned timeout; /* persistent timeout in sec */ | 584 | unsigned int timeout; /* persistent timeout in sec */ |
| 585 | u32 netmask; /* persistent netmask */ | 585 | u32 netmask; /* persistent netmask */ |
| 586 | }; | 586 | }; |
| 587 | 587 | ||
| @@ -592,7 +592,7 @@ struct ip_vs_dest_user_kern { | |||
| 592 | u16 port; | 592 | u16 port; |
| 593 | 593 | ||
| 594 | /* real server options */ | 594 | /* real server options */ |
| 595 | unsigned conn_flags; /* connection flags */ | 595 | unsigned int conn_flags; /* connection flags */ |
| 596 | int weight; /* destination weight */ | 596 | int weight; /* destination weight */ |
| 597 | 597 | ||
| 598 | /* thresholds for active connections */ | 598 | /* thresholds for active connections */ |
| @@ -616,8 +616,8 @@ struct ip_vs_service { | |||
| 616 | union nf_inet_addr addr; /* IP address for virtual service */ | 616 | union nf_inet_addr addr; /* IP address for virtual service */ |
| 617 | __be16 port; /* port number for the service */ | 617 | __be16 port; /* port number for the service */ |
| 618 | __u32 fwmark; /* firewall mark of the service */ | 618 | __u32 fwmark; /* firewall mark of the service */ |
| 619 | unsigned flags; /* service status flags */ | 619 | unsigned int flags; /* service status flags */ |
| 620 | unsigned timeout; /* persistent timeout in ticks */ | 620 | unsigned int timeout; /* persistent timeout in ticks */ |
| 621 | __be32 netmask; /* grouping granularity */ | 621 | __be32 netmask; /* grouping granularity */ |
| 622 | struct net *net; | 622 | struct net *net; |
| 623 | 623 | ||
| @@ -647,7 +647,7 @@ struct ip_vs_dest { | |||
| 647 | u16 af; /* address family */ | 647 | u16 af; /* address family */ |
| 648 | __be16 port; /* port number of the server */ | 648 | __be16 port; /* port number of the server */ |
| 649 | union nf_inet_addr addr; /* IP address of the server */ | 649 | union nf_inet_addr addr; /* IP address of the server */ |
| 650 | volatile unsigned flags; /* dest status flags */ | 650 | volatile unsigned int flags; /* dest status flags */ |
| 651 | atomic_t conn_flags; /* flags to copy to conn */ | 651 | atomic_t conn_flags; /* flags to copy to conn */ |
| 652 | atomic_t weight; /* server weight */ | 652 | atomic_t weight; /* server weight */ |
| 653 | 653 | ||
| @@ -784,6 +784,16 @@ struct ip_vs_app { | |||
| 784 | void (*timeout_change)(struct ip_vs_app *app, int flags); | 784 | void (*timeout_change)(struct ip_vs_app *app, int flags); |
| 785 | }; | 785 | }; |
| 786 | 786 | ||
| 787 | struct ipvs_master_sync_state { | ||
| 788 | struct list_head sync_queue; | ||
| 789 | struct ip_vs_sync_buff *sync_buff; | ||
| 790 | int sync_queue_len; | ||
| 791 | unsigned int sync_queue_delay; | ||
| 792 | struct task_struct *master_thread; | ||
| 793 | struct delayed_work master_wakeup_work; | ||
| 794 | struct netns_ipvs *ipvs; | ||
| 795 | }; | ||
| 796 | |||
| 787 | /* IPVS in network namespace */ | 797 | /* IPVS in network namespace */ |
| 788 | struct netns_ipvs { | 798 | struct netns_ipvs { |
| 789 | int gen; /* Generation */ | 799 | int gen; /* Generation */ |
| @@ -870,10 +880,15 @@ struct netns_ipvs { | |||
| 870 | #endif | 880 | #endif |
| 871 | int sysctl_snat_reroute; | 881 | int sysctl_snat_reroute; |
| 872 | int sysctl_sync_ver; | 882 | int sysctl_sync_ver; |
| 883 | int sysctl_sync_ports; | ||
| 884 | int sysctl_sync_qlen_max; | ||
| 885 | int sysctl_sync_sock_size; | ||
| 873 | int sysctl_cache_bypass; | 886 | int sysctl_cache_bypass; |
| 874 | int sysctl_expire_nodest_conn; | 887 | int sysctl_expire_nodest_conn; |
| 875 | int sysctl_expire_quiescent_template; | 888 | int sysctl_expire_quiescent_template; |
| 876 | int sysctl_sync_threshold[2]; | 889 | int sysctl_sync_threshold[2]; |
| 890 | unsigned int sysctl_sync_refresh_period; | ||
| 891 | int sysctl_sync_retries; | ||
| 877 | int sysctl_nat_icmp_send; | 892 | int sysctl_nat_icmp_send; |
| 878 | 893 | ||
| 879 | /* ip_vs_lblc */ | 894 | /* ip_vs_lblc */ |
| @@ -889,13 +904,11 @@ struct netns_ipvs { | |||
| 889 | spinlock_t est_lock; | 904 | spinlock_t est_lock; |
| 890 | struct timer_list est_timer; /* Estimation timer */ | 905 | struct timer_list est_timer; /* Estimation timer */ |
| 891 | /* ip_vs_sync */ | 906 | /* ip_vs_sync */ |
| 892 | struct list_head sync_queue; | ||
| 893 | spinlock_t sync_lock; | 907 | spinlock_t sync_lock; |
| 894 | struct ip_vs_sync_buff *sync_buff; | 908 | struct ipvs_master_sync_state *ms; |
| 895 | spinlock_t sync_buff_lock; | 909 | spinlock_t sync_buff_lock; |
| 896 | struct sockaddr_in sync_mcast_addr; | 910 | struct task_struct **backup_threads; |
| 897 | struct task_struct *master_thread; | 911 | int threads_mask; |
| 898 | struct task_struct *backup_thread; | ||
| 899 | int send_mesg_maxlen; | 912 | int send_mesg_maxlen; |
| 900 | int recv_mesg_maxlen; | 913 | int recv_mesg_maxlen; |
| 901 | volatile int sync_state; | 914 | volatile int sync_state; |
| @@ -912,6 +925,14 @@ struct netns_ipvs { | |||
| 912 | #define DEFAULT_SYNC_THRESHOLD 3 | 925 | #define DEFAULT_SYNC_THRESHOLD 3 |
| 913 | #define DEFAULT_SYNC_PERIOD 50 | 926 | #define DEFAULT_SYNC_PERIOD 50 |
| 914 | #define DEFAULT_SYNC_VER 1 | 927 | #define DEFAULT_SYNC_VER 1 |
| 928 | #define DEFAULT_SYNC_REFRESH_PERIOD (0U * HZ) | ||
| 929 | #define DEFAULT_SYNC_RETRIES 0 | ||
| 930 | #define IPVS_SYNC_WAKEUP_RATE 8 | ||
| 931 | #define IPVS_SYNC_QLEN_MAX (IPVS_SYNC_WAKEUP_RATE * 4) | ||
| 932 | #define IPVS_SYNC_SEND_DELAY (HZ / 50) | ||
| 933 | #define IPVS_SYNC_CHECK_PERIOD HZ | ||
| 934 | #define IPVS_SYNC_FLUSH_TIME (HZ * 2) | ||
| 935 | #define IPVS_SYNC_PORTS_MAX (1 << 6) | ||
| 915 | 936 | ||
| 916 | #ifdef CONFIG_SYSCTL | 937 | #ifdef CONFIG_SYSCTL |
| 917 | 938 | ||
| @@ -922,7 +943,17 @@ static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | |||
| 922 | 943 | ||
| 923 | static inline int sysctl_sync_period(struct netns_ipvs *ipvs) | 944 | static inline int sysctl_sync_period(struct netns_ipvs *ipvs) |
| 924 | { | 945 | { |
| 925 | return ipvs->sysctl_sync_threshold[1]; | 946 | return ACCESS_ONCE(ipvs->sysctl_sync_threshold[1]); |
| 947 | } | ||
| 948 | |||
| 949 | static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs) | ||
| 950 | { | ||
| 951 | return ACCESS_ONCE(ipvs->sysctl_sync_refresh_period); | ||
| 952 | } | ||
| 953 | |||
| 954 | static inline int sysctl_sync_retries(struct netns_ipvs *ipvs) | ||
| 955 | { | ||
| 956 | return ipvs->sysctl_sync_retries; | ||
| 926 | } | 957 | } |
| 927 | 958 | ||
| 928 | static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) | 959 | static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) |
| @@ -930,6 +961,21 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) | |||
| 930 | return ipvs->sysctl_sync_ver; | 961 | return ipvs->sysctl_sync_ver; |
| 931 | } | 962 | } |
| 932 | 963 | ||
| 964 | static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) | ||
| 965 | { | ||
| 966 | return ACCESS_ONCE(ipvs->sysctl_sync_ports); | ||
| 967 | } | ||
| 968 | |||
| 969 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) | ||
| 970 | { | ||
| 971 | return ipvs->sysctl_sync_qlen_max; | ||
| 972 | } | ||
| 973 | |||
| 974 | static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | ||
| 975 | { | ||
| 976 | return ipvs->sysctl_sync_sock_size; | ||
| 977 | } | ||
| 978 | |||
| 933 | #else | 979 | #else |
| 934 | 980 | ||
| 935 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 981 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
| @@ -942,18 +988,43 @@ static inline int sysctl_sync_period(struct netns_ipvs *ipvs) | |||
| 942 | return DEFAULT_SYNC_PERIOD; | 988 | return DEFAULT_SYNC_PERIOD; |
| 943 | } | 989 | } |
| 944 | 990 | ||
| 991 | static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs) | ||
| 992 | { | ||
| 993 | return DEFAULT_SYNC_REFRESH_PERIOD; | ||
| 994 | } | ||
| 995 | |||
| 996 | static inline int sysctl_sync_retries(struct netns_ipvs *ipvs) | ||
| 997 | { | ||
| 998 | return DEFAULT_SYNC_RETRIES & 3; | ||
| 999 | } | ||
| 1000 | |||
| 945 | static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) | 1001 | static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) |
| 946 | { | 1002 | { |
| 947 | return DEFAULT_SYNC_VER; | 1003 | return DEFAULT_SYNC_VER; |
| 948 | } | 1004 | } |
| 949 | 1005 | ||
| 1006 | static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) | ||
| 1007 | { | ||
| 1008 | return 1; | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) | ||
| 1012 | { | ||
| 1013 | return IPVS_SYNC_QLEN_MAX; | ||
| 1014 | } | ||
| 1015 | |||
| 1016 | static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | ||
| 1017 | { | ||
| 1018 | return 0; | ||
| 1019 | } | ||
| 1020 | |||
| 950 | #endif | 1021 | #endif |
| 951 | 1022 | ||
| 952 | /* | 1023 | /* |
| 953 | * IPVS core functions | 1024 | * IPVS core functions |
| 954 | * (from ip_vs_core.c) | 1025 | * (from ip_vs_core.c) |
| 955 | */ | 1026 | */ |
| 956 | extern const char *ip_vs_proto_name(unsigned proto); | 1027 | extern const char *ip_vs_proto_name(unsigned int proto); |
| 957 | extern void ip_vs_init_hash_table(struct list_head *table, int rows); | 1028 | extern void ip_vs_init_hash_table(struct list_head *table, int rows); |
| 958 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) | 1029 | #define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) |
| 959 | 1030 | ||
| @@ -1014,7 +1085,7 @@ extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); | |||
| 1014 | 1085 | ||
| 1015 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, | 1086 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, |
| 1016 | const union nf_inet_addr *daddr, | 1087 | const union nf_inet_addr *daddr, |
| 1017 | __be16 dport, unsigned flags, | 1088 | __be16 dport, unsigned int flags, |
| 1018 | struct ip_vs_dest *dest, __u32 fwmark); | 1089 | struct ip_vs_dest *dest, __u32 fwmark); |
| 1019 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | 1090 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); |
| 1020 | 1091 | ||
| @@ -1184,10 +1255,8 @@ extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | |||
| 1184 | * IPVS control data and functions (from ip_vs_ctl.c) | 1255 | * IPVS control data and functions (from ip_vs_ctl.c) |
| 1185 | */ | 1256 | */ |
| 1186 | extern struct ip_vs_stats ip_vs_stats; | 1257 | extern struct ip_vs_stats ip_vs_stats; |
| 1187 | extern const struct ctl_path net_vs_ctl_path[]; | ||
| 1188 | extern int sysctl_ip_vs_sync_ver; | 1258 | extern int sysctl_ip_vs_sync_ver; |
| 1189 | 1259 | ||
| 1190 | extern void ip_vs_sync_switch_mode(struct net *net, int mode); | ||
| 1191 | extern struct ip_vs_service * | 1260 | extern struct ip_vs_service * |
| 1192 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, | 1261 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, |
| 1193 | const union nf_inet_addr *vaddr, __be16 vport); | 1262 | const union nf_inet_addr *vaddr, __be16 vport); |
| @@ -1221,7 +1290,7 @@ extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | |||
| 1221 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, | 1290 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, |
| 1222 | __u8 syncid); | 1291 | __u8 syncid); |
| 1223 | extern int stop_sync_thread(struct net *net, int state); | 1292 | extern int stop_sync_thread(struct net *net, int state); |
| 1224 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); | 1293 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts); |
| 1225 | 1294 | ||
| 1226 | 1295 | ||
| 1227 | /* | 1296 | /* |
diff --git a/include/net/ipip.h b/include/net/ipip.h index a32654d52730..a93cf6d7e94b 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
| @@ -54,8 +54,10 @@ struct ip_tunnel_prl_entry { | |||
| 54 | \ | 54 | \ |
| 55 | err = ip_local_out(skb); \ | 55 | err = ip_local_out(skb); \ |
| 56 | if (likely(net_xmit_eval(err) == 0)) { \ | 56 | if (likely(net_xmit_eval(err) == 0)) { \ |
| 57 | u64_stats_update_begin(&(stats1)->syncp); \ | ||
| 57 | (stats1)->tx_bytes += pkt_len; \ | 58 | (stats1)->tx_bytes += pkt_len; \ |
| 58 | (stats1)->tx_packets++; \ | 59 | (stats1)->tx_packets++; \ |
| 60 | u64_stats_update_end(&(stats1)->syncp); \ | ||
| 59 | } else { \ | 61 | } else { \ |
| 60 | (stats2)->tx_errors++; \ | 62 | (stats2)->tx_errors++; \ |
| 61 | (stats2)->tx_aborted_errors++; \ | 63 | (stats2)->tx_aborted_errors++; \ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index e4170a22fc6f..aecf88436abf 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -113,7 +113,6 @@ struct frag_hdr { | |||
| 113 | 113 | ||
| 114 | /* sysctls */ | 114 | /* sysctls */ |
| 115 | extern int sysctl_mld_max_msf; | 115 | extern int sysctl_mld_max_msf; |
| 116 | extern struct ctl_path net_ipv6_ctl_path[]; | ||
| 117 | 116 | ||
| 118 | #define _DEVINC(net, statname, modifier, idev, field) \ | 117 | #define _DEVINC(net, statname, modifier, idev, field) \ |
| 119 | ({ \ | 118 | ({ \ |
| @@ -264,7 +263,7 @@ extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_t | |||
| 264 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, | 263 | struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, |
| 265 | struct ipv6_txoptions *opt); | 264 | struct ipv6_txoptions *opt); |
| 266 | 265 | ||
| 267 | extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); | 266 | extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); |
| 268 | 267 | ||
| 269 | int ip6_frag_nqueues(struct net *net); | 268 | int ip6_frag_nqueues(struct net *net); |
| 270 | int ip6_frag_mem(struct net *net); | 269 | int ip6_frag_mem(struct net *net); |
| @@ -333,8 +332,8 @@ static inline void ipv6_addr_set(struct in6_addr *addr, | |||
| 333 | addr->s6_addr32[3] = w4; | 332 | addr->s6_addr32[3] = w4; |
| 334 | } | 333 | } |
| 335 | 334 | ||
| 336 | static inline int ipv6_addr_equal(const struct in6_addr *a1, | 335 | static inline bool ipv6_addr_equal(const struct in6_addr *a1, |
| 337 | const struct in6_addr *a2) | 336 | const struct in6_addr *a2) |
| 338 | { | 337 | { |
| 339 | return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | | 338 | return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | |
| 340 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | | 339 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | |
| @@ -342,27 +341,27 @@ static inline int ipv6_addr_equal(const struct in6_addr *a1, | |||
| 342 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; | 341 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; |
| 343 | } | 342 | } |
| 344 | 343 | ||
| 345 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 344 | static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, |
| 346 | unsigned int prefixlen) | 345 | unsigned int prefixlen) |
| 347 | { | 346 | { |
| 348 | unsigned pdw, pbi; | 347 | unsigned int pdw, pbi; |
| 349 | 348 | ||
| 350 | /* check complete u32 in prefix */ | 349 | /* check complete u32 in prefix */ |
| 351 | pdw = prefixlen >> 5; | 350 | pdw = prefixlen >> 5; |
| 352 | if (pdw && memcmp(a1, a2, pdw << 2)) | 351 | if (pdw && memcmp(a1, a2, pdw << 2)) |
| 353 | return 0; | 352 | return false; |
| 354 | 353 | ||
| 355 | /* check incomplete u32 in prefix */ | 354 | /* check incomplete u32 in prefix */ |
| 356 | pbi = prefixlen & 0x1f; | 355 | pbi = prefixlen & 0x1f; |
| 357 | if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi)))) | 356 | if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi)))) |
| 358 | return 0; | 357 | return false; |
| 359 | 358 | ||
| 360 | return 1; | 359 | return true; |
| 361 | } | 360 | } |
| 362 | 361 | ||
| 363 | static inline int ipv6_prefix_equal(const struct in6_addr *a1, | 362 | static inline bool ipv6_prefix_equal(const struct in6_addr *a1, |
| 364 | const struct in6_addr *a2, | 363 | const struct in6_addr *a2, |
| 365 | unsigned int prefixlen) | 364 | unsigned int prefixlen) |
| 366 | { | 365 | { |
| 367 | return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32, | 366 | return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32, |
| 368 | prefixlen); | 367 | prefixlen); |
| @@ -388,21 +387,21 @@ struct ip6_create_arg { | |||
| 388 | }; | 387 | }; |
| 389 | 388 | ||
| 390 | void ip6_frag_init(struct inet_frag_queue *q, void *a); | 389 | void ip6_frag_init(struct inet_frag_queue *q, void *a); |
| 391 | int ip6_frag_match(struct inet_frag_queue *q, void *a); | 390 | bool ip6_frag_match(struct inet_frag_queue *q, void *a); |
| 392 | 391 | ||
| 393 | static inline int ipv6_addr_any(const struct in6_addr *a) | 392 | static inline bool ipv6_addr_any(const struct in6_addr *a) |
| 394 | { | 393 | { |
| 395 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 394 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
| 396 | a->s6_addr32[2] | a->s6_addr32[3]) == 0; | 395 | a->s6_addr32[2] | a->s6_addr32[3]) == 0; |
| 397 | } | 396 | } |
| 398 | 397 | ||
| 399 | static inline int ipv6_addr_loopback(const struct in6_addr *a) | 398 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
| 400 | { | 399 | { |
| 401 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 400 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
| 402 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; | 401 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; |
| 403 | } | 402 | } |
| 404 | 403 | ||
| 405 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 404 | static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) |
| 406 | { | 405 | { |
| 407 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 406 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
| 408 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; | 407 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; |
| @@ -412,7 +411,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | |||
| 412 | * Check for a RFC 4843 ORCHID address | 411 | * Check for a RFC 4843 ORCHID address |
| 413 | * (Overlay Routable Cryptographic Hash Identifiers) | 412 | * (Overlay Routable Cryptographic Hash Identifiers) |
| 414 | */ | 413 | */ |
| 415 | static inline int ipv6_addr_orchid(const struct in6_addr *a) | 414 | static inline bool ipv6_addr_orchid(const struct in6_addr *a) |
| 416 | { | 415 | { |
| 417 | return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010); | 416 | return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010); |
| 418 | } | 417 | } |
| @@ -560,7 +559,7 @@ extern void ipv6_push_frag_opts(struct sk_buff *skb, | |||
| 560 | extern int ipv6_skip_exthdr(const struct sk_buff *, int start, | 559 | extern int ipv6_skip_exthdr(const struct sk_buff *, int start, |
| 561 | u8 *nexthdrp, __be16 *frag_offp); | 560 | u8 *nexthdrp, __be16 *frag_offp); |
| 562 | 561 | ||
| 563 | extern int ipv6_ext_hdr(u8 nexthdr); | 562 | extern bool ipv6_ext_hdr(u8 nexthdr); |
| 564 | 563 | ||
| 565 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | 564 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); |
| 566 | 565 | ||
| @@ -661,8 +660,6 @@ extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); | |||
| 661 | extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); | 660 | extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); |
| 662 | extern int ipv6_sysctl_register(void); | 661 | extern int ipv6_sysctl_register(void); |
| 663 | extern void ipv6_sysctl_unregister(void); | 662 | extern void ipv6_sysctl_unregister(void); |
| 664 | extern int ipv6_static_sysctl_register(void); | ||
| 665 | extern void ipv6_static_sysctl_unregister(void); | ||
| 666 | #endif | 663 | #endif |
| 667 | 664 | ||
| 668 | #endif /* _NET_IPV6_H */ | 665 | #endif /* _NET_IPV6_H */ |
diff --git a/include/net/lapb.h b/include/net/lapb.h index fd2bf572ee1d..df892a94f2c6 100644 --- a/include/net/lapb.h +++ b/include/net/lapb.h | |||
| @@ -149,4 +149,10 @@ extern int lapb_t1timer_running(struct lapb_cb *lapb); | |||
| 149 | */ | 149 | */ |
| 150 | #define LAPB_DEBUG 0 | 150 | #define LAPB_DEBUG 0 |
| 151 | 151 | ||
| 152 | #define lapb_dbg(level, fmt, ...) \ | ||
| 153 | do { \ | ||
| 154 | if (level < LAPB_DEBUG) \ | ||
| 155 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
| 156 | } while (0) | ||
| 157 | |||
| 152 | #endif | 158 | #endif |
diff --git a/include/net/llc_c_ev.h b/include/net/llc_c_ev.h index 23a409381fa9..6ca3113df39e 100644 --- a/include/net/llc_c_ev.h +++ b/include/net/llc_c_ev.h | |||
| @@ -264,6 +264,6 @@ extern int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, | |||
| 264 | static __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb) | 264 | static __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb) |
| 265 | { | 265 | { |
| 266 | return atomic_read(&sk->sk_rmem_alloc) + skb->truesize < | 266 | return atomic_read(&sk->sk_rmem_alloc) + skb->truesize < |
| 267 | (unsigned)sk->sk_rcvbuf; | 267 | (unsigned int)sk->sk_rcvbuf; |
| 268 | } | 268 | } |
| 269 | #endif /* LLC_C_EV_H */ | 269 | #endif /* LLC_C_EV_H */ |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index f57e7d46a453..5a93d13ac95c 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/if_ether.h> | 15 | #include <linux/if_ether.h> |
| 16 | #include <linux/if_tr.h> | ||
| 17 | 16 | ||
| 18 | /* Lengths of frame formats */ | 17 | /* Lengths of frame formats */ |
| 19 | #define LLC_PDU_LEN_I 4 /* header and 2 control bytes */ | 18 | #define LLC_PDU_LEN_I 4 /* header and 2 control bytes */ |
| @@ -253,10 +252,6 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | |||
| 253 | { | 252 | { |
| 254 | if (skb->protocol == htons(ETH_P_802_2)) | 253 | if (skb->protocol == htons(ETH_P_802_2)) |
| 255 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); | 254 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); |
| 256 | else if (skb->protocol == htons(ETH_P_TR_802_2)) { | ||
| 257 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); | ||
| 258 | *sa &= 0x7F; | ||
| 259 | } | ||
| 260 | } | 255 | } |
| 261 | 256 | ||
| 262 | /** | 257 | /** |
| @@ -270,8 +265,6 @@ static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da) | |||
| 270 | { | 265 | { |
| 271 | if (skb->protocol == htons(ETH_P_802_2)) | 266 | if (skb->protocol == htons(ETH_P_802_2)) |
| 272 | memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); | 267 | memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); |
| 273 | else if (skb->protocol == htons(ETH_P_TR_802_2)) | ||
| 274 | memcpy(da, tr_hdr(skb)->daddr, ETH_ALEN); | ||
| 275 | } | 268 | } |
| 276 | 269 | ||
| 277 | /** | 270 | /** |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9210bdc7bd8d..4d6e6c6818d0 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -95,9 +95,11 @@ struct device; | |||
| 95 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. | 95 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. |
| 96 | */ | 96 | */ |
| 97 | enum ieee80211_max_queues { | 97 | enum ieee80211_max_queues { |
| 98 | IEEE80211_MAX_QUEUES = 4, | 98 | IEEE80211_MAX_QUEUES = 16, |
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | #define IEEE80211_INVAL_HW_QUEUE 0xff | ||
| 102 | |||
| 101 | /** | 103 | /** |
| 102 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 | 104 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 |
| 103 | * @IEEE80211_AC_VO: voice | 105 | * @IEEE80211_AC_VO: voice |
| @@ -244,7 +246,7 @@ enum ieee80211_rssi_event { | |||
| 244 | * @channel_type: Channel type for this BSS -- the hardware might be | 246 | * @channel_type: Channel type for this BSS -- the hardware might be |
| 245 | * configured for HT40+ while this BSS only uses no-HT, for | 247 | * configured for HT40+ while this BSS only uses no-HT, for |
| 246 | * example. | 248 | * example. |
| 247 | * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info). | 249 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. |
| 248 | * This field is only valid when the channel type is one of the HT types. | 250 | * This field is only valid when the channel type is one of the HT types. |
| 249 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 251 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
| 250 | * implies disabled | 252 | * implies disabled |
| @@ -522,7 +524,7 @@ struct ieee80211_tx_rate { | |||
| 522 | * | 524 | * |
| 523 | * @flags: transmit info flags, defined above | 525 | * @flags: transmit info flags, defined above |
| 524 | * @band: the band to transmit on (use for checking for races) | 526 | * @band: the band to transmit on (use for checking for races) |
| 525 | * @antenna_sel_tx: antenna to use, 0 for automatic diversity | 527 | * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC |
| 526 | * @ack_frame_id: internal frame ID for TX status, used internally | 528 | * @ack_frame_id: internal frame ID for TX status, used internally |
| 527 | * @control: union for control data | 529 | * @control: union for control data |
| 528 | * @status: union for status data | 530 | * @status: union for status data |
| @@ -538,7 +540,7 @@ struct ieee80211_tx_info { | |||
| 538 | u32 flags; | 540 | u32 flags; |
| 539 | u8 band; | 541 | u8 band; |
| 540 | 542 | ||
| 541 | u8 antenna_sel_tx; | 543 | u8 hw_queue; |
| 542 | 544 | ||
| 543 | u16 ack_frame_id; | 545 | u16 ack_frame_id; |
| 544 | 546 | ||
| @@ -564,7 +566,8 @@ struct ieee80211_tx_info { | |||
| 564 | u8 ampdu_ack_len; | 566 | u8 ampdu_ack_len; |
| 565 | int ack_signal; | 567 | int ack_signal; |
| 566 | u8 ampdu_len; | 568 | u8 ampdu_len; |
| 567 | /* 15 bytes free */ | 569 | u8 antenna; |
| 570 | /* 14 bytes free */ | ||
| 568 | } status; | 571 | } status; |
| 569 | struct { | 572 | struct { |
| 570 | struct ieee80211_tx_rate driver_rates[ | 573 | struct ieee80211_tx_rate driver_rates[ |
| @@ -888,6 +891,8 @@ enum ieee80211_vif_flags { | |||
| 888 | * these need to be set (or cleared) when the interface is added | 891 | * these need to be set (or cleared) when the interface is added |
| 889 | * or, if supported by the driver, the interface type is changed | 892 | * or, if supported by the driver, the interface type is changed |
| 890 | * at runtime, mac80211 will never touch this field | 893 | * at runtime, mac80211 will never touch this field |
| 894 | * @hw_queue: hardware queue for each AC | ||
| 895 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only | ||
| 891 | * @drv_priv: data area for driver use, will always be aligned to | 896 | * @drv_priv: data area for driver use, will always be aligned to |
| 892 | * sizeof(void *). | 897 | * sizeof(void *). |
| 893 | */ | 898 | */ |
| @@ -896,7 +901,12 @@ struct ieee80211_vif { | |||
| 896 | struct ieee80211_bss_conf bss_conf; | 901 | struct ieee80211_bss_conf bss_conf; |
| 897 | u8 addr[ETH_ALEN]; | 902 | u8 addr[ETH_ALEN]; |
| 898 | bool p2p; | 903 | bool p2p; |
| 904 | |||
| 905 | u8 cab_queue; | ||
| 906 | u8 hw_queue[IEEE80211_NUM_ACS]; | ||
| 907 | |||
| 899 | u32 driver_flags; | 908 | u32 driver_flags; |
| 909 | |||
| 900 | /* must be last */ | 910 | /* must be last */ |
| 901 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 911 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
| 902 | }; | 912 | }; |
| @@ -1174,6 +1184,15 @@ enum sta_notify_cmd { | |||
| 1174 | * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while | 1184 | * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while |
| 1175 | * being idle (i.e. mac80211 doesn't have to go idle-off during the | 1185 | * being idle (i.e. mac80211 doesn't have to go idle-off during the |
| 1176 | * the scan). | 1186 | * the scan). |
| 1187 | * | ||
| 1188 | * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of | ||
| 1189 | * a virtual monitor interface when monitor interfaces are the only | ||
| 1190 | * active interfaces. | ||
| 1191 | * | ||
| 1192 | * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface | ||
| 1193 | * queue mapping in order to use different queues (not just one per AC) | ||
| 1194 | * for different virtual interfaces. See the doc section on HW queue | ||
| 1195 | * control for more details. | ||
| 1177 | */ | 1196 | */ |
| 1178 | enum ieee80211_hw_flags { | 1197 | enum ieee80211_hw_flags { |
| 1179 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1198 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -1190,13 +1209,13 @@ enum ieee80211_hw_flags { | |||
| 1190 | IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, | 1209 | IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, |
| 1191 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, | 1210 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, |
| 1192 | IEEE80211_HW_MFP_CAPABLE = 1<<13, | 1211 | IEEE80211_HW_MFP_CAPABLE = 1<<13, |
| 1193 | /* reuse bit 14 */ | 1212 | IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, |
| 1194 | IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15, | 1213 | IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15, |
| 1195 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, | 1214 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, |
| 1196 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, | 1215 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, |
| 1197 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1216 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
| 1198 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | 1217 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, |
| 1199 | /* reuse bit 20 */ | 1218 | IEEE80211_HW_QUEUE_CONTROL = 1<<20, |
| 1200 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1219 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
| 1201 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1220 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
| 1202 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | 1221 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, |
| @@ -1266,6 +1285,9 @@ enum ieee80211_hw_flags { | |||
| 1266 | * @max_tx_aggregation_subframes: maximum number of subframes in an | 1285 | * @max_tx_aggregation_subframes: maximum number of subframes in an |
| 1267 | * aggregate an HT driver will transmit, used by the peer as a | 1286 | * aggregate an HT driver will transmit, used by the peer as a |
| 1268 | * hint to size its reorder buffer. | 1287 | * hint to size its reorder buffer. |
| 1288 | * | ||
| 1289 | * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX | ||
| 1290 | * (if %IEEE80211_HW_QUEUE_CONTROL is set) | ||
| 1269 | */ | 1291 | */ |
| 1270 | struct ieee80211_hw { | 1292 | struct ieee80211_hw { |
| 1271 | struct ieee80211_conf conf; | 1293 | struct ieee80211_conf conf; |
| @@ -1286,6 +1308,7 @@ struct ieee80211_hw { | |||
| 1286 | u8 max_rate_tries; | 1308 | u8 max_rate_tries; |
| 1287 | u8 max_rx_aggregation_subframes; | 1309 | u8 max_rx_aggregation_subframes; |
| 1288 | u8 max_tx_aggregation_subframes; | 1310 | u8 max_tx_aggregation_subframes; |
| 1311 | u8 offchannel_tx_hw_queue; | ||
| 1289 | }; | 1312 | }; |
| 1290 | 1313 | ||
| 1291 | /** | 1314 | /** |
| @@ -1694,6 +1717,61 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
| 1694 | */ | 1717 | */ |
| 1695 | 1718 | ||
| 1696 | /** | 1719 | /** |
| 1720 | * DOC: HW queue control | ||
| 1721 | * | ||
| 1722 | * Before HW queue control was introduced, mac80211 only had a single static | ||
| 1723 | * assignment of per-interface AC software queues to hardware queues. This | ||
| 1724 | * was problematic for a few reasons: | ||
| 1725 | * 1) off-channel transmissions might get stuck behind other frames | ||
| 1726 | * 2) multiple virtual interfaces couldn't be handled correctly | ||
| 1727 | * 3) after-DTIM frames could get stuck behind other frames | ||
| 1728 | * | ||
| 1729 | * To solve this, hardware typically uses multiple different queues for all | ||
| 1730 | * the different usages, and this needs to be propagated into mac80211 so it | ||
| 1731 | * won't have the same problem with the software queues. | ||
| 1732 | * | ||
| 1733 | * Therefore, mac80211 now offers the %IEEE80211_HW_QUEUE_CONTROL capability | ||
| 1734 | * flag that tells it that the driver implements its own queue control. To do | ||
| 1735 | * so, the driver will set up the various queues in each &struct ieee80211_vif | ||
| 1736 | * and the offchannel queue in &struct ieee80211_hw. In response, mac80211 will | ||
| 1737 | * use those queue IDs in the hw_queue field of &struct ieee80211_tx_info and | ||
| 1738 | * if necessary will queue the frame on the right software queue that mirrors | ||
| 1739 | * the hardware queue. | ||
| 1740 | * Additionally, the driver has to then use these HW queue IDs for the queue | ||
| 1741 | * management functions (ieee80211_stop_queue() et al.) | ||
| 1742 | * | ||
| 1743 | * The driver is free to set up the queue mappings as needed, multiple virtual | ||
| 1744 | * interfaces may map to the same hardware queues if needed. The setup has to | ||
| 1745 | * happen during add_interface or change_interface callbacks. For example, a | ||
| 1746 | * driver supporting station+station and station+AP modes might decide to have | ||
| 1747 | * 10 hardware queues to handle different scenarios: | ||
| 1748 | * | ||
| 1749 | * 4 AC HW queues for 1st vif: 0, 1, 2, 3 | ||
| 1750 | * 4 AC HW queues for 2nd vif: 4, 5, 6, 7 | ||
| 1751 | * after-DTIM queue for AP: 8 | ||
| 1752 | * off-channel queue: 9 | ||
| 1753 | * | ||
| 1754 | * It would then set up the hardware like this: | ||
| 1755 | * hw.offchannel_tx_hw_queue = 9 | ||
| 1756 | * | ||
| 1757 | * and the first virtual interface that is added as follows: | ||
| 1758 | * vif.hw_queue[IEEE80211_AC_VO] = 0 | ||
| 1759 | * vif.hw_queue[IEEE80211_AC_VI] = 1 | ||
| 1760 | * vif.hw_queue[IEEE80211_AC_BE] = 2 | ||
| 1761 | * vif.hw_queue[IEEE80211_AC_BK] = 3 | ||
| 1762 | * vif.cab_queue = 8 // if AP mode, otherwise %IEEE80211_INVAL_HW_QUEUE | ||
| 1763 | * and the second virtual interface with 4-7. | ||
| 1764 | * | ||
| 1765 | * If queue 6 gets full, for example, mac80211 would only stop the second | ||
| 1766 | * virtual interface's BE queue since virtual interface queues are per AC. | ||
| 1767 | * | ||
| 1768 | * Note that the vif.cab_queue value should be set to %IEEE80211_INVAL_HW_QUEUE | ||
| 1769 | * whenever the queue is not used (i.e. the interface is not in AP mode) if the | ||
| 1770 | * queue could potentially be shared since mac80211 will look at cab_queue when | ||
| 1771 | * a queue is stopped/woken even if the interface is not in AP mode. | ||
| 1772 | */ | ||
| 1773 | |||
| 1774 | /** | ||
| 1697 | * enum ieee80211_filter_flags - hardware filter flags | 1775 | * enum ieee80211_filter_flags - hardware filter flags |
| 1698 | * | 1776 | * |
| 1699 | * These flags determine what the filter in hardware should be | 1777 | * These flags determine what the filter in hardware should be |
| @@ -1780,6 +1858,18 @@ enum ieee80211_frame_release_type { | |||
| 1780 | }; | 1858 | }; |
| 1781 | 1859 | ||
| 1782 | /** | 1860 | /** |
| 1861 | * enum ieee80211_rate_control_changed - flags to indicate what changed | ||
| 1862 | * | ||
| 1863 | * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit | ||
| 1864 | * to this station changed. | ||
| 1865 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. | ||
| 1866 | */ | ||
| 1867 | enum ieee80211_rate_control_changed { | ||
| 1868 | IEEE80211_RC_BW_CHANGED = BIT(0), | ||
| 1869 | IEEE80211_RC_SMPS_CHANGED = BIT(1), | ||
| 1870 | }; | ||
| 1871 | |||
| 1872 | /** | ||
| 1783 | * struct ieee80211_ops - callbacks from mac80211 to the driver | 1873 | * struct ieee80211_ops - callbacks from mac80211 to the driver |
| 1784 | * | 1874 | * |
| 1785 | * This structure contains various callbacks that the driver may | 1875 | * This structure contains various callbacks that the driver may |
| @@ -1980,6 +2070,14 @@ enum ieee80211_frame_release_type { | |||
| 1980 | * up the list of states. | 2070 | * up the list of states. |
| 1981 | * The callback can sleep. | 2071 | * The callback can sleep. |
| 1982 | * | 2072 | * |
| 2073 | * @sta_rc_update: Notifies the driver of changes to the bitrates that can be | ||
| 2074 | * used to transmit to the station. The changes are advertised with bits | ||
| 2075 | * from &enum ieee80211_rate_control_changed and the values are reflected | ||
| 2076 | * in the station data. This callback should only be used when the driver | ||
| 2077 | * uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since | ||
| 2078 | * otherwise the rate control algorithm is notified directly. | ||
| 2079 | * Must be atomic. | ||
| 2080 | * | ||
| 1983 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 2081 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
| 1984 | * bursting) for a hardware TX queue. | 2082 | * bursting) for a hardware TX queue. |
| 1985 | * Returns a negative error code on failure. | 2083 | * Returns a negative error code on failure. |
| @@ -2125,6 +2223,14 @@ enum ieee80211_frame_release_type { | |||
| 2125 | * The @tids parameter is a bitmap and tells the driver which TIDs the | 2223 | * The @tids parameter is a bitmap and tells the driver which TIDs the |
| 2126 | * frames will be on; it will at most have two bits set. | 2224 | * frames will be on; it will at most have two bits set. |
| 2127 | * This callback must be atomic. | 2225 | * This callback must be atomic. |
| 2226 | * | ||
| 2227 | * @get_et_sset_count: Ethtool API to get string-set count. | ||
| 2228 | * | ||
| 2229 | * @get_et_stats: Ethtool API to get a set of u64 stats. | ||
| 2230 | * | ||
| 2231 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | ||
| 2232 | * and perhaps other supported types of ethtool data-sets. | ||
| 2233 | * | ||
| 2128 | */ | 2234 | */ |
| 2129 | struct ieee80211_ops { | 2235 | struct ieee80211_ops { |
| 2130 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 2236 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -2135,6 +2241,7 @@ struct ieee80211_ops { | |||
| 2135 | #ifdef CONFIG_PM | 2241 | #ifdef CONFIG_PM |
| 2136 | int (*suspend)(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); | 2242 | int (*suspend)(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); |
| 2137 | int (*resume)(struct ieee80211_hw *hw); | 2243 | int (*resume)(struct ieee80211_hw *hw); |
| 2244 | void (*set_wakeup)(struct ieee80211_hw *hw, bool enabled); | ||
| 2138 | #endif | 2245 | #endif |
| 2139 | int (*add_interface)(struct ieee80211_hw *hw, | 2246 | int (*add_interface)(struct ieee80211_hw *hw, |
| 2140 | struct ieee80211_vif *vif); | 2247 | struct ieee80211_vif *vif); |
| @@ -2196,8 +2303,12 @@ struct ieee80211_ops { | |||
| 2196 | struct ieee80211_sta *sta, | 2303 | struct ieee80211_sta *sta, |
| 2197 | enum ieee80211_sta_state old_state, | 2304 | enum ieee80211_sta_state old_state, |
| 2198 | enum ieee80211_sta_state new_state); | 2305 | enum ieee80211_sta_state new_state); |
| 2306 | void (*sta_rc_update)(struct ieee80211_hw *hw, | ||
| 2307 | struct ieee80211_vif *vif, | ||
| 2308 | struct ieee80211_sta *sta, | ||
| 2309 | u32 changed); | ||
| 2199 | int (*conf_tx)(struct ieee80211_hw *hw, | 2310 | int (*conf_tx)(struct ieee80211_hw *hw, |
| 2200 | struct ieee80211_vif *vif, u16 queue, | 2311 | struct ieee80211_vif *vif, u16 ac, |
| 2201 | const struct ieee80211_tx_queue_params *params); | 2312 | const struct ieee80211_tx_queue_params *params); |
| 2202 | u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | 2313 | u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
| 2203 | void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2314 | void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| @@ -2250,6 +2361,15 @@ struct ieee80211_ops { | |||
| 2250 | u16 tids, int num_frames, | 2361 | u16 tids, int num_frames, |
| 2251 | enum ieee80211_frame_release_type reason, | 2362 | enum ieee80211_frame_release_type reason, |
| 2252 | bool more_data); | 2363 | bool more_data); |
| 2364 | |||
| 2365 | int (*get_et_sset_count)(struct ieee80211_hw *hw, | ||
| 2366 | struct ieee80211_vif *vif, int sset); | ||
| 2367 | void (*get_et_stats)(struct ieee80211_hw *hw, | ||
| 2368 | struct ieee80211_vif *vif, | ||
| 2369 | struct ethtool_stats *stats, u64 *data); | ||
| 2370 | void (*get_et_strings)(struct ieee80211_hw *hw, | ||
| 2371 | struct ieee80211_vif *vif, | ||
| 2372 | u32 sset, u8 *data); | ||
| 2253 | }; | 2373 | }; |
| 2254 | 2374 | ||
| 2255 | /** | 2375 | /** |
| @@ -2844,6 +2964,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | |||
| 2844 | */ | 2964 | */ |
| 2845 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | 2965 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, |
| 2846 | struct ieee80211_vif *vif, | 2966 | struct ieee80211_vif *vif, |
| 2967 | enum ieee80211_band band, | ||
| 2847 | size_t frame_len, | 2968 | size_t frame_len, |
| 2848 | struct ieee80211_rate *rate); | 2969 | struct ieee80211_rate *rate); |
| 2849 | 2970 | ||
| @@ -3512,19 +3633,6 @@ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); | |||
| 3512 | /* Rate control API */ | 3633 | /* Rate control API */ |
| 3513 | 3634 | ||
| 3514 | /** | 3635 | /** |
| 3515 | * enum rate_control_changed - flags to indicate which parameter changed | ||
| 3516 | * | ||
| 3517 | * @IEEE80211_RC_HT_CHANGED: The HT parameters of the operating channel have | ||
| 3518 | * changed, rate control algorithm can update its internal state if needed. | ||
| 3519 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed, the rate | ||
| 3520 | * control algorithm needs to adjust accordingly. | ||
| 3521 | */ | ||
| 3522 | enum rate_control_changed { | ||
| 3523 | IEEE80211_RC_HT_CHANGED = BIT(0), | ||
| 3524 | IEEE80211_RC_SMPS_CHANGED = BIT(1), | ||
| 3525 | }; | ||
| 3526 | |||
| 3527 | /** | ||
| 3528 | * struct ieee80211_tx_rate_control - rate control information for/from RC algo | 3636 | * struct ieee80211_tx_rate_control - rate control information for/from RC algo |
| 3529 | * | 3637 | * |
| 3530 | * @hw: The hardware the algorithm is invoked for. | 3638 | * @hw: The hardware the algorithm is invoked for. |
| @@ -3569,9 +3677,8 @@ struct rate_control_ops { | |||
| 3569 | void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, | 3677 | void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, |
| 3570 | struct ieee80211_sta *sta, void *priv_sta); | 3678 | struct ieee80211_sta *sta, void *priv_sta); |
| 3571 | void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, | 3679 | void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, |
| 3572 | struct ieee80211_sta *sta, | 3680 | struct ieee80211_sta *sta, void *priv_sta, |
| 3573 | void *priv_sta, u32 changed, | 3681 | u32 changed); |
| 3574 | enum nl80211_channel_type oper_chan_type); | ||
| 3575 | void (*free_sta)(void *priv, struct ieee80211_sta *sta, | 3682 | void (*free_sta)(void *priv, struct ieee80211_sta *sta, |
| 3576 | void *priv_sta); | 3683 | void *priv_sta); |
| 3577 | 3684 | ||
| @@ -3706,8 +3813,20 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif, | |||
| 3706 | 3813 | ||
| 3707 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); | 3814 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); |
| 3708 | 3815 | ||
| 3709 | int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb); | 3816 | int ieee80211_add_srates_ie(struct ieee80211_vif *vif, |
| 3817 | struct sk_buff *skb, bool need_basic); | ||
| 3710 | 3818 | ||
| 3711 | int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, | 3819 | int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, |
| 3712 | struct sk_buff *skb); | 3820 | struct sk_buff *skb, bool need_basic); |
| 3821 | |||
| 3822 | /** | ||
| 3823 | * ieee80211_ave_rssi - report the average rssi for the specified interface | ||
| 3824 | * | ||
| 3825 | * @vif: the specified virtual interface | ||
| 3826 | * | ||
| 3827 | * This function return the average rssi value for the requested interface. | ||
| 3828 | * It assumes that the given vif is valid. | ||
| 3829 | */ | ||
| 3830 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); | ||
| 3831 | |||
| 3713 | #endif /* MAC80211_H */ | 3832 | #endif /* MAC80211_H */ |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h new file mode 100644 index 000000000000..c9f8ab5cc687 --- /dev/null +++ b/include/net/mac802154.h | |||
| @@ -0,0 +1,136 @@ | |||
| 1 | /* | ||
| 2 | * IEEE802.15.4-2003 specification | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007-2012 Siemens AG | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License along | ||
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 18 | */ | ||
| 19 | #ifndef NET_MAC802154_H | ||
| 20 | #define NET_MAC802154_H | ||
| 21 | |||
| 22 | #include <net/af_ieee802154.h> | ||
| 23 | |||
| 24 | /* The following flags are used to indicate changed address settings from | ||
| 25 | * the stack to the hardware. | ||
| 26 | */ | ||
| 27 | |||
| 28 | /* indicates that the Short Address changed */ | ||
| 29 | #define IEEE802515_AFILT_SADDR_CHANGED 0x00000001 | ||
| 30 | /* indicates that the IEEE Address changed */ | ||
| 31 | #define IEEE802515_AFILT_IEEEADDR_CHANGED 0x00000002 | ||
| 32 | /* indicates that the PAN ID changed */ | ||
| 33 | #define IEEE802515_AFILT_PANID_CHANGED 0x00000004 | ||
| 34 | /* indicates that PAN Coordinator status changed */ | ||
| 35 | #define IEEE802515_AFILT_PANC_CHANGED 0x00000008 | ||
| 36 | |||
| 37 | struct ieee802154_hw_addr_filt { | ||
| 38 | __le16 pan_id; /* Each independent PAN selects a unique | ||
| 39 | * identifier. This PAN id allows communication | ||
| 40 | * between devices within a network using short | ||
| 41 | * addresses and enables transmissions between | ||
| 42 | * devices across independent networks. | ||
| 43 | */ | ||
| 44 | __le16 short_addr; | ||
| 45 | u8 ieee_addr[IEEE802154_ADDR_LEN]; | ||
| 46 | u8 pan_coord; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct ieee802154_dev { | ||
| 50 | /* filled by the driver */ | ||
| 51 | int extra_tx_headroom; | ||
| 52 | u32 flags; | ||
| 53 | struct device *parent; | ||
| 54 | |||
| 55 | /* filled by mac802154 core */ | ||
| 56 | struct ieee802154_hw_addr_filt hw_filt; | ||
| 57 | void *priv; | ||
| 58 | struct wpan_phy *phy; | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* Checksum is in hardware and is omitted from a packet | ||
| 62 | * | ||
| 63 | * These following flags are used to indicate hardware capabilities to | ||
| 64 | * the stack. Generally, flags here should have their meaning | ||
| 65 | * done in a way that the simplest hardware doesn't need setting | ||
| 66 | * any particular flags. There are some exceptions to this rule, | ||
| 67 | * however, so you are advised to review these flags carefully. | ||
| 68 | */ | ||
| 69 | |||
| 70 | /* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */ | ||
| 71 | #define IEEE802154_HW_OMIT_CKSUM 0x00000001 | ||
| 72 | /* Indicates that receiver will autorespond with ACK frames. */ | ||
| 73 | #define IEEE802154_HW_AACK 0x00000002 | ||
| 74 | |||
| 75 | /* struct ieee802154_ops - callbacks from mac802154 to the driver | ||
| 76 | * | ||
| 77 | * This structure contains various callbacks that the driver may | ||
| 78 | * handle or, in some cases, must handle, for example to transmit | ||
| 79 | * a frame. | ||
| 80 | * | ||
| 81 | * start: Handler that 802.15.4 module calls for device initialization. | ||
| 82 | * This function is called before the first interface is attached. | ||
| 83 | * | ||
| 84 | * stop: Handler that 802.15.4 module calls for device cleanup. | ||
| 85 | * This function is called after the last interface is removed. | ||
| 86 | * | ||
| 87 | * xmit: Handler that 802.15.4 module calls for each transmitted frame. | ||
| 88 | * skb cntains the buffer starting from the IEEE 802.15.4 header. | ||
| 89 | * The low-level driver should send the frame based on available | ||
| 90 | * configuration. | ||
| 91 | * This function should return zero or negative errno. Called with | ||
| 92 | * pib_lock held. | ||
| 93 | * | ||
| 94 | * ed: Handler that 802.15.4 module calls for Energy Detection. | ||
| 95 | * This function should place the value for detected energy | ||
| 96 | * (usually device-dependant) in the level pointer and return | ||
| 97 | * either zero or negative errno. Called with pib_lock held. | ||
| 98 | * | ||
| 99 | * set_channel: | ||
| 100 | * Set radio for listening on specific channel. | ||
| 101 | * Set the device for listening on specified channel. | ||
| 102 | * Returns either zero, or negative errno. Called with pib_lock held. | ||
| 103 | * | ||
| 104 | * set_hw_addr_filt: | ||
| 105 | * Set radio for listening on specific address. | ||
| 106 | * Set the device for listening on specified address. | ||
| 107 | * Returns either zero, or negative errno. | ||
| 108 | */ | ||
| 109 | struct ieee802154_ops { | ||
| 110 | struct module *owner; | ||
| 111 | int (*start)(struct ieee802154_dev *dev); | ||
| 112 | void (*stop)(struct ieee802154_dev *dev); | ||
| 113 | int (*xmit)(struct ieee802154_dev *dev, | ||
| 114 | struct sk_buff *skb); | ||
| 115 | int (*ed)(struct ieee802154_dev *dev, u8 *level); | ||
| 116 | int (*set_channel)(struct ieee802154_dev *dev, | ||
| 117 | int page, | ||
| 118 | int channel); | ||
| 119 | int (*set_hw_addr_filt)(struct ieee802154_dev *dev, | ||
| 120 | struct ieee802154_hw_addr_filt *filt, | ||
| 121 | unsigned long changed); | ||
| 122 | int (*ieee_addr)(struct ieee802154_dev *dev, | ||
| 123 | u8 addr[IEEE802154_ADDR_LEN]); | ||
| 124 | }; | ||
| 125 | |||
| 126 | /* Basic interface to register ieee802154 device */ | ||
| 127 | struct ieee802154_dev * | ||
| 128 | ieee802154_alloc_device(size_t priv_data_lex, struct ieee802154_ops *ops); | ||
| 129 | void ieee802154_free_device(struct ieee802154_dev *dev); | ||
| 130 | int ieee802154_register_device(struct ieee802154_dev *dev); | ||
| 131 | void ieee802154_unregister_device(struct ieee802154_dev *dev); | ||
| 132 | |||
| 133 | void ieee802154_rx_irqsafe(struct ieee802154_dev *dev, struct sk_buff *skb, | ||
| 134 | u8 lqi); | ||
| 135 | |||
| 136 | #endif /* NET_MAC802154_H */ | ||
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 6f9c25a76cd1..c02b6ad3f6c5 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
| @@ -34,6 +34,7 @@ enum { | |||
| 34 | __ND_OPT_ARRAY_MAX, | 34 | __ND_OPT_ARRAY_MAX, |
| 35 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ | 35 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ |
| 36 | ND_OPT_RDNSS = 25, /* RFC5006 */ | 36 | ND_OPT_RDNSS = 25, /* RFC5006 */ |
| 37 | ND_OPT_DNSSL = 31, /* RFC6106 */ | ||
| 37 | __ND_OPT_MAX | 38 | __ND_OPT_MAX |
| 38 | }; | 39 | }; |
| 39 | 40 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 34c996f46181..6cdfeedb650b 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -195,7 +195,6 @@ static inline void *neighbour_priv(const struct neighbour *n) | |||
| 195 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 | 195 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 |
| 196 | 196 | ||
| 197 | extern void neigh_table_init(struct neigh_table *tbl); | 197 | extern void neigh_table_init(struct neigh_table *tbl); |
| 198 | extern void neigh_table_init_no_netlink(struct neigh_table *tbl); | ||
| 199 | extern int neigh_table_clear(struct neigh_table *tbl); | 198 | extern int neigh_table_clear(struct neigh_table *tbl); |
| 200 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, | 199 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, |
| 201 | const void *pkey, | 200 | const void *pkey, |
| @@ -323,7 +322,7 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | |||
| 323 | #ifdef CONFIG_BRIDGE_NETFILTER | 322 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 324 | static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) | 323 | static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) |
| 325 | { | 324 | { |
| 326 | unsigned seq, hh_alen; | 325 | unsigned int seq, hh_alen; |
| 327 | 326 | ||
| 328 | do { | 327 | do { |
| 329 | seq = read_seqbegin(&hh->hh_lock); | 328 | seq = read_seqbegin(&hh->hh_lock); |
| @@ -336,7 +335,7 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) | |||
| 336 | 335 | ||
| 337 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | 336 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) |
| 338 | { | 337 | { |
| 339 | unsigned seq; | 338 | unsigned int seq; |
| 340 | int hh_len; | 339 | int hh_len; |
| 341 | 340 | ||
| 342 | do { | 341 | do { |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ee547c149810..ac9195e6a062 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -279,14 +279,25 @@ extern void unregister_pernet_subsys(struct pernet_operations *); | |||
| 279 | extern int register_pernet_device(struct pernet_operations *); | 279 | extern int register_pernet_device(struct pernet_operations *); |
| 280 | extern void unregister_pernet_device(struct pernet_operations *); | 280 | extern void unregister_pernet_device(struct pernet_operations *); |
| 281 | 281 | ||
| 282 | struct ctl_path; | ||
| 283 | struct ctl_table; | 282 | struct ctl_table; |
| 284 | struct ctl_table_header; | 283 | struct ctl_table_header; |
| 285 | 284 | ||
| 286 | extern struct ctl_table_header *register_net_sysctl_table(struct net *net, | 285 | #ifdef CONFIG_SYSCTL |
| 287 | const struct ctl_path *path, struct ctl_table *table); | 286 | extern int net_sysctl_init(void); |
| 288 | extern struct ctl_table_header *register_net_sysctl_rotable( | 287 | extern struct ctl_table_header *register_net_sysctl(struct net *net, |
| 289 | const struct ctl_path *path, struct ctl_table *table); | 288 | const char *path, struct ctl_table *table); |
| 290 | extern void unregister_net_sysctl_table(struct ctl_table_header *header); | 289 | extern void unregister_net_sysctl_table(struct ctl_table_header *header); |
| 290 | #else | ||
| 291 | static inline int net_sysctl_init(void) { return 0; } | ||
| 292 | static inline struct ctl_table_header *register_net_sysctl(struct net *net, | ||
| 293 | const char *path, struct ctl_table *table) | ||
| 294 | { | ||
| 295 | return NULL; | ||
| 296 | } | ||
| 297 | static inline void unregister_net_sysctl_table(struct ctl_table_header *header) | ||
| 298 | { | ||
| 299 | } | ||
| 300 | #endif | ||
| 301 | |||
| 291 | 302 | ||
| 292 | #endif /* __NET_NET_NAMESPACE_H */ | 303 | #endif /* __NET_NET_NAMESPACE_H */ |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index ab86036bbf0c..cce7f6a798bf 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -321,14 +321,8 @@ extern unsigned int nf_conntrack_max; | |||
| 321 | extern unsigned int nf_conntrack_hash_rnd; | 321 | extern unsigned int nf_conntrack_hash_rnd; |
| 322 | void init_nf_conntrack_hash_rnd(void); | 322 | void init_nf_conntrack_hash_rnd(void); |
| 323 | 323 | ||
| 324 | #define NF_CT_STAT_INC(net, count) \ | 324 | #define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count) |
| 325 | __this_cpu_inc((net)->ct.stat->count) | 325 | #define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count) |
| 326 | #define NF_CT_STAT_INC_ATOMIC(net, count) \ | ||
| 327 | do { \ | ||
| 328 | local_bh_disable(); \ | ||
| 329 | __this_cpu_inc((net)->ct.stat->count); \ | ||
| 330 | local_bh_enable(); \ | ||
| 331 | } while (0) | ||
| 332 | 326 | ||
| 333 | #define MODULE_ALIAS_NFCT_HELPER(helper) \ | 327 | #define MODULE_ALIAS_NFCT_HELPER(helper) \ |
| 334 | MODULE_ALIAS("nfct-helper-" helper) | 328 | MODULE_ALIAS("nfct-helper-" helper) |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 5767dc242dee..1d1889409b9e 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
| @@ -60,8 +60,8 @@ static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | |||
| 60 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | 60 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | extern int nf_conntrack_helper_init(void); | 63 | extern int nf_conntrack_helper_init(struct net *net); |
| 64 | extern void nf_conntrack_helper_fini(void); | 64 | extern void nf_conntrack_helper_fini(struct net *net); |
| 65 | 65 | ||
| 66 | extern int nf_conntrack_broadcast_help(struct sk_buff *skb, | 66 | extern int nf_conntrack_broadcast_help(struct sk_buff *skb, |
| 67 | unsigned int protoff, | 67 | unsigned int protoff, |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index e8010f445ae1..9699c028b74b 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
| @@ -65,7 +65,7 @@ struct nf_conntrack_l3proto { | |||
| 65 | 65 | ||
| 66 | #ifdef CONFIG_SYSCTL | 66 | #ifdef CONFIG_SYSCTL |
| 67 | struct ctl_table_header *ctl_table_header; | 67 | struct ctl_table_header *ctl_table_header; |
| 68 | struct ctl_path *ctl_table_path; | 68 | const char *ctl_table_path; |
| 69 | struct ctl_table *ctl_table; | 69 | struct ctl_table *ctl_table; |
| 70 | #endif /* CONFIG_SYSCTL */ | 70 | #endif /* CONFIG_SYSCTL */ |
| 71 | 71 | ||
diff --git a/include/net/netlink.h b/include/net/netlink.h index f394fe5d7641..785f37a3b44e 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -102,20 +102,6 @@ | |||
| 102 | * nla_put_flag(skb, type) add flag attribute to skb | 102 | * nla_put_flag(skb, type) add flag attribute to skb |
| 103 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb | 103 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb |
| 104 | * | 104 | * |
| 105 | * Exceptions Based Attribute Construction: | ||
| 106 | * NLA_PUT(skb, type, len, data) add attribute to skb | ||
| 107 | * NLA_PUT_U8(skb, type, value) add u8 attribute to skb | ||
| 108 | * NLA_PUT_U16(skb, type, value) add u16 attribute to skb | ||
| 109 | * NLA_PUT_U32(skb, type, value) add u32 attribute to skb | ||
| 110 | * NLA_PUT_U64(skb, type, value) add u64 attribute to skb | ||
| 111 | * NLA_PUT_STRING(skb, type, str) add string attribute to skb | ||
| 112 | * NLA_PUT_FLAG(skb, type) add flag attribute to skb | ||
| 113 | * NLA_PUT_MSECS(skb, type, jiffies) add msecs attribute to skb | ||
| 114 | * | ||
| 115 | * The meaning of these functions is equal to their lower case | ||
| 116 | * variants but they jump to the label nla_put_failure in case | ||
| 117 | * of a failure. | ||
| 118 | * | ||
| 119 | * Nested Attributes Construction: | 105 | * Nested Attributes Construction: |
| 120 | * nla_nest_start(skb, type) start a nested attribute | 106 | * nla_nest_start(skb, type) start a nested attribute |
| 121 | * nla_nest_end(skb, nla) finalize a nested attribute | 107 | * nla_nest_end(skb, nla) finalize a nested attribute |
| @@ -772,6 +758,39 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value) | |||
| 772 | } | 758 | } |
| 773 | 759 | ||
| 774 | /** | 760 | /** |
| 761 | * nla_put_be16 - Add a __be16 netlink attribute to a socket buffer | ||
| 762 | * @skb: socket buffer to add attribute to | ||
| 763 | * @attrtype: attribute type | ||
| 764 | * @value: numeric value | ||
| 765 | */ | ||
| 766 | static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) | ||
| 767 | { | ||
| 768 | return nla_put(skb, attrtype, sizeof(__be16), &value); | ||
| 769 | } | ||
| 770 | |||
| 771 | /** | ||
| 772 | * nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer | ||
| 773 | * @skb: socket buffer to add attribute to | ||
| 774 | * @attrtype: attribute type | ||
| 775 | * @value: numeric value | ||
| 776 | */ | ||
| 777 | static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value) | ||
| 778 | { | ||
| 779 | return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
| 780 | } | ||
| 781 | |||
| 782 | /** | ||
| 783 | * nla_put_le16 - Add a __le16 netlink attribute to a socket buffer | ||
| 784 | * @skb: socket buffer to add attribute to | ||
| 785 | * @attrtype: attribute type | ||
| 786 | * @value: numeric value | ||
| 787 | */ | ||
| 788 | static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value) | ||
| 789 | { | ||
| 790 | return nla_put(skb, attrtype, sizeof(__le16), &value); | ||
| 791 | } | ||
| 792 | |||
| 793 | /** | ||
| 775 | * nla_put_u32 - Add a u32 netlink attribute to a socket buffer | 794 | * nla_put_u32 - Add a u32 netlink attribute to a socket buffer |
| 776 | * @skb: socket buffer to add attribute to | 795 | * @skb: socket buffer to add attribute to |
| 777 | * @attrtype: attribute type | 796 | * @attrtype: attribute type |
| @@ -783,7 +802,40 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value) | |||
| 783 | } | 802 | } |
| 784 | 803 | ||
| 785 | /** | 804 | /** |
| 786 | * nla_put_64 - Add a u64 netlink attribute to a socket buffer | 805 | * nla_put_be32 - Add a __be32 netlink attribute to a socket buffer |
| 806 | * @skb: socket buffer to add attribute to | ||
| 807 | * @attrtype: attribute type | ||
| 808 | * @value: numeric value | ||
| 809 | */ | ||
| 810 | static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) | ||
| 811 | { | ||
| 812 | return nla_put(skb, attrtype, sizeof(__be32), &value); | ||
| 813 | } | ||
| 814 | |||
| 815 | /** | ||
| 816 | * nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer | ||
| 817 | * @skb: socket buffer to add attribute to | ||
| 818 | * @attrtype: attribute type | ||
| 819 | * @value: numeric value | ||
| 820 | */ | ||
| 821 | static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value) | ||
| 822 | { | ||
| 823 | return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
| 824 | } | ||
| 825 | |||
| 826 | /** | ||
| 827 | * nla_put_le32 - Add a __le32 netlink attribute to a socket buffer | ||
| 828 | * @skb: socket buffer to add attribute to | ||
| 829 | * @attrtype: attribute type | ||
| 830 | * @value: numeric value | ||
| 831 | */ | ||
| 832 | static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value) | ||
| 833 | { | ||
| 834 | return nla_put(skb, attrtype, sizeof(__le32), &value); | ||
| 835 | } | ||
| 836 | |||
| 837 | /** | ||
| 838 | * nla_put_u64 - Add a u64 netlink attribute to a socket buffer | ||
| 787 | * @skb: socket buffer to add attribute to | 839 | * @skb: socket buffer to add attribute to |
| 788 | * @attrtype: attribute type | 840 | * @attrtype: attribute type |
| 789 | * @value: numeric value | 841 | * @value: numeric value |
| @@ -794,6 +846,39 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) | |||
| 794 | } | 846 | } |
| 795 | 847 | ||
| 796 | /** | 848 | /** |
| 849 | * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer | ||
| 850 | * @skb: socket buffer to add attribute to | ||
| 851 | * @attrtype: attribute type | ||
| 852 | * @value: numeric value | ||
| 853 | */ | ||
| 854 | static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) | ||
| 855 | { | ||
| 856 | return nla_put(skb, attrtype, sizeof(__be64), &value); | ||
| 857 | } | ||
| 858 | |||
| 859 | /** | ||
| 860 | * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer | ||
| 861 | * @skb: socket buffer to add attribute to | ||
| 862 | * @attrtype: attribute type | ||
| 863 | * @value: numeric value | ||
| 864 | */ | ||
| 865 | static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) | ||
| 866 | { | ||
| 867 | return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value); | ||
| 868 | } | ||
| 869 | |||
| 870 | /** | ||
| 871 | * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer | ||
| 872 | * @skb: socket buffer to add attribute to | ||
| 873 | * @attrtype: attribute type | ||
| 874 | * @value: numeric value | ||
| 875 | */ | ||
| 876 | static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value) | ||
| 877 | { | ||
| 878 | return nla_put(skb, attrtype, sizeof(__le64), &value); | ||
| 879 | } | ||
| 880 | |||
| 881 | /** | ||
| 797 | * nla_put_string - Add a string netlink attribute to a socket buffer | 882 | * nla_put_string - Add a string netlink attribute to a socket buffer |
| 798 | * @skb: socket buffer to add attribute to | 883 | * @skb: socket buffer to add attribute to |
| 799 | * @attrtype: attribute type | 884 | * @attrtype: attribute type |
| @@ -828,60 +913,6 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
| 828 | return nla_put(skb, attrtype, sizeof(u64), &tmp); | 913 | return nla_put(skb, attrtype, sizeof(u64), &tmp); |
| 829 | } | 914 | } |
| 830 | 915 | ||
| 831 | #define NLA_PUT(skb, attrtype, attrlen, data) \ | ||
| 832 | do { \ | ||
| 833 | if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \ | ||
| 834 | goto nla_put_failure; \ | ||
| 835 | } while(0) | ||
| 836 | |||
| 837 | #define NLA_PUT_TYPE(skb, type, attrtype, value) \ | ||
| 838 | do { \ | ||
| 839 | type __tmp = value; \ | ||
| 840 | NLA_PUT(skb, attrtype, sizeof(type), &__tmp); \ | ||
| 841 | } while(0) | ||
| 842 | |||
| 843 | #define NLA_PUT_U8(skb, attrtype, value) \ | ||
| 844 | NLA_PUT_TYPE(skb, u8, attrtype, value) | ||
| 845 | |||
| 846 | #define NLA_PUT_U16(skb, attrtype, value) \ | ||
| 847 | NLA_PUT_TYPE(skb, u16, attrtype, value) | ||
| 848 | |||
| 849 | #define NLA_PUT_LE16(skb, attrtype, value) \ | ||
| 850 | NLA_PUT_TYPE(skb, __le16, attrtype, value) | ||
| 851 | |||
| 852 | #define NLA_PUT_BE16(skb, attrtype, value) \ | ||
| 853 | NLA_PUT_TYPE(skb, __be16, attrtype, value) | ||
| 854 | |||
| 855 | #define NLA_PUT_NET16(skb, attrtype, value) \ | ||
| 856 | NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
| 857 | |||
| 858 | #define NLA_PUT_U32(skb, attrtype, value) \ | ||
| 859 | NLA_PUT_TYPE(skb, u32, attrtype, value) | ||
| 860 | |||
| 861 | #define NLA_PUT_BE32(skb, attrtype, value) \ | ||
| 862 | NLA_PUT_TYPE(skb, __be32, attrtype, value) | ||
| 863 | |||
| 864 | #define NLA_PUT_NET32(skb, attrtype, value) \ | ||
| 865 | NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
| 866 | |||
| 867 | #define NLA_PUT_U64(skb, attrtype, value) \ | ||
| 868 | NLA_PUT_TYPE(skb, u64, attrtype, value) | ||
| 869 | |||
| 870 | #define NLA_PUT_BE64(skb, attrtype, value) \ | ||
| 871 | NLA_PUT_TYPE(skb, __be64, attrtype, value) | ||
| 872 | |||
| 873 | #define NLA_PUT_NET64(skb, attrtype, value) \ | ||
| 874 | NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
| 875 | |||
| 876 | #define NLA_PUT_STRING(skb, attrtype, value) \ | ||
| 877 | NLA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
| 878 | |||
| 879 | #define NLA_PUT_FLAG(skb, attrtype) \ | ||
| 880 | NLA_PUT(skb, attrtype, 0, NULL) | ||
| 881 | |||
| 882 | #define NLA_PUT_MSECS(skb, attrtype, jiffies) \ | ||
| 883 | NLA_PUT_U64(skb, attrtype, jiffies_to_msecs(jiffies)) | ||
| 884 | |||
| 885 | /** | 916 | /** |
| 886 | * nla_get_u32 - return payload of u32 attribute | 917 | * nla_get_u32 - return payload of u32 attribute |
| 887 | * @nla: u32 netlink attribute | 918 | * @nla: u32 netlink attribute |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 7a911eca0f18..a053a19870cf 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -26,11 +26,14 @@ struct netns_ct { | |||
| 26 | int sysctl_tstamp; | 26 | int sysctl_tstamp; |
| 27 | int sysctl_checksum; | 27 | int sysctl_checksum; |
| 28 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 28 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
| 29 | int sysctl_auto_assign_helper; | ||
| 30 | bool auto_assign_helper_warned; | ||
| 29 | #ifdef CONFIG_SYSCTL | 31 | #ifdef CONFIG_SYSCTL |
| 30 | struct ctl_table_header *sysctl_header; | 32 | struct ctl_table_header *sysctl_header; |
| 31 | struct ctl_table_header *acct_sysctl_header; | 33 | struct ctl_table_header *acct_sysctl_header; |
| 32 | struct ctl_table_header *tstamp_sysctl_header; | 34 | struct ctl_table_header *tstamp_sysctl_header; |
| 33 | struct ctl_table_header *event_sysctl_header; | 35 | struct ctl_table_header *event_sysctl_header; |
| 36 | struct ctl_table_header *helper_sysctl_header; | ||
| 34 | #endif | 37 | #endif |
| 35 | char *slabname; | 38 | char *slabname; |
| 36 | }; | 39 | }; |
diff --git a/include/net/netns/hash.h b/include/net/netns/hash.h index 548d78f2cc47..c06ac58ca107 100644 --- a/include/net/netns/hash.h +++ b/include/net/netns/hash.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | struct net; | 6 | struct net; |
| 7 | 7 | ||
| 8 | static inline unsigned net_hash_mix(struct net *net) | 8 | static inline unsigned int net_hash_mix(struct net *net) |
| 9 | { | 9 | { |
| 10 | #ifdef CONFIG_NET_NS | 10 | #ifdef CONFIG_NET_NS |
| 11 | /* | 11 | /* |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 81abfcb2eb4e..b42be53587ba 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -12,7 +12,9 @@ struct ctl_table_header; | |||
| 12 | 12 | ||
| 13 | struct netns_sysctl_ipv6 { | 13 | struct netns_sysctl_ipv6 { |
| 14 | #ifdef CONFIG_SYSCTL | 14 | #ifdef CONFIG_SYSCTL |
| 15 | struct ctl_table_header *table; | 15 | struct ctl_table_header *hdr; |
| 16 | struct ctl_table_header *route_hdr; | ||
| 17 | struct ctl_table_header *icmp_hdr; | ||
| 16 | struct ctl_table_header *frags_hdr; | 18 | struct ctl_table_header *frags_hdr; |
| 17 | #endif | 19 | #endif |
| 18 | int bindv6only; | 20 | int bindv6only; |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h new file mode 100644 index 000000000000..aca65a5a9d0d --- /dev/null +++ b/include/net/nfc/hci.h | |||
| @@ -0,0 +1,198 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Intel Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the | ||
| 16 | * Free Software Foundation, Inc., | ||
| 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __NET_HCI_H | ||
| 21 | #define __NET_HCI_H | ||
| 22 | |||
| 23 | #include <linux/skbuff.h> | ||
| 24 | |||
| 25 | #include <net/nfc/nfc.h> | ||
| 26 | |||
| 27 | struct nfc_hci_dev; | ||
| 28 | |||
| 29 | struct nfc_hci_ops { | ||
| 30 | int (*open) (struct nfc_hci_dev *hdev); | ||
| 31 | void (*close) (struct nfc_hci_dev *hdev); | ||
| 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); | ||
| 33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
| 34 | int (*start_poll) (struct nfc_hci_dev *hdev, u32 protocols); | ||
| 35 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | ||
| 36 | struct nfc_target *target); | ||
| 37 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | ||
| 38 | struct nfc_target *target); | ||
| 39 | int (*data_exchange) (struct nfc_hci_dev *hdev, | ||
| 40 | struct nfc_target *target, | ||
| 41 | struct sk_buff *skb, struct sk_buff **res_skb); | ||
| 42 | }; | ||
| 43 | |||
| 44 | #define NFC_HCI_MAX_CUSTOM_GATES 15 | ||
| 45 | struct nfc_hci_init_data { | ||
| 46 | u8 gate_count; | ||
| 47 | u8 gates[NFC_HCI_MAX_CUSTOM_GATES]; | ||
| 48 | char session_id[9]; | ||
| 49 | }; | ||
| 50 | |||
| 51 | typedef int (*xmit) (struct sk_buff *skb, void *cb_data); | ||
| 52 | |||
| 53 | #define NFC_HCI_MAX_GATES 256 | ||
| 54 | |||
| 55 | struct nfc_hci_dev { | ||
| 56 | struct nfc_dev *ndev; | ||
| 57 | |||
| 58 | u32 max_data_link_payload; | ||
| 59 | |||
| 60 | struct mutex msg_tx_mutex; | ||
| 61 | |||
| 62 | struct list_head msg_tx_queue; | ||
| 63 | |||
| 64 | struct workqueue_struct *msg_tx_wq; | ||
| 65 | struct work_struct msg_tx_work; | ||
| 66 | |||
| 67 | struct timer_list cmd_timer; | ||
| 68 | struct hci_msg *cmd_pending_msg; | ||
| 69 | |||
| 70 | struct sk_buff_head rx_hcp_frags; | ||
| 71 | |||
| 72 | struct workqueue_struct *msg_rx_wq; | ||
| 73 | struct work_struct msg_rx_work; | ||
| 74 | |||
| 75 | struct sk_buff_head msg_rx_queue; | ||
| 76 | |||
| 77 | struct nfc_hci_ops *ops; | ||
| 78 | |||
| 79 | struct nfc_hci_init_data init_data; | ||
| 80 | |||
| 81 | void *clientdata; | ||
| 82 | |||
| 83 | u8 gate2pipe[NFC_HCI_MAX_GATES]; | ||
| 84 | |||
| 85 | bool poll_started; | ||
| 86 | struct nfc_target *targets; | ||
| 87 | int target_count; | ||
| 88 | |||
| 89 | u8 sw_romlib; | ||
| 90 | u8 sw_patch; | ||
| 91 | u8 sw_flashlib_major; | ||
| 92 | u8 sw_flashlib_minor; | ||
| 93 | |||
| 94 | u8 hw_derivative; | ||
| 95 | u8 hw_version; | ||
| 96 | u8 hw_mpw; | ||
| 97 | u8 hw_software; | ||
| 98 | u8 hw_bsid; | ||
| 99 | }; | ||
| 100 | |||
| 101 | /* hci device allocation */ | ||
| 102 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | ||
| 103 | struct nfc_hci_init_data *init_data, | ||
| 104 | u32 protocols, | ||
| 105 | int tx_headroom, | ||
| 106 | int tx_tailroom, | ||
| 107 | int max_link_payload); | ||
| 108 | void nfc_hci_free_device(struct nfc_hci_dev *hdev); | ||
| 109 | |||
| 110 | int nfc_hci_register_device(struct nfc_hci_dev *hdev); | ||
| 111 | void nfc_hci_unregister_device(struct nfc_hci_dev *hdev); | ||
| 112 | |||
| 113 | void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata); | ||
| 114 | void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | ||
| 115 | |||
| 116 | /* Host IDs */ | ||
| 117 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | ||
| 118 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | ||
| 119 | #define NFC_HCI_UICC_HOST_ID 0x02 | ||
| 120 | |||
| 121 | /* Host Controller Gates and registry indexes */ | ||
| 122 | #define NFC_HCI_ADMIN_GATE 0x00 | ||
| 123 | #define NFC_HCI_ADMIN_SESSION_IDENTITY 0x01 | ||
| 124 | #define NFC_HCI_ADMIN_MAX_PIPE 0x02 | ||
| 125 | #define NFC_HCI_ADMIN_WHITELIST 0x03 | ||
| 126 | #define NFC_HCI_ADMIN_HOST_LIST 0x04 | ||
| 127 | |||
| 128 | #define NFC_HCI_LOOPBACK_GATE 0x04 | ||
| 129 | |||
| 130 | #define NFC_HCI_ID_MGMT_GATE 0x05 | ||
| 131 | #define NFC_HCI_ID_MGMT_VERSION_SW 0x01 | ||
| 132 | #define NFC_HCI_ID_MGMT_VERSION_HW 0x03 | ||
| 133 | #define NFC_HCI_ID_MGMT_VENDOR_NAME 0x04 | ||
| 134 | #define NFC_HCI_ID_MGMT_MODEL_ID 0x05 | ||
| 135 | #define NFC_HCI_ID_MGMT_HCI_VERSION 0x02 | ||
| 136 | #define NFC_HCI_ID_MGMT_GATES_LIST 0x06 | ||
| 137 | |||
| 138 | #define NFC_HCI_LINK_MGMT_GATE 0x06 | ||
| 139 | #define NFC_HCI_LINK_MGMT_REC_ERROR 0x01 | ||
| 140 | |||
| 141 | #define NFC_HCI_RF_READER_B_GATE 0x11 | ||
| 142 | #define NFC_HCI_RF_READER_B_PUPI 0x03 | ||
| 143 | #define NFC_HCI_RF_READER_B_APPLICATION_DATA 0x04 | ||
| 144 | #define NFC_HCI_RF_READER_B_AFI 0x02 | ||
| 145 | #define NFC_HCI_RF_READER_B_HIGHER_LAYER_RESPONSE 0x01 | ||
| 146 | #define NFC_HCI_RF_READER_B_HIGHER_LAYER_DATA 0x05 | ||
| 147 | |||
| 148 | #define NFC_HCI_RF_READER_A_GATE 0x13 | ||
| 149 | #define NFC_HCI_RF_READER_A_UID 0x02 | ||
| 150 | #define NFC_HCI_RF_READER_A_ATQA 0x04 | ||
| 151 | #define NFC_HCI_RF_READER_A_APPLICATION_DATA 0x05 | ||
| 152 | #define NFC_HCI_RF_READER_A_SAK 0x03 | ||
| 153 | #define NFC_HCI_RF_READER_A_FWI_SFGT 0x06 | ||
| 154 | #define NFC_HCI_RF_READER_A_DATARATE_MAX 0x01 | ||
| 155 | |||
| 156 | #define NFC_HCI_TYPE_A_SEL_PROT(x) (((x) & 0x60) >> 5) | ||
| 157 | #define NFC_HCI_TYPE_A_SEL_PROT_MIFARE 0 | ||
| 158 | #define NFC_HCI_TYPE_A_SEL_PROT_ISO14443 1 | ||
| 159 | #define NFC_HCI_TYPE_A_SEL_PROT_DEP 2 | ||
| 160 | #define NFC_HCI_TYPE_A_SEL_PROT_ISO14443_DEP 3 | ||
| 161 | |||
| 162 | /* Generic events */ | ||
| 163 | #define NFC_HCI_EVT_HCI_END_OF_OPERATION 0x01 | ||
| 164 | #define NFC_HCI_EVT_POST_DATA 0x02 | ||
| 165 | #define NFC_HCI_EVT_HOT_PLUG 0x03 | ||
| 166 | |||
| 167 | /* Reader RF gates events */ | ||
| 168 | #define NFC_HCI_EVT_READER_REQUESTED 0x10 | ||
| 169 | #define NFC_HCI_EVT_END_OPERATION 0x11 | ||
| 170 | |||
| 171 | /* Reader Application gate events */ | ||
| 172 | #define NFC_HCI_EVT_TARGET_DISCOVERED 0x10 | ||
| 173 | |||
| 174 | /* receiving messages from lower layer */ | ||
| 175 | void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, | ||
| 176 | struct sk_buff *skb); | ||
| 177 | void nfc_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, | ||
| 178 | struct sk_buff *skb); | ||
| 179 | void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, | ||
| 180 | struct sk_buff *skb); | ||
| 181 | void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
| 182 | |||
| 183 | /* connecting to gates and sending hci instructions */ | ||
| 184 | int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate); | ||
| 185 | int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate); | ||
| 186 | int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev); | ||
| 187 | int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, | ||
| 188 | struct sk_buff **skb); | ||
| 189 | int nfc_hci_set_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, | ||
| 190 | const u8 *param, size_t param_len); | ||
| 191 | int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | ||
| 192 | const u8 *param, size_t param_len, struct sk_buff **skb); | ||
| 193 | int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | ||
| 194 | const u8 *param, size_t param_len); | ||
| 195 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
| 196 | const u8 *param, size_t param_len); | ||
| 197 | |||
| 198 | #endif /* __NET_HCI_H */ | ||
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index bac070bf3514..9a2505a5b8de 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -62,10 +62,12 @@ struct nfc_ops { | |||
| 62 | int (*data_exchange)(struct nfc_dev *dev, u32 target_idx, | 62 | int (*data_exchange)(struct nfc_dev *dev, u32 target_idx, |
| 63 | struct sk_buff *skb, data_exchange_cb_t cb, | 63 | struct sk_buff *skb, data_exchange_cb_t cb, |
| 64 | void *cb_context); | 64 | void *cb_context); |
| 65 | int (*check_presence)(struct nfc_dev *dev, u32 target_idx); | ||
| 65 | }; | 66 | }; |
| 66 | 67 | ||
| 67 | #define NFC_TARGET_IDX_ANY -1 | 68 | #define NFC_TARGET_IDX_ANY -1 |
| 68 | #define NFC_MAX_GT_LEN 48 | 69 | #define NFC_MAX_GT_LEN 48 |
| 70 | #define NFC_TARGET_IDX_NONE 0xffffffff | ||
| 69 | 71 | ||
| 70 | struct nfc_target { | 72 | struct nfc_target { |
| 71 | u32 idx; | 73 | u32 idx; |
| @@ -78,6 +80,8 @@ struct nfc_target { | |||
| 78 | u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; | 80 | u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; |
| 79 | u8 sensf_res_len; | 81 | u8 sensf_res_len; |
| 80 | u8 sensf_res[NFC_SENSF_RES_MAXSIZE]; | 82 | u8 sensf_res[NFC_SENSF_RES_MAXSIZE]; |
| 83 | u8 hci_reader_gate; | ||
| 84 | u8 logical_idx; | ||
| 81 | }; | 85 | }; |
| 82 | 86 | ||
| 83 | struct nfc_genl_data { | 87 | struct nfc_genl_data { |
| @@ -86,7 +90,8 @@ struct nfc_genl_data { | |||
| 86 | }; | 90 | }; |
| 87 | 91 | ||
| 88 | struct nfc_dev { | 92 | struct nfc_dev { |
| 89 | unsigned idx; | 93 | unsigned int idx; |
| 94 | u32 target_next_idx; | ||
| 90 | struct nfc_target *targets; | 95 | struct nfc_target *targets; |
| 91 | int n_targets; | 96 | int n_targets; |
| 92 | int targets_generation; | 97 | int targets_generation; |
| @@ -94,7 +99,7 @@ struct nfc_dev { | |||
| 94 | struct device dev; | 99 | struct device dev; |
| 95 | bool dev_up; | 100 | bool dev_up; |
| 96 | bool polling; | 101 | bool polling; |
| 97 | bool remote_activated; | 102 | u32 activated_target_idx; |
| 98 | bool dep_link_up; | 103 | bool dep_link_up; |
| 99 | u32 dep_rf_mode; | 104 | u32 dep_rf_mode; |
| 100 | struct nfc_genl_data genl_data; | 105 | struct nfc_genl_data genl_data; |
| @@ -103,6 +108,10 @@ struct nfc_dev { | |||
| 103 | int tx_headroom; | 108 | int tx_headroom; |
| 104 | int tx_tailroom; | 109 | int tx_tailroom; |
| 105 | 110 | ||
| 111 | struct timer_list check_pres_timer; | ||
| 112 | struct workqueue_struct *check_pres_wq; | ||
| 113 | struct work_struct check_pres_work; | ||
| 114 | |||
| 106 | struct nfc_ops *ops; | 115 | struct nfc_ops *ops; |
| 107 | }; | 116 | }; |
| 108 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) | 117 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) |
| @@ -181,6 +190,7 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev, | |||
| 181 | 190 | ||
| 182 | int nfc_targets_found(struct nfc_dev *dev, | 191 | int nfc_targets_found(struct nfc_dev *dev, |
| 183 | struct nfc_target *targets, int ntargets); | 192 | struct nfc_target *targets, int ntargets); |
| 193 | int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); | ||
| 184 | 194 | ||
| 185 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, | 195 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, |
| 186 | u8 comm_mode, u8 rf_mode); | 196 | u8 comm_mode, u8 rf_mode); |
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h new file mode 100644 index 000000000000..1071987d0408 --- /dev/null +++ b/include/net/nfc/shdlc.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 Intel Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the | ||
| 16 | * Free Software Foundation, Inc., | ||
| 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __NFC_SHDLC_H | ||
| 21 | #define __NFC_SHDLC_H | ||
| 22 | |||
| 23 | struct nfc_shdlc; | ||
| 24 | |||
| 25 | struct nfc_shdlc_ops { | ||
| 26 | int (*open) (struct nfc_shdlc *shdlc); | ||
| 27 | void (*close) (struct nfc_shdlc *shdlc); | ||
| 28 | int (*hci_ready) (struct nfc_shdlc *shdlc); | ||
| 29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); | ||
| 30 | int (*start_poll) (struct nfc_shdlc *shdlc, u32 protocols); | ||
| 31 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, | ||
| 32 | struct nfc_target *target); | ||
| 33 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | ||
| 34 | struct nfc_target *target); | ||
| 35 | int (*data_exchange) (struct nfc_shdlc *shdlc, | ||
| 36 | struct nfc_target *target, | ||
| 37 | struct sk_buff *skb, struct sk_buff **res_skb); | ||
| 38 | }; | ||
| 39 | |||
| 40 | enum shdlc_state { | ||
| 41 | SHDLC_DISCONNECTED = 0, | ||
| 42 | SHDLC_CONNECTING = 1, | ||
| 43 | SHDLC_NEGOCIATING = 2, | ||
| 44 | SHDLC_CONNECTED = 3 | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct nfc_shdlc { | ||
| 48 | struct mutex state_mutex; | ||
| 49 | enum shdlc_state state; | ||
| 50 | int hard_fault; | ||
| 51 | |||
| 52 | struct nfc_hci_dev *hdev; | ||
| 53 | |||
| 54 | wait_queue_head_t *connect_wq; | ||
| 55 | int connect_tries; | ||
| 56 | int connect_result; | ||
| 57 | struct timer_list connect_timer;/* aka T3 in spec 10.6.1 */ | ||
| 58 | |||
| 59 | u8 w; /* window size */ | ||
| 60 | bool srej_support; | ||
| 61 | |||
| 62 | struct timer_list t1_timer; /* send ack timeout */ | ||
| 63 | bool t1_active; | ||
| 64 | |||
| 65 | struct timer_list t2_timer; /* guard/retransmit timeout */ | ||
| 66 | bool t2_active; | ||
| 67 | |||
| 68 | int ns; /* next seq num for send */ | ||
| 69 | int nr; /* next expected seq num for receive */ | ||
| 70 | int dnr; /* oldest sent unacked seq num */ | ||
| 71 | |||
| 72 | struct sk_buff_head rcv_q; | ||
| 73 | |||
| 74 | struct sk_buff_head send_q; | ||
| 75 | bool rnr; /* other side is not ready to receive */ | ||
| 76 | |||
| 77 | struct sk_buff_head ack_pending_q; | ||
| 78 | |||
| 79 | struct workqueue_struct *sm_wq; | ||
| 80 | struct work_struct sm_work; | ||
| 81 | |||
| 82 | struct nfc_shdlc_ops *ops; | ||
| 83 | |||
| 84 | int client_headroom; | ||
| 85 | int client_tailroom; | ||
| 86 | |||
| 87 | void *clientdata; | ||
| 88 | }; | ||
| 89 | |||
| 90 | void nfc_shdlc_recv_frame(struct nfc_shdlc *shdlc, struct sk_buff *skb); | ||
| 91 | |||
| 92 | struct nfc_shdlc *nfc_shdlc_allocate(struct nfc_shdlc_ops *ops, | ||
| 93 | struct nfc_hci_init_data *init_data, | ||
| 94 | u32 protocols, | ||
| 95 | int tx_headroom, int tx_tailroom, | ||
| 96 | int max_link_payload, const char *devname); | ||
| 97 | |||
| 98 | void nfc_shdlc_free(struct nfc_shdlc *shdlc); | ||
| 99 | |||
| 100 | void nfc_shdlc_set_clientdata(struct nfc_shdlc *shdlc, void *clientdata); | ||
| 101 | void *nfc_shdlc_get_clientdata(struct nfc_shdlc *shdlc); | ||
| 102 | struct nfc_hci_dev *nfc_shdlc_get_hci_dev(struct nfc_shdlc *shdlc); | ||
| 103 | |||
| 104 | #endif /* __NFC_SHDLC_H */ | ||
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index fffdc603f4c8..66f5ac370f92 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
| @@ -107,7 +107,7 @@ extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, | |||
| 107 | /* Calculate maximal size of packet seen by hard_start_xmit | 107 | /* Calculate maximal size of packet seen by hard_start_xmit |
| 108 | routine of this device. | 108 | routine of this device. |
| 109 | */ | 109 | */ |
| 110 | static inline unsigned psched_mtu(const struct net_device *dev) | 110 | static inline unsigned int psched_mtu(const struct net_device *dev) |
| 111 | { | 111 | { |
| 112 | return dev->mtu + dev->hard_header_len; | 112 | return dev->mtu + dev->hard_header_len; |
| 113 | } | 113 | } |
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index cf7577234457..e7ea660e4db6 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | void raw6_icmp_error(struct sk_buff *, int nexthdr, | 6 | void raw6_icmp_error(struct sk_buff *, int nexthdr, |
| 7 | u8 type, u8 code, int inner_offset, __be32); | 7 | u8 type, u8 code, int inner_offset, __be32); |
| 8 | int raw6_local_deliver(struct sk_buff *, int); | 8 | bool raw6_local_deliver(struct sk_buff *, int); |
| 9 | 9 | ||
| 10 | extern int rawv6_rcv(struct sock *sk, | 10 | extern int rawv6_rcv(struct sock *sk, |
| 11 | struct sk_buff *skb); | 11 | struct sk_buff *skb); |
diff --git a/include/net/route.h b/include/net/route.h index b1c0d5b564c2..ed2b78e2375d 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -50,7 +50,7 @@ struct rtable { | |||
| 50 | __be32 rt_key_src; | 50 | __be32 rt_key_src; |
| 51 | 51 | ||
| 52 | int rt_genid; | 52 | int rt_genid; |
| 53 | unsigned rt_flags; | 53 | unsigned int rt_flags; |
| 54 | __u16 rt_type; | 54 | __u16 rt_type; |
| 55 | __u8 rt_key_tos; | 55 | __u8 rt_key_tos; |
| 56 | 56 | ||
| @@ -185,8 +185,8 @@ extern unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph | |||
| 185 | unsigned short new_mtu, struct net_device *dev); | 185 | unsigned short new_mtu, struct net_device *dev); |
| 186 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 186 | extern void ip_rt_send_redirect(struct sk_buff *skb); |
| 187 | 187 | ||
| 188 | extern unsigned inet_addr_type(struct net *net, __be32 addr); | 188 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); |
| 189 | extern unsigned inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 189 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); |
| 190 | extern void ip_rt_multicast_event(struct in_device *); | 190 | extern void ip_rt_multicast_event(struct in_device *); |
| 191 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); | 191 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); |
| 192 | extern void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); | 192 | extern void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 370293901971..bbcfd0993432 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -41,9 +41,11 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) | |||
| 41 | * @get_size: Function to calculate required room for dumping device | 41 | * @get_size: Function to calculate required room for dumping device |
| 42 | * specific netlink attributes | 42 | * specific netlink attributes |
| 43 | * @fill_info: Function to dump device specific netlink attributes | 43 | * @fill_info: Function to dump device specific netlink attributes |
| 44 | * @get_xstats_size: Function to calculate required room for dumping devic | 44 | * @get_xstats_size: Function to calculate required room for dumping device |
| 45 | * specific statistics | 45 | * specific statistics |
| 46 | * @fill_xstats: Function to dump device specific statistics | 46 | * @fill_xstats: Function to dump device specific statistics |
| 47 | * @get_tx_queues: Function to determine number of transmit queues to create when | ||
| 48 | * creating a new device. | ||
| 47 | */ | 49 | */ |
| 48 | struct rtnl_link_ops { | 50 | struct rtnl_link_ops { |
| 49 | struct list_head list; | 51 | struct list_head list; |
| @@ -75,9 +77,8 @@ struct rtnl_link_ops { | |||
| 75 | size_t (*get_xstats_size)(const struct net_device *dev); | 77 | size_t (*get_xstats_size)(const struct net_device *dev); |
| 76 | int (*fill_xstats)(struct sk_buff *skb, | 78 | int (*fill_xstats)(struct sk_buff *skb, |
| 77 | const struct net_device *dev); | 79 | const struct net_device *dev); |
| 78 | int (*get_tx_queues)(struct net *net, struct nlattr *tb[], | 80 | int (*get_tx_queues)(struct net *net, |
| 79 | unsigned int *tx_queues, | 81 | struct nlattr *tb[]); |
| 80 | unsigned int *real_tx_queues); | ||
| 81 | }; | 82 | }; |
| 82 | 83 | ||
| 83 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | 84 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); |
| @@ -94,7 +95,7 @@ extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | |||
| 94 | * @fill_link_af: Function to fill IFLA_AF_SPEC with address family | 95 | * @fill_link_af: Function to fill IFLA_AF_SPEC with address family |
| 95 | * specific netlink attributes. | 96 | * specific netlink attributes. |
| 96 | * @get_link_af_size: Function to calculate size of address family specific | 97 | * @get_link_af_size: Function to calculate size of address family specific |
| 97 | * netlink attributes exlusive the container attribute. | 98 | * netlink attributes. |
| 98 | * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr | 99 | * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr |
| 99 | * for invalid configuration settings. | 100 | * for invalid configuration settings. |
| 100 | * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify | 101 | * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 6ee44b24864a..a2ef81466b00 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -704,4 +704,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr) | |||
| 704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); | 704 | addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); |
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | /* The cookie is always 0 since this is how it's used in the | ||
| 708 | * pmtu code. | ||
| 709 | */ | ||
| 710 | static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) | ||
| 711 | { | ||
| 712 | if (t->dst && !dst_check(t->dst, 0)) { | ||
| 713 | dst_release(t->dst); | ||
| 714 | t->dst = NULL; | ||
| 715 | } | ||
| 716 | |||
| 717 | return t->dst; | ||
| 718 | } | ||
| 719 | |||
| 707 | #endif /* __net_sctp_h__ */ | 720 | #endif /* __net_sctp_h__ */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 88949a994538..e4652fe58958 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -1145,10 +1145,10 @@ struct sctp_outq { | |||
| 1145 | /* Data pending that has never been transmitted. */ | 1145 | /* Data pending that has never been transmitted. */ |
| 1146 | struct list_head out_chunk_list; | 1146 | struct list_head out_chunk_list; |
| 1147 | 1147 | ||
| 1148 | unsigned out_qlen; /* Total length of queued data chunks. */ | 1148 | unsigned int out_qlen; /* Total length of queued data chunks. */ |
| 1149 | 1149 | ||
| 1150 | /* Error of send failed, may used in SCTP_SEND_FAILED event. */ | 1150 | /* Error of send failed, may used in SCTP_SEND_FAILED event. */ |
| 1151 | unsigned error; | 1151 | unsigned int error; |
| 1152 | 1152 | ||
| 1153 | /* These are control chunks we want to send. */ | 1153 | /* These are control chunks we want to send. */ |
| 1154 | struct list_head control_chunk_list; | 1154 | struct list_head control_chunk_list; |
| @@ -2000,8 +2000,8 @@ void sctp_assoc_update(struct sctp_association *old, | |||
| 2000 | __u32 sctp_association_get_next_tsn(struct sctp_association *); | 2000 | __u32 sctp_association_get_next_tsn(struct sctp_association *); |
| 2001 | 2001 | ||
| 2002 | void sctp_assoc_sync_pmtu(struct sctp_association *); | 2002 | void sctp_assoc_sync_pmtu(struct sctp_association *); |
| 2003 | void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned); | 2003 | void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned int); |
| 2004 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); | 2004 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned int); |
| 2005 | void sctp_assoc_set_primary(struct sctp_association *, | 2005 | void sctp_assoc_set_primary(struct sctp_association *, |
| 2006 | struct sctp_transport *); | 2006 | struct sctp_transport *); |
| 2007 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, | 2007 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, |
diff --git a/include/net/sock.h b/include/net/sock.h index 5a0a58ac4126..da931555e000 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -97,7 +97,7 @@ void mem_cgroup_sockets_destroy(struct cgroup *cgrp) | |||
| 97 | #else | 97 | #else |
| 98 | /* Validate arguments and do nothing */ | 98 | /* Validate arguments and do nothing */ |
| 99 | static inline __printf(2, 3) | 99 | static inline __printf(2, 3) |
| 100 | void SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 100 | void SOCK_DEBUG(const struct sock *sk, const char *msg, ...) |
| 101 | { | 101 | { |
| 102 | } | 102 | } |
| 103 | #endif | 103 | #endif |
| @@ -372,11 +372,22 @@ struct sock { | |||
| 372 | void (*sk_data_ready)(struct sock *sk, int bytes); | 372 | void (*sk_data_ready)(struct sock *sk, int bytes); |
| 373 | void (*sk_write_space)(struct sock *sk); | 373 | void (*sk_write_space)(struct sock *sk); |
| 374 | void (*sk_error_report)(struct sock *sk); | 374 | void (*sk_error_report)(struct sock *sk); |
| 375 | int (*sk_backlog_rcv)(struct sock *sk, | 375 | int (*sk_backlog_rcv)(struct sock *sk, |
| 376 | struct sk_buff *skb); | 376 | struct sk_buff *skb); |
| 377 | void (*sk_destruct)(struct sock *sk); | 377 | void (*sk_destruct)(struct sock *sk); |
| 378 | }; | 378 | }; |
| 379 | 379 | ||
| 380 | /* | ||
| 381 | * SK_CAN_REUSE and SK_NO_REUSE on a socket mean that the socket is OK | ||
| 382 | * or not whether his port will be reused by someone else. SK_FORCE_REUSE | ||
| 383 | * on a socket means that the socket will reuse everybody else's port | ||
| 384 | * without looking at the other's sk_reuse value. | ||
| 385 | */ | ||
| 386 | |||
| 387 | #define SK_NO_REUSE 0 | ||
| 388 | #define SK_CAN_REUSE 1 | ||
| 389 | #define SK_FORCE_REUSE 2 | ||
| 390 | |||
| 380 | static inline int sk_peek_offset(struct sock *sk, int flags) | 391 | static inline int sk_peek_offset(struct sock *sk, int flags) |
| 381 | { | 392 | { |
| 382 | if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0)) | 393 | if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0)) |
| @@ -443,40 +454,40 @@ static inline struct sock *sk_nulls_next(const struct sock *sk) | |||
| 443 | NULL; | 454 | NULL; |
| 444 | } | 455 | } |
| 445 | 456 | ||
| 446 | static inline int sk_unhashed(const struct sock *sk) | 457 | static inline bool sk_unhashed(const struct sock *sk) |
| 447 | { | 458 | { |
| 448 | return hlist_unhashed(&sk->sk_node); | 459 | return hlist_unhashed(&sk->sk_node); |
| 449 | } | 460 | } |
| 450 | 461 | ||
| 451 | static inline int sk_hashed(const struct sock *sk) | 462 | static inline bool sk_hashed(const struct sock *sk) |
| 452 | { | 463 | { |
| 453 | return !sk_unhashed(sk); | 464 | return !sk_unhashed(sk); |
| 454 | } | 465 | } |
| 455 | 466 | ||
| 456 | static __inline__ void sk_node_init(struct hlist_node *node) | 467 | static inline void sk_node_init(struct hlist_node *node) |
| 457 | { | 468 | { |
| 458 | node->pprev = NULL; | 469 | node->pprev = NULL; |
| 459 | } | 470 | } |
| 460 | 471 | ||
| 461 | static __inline__ void sk_nulls_node_init(struct hlist_nulls_node *node) | 472 | static inline void sk_nulls_node_init(struct hlist_nulls_node *node) |
| 462 | { | 473 | { |
| 463 | node->pprev = NULL; | 474 | node->pprev = NULL; |
| 464 | } | 475 | } |
| 465 | 476 | ||
| 466 | static __inline__ void __sk_del_node(struct sock *sk) | 477 | static inline void __sk_del_node(struct sock *sk) |
| 467 | { | 478 | { |
| 468 | __hlist_del(&sk->sk_node); | 479 | __hlist_del(&sk->sk_node); |
| 469 | } | 480 | } |
| 470 | 481 | ||
| 471 | /* NB: equivalent to hlist_del_init_rcu */ | 482 | /* NB: equivalent to hlist_del_init_rcu */ |
| 472 | static __inline__ int __sk_del_node_init(struct sock *sk) | 483 | static inline bool __sk_del_node_init(struct sock *sk) |
| 473 | { | 484 | { |
| 474 | if (sk_hashed(sk)) { | 485 | if (sk_hashed(sk)) { |
| 475 | __sk_del_node(sk); | 486 | __sk_del_node(sk); |
| 476 | sk_node_init(&sk->sk_node); | 487 | sk_node_init(&sk->sk_node); |
| 477 | return 1; | 488 | return true; |
| 478 | } | 489 | } |
| 479 | return 0; | 490 | return false; |
| 480 | } | 491 | } |
| 481 | 492 | ||
| 482 | /* Grab socket reference count. This operation is valid only | 493 | /* Grab socket reference count. This operation is valid only |
| @@ -498,9 +509,9 @@ static inline void __sock_put(struct sock *sk) | |||
| 498 | atomic_dec(&sk->sk_refcnt); | 509 | atomic_dec(&sk->sk_refcnt); |
| 499 | } | 510 | } |
| 500 | 511 | ||
| 501 | static __inline__ int sk_del_node_init(struct sock *sk) | 512 | static inline bool sk_del_node_init(struct sock *sk) |
| 502 | { | 513 | { |
| 503 | int rc = __sk_del_node_init(sk); | 514 | bool rc = __sk_del_node_init(sk); |
| 504 | 515 | ||
| 505 | if (rc) { | 516 | if (rc) { |
| 506 | /* paranoid for a while -acme */ | 517 | /* paranoid for a while -acme */ |
| @@ -511,18 +522,18 @@ static __inline__ int sk_del_node_init(struct sock *sk) | |||
| 511 | } | 522 | } |
| 512 | #define sk_del_node_init_rcu(sk) sk_del_node_init(sk) | 523 | #define sk_del_node_init_rcu(sk) sk_del_node_init(sk) |
| 513 | 524 | ||
| 514 | static __inline__ int __sk_nulls_del_node_init_rcu(struct sock *sk) | 525 | static inline bool __sk_nulls_del_node_init_rcu(struct sock *sk) |
| 515 | { | 526 | { |
| 516 | if (sk_hashed(sk)) { | 527 | if (sk_hashed(sk)) { |
| 517 | hlist_nulls_del_init_rcu(&sk->sk_nulls_node); | 528 | hlist_nulls_del_init_rcu(&sk->sk_nulls_node); |
| 518 | return 1; | 529 | return true; |
| 519 | } | 530 | } |
| 520 | return 0; | 531 | return false; |
| 521 | } | 532 | } |
| 522 | 533 | ||
| 523 | static __inline__ int sk_nulls_del_node_init_rcu(struct sock *sk) | 534 | static inline bool sk_nulls_del_node_init_rcu(struct sock *sk) |
| 524 | { | 535 | { |
| 525 | int rc = __sk_nulls_del_node_init_rcu(sk); | 536 | bool rc = __sk_nulls_del_node_init_rcu(sk); |
| 526 | 537 | ||
| 527 | if (rc) { | 538 | if (rc) { |
| 528 | /* paranoid for a while -acme */ | 539 | /* paranoid for a while -acme */ |
| @@ -532,40 +543,40 @@ static __inline__ int sk_nulls_del_node_init_rcu(struct sock *sk) | |||
| 532 | return rc; | 543 | return rc; |
| 533 | } | 544 | } |
| 534 | 545 | ||
| 535 | static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) | 546 | static inline void __sk_add_node(struct sock *sk, struct hlist_head *list) |
| 536 | { | 547 | { |
| 537 | hlist_add_head(&sk->sk_node, list); | 548 | hlist_add_head(&sk->sk_node, list); |
| 538 | } | 549 | } |
| 539 | 550 | ||
| 540 | static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list) | 551 | static inline void sk_add_node(struct sock *sk, struct hlist_head *list) |
| 541 | { | 552 | { |
| 542 | sock_hold(sk); | 553 | sock_hold(sk); |
| 543 | __sk_add_node(sk, list); | 554 | __sk_add_node(sk, list); |
| 544 | } | 555 | } |
| 545 | 556 | ||
| 546 | static __inline__ void sk_add_node_rcu(struct sock *sk, struct hlist_head *list) | 557 | static inline void sk_add_node_rcu(struct sock *sk, struct hlist_head *list) |
| 547 | { | 558 | { |
| 548 | sock_hold(sk); | 559 | sock_hold(sk); |
| 549 | hlist_add_head_rcu(&sk->sk_node, list); | 560 | hlist_add_head_rcu(&sk->sk_node, list); |
| 550 | } | 561 | } |
| 551 | 562 | ||
| 552 | static __inline__ void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) | 563 | static inline void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) |
| 553 | { | 564 | { |
| 554 | hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); | 565 | hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); |
| 555 | } | 566 | } |
| 556 | 567 | ||
| 557 | static __inline__ void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) | 568 | static inline void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) |
| 558 | { | 569 | { |
| 559 | sock_hold(sk); | 570 | sock_hold(sk); |
| 560 | __sk_nulls_add_node_rcu(sk, list); | 571 | __sk_nulls_add_node_rcu(sk, list); |
| 561 | } | 572 | } |
| 562 | 573 | ||
| 563 | static __inline__ void __sk_del_bind_node(struct sock *sk) | 574 | static inline void __sk_del_bind_node(struct sock *sk) |
| 564 | { | 575 | { |
| 565 | __hlist_del(&sk->sk_bind_node); | 576 | __hlist_del(&sk->sk_bind_node); |
| 566 | } | 577 | } |
| 567 | 578 | ||
| 568 | static __inline__ void sk_add_bind_node(struct sock *sk, | 579 | static inline void sk_add_bind_node(struct sock *sk, |
| 569 | struct hlist_head *list) | 580 | struct hlist_head *list) |
| 570 | { | 581 | { |
| 571 | hlist_add_head(&sk->sk_bind_node, list); | 582 | hlist_add_head(&sk->sk_bind_node, list); |
| @@ -639,7 +650,7 @@ static inline void sock_reset_flag(struct sock *sk, enum sock_flags flag) | |||
| 639 | __clear_bit(flag, &sk->sk_flags); | 650 | __clear_bit(flag, &sk->sk_flags); |
| 640 | } | 651 | } |
| 641 | 652 | ||
| 642 | static inline int sock_flag(struct sock *sk, enum sock_flags flag) | 653 | static inline bool sock_flag(const struct sock *sk, enum sock_flags flag) |
| 643 | { | 654 | { |
| 644 | return test_bit(flag, &sk->sk_flags); | 655 | return test_bit(flag, &sk->sk_flags); |
| 645 | } | 656 | } |
| @@ -654,7 +665,7 @@ static inline void sk_acceptq_added(struct sock *sk) | |||
| 654 | sk->sk_ack_backlog++; | 665 | sk->sk_ack_backlog++; |
| 655 | } | 666 | } |
| 656 | 667 | ||
| 657 | static inline int sk_acceptq_is_full(struct sock *sk) | 668 | static inline bool sk_acceptq_is_full(const struct sock *sk) |
| 658 | { | 669 | { |
| 659 | return sk->sk_ack_backlog > sk->sk_max_ack_backlog; | 670 | return sk->sk_ack_backlog > sk->sk_max_ack_backlog; |
| 660 | } | 671 | } |
| @@ -662,19 +673,19 @@ static inline int sk_acceptq_is_full(struct sock *sk) | |||
| 662 | /* | 673 | /* |
| 663 | * Compute minimal free write space needed to queue new packets. | 674 | * Compute minimal free write space needed to queue new packets. |
| 664 | */ | 675 | */ |
| 665 | static inline int sk_stream_min_wspace(struct sock *sk) | 676 | static inline int sk_stream_min_wspace(const struct sock *sk) |
| 666 | { | 677 | { |
| 667 | return sk->sk_wmem_queued >> 1; | 678 | return sk->sk_wmem_queued >> 1; |
| 668 | } | 679 | } |
| 669 | 680 | ||
| 670 | static inline int sk_stream_wspace(struct sock *sk) | 681 | static inline int sk_stream_wspace(const struct sock *sk) |
| 671 | { | 682 | { |
| 672 | return sk->sk_sndbuf - sk->sk_wmem_queued; | 683 | return sk->sk_sndbuf - sk->sk_wmem_queued; |
| 673 | } | 684 | } |
| 674 | 685 | ||
| 675 | extern void sk_stream_write_space(struct sock *sk); | 686 | extern void sk_stream_write_space(struct sock *sk); |
| 676 | 687 | ||
| 677 | static inline int sk_stream_memory_free(struct sock *sk) | 688 | static inline bool sk_stream_memory_free(const struct sock *sk) |
| 678 | { | 689 | { |
| 679 | return sk->sk_wmem_queued < sk->sk_sndbuf; | 690 | return sk->sk_wmem_queued < sk->sk_sndbuf; |
| 680 | } | 691 | } |
| @@ -699,17 +710,19 @@ static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) | |||
| 699 | * Do not take into account this skb truesize, | 710 | * Do not take into account this skb truesize, |
| 700 | * to allow even a single big packet to come. | 711 | * to allow even a single big packet to come. |
| 701 | */ | 712 | */ |
| 702 | static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb) | 713 | static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb, |
| 714 | unsigned int limit) | ||
| 703 | { | 715 | { |
| 704 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); | 716 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); |
| 705 | 717 | ||
| 706 | return qsize > sk->sk_rcvbuf; | 718 | return qsize > limit; |
| 707 | } | 719 | } |
| 708 | 720 | ||
| 709 | /* The per-socket spinlock must be held here. */ | 721 | /* The per-socket spinlock must be held here. */ |
| 710 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb) | 722 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, |
| 723 | unsigned int limit) | ||
| 711 | { | 724 | { |
| 712 | if (sk_rcvqueues_full(sk, skb)) | 725 | if (sk_rcvqueues_full(sk, skb, limit)) |
| 713 | return -ENOBUFS; | 726 | return -ENOBUFS; |
| 714 | 727 | ||
| 715 | __sk_add_backlog(sk, skb); | 728 | __sk_add_backlog(sk, skb); |
| @@ -796,26 +809,26 @@ struct module; | |||
| 796 | * transport -> network interface is defined by struct inet_proto | 809 | * transport -> network interface is defined by struct inet_proto |
| 797 | */ | 810 | */ |
| 798 | struct proto { | 811 | struct proto { |
| 799 | void (*close)(struct sock *sk, | 812 | void (*close)(struct sock *sk, |
| 800 | long timeout); | 813 | long timeout); |
| 801 | int (*connect)(struct sock *sk, | 814 | int (*connect)(struct sock *sk, |
| 802 | struct sockaddr *uaddr, | 815 | struct sockaddr *uaddr, |
| 803 | int addr_len); | 816 | int addr_len); |
| 804 | int (*disconnect)(struct sock *sk, int flags); | 817 | int (*disconnect)(struct sock *sk, int flags); |
| 805 | 818 | ||
| 806 | struct sock * (*accept) (struct sock *sk, int flags, int *err); | 819 | struct sock * (*accept)(struct sock *sk, int flags, int *err); |
| 807 | 820 | ||
| 808 | int (*ioctl)(struct sock *sk, int cmd, | 821 | int (*ioctl)(struct sock *sk, int cmd, |
| 809 | unsigned long arg); | 822 | unsigned long arg); |
| 810 | int (*init)(struct sock *sk); | 823 | int (*init)(struct sock *sk); |
| 811 | void (*destroy)(struct sock *sk); | 824 | void (*destroy)(struct sock *sk); |
| 812 | void (*shutdown)(struct sock *sk, int how); | 825 | void (*shutdown)(struct sock *sk, int how); |
| 813 | int (*setsockopt)(struct sock *sk, int level, | 826 | int (*setsockopt)(struct sock *sk, int level, |
| 814 | int optname, char __user *optval, | 827 | int optname, char __user *optval, |
| 815 | unsigned int optlen); | 828 | unsigned int optlen); |
| 816 | int (*getsockopt)(struct sock *sk, int level, | 829 | int (*getsockopt)(struct sock *sk, int level, |
| 817 | int optname, char __user *optval, | 830 | int optname, char __user *optval, |
| 818 | int __user *option); | 831 | int __user *option); |
| 819 | #ifdef CONFIG_COMPAT | 832 | #ifdef CONFIG_COMPAT |
| 820 | int (*compat_setsockopt)(struct sock *sk, | 833 | int (*compat_setsockopt)(struct sock *sk, |
| 821 | int level, | 834 | int level, |
| @@ -832,14 +845,14 @@ struct proto { | |||
| 832 | struct msghdr *msg, size_t len); | 845 | struct msghdr *msg, size_t len); |
| 833 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, | 846 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, |
| 834 | struct msghdr *msg, | 847 | struct msghdr *msg, |
| 835 | size_t len, int noblock, int flags, | 848 | size_t len, int noblock, int flags, |
| 836 | int *addr_len); | 849 | int *addr_len); |
| 837 | int (*sendpage)(struct sock *sk, struct page *page, | 850 | int (*sendpage)(struct sock *sk, struct page *page, |
| 838 | int offset, size_t size, int flags); | 851 | int offset, size_t size, int flags); |
| 839 | int (*bind)(struct sock *sk, | 852 | int (*bind)(struct sock *sk, |
| 840 | struct sockaddr *uaddr, int addr_len); | 853 | struct sockaddr *uaddr, int addr_len); |
| 841 | 854 | ||
| 842 | int (*backlog_rcv) (struct sock *sk, | 855 | int (*backlog_rcv) (struct sock *sk, |
| 843 | struct sk_buff *skb); | 856 | struct sk_buff *skb); |
| 844 | 857 | ||
| 845 | /* Keeping track of sk's, looking them up, and port selection methods. */ | 858 | /* Keeping track of sk's, looking them up, and port selection methods. */ |
| @@ -1160,7 +1173,7 @@ proto_memory_pressure(struct proto *prot) | |||
| 1160 | extern void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc); | 1173 | extern void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc); |
| 1161 | extern int sock_prot_inuse_get(struct net *net, struct proto *proto); | 1174 | extern int sock_prot_inuse_get(struct net *net, struct proto *proto); |
| 1162 | #else | 1175 | #else |
| 1163 | static void inline sock_prot_inuse_add(struct net *net, struct proto *prot, | 1176 | static inline void sock_prot_inuse_add(struct net *net, struct proto *prot, |
| 1164 | int inc) | 1177 | int inc) |
| 1165 | { | 1178 | { |
| 1166 | } | 1179 | } |
| @@ -1247,24 +1260,24 @@ static inline int sk_mem_pages(int amt) | |||
| 1247 | return (amt + SK_MEM_QUANTUM - 1) >> SK_MEM_QUANTUM_SHIFT; | 1260 | return (amt + SK_MEM_QUANTUM - 1) >> SK_MEM_QUANTUM_SHIFT; |
| 1248 | } | 1261 | } |
| 1249 | 1262 | ||
| 1250 | static inline int sk_has_account(struct sock *sk) | 1263 | static inline bool sk_has_account(struct sock *sk) |
| 1251 | { | 1264 | { |
| 1252 | /* return true if protocol supports memory accounting */ | 1265 | /* return true if protocol supports memory accounting */ |
| 1253 | return !!sk->sk_prot->memory_allocated; | 1266 | return !!sk->sk_prot->memory_allocated; |
| 1254 | } | 1267 | } |
| 1255 | 1268 | ||
| 1256 | static inline int sk_wmem_schedule(struct sock *sk, int size) | 1269 | static inline bool sk_wmem_schedule(struct sock *sk, int size) |
| 1257 | { | 1270 | { |
| 1258 | if (!sk_has_account(sk)) | 1271 | if (!sk_has_account(sk)) |
| 1259 | return 1; | 1272 | return true; |
| 1260 | return size <= sk->sk_forward_alloc || | 1273 | return size <= sk->sk_forward_alloc || |
| 1261 | __sk_mem_schedule(sk, size, SK_MEM_SEND); | 1274 | __sk_mem_schedule(sk, size, SK_MEM_SEND); |
| 1262 | } | 1275 | } |
| 1263 | 1276 | ||
| 1264 | static inline int sk_rmem_schedule(struct sock *sk, int size) | 1277 | static inline bool sk_rmem_schedule(struct sock *sk, int size) |
| 1265 | { | 1278 | { |
| 1266 | if (!sk_has_account(sk)) | 1279 | if (!sk_has_account(sk)) |
| 1267 | return 1; | 1280 | return true; |
| 1268 | return size <= sk->sk_forward_alloc || | 1281 | return size <= sk->sk_forward_alloc || |
| 1269 | __sk_mem_schedule(sk, size, SK_MEM_RECV); | 1282 | __sk_mem_schedule(sk, size, SK_MEM_RECV); |
| 1270 | } | 1283 | } |
| @@ -1329,7 +1342,7 @@ static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) | |||
| 1329 | * Mark both the sk_lock and the sk_lock.slock as a | 1342 | * Mark both the sk_lock and the sk_lock.slock as a |
| 1330 | * per-address-family lock class. | 1343 | * per-address-family lock class. |
| 1331 | */ | 1344 | */ |
| 1332 | #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ | 1345 | #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ |
| 1333 | do { \ | 1346 | do { \ |
| 1334 | sk->sk_lock.owned = 0; \ | 1347 | sk->sk_lock.owned = 0; \ |
| 1335 | init_waitqueue_head(&sk->sk_lock.wq); \ | 1348 | init_waitqueue_head(&sk->sk_lock.wq); \ |
| @@ -1337,7 +1350,7 @@ do { \ | |||
| 1337 | debug_check_no_locks_freed((void *)&(sk)->sk_lock, \ | 1350 | debug_check_no_locks_freed((void *)&(sk)->sk_lock, \ |
| 1338 | sizeof((sk)->sk_lock)); \ | 1351 | sizeof((sk)->sk_lock)); \ |
| 1339 | lockdep_set_class_and_name(&(sk)->sk_lock.slock, \ | 1352 | lockdep_set_class_and_name(&(sk)->sk_lock.slock, \ |
| 1340 | (skey), (sname)); \ | 1353 | (skey), (sname)); \ |
| 1341 | lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ | 1354 | lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ |
| 1342 | } while (0) | 1355 | } while (0) |
| 1343 | 1356 | ||
| @@ -1397,13 +1410,13 @@ extern int sock_setsockopt(struct socket *sock, int level, | |||
| 1397 | unsigned int optlen); | 1410 | unsigned int optlen); |
| 1398 | 1411 | ||
| 1399 | extern int sock_getsockopt(struct socket *sock, int level, | 1412 | extern int sock_getsockopt(struct socket *sock, int level, |
| 1400 | int op, char __user *optval, | 1413 | int op, char __user *optval, |
| 1401 | int __user *optlen); | 1414 | int __user *optlen); |
| 1402 | extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | 1415 | extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, |
| 1403 | unsigned long size, | 1416 | unsigned long size, |
| 1404 | int noblock, | 1417 | int noblock, |
| 1405 | int *errcode); | 1418 | int *errcode); |
| 1406 | extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, | 1419 | extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, |
| 1407 | unsigned long header_len, | 1420 | unsigned long header_len, |
| 1408 | unsigned long data_len, | 1421 | unsigned long data_len, |
| 1409 | int noblock, | 1422 | int noblock, |
| @@ -1425,7 +1438,7 @@ static inline void sock_update_classid(struct sock *sk) | |||
| 1425 | * Functions to fill in entries in struct proto_ops when a protocol | 1438 | * Functions to fill in entries in struct proto_ops when a protocol |
| 1426 | * does not implement a particular function. | 1439 | * does not implement a particular function. |
| 1427 | */ | 1440 | */ |
| 1428 | extern int sock_no_bind(struct socket *, | 1441 | extern int sock_no_bind(struct socket *, |
| 1429 | struct sockaddr *, int); | 1442 | struct sockaddr *, int); |
| 1430 | extern int sock_no_connect(struct socket *, | 1443 | extern int sock_no_connect(struct socket *, |
| 1431 | struct sockaddr *, int, int); | 1444 | struct sockaddr *, int, int); |
| @@ -1454,7 +1467,7 @@ extern int sock_no_mmap(struct file *file, | |||
| 1454 | struct vm_area_struct *vma); | 1467 | struct vm_area_struct *vma); |
| 1455 | extern ssize_t sock_no_sendpage(struct socket *sock, | 1468 | extern ssize_t sock_no_sendpage(struct socket *sock, |
| 1456 | struct page *page, | 1469 | struct page *page, |
| 1457 | int offset, size_t size, | 1470 | int offset, size_t size, |
| 1458 | int flags); | 1471 | int flags); |
| 1459 | 1472 | ||
| 1460 | /* | 1473 | /* |
| @@ -1477,7 +1490,7 @@ extern void sk_common_release(struct sock *sk); | |||
| 1477 | /* | 1490 | /* |
| 1478 | * Default socket callbacks and setup code | 1491 | * Default socket callbacks and setup code |
| 1479 | */ | 1492 | */ |
| 1480 | 1493 | ||
| 1481 | /* Initialise core socket variables */ | 1494 | /* Initialise core socket variables */ |
| 1482 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1495 | extern void sock_init_data(struct socket *sock, struct sock *sk); |
| 1483 | 1496 | ||
| @@ -1677,7 +1690,7 @@ extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | |||
| 1677 | 1690 | ||
| 1678 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); | 1691 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); |
| 1679 | 1692 | ||
| 1680 | static inline int sk_can_gso(const struct sock *sk) | 1693 | static inline bool sk_can_gso(const struct sock *sk) |
| 1681 | { | 1694 | { |
| 1682 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); | 1695 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); |
| 1683 | } | 1696 | } |
| @@ -1794,7 +1807,7 @@ static inline int sk_rmem_alloc_get(const struct sock *sk) | |||
| 1794 | * | 1807 | * |
| 1795 | * Returns true if socket has write or read allocations | 1808 | * Returns true if socket has write or read allocations |
| 1796 | */ | 1809 | */ |
| 1797 | static inline int sk_has_allocations(const struct sock *sk) | 1810 | static inline bool sk_has_allocations(const struct sock *sk) |
| 1798 | { | 1811 | { |
| 1799 | return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk); | 1812 | return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk); |
| 1800 | } | 1813 | } |
| @@ -1833,9 +1846,7 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
| 1833 | */ | 1846 | */ |
| 1834 | static inline bool wq_has_sleeper(struct socket_wq *wq) | 1847 | static inline bool wq_has_sleeper(struct socket_wq *wq) |
| 1835 | { | 1848 | { |
| 1836 | 1849 | /* We need to be sure we are in sync with the | |
| 1837 | /* | ||
| 1838 | * We need to be sure we are in sync with the | ||
| 1839 | * add_wait_queue modifications to the wait queue. | 1850 | * add_wait_queue modifications to the wait queue. |
| 1840 | * | 1851 | * |
| 1841 | * This memory barrier is paired in the sock_poll_wait. | 1852 | * This memory barrier is paired in the sock_poll_wait. |
| @@ -1857,22 +1868,21 @@ static inline void sock_poll_wait(struct file *filp, | |||
| 1857 | { | 1868 | { |
| 1858 | if (!poll_does_not_wait(p) && wait_address) { | 1869 | if (!poll_does_not_wait(p) && wait_address) { |
| 1859 | poll_wait(filp, wait_address, p); | 1870 | poll_wait(filp, wait_address, p); |
| 1860 | /* | 1871 | /* We need to be sure we are in sync with the |
| 1861 | * We need to be sure we are in sync with the | ||
| 1862 | * socket flags modification. | 1872 | * socket flags modification. |
| 1863 | * | 1873 | * |
| 1864 | * This memory barrier is paired in the wq_has_sleeper. | 1874 | * This memory barrier is paired in the wq_has_sleeper. |
| 1865 | */ | 1875 | */ |
| 1866 | smp_mb(); | 1876 | smp_mb(); |
| 1867 | } | 1877 | } |
| 1868 | } | 1878 | } |
| 1869 | 1879 | ||
| 1870 | /* | 1880 | /* |
| 1871 | * Queue a received datagram if it will fit. Stream and sequenced | 1881 | * Queue a received datagram if it will fit. Stream and sequenced |
| 1872 | * protocols can't normally use this as they need to fit buffers in | 1882 | * protocols can't normally use this as they need to fit buffers in |
| 1873 | * and play with them. | 1883 | * and play with them. |
| 1874 | * | 1884 | * |
| 1875 | * Inlined as it's very short and called for pretty much every | 1885 | * Inlined as it's very short and called for pretty much every |
| 1876 | * packet ever received. | 1886 | * packet ever received. |
| 1877 | */ | 1887 | */ |
| 1878 | 1888 | ||
| @@ -1898,10 +1908,10 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
| 1898 | sk_mem_charge(sk, skb->truesize); | 1908 | sk_mem_charge(sk, skb->truesize); |
| 1899 | } | 1909 | } |
| 1900 | 1910 | ||
| 1901 | extern void sk_reset_timer(struct sock *sk, struct timer_list* timer, | 1911 | extern void sk_reset_timer(struct sock *sk, struct timer_list *timer, |
| 1902 | unsigned long expires); | 1912 | unsigned long expires); |
| 1903 | 1913 | ||
| 1904 | extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | 1914 | extern void sk_stop_timer(struct sock *sk, struct timer_list *timer); |
| 1905 | 1915 | ||
| 1906 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 1916 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
| 1907 | 1917 | ||
| @@ -1910,7 +1920,7 @@ extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); | |||
| 1910 | /* | 1920 | /* |
| 1911 | * Recover an error report and clear atomically | 1921 | * Recover an error report and clear atomically |
| 1912 | */ | 1922 | */ |
| 1913 | 1923 | ||
| 1914 | static inline int sock_error(struct sock *sk) | 1924 | static inline int sock_error(struct sock *sk) |
| 1915 | { | 1925 | { |
| 1916 | int err; | 1926 | int err; |
| @@ -1926,7 +1936,7 @@ static inline unsigned long sock_wspace(struct sock *sk) | |||
| 1926 | 1936 | ||
| 1927 | if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { | 1937 | if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { |
| 1928 | amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); | 1938 | amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); |
| 1929 | if (amt < 0) | 1939 | if (amt < 0) |
| 1930 | amt = 0; | 1940 | amt = 0; |
| 1931 | } | 1941 | } |
| 1932 | return amt; | 1942 | return amt; |
| @@ -1970,7 +1980,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk) | |||
| 1970 | /* | 1980 | /* |
| 1971 | * Default write policy as shown to user space via poll/select/SIGIO | 1981 | * Default write policy as shown to user space via poll/select/SIGIO |
| 1972 | */ | 1982 | */ |
| 1973 | static inline int sock_writeable(const struct sock *sk) | 1983 | static inline bool sock_writeable(const struct sock *sk) |
| 1974 | { | 1984 | { |
| 1975 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf >> 1); | 1985 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf >> 1); |
| 1976 | } | 1986 | } |
| @@ -1980,12 +1990,12 @@ static inline gfp_t gfp_any(void) | |||
| 1980 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1990 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; |
| 1981 | } | 1991 | } |
| 1982 | 1992 | ||
| 1983 | static inline long sock_rcvtimeo(const struct sock *sk, int noblock) | 1993 | static inline long sock_rcvtimeo(const struct sock *sk, bool noblock) |
| 1984 | { | 1994 | { |
| 1985 | return noblock ? 0 : sk->sk_rcvtimeo; | 1995 | return noblock ? 0 : sk->sk_rcvtimeo; |
| 1986 | } | 1996 | } |
| 1987 | 1997 | ||
| 1988 | static inline long sock_sndtimeo(const struct sock *sk, int noblock) | 1998 | static inline long sock_sndtimeo(const struct sock *sk, bool noblock) |
| 1989 | { | 1999 | { |
| 1990 | return noblock ? 0 : sk->sk_sndtimeo; | 2000 | return noblock ? 0 : sk->sk_sndtimeo; |
| 1991 | } | 2001 | } |
| @@ -2008,7 +2018,7 @@ extern void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, | |||
| 2008 | extern void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk, | 2018 | extern void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk, |
| 2009 | struct sk_buff *skb); | 2019 | struct sk_buff *skb); |
| 2010 | 2020 | ||
| 2011 | static __inline__ void | 2021 | static inline void |
| 2012 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 2022 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
| 2013 | { | 2023 | { |
| 2014 | ktime_t kt = skb->tstamp; | 2024 | ktime_t kt = skb->tstamp; |
| @@ -2049,7 +2059,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | |||
| 2049 | (1UL << SOCK_RCVTSTAMP) | \ | 2059 | (1UL << SOCK_RCVTSTAMP) | \ |
| 2050 | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \ | 2060 | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \ |
| 2051 | (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ | 2061 | (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ |
| 2052 | (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ | 2062 | (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ |
| 2053 | (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE)) | 2063 | (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE)) |
| 2054 | 2064 | ||
| 2055 | if (sk->sk_flags & FLAGS_TS_OR_DROPS) | 2065 | if (sk->sk_flags & FLAGS_TS_OR_DROPS) |
| @@ -2078,7 +2088,7 @@ extern int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); | |||
| 2078 | * locked so that the sk_buff queue operation is ok. | 2088 | * locked so that the sk_buff queue operation is ok. |
| 2079 | */ | 2089 | */ |
| 2080 | #ifdef CONFIG_NET_DMA | 2090 | #ifdef CONFIG_NET_DMA |
| 2081 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | 2091 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, bool copied_early) |
| 2082 | { | 2092 | { |
| 2083 | __skb_unlink(skb, &sk->sk_receive_queue); | 2093 | __skb_unlink(skb, &sk->sk_receive_queue); |
| 2084 | if (!copied_early) | 2094 | if (!copied_early) |
| @@ -2087,7 +2097,7 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e | |||
| 2087 | __skb_queue_tail(&sk->sk_async_wait_queue, skb); | 2097 | __skb_queue_tail(&sk->sk_async_wait_queue, skb); |
| 2088 | } | 2098 | } |
| 2089 | #else | 2099 | #else |
| 2090 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | 2100 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, bool copied_early) |
| 2091 | { | 2101 | { |
| 2092 | __skb_unlink(skb, &sk->sk_receive_queue); | 2102 | __skb_unlink(skb, &sk->sk_receive_queue); |
| 2093 | __kfree_skb(skb); | 2103 | __kfree_skb(skb); |
| @@ -2134,8 +2144,8 @@ extern void sock_enable_timestamp(struct sock *sk, int flag); | |||
| 2134 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 2144 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |
| 2135 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); | 2145 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); |
| 2136 | 2146 | ||
| 2137 | /* | 2147 | /* |
| 2138 | * Enable debug/info messages | 2148 | * Enable debug/info messages |
| 2139 | */ | 2149 | */ |
| 2140 | extern int net_msg_warn; | 2150 | extern int net_msg_warn; |
| 2141 | #define NETDEBUG(fmt, args...) \ | 2151 | #define NETDEBUG(fmt, args...) \ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index f75a04d752cb..e79aa48d9fc1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -123,7 +123,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 123 | #endif | 123 | #endif |
| 124 | #define TCP_RTO_MAX ((unsigned)(120*HZ)) | 124 | #define TCP_RTO_MAX ((unsigned)(120*HZ)) |
| 125 | #define TCP_RTO_MIN ((unsigned)(HZ/5)) | 125 | #define TCP_RTO_MIN ((unsigned)(HZ/5)) |
| 126 | #define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC2988bis initial RTO value */ | 126 | #define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC6298 2.1 initial RTO value */ |
| 127 | #define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now | 127 | #define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now |
| 128 | * used as a fallback RTO for the | 128 | * used as a fallback RTO for the |
| 129 | * initial data transmission if no | 129 | * initial data transmission if no |
| @@ -252,6 +252,7 @@ extern int sysctl_tcp_max_ssthresh; | |||
| 252 | extern int sysctl_tcp_cookie_size; | 252 | extern int sysctl_tcp_cookie_size; |
| 253 | extern int sysctl_tcp_thin_linear_timeouts; | 253 | extern int sysctl_tcp_thin_linear_timeouts; |
| 254 | extern int sysctl_tcp_thin_dupack; | 254 | extern int sysctl_tcp_thin_dupack; |
| 255 | extern int sysctl_tcp_early_retrans; | ||
| 255 | 256 | ||
| 256 | extern atomic_long_t tcp_memory_allocated; | 257 | extern atomic_long_t tcp_memory_allocated; |
| 257 | extern struct percpu_counter tcp_sockets_allocated; | 258 | extern struct percpu_counter tcp_sockets_allocated; |
| @@ -262,14 +263,14 @@ extern int tcp_memory_pressure; | |||
| 262 | * and worry about wraparound (automatic with unsigned arithmetic). | 263 | * and worry about wraparound (automatic with unsigned arithmetic). |
| 263 | */ | 264 | */ |
| 264 | 265 | ||
| 265 | static inline int before(__u32 seq1, __u32 seq2) | 266 | static inline bool before(__u32 seq1, __u32 seq2) |
| 266 | { | 267 | { |
| 267 | return (__s32)(seq1-seq2) < 0; | 268 | return (__s32)(seq1-seq2) < 0; |
| 268 | } | 269 | } |
| 269 | #define after(seq2, seq1) before(seq1, seq2) | 270 | #define after(seq2, seq1) before(seq1, seq2) |
| 270 | 271 | ||
| 271 | /* is s2<=s1<=s3 ? */ | 272 | /* is s2<=s1<=s3 ? */ |
| 272 | static inline int between(__u32 seq1, __u32 seq2, __u32 seq3) | 273 | static inline bool between(__u32 seq1, __u32 seq2, __u32 seq3) |
| 273 | { | 274 | { |
| 274 | return seq3 - seq2 >= seq1 - seq2; | 275 | return seq3 - seq2 >= seq1 - seq2; |
| 275 | } | 276 | } |
| @@ -304,7 +305,7 @@ static inline void tcp_synq_overflow(struct sock *sk) | |||
| 304 | } | 305 | } |
| 305 | 306 | ||
| 306 | /* syncookies: no recent synqueue overflow on this listening socket? */ | 307 | /* syncookies: no recent synqueue overflow on this listening socket? */ |
| 307 | static inline int tcp_synq_no_recent_overflow(const struct sock *sk) | 308 | static inline bool tcp_synq_no_recent_overflow(const struct sock *sk) |
| 308 | { | 309 | { |
| 309 | unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; | 310 | unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; |
| 310 | return time_after(jiffies, last_overflow + TCP_TIMEOUT_FALLBACK); | 311 | return time_after(jiffies, last_overflow + TCP_TIMEOUT_FALLBACK); |
| @@ -366,13 +367,6 @@ static inline void tcp_dec_quickack_mode(struct sock *sk, | |||
| 366 | #define TCP_ECN_DEMAND_CWR 4 | 367 | #define TCP_ECN_DEMAND_CWR 4 |
| 367 | #define TCP_ECN_SEEN 8 | 368 | #define TCP_ECN_SEEN 8 |
| 368 | 369 | ||
| 369 | static __inline__ void | ||
| 370 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) | ||
| 371 | { | ||
| 372 | if (sysctl_tcp_ecn && th->ece && th->cwr) | ||
| 373 | inet_rsk(req)->ecn_ok = 1; | ||
| 374 | } | ||
| 375 | |||
| 376 | enum tcp_tw_status { | 370 | enum tcp_tw_status { |
| 377 | TCP_TW_SUCCESS = 0, | 371 | TCP_TW_SUCCESS = 0, |
| 378 | TCP_TW_RST = 1, | 372 | TCP_TW_RST = 1, |
| @@ -389,12 +383,13 @@ extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | |||
| 389 | struct request_sock **prev); | 383 | struct request_sock **prev); |
| 390 | extern int tcp_child_process(struct sock *parent, struct sock *child, | 384 | extern int tcp_child_process(struct sock *parent, struct sock *child, |
| 391 | struct sk_buff *skb); | 385 | struct sk_buff *skb); |
| 392 | extern int tcp_use_frto(struct sock *sk); | 386 | extern bool tcp_use_frto(struct sock *sk); |
| 393 | extern void tcp_enter_frto(struct sock *sk); | 387 | extern void tcp_enter_frto(struct sock *sk); |
| 394 | extern void tcp_enter_loss(struct sock *sk, int how); | 388 | extern void tcp_enter_loss(struct sock *sk, int how); |
| 395 | extern void tcp_clear_retrans(struct tcp_sock *tp); | 389 | extern void tcp_clear_retrans(struct tcp_sock *tp); |
| 396 | extern void tcp_update_metrics(struct sock *sk); | 390 | extern void tcp_update_metrics(struct sock *sk); |
| 397 | extern void tcp_close(struct sock *sk, long timeout); | 391 | extern void tcp_close(struct sock *sk, long timeout); |
| 392 | extern void tcp_init_sock(struct sock *sk); | ||
| 398 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, | 393 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, |
| 399 | struct poll_table_struct *wait); | 394 | struct poll_table_struct *wait); |
| 400 | extern int tcp_getsockopt(struct sock *sk, int level, int optname, | 395 | extern int tcp_getsockopt(struct sock *sk, int level, int optname, |
| @@ -435,6 +430,9 @@ extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 435 | struct request_values *rvp); | 430 | struct request_values *rvp); |
| 436 | extern int tcp_disconnect(struct sock *sk, int flags); | 431 | extern int tcp_disconnect(struct sock *sk, int flags); |
| 437 | 432 | ||
| 433 | void tcp_connect_init(struct sock *sk); | ||
| 434 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); | ||
| 435 | int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); | ||
| 438 | 436 | ||
| 439 | /* From syncookies.c */ | 437 | /* From syncookies.c */ |
| 440 | extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; | 438 | extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; |
| @@ -472,7 +470,7 @@ static inline __u32 cookie_v6_init_sequence(struct sock *sk, | |||
| 472 | 470 | ||
| 473 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, | 471 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, |
| 474 | int nonagle); | 472 | int nonagle); |
| 475 | extern int tcp_may_send_now(struct sock *sk); | 473 | extern bool tcp_may_send_now(struct sock *sk); |
| 476 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 474 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
| 477 | extern void tcp_retransmit_timer(struct sock *sk); | 475 | extern void tcp_retransmit_timer(struct sock *sk); |
| 478 | extern void tcp_xmit_retransmit_queue(struct sock *); | 476 | extern void tcp_xmit_retransmit_queue(struct sock *); |
| @@ -486,15 +484,17 @@ extern int tcp_write_wakeup(struct sock *); | |||
| 486 | extern void tcp_send_fin(struct sock *sk); | 484 | extern void tcp_send_fin(struct sock *sk); |
| 487 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); | 485 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); |
| 488 | extern int tcp_send_synack(struct sock *); | 486 | extern int tcp_send_synack(struct sock *); |
| 489 | extern int tcp_syn_flood_action(struct sock *sk, | 487 | extern bool tcp_syn_flood_action(struct sock *sk, |
| 490 | const struct sk_buff *skb, | 488 | const struct sk_buff *skb, |
| 491 | const char *proto); | 489 | const char *proto); |
| 492 | extern void tcp_push_one(struct sock *, unsigned int mss_now); | 490 | extern void tcp_push_one(struct sock *, unsigned int mss_now); |
| 493 | extern void tcp_send_ack(struct sock *sk); | 491 | extern void tcp_send_ack(struct sock *sk); |
| 494 | extern void tcp_send_delayed_ack(struct sock *sk); | 492 | extern void tcp_send_delayed_ack(struct sock *sk); |
| 495 | 493 | ||
| 496 | /* tcp_input.c */ | 494 | /* tcp_input.c */ |
| 497 | extern void tcp_cwnd_application_limited(struct sock *sk); | 495 | extern void tcp_cwnd_application_limited(struct sock *sk); |
| 496 | extern void tcp_resume_early_retransmit(struct sock *sk); | ||
| 497 | extern void tcp_rearm_rto(struct sock *sk); | ||
| 498 | 498 | ||
| 499 | /* tcp_timer.c */ | 499 | /* tcp_timer.c */ |
| 500 | extern void tcp_init_xmit_timers(struct sock *); | 500 | extern void tcp_init_xmit_timers(struct sock *); |
| @@ -540,8 +540,8 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
| 540 | 540 | ||
| 541 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 541 | extern void tcp_initialize_rcv_mss(struct sock *sk); |
| 542 | 542 | ||
| 543 | extern int tcp_mtu_to_mss(const struct sock *sk, int pmtu); | 543 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); |
| 544 | extern int tcp_mss_to_mtu(const struct sock *sk, int mss); | 544 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); |
| 545 | extern void tcp_mtup_init(struct sock *sk); | 545 | extern void tcp_mtup_init(struct sock *sk); |
| 546 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); | 546 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); |
| 547 | 547 | ||
| @@ -609,6 +609,8 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) | |||
| 609 | */ | 609 | */ |
| 610 | extern u32 __tcp_select_window(struct sock *sk); | 610 | extern u32 __tcp_select_window(struct sock *sk); |
| 611 | 611 | ||
| 612 | void tcp_send_window_probe(struct sock *sk); | ||
| 613 | |||
| 612 | /* TCP timestamps are only 32-bits, this causes a slight | 614 | /* TCP timestamps are only 32-bits, this causes a slight |
| 613 | * complication on 64-bit systems since we store a snapshot | 615 | * complication on 64-bit systems since we store a snapshot |
| 614 | * of jiffies in the buffer control blocks below. We decided | 616 | * of jiffies in the buffer control blocks below. We decided |
| @@ -645,21 +647,38 @@ struct tcp_skb_cb { | |||
| 645 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ | 647 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ |
| 646 | __u32 when; /* used to compute rtt's */ | 648 | __u32 when; /* used to compute rtt's */ |
| 647 | __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ | 649 | __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ |
| 650 | |||
| 648 | __u8 sacked; /* State flags for SACK/FACK. */ | 651 | __u8 sacked; /* State flags for SACK/FACK. */ |
| 649 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ | 652 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ |
| 650 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ | 653 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ |
| 651 | #define TCPCB_LOST 0x04 /* SKB is lost */ | 654 | #define TCPCB_LOST 0x04 /* SKB is lost */ |
| 652 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ | 655 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ |
| 653 | __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ | ||
| 654 | /* 1 byte hole */ | ||
| 655 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ | 656 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ |
| 656 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) | 657 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) |
| 657 | 658 | ||
| 659 | __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ | ||
| 660 | /* 1 byte hole */ | ||
| 658 | __u32 ack_seq; /* Sequence number ACK'd */ | 661 | __u32 ack_seq; /* Sequence number ACK'd */ |
| 659 | }; | 662 | }; |
| 660 | 663 | ||
| 661 | #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0])) | 664 | #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0])) |
| 662 | 665 | ||
| 666 | /* RFC3168 : 6.1.1 SYN packets must not have ECT/ECN bits set | ||
| 667 | * | ||
| 668 | * If we receive a SYN packet with these bits set, it means a network is | ||
| 669 | * playing bad games with TOS bits. In order to avoid possible false congestion | ||
| 670 | * notifications, we disable TCP ECN negociation. | ||
| 671 | */ | ||
| 672 | static inline void | ||
| 673 | TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb) | ||
| 674 | { | ||
| 675 | const struct tcphdr *th = tcp_hdr(skb); | ||
| 676 | |||
| 677 | if (sysctl_tcp_ecn && th->ece && th->cwr && | ||
| 678 | INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) | ||
| 679 | inet_rsk(req)->ecn_ok = 1; | ||
| 680 | } | ||
| 681 | |||
| 663 | /* Due to TSO, an SKB can be composed of multiple actual | 682 | /* Due to TSO, an SKB can be composed of multiple actual |
| 664 | * packets. To keep these tracked properly, we use this. | 683 | * packets. To keep these tracked properly, we use this. |
| 665 | */ | 684 | */ |
| @@ -775,12 +794,12 @@ static inline int tcp_is_sack(const struct tcp_sock *tp) | |||
| 775 | return tp->rx_opt.sack_ok; | 794 | return tp->rx_opt.sack_ok; |
| 776 | } | 795 | } |
| 777 | 796 | ||
| 778 | static inline int tcp_is_reno(const struct tcp_sock *tp) | 797 | static inline bool tcp_is_reno(const struct tcp_sock *tp) |
| 779 | { | 798 | { |
| 780 | return !tcp_is_sack(tp); | 799 | return !tcp_is_sack(tp); |
| 781 | } | 800 | } |
| 782 | 801 | ||
| 783 | static inline int tcp_is_fack(const struct tcp_sock *tp) | 802 | static inline bool tcp_is_fack(const struct tcp_sock *tp) |
| 784 | { | 803 | { |
| 785 | return tp->rx_opt.sack_ok & TCP_FACK_ENABLED; | 804 | return tp->rx_opt.sack_ok & TCP_FACK_ENABLED; |
| 786 | } | 805 | } |
| @@ -790,6 +809,21 @@ static inline void tcp_enable_fack(struct tcp_sock *tp) | |||
| 790 | tp->rx_opt.sack_ok |= TCP_FACK_ENABLED; | 809 | tp->rx_opt.sack_ok |= TCP_FACK_ENABLED; |
| 791 | } | 810 | } |
| 792 | 811 | ||
| 812 | /* TCP early-retransmit (ER) is similar to but more conservative than | ||
| 813 | * the thin-dupack feature. Enable ER only if thin-dupack is disabled. | ||
| 814 | */ | ||
| 815 | static inline void tcp_enable_early_retrans(struct tcp_sock *tp) | ||
| 816 | { | ||
| 817 | tp->do_early_retrans = sysctl_tcp_early_retrans && | ||
| 818 | !sysctl_tcp_thin_dupack && sysctl_tcp_reordering == 3; | ||
| 819 | tp->early_retrans_delayed = 0; | ||
| 820 | } | ||
| 821 | |||
| 822 | static inline void tcp_disable_early_retrans(struct tcp_sock *tp) | ||
| 823 | { | ||
| 824 | tp->do_early_retrans = 0; | ||
| 825 | } | ||
| 826 | |||
| 793 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) | 827 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) |
| 794 | { | 828 | { |
| 795 | return tp->sacked_out + tp->lost_out; | 829 | return tp->sacked_out + tp->lost_out; |
| @@ -867,7 +901,7 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp) | |||
| 867 | { | 901 | { |
| 868 | return tp->snd_una + tp->snd_wnd; | 902 | return tp->snd_una + tp->snd_wnd; |
| 869 | } | 903 | } |
| 870 | extern int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); | 904 | extern bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); |
| 871 | 905 | ||
| 872 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, | 906 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, |
| 873 | const struct sk_buff *skb) | 907 | const struct sk_buff *skb) |
| @@ -910,7 +944,7 @@ static inline __sum16 __tcp_checksum_complete(struct sk_buff *skb) | |||
| 910 | return __skb_checksum_complete(skb); | 944 | return __skb_checksum_complete(skb); |
| 911 | } | 945 | } |
| 912 | 946 | ||
| 913 | static inline int tcp_checksum_complete(struct sk_buff *skb) | 947 | static inline bool tcp_checksum_complete(struct sk_buff *skb) |
| 914 | { | 948 | { |
| 915 | return !skb_csum_unnecessary(skb) && | 949 | return !skb_csum_unnecessary(skb) && |
| 916 | __tcp_checksum_complete(skb); | 950 | __tcp_checksum_complete(skb); |
| @@ -940,12 +974,12 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) | |||
| 940 | * | 974 | * |
| 941 | * NOTE: is this not too big to inline? | 975 | * NOTE: is this not too big to inline? |
| 942 | */ | 976 | */ |
| 943 | static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | 977 | static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb) |
| 944 | { | 978 | { |
| 945 | struct tcp_sock *tp = tcp_sk(sk); | 979 | struct tcp_sock *tp = tcp_sk(sk); |
| 946 | 980 | ||
| 947 | if (sysctl_tcp_low_latency || !tp->ucopy.task) | 981 | if (sysctl_tcp_low_latency || !tp->ucopy.task) |
| 948 | return 0; | 982 | return false; |
| 949 | 983 | ||
| 950 | __skb_queue_tail(&tp->ucopy.prequeue, skb); | 984 | __skb_queue_tail(&tp->ucopy.prequeue, skb); |
| 951 | tp->ucopy.memory += skb->truesize; | 985 | tp->ucopy.memory += skb->truesize; |
| @@ -969,7 +1003,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
| 969 | (3 * tcp_rto_min(sk)) / 4, | 1003 | (3 * tcp_rto_min(sk)) / 4, |
| 970 | TCP_RTO_MAX); | 1004 | TCP_RTO_MAX); |
| 971 | } | 1005 | } |
| 972 | return 1; | 1006 | return true; |
| 973 | } | 1007 | } |
| 974 | 1008 | ||
| 975 | 1009 | ||
| @@ -1074,28 +1108,28 @@ static inline int tcp_fin_time(const struct sock *sk) | |||
| 1074 | return fin_timeout; | 1108 | return fin_timeout; |
| 1075 | } | 1109 | } |
| 1076 | 1110 | ||
| 1077 | static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | 1111 | static inline bool tcp_paws_check(const struct tcp_options_received *rx_opt, |
| 1078 | int paws_win) | 1112 | int paws_win) |
| 1079 | { | 1113 | { |
| 1080 | if ((s32)(rx_opt->ts_recent - rx_opt->rcv_tsval) <= paws_win) | 1114 | if ((s32)(rx_opt->ts_recent - rx_opt->rcv_tsval) <= paws_win) |
| 1081 | return 1; | 1115 | return true; |
| 1082 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1116 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
| 1083 | return 1; | 1117 | return true; |
| 1084 | /* | 1118 | /* |
| 1085 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | 1119 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, |
| 1086 | * then following tcp messages have valid values. Ignore 0 value, | 1120 | * then following tcp messages have valid values. Ignore 0 value, |
| 1087 | * or else 'negative' tsval might forbid us to accept their packets. | 1121 | * or else 'negative' tsval might forbid us to accept their packets. |
| 1088 | */ | 1122 | */ |
| 1089 | if (!rx_opt->ts_recent) | 1123 | if (!rx_opt->ts_recent) |
| 1090 | return 1; | 1124 | return true; |
| 1091 | return 0; | 1125 | return false; |
| 1092 | } | 1126 | } |
| 1093 | 1127 | ||
| 1094 | static inline int tcp_paws_reject(const struct tcp_options_received *rx_opt, | 1128 | static inline bool tcp_paws_reject(const struct tcp_options_received *rx_opt, |
| 1095 | int rst) | 1129 | int rst) |
| 1096 | { | 1130 | { |
| 1097 | if (tcp_paws_check(rx_opt, 0)) | 1131 | if (tcp_paws_check(rx_opt, 0)) |
| 1098 | return 0; | 1132 | return false; |
| 1099 | 1133 | ||
| 1100 | /* RST segments are not recommended to carry timestamp, | 1134 | /* RST segments are not recommended to carry timestamp, |
| 1101 | and, if they do, it is recommended to ignore PAWS because | 1135 | and, if they do, it is recommended to ignore PAWS because |
| @@ -1110,8 +1144,8 @@ static inline int tcp_paws_reject(const struct tcp_options_received *rx_opt, | |||
| 1110 | However, we can relax time bounds for RST segments to MSL. | 1144 | However, we can relax time bounds for RST segments to MSL. |
| 1111 | */ | 1145 | */ |
| 1112 | if (rst && get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_MSL) | 1146 | if (rst && get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_MSL) |
| 1113 | return 0; | 1147 | return false; |
| 1114 | return 1; | 1148 | return true; |
| 1115 | } | 1149 | } |
| 1116 | 1150 | ||
| 1117 | static inline void tcp_mib_init(struct net *net) | 1151 | static inline void tcp_mib_init(struct net *net) |
| @@ -1226,7 +1260,7 @@ extern void tcp_put_md5sig_pool(void); | |||
| 1226 | 1260 | ||
| 1227 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); | 1261 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); |
| 1228 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, | 1262 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, |
| 1229 | unsigned header_len); | 1263 | unsigned int header_len); |
| 1230 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1264 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
| 1231 | const struct tcp_md5sig_key *key); | 1265 | const struct tcp_md5sig_key *key); |
| 1232 | 1266 | ||
| @@ -1349,7 +1383,7 @@ static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk) | |||
| 1349 | __skb_unlink(skb, &sk->sk_write_queue); | 1383 | __skb_unlink(skb, &sk->sk_write_queue); |
| 1350 | } | 1384 | } |
| 1351 | 1385 | ||
| 1352 | static inline int tcp_write_queue_empty(struct sock *sk) | 1386 | static inline bool tcp_write_queue_empty(struct sock *sk) |
| 1353 | { | 1387 | { |
| 1354 | return skb_queue_empty(&sk->sk_write_queue); | 1388 | return skb_queue_empty(&sk->sk_write_queue); |
| 1355 | } | 1389 | } |
| @@ -1406,7 +1440,7 @@ static inline void tcp_highest_sack_combine(struct sock *sk, | |||
| 1406 | /* Determines whether this is a thin stream (which may suffer from | 1440 | /* Determines whether this is a thin stream (which may suffer from |
| 1407 | * increased latency). Used to trigger latency-reducing mechanisms. | 1441 | * increased latency). Used to trigger latency-reducing mechanisms. |
| 1408 | */ | 1442 | */ |
| 1409 | static inline unsigned int tcp_stream_is_thin(struct tcp_sock *tp) | 1443 | static inline bool tcp_stream_is_thin(struct tcp_sock *tp) |
| 1410 | { | 1444 | { |
| 1411 | return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp); | 1445 | return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp); |
| 1412 | } | 1446 | } |
diff --git a/include/net/udp.h b/include/net/udp.h index 5d606d9da9e5..065f379c6503 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -81,7 +81,7 @@ struct udp_table { | |||
| 81 | extern struct udp_table udp_table; | 81 | extern struct udp_table udp_table; |
| 82 | extern void udp_table_init(struct udp_table *, const char *); | 82 | extern void udp_table_init(struct udp_table *, const char *); |
| 83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, | 83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, |
| 84 | struct net *net, unsigned num) | 84 | struct net *net, unsigned int num) |
| 85 | { | 85 | { |
| 86 | return &table->hash[udp_hashfn(net, num, table->mask)]; | 86 | return &table->hash[udp_hashfn(net, num, table->mask)]; |
| 87 | } | 87 | } |
| @@ -267,4 +267,8 @@ extern void udp_init(void); | |||
| 267 | extern int udp4_ufo_send_check(struct sk_buff *skb); | 267 | extern int udp4_ufo_send_check(struct sk_buff *skb); |
| 268 | extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, | 268 | extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, |
| 269 | netdev_features_t features); | 269 | netdev_features_t features); |
| 270 | extern void udp_encap_enable(void); | ||
| 271 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 272 | extern void udpv6_encap_enable(void); | ||
| 273 | #endif | ||
| 270 | #endif /* _UDP_H */ | 274 | #endif /* _UDP_H */ |
diff --git a/include/net/wimax.h b/include/net/wimax.h index 322ff4fbdb4a..bbb74f990cab 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
| @@ -423,8 +423,8 @@ struct wimax_dev { | |||
| 423 | int (*op_reset)(struct wimax_dev *wimax_dev); | 423 | int (*op_reset)(struct wimax_dev *wimax_dev); |
| 424 | 424 | ||
| 425 | struct rfkill *rfkill; | 425 | struct rfkill *rfkill; |
| 426 | unsigned rf_hw; | 426 | unsigned int rf_hw; |
| 427 | unsigned rf_sw; | 427 | unsigned int rf_sw; |
| 428 | char name[32]; | 428 | char name[32]; |
| 429 | 429 | ||
| 430 | struct dentry *debugfs_dentry; | 430 | struct dentry *debugfs_dentry; |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index ff27f1b078d1..b52bda8d13b1 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
| @@ -25,6 +25,14 @@ | |||
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/bug.h> | 26 | #include <linux/bug.h> |
| 27 | 27 | ||
| 28 | /* According to the IEEE 802.15.4 stadard the upper most significant bits of | ||
| 29 | * the 32-bit channel bitmaps shall be used as an integer value to specify 32 | ||
| 30 | * possible channel pages. The lower 27 bits of the channel bit map shall be | ||
| 31 | * used as a bit mask to specify channel numbers within a channel page. | ||
| 32 | */ | ||
| 33 | #define WPAN_NUM_CHANNELS 27 | ||
| 34 | #define WPAN_NUM_PAGES 32 | ||
| 35 | |||
| 28 | struct wpan_phy { | 36 | struct wpan_phy { |
| 29 | struct mutex pib_lock; | 37 | struct mutex pib_lock; |
| 30 | 38 | ||
| @@ -43,7 +51,7 @@ struct wpan_phy { | |||
| 43 | int idx; | 51 | int idx; |
| 44 | 52 | ||
| 45 | struct net_device *(*add_iface)(struct wpan_phy *phy, | 53 | struct net_device *(*add_iface)(struct wpan_phy *phy, |
| 46 | const char *name); | 54 | const char *name, int type); |
| 47 | void (*del_iface)(struct wpan_phy *phy, struct net_device *dev); | 55 | void (*del_iface)(struct wpan_phy *phy, struct net_device *dev); |
| 48 | 56 | ||
| 49 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 57 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
diff --git a/include/net/x25.h b/include/net/x25.h index a06119a05129..b4a8a8923128 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
| @@ -305,7 +305,7 @@ static inline void x25_unregister_sysctl(void) {}; | |||
| 305 | #endif /* CONFIG_SYSCTL */ | 305 | #endif /* CONFIG_SYSCTL */ |
| 306 | 306 | ||
| 307 | struct x25_skb_cb { | 307 | struct x25_skb_cb { |
| 308 | unsigned flags; | 308 | unsigned int flags; |
| 309 | }; | 309 | }; |
| 310 | #define X25_SKB_CB(s) ((struct x25_skb_cb *) ((s)->cb)) | 310 | #define X25_SKB_CB(s) ((struct x25_skb_cb *) ((s)->cb)) |
| 311 | 311 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 96239e78e621..e0a55df5bde8 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -886,15 +886,15 @@ __be16 xfrm_flowi_dport(const struct flowi *fl, const union flowi_uli *uli) | |||
| 886 | return port; | 886 | return port; |
| 887 | } | 887 | } |
| 888 | 888 | ||
| 889 | extern int xfrm_selector_match(const struct xfrm_selector *sel, | 889 | extern bool xfrm_selector_match(const struct xfrm_selector *sel, |
| 890 | const struct flowi *fl, | 890 | const struct flowi *fl, |
| 891 | unsigned short family); | 891 | unsigned short family); |
| 892 | 892 | ||
| 893 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 893 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 894 | /* If neither has a context --> match | 894 | /* If neither has a context --> match |
| 895 | * Otherwise, both must have a context and the sids, doi, alg must match | 895 | * Otherwise, both must have a context and the sids, doi, alg must match |
| 896 | */ | 896 | */ |
| 897 | static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) | 897 | static inline bool xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) |
| 898 | { | 898 | { |
| 899 | return ((!s1 && !s2) || | 899 | return ((!s1 && !s2) || |
| 900 | (s1 && s2 && | 900 | (s1 && s2 && |
| @@ -903,9 +903,9 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct | |||
| 903 | (s1->ctx_alg == s2->ctx_alg))); | 903 | (s1->ctx_alg == s2->ctx_alg))); |
| 904 | } | 904 | } |
| 905 | #else | 905 | #else |
| 906 | static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) | 906 | static inline bool xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) |
| 907 | { | 907 | { |
| 908 | return 1; | 908 | return true; |
| 909 | } | 909 | } |
| 910 | #endif | 910 | #endif |
| 911 | 911 | ||
| @@ -1682,8 +1682,9 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) | |||
| 1682 | 1682 | ||
| 1683 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) | 1683 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) |
| 1684 | { | 1684 | { |
| 1685 | if (m->m | m->v) | 1685 | if ((m->m | m->v) && |
| 1686 | NLA_PUT(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m); | 1686 | nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m)) |
| 1687 | goto nla_put_failure; | ||
| 1687 | return 0; | 1688 | return 0; |
| 1688 | 1689 | ||
| 1689 | nla_put_failure: | 1690 | nla_put_failure: |
