diff options
Diffstat (limited to 'include')
75 files changed, 1198 insertions, 607 deletions
diff --git a/include/linux/can.h b/include/linux/can.h index 9a19bcb3eeaf..1a66cf6112ae 100644 --- a/include/linux/can.h +++ b/include/linux/can.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /* special address description flags for the CAN_ID */ | 21 | /* special address description flags for the CAN_ID */ |
22 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ | 22 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ |
23 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ | 23 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ |
24 | #define CAN_ERR_FLAG 0x20000000U /* error frame */ | 24 | #define CAN_ERR_FLAG 0x20000000U /* error message frame */ |
25 | 25 | ||
26 | /* valid bits in CAN ID for frame formats */ | 26 | /* valid bits in CAN ID for frame formats */ |
27 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ | 27 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ |
@@ -32,32 +32,81 @@ | |||
32 | * Controller Area Network Identifier structure | 32 | * Controller Area Network Identifier structure |
33 | * | 33 | * |
34 | * bit 0-28 : CAN identifier (11/29 bit) | 34 | * bit 0-28 : CAN identifier (11/29 bit) |
35 | * bit 29 : error frame flag (0 = data frame, 1 = error frame) | 35 | * bit 29 : error message frame flag (0 = data frame, 1 = error message) |
36 | * bit 30 : remote transmission request flag (1 = rtr frame) | 36 | * bit 30 : remote transmission request flag (1 = rtr frame) |
37 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) | 37 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) |
38 | */ | 38 | */ |
39 | typedef __u32 canid_t; | 39 | typedef __u32 canid_t; |
40 | 40 | ||
41 | /* | 41 | /* |
42 | * Controller Area Network Error Frame Mask structure | 42 | * Controller Area Network Error Message Frame Mask structure |
43 | * | 43 | * |
44 | * bit 0-28 : error class mask (see include/linux/can/error.h) | 44 | * bit 0-28 : error class mask (see include/linux/can/error.h) |
45 | * bit 29-31 : set to zero | 45 | * bit 29-31 : set to zero |
46 | */ | 46 | */ |
47 | typedef __u32 can_err_mask_t; | 47 | typedef __u32 can_err_mask_t; |
48 | 48 | ||
49 | /* CAN payload length and DLC definitions according to ISO 11898-1 */ | ||
50 | #define CAN_MAX_DLC 8 | ||
51 | #define CAN_MAX_DLEN 8 | ||
52 | |||
53 | /* CAN FD payload length and DLC definitions according to ISO 11898-7 */ | ||
54 | #define CANFD_MAX_DLC 15 | ||
55 | #define CANFD_MAX_DLEN 64 | ||
56 | |||
49 | /** | 57 | /** |
50 | * struct can_frame - basic CAN frame structure | 58 | * struct can_frame - basic CAN frame structure |
51 | * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above. | 59 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition |
52 | * @can_dlc: the data length field of the CAN frame | 60 | * @can_dlc: frame payload length in byte (0 .. 8) aka data length code |
53 | * @data: the CAN frame payload. | 61 | * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1 |
62 | * mapping of the 'data length code' to the real payload length | ||
63 | * @data: CAN frame payload (up to 8 byte) | ||
54 | */ | 64 | */ |
55 | struct can_frame { | 65 | struct can_frame { |
56 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | 66 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ |
57 | __u8 can_dlc; /* data length code: 0 .. 8 */ | 67 | __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ |
58 | __u8 data[8] __attribute__((aligned(8))); | 68 | __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8))); |
59 | }; | 69 | }; |
60 | 70 | ||
71 | /* | ||
72 | * defined bits for canfd_frame.flags | ||
73 | * | ||
74 | * As the default for CAN FD should be to support the high data rate in the | ||
75 | * payload section of the frame (HDR) and to support up to 64 byte in the | ||
76 | * data section (EDL) the bits are only set in the non-default case. | ||
77 | * Btw. as long as there's no real implementation for CAN FD network driver | ||
78 | * these bits are only preliminary. | ||
79 | * | ||
80 | * RX: NOHDR/NOEDL - info about received CAN FD frame | ||
81 | * ESI - bit from originating CAN controller | ||
82 | * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller | ||
83 | * ESI - bit is set by local CAN controller | ||
84 | */ | ||
85 | #define CANFD_NOHDR 0x01 /* frame without high data rate */ | ||
86 | #define CANFD_NOEDL 0x02 /* frame without extended data length */ | ||
87 | #define CANFD_ESI 0x04 /* error state indicator */ | ||
88 | |||
89 | /** | ||
90 | * struct canfd_frame - CAN flexible data rate frame structure | ||
91 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition | ||
92 | * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN) | ||
93 | * @flags: additional flags for CAN FD | ||
94 | * @__res0: reserved / padding | ||
95 | * @__res1: reserved / padding | ||
96 | * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte) | ||
97 | */ | ||
98 | struct canfd_frame { | ||
99 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | ||
100 | __u8 len; /* frame payload length in byte */ | ||
101 | __u8 flags; /* additional flags for CAN FD */ | ||
102 | __u8 __res0; /* reserved / padding */ | ||
103 | __u8 __res1; /* reserved / padding */ | ||
104 | __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8))); | ||
105 | }; | ||
106 | |||
107 | #define CAN_MTU (sizeof(struct can_frame)) | ||
108 | #define CANFD_MTU (sizeof(struct canfd_frame)) | ||
109 | |||
61 | /* particular protocols of the protocol family PF_CAN */ | 110 | /* particular protocols of the protocol family PF_CAN */ |
62 | #define CAN_RAW 1 /* RAW sockets */ | 111 | #define CAN_RAW 1 /* RAW sockets */ |
63 | #define CAN_BCM 2 /* Broadcast Manager */ | 112 | #define CAN_BCM 2 /* Broadcast Manager */ |
@@ -97,7 +146,7 @@ struct sockaddr_can { | |||
97 | * <received_can_id> & mask == can_id & mask | 146 | * <received_can_id> & mask == can_id & mask |
98 | * | 147 | * |
99 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can | 148 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can |
100 | * filter for error frames (CAN_ERR_FLAG bit set in mask). | 149 | * filter for error message frames (CAN_ERR_FLAG bit set in mask). |
101 | */ | 150 | */ |
102 | struct can_filter { | 151 | struct can_filter { |
103 | canid_t can_id; | 152 | canid_t can_id; |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 0ccc1cd28b95..78c6c52073ad 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
@@ -17,10 +17,10 @@ | |||
17 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
18 | #include <linux/netdevice.h> | 18 | #include <linux/netdevice.h> |
19 | 19 | ||
20 | #define CAN_VERSION "20090105" | 20 | #define CAN_VERSION "20120528" |
21 | 21 | ||
22 | /* increment this number each time you change some user-space interface */ | 22 | /* increment this number each time you change some user-space interface */ |
23 | #define CAN_ABI_VERSION "8" | 23 | #define CAN_ABI_VERSION "9" |
24 | 24 | ||
25 | #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION | 25 | #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION |
26 | 26 | ||
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 5d2efe7e3f1b..ee5a771fb20d 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -61,23 +61,40 @@ struct can_priv { | |||
61 | * To be used in the CAN netdriver receive path to ensure conformance with | 61 | * To be used in the CAN netdriver receive path to ensure conformance with |
62 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | 62 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) |
63 | */ | 63 | */ |
64 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | 64 | #define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC)) |
65 | #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) | ||
65 | 66 | ||
66 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ | 67 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ |
67 | static inline int can_dropped_invalid_skb(struct net_device *dev, | 68 | static inline int can_dropped_invalid_skb(struct net_device *dev, |
68 | struct sk_buff *skb) | 69 | struct sk_buff *skb) |
69 | { | 70 | { |
70 | const struct can_frame *cf = (struct can_frame *)skb->data; | 71 | const struct canfd_frame *cfd = (struct canfd_frame *)skb->data; |
71 | 72 | ||
72 | if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { | 73 | if (skb->protocol == htons(ETH_P_CAN)) { |
73 | kfree_skb(skb); | 74 | if (unlikely(skb->len != CAN_MTU || |
74 | dev->stats.tx_dropped++; | 75 | cfd->len > CAN_MAX_DLEN)) |
75 | return 1; | 76 | goto inval_skb; |
76 | } | 77 | } else if (skb->protocol == htons(ETH_P_CANFD)) { |
78 | if (unlikely(skb->len != CANFD_MTU || | ||
79 | cfd->len > CANFD_MAX_DLEN)) | ||
80 | goto inval_skb; | ||
81 | } else | ||
82 | goto inval_skb; | ||
77 | 83 | ||
78 | return 0; | 84 | return 0; |
85 | |||
86 | inval_skb: | ||
87 | kfree_skb(skb); | ||
88 | dev->stats.tx_dropped++; | ||
89 | return 1; | ||
79 | } | 90 | } |
80 | 91 | ||
92 | /* get data length from can_dlc with sanitized can_dlc */ | ||
93 | u8 can_dlc2len(u8 can_dlc); | ||
94 | |||
95 | /* map the sanitized data length to an appropriate data length code */ | ||
96 | u8 can_len2dlc(u8 len); | ||
97 | |||
81 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 98 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
82 | void free_candev(struct net_device *dev); | 99 | void free_candev(struct net_device *dev); |
83 | 100 | ||
diff --git a/include/linux/can/error.h b/include/linux/can/error.h index 63e855ea6b84..7b7148bded71 100644 --- a/include/linux/can/error.h +++ b/include/linux/can/error.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/can/error.h | 2 | * linux/can/error.h |
3 | * | 3 | * |
4 | * Definitions of the CAN error frame to be filtered and passed to the user. | 4 | * Definitions of the CAN error messages to be filtered and passed to the user. |
5 | * | 5 | * |
6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> |
7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
@@ -12,7 +12,7 @@ | |||
12 | #ifndef CAN_ERROR_H | 12 | #ifndef CAN_ERROR_H |
13 | #define CAN_ERROR_H | 13 | #define CAN_ERROR_H |
14 | 14 | ||
15 | #define CAN_ERR_DLC 8 /* dlc for error frames */ | 15 | #define CAN_ERR_DLC 8 /* dlc for error message frames */ |
16 | 16 | ||
17 | /* error class (mask) in can_id */ | 17 | /* error class (mask) in can_id */ |
18 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ | 18 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ |
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h index 781f3a3701be..a814062b0719 100644 --- a/include/linux/can/raw.h +++ b/include/linux/can/raw.h | |||
@@ -23,7 +23,8 @@ enum { | |||
23 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ | 23 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ |
24 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ | 24 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ |
25 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ | 25 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ |
26 | CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */ | 26 | CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */ |
27 | CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */ | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | #endif | 30 | #endif |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index e17fa7140588..21eff418091b 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -137,6 +137,35 @@ struct ethtool_eeprom { | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * struct ethtool_eee - Energy Efficient Ethernet information | ||
141 | * @cmd: ETHTOOL_{G,S}EEE | ||
142 | * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations | ||
143 | * for which there is EEE support. | ||
144 | * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations | ||
145 | * advertised as eee capable. | ||
146 | * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex | ||
147 | * combinations advertised by the link partner as eee capable. | ||
148 | * @eee_active: Result of the eee auto negotiation. | ||
149 | * @eee_enabled: EEE configured mode (enabled/disabled). | ||
150 | * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given | ||
151 | * that eee was negotiated. | ||
152 | * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting | ||
153 | * its tx lpi (after reaching 'idle' state). Effective only when eee | ||
154 | * was negotiated and tx_lpi_enabled was set. | ||
155 | */ | ||
156 | struct ethtool_eee { | ||
157 | __u32 cmd; | ||
158 | __u32 supported; | ||
159 | __u32 advertised; | ||
160 | __u32 lp_advertised; | ||
161 | __u32 eee_active; | ||
162 | __u32 eee_enabled; | ||
163 | __u32 tx_lpi_enabled; | ||
164 | __u32 tx_lpi_timer; | ||
165 | __u32 reserved[2]; | ||
166 | }; | ||
167 | |||
168 | /** | ||
140 | * struct ethtool_modinfo - plugin module eeprom information | 169 | * struct ethtool_modinfo - plugin module eeprom information |
141 | * @cmd: %ETHTOOL_GMODULEINFO | 170 | * @cmd: %ETHTOOL_GMODULEINFO |
142 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx | 171 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx |
@@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) | |||
945 | * @get_module_info: Get the size and type of the eeprom contained within | 974 | * @get_module_info: Get the size and type of the eeprom contained within |
946 | * a plug-in module. | 975 | * a plug-in module. |
947 | * @get_module_eeprom: Get the eeprom information from the plug-in module | 976 | * @get_module_eeprom: Get the eeprom information from the plug-in module |
977 | * @get_eee: Get Energy-Efficient (EEE) supported and status. | ||
978 | * @set_eee: Set EEE status (enable/disable) as well as LPI timers. | ||
948 | * | 979 | * |
949 | * All operations are optional (i.e. the function pointer may be set | 980 | * All operations are optional (i.e. the function pointer may be set |
950 | * to %NULL) and callers must take this into account. Callers must | 981 | * to %NULL) and callers must take this into account. Callers must |
@@ -1011,6 +1042,8 @@ struct ethtool_ops { | |||
1011 | struct ethtool_modinfo *); | 1042 | struct ethtool_modinfo *); |
1012 | int (*get_module_eeprom)(struct net_device *, | 1043 | int (*get_module_eeprom)(struct net_device *, |
1013 | struct ethtool_eeprom *, u8 *); | 1044 | struct ethtool_eeprom *, u8 *); |
1045 | int (*get_eee)(struct net_device *, struct ethtool_eee *); | ||
1046 | int (*set_eee)(struct net_device *, struct ethtool_eee *); | ||
1014 | 1047 | ||
1015 | 1048 | ||
1016 | }; | 1049 | }; |
@@ -1089,6 +1122,8 @@ struct ethtool_ops { | |||
1089 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ | 1122 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ |
1090 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ | 1123 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ |
1091 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ | 1124 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ |
1125 | #define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */ | ||
1126 | #define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */ | ||
1092 | 1127 | ||
1093 | /* compatibility with older code */ | 1128 | /* compatibility with older code */ |
1094 | #define SPARC_ETH_GSET ETHTOOL_GSET | 1129 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -1118,6 +1153,10 @@ struct ethtool_ops { | |||
1118 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 1153 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
1119 | #define SUPPORTED_20000baseMLD2_Full (1 << 21) | 1154 | #define SUPPORTED_20000baseMLD2_Full (1 << 21) |
1120 | #define SUPPORTED_20000baseKR2_Full (1 << 22) | 1155 | #define SUPPORTED_20000baseKR2_Full (1 << 22) |
1156 | #define SUPPORTED_40000baseKR4_Full (1 << 23) | ||
1157 | #define SUPPORTED_40000baseCR4_Full (1 << 24) | ||
1158 | #define SUPPORTED_40000baseSR4_Full (1 << 25) | ||
1159 | #define SUPPORTED_40000baseLR4_Full (1 << 26) | ||
1121 | 1160 | ||
1122 | /* Indicates what features are advertised by the interface. */ | 1161 | /* Indicates what features are advertised by the interface. */ |
1123 | #define ADVERTISED_10baseT_Half (1 << 0) | 1162 | #define ADVERTISED_10baseT_Half (1 << 0) |
@@ -1143,6 +1182,10 @@ struct ethtool_ops { | |||
1143 | #define ADVERTISED_10000baseR_FEC (1 << 20) | 1182 | #define ADVERTISED_10000baseR_FEC (1 << 20) |
1144 | #define ADVERTISED_20000baseMLD2_Full (1 << 21) | 1183 | #define ADVERTISED_20000baseMLD2_Full (1 << 21) |
1145 | #define ADVERTISED_20000baseKR2_Full (1 << 22) | 1184 | #define ADVERTISED_20000baseKR2_Full (1 << 22) |
1185 | #define ADVERTISED_40000baseKR4_Full (1 << 23) | ||
1186 | #define ADVERTISED_40000baseCR4_Full (1 << 24) | ||
1187 | #define ADVERTISED_40000baseSR4_Full (1 << 25) | ||
1188 | #define ADVERTISED_40000baseLR4_Full (1 << 26) | ||
1146 | 1189 | ||
1147 | /* The following are all involved in forcing a particular link | 1190 | /* The following are all involved in forcing a particular link |
1148 | * mode for the device for setting things. When getting the | 1191 | * mode for the device for setting things. When getting the |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 56d907a2c804..167ce5b363d2 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -105,7 +105,8 @@ | |||
105 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ | 105 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ |
106 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ | 106 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ |
107 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ | 107 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ |
108 | #define ETH_P_CAN 0x000C /* Controller Area Network */ | 108 | #define ETH_P_CAN 0x000C /* CAN: Controller Area Network */ |
109 | #define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/ | ||
109 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ | 110 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ |
110 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ | 111 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ |
111 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ | 112 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 8185f57a9c7f..99efd60fa8c9 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -60,9 +60,11 @@ struct team_port { | |||
60 | unsigned int mtu; | 60 | unsigned int mtu; |
61 | } orig; | 61 | } orig; |
62 | 62 | ||
63 | struct rcu_head rcu; | 63 | long mode_priv[0]; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | extern bool team_port_enabled(struct team_port *port); | ||
67 | |||
66 | struct team_mode_ops { | 68 | struct team_mode_ops { |
67 | int (*init)(struct team *team); | 69 | int (*init)(struct team *team); |
68 | void (*exit)(struct team *team); | 70 | void (*exit)(struct team *team); |
@@ -73,6 +75,8 @@ struct team_mode_ops { | |||
73 | int (*port_enter)(struct team *team, struct team_port *port); | 75 | int (*port_enter)(struct team *team, struct team_port *port); |
74 | void (*port_leave)(struct team *team, struct team_port *port); | 76 | void (*port_leave)(struct team *team, struct team_port *port); |
75 | void (*port_change_mac)(struct team *team, struct team_port *port); | 77 | void (*port_change_mac)(struct team *team, struct team_port *port); |
78 | void (*port_enabled)(struct team *team, struct team_port *port); | ||
79 | void (*port_disabled)(struct team *team, struct team_port *port); | ||
76 | }; | 80 | }; |
77 | 81 | ||
78 | enum team_option_type { | 82 | enum team_option_type { |
@@ -82,6 +86,11 @@ enum team_option_type { | |||
82 | TEAM_OPTION_TYPE_BOOL, | 86 | TEAM_OPTION_TYPE_BOOL, |
83 | }; | 87 | }; |
84 | 88 | ||
89 | struct team_option_inst_info { | ||
90 | u32 array_index; | ||
91 | struct team_port *port; /* != NULL if per-port */ | ||
92 | }; | ||
93 | |||
85 | struct team_gsetter_ctx { | 94 | struct team_gsetter_ctx { |
86 | union { | 95 | union { |
87 | u32 u32_val; | 96 | u32 u32_val; |
@@ -92,23 +101,28 @@ struct team_gsetter_ctx { | |||
92 | } bin_val; | 101 | } bin_val; |
93 | bool bool_val; | 102 | bool bool_val; |
94 | } data; | 103 | } data; |
95 | struct team_port *port; | 104 | struct team_option_inst_info *info; |
96 | }; | 105 | }; |
97 | 106 | ||
98 | struct team_option { | 107 | struct team_option { |
99 | struct list_head list; | 108 | struct list_head list; |
100 | const char *name; | 109 | const char *name; |
101 | bool per_port; | 110 | bool per_port; |
111 | unsigned int array_size; /* != 0 means the option is array */ | ||
102 | enum team_option_type type; | 112 | enum team_option_type type; |
113 | int (*init)(struct team *team, struct team_option_inst_info *info); | ||
103 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); | 114 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); |
104 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); | 115 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); |
105 | }; | 116 | }; |
106 | 117 | ||
118 | extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info); | ||
119 | extern void team_options_change_check(struct team *team); | ||
120 | |||
107 | struct team_mode { | 121 | struct team_mode { |
108 | struct list_head list; | ||
109 | const char *kind; | 122 | const char *kind; |
110 | struct module *owner; | 123 | struct module *owner; |
111 | size_t priv_size; | 124 | size_t priv_size; |
125 | size_t port_priv_size; | ||
112 | const struct team_mode_ops *ops; | 126 | const struct team_mode_ops *ops; |
113 | }; | 127 | }; |
114 | 128 | ||
@@ -178,8 +192,8 @@ extern int team_options_register(struct team *team, | |||
178 | extern void team_options_unregister(struct team *team, | 192 | extern void team_options_unregister(struct team *team, |
179 | const struct team_option *option, | 193 | const struct team_option *option, |
180 | size_t option_count); | 194 | size_t option_count); |
181 | extern int team_mode_register(struct team_mode *mode); | 195 | extern int team_mode_register(const struct team_mode *mode); |
182 | extern int team_mode_unregister(struct team_mode *mode); | 196 | extern void team_mode_unregister(const struct team_mode *mode); |
183 | 197 | ||
184 | #endif /* __KERNEL__ */ | 198 | #endif /* __KERNEL__ */ |
185 | 199 | ||
@@ -241,6 +255,7 @@ enum { | |||
241 | TEAM_ATTR_OPTION_DATA, /* dynamic */ | 255 | TEAM_ATTR_OPTION_DATA, /* dynamic */ |
242 | TEAM_ATTR_OPTION_REMOVED, /* flag */ | 256 | TEAM_ATTR_OPTION_REMOVED, /* flag */ |
243 | TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ | 257 | TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ |
258 | TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */ | ||
244 | 259 | ||
245 | __TEAM_ATTR_OPTION_MAX, | 260 | __TEAM_ATTR_OPTION_MAX, |
246 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, | 261 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 597f4a9f3240..67f9ddacb70c 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -38,6 +38,7 @@ enum | |||
38 | IPV4_DEVCONF_ACCEPT_LOCAL, | 38 | IPV4_DEVCONF_ACCEPT_LOCAL, |
39 | IPV4_DEVCONF_SRC_VMARK, | 39 | IPV4_DEVCONF_SRC_VMARK, |
40 | IPV4_DEVCONF_PROXY_ARP_PVLAN, | 40 | IPV4_DEVCONF_PROXY_ARP_PVLAN, |
41 | IPV4_DEVCONF_ROUTE_LOCALNET, | ||
41 | __IPV4_DEVCONF_MAX | 42 | __IPV4_DEVCONF_MAX |
42 | }; | 43 | }; |
43 | 44 | ||
@@ -131,6 +132,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
131 | #define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ | 132 | #define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ |
132 | IN_DEV_ORCONF((in_dev), \ | 133 | IN_DEV_ORCONF((in_dev), \ |
133 | PROMOTE_SECONDARIES) | 134 | PROMOTE_SECONDARIES) |
135 | #define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET) | ||
134 | 136 | ||
135 | #define IN_DEV_RX_REDIRECTS(in_dev) \ | 137 | #define IN_DEV_RX_REDIRECTS(in_dev) \ |
136 | ((IN_DEV_FORWARD(in_dev) && \ | 138 | ((IN_DEV_FORWARD(in_dev) && \ |
diff --git a/include/linux/ks8851_mll.h b/include/linux/ks8851_mll.h new file mode 100644 index 000000000000..e9ccfb59ed30 --- /dev/null +++ b/include/linux/ks8851_mll.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * ks8861_mll platform data struct definition | ||
3 | * Copyright (c) 2012 BTicino S.p.A. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
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 Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _LINUX_KS8851_MLL_H | ||
20 | #define _LINUX_KS8851_MLL_H | ||
21 | |||
22 | #include <linux/if_ether.h> | ||
23 | |||
24 | /** | ||
25 | * struct ks8851_mll_platform_data - Platform data of the KS8851_MLL network driver | ||
26 | * @macaddr: The MAC address of the device, set to all 0:s to use the on in | ||
27 | * the chip. | ||
28 | */ | ||
29 | struct ks8851_mll_platform_data { | ||
30 | u8 mac_addr[ETH_ALEN]; | ||
31 | }; | ||
32 | |||
33 | #endif | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d94cb1431519..2c2ecea28a1b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1046,10 +1046,9 @@ struct net_device { | |||
1046 | */ | 1046 | */ |
1047 | char name[IFNAMSIZ]; | 1047 | char name[IFNAMSIZ]; |
1048 | 1048 | ||
1049 | struct pm_qos_request pm_qos_req; | 1049 | /* device name hash chain, please keep it close to name[] */ |
1050 | |||
1051 | /* device name hash chain */ | ||
1052 | struct hlist_node name_hlist; | 1050 | struct hlist_node name_hlist; |
1051 | |||
1053 | /* snmp alias */ | 1052 | /* snmp alias */ |
1054 | char *ifalias; | 1053 | char *ifalias; |
1055 | 1054 | ||
@@ -1322,6 +1321,8 @@ struct net_device { | |||
1322 | 1321 | ||
1323 | /* group the device belongs to */ | 1322 | /* group the device belongs to */ |
1324 | int group; | 1323 | int group; |
1324 | |||
1325 | struct pm_qos_request pm_qos_req; | ||
1325 | }; | 1326 | }; |
1326 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 1327 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
1327 | 1328 | ||
@@ -1626,6 +1627,7 @@ extern int dev_alloc_name(struct net_device *dev, const char *name); | |||
1626 | extern int dev_open(struct net_device *dev); | 1627 | extern int dev_open(struct net_device *dev); |
1627 | extern int dev_close(struct net_device *dev); | 1628 | extern int dev_close(struct net_device *dev); |
1628 | extern void dev_disable_lro(struct net_device *dev); | 1629 | extern void dev_disable_lro(struct net_device *dev); |
1630 | extern int dev_loopback_xmit(struct sk_buff *newskb); | ||
1629 | extern int dev_queue_xmit(struct sk_buff *skb); | 1631 | extern int dev_queue_xmit(struct sk_buff *skb); |
1630 | extern int register_netdevice(struct net_device *dev); | 1632 | extern int register_netdevice(struct net_device *dev); |
1631 | extern void unregister_netdevice_queue(struct net_device *dev, | 1633 | extern void unregister_netdevice_queue(struct net_device *dev, |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index ff9c84c29b28..c613cf0d7884 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -94,6 +94,16 @@ static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1, | |||
94 | a1->all[3] == a2->all[3]; | 94 | a1->all[3] == a2->all[3]; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, | ||
98 | union nf_inet_addr *result, | ||
99 | const union nf_inet_addr *mask) | ||
100 | { | ||
101 | result->all[0] = a1->all[0] & mask->all[0]; | ||
102 | result->all[1] = a1->all[1] & mask->all[1]; | ||
103 | result->all[2] = a1->all[2] & mask->all[2]; | ||
104 | result->all[3] = a1->all[3] & mask->all[3]; | ||
105 | } | ||
106 | |||
97 | extern void netfilter_init(void); | 107 | extern void netfilter_init(void); |
98 | 108 | ||
99 | /* Largest hook number + 1 */ | 109 | /* Largest hook number + 1 */ |
@@ -383,6 +393,22 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) | |||
383 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; | 393 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; |
384 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | 394 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); |
385 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; | 395 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; |
396 | |||
397 | struct nf_conn; | ||
398 | struct nlattr; | ||
399 | |||
400 | struct nfq_ct_hook { | ||
401 | size_t (*build_size)(const struct nf_conn *ct); | ||
402 | int (*build)(struct sk_buff *skb, struct nf_conn *ct); | ||
403 | int (*parse)(const struct nlattr *attr, struct nf_conn *ct); | ||
404 | }; | ||
405 | extern struct nfq_ct_hook __rcu *nfq_ct_hook; | ||
406 | |||
407 | struct nfq_ct_nat_hook { | ||
408 | void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, | ||
409 | u32 ctinfo, int off); | ||
410 | }; | ||
411 | extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; | ||
386 | #else | 412 | #else |
387 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 413 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
388 | #endif | 414 | #endif |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 1697036336b6..874ae8f2706b 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -10,6 +10,7 @@ header-y += nfnetlink.h | |||
10 | header-y += nfnetlink_acct.h | 10 | header-y += nfnetlink_acct.h |
11 | header-y += nfnetlink_compat.h | 11 | header-y += nfnetlink_compat.h |
12 | header-y += nfnetlink_conntrack.h | 12 | header-y += nfnetlink_conntrack.h |
13 | header-y += nfnetlink_cthelper.h | ||
13 | header-y += nfnetlink_cttimeout.h | 14 | header-y += nfnetlink_cttimeout.h |
14 | header-y += nfnetlink_log.h | 15 | header-y += nfnetlink_log.h |
15 | header-y += nfnetlink_queue.h | 16 | header-y += nfnetlink_queue.h |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 0ce91d56a5f2..0dfc8b7210a3 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define __NF_CONNTRACK_SIP_H__ | 2 | #define __NF_CONNTRACK_SIP_H__ |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <net/netfilter/nf_conntrack_expect.h> | ||
6 | |||
5 | #define SIP_PORT 5060 | 7 | #define SIP_PORT 5060 |
6 | #define SIP_TIMEOUT 3600 | 8 | #define SIP_TIMEOUT 3600 |
7 | 9 | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index a1048c1587d1..18341cdb2443 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -50,7 +50,8 @@ struct nfgenmsg { | |||
50 | #define NFNL_SUBSYS_IPSET 6 | 50 | #define NFNL_SUBSYS_IPSET 6 |
51 | #define NFNL_SUBSYS_ACCT 7 | 51 | #define NFNL_SUBSYS_ACCT 7 |
52 | #define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 | 52 | #define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 |
53 | #define NFNL_SUBSYS_COUNT 9 | 53 | #define NFNL_SUBSYS_CTHELPER 9 |
54 | #define NFNL_SUBSYS_COUNT 10 | ||
54 | 55 | ||
55 | #ifdef __KERNEL__ | 56 | #ifdef __KERNEL__ |
56 | 57 | ||
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index e58e4b93c108..768883370080 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -191,6 +191,7 @@ enum ctattr_expect_nat { | |||
191 | enum ctattr_help { | 191 | enum ctattr_help { |
192 | CTA_HELP_UNSPEC, | 192 | CTA_HELP_UNSPEC, |
193 | CTA_HELP_NAME, | 193 | CTA_HELP_NAME, |
194 | CTA_HELP_INFO, | ||
194 | __CTA_HELP_MAX | 195 | __CTA_HELP_MAX |
195 | }; | 196 | }; |
196 | #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) | 197 | #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) |
diff --git a/include/linux/netfilter/nfnetlink_cthelper.h b/include/linux/netfilter/nfnetlink_cthelper.h new file mode 100644 index 000000000000..33659f6fad3e --- /dev/null +++ b/include/linux/netfilter/nfnetlink_cthelper.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef _NFNL_CTHELPER_H_ | ||
2 | #define _NFNL_CTHELPER_H_ | ||
3 | |||
4 | #define NFCT_HELPER_STATUS_DISABLED 0 | ||
5 | #define NFCT_HELPER_STATUS_ENABLED 1 | ||
6 | |||
7 | enum nfnl_acct_msg_types { | ||
8 | NFNL_MSG_CTHELPER_NEW, | ||
9 | NFNL_MSG_CTHELPER_GET, | ||
10 | NFNL_MSG_CTHELPER_DEL, | ||
11 | NFNL_MSG_CTHELPER_MAX | ||
12 | }; | ||
13 | |||
14 | enum nfnl_cthelper_type { | ||
15 | NFCTH_UNSPEC, | ||
16 | NFCTH_NAME, | ||
17 | NFCTH_TUPLE, | ||
18 | NFCTH_QUEUE_NUM, | ||
19 | NFCTH_POLICY, | ||
20 | NFCTH_PRIV_DATA_LEN, | ||
21 | NFCTH_STATUS, | ||
22 | __NFCTH_MAX | ||
23 | }; | ||
24 | #define NFCTH_MAX (__NFCTH_MAX - 1) | ||
25 | |||
26 | enum nfnl_cthelper_policy_type { | ||
27 | NFCTH_POLICY_SET_UNSPEC, | ||
28 | NFCTH_POLICY_SET_NUM, | ||
29 | NFCTH_POLICY_SET, | ||
30 | NFCTH_POLICY_SET1 = NFCTH_POLICY_SET, | ||
31 | NFCTH_POLICY_SET2, | ||
32 | NFCTH_POLICY_SET3, | ||
33 | NFCTH_POLICY_SET4, | ||
34 | __NFCTH_POLICY_SET_MAX | ||
35 | }; | ||
36 | #define NFCTH_POLICY_SET_MAX (__NFCTH_POLICY_SET_MAX - 1) | ||
37 | |||
38 | enum nfnl_cthelper_pol_type { | ||
39 | NFCTH_POLICY_UNSPEC, | ||
40 | NFCTH_POLICY_NAME, | ||
41 | NFCTH_POLICY_EXPECT_MAX, | ||
42 | NFCTH_POLICY_EXPECT_TIMEOUT, | ||
43 | __NFCTH_POLICY_MAX | ||
44 | }; | ||
45 | #define NFCTH_POLICY_MAX (__NFCTH_POLICY_MAX - 1) | ||
46 | |||
47 | enum nfnl_cthelper_tuple_type { | ||
48 | NFCTH_TUPLE_UNSPEC, | ||
49 | NFCTH_TUPLE_L3PROTONUM, | ||
50 | NFCTH_TUPLE_L4PROTONUM, | ||
51 | __NFCTH_TUPLE_MAX, | ||
52 | }; | ||
53 | #define NFCTH_TUPLE_MAX (__NFCTH_TUPLE_MAX - 1) | ||
54 | |||
55 | #endif /* _NFNL_CTHELPER_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 24b32e6c009e..e0d8fd8d4d24 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -42,6 +42,8 @@ enum nfqnl_attr_type { | |||
42 | NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ | 42 | NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ |
43 | NFQA_HWADDR, /* nfqnl_msg_packet_hw */ | 43 | NFQA_HWADDR, /* nfqnl_msg_packet_hw */ |
44 | NFQA_PAYLOAD, /* opaque data payload */ | 44 | NFQA_PAYLOAD, /* opaque data payload */ |
45 | NFQA_CT, /* nf_conntrack_netlink.h */ | ||
46 | NFQA_CT_INFO, /* enum ip_conntrack_info */ | ||
45 | 47 | ||
46 | __NFQA_MAX | 48 | __NFQA_MAX |
47 | }; | 49 | }; |
@@ -84,8 +86,14 @@ enum nfqnl_attr_config { | |||
84 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | 86 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ |
85 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | 87 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ |
86 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ | 88 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ |
89 | NFQA_CFG_MASK, /* identify which flags to change */ | ||
90 | NFQA_CFG_FLAGS, /* value of these flags (__u32) */ | ||
87 | __NFQA_CFG_MAX | 91 | __NFQA_CFG_MAX |
88 | }; | 92 | }; |
89 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | 93 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) |
90 | 94 | ||
95 | /* Flags for NFQA_CFG_FLAGS */ | ||
96 | #define NFQA_CFG_F_FAIL_OPEN (1 << 0) | ||
97 | #define NFQA_CFG_F_CONNTRACK (1 << 1) | ||
98 | |||
91 | #endif /* _NFNETLINK_QUEUE_H */ | 99 | #endif /* _NFNETLINK_QUEUE_H */ |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index d1366f05d1b2..f1656096121e 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
@@ -22,13 +22,8 @@ struct xt_connlimit_info { | |||
22 | #endif | 22 | #endif |
23 | }; | 23 | }; |
24 | unsigned int limit; | 24 | unsigned int limit; |
25 | union { | 25 | /* revision 1 */ |
26 | /* revision 0 */ | 26 | __u32 flags; |
27 | unsigned int inverse; | ||
28 | |||
29 | /* revision 1 */ | ||
30 | __u32 flags; | ||
31 | }; | ||
32 | 27 | ||
33 | /* Used internally by the kernel */ | 28 | /* Used internally by the kernel */ |
34 | struct xt_connlimit_data *data __attribute__((aligned(8))); | 29 | struct xt_connlimit_data *data __attribute__((aligned(8))); |
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h index 83318e01425e..6ef36c113e89 100644 --- a/include/linux/netfilter/xt_recent.h +++ b/include/linux/netfilter/xt_recent.h | |||
@@ -32,4 +32,14 @@ struct xt_recent_mtinfo { | |||
32 | __u8 side; | 32 | __u8 side; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct xt_recent_mtinfo_v1 { | ||
36 | __u32 seconds; | ||
37 | __u32 hit_count; | ||
38 | __u8 check_set; | ||
39 | __u8 invert; | ||
40 | char name[XT_RECENT_NAME_LEN]; | ||
41 | __u8 side; | ||
42 | union nf_inet_addr mask; | ||
43 | }; | ||
44 | |||
35 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ | 45 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index fa0946c549d3..e2b12801378d 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -66,6 +66,7 @@ enum nf_ip_hook_priorities { | |||
66 | NF_IP_PRI_SECURITY = 50, | 66 | NF_IP_PRI_SECURITY = 50, |
67 | NF_IP_PRI_NAT_SRC = 100, | 67 | NF_IP_PRI_NAT_SRC = 100, |
68 | NF_IP_PRI_SELINUX_LAST = 225, | 68 | NF_IP_PRI_SELINUX_LAST = 225, |
69 | NF_IP_PRI_CONNTRACK_HELPER = 300, | ||
69 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, | 70 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, |
70 | NF_IP_PRI_LAST = INT_MAX, | 71 | NF_IP_PRI_LAST = INT_MAX, |
71 | }; | 72 | }; |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index c61b8fb1a9ef..8ba0c5b72ea9 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -5,7 +5,6 @@ header-y += ipt_LOG.h | |||
5 | header-y += ipt_REJECT.h | 5 | header-y += ipt_REJECT.h |
6 | header-y += ipt_TTL.h | 6 | header-y += ipt_TTL.h |
7 | header-y += ipt_ULOG.h | 7 | header-y += ipt_ULOG.h |
8 | header-y += ipt_addrtype.h | ||
9 | header-y += ipt_ah.h | 8 | header-y += ipt_ah.h |
10 | header-y += ipt_ecn.h | 9 | header-y += ipt_ecn.h |
11 | header-y += ipt_ttl.h | 10 | header-y += ipt_ttl.h |
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h deleted file mode 100644 index 0da42237c8da..000000000000 --- a/include/linux/netfilter_ipv4/ipt_addrtype.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #ifndef _IPT_ADDRTYPE_H | ||
2 | #define _IPT_ADDRTYPE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | enum { | ||
7 | IPT_ADDRTYPE_INVERT_SOURCE = 0x0001, | ||
8 | IPT_ADDRTYPE_INVERT_DEST = 0x0002, | ||
9 | IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004, | ||
10 | IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008, | ||
11 | }; | ||
12 | |||
13 | struct ipt_addrtype_info_v1 { | ||
14 | __u16 source; /* source-type mask */ | ||
15 | __u16 dest; /* dest-type mask */ | ||
16 | __u32 flags; | ||
17 | }; | ||
18 | |||
19 | /* revision 0 */ | ||
20 | struct ipt_addrtype_info { | ||
21 | __u16 source; /* source-type mask */ | ||
22 | __u16 dest; /* dest-type mask */ | ||
23 | __u32 invert_source; | ||
24 | __u32 invert_dest; | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 57c025127f1d..7c8a513ce7a3 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -71,6 +71,7 @@ enum nf_ip6_hook_priorities { | |||
71 | NF_IP6_PRI_SECURITY = 50, | 71 | NF_IP6_PRI_SECURITY = 50, |
72 | NF_IP6_PRI_NAT_SRC = 100, | 72 | NF_IP6_PRI_NAT_SRC = 100, |
73 | NF_IP6_PRI_SELINUX_LAST = 225, | 73 | NF_IP6_PRI_SELINUX_LAST = 225, |
74 | NF_IP6_PRI_CONNTRACK_HELPER = 300, | ||
74 | NF_IP6_PRI_LAST = INT_MAX, | 75 | NF_IP6_PRI_LAST = INT_MAX, |
75 | }; | 76 | }; |
76 | 77 | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 0f628ffa420c..ed33f0901bc2 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -241,14 +241,6 @@ struct netlink_notify { | |||
241 | struct nlmsghdr * | 241 | struct nlmsghdr * |
242 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); | 242 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); |
243 | 243 | ||
244 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ | ||
245 | ({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \ | ||
246 | goto nlmsg_failure; \ | ||
247 | __nlmsg_put(skb, pid, seq, type, len, flags); }) | ||
248 | |||
249 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | ||
250 | NLMSG_NEW(skb, pid, seq, type, len, 0) | ||
251 | |||
252 | struct netlink_dump_control { | 244 | struct netlink_dump_control { |
253 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); | 245 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); |
254 | int (*done)(struct netlink_callback*); | 246 | int (*done)(struct netlink_callback*); |
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 0ae9b5857c83..f4e6dd915b1c 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
@@ -56,6 +56,10 @@ | |||
56 | * %NFC_ATTR_PROTOCOLS) | 56 | * %NFC_ATTR_PROTOCOLS) |
57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed | 57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed |
58 | * (it sends %NFC_ATTR_DEVICE_INDEX) | 58 | * (it sends %NFC_ATTR_DEVICE_INDEX) |
59 | * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in | ||
60 | * target mode. | ||
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | ||
62 | * from target mode. | ||
59 | */ | 63 | */ |
60 | enum nfc_commands { | 64 | enum nfc_commands { |
61 | NFC_CMD_UNSPEC, | 65 | NFC_CMD_UNSPEC, |
@@ -71,6 +75,8 @@ enum nfc_commands { | |||
71 | NFC_EVENT_DEVICE_ADDED, | 75 | NFC_EVENT_DEVICE_ADDED, |
72 | NFC_EVENT_DEVICE_REMOVED, | 76 | NFC_EVENT_DEVICE_REMOVED, |
73 | NFC_EVENT_TARGET_LOST, | 77 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | ||
79 | NFC_EVENT_TM_DEACTIVATED, | ||
74 | /* private: internal use only */ | 80 | /* private: internal use only */ |
75 | __NFC_CMD_AFTER_LAST | 81 | __NFC_CMD_AFTER_LAST |
76 | }; | 82 | }; |
@@ -94,6 +100,8 @@ enum nfc_commands { | |||
94 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes | 100 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes |
95 | * @NFC_ATTR_COMM_MODE: Passive or active mode | 101 | * @NFC_ATTR_COMM_MODE: Passive or active mode |
96 | * @NFC_ATTR_RF_MODE: Initiator or target | 102 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | ||
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | ||
97 | */ | 105 | */ |
98 | enum nfc_attrs { | 106 | enum nfc_attrs { |
99 | NFC_ATTR_UNSPEC, | 107 | NFC_ATTR_UNSPEC, |
@@ -109,6 +117,8 @@ enum nfc_attrs { | |||
109 | NFC_ATTR_COMM_MODE, | 117 | NFC_ATTR_COMM_MODE, |
110 | NFC_ATTR_RF_MODE, | 118 | NFC_ATTR_RF_MODE, |
111 | NFC_ATTR_DEVICE_POWERED, | 119 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | ||
121 | NFC_ATTR_TM_PROTOCOLS, | ||
112 | /* private: internal use only */ | 122 | /* private: internal use only */ |
113 | __NFC_ATTR_AFTER_LAST | 123 | __NFC_ATTR_AFTER_LAST |
114 | }; | 124 | }; |
@@ -118,6 +128,7 @@ enum nfc_attrs { | |||
118 | #define NFC_NFCID1_MAXSIZE 10 | 128 | #define NFC_NFCID1_MAXSIZE 10 |
119 | #define NFC_SENSB_RES_MAXSIZE 12 | 129 | #define NFC_SENSB_RES_MAXSIZE 12 |
120 | #define NFC_SENSF_RES_MAXSIZE 18 | 130 | #define NFC_SENSF_RES_MAXSIZE 18 |
131 | #define NFC_GB_MAXSIZE 48 | ||
121 | 132 | ||
122 | /* NFC protocols */ | 133 | /* NFC protocols */ |
123 | #define NFC_PROTO_JEWEL 1 | 134 | #define NFC_PROTO_JEWEL 1 |
@@ -135,6 +146,7 @@ enum nfc_attrs { | |||
135 | /* NFC RF modes */ | 146 | /* NFC RF modes */ |
136 | #define NFC_RF_INITIATOR 0 | 147 | #define NFC_RF_INITIATOR 0 |
137 | #define NFC_RF_TARGET 1 | 148 | #define NFC_RF_TARGET 1 |
149 | #define NFC_RF_NONE 2 | ||
138 | 150 | ||
139 | /* NFC protocols masks used in bitsets */ | 151 | /* NFC protocols masks used in bitsets */ |
140 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) | 152 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index a6959f72745e..970afdf5a605 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -170,6 +170,8 @@ | |||
170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
173 | * The channel to use can be set on the interface or be given using the | ||
174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | ||
173 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
174 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
175 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
@@ -1520,6 +1522,8 @@ enum nl80211_attrs { | |||
1520 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1522 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
1521 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1523 | #define NL80211_MAX_NR_AKM_SUITES 2 |
1522 | 1524 | ||
1525 | #define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10 | ||
1526 | |||
1523 | /** | 1527 | /** |
1524 | * enum nl80211_iftype - (virtual) interface types | 1528 | * enum nl80211_iftype - (virtual) interface types |
1525 | * | 1529 | * |
@@ -2534,10 +2538,14 @@ enum nl80211_attr_cqm { | |||
2534 | * configured threshold | 2538 | * configured threshold |
2535 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the | 2539 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the |
2536 | * configured threshold | 2540 | * configured threshold |
2541 | * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss. | ||
2542 | * (Note that deauth/disassoc will still follow if the AP is not | ||
2543 | * available. This event might get used as roaming event, etc.) | ||
2537 | */ | 2544 | */ |
2538 | enum nl80211_cqm_rssi_threshold_event { | 2545 | enum nl80211_cqm_rssi_threshold_event { |
2539 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, | 2546 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, |
2540 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, | 2547 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, |
2548 | NL80211_CQM_RSSI_BEACON_LOSS_EVENT, | ||
2541 | }; | 2549 | }; |
2542 | 2550 | ||
2543 | 2551 | ||
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index 5a3db3aa5f17..fd4f2d1cdf6c 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
@@ -130,18 +130,8 @@ enum { | |||
130 | enum { | 130 | enum { |
131 | __IEEE802154_DEV_INVALID = -1, | 131 | __IEEE802154_DEV_INVALID = -1, |
132 | 132 | ||
133 | /* TODO: | 133 | IEEE802154_DEV_WPAN, |
134 | * Nowadays three device types supported by this stack at linux-zigbee | 134 | IEEE802154_DEV_MONITOR, |
135 | * project: WPAN = 0, MONITOR = 1 and SMAC = 2. | ||
136 | * | ||
137 | * Since this stack implementation exists many years, it's definitely | ||
138 | * bad idea to change the assigned values due to they are already used | ||
139 | * by third-party userspace software like: iz-tools, wireshark... | ||
140 | * | ||
141 | * Currently only monitor device is added and initialized by '1' for | ||
142 | * compatibility. | ||
143 | */ | ||
144 | IEEE802154_DEV_MONITOR = 1, | ||
145 | 135 | ||
146 | __IEEE802154_DEV_MAX, | 136 | __IEEE802154_DEV_MAX, |
147 | }; | 137 | }; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index c291cae8ce32..7eac80a2557b 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -243,6 +243,15 @@ enum phy_state { | |||
243 | PHY_RESUMING | 243 | PHY_RESUMING |
244 | }; | 244 | }; |
245 | 245 | ||
246 | /** | ||
247 | * struct phy_c45_device_ids - 802.3-c45 Device Identifiers | ||
248 | * @devices_in_package: Bit vector of devices present. | ||
249 | * @device_ids: The device identifer for each present device. | ||
250 | */ | ||
251 | struct phy_c45_device_ids { | ||
252 | u32 devices_in_package; | ||
253 | u32 device_ids[8]; | ||
254 | }; | ||
246 | 255 | ||
247 | /* phy_device: An instance of a PHY | 256 | /* phy_device: An instance of a PHY |
248 | * | 257 | * |
@@ -250,6 +259,8 @@ enum phy_state { | |||
250 | * bus: Pointer to the bus this PHY is on | 259 | * bus: Pointer to the bus this PHY is on |
251 | * dev: driver model device structure for this PHY | 260 | * dev: driver model device structure for this PHY |
252 | * phy_id: UID for this device found during discovery | 261 | * phy_id: UID for this device found during discovery |
262 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | ||
263 | * is_c45: Set to true if this phy uses clause 45 addressing. | ||
253 | * state: state of the PHY for management purposes | 264 | * state: state of the PHY for management purposes |
254 | * dev_flags: Device-specific flags used by the PHY driver. | 265 | * dev_flags: Device-specific flags used by the PHY driver. |
255 | * addr: Bus address of PHY | 266 | * addr: Bus address of PHY |
@@ -285,6 +296,9 @@ struct phy_device { | |||
285 | 296 | ||
286 | u32 phy_id; | 297 | u32 phy_id; |
287 | 298 | ||
299 | struct phy_c45_device_ids c45_ids; | ||
300 | bool is_c45; | ||
301 | |||
288 | enum phy_state state; | 302 | enum phy_state state; |
289 | 303 | ||
290 | u32 dev_flags; | 304 | u32 dev_flags; |
@@ -412,6 +426,12 @@ struct phy_driver { | |||
412 | /* Clears up any memory if needed */ | 426 | /* Clears up any memory if needed */ |
413 | void (*remove)(struct phy_device *phydev); | 427 | void (*remove)(struct phy_device *phydev); |
414 | 428 | ||
429 | /* Returns true if this is a suitable driver for the given | ||
430 | * phydev. If NULL, matching is based on phy_id and | ||
431 | * phy_id_mask. | ||
432 | */ | ||
433 | int (*match_phy_device)(struct phy_device *phydev); | ||
434 | |||
415 | /* Handles ethtool queries for hardware time stamping. */ | 435 | /* Handles ethtool queries for hardware time stamping. */ |
416 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); | 436 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); |
417 | 437 | ||
@@ -480,7 +500,9 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
480 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 500 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
481 | } | 501 | } |
482 | 502 | ||
483 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 503 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
504 | bool is_c45, struct phy_c45_device_ids *c45_ids); | ||
505 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | ||
484 | int phy_device_register(struct phy_device *phy); | 506 | int phy_device_register(struct phy_device *phy); |
485 | int phy_init_hw(struct phy_device *phydev); | 507 | int phy_init_hw(struct phy_device *phydev); |
486 | struct phy_device * phy_attach(struct net_device *dev, | 508 | struct phy_device * phy_attach(struct net_device *dev, |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 2c1de8982c85..ea60b0854109 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -612,12 +612,6 @@ struct tcamsg { | |||
612 | #include <linux/mutex.h> | 612 | #include <linux/mutex.h> |
613 | #include <linux/netdevice.h> | 613 | #include <linux/netdevice.h> |
614 | 614 | ||
615 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | ||
616 | { | ||
617 | int len = strlen(str) + 1; | ||
618 | return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); | ||
619 | } | ||
620 | |||
621 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); | 615 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); |
622 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); | 616 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); |
623 | extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, | 617 | extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, |
@@ -628,122 +622,6 @@ extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, | |||
628 | u32 id, u32 ts, u32 tsage, long expires, | 622 | u32 id, u32 ts, u32 tsage, long expires, |
629 | u32 error); | 623 | u32 error); |
630 | 624 | ||
631 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); | ||
632 | |||
633 | #define RTA_PUT(skb, attrtype, attrlen, data) \ | ||
634 | ({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ | ||
635 | goto rtattr_failure; \ | ||
636 | __rta_fill(skb, attrtype, attrlen, data); }) | ||
637 | |||
638 | #define RTA_APPEND(skb, attrlen, data) \ | ||
639 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ | ||
640 | goto rtattr_failure; \ | ||
641 | memcpy(skb_put(skb, attrlen), data, attrlen); }) | ||
642 | |||
643 | #define RTA_PUT_NOHDR(skb, attrlen, data) \ | ||
644 | ({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \ | ||
645 | memset(skb_tail_pointer(skb) - (RTA_ALIGN(attrlen) - attrlen), 0, \ | ||
646 | RTA_ALIGN(attrlen) - attrlen); }) | ||
647 | |||
648 | #define RTA_PUT_U8(skb, attrtype, value) \ | ||
649 | ({ u8 _tmp = (value); \ | ||
650 | RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); }) | ||
651 | |||
652 | #define RTA_PUT_U16(skb, attrtype, value) \ | ||
653 | ({ u16 _tmp = (value); \ | ||
654 | RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); }) | ||
655 | |||
656 | #define RTA_PUT_U32(skb, attrtype, value) \ | ||
657 | ({ u32 _tmp = (value); \ | ||
658 | RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); }) | ||
659 | |||
660 | #define RTA_PUT_U64(skb, attrtype, value) \ | ||
661 | ({ u64 _tmp = (value); \ | ||
662 | RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); }) | ||
663 | |||
664 | #define RTA_PUT_SECS(skb, attrtype, value) \ | ||
665 | RTA_PUT_U64(skb, attrtype, (value) / HZ) | ||
666 | |||
667 | #define RTA_PUT_MSECS(skb, attrtype, value) \ | ||
668 | RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value)) | ||
669 | |||
670 | #define RTA_PUT_STRING(skb, attrtype, value) \ | ||
671 | RTA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
672 | |||
673 | #define RTA_PUT_FLAG(skb, attrtype) \ | ||
674 | RTA_PUT(skb, attrtype, 0, NULL); | ||
675 | |||
676 | #define RTA_NEST(skb, type) \ | ||
677 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ | ||
678 | RTA_PUT(skb, type, 0, NULL); \ | ||
679 | __start; }) | ||
680 | |||
681 | #define RTA_NEST_END(skb, start) \ | ||
682 | ({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | ||
683 | (skb)->len; }) | ||
684 | |||
685 | #define RTA_NEST_COMPAT(skb, type, attrlen, data) \ | ||
686 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ | ||
687 | RTA_PUT(skb, type, attrlen, data); \ | ||
688 | RTA_NEST(skb, type); \ | ||
689 | __start; }) | ||
690 | |||
691 | #define RTA_NEST_COMPAT_END(skb, start) \ | ||
692 | ({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \ | ||
693 | (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | ||
694 | RTA_NEST_END(skb, __nest); \ | ||
695 | (skb)->len; }) | ||
696 | |||
697 | #define RTA_NEST_CANCEL(skb, start) \ | ||
698 | ({ if (start) \ | ||
699 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | ||
700 | -1; }) | ||
701 | |||
702 | #define RTA_GET_U8(rta) \ | ||
703 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \ | ||
704 | goto rtattr_failure; \ | ||
705 | *(u8 *) RTA_DATA(rta); }) | ||
706 | |||
707 | #define RTA_GET_U16(rta) \ | ||
708 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \ | ||
709 | goto rtattr_failure; \ | ||
710 | *(u16 *) RTA_DATA(rta); }) | ||
711 | |||
712 | #define RTA_GET_U32(rta) \ | ||
713 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \ | ||
714 | goto rtattr_failure; \ | ||
715 | *(u32 *) RTA_DATA(rta); }) | ||
716 | |||
717 | #define RTA_GET_U64(rta) \ | ||
718 | ({ u64 _tmp; \ | ||
719 | if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \ | ||
720 | goto rtattr_failure; \ | ||
721 | memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \ | ||
722 | _tmp; }) | ||
723 | |||
724 | #define RTA_GET_FLAG(rta) (!!(rta)) | ||
725 | |||
726 | #define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ) | ||
727 | #define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta))) | ||
728 | |||
729 | static inline struct rtattr * | ||
730 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | ||
731 | { | ||
732 | struct rtattr *rta; | ||
733 | int size = RTA_LENGTH(attrlen); | ||
734 | |||
735 | rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); | ||
736 | rta->rta_type = attrtype; | ||
737 | rta->rta_len = size; | ||
738 | memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); | ||
739 | return rta; | ||
740 | } | ||
741 | |||
742 | #define __RTA_PUT(skb, attrtype, attrlen) \ | ||
743 | ({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ | ||
744 | goto rtattr_failure; \ | ||
745 | __rta_reserve(skb, attrtype, attrlen); }) | ||
746 | |||
747 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | 625 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
748 | 626 | ||
749 | /* RTNL is used as a global lock for all changes to network configuration */ | 627 | /* RTNL is used as a global lock for all changes to network configuration */ |
@@ -794,13 +672,6 @@ extern void __rtnl_unlock(void); | |||
794 | } \ | 672 | } \ |
795 | } while(0) | 673 | } while(0) |
796 | 674 | ||
797 | static inline u32 rtm_get_table(struct rtattr **rta, u8 table) | ||
798 | { | ||
799 | return RTA_GET_U32(rta[RTA_TABLE-1]); | ||
800 | rtattr_failure: | ||
801 | return table; | ||
802 | } | ||
803 | |||
804 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, | 675 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, |
805 | struct netlink_callback *cb, | 676 | struct netlink_callback *cb, |
806 | struct net_device *dev, | 677 | struct net_device *dev, |
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h index db4bae78bda9..6793fac5eab5 100644 --- a/include/linux/sock_diag.h +++ b/include/linux/sock_diag.h | |||
@@ -18,6 +18,7 @@ enum { | |||
18 | SK_MEMINFO_FWD_ALLOC, | 18 | SK_MEMINFO_FWD_ALLOC, |
19 | SK_MEMINFO_WMEM_QUEUED, | 19 | SK_MEMINFO_WMEM_QUEUED, |
20 | SK_MEMINFO_OPTMEM, | 20 | SK_MEMINFO_OPTMEM, |
21 | SK_MEMINFO_BACKLOG, | ||
21 | 22 | ||
22 | SK_MEMINFO_VARS, | 23 | SK_MEMINFO_VARS, |
23 | }; | 24 | }; |
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h new file mode 100644 index 000000000000..b2b1afbb3202 --- /dev/null +++ b/include/linux/spi/at86rf230.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * AT86RF230/RF231 driver | ||
3 | * | ||
4 | * Copyright (C) 2009-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 | * Written by: | ||
20 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> | ||
21 | */ | ||
22 | #ifndef AT86RF230_H | ||
23 | #define AT86RF230_H | ||
24 | |||
25 | struct at86rf230_platform_data { | ||
26 | int rstn; | ||
27 | int slp_tr; | ||
28 | int dig2; | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index bc14bd738ade..bb674c02f306 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -243,6 +243,7 @@ struct ssb_bus_ops { | |||
243 | #define SSB_DEV_MINI_MACPHY 0x823 | 243 | #define SSB_DEV_MINI_MACPHY 0x823 |
244 | #define SSB_DEV_ARM_1176 0x824 | 244 | #define SSB_DEV_ARM_1176 0x824 |
245 | #define SSB_DEV_ARM_7TDMI 0x825 | 245 | #define SSB_DEV_ARM_7TDMI 0x825 |
246 | #define SSB_DEV_ARM_CM3 0x82A | ||
246 | 247 | ||
247 | /* Vendor-ID values */ | 248 | /* Vendor-ID values */ |
248 | #define SSB_VENDOR_BROADCOM 0x4243 | 249 | #define SSB_VENDOR_BROADCOM 0x4243 |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 5f359dbfcdce..7d3bcedc062a 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -506,8 +506,9 @@ struct tcp_timewait_sock { | |||
506 | u32 tw_rcv_wnd; | 506 | u32 tw_rcv_wnd; |
507 | u32 tw_ts_recent; | 507 | u32 tw_ts_recent; |
508 | long tw_ts_recent_stamp; | 508 | long tw_ts_recent_stamp; |
509 | struct inet_peer *tw_peer; | ||
509 | #ifdef CONFIG_TCP_MD5SIG | 510 | #ifdef CONFIG_TCP_MD5SIG |
510 | struct tcp_md5sig_key *tw_md5_key; | 511 | struct tcp_md5sig_key *tw_md5_key; |
511 | #endif | 512 | #endif |
512 | /* Few sockets in timewait have cookies; in that case, then this | 513 | /* Few sockets in timewait have cookies; in that case, then this |
513 | * object holds a reference to them (tw_cookie_values->kref). | 514 | * object holds a reference to them (tw_cookie_values->kref). |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 76f439647c4b..f87cf622317f 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -66,9 +66,8 @@ struct usbnet { | |||
66 | # define EVENT_STS_SPLIT 3 | 66 | # define EVENT_STS_SPLIT 3 |
67 | # define EVENT_LINK_RESET 4 | 67 | # define EVENT_LINK_RESET 4 |
68 | # define EVENT_RX_PAUSED 5 | 68 | # define EVENT_RX_PAUSED 5 |
69 | # define EVENT_DEV_WAKING 6 | 69 | # define EVENT_DEV_ASLEEP 6 |
70 | # define EVENT_DEV_ASLEEP 7 | 70 | # define EVENT_DEV_OPEN 7 |
71 | # define EVENT_DEV_OPEN 8 | ||
72 | }; | 71 | }; |
73 | 72 | ||
74 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 73 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 2ee33da36a7a..b5f8988e4283 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -14,10 +14,11 @@ extern struct sock *unix_get_socket(struct file *filp); | |||
14 | extern struct sock *unix_peer_get(struct sock *); | 14 | extern struct sock *unix_peer_get(struct sock *); |
15 | 15 | ||
16 | #define UNIX_HASH_SIZE 256 | 16 | #define UNIX_HASH_SIZE 256 |
17 | #define UNIX_HASH_BITS 8 | ||
17 | 18 | ||
18 | extern unsigned int unix_tot_inflight; | 19 | extern unsigned int unix_tot_inflight; |
19 | extern spinlock_t unix_table_lock; | 20 | extern spinlock_t unix_table_lock; |
20 | extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; | 21 | extern struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE]; |
21 | 22 | ||
22 | struct unix_address { | 23 | struct unix_address { |
23 | atomic_t refcnt; | 24 | atomic_t refcnt; |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h new file mode 100644 index 000000000000..6a76e0a0705e --- /dev/null +++ b/include/net/bluetooth/a2mp.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. | ||
3 | Copyright (c) 2011,2012 Intel Corp. | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License version 2 and | ||
7 | only version 2 as published by the Free Software Foundation. | ||
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 | |||
15 | #ifndef __A2MP_H | ||
16 | #define __A2MP_H | ||
17 | |||
18 | #include <net/bluetooth/l2cap.h> | ||
19 | |||
20 | #define A2MP_FEAT_EXT 0x8000 | ||
21 | |||
22 | struct amp_mgr { | ||
23 | struct l2cap_conn *l2cap_conn; | ||
24 | struct l2cap_chan *a2mp_chan; | ||
25 | struct kref kref; | ||
26 | __u8 ident; | ||
27 | __u8 handle; | ||
28 | unsigned long flags; | ||
29 | }; | ||
30 | |||
31 | struct a2mp_cmd { | ||
32 | __u8 code; | ||
33 | __u8 ident; | ||
34 | __le16 len; | ||
35 | __u8 data[0]; | ||
36 | } __packed; | ||
37 | |||
38 | /* A2MP command codes */ | ||
39 | #define A2MP_COMMAND_REJ 0x01 | ||
40 | struct a2mp_cmd_rej { | ||
41 | __le16 reason; | ||
42 | __u8 data[0]; | ||
43 | } __packed; | ||
44 | |||
45 | #define A2MP_DISCOVER_REQ 0x02 | ||
46 | struct a2mp_discov_req { | ||
47 | __le16 mtu; | ||
48 | __le16 ext_feat; | ||
49 | } __packed; | ||
50 | |||
51 | struct a2mp_cl { | ||
52 | __u8 id; | ||
53 | __u8 type; | ||
54 | __u8 status; | ||
55 | } __packed; | ||
56 | |||
57 | #define A2MP_DISCOVER_RSP 0x03 | ||
58 | struct a2mp_discov_rsp { | ||
59 | __le16 mtu; | ||
60 | __le16 ext_feat; | ||
61 | struct a2mp_cl cl[0]; | ||
62 | } __packed; | ||
63 | |||
64 | #define A2MP_CHANGE_NOTIFY 0x04 | ||
65 | #define A2MP_CHANGE_RSP 0x05 | ||
66 | |||
67 | #define A2MP_GETINFO_REQ 0x06 | ||
68 | struct a2mp_info_req { | ||
69 | __u8 id; | ||
70 | } __packed; | ||
71 | |||
72 | #define A2MP_GETINFO_RSP 0x07 | ||
73 | struct a2mp_info_rsp { | ||
74 | __u8 id; | ||
75 | __u8 status; | ||
76 | __le32 total_bw; | ||
77 | __le32 max_bw; | ||
78 | __le32 min_latency; | ||
79 | __le16 pal_cap; | ||
80 | __le16 assoc_size; | ||
81 | } __packed; | ||
82 | |||
83 | #define A2MP_GETAMPASSOC_REQ 0x08 | ||
84 | struct a2mp_amp_assoc_req { | ||
85 | __u8 id; | ||
86 | } __packed; | ||
87 | |||
88 | #define A2MP_GETAMPASSOC_RSP 0x09 | ||
89 | struct a2mp_amp_assoc_rsp { | ||
90 | __u8 id; | ||
91 | __u8 status; | ||
92 | __u8 amp_assoc[0]; | ||
93 | } __packed; | ||
94 | |||
95 | #define A2MP_CREATEPHYSLINK_REQ 0x0A | ||
96 | #define A2MP_DISCONNPHYSLINK_REQ 0x0C | ||
97 | struct a2mp_physlink_req { | ||
98 | __u8 local_id; | ||
99 | __u8 remote_id; | ||
100 | __u8 amp_assoc[0]; | ||
101 | } __packed; | ||
102 | |||
103 | #define A2MP_CREATEPHYSLINK_RSP 0x0B | ||
104 | #define A2MP_DISCONNPHYSLINK_RSP 0x0D | ||
105 | struct a2mp_physlink_rsp { | ||
106 | __u8 local_id; | ||
107 | __u8 remote_id; | ||
108 | __u8 status; | ||
109 | } __packed; | ||
110 | |||
111 | /* A2MP response status */ | ||
112 | #define A2MP_STATUS_SUCCESS 0x00 | ||
113 | #define A2MP_STATUS_INVALID_CTRL_ID 0x01 | ||
114 | #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 | ||
115 | #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 | ||
116 | #define A2MP_STATUS_COLLISION_OCCURED 0x03 | ||
117 | #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 | ||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | ||
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | ||
120 | |||
121 | void amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | ||
124 | struct sk_buff *skb); | ||
125 | |||
126 | #endif /* __A2MP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 961669b648fd..565d4bee1e49 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,22 +12,19 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifndef __BLUETOOTH_H | 25 | #ifndef __BLUETOOTH_H |
26 | #define __BLUETOOTH_H | 26 | #define __BLUETOOTH_H |
27 | 27 | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #include <linux/list.h> | ||
31 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
32 | #include <net/sock.h> | 29 | #include <net/sock.h> |
33 | 30 | ||
@@ -168,8 +165,8 @@ typedef struct { | |||
168 | #define BDADDR_LE_PUBLIC 0x01 | 165 | #define BDADDR_LE_PUBLIC 0x01 |
169 | #define BDADDR_LE_RANDOM 0x02 | 166 | #define BDADDR_LE_RANDOM 0x02 |
170 | 167 | ||
171 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 168 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) |
172 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 169 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
173 | 170 | ||
174 | /* Copy, swap, convert BD Address */ | 171 | /* Copy, swap, convert BD Address */ |
175 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) | 172 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) |
@@ -215,7 +212,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
215 | struct msghdr *msg, size_t len, int flags); | 212 | struct msghdr *msg, size_t len, int flags); |
216 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | 213 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, |
217 | struct msghdr *msg, size_t len, int flags); | 214 | struct msghdr *msg, size_t len, int flags); |
218 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 215 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); |
219 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 216 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
220 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 217 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
221 | 218 | ||
@@ -225,12 +222,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
225 | 222 | ||
226 | /* Skb helpers */ | 223 | /* Skb helpers */ |
227 | struct l2cap_ctrl { | 224 | struct l2cap_ctrl { |
228 | unsigned int sframe : 1, | 225 | unsigned int sframe:1, |
229 | poll : 1, | 226 | poll:1, |
230 | final : 1, | 227 | final:1, |
231 | fcs : 1, | 228 | fcs:1, |
232 | sar : 2, | 229 | sar:2, |
233 | super : 2; | 230 | super:2; |
234 | __u16 reqseq; | 231 | __u16 reqseq; |
235 | __u16 txseq; | 232 | __u16 txseq; |
236 | __u8 retries; | 233 | __u8 retries; |
@@ -249,7 +246,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) | |||
249 | { | 246 | { |
250 | struct sk_buff *skb; | 247 | struct sk_buff *skb; |
251 | 248 | ||
252 | if ((skb = alloc_skb(len + BT_SKB_RESERVE, how))) { | 249 | skb = alloc_skb(len + BT_SKB_RESERVE, how); |
250 | if (skb) { | ||
253 | skb_reserve(skb, BT_SKB_RESERVE); | 251 | skb_reserve(skb, BT_SKB_RESERVE); |
254 | bt_cb(skb)->incoming = 0; | 252 | bt_cb(skb)->incoming = 0; |
255 | } | 253 | } |
@@ -261,7 +259,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, | |||
261 | { | 259 | { |
262 | struct sk_buff *skb; | 260 | struct sk_buff *skb; |
263 | 261 | ||
264 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 262 | skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); |
263 | if (skb) { | ||
265 | skb_reserve(skb, BT_SKB_RESERVE); | 264 | skb_reserve(skb, BT_SKB_RESERVE); |
266 | bt_cb(skb)->incoming = 0; | 265 | bt_cb(skb)->incoming = 0; |
267 | } | 266 | } |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 3def64ba77fa..2a6b0b8b7120 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -30,6 +30,9 @@ | |||
30 | #define HCI_MAX_EVENT_SIZE 260 | 30 | #define HCI_MAX_EVENT_SIZE 260 |
31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) | 31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) |
32 | 32 | ||
33 | #define HCI_LINK_KEY_SIZE 16 | ||
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | ||
35 | |||
33 | /* HCI dev events */ | 36 | /* HCI dev events */ |
34 | #define HCI_DEV_REG 1 | 37 | #define HCI_DEV_REG 1 |
35 | #define HCI_DEV_UNREG 2 | 38 | #define HCI_DEV_UNREG 2 |
@@ -56,9 +59,12 @@ | |||
56 | #define HCI_BREDR 0x00 | 59 | #define HCI_BREDR 0x00 |
57 | #define HCI_AMP 0x01 | 60 | #define HCI_AMP 0x01 |
58 | 61 | ||
62 | /* First BR/EDR Controller shall have ID = 0 */ | ||
63 | #define HCI_BREDR_ID 0 | ||
64 | |||
59 | /* HCI device quirks */ | 65 | /* HCI device quirks */ |
60 | enum { | 66 | enum { |
61 | HCI_QUIRK_NO_RESET, | 67 | HCI_QUIRK_RESET_ON_CLOSE, |
62 | HCI_QUIRK_RAW_DEVICE, | 68 | HCI_QUIRK_RAW_DEVICE, |
63 | HCI_QUIRK_FIXUP_BUFFER_SIZE | 69 | HCI_QUIRK_FIXUP_BUFFER_SIZE |
64 | }; | 70 | }; |
@@ -133,10 +139,8 @@ enum { | |||
133 | #define HCIINQUIRY _IOR('H', 240, int) | 139 | #define HCIINQUIRY _IOR('H', 240, int) |
134 | 140 | ||
135 | /* HCI timeouts */ | 141 | /* HCI timeouts */ |
136 | #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */ | ||
137 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ | 142 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ |
138 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 143 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ |
139 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ | ||
140 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 144 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ |
141 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | 145 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ |
142 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ | 146 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ |
@@ -371,7 +375,7 @@ struct hci_cp_reject_conn_req { | |||
371 | #define HCI_OP_LINK_KEY_REPLY 0x040b | 375 | #define HCI_OP_LINK_KEY_REPLY 0x040b |
372 | struct hci_cp_link_key_reply { | 376 | struct hci_cp_link_key_reply { |
373 | bdaddr_t bdaddr; | 377 | bdaddr_t bdaddr; |
374 | __u8 link_key[16]; | 378 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
375 | } __packed; | 379 | } __packed; |
376 | 380 | ||
377 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c | 381 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c |
@@ -523,6 +527,28 @@ struct hci_cp_io_capability_neg_reply { | |||
523 | __u8 reason; | 527 | __u8 reason; |
524 | } __packed; | 528 | } __packed; |
525 | 529 | ||
530 | #define HCI_OP_CREATE_PHY_LINK 0x0435 | ||
531 | struct hci_cp_create_phy_link { | ||
532 | __u8 phy_handle; | ||
533 | __u8 key_len; | ||
534 | __u8 key_type; | ||
535 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
536 | } __packed; | ||
537 | |||
538 | #define HCI_OP_ACCEPT_PHY_LINK 0x0436 | ||
539 | struct hci_cp_accept_phy_link { | ||
540 | __u8 phy_handle; | ||
541 | __u8 key_len; | ||
542 | __u8 key_type; | ||
543 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
544 | } __packed; | ||
545 | |||
546 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | ||
547 | struct hci_cp_disconn_phy_link { | ||
548 | __u8 phy_handle; | ||
549 | __u8 reason; | ||
550 | } __packed; | ||
551 | |||
526 | #define HCI_OP_SNIFF_MODE 0x0803 | 552 | #define HCI_OP_SNIFF_MODE 0x0803 |
527 | struct hci_cp_sniff_mode { | 553 | struct hci_cp_sniff_mode { |
528 | __le16 handle; | 554 | __le16 handle; |
@@ -818,6 +844,31 @@ struct hci_rp_read_local_amp_info { | |||
818 | __le32 be_flush_to; | 844 | __le32 be_flush_to; |
819 | } __packed; | 845 | } __packed; |
820 | 846 | ||
847 | #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a | ||
848 | struct hci_cp_read_local_amp_assoc { | ||
849 | __u8 phy_handle; | ||
850 | __le16 len_so_far; | ||
851 | __le16 max_len; | ||
852 | } __packed; | ||
853 | struct hci_rp_read_local_amp_assoc { | ||
854 | __u8 status; | ||
855 | __u8 phy_handle; | ||
856 | __le16 rem_len; | ||
857 | __u8 frag[0]; | ||
858 | } __packed; | ||
859 | |||
860 | #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b | ||
861 | struct hci_cp_write_remote_amp_assoc { | ||
862 | __u8 phy_handle; | ||
863 | __le16 len_so_far; | ||
864 | __le16 rem_len; | ||
865 | __u8 frag[0]; | ||
866 | } __packed; | ||
867 | struct hci_rp_write_remote_amp_assoc { | ||
868 | __u8 status; | ||
869 | __u8 phy_handle; | ||
870 | } __packed; | ||
871 | |||
821 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | 872 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
822 | struct hci_cp_le_set_event_mask { | 873 | struct hci_cp_le_set_event_mask { |
823 | __u8 mask[8]; | 874 | __u8 mask[8]; |
@@ -1048,7 +1099,7 @@ struct hci_ev_link_key_req { | |||
1048 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 | 1099 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 |
1049 | struct hci_ev_link_key_notify { | 1100 | struct hci_ev_link_key_notify { |
1050 | bdaddr_t bdaddr; | 1101 | bdaddr_t bdaddr; |
1051 | __u8 link_key[16]; | 1102 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
1052 | __u8 key_type; | 1103 | __u8 key_type; |
1053 | } __packed; | 1104 | } __packed; |
1054 | 1105 | ||
@@ -1196,6 +1247,39 @@ struct hci_ev_le_meta { | |||
1196 | __u8 subevent; | 1247 | __u8 subevent; |
1197 | } __packed; | 1248 | } __packed; |
1198 | 1249 | ||
1250 | #define HCI_EV_PHY_LINK_COMPLETE 0x40 | ||
1251 | struct hci_ev_phy_link_complete { | ||
1252 | __u8 status; | ||
1253 | __u8 phy_handle; | ||
1254 | } __packed; | ||
1255 | |||
1256 | #define HCI_EV_CHANNEL_SELECTED 0x41 | ||
1257 | struct hci_ev_channel_selected { | ||
1258 | __u8 phy_handle; | ||
1259 | } __packed; | ||
1260 | |||
1261 | #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 | ||
1262 | struct hci_ev_disconn_phy_link_complete { | ||
1263 | __u8 status; | ||
1264 | __u8 phy_handle; | ||
1265 | __u8 reason; | ||
1266 | } __packed; | ||
1267 | |||
1268 | #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 | ||
1269 | struct hci_ev_logical_link_complete { | ||
1270 | __u8 status; | ||
1271 | __le16 handle; | ||
1272 | __u8 phy_handle; | ||
1273 | __u8 flow_spec_id; | ||
1274 | } __packed; | ||
1275 | |||
1276 | #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 | ||
1277 | struct hci_ev_disconn_logical_link_complete { | ||
1278 | __u8 status; | ||
1279 | __le16 handle; | ||
1280 | __u8 reason; | ||
1281 | } __packed; | ||
1282 | |||
1199 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 | 1283 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 |
1200 | struct hci_comp_blocks_info { | 1284 | struct hci_comp_blocks_info { |
1201 | __le16 handle; | 1285 | __le16 handle; |
@@ -1296,7 +1380,6 @@ struct hci_sco_hdr { | |||
1296 | __u8 dlen; | 1380 | __u8 dlen; |
1297 | } __packed; | 1381 | } __packed; |
1298 | 1382 | ||
1299 | #include <linux/skbuff.h> | ||
1300 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | 1383 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
1301 | { | 1384 | { |
1302 | return (struct hci_event_hdr *) skb->data; | 1385 | return (struct hci_event_hdr *) skb->data; |
@@ -1313,12 +1396,12 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
1313 | } | 1396 | } |
1314 | 1397 | ||
1315 | /* Command opcode pack/unpack */ | 1398 | /* Command opcode pack/unpack */ |
1316 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1399 | #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) |
1317 | #define hci_opcode_ogf(op) (op >> 10) | 1400 | #define hci_opcode_ogf(op) (op >> 10) |
1318 | #define hci_opcode_ocf(op) (op & 0x03ff) | 1401 | #define hci_opcode_ocf(op) (op & 0x03ff) |
1319 | 1402 | ||
1320 | /* ACL handle and flags pack/unpack */ | 1403 | /* ACL handle and flags pack/unpack */ |
1321 | #define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12)) | 1404 | #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) |
1322 | #define hci_handle(h) (h & 0x0fff) | 1405 | #define hci_handle(h) (h & 0x0fff) |
1323 | #define hci_flags(h) (h >> 12) | 1406 | #define hci_flags(h) (h >> 12) |
1324 | 1407 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fc7728f94e4..20fd57367ddc 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #ifndef __HCI_CORE_H | 25 | #ifndef __HCI_CORE_H |
26 | #define __HCI_CORE_H | 26 | #define __HCI_CORE_H |
27 | 27 | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <net/bluetooth/hci.h> | 28 | #include <net/bluetooth/hci.h> |
30 | 29 | ||
31 | /* HCI priority */ | 30 | /* HCI priority */ |
@@ -65,7 +64,7 @@ struct discovery_state { | |||
65 | DISCOVERY_RESOLVING, | 64 | DISCOVERY_RESOLVING, |
66 | DISCOVERY_STOPPING, | 65 | DISCOVERY_STOPPING, |
67 | } state; | 66 | } state; |
68 | struct list_head all; /* All devices found during inquiry */ | 67 | struct list_head all; /* All devices found during inquiry */ |
69 | struct list_head unknown; /* Name state not known */ | 68 | struct list_head unknown; /* Name state not known */ |
70 | struct list_head resolve; /* Name needs to be resolved */ | 69 | struct list_head resolve; /* Name needs to be resolved */ |
71 | __u32 timestamp; | 70 | __u32 timestamp; |
@@ -105,7 +104,7 @@ struct link_key { | |||
105 | struct list_head list; | 104 | struct list_head list; |
106 | bdaddr_t bdaddr; | 105 | bdaddr_t bdaddr; |
107 | u8 type; | 106 | u8 type; |
108 | u8 val[16]; | 107 | u8 val[HCI_LINK_KEY_SIZE]; |
109 | u8 pin_len; | 108 | u8 pin_len; |
110 | }; | 109 | }; |
111 | 110 | ||
@@ -333,6 +332,7 @@ struct hci_conn { | |||
333 | void *l2cap_data; | 332 | void *l2cap_data; |
334 | void *sco_data; | 333 | void *sco_data; |
335 | void *smp_conn; | 334 | void *smp_conn; |
335 | struct amp_mgr *amp_mgr; | ||
336 | 336 | ||
337 | struct hci_conn *link; | 337 | struct hci_conn *link; |
338 | 338 | ||
@@ -360,7 +360,8 @@ extern int l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | |||
360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); |
361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); | 363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
364 | u16 flags); | ||
364 | 365 | ||
365 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 366 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
366 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 367 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
@@ -429,8 +430,8 @@ enum { | |||
429 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 430 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
430 | { | 431 | { |
431 | struct hci_dev *hdev = conn->hdev; | 432 | struct hci_dev *hdev = conn->hdev; |
432 | return (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && | 433 | return test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && |
433 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); | 434 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
434 | } | 435 | } |
435 | 436 | ||
436 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 437 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
@@ -640,6 +641,19 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) | |||
640 | dev_set_drvdata(&hdev->dev, data); | 641 | dev_set_drvdata(&hdev->dev, data); |
641 | } | 642 | } |
642 | 643 | ||
644 | /* hci_dev_list shall be locked */ | ||
645 | static inline uint8_t __hci_num_ctrl(void) | ||
646 | { | ||
647 | uint8_t count = 0; | ||
648 | struct list_head *p; | ||
649 | |||
650 | list_for_each(p, &hci_dev_list) { | ||
651 | count++; | ||
652 | } | ||
653 | |||
654 | return count; | ||
655 | } | ||
656 | |||
643 | struct hci_dev *hci_dev_get(int index); | 657 | struct hci_dev *hci_dev_get(int index); |
644 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 658 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); |
645 | 659 | ||
@@ -661,7 +675,8 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
661 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 675 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
662 | int hci_inquiry(void __user *arg); | 676 | int hci_inquiry(void __user *arg); |
663 | 677 | ||
664 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); | 678 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
679 | bdaddr_t *bdaddr); | ||
665 | int hci_blacklist_clear(struct hci_dev *hdev); | 680 | int hci_blacklist_clear(struct hci_dev *hdev); |
666 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 681 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
667 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 682 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 1c7d1cd5e679..d80e3f0691b4 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -40,11 +40,11 @@ | |||
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 42 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_LE_DEFAULT_MTU 23 | ||
44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
46 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF |
47 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ | 46 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ |
47 | #define L2CAP_LE_MIN_MTU 23 | ||
48 | 48 | ||
49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) | 49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) |
50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) | 50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) |
@@ -52,6 +52,8 @@ | |||
52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
54 | 54 | ||
55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | ||
56 | |||
55 | /* L2CAP socket address */ | 57 | /* L2CAP socket address */ |
56 | struct sockaddr_l2 { | 58 | struct sockaddr_l2 { |
57 | sa_family_t l2_family; | 59 | sa_family_t l2_family; |
@@ -229,9 +231,14 @@ struct l2cap_conn_rsp { | |||
229 | __le16 status; | 231 | __le16 status; |
230 | } __packed; | 232 | } __packed; |
231 | 233 | ||
234 | /* protocol/service multiplexer (PSM) */ | ||
235 | #define L2CAP_PSM_SDP 0x0001 | ||
236 | #define L2CAP_PSM_RFCOMM 0x0003 | ||
237 | |||
232 | /* channel indentifier */ | 238 | /* channel indentifier */ |
233 | #define L2CAP_CID_SIGNALING 0x0001 | 239 | #define L2CAP_CID_SIGNALING 0x0001 |
234 | #define L2CAP_CID_CONN_LESS 0x0002 | 240 | #define L2CAP_CID_CONN_LESS 0x0002 |
241 | #define L2CAP_CID_A2MP 0x0003 | ||
235 | #define L2CAP_CID_LE_DATA 0x0004 | 242 | #define L2CAP_CID_LE_DATA 0x0004 |
236 | #define L2CAP_CID_LE_SIGNALING 0x0005 | 243 | #define L2CAP_CID_LE_SIGNALING 0x0005 |
237 | #define L2CAP_CID_SMP 0x0006 | 244 | #define L2CAP_CID_SMP 0x0006 |
@@ -271,6 +278,9 @@ struct l2cap_conf_rsp { | |||
271 | #define L2CAP_CONF_PENDING 0x0004 | 278 | #define L2CAP_CONF_PENDING 0x0004 |
272 | #define L2CAP_CONF_EFS_REJECT 0x0005 | 279 | #define L2CAP_CONF_EFS_REJECT 0x0005 |
273 | 280 | ||
281 | /* configuration req/rsp continuation flag */ | ||
282 | #define L2CAP_CONF_FLAG_CONTINUATION 0x0001 | ||
283 | |||
274 | struct l2cap_conf_opt { | 284 | struct l2cap_conf_opt { |
275 | __u8 type; | 285 | __u8 type; |
276 | __u8 len; | 286 | __u8 len; |
@@ -419,11 +429,6 @@ struct l2cap_seq_list { | |||
419 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF | 429 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF |
420 | #define L2CAP_SEQ_LIST_TAIL 0x8000 | 430 | #define L2CAP_SEQ_LIST_TAIL 0x8000 |
421 | 431 | ||
422 | struct srej_list { | ||
423 | __u16 tx_seq; | ||
424 | struct list_head list; | ||
425 | }; | ||
426 | |||
427 | struct l2cap_chan { | 432 | struct l2cap_chan { |
428 | struct sock *sk; | 433 | struct sock *sk; |
429 | 434 | ||
@@ -475,14 +480,12 @@ struct l2cap_chan { | |||
475 | __u16 expected_ack_seq; | 480 | __u16 expected_ack_seq; |
476 | __u16 expected_tx_seq; | 481 | __u16 expected_tx_seq; |
477 | __u16 buffer_seq; | 482 | __u16 buffer_seq; |
478 | __u16 buffer_seq_srej; | ||
479 | __u16 srej_save_reqseq; | 483 | __u16 srej_save_reqseq; |
480 | __u16 last_acked_seq; | 484 | __u16 last_acked_seq; |
481 | __u16 frames_sent; | 485 | __u16 frames_sent; |
482 | __u16 unacked_frames; | 486 | __u16 unacked_frames; |
483 | __u8 retry_count; | 487 | __u8 retry_count; |
484 | __u16 srej_queue_next; | 488 | __u16 srej_queue_next; |
485 | __u8 num_acked; | ||
486 | __u16 sdu_len; | 489 | __u16 sdu_len; |
487 | struct sk_buff *sdu; | 490 | struct sk_buff *sdu; |
488 | struct sk_buff *sdu_last_frag; | 491 | struct sk_buff *sdu_last_frag; |
@@ -515,7 +518,6 @@ struct l2cap_chan { | |||
515 | struct sk_buff_head srej_q; | 518 | struct sk_buff_head srej_q; |
516 | struct l2cap_seq_list srej_list; | 519 | struct l2cap_seq_list srej_list; |
517 | struct l2cap_seq_list retrans_list; | 520 | struct l2cap_seq_list retrans_list; |
518 | struct list_head srej_l; | ||
519 | 521 | ||
520 | struct list_head list; | 522 | struct list_head list; |
521 | struct list_head global_l; | 523 | struct list_head global_l; |
@@ -528,10 +530,14 @@ struct l2cap_chan { | |||
528 | struct l2cap_ops { | 530 | struct l2cap_ops { |
529 | char *name; | 531 | char *name; |
530 | 532 | ||
531 | struct l2cap_chan *(*new_connection) (void *data); | 533 | struct l2cap_chan *(*new_connection) (struct l2cap_chan *chan); |
532 | int (*recv) (void *data, struct sk_buff *skb); | 534 | int (*recv) (struct l2cap_chan * chan, |
533 | void (*close) (void *data); | 535 | struct sk_buff *skb); |
534 | void (*state_change) (void *data, int state); | 536 | void (*teardown) (struct l2cap_chan *chan, int err); |
537 | void (*close) (struct l2cap_chan *chan); | ||
538 | void (*state_change) (struct l2cap_chan *chan, | ||
539 | int state); | ||
540 | void (*ready) (struct l2cap_chan *chan); | ||
535 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
536 | unsigned long len, int nb); | 542 | unsigned long len, int nb); |
537 | }; | 543 | }; |
@@ -575,6 +581,7 @@ struct l2cap_conn { | |||
575 | #define L2CAP_CHAN_RAW 1 | 581 | #define L2CAP_CHAN_RAW 1 |
576 | #define L2CAP_CHAN_CONN_LESS 2 | 582 | #define L2CAP_CHAN_CONN_LESS 2 |
577 | #define L2CAP_CHAN_CONN_ORIENTED 3 | 583 | #define L2CAP_CHAN_CONN_ORIENTED 3 |
584 | #define L2CAP_CHAN_CONN_FIX_A2MP 4 | ||
578 | 585 | ||
579 | /* ----- L2CAP socket info ----- */ | 586 | /* ----- L2CAP socket info ----- */ |
580 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 587 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
@@ -597,6 +604,7 @@ enum { | |||
597 | CONF_EWS_RECV, | 604 | CONF_EWS_RECV, |
598 | CONF_LOC_CONF_PEND, | 605 | CONF_LOC_CONF_PEND, |
599 | CONF_REM_CONF_PEND, | 606 | CONF_REM_CONF_PEND, |
607 | CONF_NOT_COMPLETE, | ||
600 | }; | 608 | }; |
601 | 609 | ||
602 | #define L2CAP_CONF_MAX_CONF_REQ 2 | 610 | #define L2CAP_CONF_MAX_CONF_REQ 2 |
@@ -713,11 +721,7 @@ static inline bool l2cap_clear_timer(struct l2cap_chan *chan, | |||
713 | 721 | ||
714 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) | 722 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) |
715 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) | 723 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) |
716 | #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ | ||
717 | msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | ||
718 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) | 724 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) |
719 | #define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ | ||
720 | msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | ||
721 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) | 725 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) |
722 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ | 726 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ |
723 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | 727 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); |
@@ -736,173 +740,17 @@ static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq) | |||
736 | return (seq + 1) % (chan->tx_win_max + 1); | 740 | return (seq + 1) % (chan->tx_win_max + 1); |
737 | } | 741 | } |
738 | 742 | ||
739 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) | 743 | static inline struct l2cap_chan *l2cap_chan_no_new_connection(struct l2cap_chan *chan) |
740 | { | ||
741 | int sub; | ||
742 | |||
743 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; | ||
744 | |||
745 | if (sub < 0) | ||
746 | sub += 64; | ||
747 | |||
748 | return sub == ch->remote_tx_win; | ||
749 | } | ||
750 | |||
751 | static inline __u16 __get_reqseq(struct l2cap_chan *chan, __u32 ctrl) | ||
752 | { | ||
753 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
754 | return (ctrl & L2CAP_EXT_CTRL_REQSEQ) >> | ||
755 | L2CAP_EXT_CTRL_REQSEQ_SHIFT; | ||
756 | else | ||
757 | return (ctrl & L2CAP_CTRL_REQSEQ) >> L2CAP_CTRL_REQSEQ_SHIFT; | ||
758 | } | ||
759 | |||
760 | static inline __u32 __set_reqseq(struct l2cap_chan *chan, __u32 reqseq) | ||
761 | { | 744 | { |
762 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | 745 | return NULL; |
763 | return (reqseq << L2CAP_EXT_CTRL_REQSEQ_SHIFT) & | ||
764 | L2CAP_EXT_CTRL_REQSEQ; | ||
765 | else | ||
766 | return (reqseq << L2CAP_CTRL_REQSEQ_SHIFT) & L2CAP_CTRL_REQSEQ; | ||
767 | } | 746 | } |
768 | 747 | ||
769 | static inline __u16 __get_txseq(struct l2cap_chan *chan, __u32 ctrl) | 748 | static inline void l2cap_chan_no_teardown(struct l2cap_chan *chan, int err) |
770 | { | 749 | { |
771 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
772 | return (ctrl & L2CAP_EXT_CTRL_TXSEQ) >> | ||
773 | L2CAP_EXT_CTRL_TXSEQ_SHIFT; | ||
774 | else | ||
775 | return (ctrl & L2CAP_CTRL_TXSEQ) >> L2CAP_CTRL_TXSEQ_SHIFT; | ||
776 | } | 750 | } |
777 | 751 | ||
778 | static inline __u32 __set_txseq(struct l2cap_chan *chan, __u32 txseq) | 752 | static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) |
779 | { | 753 | { |
780 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
781 | return (txseq << L2CAP_EXT_CTRL_TXSEQ_SHIFT) & | ||
782 | L2CAP_EXT_CTRL_TXSEQ; | ||
783 | else | ||
784 | return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; | ||
785 | } | ||
786 | |||
787 | static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl) | ||
788 | { | ||
789 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
790 | return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE; | ||
791 | else | ||
792 | return ctrl & L2CAP_CTRL_FRAME_TYPE; | ||
793 | } | ||
794 | |||
795 | static inline __u32 __set_sframe(struct l2cap_chan *chan) | ||
796 | { | ||
797 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
798 | return L2CAP_EXT_CTRL_FRAME_TYPE; | ||
799 | else | ||
800 | return L2CAP_CTRL_FRAME_TYPE; | ||
801 | } | ||
802 | |||
803 | static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) | ||
804 | { | ||
805 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
806 | return (ctrl & L2CAP_EXT_CTRL_SAR) >> L2CAP_EXT_CTRL_SAR_SHIFT; | ||
807 | else | ||
808 | return (ctrl & L2CAP_CTRL_SAR) >> L2CAP_CTRL_SAR_SHIFT; | ||
809 | } | ||
810 | |||
811 | static inline __u32 __set_ctrl_sar(struct l2cap_chan *chan, __u32 sar) | ||
812 | { | ||
813 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
814 | return (sar << L2CAP_EXT_CTRL_SAR_SHIFT) & L2CAP_EXT_CTRL_SAR; | ||
815 | else | ||
816 | return (sar << L2CAP_CTRL_SAR_SHIFT) & L2CAP_CTRL_SAR; | ||
817 | } | ||
818 | |||
819 | static inline bool __is_sar_start(struct l2cap_chan *chan, __u32 ctrl) | ||
820 | { | ||
821 | return __get_ctrl_sar(chan, ctrl) == L2CAP_SAR_START; | ||
822 | } | ||
823 | |||
824 | static inline __u32 __get_sar_mask(struct l2cap_chan *chan) | ||
825 | { | ||
826 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
827 | return L2CAP_EXT_CTRL_SAR; | ||
828 | else | ||
829 | return L2CAP_CTRL_SAR; | ||
830 | } | ||
831 | |||
832 | static inline __u8 __get_ctrl_super(struct l2cap_chan *chan, __u32 ctrl) | ||
833 | { | ||
834 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
835 | return (ctrl & L2CAP_EXT_CTRL_SUPERVISE) >> | ||
836 | L2CAP_EXT_CTRL_SUPER_SHIFT; | ||
837 | else | ||
838 | return (ctrl & L2CAP_CTRL_SUPERVISE) >> L2CAP_CTRL_SUPER_SHIFT; | ||
839 | } | ||
840 | |||
841 | static inline __u32 __set_ctrl_super(struct l2cap_chan *chan, __u32 super) | ||
842 | { | ||
843 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
844 | return (super << L2CAP_EXT_CTRL_SUPER_SHIFT) & | ||
845 | L2CAP_EXT_CTRL_SUPERVISE; | ||
846 | else | ||
847 | return (super << L2CAP_CTRL_SUPER_SHIFT) & | ||
848 | L2CAP_CTRL_SUPERVISE; | ||
849 | } | ||
850 | |||
851 | static inline __u32 __set_ctrl_final(struct l2cap_chan *chan) | ||
852 | { | ||
853 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
854 | return L2CAP_EXT_CTRL_FINAL; | ||
855 | else | ||
856 | return L2CAP_CTRL_FINAL; | ||
857 | } | ||
858 | |||
859 | static inline bool __is_ctrl_final(struct l2cap_chan *chan, __u32 ctrl) | ||
860 | { | ||
861 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
862 | return ctrl & L2CAP_EXT_CTRL_FINAL; | ||
863 | else | ||
864 | return ctrl & L2CAP_CTRL_FINAL; | ||
865 | } | ||
866 | |||
867 | static inline __u32 __set_ctrl_poll(struct l2cap_chan *chan) | ||
868 | { | ||
869 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
870 | return L2CAP_EXT_CTRL_POLL; | ||
871 | else | ||
872 | return L2CAP_CTRL_POLL; | ||
873 | } | ||
874 | |||
875 | static inline bool __is_ctrl_poll(struct l2cap_chan *chan, __u32 ctrl) | ||
876 | { | ||
877 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
878 | return ctrl & L2CAP_EXT_CTRL_POLL; | ||
879 | else | ||
880 | return ctrl & L2CAP_CTRL_POLL; | ||
881 | } | ||
882 | |||
883 | static inline __u32 __get_control(struct l2cap_chan *chan, void *p) | ||
884 | { | ||
885 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
886 | return get_unaligned_le32(p); | ||
887 | else | ||
888 | return get_unaligned_le16(p); | ||
889 | } | ||
890 | |||
891 | static inline void __put_control(struct l2cap_chan *chan, __u32 control, | ||
892 | void *p) | ||
893 | { | ||
894 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
895 | return put_unaligned_le32(control, p); | ||
896 | else | ||
897 | return put_unaligned_le16(control, p); | ||
898 | } | ||
899 | |||
900 | static inline __u8 __ctrl_size(struct l2cap_chan *chan) | ||
901 | { | ||
902 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
903 | return L2CAP_EXT_HDR_SIZE - L2CAP_HDR_SIZE; | ||
904 | else | ||
905 | return L2CAP_ENH_HDR_SIZE - L2CAP_HDR_SIZE; | ||
906 | } | 754 | } |
907 | 755 | ||
908 | extern bool disable_ertm; | 756 | extern bool disable_ertm; |
@@ -926,5 +774,8 @@ int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | |||
926 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 774 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |
927 | int l2cap_chan_check_security(struct l2cap_chan *chan); | 775 | int l2cap_chan_check_security(struct l2cap_chan *chan); |
928 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 776 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
777 | int l2cap_ertm_init(struct l2cap_chan *chan); | ||
778 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | ||
929 | 780 | ||
930 | #endif /* __L2CAP_H */ | 781 | #endif /* __L2CAP_H */ |
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index 439dadc8102f..bcb9cc3ce98b 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
@@ -93,25 +93,25 @@ struct cfhsi_desc { | |||
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | /* Structure implemented by the CAIF HSI driver. */ | 95 | /* Structure implemented by the CAIF HSI driver. */ |
96 | struct cfhsi_drv { | 96 | struct cfhsi_cb_ops { |
97 | void (*tx_done_cb) (struct cfhsi_drv *drv); | 97 | void (*tx_done_cb) (struct cfhsi_cb_ops *drv); |
98 | void (*rx_done_cb) (struct cfhsi_drv *drv); | 98 | void (*rx_done_cb) (struct cfhsi_cb_ops *drv); |
99 | void (*wake_up_cb) (struct cfhsi_drv *drv); | 99 | void (*wake_up_cb) (struct cfhsi_cb_ops *drv); |
100 | void (*wake_down_cb) (struct cfhsi_drv *drv); | 100 | void (*wake_down_cb) (struct cfhsi_cb_ops *drv); |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* Structure implemented by HSI device. */ | 103 | /* Structure implemented by HSI device. */ |
104 | struct cfhsi_dev { | 104 | struct cfhsi_ops { |
105 | int (*cfhsi_up) (struct cfhsi_dev *dev); | 105 | int (*cfhsi_up) (struct cfhsi_ops *dev); |
106 | int (*cfhsi_down) (struct cfhsi_dev *dev); | 106 | int (*cfhsi_down) (struct cfhsi_ops *dev); |
107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
109 | int (*cfhsi_wake_up) (struct cfhsi_dev *dev); | 109 | int (*cfhsi_wake_up) (struct cfhsi_ops *dev); |
110 | int (*cfhsi_wake_down) (struct cfhsi_dev *dev); | 110 | int (*cfhsi_wake_down) (struct cfhsi_ops *dev); |
111 | int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status); | 111 | int (*cfhsi_get_peer_wake) (struct cfhsi_ops *dev, bool *status); |
112 | int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); | 112 | int (*cfhsi_fifo_occupancy) (struct cfhsi_ops *dev, size_t *occupancy); |
113 | int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); | 113 | int (*cfhsi_rx_cancel)(struct cfhsi_ops *dev); |
114 | struct cfhsi_drv *drv; | 114 | struct cfhsi_cb_ops *cb_ops; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | /* Structure holds status of received CAIF frames processing */ | 117 | /* Structure holds status of received CAIF frames processing */ |
@@ -132,17 +132,26 @@ enum { | |||
132 | CFHSI_PRIO_LAST, | 132 | CFHSI_PRIO_LAST, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | struct cfhsi_config { | ||
136 | u32 inactivity_timeout; | ||
137 | u32 aggregation_timeout; | ||
138 | u32 head_align; | ||
139 | u32 tail_align; | ||
140 | u32 q_high_mark; | ||
141 | u32 q_low_mark; | ||
142 | }; | ||
143 | |||
135 | /* Structure implemented by CAIF HSI drivers. */ | 144 | /* Structure implemented by CAIF HSI drivers. */ |
136 | struct cfhsi { | 145 | struct cfhsi { |
137 | struct caif_dev_common cfdev; | 146 | struct caif_dev_common cfdev; |
138 | struct net_device *ndev; | 147 | struct net_device *ndev; |
139 | struct platform_device *pdev; | 148 | struct platform_device *pdev; |
140 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; | 149 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; |
141 | struct cfhsi_drv drv; | 150 | struct cfhsi_cb_ops cb_ops; |
142 | struct cfhsi_dev *dev; | 151 | struct cfhsi_ops *ops; |
143 | int tx_state; | 152 | int tx_state; |
144 | struct cfhsi_rx_state rx_state; | 153 | struct cfhsi_rx_state rx_state; |
145 | unsigned long inactivity_timeout; | 154 | struct cfhsi_config cfg; |
146 | int rx_len; | 155 | int rx_len; |
147 | u8 *rx_ptr; | 156 | u8 *rx_ptr; |
148 | u8 *tx_buf; | 157 | u8 *tx_buf; |
@@ -150,8 +159,6 @@ struct cfhsi { | |||
150 | u8 *rx_flip_buf; | 159 | u8 *rx_flip_buf; |
151 | spinlock_t lock; | 160 | spinlock_t lock; |
152 | int flow_off_sent; | 161 | int flow_off_sent; |
153 | u32 q_low_mark; | ||
154 | u32 q_high_mark; | ||
155 | struct list_head list; | 162 | struct list_head list; |
156 | struct work_struct wake_up_work; | 163 | struct work_struct wake_up_work; |
157 | struct work_struct wake_down_work; | 164 | struct work_struct wake_down_work; |
@@ -164,13 +171,31 @@ struct cfhsi { | |||
164 | struct timer_list rx_slowpath_timer; | 171 | struct timer_list rx_slowpath_timer; |
165 | 172 | ||
166 | /* TX aggregation */ | 173 | /* TX aggregation */ |
167 | unsigned long aggregation_timeout; | ||
168 | int aggregation_len; | 174 | int aggregation_len; |
169 | struct timer_list aggregation_timer; | 175 | struct timer_list aggregation_timer; |
170 | 176 | ||
171 | unsigned long bits; | 177 | unsigned long bits; |
172 | }; | 178 | }; |
173 | |||
174 | extern struct platform_driver cfhsi_driver; | 179 | extern struct platform_driver cfhsi_driver; |
175 | 180 | ||
181 | /** | ||
182 | * enum ifla_caif_hsi - CAIF HSI NetlinkRT parameters. | ||
183 | * @IFLA_CAIF_HSI_INACTIVITY_TOUT: Inactivity timeout before | ||
184 | * taking the HSI wakeline down, in milliseconds. | ||
185 | * When using RT Netlink to create, destroy or configure a CAIF HSI interface, | ||
186 | * enum ifla_caif_hsi is used to specify the configuration attributes. | ||
187 | */ | ||
188 | enum ifla_caif_hsi { | ||
189 | __IFLA_CAIF_HSI_UNSPEC, | ||
190 | __IFLA_CAIF_HSI_INACTIVITY_TOUT, | ||
191 | __IFLA_CAIF_HSI_AGGREGATION_TOUT, | ||
192 | __IFLA_CAIF_HSI_HEAD_ALIGN, | ||
193 | __IFLA_CAIF_HSI_TAIL_ALIGN, | ||
194 | __IFLA_CAIF_HSI_QHIGH_WATERMARK, | ||
195 | __IFLA_CAIF_HSI_QLOW_WATERMARK, | ||
196 | __IFLA_CAIF_HSI_MAX | ||
197 | }; | ||
198 | |||
199 | extern struct cfhsi_ops *cfhsi_get_ops(void); | ||
200 | |||
176 | #endif /* CAIF_HSI_H_ */ | 201 | #endif /* CAIF_HSI_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0289d4ce7070..7319f25250b6 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -404,6 +404,8 @@ struct cfg80211_beacon_data { | |||
404 | * | 404 | * |
405 | * Used to configure an AP interface. | 405 | * Used to configure an AP interface. |
406 | * | 406 | * |
407 | * @channel: the channel to start the AP on | ||
408 | * @channel_type: the channel type to use | ||
407 | * @beacon: beacon data | 409 | * @beacon: beacon data |
408 | * @beacon_interval: beacon interval | 410 | * @beacon_interval: beacon interval |
409 | * @dtim_period: DTIM period | 411 | * @dtim_period: DTIM period |
@@ -417,6 +419,9 @@ struct cfg80211_beacon_data { | |||
417 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 419 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
418 | */ | 420 | */ |
419 | struct cfg80211_ap_settings { | 421 | struct cfg80211_ap_settings { |
422 | struct ieee80211_channel *channel; | ||
423 | enum nl80211_channel_type channel_type; | ||
424 | |||
420 | struct cfg80211_beacon_data beacon; | 425 | struct cfg80211_beacon_data beacon; |
421 | 426 | ||
422 | int beacon_interval, dtim_period; | 427 | int beacon_interval, dtim_period; |
@@ -826,6 +831,8 @@ struct mesh_config { | |||
826 | 831 | ||
827 | /** | 832 | /** |
828 | * struct mesh_setup - 802.11s mesh setup configuration | 833 | * struct mesh_setup - 802.11s mesh setup configuration |
834 | * @channel: the channel to start the mesh network on | ||
835 | * @channel_type: the channel type to use | ||
829 | * @mesh_id: the mesh ID | 836 | * @mesh_id: the mesh ID |
830 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 837 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
831 | * @sync_method: which synchronization method to use | 838 | * @sync_method: which synchronization method to use |
@@ -840,6 +847,8 @@ struct mesh_config { | |||
840 | * These parameters are fixed when the mesh is created. | 847 | * These parameters are fixed when the mesh is created. |
841 | */ | 848 | */ |
842 | struct mesh_setup { | 849 | struct mesh_setup { |
850 | struct ieee80211_channel *channel; | ||
851 | enum nl80211_channel_type channel_type; | ||
843 | const u8 *mesh_id; | 852 | const u8 *mesh_id; |
844 | u8 mesh_id_len; | 853 | u8 mesh_id_len; |
845 | u8 sync_method; | 854 | u8 sync_method; |
@@ -1411,11 +1420,14 @@ struct cfg80211_gtk_rekey_data { | |||
1411 | * | 1420 | * |
1412 | * @set_txq_params: Set TX queue parameters | 1421 | * @set_txq_params: Set TX queue parameters |
1413 | * | 1422 | * |
1414 | * @set_channel: Set channel for a given wireless interface. Some devices | 1423 | * @libertas_set_mesh_channel: Only for backward compatibility for libertas, |
1415 | * may support multi-channel operation (by channel hopping) so cfg80211 | 1424 | * as it doesn't implement join_mesh and needs to set the channel to |
1416 | * doesn't verify much. Note, however, that the passed netdev may be | 1425 | * join the mesh instead. |
1417 | * %NULL as well if the user requested changing the channel for the | 1426 | * |
1418 | * device itself, or for a monitor interface. | 1427 | * @set_monitor_channel: Set the monitor mode channel for the device. If other |
1428 | * interfaces are active this callback should reject the configuration. | ||
1429 | * If no interfaces are active or the device is down, the channel should | ||
1430 | * be stored for when a monitor interface becomes active. | ||
1419 | * @get_channel: Get the current operating channel, should return %NULL if | 1431 | * @get_channel: Get the current operating channel, should return %NULL if |
1420 | * there's no single defined operating channel if for example the | 1432 | * there's no single defined operating channel if for example the |
1421 | * device implements channel hopping for multi-channel virtual interfaces. | 1433 | * device implements channel hopping for multi-channel virtual interfaces. |
@@ -1605,9 +1617,13 @@ struct cfg80211_ops { | |||
1605 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, | 1617 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, |
1606 | struct ieee80211_txq_params *params); | 1618 | struct ieee80211_txq_params *params); |
1607 | 1619 | ||
1608 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, | 1620 | int (*libertas_set_mesh_channel)(struct wiphy *wiphy, |
1609 | struct ieee80211_channel *chan, | 1621 | struct net_device *dev, |
1610 | enum nl80211_channel_type channel_type); | 1622 | struct ieee80211_channel *chan); |
1623 | |||
1624 | int (*set_monitor_channel)(struct wiphy *wiphy, | ||
1625 | struct ieee80211_channel *chan, | ||
1626 | enum nl80211_channel_type channel_type); | ||
1611 | 1627 | ||
1612 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, | 1628 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, |
1613 | struct cfg80211_scan_request *request); | 1629 | struct cfg80211_scan_request *request); |
@@ -2263,7 +2279,10 @@ struct cfg80211_cached_keys; | |||
2263 | * @netdev: (private) Used to reference back to the netdev | 2279 | * @netdev: (private) Used to reference back to the netdev |
2264 | * @current_bss: (private) Used by the internal configuration code | 2280 | * @current_bss: (private) Used by the internal configuration code |
2265 | * @channel: (private) Used by the internal configuration code to track | 2281 | * @channel: (private) Used by the internal configuration code to track |
2266 | * user-set AP, monitor and WDS channels for wireless extensions | 2282 | * the user-set AP, monitor and WDS channel |
2283 | * @preset_chan: (private) Used by the internal configuration code to | ||
2284 | * track the channel to be used for AP later | ||
2285 | * @preset_chantype: (private) the corresponding channel type | ||
2267 | * @bssid: (private) Used by the internal configuration code | 2286 | * @bssid: (private) Used by the internal configuration code |
2268 | * @ssid: (private) Used by the internal configuration code | 2287 | * @ssid: (private) Used by the internal configuration code |
2269 | * @ssid_len: (private) Used by the internal configuration code | 2288 | * @ssid_len: (private) Used by the internal configuration code |
@@ -2313,7 +2332,8 @@ struct wireless_dev { | |||
2313 | spinlock_t event_lock; | 2332 | spinlock_t event_lock; |
2314 | 2333 | ||
2315 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2334 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2316 | struct ieee80211_channel *channel; | 2335 | struct ieee80211_channel *preset_chan; |
2336 | enum nl80211_channel_type preset_chantype; | ||
2317 | 2337 | ||
2318 | bool ps; | 2338 | bool ps; |
2319 | int ps_timeout; | 2339 | int ps_timeout; |
@@ -3359,11 +3379,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
3359 | const u8 *frame, size_t len, | 3379 | const u8 *frame, size_t len, |
3360 | int freq, int sig_dbm, gfp_t gfp); | 3380 | int freq, int sig_dbm, gfp_t gfp); |
3361 | 3381 | ||
3362 | /* | 3382 | /** |
3363 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3383 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used |
3364 | * @wiphy: the wiphy | 3384 | * @wiphy: the wiphy |
3365 | * @chan: main channel | 3385 | * @chan: main channel |
3366 | * @channel_type: HT mode | 3386 | * @channel_type: HT mode |
3387 | * | ||
3388 | * This function returns true if there is no secondary channel or the secondary | ||
3389 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | ||
3367 | */ | 3390 | */ |
3368 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3391 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, |
3369 | struct ieee80211_channel *chan, | 3392 | struct ieee80211_channel *chan, |
diff --git a/include/net/dst.h b/include/net/dst.h index 8197eadca819..f0bf3b8d5911 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -48,8 +48,8 @@ struct dst_entry { | |||
48 | #else | 48 | #else |
49 | void *__pad1; | 49 | void *__pad1; |
50 | #endif | 50 | #endif |
51 | int (*input)(struct sk_buff*); | 51 | int (*input)(struct sk_buff *); |
52 | int (*output)(struct sk_buff*); | 52 | int (*output)(struct sk_buff *); |
53 | 53 | ||
54 | int flags; | 54 | int flags; |
55 | #define DST_HOST 0x0001 | 55 | #define DST_HOST 0x0001 |
@@ -241,7 +241,7 @@ dst_metric_locked(const struct dst_entry *dst, int metric) | |||
241 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | 241 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
242 | } | 242 | } |
243 | 243 | ||
244 | static inline void dst_hold(struct dst_entry * dst) | 244 | static inline void dst_hold(struct dst_entry *dst) |
245 | { | 245 | { |
246 | /* | 246 | /* |
247 | * If your kernel compilation stops here, please check | 247 | * If your kernel compilation stops here, please check |
@@ -264,8 +264,7 @@ static inline void dst_use_noref(struct dst_entry *dst, unsigned long time) | |||
264 | dst->lastuse = time; | 264 | dst->lastuse = time; |
265 | } | 265 | } |
266 | 266 | ||
267 | static inline | 267 | static inline struct dst_entry *dst_clone(struct dst_entry *dst) |
268 | struct dst_entry * dst_clone(struct dst_entry * dst) | ||
269 | { | 268 | { |
270 | if (dst) | 269 | if (dst) |
271 | atomic_inc(&dst->__refcnt); | 270 | atomic_inc(&dst->__refcnt); |
@@ -371,12 +370,12 @@ static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb) | |||
371 | } | 370 | } |
372 | 371 | ||
373 | extern int dst_discard(struct sk_buff *skb); | 372 | extern int dst_discard(struct sk_buff *skb); |
374 | extern void *dst_alloc(struct dst_ops * ops, struct net_device *dev, | 373 | extern void *dst_alloc(struct dst_ops *ops, struct net_device *dev, |
375 | int initial_ref, int initial_obsolete, int flags); | 374 | int initial_ref, int initial_obsolete, int flags); |
376 | extern void __dst_free(struct dst_entry * dst); | 375 | extern void __dst_free(struct dst_entry *dst); |
377 | extern struct dst_entry *dst_destroy(struct dst_entry * dst); | 376 | extern struct dst_entry *dst_destroy(struct dst_entry *dst); |
378 | 377 | ||
379 | static inline void dst_free(struct dst_entry * dst) | 378 | static inline void dst_free(struct dst_entry *dst) |
380 | { | 379 | { |
381 | if (dst->obsolete > 1) | 380 | if (dst->obsolete > 1) |
382 | return; | 381 | return; |
diff --git a/include/net/flow.h b/include/net/flow.h index 6c469dbdb917..bd524f598561 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -22,6 +22,7 @@ struct flowi_common { | |||
22 | #define FLOWI_FLAG_ANYSRC 0x01 | 22 | #define FLOWI_FLAG_ANYSRC 0x01 |
23 | #define FLOWI_FLAG_PRECOW_METRICS 0x02 | 23 | #define FLOWI_FLAG_PRECOW_METRICS 0x02 |
24 | #define FLOWI_FLAG_CAN_SLEEP 0x04 | 24 | #define FLOWI_FLAG_CAN_SLEEP 0x04 |
25 | #define FLOWI_FLAG_RT_NOCACHE 0x08 | ||
25 | __u32 flowic_secid; | 26 | __u32 flowic_secid; |
26 | }; | 27 | }; |
27 | 28 | ||
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 7d83f90f203f..af3c743a40e4 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -43,7 +43,7 @@ struct inet_connection_sock_af_ops { | |||
43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
44 | struct request_sock *req, | 44 | struct request_sock *req, |
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); |
47 | u16 net_header_len; | 47 | u16 net_header_len; |
48 | u16 net_frag_header_len; | 48 | u16 net_frag_header_len; |
49 | u16 sockaddr_len; | 49 | u16 sockaddr_len; |
@@ -251,7 +251,8 @@ extern int inet_csk_get_port(struct sock *sk, unsigned short snum); | |||
251 | 251 | ||
252 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, | 252 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, |
253 | struct flowi4 *fl4, | 253 | struct flowi4 *fl4, |
254 | const struct request_sock *req); | 254 | const struct request_sock *req, |
255 | bool nocache); | ||
255 | extern struct dst_entry* inet_csk_route_child_sock(struct sock *sk, | 256 | extern struct dst_entry* inet_csk_route_child_sock(struct sock *sk, |
256 | struct sock *newsk, | 257 | struct sock *newsk, |
257 | const struct request_sock *req); | 258 | const struct request_sock *req); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 808fc5f76b03..54be0287eb98 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -379,10 +379,10 @@ static inline struct sock *__inet_lookup_skb(struct inet_hashinfo *hashinfo, | |||
379 | const __be16 sport, | 379 | const __be16 sport, |
380 | const __be16 dport) | 380 | const __be16 dport) |
381 | { | 381 | { |
382 | struct sock *sk; | 382 | struct sock *sk = skb_steal_sock(skb); |
383 | const struct iphdr *iph = ip_hdr(skb); | 383 | const struct iphdr *iph = ip_hdr(skb); |
384 | 384 | ||
385 | if (unlikely(sk = skb_steal_sock(skb))) | 385 | if (sk) |
386 | return sk; | 386 | return sk; |
387 | else | 387 | else |
388 | return __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, | 388 | return __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 2040bff945d4..c27c8f10ebdc 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -65,6 +65,69 @@ struct inet_peer { | |||
65 | atomic_t refcnt; | 65 | atomic_t refcnt; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct inet_peer_base { | ||
69 | struct inet_peer __rcu *root; | ||
70 | seqlock_t lock; | ||
71 | u32 flush_seq; | ||
72 | int total; | ||
73 | }; | ||
74 | |||
75 | #define INETPEER_BASE_BIT 0x1UL | ||
76 | |||
77 | static inline struct inet_peer *inetpeer_ptr(unsigned long val) | ||
78 | { | ||
79 | BUG_ON(val & INETPEER_BASE_BIT); | ||
80 | return (struct inet_peer *) val; | ||
81 | } | ||
82 | |||
83 | static inline struct inet_peer_base *inetpeer_base_ptr(unsigned long val) | ||
84 | { | ||
85 | if (!(val & INETPEER_BASE_BIT)) | ||
86 | return NULL; | ||
87 | val &= ~INETPEER_BASE_BIT; | ||
88 | return (struct inet_peer_base *) val; | ||
89 | } | ||
90 | |||
91 | static inline bool inetpeer_ptr_is_peer(unsigned long val) | ||
92 | { | ||
93 | return !(val & INETPEER_BASE_BIT); | ||
94 | } | ||
95 | |||
96 | static inline void __inetpeer_ptr_set_peer(unsigned long *val, struct inet_peer *peer) | ||
97 | { | ||
98 | /* This implicitly clears INETPEER_BASE_BIT */ | ||
99 | *val = (unsigned long) peer; | ||
100 | } | ||
101 | |||
102 | static inline bool inetpeer_ptr_set_peer(unsigned long *ptr, struct inet_peer *peer) | ||
103 | { | ||
104 | unsigned long val = (unsigned long) peer; | ||
105 | unsigned long orig = *ptr; | ||
106 | |||
107 | if (!(orig & INETPEER_BASE_BIT) || | ||
108 | cmpxchg(ptr, orig, val) != orig) | ||
109 | return false; | ||
110 | return true; | ||
111 | } | ||
112 | |||
113 | static inline void inetpeer_init_ptr(unsigned long *ptr, struct inet_peer_base *base) | ||
114 | { | ||
115 | *ptr = (unsigned long) base | INETPEER_BASE_BIT; | ||
116 | } | ||
117 | |||
118 | static inline void inetpeer_transfer_peer(unsigned long *to, unsigned long *from) | ||
119 | { | ||
120 | unsigned long val = *from; | ||
121 | |||
122 | *to = val; | ||
123 | if (inetpeer_ptr_is_peer(val)) { | ||
124 | struct inet_peer *peer = inetpeer_ptr(val); | ||
125 | atomic_inc(&peer->refcnt); | ||
126 | } | ||
127 | } | ||
128 | |||
129 | extern void inet_peer_base_init(struct inet_peer_base *); | ||
130 | |||
68 | void inet_initpeers(void) __init; | 131 | void inet_initpeers(void) __init; |
69 | 132 | ||
70 | #define INETPEER_METRICS_NEW (~(u32) 0) | 133 | #define INETPEER_METRICS_NEW (~(u32) 0) |
@@ -75,31 +138,38 @@ static inline bool inet_metrics_new(const struct inet_peer *p) | |||
75 | } | 138 | } |
76 | 139 | ||
77 | /* can be called with or without local BH being disabled */ | 140 | /* can be called with or without local BH being disabled */ |
78 | struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create); | 141 | struct inet_peer *inet_getpeer(struct inet_peer_base *base, |
142 | const struct inetpeer_addr *daddr, | ||
143 | int create); | ||
79 | 144 | ||
80 | static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | 145 | static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base, |
146 | __be32 v4daddr, | ||
147 | int create) | ||
81 | { | 148 | { |
82 | struct inetpeer_addr daddr; | 149 | struct inetpeer_addr daddr; |
83 | 150 | ||
84 | daddr.addr.a4 = v4daddr; | 151 | daddr.addr.a4 = v4daddr; |
85 | daddr.family = AF_INET; | 152 | daddr.family = AF_INET; |
86 | return inet_getpeer(&daddr, create); | 153 | return inet_getpeer(base, &daddr, create); |
87 | } | 154 | } |
88 | 155 | ||
89 | static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, int create) | 156 | static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base, |
157 | const struct in6_addr *v6daddr, | ||
158 | int create) | ||
90 | { | 159 | { |
91 | struct inetpeer_addr daddr; | 160 | struct inetpeer_addr daddr; |
92 | 161 | ||
93 | *(struct in6_addr *)daddr.addr.a6 = *v6daddr; | 162 | *(struct in6_addr *)daddr.addr.a6 = *v6daddr; |
94 | daddr.family = AF_INET6; | 163 | daddr.family = AF_INET6; |
95 | return inet_getpeer(&daddr, create); | 164 | return inet_getpeer(base, &daddr, create); |
96 | } | 165 | } |
97 | 166 | ||
98 | /* can be called from BH context or outside */ | 167 | /* can be called from BH context or outside */ |
99 | extern void inet_putpeer(struct inet_peer *p); | 168 | extern void inet_putpeer(struct inet_peer *p); |
100 | extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); | 169 | extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); |
101 | 170 | ||
102 | extern void inetpeer_invalidate_tree(int family); | 171 | extern void inetpeer_invalidate_tree(struct inet_peer_base *); |
172 | extern void inetpeer_invalidate_family(int family); | ||
103 | 173 | ||
104 | /* | 174 | /* |
105 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, | 175 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, |
diff --git a/include/net/ip.h b/include/net/ip.h index 83e0619f59d0..ec5cfde85e9a 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -158,8 +158,9 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
158 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; | 158 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; |
159 | } | 159 | } |
160 | 160 | ||
161 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, | 161 | void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
162 | const struct ip_reply_arg *arg, unsigned int len); | 162 | __be32 saddr, const struct ip_reply_arg *arg, |
163 | unsigned int len); | ||
163 | 164 | ||
164 | struct ipv4_config { | 165 | struct ipv4_config { |
165 | int log_martians; | 166 | int log_martians; |
@@ -210,6 +211,9 @@ extern int inet_peer_threshold; | |||
210 | extern int inet_peer_minttl; | 211 | extern int inet_peer_minttl; |
211 | extern int inet_peer_maxttl; | 212 | extern int inet_peer_maxttl; |
212 | 213 | ||
214 | /* From ip_input.c */ | ||
215 | extern int sysctl_ip_early_demux; | ||
216 | |||
213 | /* From ip_output.c */ | 217 | /* From ip_output.c */ |
214 | extern int sysctl_ip_dynaddr; | 218 | extern int sysctl_ip_dynaddr; |
215 | 219 | ||
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 0ae759a6c76e..a192f7807659 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -107,7 +107,7 @@ struct rt6_info { | |||
107 | u32 rt6i_peer_genid; | 107 | u32 rt6i_peer_genid; |
108 | 108 | ||
109 | struct inet6_dev *rt6i_idev; | 109 | struct inet6_dev *rt6i_idev; |
110 | struct inet_peer *rt6i_peer; | 110 | unsigned long _rt6i_peer; |
111 | 111 | ||
112 | #ifdef CONFIG_XFRM | 112 | #ifdef CONFIG_XFRM |
113 | u32 rt6i_flow_cache_genid; | 113 | u32 rt6i_flow_cache_genid; |
@@ -118,6 +118,36 @@ struct rt6_info { | |||
118 | u8 rt6i_protocol; | 118 | u8 rt6i_protocol; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | static inline struct inet_peer *rt6_peer_ptr(struct rt6_info *rt) | ||
122 | { | ||
123 | return inetpeer_ptr(rt->_rt6i_peer); | ||
124 | } | ||
125 | |||
126 | static inline bool rt6_has_peer(struct rt6_info *rt) | ||
127 | { | ||
128 | return inetpeer_ptr_is_peer(rt->_rt6i_peer); | ||
129 | } | ||
130 | |||
131 | static inline void __rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer) | ||
132 | { | ||
133 | __inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer); | ||
134 | } | ||
135 | |||
136 | static inline bool rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer) | ||
137 | { | ||
138 | return inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer); | ||
139 | } | ||
140 | |||
141 | static inline void rt6_init_peer(struct rt6_info *rt, struct inet_peer_base *base) | ||
142 | { | ||
143 | inetpeer_init_ptr(&rt->_rt6i_peer, base); | ||
144 | } | ||
145 | |||
146 | static inline void rt6_transfer_peer(struct rt6_info *rt, struct rt6_info *ort) | ||
147 | { | ||
148 | inetpeer_transfer_peer(&rt->_rt6i_peer, &ort->_rt6i_peer); | ||
149 | } | ||
150 | |||
121 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | 151 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) |
122 | { | 152 | { |
123 | return ((struct rt6_info *)dst)->rt6i_idev; | 153 | return ((struct rt6_info *)dst)->rt6i_idev; |
@@ -207,6 +237,7 @@ struct fib6_table { | |||
207 | u32 tb6_id; | 237 | u32 tb6_id; |
208 | rwlock_t tb6_lock; | 238 | rwlock_t tb6_lock; |
209 | struct fib6_node tb6_root; | 239 | struct fib6_node tb6_root; |
240 | struct inet_peer_base tb6_peers; | ||
210 | }; | 241 | }; |
211 | 242 | ||
212 | #define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC | 243 | #define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 37c1a1ed82c1..58cb3fc34879 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -53,16 +53,25 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
53 | return (flags >> 3) & 7; | 53 | return (flags >> 3) & 7; |
54 | } | 54 | } |
55 | 55 | ||
56 | extern void rt6_bind_peer(struct rt6_info *rt, | 56 | extern void rt6_bind_peer(struct rt6_info *rt, int create); |
57 | int create); | 57 | |
58 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) | ||
59 | { | ||
60 | if (rt6_has_peer(rt)) | ||
61 | return rt6_peer_ptr(rt); | ||
62 | |||
63 | rt6_bind_peer(rt, create); | ||
64 | return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL); | ||
65 | } | ||
58 | 66 | ||
59 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | 67 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) |
60 | { | 68 | { |
61 | if (rt->rt6i_peer) | 69 | return __rt6_get_peer(rt, 0); |
62 | return rt->rt6i_peer; | 70 | } |
63 | 71 | ||
64 | rt6_bind_peer(rt, 0); | 72 | static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) |
65 | return rt->rt6i_peer; | 73 | { |
74 | return __rt6_get_peer(rt, 1); | ||
66 | } | 75 | } |
67 | 76 | ||
68 | extern void ip6_route_input(struct sk_buff *skb); | 77 | extern void ip6_route_input(struct sk_buff *skb); |
@@ -131,10 +140,10 @@ extern void rt6_redirect(const struct in6_addr *dest, | |||
131 | u8 *lladdr, | 140 | u8 *lladdr, |
132 | int on_link); | 141 | int on_link); |
133 | 142 | ||
134 | extern void rt6_pmtu_discovery(const struct in6_addr *daddr, | 143 | extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, |
135 | const struct in6_addr *saddr, | 144 | int oif, u32 mark); |
136 | struct net_device *dev, | 145 | extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, |
137 | u32 pmtu); | 146 | __be32 mtu); |
138 | 147 | ||
139 | struct netlink_callback; | 148 | struct netlink_callback; |
140 | 149 | ||
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 78df0866cc38..9e6c26d4ba4c 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <net/flow.h> | 19 | #include <net/flow.h> |
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <net/fib_rules.h> | 21 | #include <net/fib_rules.h> |
22 | #include <net/inetpeer.h> | ||
22 | 23 | ||
23 | struct fib_config { | 24 | struct fib_config { |
24 | u8 fc_dst_len; | 25 | u8 fc_dst_len; |
@@ -157,11 +158,12 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); | |||
157 | FIB_RES_SADDR(net, res)) | 158 | FIB_RES_SADDR(net, res)) |
158 | 159 | ||
159 | struct fib_table { | 160 | struct fib_table { |
160 | struct hlist_node tb_hlist; | 161 | struct hlist_node tb_hlist; |
161 | u32 tb_id; | 162 | u32 tb_id; |
162 | int tb_default; | 163 | int tb_default; |
163 | int tb_num_default; | 164 | int tb_num_default; |
164 | unsigned long tb_data[0]; | 165 | struct inet_peer_base tb_peers; |
166 | unsigned long tb_data[0]; | ||
165 | }; | 167 | }; |
166 | 168 | ||
167 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, | 169 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, |
@@ -228,9 +230,10 @@ extern struct fib_table *fib_get_table(struct net *net, u32 id); | |||
228 | /* Exported by fib_frontend.c */ | 230 | /* Exported by fib_frontend.c */ |
229 | extern const struct nla_policy rtm_ipv4_policy[]; | 231 | extern const struct nla_policy rtm_ipv4_policy[]; |
230 | extern void ip_fib_init(void); | 232 | extern void ip_fib_init(void); |
233 | extern __be32 fib_compute_spec_dst(struct sk_buff *skb); | ||
231 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, | 234 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, |
232 | u8 tos, int oif, struct net_device *dev, | 235 | u8 tos, int oif, struct net_device *dev, |
233 | __be32 *spec_dst, u32 *itag); | 236 | u32 *itag); |
234 | extern void fib_select_default(struct fib_result *res); | 237 | extern void fib_select_default(struct fib_result *res); |
235 | 238 | ||
236 | /* Exported by fib_semantics.c */ | 239 | /* Exported by fib_semantics.c */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 95e39b6a02ec..6914f9978aea 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1297,6 +1297,10 @@ enum ieee80211_hw_flags { | |||
1297 | * reports, by default it is set to _MCS, _GI and _BW but doesn't | 1297 | * reports, by default it is set to _MCS, _GI and _BW but doesn't |
1298 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only | 1298 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only |
1299 | * adding _BW is supported today. | 1299 | * adding _BW is supported today. |
1300 | * | ||
1301 | * @netdev_features: netdev features to be set in each netdev created | ||
1302 | * from this HW. Note only HW checksum features are currently | ||
1303 | * compatible with mac80211. Other feature bits will be rejected. | ||
1300 | */ | 1304 | */ |
1301 | struct ieee80211_hw { | 1305 | struct ieee80211_hw { |
1302 | struct ieee80211_conf conf; | 1306 | struct ieee80211_conf conf; |
@@ -1319,6 +1323,7 @@ struct ieee80211_hw { | |||
1319 | u8 max_tx_aggregation_subframes; | 1323 | u8 max_tx_aggregation_subframes; |
1320 | u8 offchannel_tx_hw_queue; | 1324 | u8 offchannel_tx_hw_queue; |
1321 | u8 radiotap_mcs_details; | 1325 | u8 radiotap_mcs_details; |
1326 | netdev_features_t netdev_features; | ||
1322 | }; | 1327 | }; |
1323 | 1328 | ||
1324 | /** | 1329 | /** |
@@ -2183,7 +2188,10 @@ enum ieee80211_rate_control_changed { | |||
2183 | * offload. Frames to transmit on the off-channel channel are transmitted | 2188 | * offload. Frames to transmit on the off-channel channel are transmitted |
2184 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the | 2189 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the |
2185 | * duration (which will always be non-zero) expires, the driver must call | 2190 | * duration (which will always be non-zero) expires, the driver must call |
2186 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | 2191 | * ieee80211_remain_on_channel_expired(). |
2192 | * Note that this callback may be called while the device is in IDLE and | ||
2193 | * must be accepted in this case. | ||
2194 | * This callback may sleep. | ||
2187 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | 2195 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is |
2188 | * aborted before it expires. This callback may sleep. | 2196 | * aborted before it expires. This callback may sleep. |
2189 | * | 2197 | * |
@@ -3557,16 +3565,6 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
3557 | gfp_t gfp); | 3565 | gfp_t gfp); |
3558 | 3566 | ||
3559 | /** | 3567 | /** |
3560 | * ieee80211_get_operstate - get the operstate of the vif | ||
3561 | * | ||
3562 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3563 | * | ||
3564 | * The driver might need to know the operstate of the net_device | ||
3565 | * (specifically, whether the link is IF_OPER_UP after resume) | ||
3566 | */ | ||
3567 | unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif); | ||
3568 | |||
3569 | /** | ||
3570 | * ieee80211_chswitch_done - Complete channel switch process | 3568 | * ieee80211_chswitch_done - Complete channel switch process |
3571 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3569 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
3572 | * @success: make the channel switch successful or not | 3570 | * @success: make the channel switch successful or not |
@@ -3845,4 +3843,28 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, | |||
3845 | */ | 3843 | */ |
3846 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); | 3844 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); |
3847 | 3845 | ||
3846 | /* Extra debugging macros */ | ||
3847 | |||
3848 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
3849 | #define ht_vdbg(fmt, ...) \ | ||
3850 | pr_debug(fmt, ##__VA_ARGS__) | ||
3851 | #else | ||
3852 | #define ht_vdbg(fmt, ...) \ | ||
3853 | do { \ | ||
3854 | if (0) \ | ||
3855 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
3856 | } while (0) | ||
3857 | #endif | ||
3858 | |||
3859 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | ||
3860 | #define ibss_vdbg(fmt, ...) \ | ||
3861 | pr_debug(fmt, ##__VA_ARGS__) | ||
3862 | #else | ||
3863 | #define ibss_vdbg(fmt, ...) \ | ||
3864 | do { \ | ||
3865 | if (0) \ | ||
3866 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
3867 | } while (0) | ||
3868 | #endif | ||
3869 | |||
3848 | #endif /* MAC80211_H */ | 3870 | #endif /* MAC80211_H */ |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index c9f8ab5cc687..d0d11df9cba1 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
@@ -21,6 +21,14 @@ | |||
21 | 21 | ||
22 | #include <net/af_ieee802154.h> | 22 | #include <net/af_ieee802154.h> |
23 | 23 | ||
24 | /* General MAC frame format: | ||
25 | * 2 bytes: Frame Control | ||
26 | * 1 byte: Sequence Number | ||
27 | * 20 bytes: Addressing fields | ||
28 | * 14 bytes: Auxiliary Security Header | ||
29 | */ | ||
30 | #define MAC802154_FRAME_HARD_HEADER_LEN (2 + 1 + 20 + 14) | ||
31 | |||
24 | /* The following flags are used to indicate changed address settings from | 32 | /* The following flags are used to indicate changed address settings from |
25 | * the stack to the hardware. | 33 | * the stack to the hardware. |
26 | */ | 34 | */ |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index cce7f6a798bf..f1494feba79f 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -39,36 +39,6 @@ union nf_conntrack_expect_proto { | |||
39 | /* insert expect proto private data here */ | 39 | /* insert expect proto private data here */ |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* Add protocol helper include file here */ | ||
43 | #include <linux/netfilter/nf_conntrack_ftp.h> | ||
44 | #include <linux/netfilter/nf_conntrack_pptp.h> | ||
45 | #include <linux/netfilter/nf_conntrack_h323.h> | ||
46 | #include <linux/netfilter/nf_conntrack_sane.h> | ||
47 | #include <linux/netfilter/nf_conntrack_sip.h> | ||
48 | |||
49 | /* per conntrack: application helper private data */ | ||
50 | union nf_conntrack_help { | ||
51 | /* insert conntrack helper private data (master) here */ | ||
52 | #if defined(CONFIG_NF_CONNTRACK_FTP) || defined(CONFIG_NF_CONNTRACK_FTP_MODULE) | ||
53 | struct nf_ct_ftp_master ct_ftp_info; | ||
54 | #endif | ||
55 | #if defined(CONFIG_NF_CONNTRACK_PPTP) || \ | ||
56 | defined(CONFIG_NF_CONNTRACK_PPTP_MODULE) | ||
57 | struct nf_ct_pptp_master ct_pptp_info; | ||
58 | #endif | ||
59 | #if defined(CONFIG_NF_CONNTRACK_H323) || \ | ||
60 | defined(CONFIG_NF_CONNTRACK_H323_MODULE) | ||
61 | struct nf_ct_h323_master ct_h323_info; | ||
62 | #endif | ||
63 | #if defined(CONFIG_NF_CONNTRACK_SANE) || \ | ||
64 | defined(CONFIG_NF_CONNTRACK_SANE_MODULE) | ||
65 | struct nf_ct_sane_master ct_sane_info; | ||
66 | #endif | ||
67 | #if defined(CONFIG_NF_CONNTRACK_SIP) || defined(CONFIG_NF_CONNTRACK_SIP_MODULE) | ||
68 | struct nf_ct_sip_master ct_sip_info; | ||
69 | #endif | ||
70 | }; | ||
71 | |||
72 | #include <linux/types.h> | 42 | #include <linux/types.h> |
73 | #include <linux/skbuff.h> | 43 | #include <linux/skbuff.h> |
74 | #include <linux/timer.h> | 44 | #include <linux/timer.h> |
@@ -89,12 +59,13 @@ struct nf_conn_help { | |||
89 | /* Helper. if any */ | 59 | /* Helper. if any */ |
90 | struct nf_conntrack_helper __rcu *helper; | 60 | struct nf_conntrack_helper __rcu *helper; |
91 | 61 | ||
92 | union nf_conntrack_help help; | ||
93 | |||
94 | struct hlist_head expectations; | 62 | struct hlist_head expectations; |
95 | 63 | ||
96 | /* Current number of expected connections */ | 64 | /* Current number of expected connections */ |
97 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; | 65 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; |
66 | |||
67 | /* private helper information. */ | ||
68 | char data[]; | ||
98 | }; | 69 | }; |
99 | 70 | ||
100 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 71 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index aced085132e7..d8f5b9f52169 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -28,8 +28,8 @@ extern unsigned int nf_conntrack_in(struct net *net, | |||
28 | extern int nf_conntrack_init(struct net *net); | 28 | extern int nf_conntrack_init(struct net *net); |
29 | extern void nf_conntrack_cleanup(struct net *net); | 29 | extern void nf_conntrack_cleanup(struct net *net); |
30 | 30 | ||
31 | extern int nf_conntrack_proto_init(void); | 31 | extern int nf_conntrack_proto_init(struct net *net); |
32 | extern void nf_conntrack_proto_fini(void); | 32 | extern void nf_conntrack_proto_fini(struct net *net); |
33 | 33 | ||
34 | extern bool | 34 | extern bool |
35 | nf_ct_get_tuple(const struct sk_buff *skb, | 35 | nf_ct_get_tuple(const struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 4619caadd9d1..983f00263243 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -59,10 +59,12 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) | |||
59 | return nf_ct_net(exp->master); | 59 | return nf_ct_net(exp->master); |
60 | } | 60 | } |
61 | 61 | ||
62 | #define NF_CT_EXP_POLICY_NAME_LEN 16 | ||
63 | |||
62 | struct nf_conntrack_expect_policy { | 64 | struct nf_conntrack_expect_policy { |
63 | unsigned int max_expected; | 65 | unsigned int max_expected; |
64 | unsigned int timeout; | 66 | unsigned int timeout; |
65 | const char *name; | 67 | char name[NF_CT_EXP_POLICY_NAME_LEN]; |
66 | }; | 68 | }; |
67 | 69 | ||
68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 70 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 96755c3798a5..8b4d1fc29096 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -80,10 +80,13 @@ static inline void nf_ct_ext_free(struct nf_conn *ct) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | /* Add this type, returns pointer to data or NULL. */ | 82 | /* Add this type, returns pointer to data or NULL. */ |
83 | void * | 83 | void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, |
84 | __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); | 84 | size_t var_alloc_len, gfp_t gfp); |
85 | |||
85 | #define nf_ct_ext_add(ct, id, gfp) \ | 86 | #define nf_ct_ext_add(ct, id, gfp) \ |
86 | ((id##_TYPE *)__nf_ct_ext_add((ct), (id), (gfp))) | 87 | ((id##_TYPE *)__nf_ct_ext_add_length((ct), (id), 0, (gfp))) |
88 | #define nf_ct_ext_add_length(ct, id, len, gfp) \ | ||
89 | ((id##_TYPE *)__nf_ct_ext_add_length((ct), (id), (len), (gfp))) | ||
87 | 90 | ||
88 | #define NF_CT_EXT_F_PREALLOC 0x0001 | 91 | #define NF_CT_EXT_F_PREALLOC 0x0001 |
89 | 92 | ||
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 1d1889409b9e..9aad956d1008 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -11,18 +11,27 @@ | |||
11 | #define _NF_CONNTRACK_HELPER_H | 11 | #define _NF_CONNTRACK_HELPER_H |
12 | #include <net/netfilter/nf_conntrack.h> | 12 | #include <net/netfilter/nf_conntrack.h> |
13 | #include <net/netfilter/nf_conntrack_extend.h> | 13 | #include <net/netfilter/nf_conntrack_extend.h> |
14 | #include <net/netfilter/nf_conntrack_expect.h> | ||
14 | 15 | ||
15 | struct module; | 16 | struct module; |
16 | 17 | ||
18 | enum nf_ct_helper_flags { | ||
19 | NF_CT_HELPER_F_USERSPACE = (1 << 0), | ||
20 | NF_CT_HELPER_F_CONFIGURED = (1 << 1), | ||
21 | }; | ||
22 | |||
17 | #define NF_CT_HELPER_NAME_LEN 16 | 23 | #define NF_CT_HELPER_NAME_LEN 16 |
18 | 24 | ||
19 | struct nf_conntrack_helper { | 25 | struct nf_conntrack_helper { |
20 | struct hlist_node hnode; /* Internal use. */ | 26 | struct hlist_node hnode; /* Internal use. */ |
21 | 27 | ||
22 | const char *name; /* name of the module */ | 28 | char name[NF_CT_HELPER_NAME_LEN]; /* name of the module */ |
23 | struct module *me; /* pointer to self */ | 29 | struct module *me; /* pointer to self */ |
24 | const struct nf_conntrack_expect_policy *expect_policy; | 30 | const struct nf_conntrack_expect_policy *expect_policy; |
25 | 31 | ||
32 | /* length of internal data, ie. sizeof(struct nf_ct_*_master) */ | ||
33 | size_t data_len; | ||
34 | |||
26 | /* Tuple of things we will help (compared against server response) */ | 35 | /* Tuple of things we will help (compared against server response) */ |
27 | struct nf_conntrack_tuple tuple; | 36 | struct nf_conntrack_tuple tuple; |
28 | 37 | ||
@@ -35,8 +44,12 @@ struct nf_conntrack_helper { | |||
35 | 44 | ||
36 | void (*destroy)(struct nf_conn *ct); | 45 | void (*destroy)(struct nf_conn *ct); |
37 | 46 | ||
47 | int (*from_nlattr)(struct nlattr *attr, struct nf_conn *ct); | ||
38 | int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct); | 48 | int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct); |
39 | unsigned int expect_class_max; | 49 | unsigned int expect_class_max; |
50 | |||
51 | unsigned int flags; | ||
52 | unsigned int queue_num; /* For user-space helpers. */ | ||
40 | }; | 53 | }; |
41 | 54 | ||
42 | extern struct nf_conntrack_helper * | 55 | extern struct nf_conntrack_helper * |
@@ -48,7 +61,7 @@ nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum); | |||
48 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 61 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
49 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 62 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
50 | 63 | ||
51 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | 64 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, struct nf_conntrack_helper *helper, gfp_t gfp); |
52 | 65 | ||
53 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, | 66 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
54 | gfp_t flags); | 67 | gfp_t flags); |
@@ -60,6 +73,15 @@ static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | |||
60 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | 73 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); |
61 | } | 74 | } |
62 | 75 | ||
76 | static inline void *nfct_help_data(const struct nf_conn *ct) | ||
77 | { | ||
78 | struct nf_conn_help *help; | ||
79 | |||
80 | help = nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | ||
81 | |||
82 | return (void *)help->data; | ||
83 | } | ||
84 | |||
63 | extern int nf_conntrack_helper_init(struct net *net); | 85 | extern int nf_conntrack_helper_init(struct net *net); |
64 | extern void nf_conntrack_helper_fini(struct net *net); | 86 | extern void nf_conntrack_helper_fini(struct net *net); |
65 | 87 | ||
@@ -82,4 +104,7 @@ nf_ct_helper_expectfn_find_by_name(const char *name); | |||
82 | struct nf_ct_helper_expectfn * | 104 | struct nf_ct_helper_expectfn * |
83 | nf_ct_helper_expectfn_find_by_symbol(const void *symbol); | 105 | nf_ct_helper_expectfn_find_by_symbol(const void *symbol); |
84 | 106 | ||
107 | extern struct hlist_head *nf_ct_helper_hash; | ||
108 | extern unsigned int nf_ct_helper_hsize; | ||
109 | |||
85 | #endif /*_NF_CONNTRACK_HELPER_H*/ | 110 | #endif /*_NF_CONNTRACK_HELPER_H*/ |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 9699c028b74b..6f7c13f4ac03 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -64,11 +64,12 @@ struct nf_conntrack_l3proto { | |||
64 | size_t nla_size; | 64 | size_t nla_size; |
65 | 65 | ||
66 | #ifdef CONFIG_SYSCTL | 66 | #ifdef CONFIG_SYSCTL |
67 | struct ctl_table_header *ctl_table_header; | ||
68 | const char *ctl_table_path; | 67 | const char *ctl_table_path; |
69 | struct ctl_table *ctl_table; | ||
70 | #endif /* CONFIG_SYSCTL */ | 68 | #endif /* CONFIG_SYSCTL */ |
71 | 69 | ||
70 | /* Init l3proto pernet data */ | ||
71 | int (*init_net)(struct net *net); | ||
72 | |||
72 | /* Module (if any) which this is connected to. */ | 73 | /* Module (if any) which this is connected to. */ |
73 | struct module *me; | 74 | struct module *me; |
74 | }; | 75 | }; |
@@ -76,8 +77,10 @@ struct nf_conntrack_l3proto { | |||
76 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; | 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; |
77 | 78 | ||
78 | /* Protocol registration. */ | 79 | /* Protocol registration. */ |
79 | extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); | 80 | extern int nf_conntrack_l3proto_register(struct net *net, |
80 | extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 81 | struct nf_conntrack_l3proto *proto); |
82 | extern void nf_conntrack_l3proto_unregister(struct net *net, | ||
83 | struct nf_conntrack_l3proto *proto); | ||
81 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 84 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
82 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 85 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
83 | 86 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 3b572bb20aa2..81c52b5205f2 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/netlink.h> | 12 | #include <linux/netlink.h> |
13 | #include <net/netlink.h> | 13 | #include <net/netlink.h> |
14 | #include <net/netfilter/nf_conntrack.h> | 14 | #include <net/netfilter/nf_conntrack.h> |
15 | #include <net/netns/generic.h> | ||
15 | 16 | ||
16 | struct seq_file; | 17 | struct seq_file; |
17 | 18 | ||
@@ -86,23 +87,18 @@ struct nf_conntrack_l4proto { | |||
86 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) | 87 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) |
87 | struct { | 88 | struct { |
88 | size_t obj_size; | 89 | size_t obj_size; |
89 | int (*nlattr_to_obj)(struct nlattr *tb[], void *data); | 90 | int (*nlattr_to_obj)(struct nlattr *tb[], |
91 | struct net *net, void *data); | ||
90 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); | 92 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); |
91 | 93 | ||
92 | unsigned int nlattr_max; | 94 | unsigned int nlattr_max; |
93 | const struct nla_policy *nla_policy; | 95 | const struct nla_policy *nla_policy; |
94 | } ctnl_timeout; | 96 | } ctnl_timeout; |
95 | #endif | 97 | #endif |
98 | int *net_id; | ||
99 | /* Init l4proto pernet data */ | ||
100 | int (*init_net)(struct net *net); | ||
96 | 101 | ||
97 | #ifdef CONFIG_SYSCTL | ||
98 | struct ctl_table_header **ctl_table_header; | ||
99 | struct ctl_table *ctl_table; | ||
100 | unsigned int *ctl_table_users; | ||
101 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
102 | struct ctl_table_header *ctl_compat_table_header; | ||
103 | struct ctl_table *ctl_compat_table; | ||
104 | #endif | ||
105 | #endif | ||
106 | /* Protocol name */ | 102 | /* Protocol name */ |
107 | const char *name; | 103 | const char *name; |
108 | 104 | ||
@@ -123,8 +119,10 @@ nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); | |||
123 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); | 119 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
124 | 120 | ||
125 | /* Protocol registration. */ | 121 | /* Protocol registration. */ |
126 | extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto); | 122 | extern int nf_conntrack_l4proto_register(struct net *net, |
127 | extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); | 123 | struct nf_conntrack_l4proto *proto); |
124 | extern void nf_conntrack_l4proto_unregister(struct net *net, | ||
125 | struct nf_conntrack_l4proto *proto); | ||
128 | 126 | ||
129 | /* Generic netlink helpers */ | 127 | /* Generic netlink helpers */ |
130 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | 128 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 02bb6c29dc3d..7d8fb7b46c44 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
@@ -54,4 +54,8 @@ extern void nf_nat_follow_master(struct nf_conn *ct, | |||
54 | extern s16 nf_nat_get_offset(const struct nf_conn *ct, | 54 | extern s16 nf_nat_get_offset(const struct nf_conn *ct, |
55 | enum ip_conntrack_dir dir, | 55 | enum ip_conntrack_dir dir, |
56 | u32 seq); | 56 | u32 seq); |
57 | |||
58 | extern void nf_nat_tcp_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
59 | u32 dir, int off); | ||
60 | |||
57 | #endif | 61 | #endif |
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h new file mode 100644 index 000000000000..86267a529514 --- /dev/null +++ b/include/net/netfilter/nfnetlink_queue.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef _NET_NFNL_QUEUE_H_ | ||
2 | #define _NET_NFNL_QUEUE_H_ | ||
3 | |||
4 | #include <linux/netfilter/nf_conntrack_common.h> | ||
5 | |||
6 | struct nf_conn; | ||
7 | |||
8 | #ifdef CONFIG_NETFILTER_NETLINK_QUEUE_CT | ||
9 | struct nf_conn *nfqnl_ct_get(struct sk_buff *entskb, size_t *size, | ||
10 | enum ip_conntrack_info *ctinfo); | ||
11 | struct nf_conn *nfqnl_ct_parse(const struct sk_buff *skb, | ||
12 | const struct nlattr *attr, | ||
13 | enum ip_conntrack_info *ctinfo); | ||
14 | int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct, | ||
15 | enum ip_conntrack_info ctinfo); | ||
16 | void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
17 | enum ip_conntrack_info ctinfo, int diff); | ||
18 | #else | ||
19 | inline struct nf_conn * | ||
20 | nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo) | ||
21 | { | ||
22 | return NULL; | ||
23 | } | ||
24 | |||
25 | inline struct nf_conn *nfqnl_ct_parse(const struct sk_buff *skb, | ||
26 | const struct nlattr *attr, | ||
27 | enum ip_conntrack_info *ctinfo) | ||
28 | { | ||
29 | return NULL; | ||
30 | } | ||
31 | |||
32 | inline int | ||
33 | nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info ctinfo) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | inline void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
39 | enum ip_conntrack_info ctinfo, int diff) | ||
40 | { | ||
41 | } | ||
42 | #endif /* NF_CONNTRACK */ | ||
43 | #endif | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index a053a19870cf..3aecdc7a84fb 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -4,10 +4,64 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/list_nulls.h> | 5 | #include <linux/list_nulls.h> |
6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
7 | #include <linux/netfilter/nf_conntrack_tcp.h> | ||
7 | 8 | ||
8 | struct ctl_table_header; | 9 | struct ctl_table_header; |
9 | struct nf_conntrack_ecache; | 10 | struct nf_conntrack_ecache; |
10 | 11 | ||
12 | struct nf_proto_net { | ||
13 | #ifdef CONFIG_SYSCTL | ||
14 | struct ctl_table_header *ctl_table_header; | ||
15 | struct ctl_table *ctl_table; | ||
16 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
17 | struct ctl_table_header *ctl_compat_header; | ||
18 | struct ctl_table *ctl_compat_table; | ||
19 | #endif | ||
20 | #endif | ||
21 | unsigned int users; | ||
22 | }; | ||
23 | |||
24 | struct nf_generic_net { | ||
25 | struct nf_proto_net pn; | ||
26 | unsigned int timeout; | ||
27 | }; | ||
28 | |||
29 | struct nf_tcp_net { | ||
30 | struct nf_proto_net pn; | ||
31 | unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; | ||
32 | unsigned int tcp_loose; | ||
33 | unsigned int tcp_be_liberal; | ||
34 | unsigned int tcp_max_retrans; | ||
35 | }; | ||
36 | |||
37 | enum udp_conntrack { | ||
38 | UDP_CT_UNREPLIED, | ||
39 | UDP_CT_REPLIED, | ||
40 | UDP_CT_MAX | ||
41 | }; | ||
42 | |||
43 | struct nf_udp_net { | ||
44 | struct nf_proto_net pn; | ||
45 | unsigned int timeouts[UDP_CT_MAX]; | ||
46 | }; | ||
47 | |||
48 | struct nf_icmp_net { | ||
49 | struct nf_proto_net pn; | ||
50 | unsigned int timeout; | ||
51 | }; | ||
52 | |||
53 | struct nf_ip_net { | ||
54 | struct nf_generic_net generic; | ||
55 | struct nf_tcp_net tcp; | ||
56 | struct nf_udp_net udp; | ||
57 | struct nf_icmp_net icmp; | ||
58 | struct nf_icmp_net icmpv6; | ||
59 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) | ||
60 | struct ctl_table_header *ctl_table_header; | ||
61 | struct ctl_table *ctl_table; | ||
62 | #endif | ||
63 | }; | ||
64 | |||
11 | struct netns_ct { | 65 | struct netns_ct { |
12 | atomic_t count; | 66 | atomic_t count; |
13 | unsigned int expect_count; | 67 | unsigned int expect_count; |
@@ -28,6 +82,7 @@ struct netns_ct { | |||
28 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 82 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
29 | int sysctl_auto_assign_helper; | 83 | int sysctl_auto_assign_helper; |
30 | bool auto_assign_helper_warned; | 84 | bool auto_assign_helper_warned; |
85 | struct nf_ip_net nf_ct_proto; | ||
31 | #ifdef CONFIG_SYSCTL | 86 | #ifdef CONFIG_SYSCTL |
32 | struct ctl_table_header *sysctl_header; | 87 | struct ctl_table_header *sysctl_header; |
33 | struct ctl_table_header *acct_sysctl_header; | 88 | struct ctl_table_header *acct_sysctl_header; |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index bbd023a1c9b9..227f0cd9d3f6 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -30,7 +30,7 @@ struct netns_ipv4 { | |||
30 | 30 | ||
31 | struct sock **icmp_sk; | 31 | struct sock **icmp_sk; |
32 | struct sock *tcp_sock; | 32 | struct sock *tcp_sock; |
33 | 33 | struct inet_peer_base *peers; | |
34 | struct netns_frags frags; | 34 | struct netns_frags frags; |
35 | #ifdef CONFIG_NETFILTER | 35 | #ifdef CONFIG_NETFILTER |
36 | struct xt_table *iptable_filter; | 36 | struct xt_table *iptable_filter; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index b42be53587ba..df0a5456a3fd 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -33,6 +33,7 @@ struct netns_ipv6 { | |||
33 | struct netns_sysctl_ipv6 sysctl; | 33 | struct netns_sysctl_ipv6 sysctl; |
34 | struct ipv6_devconf *devconf_all; | 34 | struct ipv6_devconf *devconf_all; |
35 | struct ipv6_devconf *devconf_dflt; | 35 | struct ipv6_devconf *devconf_dflt; |
36 | struct inet_peer_base *peers; | ||
36 | struct netns_frags frags; | 37 | struct netns_frags frags; |
37 | #ifdef CONFIG_NETFILTER | 38 | #ifdef CONFIG_NETFILTER |
38 | struct xt_table *ip6table_filter; | 39 | struct xt_table *ip6table_filter; |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 4467c9460857..e30e6a869714 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -31,7 +31,8 @@ struct nfc_hci_ops { | |||
31 | void (*close) (struct nfc_hci_dev *hdev); | 31 | void (*close) (struct nfc_hci_dev *hdev); |
32 | int (*hci_ready) (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); | 33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
34 | int (*start_poll) (struct nfc_hci_dev *hdev, u32 protocols); | 34 | int (*start_poll) (struct nfc_hci_dev *hdev, |
35 | u32 im_protocols, u32 tm_protocols); | ||
35 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 36 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
36 | struct nfc_target *target); | 37 | struct nfc_target *target); |
37 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index b7ca4a2a1d72..180964b954ab 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -53,7 +53,8 @@ struct nfc_target; | |||
53 | struct nfc_ops { | 53 | struct nfc_ops { |
54 | int (*dev_up)(struct nfc_dev *dev); | 54 | int (*dev_up)(struct nfc_dev *dev); |
55 | int (*dev_down)(struct nfc_dev *dev); | 55 | int (*dev_down)(struct nfc_dev *dev); |
56 | int (*start_poll)(struct nfc_dev *dev, u32 protocols); | 56 | int (*start_poll)(struct nfc_dev *dev, |
57 | u32 im_protocols, u32 tm_protocols); | ||
57 | void (*stop_poll)(struct nfc_dev *dev); | 58 | void (*stop_poll)(struct nfc_dev *dev); |
58 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, | 59 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, |
59 | u8 comm_mode, u8 *gb, size_t gb_len); | 60 | u8 comm_mode, u8 *gb, size_t gb_len); |
@@ -62,9 +63,10 @@ struct nfc_ops { | |||
62 | u32 protocol); | 63 | u32 protocol); |
63 | void (*deactivate_target)(struct nfc_dev *dev, | 64 | void (*deactivate_target)(struct nfc_dev *dev, |
64 | struct nfc_target *target); | 65 | struct nfc_target *target); |
65 | int (*data_exchange)(struct nfc_dev *dev, struct nfc_target *target, | 66 | int (*im_transceive)(struct nfc_dev *dev, struct nfc_target *target, |
66 | struct sk_buff *skb, data_exchange_cb_t cb, | 67 | struct sk_buff *skb, data_exchange_cb_t cb, |
67 | void *cb_context); | 68 | void *cb_context); |
69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); | ||
68 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); | 70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); |
69 | }; | 71 | }; |
70 | 72 | ||
@@ -99,10 +101,10 @@ struct nfc_dev { | |||
99 | int targets_generation; | 101 | int targets_generation; |
100 | struct device dev; | 102 | struct device dev; |
101 | bool dev_up; | 103 | bool dev_up; |
104 | u8 rf_mode; | ||
102 | bool polling; | 105 | bool polling; |
103 | struct nfc_target *active_target; | 106 | struct nfc_target *active_target; |
104 | bool dep_link_up; | 107 | bool dep_link_up; |
105 | u32 dep_rf_mode; | ||
106 | struct nfc_genl_data genl_data; | 108 | struct nfc_genl_data genl_data; |
107 | u32 supported_protocols; | 109 | u32 supported_protocols; |
108 | 110 | ||
@@ -188,6 +190,7 @@ struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp); | |||
188 | 190 | ||
189 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, | 191 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, |
190 | u8 *gt, u8 gt_len); | 192 | u8 *gt, u8 gt_len); |
193 | u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); | ||
191 | 194 | ||
192 | int nfc_targets_found(struct nfc_dev *dev, | 195 | int nfc_targets_found(struct nfc_dev *dev, |
193 | struct nfc_target *targets, int ntargets); | 196 | struct nfc_target *targets, int ntargets); |
@@ -196,4 +199,9 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); | |||
196 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, | 199 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, |
197 | u8 comm_mode, u8 rf_mode); | 200 | u8 comm_mode, u8 rf_mode); |
198 | 201 | ||
202 | int nfc_tm_activated(struct nfc_dev *dev, u32 protocol, u8 comm_mode, | ||
203 | u8 *gb, size_t gb_len); | ||
204 | int nfc_tm_deactivated(struct nfc_dev *dev); | ||
205 | int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); | ||
206 | |||
199 | #endif /* __NET_NFC_H */ | 207 | #endif /* __NET_NFC_H */ |
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h index ab06afd462da..35e930d2f638 100644 --- a/include/net/nfc/shdlc.h +++ b/include/net/nfc/shdlc.h | |||
@@ -27,7 +27,8 @@ struct nfc_shdlc_ops { | |||
27 | void (*close) (struct nfc_shdlc *shdlc); | 27 | void (*close) (struct nfc_shdlc *shdlc); |
28 | int (*hci_ready) (struct nfc_shdlc *shdlc); | 28 | int (*hci_ready) (struct nfc_shdlc *shdlc); |
29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); | 29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); |
30 | int (*start_poll) (struct nfc_shdlc *shdlc, u32 protocols); | 30 | int (*start_poll) (struct nfc_shdlc *shdlc, |
31 | u32 im_protocols, u32 tm_protocols); | ||
31 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, | 32 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, |
32 | struct nfc_target *target); | 33 | struct nfc_target *target); |
33 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | 34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 875f4895b033..057f2d315567 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -29,11 +29,15 @@ | |||
29 | #include <linux/ipv6.h> | 29 | #include <linux/ipv6.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define MAX_INET_PROTOS 256 /* Must be a power of 2 */ | 32 | /* This is one larger than the largest protocol value that can be |
33 | 33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | |
34 | * value is presented in a __u8, this is defined to be 256. | ||
35 | */ | ||
36 | #define MAX_INET_PROTOS 256 | ||
34 | 37 | ||
35 | /* This is used to register protocols. */ | 38 | /* This is used to register protocols. */ |
36 | struct net_protocol { | 39 | struct net_protocol { |
40 | void (*early_demux)(struct sk_buff *skb); | ||
37 | int (*handler)(struct sk_buff *skb); | 41 | int (*handler)(struct sk_buff *skb); |
38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 42 | void (*err_handler)(struct sk_buff *skb, u32 info); |
39 | int (*gso_send_check)(struct sk_buff *skb); | 43 | int (*gso_send_check)(struct sk_buff *skb); |
diff --git a/include/net/route.h b/include/net/route.h index 98705468ac03..211e2665139b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -65,12 +65,45 @@ struct rtable { | |||
65 | __be32 rt_gateway; | 65 | __be32 rt_gateway; |
66 | 66 | ||
67 | /* Miscellaneous cached information */ | 67 | /* Miscellaneous cached information */ |
68 | __be32 rt_spec_dst; /* RFC1122 specific destination */ | ||
69 | u32 rt_peer_genid; | 68 | u32 rt_peer_genid; |
70 | struct inet_peer *peer; /* long-living peer info */ | 69 | unsigned long _peer; /* long-living peer info */ |
71 | struct fib_info *fi; /* for client ref to shared metrics */ | 70 | struct fib_info *fi; /* for client ref to shared metrics */ |
72 | }; | 71 | }; |
73 | 72 | ||
73 | static inline struct inet_peer *rt_peer_ptr(struct rtable *rt) | ||
74 | { | ||
75 | return inetpeer_ptr(rt->_peer); | ||
76 | } | ||
77 | |||
78 | static inline bool rt_has_peer(struct rtable *rt) | ||
79 | { | ||
80 | return inetpeer_ptr_is_peer(rt->_peer); | ||
81 | } | ||
82 | |||
83 | static inline void __rt_set_peer(struct rtable *rt, struct inet_peer *peer) | ||
84 | { | ||
85 | __inetpeer_ptr_set_peer(&rt->_peer, peer); | ||
86 | } | ||
87 | |||
88 | static inline bool rt_set_peer(struct rtable *rt, struct inet_peer *peer) | ||
89 | { | ||
90 | return inetpeer_ptr_set_peer(&rt->_peer, peer); | ||
91 | } | ||
92 | |||
93 | static inline void rt_init_peer(struct rtable *rt, struct inet_peer_base *base) | ||
94 | { | ||
95 | inetpeer_init_ptr(&rt->_peer, base); | ||
96 | } | ||
97 | |||
98 | static inline void rt_transfer_peer(struct rtable *rt, struct rtable *ort) | ||
99 | { | ||
100 | rt->_peer = ort->_peer; | ||
101 | if (rt_has_peer(ort)) { | ||
102 | struct inet_peer *peer = rt_peer_ptr(ort); | ||
103 | atomic_inc(&peer->refcnt); | ||
104 | } | ||
105 | } | ||
106 | |||
74 | static inline bool rt_is_input_route(const struct rtable *rt) | 107 | static inline bool rt_is_input_route(const struct rtable *rt) |
75 | { | 108 | { |
76 | return rt->rt_route_iif != 0; | 109 | return rt->rt_route_iif != 0; |
@@ -181,9 +214,10 @@ static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 s | |||
181 | return ip_route_input_common(skb, dst, src, tos, devin, true); | 214 | return ip_route_input_common(skb, dst, src, tos, devin, true); |
182 | } | 215 | } |
183 | 216 | ||
184 | extern unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph, | 217 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, |
185 | unsigned short new_mtu, struct net_device *dev); | 218 | int oif, u32 mark, u8 protocol, int flow_flags); |
186 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 219 | extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); |
220 | extern void ip_rt_send_redirect(struct sk_buff *skb); | ||
187 | 221 | ||
188 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); | 222 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); |
189 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 223 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); |
@@ -296,13 +330,23 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable | |||
296 | 330 | ||
297 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); | 331 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); |
298 | 332 | ||
333 | static inline struct inet_peer *__rt_get_peer(struct rtable *rt, __be32 daddr, int create) | ||
334 | { | ||
335 | if (rt_has_peer(rt)) | ||
336 | return rt_peer_ptr(rt); | ||
337 | |||
338 | rt_bind_peer(rt, daddr, create); | ||
339 | return (rt_has_peer(rt) ? rt_peer_ptr(rt) : NULL); | ||
340 | } | ||
341 | |||
299 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) | 342 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) |
300 | { | 343 | { |
301 | if (rt->peer) | 344 | return __rt_get_peer(rt, daddr, 0); |
302 | return rt->peer; | 345 | } |
303 | 346 | ||
304 | rt_bind_peer(rt, daddr, 0); | 347 | static inline struct inet_peer *rt_get_peer_create(struct rtable *rt, __be32 daddr) |
305 | return rt->peer; | 348 | { |
349 | return __rt_get_peer(rt, daddr, 1); | ||
306 | } | 350 | } |
307 | 351 | ||
308 | static inline int inet_iif(const struct sk_buff *skb) | 352 | static inline int inet_iif(const struct sk_buff *skb) |
diff --git a/include/net/sock.h b/include/net/sock.h index 4a4521699563..dcb54a0793ec 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -198,6 +198,7 @@ struct cg_proto; | |||
198 | * @sk_lock: synchronizer | 198 | * @sk_lock: synchronizer |
199 | * @sk_rcvbuf: size of receive buffer in bytes | 199 | * @sk_rcvbuf: size of receive buffer in bytes |
200 | * @sk_wq: sock wait queue and async head | 200 | * @sk_wq: sock wait queue and async head |
201 | * @sk_rx_dst: receive input route used by early tcp demux | ||
201 | * @sk_dst_cache: destination cache | 202 | * @sk_dst_cache: destination cache |
202 | * @sk_dst_lock: destination cache lock | 203 | * @sk_dst_lock: destination cache lock |
203 | * @sk_policy: flow policy | 204 | * @sk_policy: flow policy |
@@ -317,6 +318,7 @@ struct sock { | |||
317 | struct xfrm_policy *sk_policy[2]; | 318 | struct xfrm_policy *sk_policy[2]; |
318 | #endif | 319 | #endif |
319 | unsigned long sk_flags; | 320 | unsigned long sk_flags; |
321 | struct dst_entry *sk_rx_dst; | ||
320 | struct dst_entry *sk_dst_cache; | 322 | struct dst_entry *sk_dst_cache; |
321 | spinlock_t sk_dst_lock; | 323 | spinlock_t sk_dst_lock; |
322 | atomic_t sk_wmem_alloc; | 324 | atomic_t sk_wmem_alloc; |
@@ -1426,6 +1428,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk, | |||
1426 | gfp_t priority); | 1428 | gfp_t priority); |
1427 | extern void sock_wfree(struct sk_buff *skb); | 1429 | extern void sock_wfree(struct sk_buff *skb); |
1428 | extern void sock_rfree(struct sk_buff *skb); | 1430 | extern void sock_rfree(struct sk_buff *skb); |
1431 | extern void sock_edemux(struct sk_buff *skb); | ||
1429 | 1432 | ||
1430 | extern int sock_setsockopt(struct socket *sock, int level, | 1433 | extern int sock_setsockopt(struct socket *sock, int level, |
1431 | int op, char __user *optval, | 1434 | int op, char __user *optval, |
@@ -2152,7 +2155,7 @@ static inline void sk_change_net(struct sock *sk, struct net *net) | |||
2152 | 2155 | ||
2153 | static inline struct sock *skb_steal_sock(struct sk_buff *skb) | 2156 | static inline struct sock *skb_steal_sock(struct sk_buff *skb) |
2154 | { | 2157 | { |
2155 | if (unlikely(skb->sk)) { | 2158 | if (skb->sk) { |
2156 | struct sock *sk = skb->sk; | 2159 | struct sock *sk = skb->sk; |
2157 | 2160 | ||
2158 | skb->destructor = NULL; | 2161 | skb->destructor = NULL; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e79aa48d9fc1..53fb7d814170 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -325,10 +325,10 @@ extern void tcp_v4_err(struct sk_buff *skb, u32); | |||
325 | 325 | ||
326 | extern void tcp_shutdown (struct sock *sk, int how); | 326 | extern void tcp_shutdown (struct sock *sk, int how); |
327 | 327 | ||
328 | extern void tcp_v4_early_demux(struct sk_buff *skb); | ||
328 | extern int tcp_v4_rcv(struct sk_buff *skb); | 329 | extern int tcp_v4_rcv(struct sk_buff *skb); |
329 | 330 | ||
330 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); | 331 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); |
331 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
332 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 332 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
333 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 333 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
334 | size_t size); | 334 | size_t size); |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 8d6689cb2c66..68f0ecad6c6e 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -22,7 +22,6 @@ struct timewait_sock_ops { | |||
22 | int (*twsk_unique)(struct sock *sk, | 22 | int (*twsk_unique)(struct sock *sk, |
23 | struct sock *sktw, void *twp); | 23 | struct sock *sktw, void *twp); |
24 | void (*twsk_destructor)(struct sock *sk); | 24 | void (*twsk_destructor)(struct sock *sk); |
25 | void *(*twsk_getpeer)(struct sock *sk); | ||
26 | }; | 25 | }; |
27 | 26 | ||
28 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 27 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
@@ -41,11 +40,4 @@ static inline void twsk_destructor(struct sock *sk) | |||
41 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 40 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
42 | } | 41 | } |
43 | 42 | ||
44 | static inline void *twsk_getpeer(struct sock *sk) | ||
45 | { | ||
46 | if (sk->sk_prot->twsk_prot->twsk_getpeer) | ||
47 | return sk->sk_prot->twsk_prot->twsk_getpeer(sk); | ||
48 | return NULL; | ||
49 | } | ||
50 | |||
51 | #endif /* _TIMEWAIT_SOCK_H */ | 43 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e0a55df5bde8..17acbc92476d 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1682,13 +1682,11 @@ 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 | int ret = 0; |
1686 | nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m)) | ||
1687 | goto nla_put_failure; | ||
1688 | return 0; | ||
1689 | 1686 | ||
1690 | nla_put_failure: | 1687 | if (m->m | m->v) |
1691 | return -1; | 1688 | ret = nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m); |
1689 | return ret; | ||
1692 | } | 1690 | } |
1693 | 1691 | ||
1694 | #endif /* _NET_XFRM_H */ | 1692 | #endif /* _NET_XFRM_H */ |