diff options
Diffstat (limited to 'include/linux')
36 files changed, 683 insertions, 287 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index eb1c6a47b67f..994739da827f 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -318,6 +318,7 @@ struct bcma_bus { | |||
| 318 | const struct bcma_host_ops *ops; | 318 | const struct bcma_host_ops *ops; |
| 319 | 319 | ||
| 320 | enum bcma_hosttype hosttype; | 320 | enum bcma_hosttype hosttype; |
| 321 | bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */ | ||
| 321 | union { | 322 | union { |
| 322 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ | 323 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ |
| 323 | struct pci_dev *host_pci; | 324 | struct pci_dev *host_pci; |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index 0333e605ea0d..3f809ae372c4 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
| @@ -223,6 +223,7 @@ struct bcma_drv_pci_host { | |||
| 223 | 223 | ||
| 224 | struct bcma_drv_pci { | 224 | struct bcma_drv_pci { |
| 225 | struct bcma_device *core; | 225 | struct bcma_device *core; |
| 226 | u8 early_setup_done:1; | ||
| 226 | u8 setup_done:1; | 227 | u8 setup_done:1; |
| 227 | u8 hostmode:1; | 228 | u8 hostmode:1; |
| 228 | 229 | ||
| @@ -237,6 +238,7 @@ struct bcma_drv_pci { | |||
| 237 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) | 238 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) |
| 238 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) | 239 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) |
| 239 | 240 | ||
| 241 | extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc); | ||
| 240 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); | 242 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); |
| 241 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, | 243 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, |
| 242 | struct bcma_device *core, bool enable); | 244 | struct bcma_device *core, bool enable); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index e64ae7bf80a1..ebd5c1fcdea4 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
| @@ -64,6 +64,8 @@ | |||
| 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ | 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ |
| 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ | 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ |
| 66 | 66 | ||
| 67 | #define BCMA_PCIE2_BAR0_WIN2 0x70 | ||
| 68 | |||
| 67 | /* SiliconBackplane Address Map. | 69 | /* SiliconBackplane Address Map. |
| 68 | * All regions may not exist on all chips. | 70 | * All regions may not exist on all chips. |
| 69 | */ | 71 | */ |
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h index f24d245f8394..1b5fc0c3b1b5 100644 --- a/include/linux/bcma/bcma_soc.h +++ b/include/linux/bcma/bcma_soc.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | struct bcma_soc { | 6 | struct bcma_soc { |
| 7 | struct bcma_bus bus; | 7 | struct bcma_bus bus; |
| 8 | struct bcma_device core_cc; | ||
| 9 | struct bcma_device core_mips; | ||
| 10 | }; | 8 | }; |
| 11 | 9 | ||
| 12 | int __init bcma_host_soc_register(struct bcma_soc *soc); | 10 | int __init bcma_host_soc_register(struct bcma_soc *soc); |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index abcafaa20b86..9c78d15d33e4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -18,8 +18,6 @@ | |||
| 18 | #include <asm/div64.h> | 18 | #include <asm/div64.h> |
| 19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
| 20 | 20 | ||
| 21 | /* clocksource cycle base type */ | ||
| 22 | typedef u64 cycle_t; | ||
| 23 | struct clocksource; | 21 | struct clocksource; |
| 24 | struct module; | 22 | struct module; |
| 25 | 23 | ||
| @@ -28,106 +26,6 @@ struct module; | |||
| 28 | #endif | 26 | #endif |
| 29 | 27 | ||
| 30 | /** | 28 | /** |
| 31 | * struct cyclecounter - hardware abstraction for a free running counter | ||
| 32 | * Provides completely state-free accessors to the underlying hardware. | ||
| 33 | * Depending on which hardware it reads, the cycle counter may wrap | ||
| 34 | * around quickly. Locking rules (if necessary) have to be defined | ||
| 35 | * by the implementor and user of specific instances of this API. | ||
| 36 | * | ||
| 37 | * @read: returns the current cycle value | ||
| 38 | * @mask: bitmask for two's complement | ||
| 39 | * subtraction of non 64 bit counters, | ||
| 40 | * see CLOCKSOURCE_MASK() helper macro | ||
| 41 | * @mult: cycle to nanosecond multiplier | ||
| 42 | * @shift: cycle to nanosecond divisor (power of two) | ||
| 43 | */ | ||
| 44 | struct cyclecounter { | ||
| 45 | cycle_t (*read)(const struct cyclecounter *cc); | ||
| 46 | cycle_t mask; | ||
| 47 | u32 mult; | ||
| 48 | u32 shift; | ||
| 49 | }; | ||
| 50 | |||
| 51 | /** | ||
| 52 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
| 53 | * Contains the state needed by timecounter_read() to detect | ||
| 54 | * cycle counter wrap around. Initialize with | ||
| 55 | * timecounter_init(). Also used to convert cycle counts into the | ||
| 56 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
| 57 | * of this code are responsible for initializing the underlying | ||
| 58 | * cycle counter hardware, locking issues and reading the time | ||
| 59 | * more often than the cycle counter wraps around. The nanosecond | ||
| 60 | * counter will only wrap around after ~585 years. | ||
| 61 | * | ||
| 62 | * @cc: the cycle counter used by this instance | ||
| 63 | * @cycle_last: most recent cycle counter value seen by | ||
| 64 | * timecounter_read() | ||
| 65 | * @nsec: continuously increasing count | ||
| 66 | */ | ||
| 67 | struct timecounter { | ||
| 68 | const struct cyclecounter *cc; | ||
| 69 | cycle_t cycle_last; | ||
| 70 | u64 nsec; | ||
| 71 | }; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
| 75 | * @cc: Pointer to cycle counter. | ||
| 76 | * @cycles: Cycles | ||
| 77 | * | ||
| 78 | * XXX - This could use some mult_lxl_ll() asm optimization. Same code | ||
| 79 | * as in cyc2ns, but with unsigned result. | ||
| 80 | */ | ||
| 81 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
| 82 | cycle_t cycles) | ||
| 83 | { | ||
| 84 | u64 ret = (u64)cycles; | ||
| 85 | ret = (ret * cc->mult) >> cc->shift; | ||
| 86 | return ret; | ||
| 87 | } | ||
| 88 | |||
| 89 | /** | ||
| 90 | * timecounter_init - initialize a time counter | ||
| 91 | * @tc: Pointer to time counter which is to be initialized/reset | ||
| 92 | * @cc: A cycle counter, ready to be used. | ||
| 93 | * @start_tstamp: Arbitrary initial time stamp. | ||
| 94 | * | ||
| 95 | * After this call the current cycle register (roughly) corresponds to | ||
| 96 | * the initial time stamp. Every call to timecounter_read() increments | ||
| 97 | * the time stamp counter by the number of elapsed nanoseconds. | ||
| 98 | */ | ||
| 99 | extern void timecounter_init(struct timecounter *tc, | ||
| 100 | const struct cyclecounter *cc, | ||
| 101 | u64 start_tstamp); | ||
| 102 | |||
| 103 | /** | ||
| 104 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
| 105 | * plus the initial time stamp | ||
| 106 | * @tc: Pointer to time counter. | ||
| 107 | * | ||
| 108 | * In other words, keeps track of time since the same epoch as | ||
| 109 | * the function which generated the initial time stamp. | ||
| 110 | */ | ||
| 111 | extern u64 timecounter_read(struct timecounter *tc); | ||
| 112 | |||
| 113 | /** | ||
| 114 | * timecounter_cyc2time - convert a cycle counter to same | ||
| 115 | * time base as values returned by | ||
| 116 | * timecounter_read() | ||
| 117 | * @tc: Pointer to time counter. | ||
| 118 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
| 119 | * | ||
| 120 | * Cycle counts that are converted correctly as long as they | ||
| 121 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
| 122 | * with "max cycle count" == cs->mask+1. | ||
| 123 | * | ||
| 124 | * This allows conversion of cycle counter values which were generated | ||
| 125 | * in the past. | ||
| 126 | */ | ||
| 127 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
| 128 | cycle_t cycle_tstamp); | ||
| 129 | |||
| 130 | /** | ||
| 131 | * struct clocksource - hardware abstraction for a free running counter | 29 | * struct clocksource - hardware abstraction for a free running counter |
| 132 | * Provides mostly state-free accessors to the underlying hardware. | 30 | * Provides mostly state-free accessors to the underlying hardware. |
| 133 | * This is the structure used for system time. | 31 | * This is the structure used for system time. |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 41c891d05f04..1d869d185a0d 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -52,6 +52,10 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | |||
| 52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
| 53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | 53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) |
| 54 | 54 | ||
| 55 | struct sk_buff **eth_gro_receive(struct sk_buff **head, | ||
| 56 | struct sk_buff *skb); | ||
| 57 | int eth_gro_complete(struct sk_buff *skb, int nhoff); | ||
| 58 | |||
| 55 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ | 59 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ |
| 56 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | 60 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = |
| 57 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; | 61 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; |
diff --git a/include/linux/fec.h b/include/linux/fec.h index bcff455d1d53..1454a503622d 100644 --- a/include/linux/fec.h +++ b/include/linux/fec.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | struct fec_platform_data { | 19 | struct fec_platform_data { |
| 20 | phy_interface_t phy; | 20 | phy_interface_t phy; |
| 21 | unsigned char mac[ETH_ALEN]; | 21 | unsigned char mac[ETH_ALEN]; |
| 22 | void (*sleep_mode_enable)(int enabled); | ||
| 22 | }; | 23 | }; |
| 23 | 24 | ||
| 24 | #endif | 25 | #endif |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4f4eea8a6288..b9c7897dc566 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -1017,6 +1017,15 @@ struct ieee80211_mmie { | |||
| 1017 | u8 mic[8]; | 1017 | u8 mic[8]; |
| 1018 | } __packed; | 1018 | } __packed; |
| 1019 | 1019 | ||
| 1020 | /* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ | ||
| 1021 | struct ieee80211_mmie_16 { | ||
| 1022 | u8 element_id; | ||
| 1023 | u8 length; | ||
| 1024 | __le16 key_id; | ||
| 1025 | u8 sequence_number[6]; | ||
| 1026 | u8 mic[16]; | ||
| 1027 | } __packed; | ||
| 1028 | |||
| 1020 | struct ieee80211_vendor_ie { | 1029 | struct ieee80211_vendor_ie { |
| 1021 | u8 element_id; | 1030 | u8 element_id; |
| 1022 | u8 len; | 1031 | u8 len; |
| @@ -1994,9 +2003,15 @@ enum ieee80211_key_len { | |||
| 1994 | WLAN_KEY_LEN_WEP40 = 5, | 2003 | WLAN_KEY_LEN_WEP40 = 5, |
| 1995 | WLAN_KEY_LEN_WEP104 = 13, | 2004 | WLAN_KEY_LEN_WEP104 = 13, |
| 1996 | WLAN_KEY_LEN_CCMP = 16, | 2005 | WLAN_KEY_LEN_CCMP = 16, |
| 2006 | WLAN_KEY_LEN_CCMP_256 = 32, | ||
| 1997 | WLAN_KEY_LEN_TKIP = 32, | 2007 | WLAN_KEY_LEN_TKIP = 32, |
| 1998 | WLAN_KEY_LEN_AES_CMAC = 16, | 2008 | WLAN_KEY_LEN_AES_CMAC = 16, |
| 1999 | WLAN_KEY_LEN_SMS4 = 32, | 2009 | WLAN_KEY_LEN_SMS4 = 32, |
| 2010 | WLAN_KEY_LEN_GCMP = 16, | ||
| 2011 | WLAN_KEY_LEN_GCMP_256 = 32, | ||
| 2012 | WLAN_KEY_LEN_BIP_CMAC_256 = 32, | ||
| 2013 | WLAN_KEY_LEN_BIP_GMAC_128 = 16, | ||
| 2014 | WLAN_KEY_LEN_BIP_GMAC_256 = 32, | ||
| 2000 | }; | 2015 | }; |
| 2001 | 2016 | ||
| 2002 | #define IEEE80211_WEP_IV_LEN 4 | 2017 | #define IEEE80211_WEP_IV_LEN 4 |
| @@ -2004,9 +2019,16 @@ enum ieee80211_key_len { | |||
| 2004 | #define IEEE80211_CCMP_HDR_LEN 8 | 2019 | #define IEEE80211_CCMP_HDR_LEN 8 |
| 2005 | #define IEEE80211_CCMP_MIC_LEN 8 | 2020 | #define IEEE80211_CCMP_MIC_LEN 8 |
| 2006 | #define IEEE80211_CCMP_PN_LEN 6 | 2021 | #define IEEE80211_CCMP_PN_LEN 6 |
| 2022 | #define IEEE80211_CCMP_256_HDR_LEN 8 | ||
| 2023 | #define IEEE80211_CCMP_256_MIC_LEN 16 | ||
| 2024 | #define IEEE80211_CCMP_256_PN_LEN 6 | ||
| 2007 | #define IEEE80211_TKIP_IV_LEN 8 | 2025 | #define IEEE80211_TKIP_IV_LEN 8 |
| 2008 | #define IEEE80211_TKIP_ICV_LEN 4 | 2026 | #define IEEE80211_TKIP_ICV_LEN 4 |
| 2009 | #define IEEE80211_CMAC_PN_LEN 6 | 2027 | #define IEEE80211_CMAC_PN_LEN 6 |
| 2028 | #define IEEE80211_GMAC_PN_LEN 6 | ||
| 2029 | #define IEEE80211_GCMP_HDR_LEN 8 | ||
| 2030 | #define IEEE80211_GCMP_MIC_LEN 16 | ||
| 2031 | #define IEEE80211_GCMP_PN_LEN 6 | ||
| 2010 | 2032 | ||
| 2011 | /* Public action codes */ | 2033 | /* Public action codes */ |
| 2012 | enum ieee80211_pub_actioncode { | 2034 | enum ieee80211_pub_actioncode { |
| @@ -2230,6 +2252,11 @@ enum ieee80211_sa_query_action { | |||
| 2230 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 2252 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
| 2231 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 2253 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
| 2232 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 | 2254 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 |
| 2255 | #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09 | ||
| 2256 | #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A | ||
| 2257 | #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B | ||
| 2258 | #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C | ||
| 2259 | #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D | ||
| 2233 | 2260 | ||
| 2234 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 | 2261 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 |
| 2235 | 2262 | ||
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 0a8ce762a47f..a57bca2ea97e 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
| @@ -50,24 +50,6 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use | |||
| 50 | typedef int br_should_route_hook_t(struct sk_buff *skb); | 50 | typedef int br_should_route_hook_t(struct sk_buff *skb); |
| 51 | extern br_should_route_hook_t __rcu *br_should_route_hook; | 51 | extern br_should_route_hook_t __rcu *br_should_route_hook; |
| 52 | 52 | ||
| 53 | #if IS_ENABLED(CONFIG_BRIDGE) | ||
| 54 | int br_fdb_external_learn_add(struct net_device *dev, | ||
| 55 | const unsigned char *addr, u16 vid); | ||
| 56 | int br_fdb_external_learn_del(struct net_device *dev, | ||
| 57 | const unsigned char *addr, u16 vid); | ||
| 58 | #else | ||
| 59 | static inline int br_fdb_external_learn_add(struct net_device *dev, | ||
| 60 | const unsigned char *addr, u16 vid) | ||
| 61 | { | ||
| 62 | return 0; | ||
| 63 | } | ||
| 64 | static inline int br_fdb_external_learn_del(struct net_device *dev, | ||
| 65 | const unsigned char *addr, u16 vid) | ||
| 66 | { | ||
| 67 | return 0; | ||
| 68 | } | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) | 53 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) |
| 72 | int br_multicast_list_adjacent(struct net_device *dev, | 54 | int br_multicast_list_adjacent(struct net_device *dev, |
| 73 | struct list_head *br_ip_list); | 55 | struct list_head *br_ip_list); |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 960e666c51e4..b11b28a30b9e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -78,9 +78,9 @@ static inline bool is_vlan_dev(struct net_device *dev) | |||
| 78 | return dev->priv_flags & IFF_802_1Q_VLAN; | 78 | return dev->priv_flags & IFF_802_1Q_VLAN; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 81 | #define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
| 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
| 83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | 83 | #define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
| 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats | 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats |
| @@ -376,7 +376,7 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb, | |||
| 376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | 376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) |
| 377 | { | 377 | { |
| 378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, | 378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, |
| 379 | vlan_tx_tag_get(skb)); | 379 | skb_vlan_tag_get(skb)); |
| 380 | if (likely(skb)) | 380 | if (likely(skb)) |
| 381 | skb->vlan_tci = 0; | 381 | skb->vlan_tci = 0; |
| 382 | return skb; | 382 | return skb; |
| @@ -393,7 +393,7 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | |||
| 393 | */ | 393 | */ |
| 394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) | 394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) |
| 395 | { | 395 | { |
| 396 | if (vlan_tx_tag_present(skb)) | 396 | if (skb_vlan_tag_present(skb)) |
| 397 | skb = __vlan_hwaccel_push_inside(skb); | 397 | skb = __vlan_hwaccel_push_inside(skb); |
| 398 | return skb; | 398 | return skb; |
| 399 | } | 399 | } |
| @@ -442,8 +442,8 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
| 442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | 442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, |
| 443 | u16 *vlan_tci) | 443 | u16 *vlan_tci) |
| 444 | { | 444 | { |
| 445 | if (vlan_tx_tag_present(skb)) { | 445 | if (skb_vlan_tag_present(skb)) { |
| 446 | *vlan_tci = vlan_tx_tag_get(skb); | 446 | *vlan_tci = skb_vlan_tag_get(skb); |
| 447 | return 0; | 447 | return 0; |
| 448 | } else { | 448 | } else { |
| 449 | *vlan_tci = 0; | 449 | *vlan_tci = 0; |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index c694e7baa621..4d5169f5d7d1 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -52,6 +52,7 @@ struct ipv6_devconf { | |||
| 52 | __s32 force_tllao; | 52 | __s32 force_tllao; |
| 53 | __s32 ndisc_notify; | 53 | __s32 ndisc_notify; |
| 54 | __s32 suppress_frag_ndisc; | 54 | __s32 suppress_frag_ndisc; |
| 55 | __s32 accept_ra_mtu; | ||
| 55 | void *sysctl; | 56 | void *sysctl; |
| 56 | }; | 57 | }; |
| 57 | 58 | ||
| @@ -124,6 +125,12 @@ struct ipv6_mc_socklist; | |||
| 124 | struct ipv6_ac_socklist; | 125 | struct ipv6_ac_socklist; |
| 125 | struct ipv6_fl_socklist; | 126 | struct ipv6_fl_socklist; |
| 126 | 127 | ||
| 128 | struct inet6_cork { | ||
| 129 | struct ipv6_txoptions *opt; | ||
| 130 | u8 hop_limit; | ||
| 131 | u8 tclass; | ||
| 132 | }; | ||
| 133 | |||
| 127 | /** | 134 | /** |
| 128 | * struct ipv6_pinfo - ipv6 private area | 135 | * struct ipv6_pinfo - ipv6 private area |
| 129 | * | 136 | * |
| @@ -216,11 +223,7 @@ struct ipv6_pinfo { | |||
| 216 | struct ipv6_txoptions *opt; | 223 | struct ipv6_txoptions *opt; |
| 217 | struct sk_buff *pktoptions; | 224 | struct sk_buff *pktoptions; |
| 218 | struct sk_buff *rxpmtu; | 225 | struct sk_buff *rxpmtu; |
| 219 | struct { | 226 | struct inet6_cork cork; |
| 220 | struct ipv6_txoptions *opt; | ||
| 221 | u8 hop_limit; | ||
| 222 | u8 tclass; | ||
| 223 | } cork; | ||
| 224 | }; | 227 | }; |
| 225 | 228 | ||
| 226 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ | 229 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ |
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 5d10ae364b5e..f266661d2666 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | #ifndef _LINUX_LIST_NULLS_H | 1 | #ifndef _LINUX_LIST_NULLS_H |
| 2 | #define _LINUX_LIST_NULLS_H | 2 | #define _LINUX_LIST_NULLS_H |
| 3 | 3 | ||
| 4 | #include <linux/poison.h> | ||
| 5 | #include <linux/const.h> | ||
| 6 | |||
| 4 | /* | 7 | /* |
| 5 | * Special version of lists, where end of list is not a NULL pointer, | 8 | * Special version of lists, where end of list is not a NULL pointer, |
| 6 | * but a 'nulls' marker, which can have many different values. | 9 | * but a 'nulls' marker, which can have many different values. |
| @@ -21,8 +24,9 @@ struct hlist_nulls_head { | |||
| 21 | struct hlist_nulls_node { | 24 | struct hlist_nulls_node { |
| 22 | struct hlist_nulls_node *next, **pprev; | 25 | struct hlist_nulls_node *next, **pprev; |
| 23 | }; | 26 | }; |
| 27 | #define NULLS_MARKER(value) (1UL | (((long)value) << 1)) | ||
| 24 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ | 28 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ |
| 25 | ((ptr)->first = (struct hlist_nulls_node *) (1UL | (((long)nulls) << 1))) | 29 | ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls)) |
| 26 | 30 | ||
| 27 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) | 31 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) |
| 28 | /** | 32 | /** |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 64d25941b329..7b6d4e9ff603 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
| @@ -71,6 +71,7 @@ enum { | |||
| 71 | 71 | ||
| 72 | /*master notify fw on finish for slave's flr*/ | 72 | /*master notify fw on finish for slave's flr*/ |
| 73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, | 73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, |
| 74 | MLX4_CMD_VIRT_PORT_MAP = 0x5c, | ||
| 74 | MLX4_CMD_GET_OP_REQ = 0x59, | 75 | MLX4_CMD_GET_OP_REQ = 0x59, |
| 75 | 76 | ||
| 76 | /* TPT commands */ | 77 | /* TPT commands */ |
| @@ -165,9 +166,15 @@ enum { | |||
| 165 | }; | 166 | }; |
| 166 | 167 | ||
| 167 | enum { | 168 | enum { |
| 168 | MLX4_CMD_TIME_CLASS_A = 10000, | 169 | MLX4_CMD_TIME_CLASS_A = 60000, |
| 169 | MLX4_CMD_TIME_CLASS_B = 10000, | 170 | MLX4_CMD_TIME_CLASS_B = 60000, |
| 170 | MLX4_CMD_TIME_CLASS_C = 10000, | 171 | MLX4_CMD_TIME_CLASS_C = 60000, |
| 172 | }; | ||
| 173 | |||
| 174 | enum { | ||
| 175 | /* virtual to physical port mapping opcode modifiers */ | ||
| 176 | MLX4_GET_PORT_VIRT2PHY = 0x0, | ||
| 177 | MLX4_SET_PORT_VIRT2PHY = 0x1, | ||
| 171 | }; | 178 | }; |
| 172 | 179 | ||
| 173 | enum { | 180 | enum { |
| @@ -279,6 +286,8 @@ int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_in | |||
| 279 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); | 286 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); |
| 280 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, | 287 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, |
| 281 | struct mlx4_config_dev_params *params); | 288 | struct mlx4_config_dev_params *params); |
| 289 | void mlx4_cmd_wake_completions(struct mlx4_dev *dev); | ||
| 290 | void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev); | ||
| 282 | /* | 291 | /* |
| 283 | * mlx4_get_slave_default_vlan - | 292 | * mlx4_get_slave_default_vlan - |
| 284 | * return true if VST ( default vlan) | 293 | * return true if VST ( default vlan) |
| @@ -288,5 +297,6 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, | |||
| 288 | u16 *vlan, u8 *qos); | 297 | u16 *vlan, u8 *qos); |
| 289 | 298 | ||
| 290 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) | 299 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) |
| 300 | #define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17) | ||
| 291 | 301 | ||
| 292 | #endif /* MLX4_CMD_H */ | 302 | #endif /* MLX4_CMD_H */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 5f3a9aa7225d..e4ebff7e9d02 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | 42 | ||
| 43 | #include <linux/atomic.h> | 43 | #include <linux/atomic.h> |
| 44 | 44 | ||
| 45 | #include <linux/clocksource.h> | 45 | #include <linux/timecounter.h> |
| 46 | 46 | ||
| 47 | #define MAX_MSIX_P_PORT 17 | 47 | #define MAX_MSIX_P_PORT 17 |
| 48 | #define MAX_MSIX 64 | 48 | #define MAX_MSIX 64 |
| @@ -70,6 +70,7 @@ enum { | |||
| 70 | MLX4_FLAG_SLAVE = 1 << 3, | 70 | MLX4_FLAG_SLAVE = 1 << 3, |
| 71 | MLX4_FLAG_SRIOV = 1 << 4, | 71 | MLX4_FLAG_SRIOV = 1 << 4, |
| 72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, | 72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, |
| 73 | MLX4_FLAG_BONDED = 1 << 7 | ||
| 73 | }; | 74 | }; |
| 74 | 75 | ||
| 75 | enum { | 76 | enum { |
| @@ -200,7 +201,9 @@ enum { | |||
| 200 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, | 201 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, |
| 201 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, | 202 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, |
| 202 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, | 203 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, |
| 203 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19 | 204 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19, |
| 205 | MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20, | ||
| 206 | MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21 | ||
| 204 | }; | 207 | }; |
| 205 | 208 | ||
| 206 | enum { | 209 | enum { |
| @@ -208,6 +211,10 @@ enum { | |||
| 208 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 | 211 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 |
| 209 | }; | 212 | }; |
| 210 | 213 | ||
| 214 | enum { | ||
| 215 | MLX4_VF_CAP_FLAG_RESET = 1 << 0 | ||
| 216 | }; | ||
| 217 | |||
| 211 | /* bit enums for an 8-bit flags field indicating special use | 218 | /* bit enums for an 8-bit flags field indicating special use |
| 212 | * QPs which require special handling in qp_reserve_range. | 219 | * QPs which require special handling in qp_reserve_range. |
| 213 | * Currently, this only includes QPs used by the ETH interface, | 220 | * Currently, this only includes QPs used by the ETH interface, |
| @@ -248,9 +255,14 @@ enum { | |||
| 248 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 255 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
| 249 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, | 256 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, |
| 250 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, | 257 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, |
| 258 | MLX4_BMME_FLAG_PORT_REMAP = 1 << 24, | ||
| 251 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, | 259 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, |
| 252 | }; | 260 | }; |
| 253 | 261 | ||
| 262 | enum { | ||
| 263 | MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP | ||
| 264 | }; | ||
| 265 | |||
| 254 | enum mlx4_event { | 266 | enum mlx4_event { |
| 255 | MLX4_EVENT_TYPE_COMP = 0x00, | 267 | MLX4_EVENT_TYPE_COMP = 0x00, |
| 256 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, | 268 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, |
| @@ -276,6 +288,7 @@ enum mlx4_event { | |||
| 276 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, | 288 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, |
| 277 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, | 289 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, |
| 278 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, | 290 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, |
| 291 | MLX4_EVENT_TYPE_RECOVERABLE_ERROR_EVENT = 0x3e, | ||
| 279 | MLX4_EVENT_TYPE_NONE = 0xff, | 292 | MLX4_EVENT_TYPE_NONE = 0xff, |
| 280 | }; | 293 | }; |
| 281 | 294 | ||
| @@ -285,6 +298,11 @@ enum { | |||
| 285 | }; | 298 | }; |
| 286 | 299 | ||
| 287 | enum { | 300 | enum { |
| 301 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_BAD_CABLE = 1, | ||
| 302 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_UNSUPPORTED_CABLE = 2, | ||
| 303 | }; | ||
| 304 | |||
| 305 | enum { | ||
| 288 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, | 306 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, |
| 289 | }; | 307 | }; |
| 290 | 308 | ||
| @@ -411,6 +429,16 @@ enum { | |||
| 411 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, | 429 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, |
| 412 | }; | 430 | }; |
| 413 | 431 | ||
| 432 | enum { | ||
| 433 | MLX4_DEVICE_STATE_UP = 1 << 0, | ||
| 434 | MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, | ||
| 435 | }; | ||
| 436 | |||
| 437 | enum { | ||
| 438 | MLX4_INTERFACE_STATE_UP = 1 << 0, | ||
| 439 | MLX4_INTERFACE_STATE_DELETION = 1 << 1, | ||
| 440 | }; | ||
| 441 | |||
| 414 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ | 442 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ |
| 415 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) | 443 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) |
| 416 | 444 | ||
| @@ -535,6 +563,7 @@ struct mlx4_caps { | |||
| 535 | u8 alloc_res_qp_mask; | 563 | u8 alloc_res_qp_mask; |
| 536 | u32 dmfs_high_rate_qpn_base; | 564 | u32 dmfs_high_rate_qpn_base; |
| 537 | u32 dmfs_high_rate_qpn_range; | 565 | u32 dmfs_high_rate_qpn_range; |
| 566 | u32 vf_caps; | ||
| 538 | }; | 567 | }; |
| 539 | 568 | ||
| 540 | struct mlx4_buf_list { | 569 | struct mlx4_buf_list { |
| @@ -660,6 +689,8 @@ struct mlx4_cq { | |||
| 660 | void (*comp)(struct mlx4_cq *); | 689 | void (*comp)(struct mlx4_cq *); |
| 661 | void *priv; | 690 | void *priv; |
| 662 | } tasklet_ctx; | 691 | } tasklet_ctx; |
| 692 | int reset_notify_added; | ||
| 693 | struct list_head reset_notify; | ||
| 663 | }; | 694 | }; |
| 664 | 695 | ||
| 665 | struct mlx4_qp { | 696 | struct mlx4_qp { |
| @@ -744,8 +775,23 @@ struct mlx4_vf_dev { | |||
| 744 | u8 n_ports; | 775 | u8 n_ports; |
| 745 | }; | 776 | }; |
| 746 | 777 | ||
| 747 | struct mlx4_dev { | 778 | struct mlx4_dev_persistent { |
| 748 | struct pci_dev *pdev; | 779 | struct pci_dev *pdev; |
| 780 | struct mlx4_dev *dev; | ||
| 781 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
| 782 | int num_vfs; | ||
| 783 | enum mlx4_port_type curr_port_type[MLX4_MAX_PORTS + 1]; | ||
| 784 | enum mlx4_port_type curr_port_poss_type[MLX4_MAX_PORTS + 1]; | ||
| 785 | struct work_struct catas_work; | ||
| 786 | struct workqueue_struct *catas_wq; | ||
| 787 | struct mutex device_state_mutex; /* protect HW state */ | ||
| 788 | u8 state; | ||
| 789 | struct mutex interface_state_mutex; /* protect SW state */ | ||
| 790 | u8 interface_state; | ||
| 791 | }; | ||
| 792 | |||
| 793 | struct mlx4_dev { | ||
| 794 | struct mlx4_dev_persistent *persist; | ||
| 749 | unsigned long flags; | 795 | unsigned long flags; |
| 750 | unsigned long num_slaves; | 796 | unsigned long num_slaves; |
| 751 | struct mlx4_caps caps; | 797 | struct mlx4_caps caps; |
| @@ -754,13 +800,11 @@ struct mlx4_dev { | |||
| 754 | struct radix_tree_root qp_table_tree; | 800 | struct radix_tree_root qp_table_tree; |
| 755 | u8 rev_id; | 801 | u8 rev_id; |
| 756 | char board_id[MLX4_BOARD_ID_LEN]; | 802 | char board_id[MLX4_BOARD_ID_LEN]; |
| 757 | int num_vfs; | ||
| 758 | int numa_node; | 803 | int numa_node; |
| 759 | int oper_log_mgm_entry_size; | 804 | int oper_log_mgm_entry_size; |
| 760 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; | 805 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; |
| 761 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; | 806 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; |
| 762 | struct mlx4_vf_dev *dev_vfs; | 807 | struct mlx4_vf_dev *dev_vfs; |
| 763 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
| 764 | }; | 808 | }; |
| 765 | 809 | ||
| 766 | struct mlx4_eqe { | 810 | struct mlx4_eqe { |
| @@ -832,6 +876,11 @@ struct mlx4_eqe { | |||
| 832 | } __packed tbl_change_info; | 876 | } __packed tbl_change_info; |
| 833 | } params; | 877 | } params; |
| 834 | } __packed port_mgmt_change; | 878 | } __packed port_mgmt_change; |
| 879 | struct { | ||
| 880 | u8 reserved[3]; | ||
| 881 | u8 port; | ||
| 882 | u32 reserved1[5]; | ||
| 883 | } __packed bad_cable; | ||
| 835 | } event; | 884 | } event; |
| 836 | u8 slave_id; | 885 | u8 slave_id; |
| 837 | u8 reserved3[2]; | 886 | u8 reserved3[2]; |
| @@ -1338,6 +1387,8 @@ int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); | |||
| 1338 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); | 1387 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); |
| 1339 | 1388 | ||
| 1340 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); | 1389 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); |
| 1390 | int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis); | ||
| 1391 | int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2); | ||
| 1341 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); | 1392 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); |
| 1342 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); | 1393 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); |
| 1343 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, | 1394 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 022055c8fb26..9553a73d2049 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
| @@ -49,6 +49,10 @@ enum mlx4_dev_event { | |||
| 49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, | 49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | enum { | ||
| 53 | MLX4_INTFF_BONDING = 1 << 0 | ||
| 54 | }; | ||
| 55 | |||
| 52 | struct mlx4_interface { | 56 | struct mlx4_interface { |
| 53 | void * (*add) (struct mlx4_dev *dev); | 57 | void * (*add) (struct mlx4_dev *dev); |
| 54 | void (*remove)(struct mlx4_dev *dev, void *context); | 58 | void (*remove)(struct mlx4_dev *dev, void *context); |
| @@ -57,11 +61,26 @@ struct mlx4_interface { | |||
| 57 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | 61 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); |
| 58 | struct list_head list; | 62 | struct list_head list; |
| 59 | enum mlx4_protocol protocol; | 63 | enum mlx4_protocol protocol; |
| 64 | int flags; | ||
| 60 | }; | 65 | }; |
| 61 | 66 | ||
| 62 | int mlx4_register_interface(struct mlx4_interface *intf); | 67 | int mlx4_register_interface(struct mlx4_interface *intf); |
| 63 | void mlx4_unregister_interface(struct mlx4_interface *intf); | 68 | void mlx4_unregister_interface(struct mlx4_interface *intf); |
| 64 | 69 | ||
| 70 | int mlx4_bond(struct mlx4_dev *dev); | ||
| 71 | int mlx4_unbond(struct mlx4_dev *dev); | ||
| 72 | static inline int mlx4_is_bonded(struct mlx4_dev *dev) | ||
| 73 | { | ||
| 74 | return !!(dev->flags & MLX4_FLAG_BONDED); | ||
| 75 | } | ||
| 76 | |||
| 77 | struct mlx4_port_map { | ||
| 78 | u8 port1; | ||
| 79 | u8 port2; | ||
| 80 | }; | ||
| 81 | |||
| 82 | int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p); | ||
| 83 | |||
| 65 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); | 84 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); |
| 66 | 85 | ||
| 67 | static inline u64 mlx4_mac_to_u64(u8 *addr) | 86 | static inline u64 mlx4_mac_to_u64(u8 *addr) |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 467ccdf94c98..2bbc62aa818a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -96,6 +96,7 @@ enum { | |||
| 96 | MLX4_QP_BIT_RRE = 1 << 15, | 96 | MLX4_QP_BIT_RRE = 1 << 15, |
| 97 | MLX4_QP_BIT_RWE = 1 << 14, | 97 | MLX4_QP_BIT_RWE = 1 << 14, |
| 98 | MLX4_QP_BIT_RAE = 1 << 13, | 98 | MLX4_QP_BIT_RAE = 1 << 13, |
| 99 | MLX4_QP_BIT_FPP = 1 << 3, | ||
| 99 | MLX4_QP_BIT_RIC = 1 << 4, | 100 | MLX4_QP_BIT_RIC = 1 << 4, |
| 100 | }; | 101 | }; |
| 101 | 102 | ||
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 0f01fe065424..996807963716 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -24,13 +24,15 @@ | |||
| 24 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
| 25 | */ | 25 | */ |
| 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 | 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 |
| 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 43143 | 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 0xa887 |
| 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 |
| 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 |
| 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 |
| 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 |
| 32 | #define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c | ||
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d | ||
| 32 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 | 34 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 |
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43362 43362 | 35 | #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 |
| 34 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 | 36 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 |
| 35 | 37 | ||
| 36 | #define SDIO_VENDOR_ID_INTEL 0x0089 | 38 | #define SDIO_VENDOR_ID_INTEL 0x0089 |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 8e30685affeb..7d59dc6ab789 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
| @@ -66,6 +66,7 @@ enum { | |||
| 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ | 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ |
| 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ | 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ |
| 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ | 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ |
| 69 | NETIF_F_HW_SWITCH_OFFLOAD_BIT, /* HW switch offload */ | ||
| 69 | 70 | ||
| 70 | /* | 71 | /* |
| 71 | * Add your fresh new feature above and remember to update | 72 | * Add your fresh new feature above and remember to update |
| @@ -124,6 +125,7 @@ enum { | |||
| 124 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) | 125 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) |
| 125 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) | 126 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) |
| 126 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) | 127 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) |
| 128 | #define NETIF_F_HW_SWITCH_OFFLOAD __NETIF_F(HW_SWITCH_OFFLOAD) | ||
| 127 | 129 | ||
| 128 | /* Features valid for ethtool to change */ | 130 | /* Features valid for ethtool to change */ |
| 129 | /* = all defined minus driver/device-class-related */ | 131 | /* = all defined minus driver/device-class-related */ |
| @@ -159,7 +161,9 @@ enum { | |||
| 159 | */ | 161 | */ |
| 160 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 162 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
| 161 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 163 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
| 162 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) | 164 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED | \ |
| 165 | NETIF_F_HW_SWITCH_OFFLOAD) | ||
| 166 | |||
| 163 | /* | 167 | /* |
| 164 | * If one device doesn't support one of these features, then disable it | 168 | * If one device doesn't support one of these features, then disable it |
| 165 | * for all in netdev_increment_features. | 169 | * for all in netdev_increment_features. |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 52fd8e8694cf..d115256ed5a2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/netdev_features.h> | 51 | #include <linux/netdev_features.h> |
| 52 | #include <linux/neighbour.h> | 52 | #include <linux/neighbour.h> |
| 53 | #include <uapi/linux/netdevice.h> | 53 | #include <uapi/linux/netdevice.h> |
| 54 | #include <uapi/linux/if_bonding.h> | ||
| 54 | 55 | ||
| 55 | struct netpoll_info; | 56 | struct netpoll_info; |
| 56 | struct device; | 57 | struct device; |
| @@ -643,39 +644,40 @@ struct rps_dev_flow_table { | |||
| 643 | /* | 644 | /* |
| 644 | * The rps_sock_flow_table contains mappings of flows to the last CPU | 645 | * The rps_sock_flow_table contains mappings of flows to the last CPU |
| 645 | * on which they were processed by the application (set in recvmsg). | 646 | * on which they were processed by the application (set in recvmsg). |
| 647 | * Each entry is a 32bit value. Upper part is the high order bits | ||
| 648 | * of flow hash, lower part is cpu number. | ||
| 649 | * rps_cpu_mask is used to partition the space, depending on number of | ||
| 650 | * possible cpus : rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1 | ||
| 651 | * For example, if 64 cpus are possible, rps_cpu_mask = 0x3f, | ||
| 652 | * meaning we use 32-6=26 bits for the hash. | ||
| 646 | */ | 653 | */ |
| 647 | struct rps_sock_flow_table { | 654 | struct rps_sock_flow_table { |
| 648 | unsigned int mask; | 655 | u32 mask; |
| 649 | u16 ents[0]; | 656 | |
| 657 | u32 ents[0] ____cacheline_aligned_in_smp; | ||
| 650 | }; | 658 | }; |
| 651 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | 659 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (offsetof(struct rps_sock_flow_table, ents[_num])) |
| 652 | ((_num) * sizeof(u16))) | ||
| 653 | 660 | ||
| 654 | #define RPS_NO_CPU 0xffff | 661 | #define RPS_NO_CPU 0xffff |
| 655 | 662 | ||
| 663 | extern u32 rps_cpu_mask; | ||
| 664 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
| 665 | |||
| 656 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, | 666 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, |
| 657 | u32 hash) | 667 | u32 hash) |
| 658 | { | 668 | { |
| 659 | if (table && hash) { | 669 | if (table && hash) { |
| 660 | unsigned int cpu, index = hash & table->mask; | 670 | unsigned int index = hash & table->mask; |
| 671 | u32 val = hash & ~rps_cpu_mask; | ||
| 661 | 672 | ||
| 662 | /* We only give a hint, preemption can change cpu under us */ | 673 | /* We only give a hint, preemption can change cpu under us */ |
| 663 | cpu = raw_smp_processor_id(); | 674 | val |= raw_smp_processor_id(); |
| 664 | 675 | ||
| 665 | if (table->ents[index] != cpu) | 676 | if (table->ents[index] != val) |
| 666 | table->ents[index] = cpu; | 677 | table->ents[index] = val; |
| 667 | } | 678 | } |
| 668 | } | 679 | } |
| 669 | 680 | ||
| 670 | static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | ||
| 671 | u32 hash) | ||
| 672 | { | ||
| 673 | if (table && hash) | ||
| 674 | table->ents[hash & table->mask] = RPS_NO_CPU; | ||
| 675 | } | ||
| 676 | |||
| 677 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
| 678 | |||
| 679 | #ifdef CONFIG_RFS_ACCEL | 681 | #ifdef CONFIG_RFS_ACCEL |
| 680 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, | 682 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, |
| 681 | u16 filter_id); | 683 | u16 filter_id); |
| @@ -1154,13 +1156,15 @@ struct net_device_ops { | |||
| 1154 | int idx); | 1156 | int idx); |
| 1155 | 1157 | ||
| 1156 | int (*ndo_bridge_setlink)(struct net_device *dev, | 1158 | int (*ndo_bridge_setlink)(struct net_device *dev, |
| 1157 | struct nlmsghdr *nlh); | 1159 | struct nlmsghdr *nlh, |
| 1160 | u16 flags); | ||
| 1158 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | 1161 | int (*ndo_bridge_getlink)(struct sk_buff *skb, |
| 1159 | u32 pid, u32 seq, | 1162 | u32 pid, u32 seq, |
| 1160 | struct net_device *dev, | 1163 | struct net_device *dev, |
| 1161 | u32 filter_mask); | 1164 | u32 filter_mask); |
| 1162 | int (*ndo_bridge_dellink)(struct net_device *dev, | 1165 | int (*ndo_bridge_dellink)(struct net_device *dev, |
| 1163 | struct nlmsghdr *nlh); | 1166 | struct nlmsghdr *nlh, |
| 1167 | u16 flags); | ||
| 1164 | int (*ndo_change_carrier)(struct net_device *dev, | 1168 | int (*ndo_change_carrier)(struct net_device *dev, |
| 1165 | bool new_carrier); | 1169 | bool new_carrier); |
| 1166 | int (*ndo_get_phys_port_id)(struct net_device *dev, | 1170 | int (*ndo_get_phys_port_id)(struct net_device *dev, |
| @@ -1514,6 +1518,8 @@ struct net_device { | |||
| 1514 | struct list_head napi_list; | 1518 | struct list_head napi_list; |
| 1515 | struct list_head unreg_list; | 1519 | struct list_head unreg_list; |
| 1516 | struct list_head close_list; | 1520 | struct list_head close_list; |
| 1521 | struct list_head ptype_all; | ||
| 1522 | struct list_head ptype_specific; | ||
| 1517 | 1523 | ||
| 1518 | struct { | 1524 | struct { |
| 1519 | struct list_head upper; | 1525 | struct list_head upper; |
| @@ -1969,7 +1975,7 @@ struct offload_callbacks { | |||
| 1969 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1975 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
| 1970 | netdev_features_t features); | 1976 | netdev_features_t features); |
| 1971 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1977 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
| 1972 | struct sk_buff *skb); | 1978 | struct sk_buff *skb); |
| 1973 | int (*gro_complete)(struct sk_buff *skb, int nhoff); | 1979 | int (*gro_complete)(struct sk_buff *skb, int nhoff); |
| 1974 | }; | 1980 | }; |
| 1975 | 1981 | ||
| @@ -1979,10 +1985,21 @@ struct packet_offload { | |||
| 1979 | struct list_head list; | 1985 | struct list_head list; |
| 1980 | }; | 1986 | }; |
| 1981 | 1987 | ||
| 1988 | struct udp_offload; | ||
| 1989 | |||
| 1990 | struct udp_offload_callbacks { | ||
| 1991 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
| 1992 | struct sk_buff *skb, | ||
| 1993 | struct udp_offload *uoff); | ||
| 1994 | int (*gro_complete)(struct sk_buff *skb, | ||
| 1995 | int nhoff, | ||
| 1996 | struct udp_offload *uoff); | ||
| 1997 | }; | ||
| 1998 | |||
| 1982 | struct udp_offload { | 1999 | struct udp_offload { |
| 1983 | __be16 port; | 2000 | __be16 port; |
| 1984 | u8 ipproto; | 2001 | u8 ipproto; |
| 1985 | struct offload_callbacks callbacks; | 2002 | struct udp_offload_callbacks callbacks; |
| 1986 | }; | 2003 | }; |
| 1987 | 2004 | ||
| 1988 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | 2005 | /* often modified stats are per cpu, other are shared (netdev->stats) */ |
| @@ -2041,6 +2058,7 @@ struct pcpu_sw_netstats { | |||
| 2041 | #define NETDEV_RESEND_IGMP 0x0016 | 2058 | #define NETDEV_RESEND_IGMP 0x0016 |
| 2042 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ | 2059 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ |
| 2043 | #define NETDEV_CHANGEINFODATA 0x0018 | 2060 | #define NETDEV_CHANGEINFODATA 0x0018 |
| 2061 | #define NETDEV_BONDING_INFO 0x0019 | ||
| 2044 | 2062 | ||
| 2045 | int register_netdevice_notifier(struct notifier_block *nb); | 2063 | int register_netdevice_notifier(struct notifier_block *nb); |
| 2046 | int unregister_netdevice_notifier(struct notifier_block *nb); | 2064 | int unregister_netdevice_notifier(struct notifier_block *nb); |
| @@ -2303,6 +2321,21 @@ do { \ | |||
| 2303 | compute_pseudo(skb, proto)); \ | 2321 | compute_pseudo(skb, proto)); \ |
| 2304 | } while (0) | 2322 | } while (0) |
| 2305 | 2323 | ||
| 2324 | static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr, | ||
| 2325 | int start, int offset) | ||
| 2326 | { | ||
| 2327 | __wsum delta; | ||
| 2328 | |||
| 2329 | BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); | ||
| 2330 | |||
| 2331 | delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset); | ||
| 2332 | |||
| 2333 | /* Adjust skb->csum since we changed the packet */ | ||
| 2334 | skb->csum = csum_add(skb->csum, delta); | ||
| 2335 | NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); | ||
| 2336 | } | ||
| 2337 | |||
| 2338 | |||
| 2306 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 2339 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
| 2307 | unsigned short type, | 2340 | unsigned short type, |
| 2308 | const void *daddr, const void *saddr, | 2341 | const void *daddr, const void *saddr, |
| @@ -3464,6 +3497,19 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, | |||
| 3464 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | 3497 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, |
| 3465 | netdev_features_t features); | 3498 | netdev_features_t features); |
| 3466 | 3499 | ||
| 3500 | struct netdev_bonding_info { | ||
| 3501 | ifslave slave; | ||
| 3502 | ifbond master; | ||
| 3503 | }; | ||
| 3504 | |||
| 3505 | struct netdev_notifier_bonding_info { | ||
| 3506 | struct netdev_notifier_info info; /* must be first */ | ||
| 3507 | struct netdev_bonding_info bonding_info; | ||
| 3508 | }; | ||
| 3509 | |||
| 3510 | void netdev_bonding_info_change(struct net_device *dev, | ||
| 3511 | struct netdev_bonding_info *bonding_info); | ||
| 3512 | |||
| 3467 | static inline | 3513 | static inline |
| 3468 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | 3514 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) |
| 3469 | { | 3515 | { |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 22af8f8f5802..685809835b5c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -327,6 +327,8 @@ struct phy_c45_device_ids { | |||
| 327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | 327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. |
| 328 | * is_c45: Set to true if this phy uses clause 45 addressing. | 328 | * is_c45: Set to true if this phy uses clause 45 addressing. |
| 329 | * is_internal: Set to true if this phy is internal to a MAC. | 329 | * is_internal: Set to true if this phy is internal to a MAC. |
| 330 | * has_fixups: Set to true if this phy has fixups/quirks. | ||
| 331 | * suspended: Set to true if this phy has been suspended successfully. | ||
| 330 | * state: state of the PHY for management purposes | 332 | * state: state of the PHY for management purposes |
| 331 | * dev_flags: Device-specific flags used by the PHY driver. | 333 | * dev_flags: Device-specific flags used by the PHY driver. |
| 332 | * addr: Bus address of PHY | 334 | * addr: Bus address of PHY |
| @@ -364,6 +366,7 @@ struct phy_device { | |||
| 364 | bool is_c45; | 366 | bool is_c45; |
| 365 | bool is_internal; | 367 | bool is_internal; |
| 366 | bool has_fixups; | 368 | bool has_fixups; |
| 369 | bool suspended; | ||
| 367 | 370 | ||
| 368 | enum phy_state state; | 371 | enum phy_state state; |
| 369 | 372 | ||
| @@ -565,6 +568,15 @@ struct phy_driver { | |||
| 565 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, | 568 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, |
| 566 | int devnum, int regnum, u32 val); | 569 | int devnum, int regnum, u32 val); |
| 567 | 570 | ||
| 571 | /* Get the size and type of the eeprom contained within a plug-in | ||
| 572 | * module */ | ||
| 573 | int (*module_info)(struct phy_device *dev, | ||
| 574 | struct ethtool_modinfo *modinfo); | ||
| 575 | |||
| 576 | /* Get the eeprom information from the plug-in module */ | ||
| 577 | int (*module_eeprom)(struct phy_device *dev, | ||
| 578 | struct ethtool_eeprom *ee, u8 *data); | ||
| 579 | |||
| 568 | struct device_driver driver; | 580 | struct device_driver driver; |
| 569 | }; | 581 | }; |
| 570 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | 582 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) |
diff --git a/include/linux/platform_data/irda-sa11x0.h b/include/linux/platform_data/irda-sa11x0.h new file mode 100644 index 000000000000..38f77b5e56cf --- /dev/null +++ b/include/linux/platform_data/irda-sa11x0.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/mach/irda.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 Russell King. | ||
| 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 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef __ASM_ARM_MACH_IRDA_H | ||
| 11 | #define __ASM_ARM_MACH_IRDA_H | ||
| 12 | |||
| 13 | struct irda_platform_data { | ||
| 14 | int (*startup)(struct device *); | ||
| 15 | void (*shutdown)(struct device *); | ||
| 16 | int (*set_power)(struct device *, unsigned int state); | ||
| 17 | void (*set_speed)(struct device *, unsigned int speed); | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif | ||
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h index 5087fff96d86..cc2bdafb0c69 100644 --- a/include/linux/platform_data/st21nfca.h +++ b/include/linux/platform_data/st21nfca.h | |||
| @@ -26,6 +26,8 @@ | |||
| 26 | struct st21nfca_nfc_platform_data { | 26 | struct st21nfca_nfc_platform_data { |
| 27 | unsigned int gpio_ena; | 27 | unsigned int gpio_ena; |
| 28 | unsigned int irq_polarity; | 28 | unsigned int irq_polarity; |
| 29 | bool is_ese_present; | ||
| 30 | bool is_uicc_present; | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | #endif /* _ST21NFCA_HCI_H_ */ | 33 | #endif /* _ST21NFCA_HCI_H_ */ |
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h index c3b432f5b63e..b023373d9874 100644 --- a/include/linux/platform_data/st21nfcb.h +++ b/include/linux/platform_data/st21nfcb.h | |||
| @@ -19,8 +19,6 @@ | |||
| 19 | #ifndef _ST21NFCB_NCI_H_ | 19 | #ifndef _ST21NFCB_NCI_H_ |
| 20 | #define _ST21NFCB_NCI_H_ | 20 | #define _ST21NFCB_NCI_H_ |
| 21 | 21 | ||
| 22 | #include <linux/i2c.h> | ||
| 23 | |||
| 24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" | 22 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" |
| 25 | 23 | ||
| 26 | struct st21nfcb_nfc_platform_data { | 24 | struct st21nfcb_nfc_platform_data { |
| @@ -28,4 +26,4 @@ struct st21nfcb_nfc_platform_data { | |||
| 28 | unsigned int irq_polarity; | 26 | unsigned int irq_polarity; |
| 29 | }; | 27 | }; |
| 30 | 28 | ||
| 31 | #endif /* _ST21NFCA_HCI_H_ */ | 29 | #endif /* _ST21NFCB_NCI_H_ */ |
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index b93fd89b2e5e..58851275fed9 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
| @@ -18,16 +18,45 @@ | |||
| 18 | #ifndef _LINUX_RHASHTABLE_H | 18 | #ifndef _LINUX_RHASHTABLE_H |
| 19 | #define _LINUX_RHASHTABLE_H | 19 | #define _LINUX_RHASHTABLE_H |
| 20 | 20 | ||
| 21 | #include <linux/rculist.h> | 21 | #include <linux/compiler.h> |
| 22 | #include <linux/list_nulls.h> | ||
| 23 | #include <linux/workqueue.h> | ||
| 24 | #include <linux/mutex.h> | ||
| 25 | |||
| 26 | /* | ||
| 27 | * The end of the chain is marked with a special nulls marks which has | ||
| 28 | * the following format: | ||
| 29 | * | ||
| 30 | * +-------+-----------------------------------------------------+-+ | ||
| 31 | * | Base | Hash |1| | ||
| 32 | * +-------+-----------------------------------------------------+-+ | ||
| 33 | * | ||
| 34 | * Base (4 bits) : Reserved to distinguish between multiple tables. | ||
| 35 | * Specified via &struct rhashtable_params.nulls_base. | ||
| 36 | * Hash (27 bits): Full hash (unmasked) of first element added to bucket | ||
| 37 | * 1 (1 bit) : Nulls marker (always set) | ||
| 38 | * | ||
| 39 | * The remaining bits of the next pointer remain unused for now. | ||
| 40 | */ | ||
| 41 | #define RHT_BASE_BITS 4 | ||
| 42 | #define RHT_HASH_BITS 27 | ||
| 43 | #define RHT_BASE_SHIFT RHT_HASH_BITS | ||
| 22 | 44 | ||
| 23 | struct rhash_head { | 45 | struct rhash_head { |
| 24 | struct rhash_head __rcu *next; | 46 | struct rhash_head __rcu *next; |
| 25 | }; | 47 | }; |
| 26 | 48 | ||
| 27 | #define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL) | 49 | /** |
| 28 | 50 | * struct bucket_table - Table of hash buckets | |
| 51 | * @size: Number of hash buckets | ||
| 52 | * @locks_mask: Mask to apply before accessing locks[] | ||
| 53 | * @locks: Array of spinlocks protecting individual buckets | ||
| 54 | * @buckets: size * hash buckets | ||
| 55 | */ | ||
| 29 | struct bucket_table { | 56 | struct bucket_table { |
| 30 | size_t size; | 57 | size_t size; |
| 58 | unsigned int locks_mask; | ||
| 59 | spinlock_t *locks; | ||
| 31 | struct rhash_head __rcu *buckets[]; | 60 | struct rhash_head __rcu *buckets[]; |
| 32 | }; | 61 | }; |
| 33 | 62 | ||
| @@ -45,11 +74,16 @@ struct rhashtable; | |||
| 45 | * @hash_rnd: Seed to use while hashing | 74 | * @hash_rnd: Seed to use while hashing |
| 46 | * @max_shift: Maximum number of shifts while expanding | 75 | * @max_shift: Maximum number of shifts while expanding |
| 47 | * @min_shift: Minimum number of shifts while shrinking | 76 | * @min_shift: Minimum number of shifts while shrinking |
| 77 | * @nulls_base: Base value to generate nulls marker | ||
| 78 | * @locks_mul: Number of bucket locks to allocate per cpu (default: 128) | ||
| 48 | * @hashfn: Function to hash key | 79 | * @hashfn: Function to hash key |
| 49 | * @obj_hashfn: Function to hash object | 80 | * @obj_hashfn: Function to hash object |
| 50 | * @grow_decision: If defined, may return true if table should expand | 81 | * @grow_decision: If defined, may return true if table should expand |
| 51 | * @shrink_decision: If defined, may return true if table should shrink | 82 | * @shrink_decision: If defined, may return true if table should shrink |
| 52 | * @mutex_is_held: Must return true if protecting mutex is held | 83 | * |
| 84 | * Note: when implementing the grow and shrink decision function, min/max | ||
| 85 | * shift must be enforced, otherwise, resizing watermarks they set may be | ||
| 86 | * useless. | ||
| 53 | */ | 87 | */ |
| 54 | struct rhashtable_params { | 88 | struct rhashtable_params { |
| 55 | size_t nelem_hint; | 89 | size_t nelem_hint; |
| @@ -59,36 +93,95 @@ struct rhashtable_params { | |||
| 59 | u32 hash_rnd; | 93 | u32 hash_rnd; |
| 60 | size_t max_shift; | 94 | size_t max_shift; |
| 61 | size_t min_shift; | 95 | size_t min_shift; |
| 96 | u32 nulls_base; | ||
| 97 | size_t locks_mul; | ||
| 62 | rht_hashfn_t hashfn; | 98 | rht_hashfn_t hashfn; |
| 63 | rht_obj_hashfn_t obj_hashfn; | 99 | rht_obj_hashfn_t obj_hashfn; |
| 64 | bool (*grow_decision)(const struct rhashtable *ht, | 100 | bool (*grow_decision)(const struct rhashtable *ht, |
| 65 | size_t new_size); | 101 | size_t new_size); |
| 66 | bool (*shrink_decision)(const struct rhashtable *ht, | 102 | bool (*shrink_decision)(const struct rhashtable *ht, |
| 67 | size_t new_size); | 103 | size_t new_size); |
| 68 | #ifdef CONFIG_PROVE_LOCKING | ||
| 69 | int (*mutex_is_held)(void *parent); | ||
| 70 | void *parent; | ||
| 71 | #endif | ||
| 72 | }; | 104 | }; |
| 73 | 105 | ||
| 74 | /** | 106 | /** |
| 75 | * struct rhashtable - Hash table handle | 107 | * struct rhashtable - Hash table handle |
| 76 | * @tbl: Bucket table | 108 | * @tbl: Bucket table |
| 109 | * @future_tbl: Table under construction during expansion/shrinking | ||
| 77 | * @nelems: Number of elements in table | 110 | * @nelems: Number of elements in table |
| 78 | * @shift: Current size (1 << shift) | 111 | * @shift: Current size (1 << shift) |
| 79 | * @p: Configuration parameters | 112 | * @p: Configuration parameters |
| 113 | * @run_work: Deferred worker to expand/shrink asynchronously | ||
| 114 | * @mutex: Mutex to protect current/future table swapping | ||
| 115 | * @walkers: List of active walkers | ||
| 116 | * @being_destroyed: True if table is set up for destruction | ||
| 80 | */ | 117 | */ |
| 81 | struct rhashtable { | 118 | struct rhashtable { |
| 82 | struct bucket_table __rcu *tbl; | 119 | struct bucket_table __rcu *tbl; |
| 83 | size_t nelems; | 120 | struct bucket_table __rcu *future_tbl; |
| 84 | size_t shift; | 121 | atomic_t nelems; |
| 122 | atomic_t shift; | ||
| 85 | struct rhashtable_params p; | 123 | struct rhashtable_params p; |
| 124 | struct work_struct run_work; | ||
| 125 | struct mutex mutex; | ||
| 126 | struct list_head walkers; | ||
| 127 | bool being_destroyed; | ||
| 128 | }; | ||
| 129 | |||
| 130 | /** | ||
| 131 | * struct rhashtable_walker - Hash table walker | ||
| 132 | * @list: List entry on list of walkers | ||
| 133 | * @resize: Resize event occured | ||
| 134 | */ | ||
| 135 | struct rhashtable_walker { | ||
| 136 | struct list_head list; | ||
| 137 | bool resize; | ||
| 86 | }; | 138 | }; |
| 87 | 139 | ||
| 140 | /** | ||
| 141 | * struct rhashtable_iter - Hash table iterator, fits into netlink cb | ||
| 142 | * @ht: Table to iterate through | ||
| 143 | * @p: Current pointer | ||
| 144 | * @walker: Associated rhashtable walker | ||
| 145 | * @slot: Current slot | ||
| 146 | * @skip: Number of entries to skip in slot | ||
| 147 | */ | ||
| 148 | struct rhashtable_iter { | ||
| 149 | struct rhashtable *ht; | ||
| 150 | struct rhash_head *p; | ||
| 151 | struct rhashtable_walker *walker; | ||
| 152 | unsigned int slot; | ||
| 153 | unsigned int skip; | ||
| 154 | }; | ||
| 155 | |||
| 156 | static inline unsigned long rht_marker(const struct rhashtable *ht, u32 hash) | ||
| 157 | { | ||
| 158 | return NULLS_MARKER(ht->p.nulls_base + hash); | ||
| 159 | } | ||
| 160 | |||
| 161 | #define INIT_RHT_NULLS_HEAD(ptr, ht, hash) \ | ||
| 162 | ((ptr) = (typeof(ptr)) rht_marker(ht, hash)) | ||
| 163 | |||
| 164 | static inline bool rht_is_a_nulls(const struct rhash_head *ptr) | ||
| 165 | { | ||
| 166 | return ((unsigned long) ptr & 1); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline unsigned long rht_get_nulls_value(const struct rhash_head *ptr) | ||
| 170 | { | ||
| 171 | return ((unsigned long) ptr) >> 1; | ||
| 172 | } | ||
| 173 | |||
| 88 | #ifdef CONFIG_PROVE_LOCKING | 174 | #ifdef CONFIG_PROVE_LOCKING |
| 89 | int lockdep_rht_mutex_is_held(const struct rhashtable *ht); | 175 | int lockdep_rht_mutex_is_held(struct rhashtable *ht); |
| 176 | int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash); | ||
| 90 | #else | 177 | #else |
| 91 | static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | 178 | static inline int lockdep_rht_mutex_is_held(struct rhashtable *ht) |
| 179 | { | ||
| 180 | return 1; | ||
| 181 | } | ||
| 182 | |||
| 183 | static inline int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, | ||
| 184 | u32 hash) | ||
| 92 | { | 185 | { |
| 93 | return 1; | 186 | return 1; |
| 94 | } | 187 | } |
| @@ -96,13 +189,8 @@ static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | |||
| 96 | 189 | ||
| 97 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); | 190 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); |
| 98 | 191 | ||
| 99 | u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len); | ||
| 100 | u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr); | ||
| 101 | |||
| 102 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); | 192 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); |
| 103 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); | 193 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); |
| 104 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, | ||
| 105 | struct rhash_head __rcu **pprev); | ||
| 106 | 194 | ||
| 107 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); | 195 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); |
| 108 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | 196 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); |
| @@ -110,11 +198,23 @@ bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | |||
| 110 | int rhashtable_expand(struct rhashtable *ht); | 198 | int rhashtable_expand(struct rhashtable *ht); |
| 111 | int rhashtable_shrink(struct rhashtable *ht); | 199 | int rhashtable_shrink(struct rhashtable *ht); |
| 112 | 200 | ||
| 113 | void *rhashtable_lookup(const struct rhashtable *ht, const void *key); | 201 | void *rhashtable_lookup(struct rhashtable *ht, const void *key); |
| 114 | void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash, | 202 | void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key, |
| 115 | bool (*compare)(void *, void *), void *arg); | 203 | bool (*compare)(void *, void *), void *arg); |
| 116 | 204 | ||
| 117 | void rhashtable_destroy(const struct rhashtable *ht); | 205 | bool rhashtable_lookup_insert(struct rhashtable *ht, struct rhash_head *obj); |
| 206 | bool rhashtable_lookup_compare_insert(struct rhashtable *ht, | ||
| 207 | struct rhash_head *obj, | ||
| 208 | bool (*compare)(void *, void *), | ||
| 209 | void *arg); | ||
| 210 | |||
| 211 | int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter); | ||
| 212 | void rhashtable_walk_exit(struct rhashtable_iter *iter); | ||
| 213 | int rhashtable_walk_start(struct rhashtable_iter *iter) __acquires(RCU); | ||
| 214 | void *rhashtable_walk_next(struct rhashtable_iter *iter); | ||
| 215 | void rhashtable_walk_stop(struct rhashtable_iter *iter) __releases(RCU); | ||
| 216 | |||
| 217 | void rhashtable_destroy(struct rhashtable *ht); | ||
| 118 | 218 | ||
| 119 | #define rht_dereference(p, ht) \ | 219 | #define rht_dereference(p, ht) \ |
| 120 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) | 220 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) |
| @@ -122,92 +222,146 @@ void rhashtable_destroy(const struct rhashtable *ht); | |||
| 122 | #define rht_dereference_rcu(p, ht) \ | 222 | #define rht_dereference_rcu(p, ht) \ |
| 123 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) | 223 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) |
| 124 | 224 | ||
| 125 | #define rht_entry(ptr, type, member) container_of(ptr, type, member) | 225 | #define rht_dereference_bucket(p, tbl, hash) \ |
| 126 | #define rht_entry_safe(ptr, type, member) \ | 226 | rcu_dereference_protected(p, lockdep_rht_bucket_is_held(tbl, hash)) |
| 127 | ({ \ | 227 | |
| 128 | typeof(ptr) __ptr = (ptr); \ | 228 | #define rht_dereference_bucket_rcu(p, tbl, hash) \ |
| 129 | __ptr ? rht_entry(__ptr, type, member) : NULL; \ | 229 | rcu_dereference_check(p, lockdep_rht_bucket_is_held(tbl, hash)) |
| 130 | }) | ||
| 131 | 230 | ||
| 132 | #define rht_next_entry_safe(pos, ht, member) \ | 231 | #define rht_entry(tpos, pos, member) \ |
| 133 | ({ \ | 232 | ({ tpos = container_of(pos, typeof(*tpos), member); 1; }) |
| 134 | pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \ | 233 | |
| 135 | typeof(*(pos)), member) : NULL; \ | 234 | /** |
| 136 | }) | 235 | * rht_for_each_continue - continue iterating over hash chain |
| 236 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 237 | * @head: the previous &struct rhash_head to continue from | ||
| 238 | * @tbl: the &struct bucket_table | ||
| 239 | * @hash: the hash value / bucket index | ||
| 240 | */ | ||
| 241 | #define rht_for_each_continue(pos, head, tbl, hash) \ | ||
| 242 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
| 243 | !rht_is_a_nulls(pos); \ | ||
| 244 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
| 137 | 245 | ||
| 138 | /** | 246 | /** |
| 139 | * rht_for_each - iterate over hash chain | 247 | * rht_for_each - iterate over hash chain |
| 140 | * @pos: &struct rhash_head to use as a loop cursor. | 248 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 141 | * @head: head of the hash chain (struct rhash_head *) | 249 | * @tbl: the &struct bucket_table |
| 142 | * @ht: pointer to your struct rhashtable | 250 | * @hash: the hash value / bucket index |
| 143 | */ | 251 | */ |
| 144 | #define rht_for_each(pos, head, ht) \ | 252 | #define rht_for_each(pos, tbl, hash) \ |
| 145 | for (pos = rht_dereference(head, ht); \ | 253 | rht_for_each_continue(pos, (tbl)->buckets[hash], tbl, hash) |
| 146 | pos; \ | 254 | |
| 147 | pos = rht_dereference((pos)->next, ht)) | 255 | /** |
| 256 | * rht_for_each_entry_continue - continue iterating over hash chain | ||
| 257 | * @tpos: the type * to use as a loop cursor. | ||
| 258 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 259 | * @head: the previous &struct rhash_head to continue from | ||
| 260 | * @tbl: the &struct bucket_table | ||
| 261 | * @hash: the hash value / bucket index | ||
| 262 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 263 | */ | ||
| 264 | #define rht_for_each_entry_continue(tpos, pos, head, tbl, hash, member) \ | ||
| 265 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
| 266 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ | ||
| 267 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
| 148 | 268 | ||
| 149 | /** | 269 | /** |
| 150 | * rht_for_each_entry - iterate over hash chain of given type | 270 | * rht_for_each_entry - iterate over hash chain of given type |
| 151 | * @pos: type * to use as a loop cursor. | 271 | * @tpos: the type * to use as a loop cursor. |
| 152 | * @head: head of the hash chain (struct rhash_head *) | 272 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 153 | * @ht: pointer to your struct rhashtable | 273 | * @tbl: the &struct bucket_table |
| 154 | * @member: name of the rhash_head within the hashable struct. | 274 | * @hash: the hash value / bucket index |
| 275 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 155 | */ | 276 | */ |
| 156 | #define rht_for_each_entry(pos, head, ht, member) \ | 277 | #define rht_for_each_entry(tpos, pos, tbl, hash, member) \ |
| 157 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 278 | rht_for_each_entry_continue(tpos, pos, (tbl)->buckets[hash], \ |
| 158 | typeof(*(pos)), member); \ | 279 | tbl, hash, member) |
| 159 | pos; \ | ||
| 160 | pos = rht_next_entry_safe(pos, ht, member)) | ||
| 161 | 280 | ||
| 162 | /** | 281 | /** |
| 163 | * rht_for_each_entry_safe - safely iterate over hash chain of given type | 282 | * rht_for_each_entry_safe - safely iterate over hash chain of given type |
| 164 | * @pos: type * to use as a loop cursor. | 283 | * @tpos: the type * to use as a loop cursor. |
| 165 | * @n: type * to use for temporary next object storage | 284 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 166 | * @head: head of the hash chain (struct rhash_head *) | 285 | * @next: the &struct rhash_head to use as next in loop cursor. |
| 167 | * @ht: pointer to your struct rhashtable | 286 | * @tbl: the &struct bucket_table |
| 168 | * @member: name of the rhash_head within the hashable struct. | 287 | * @hash: the hash value / bucket index |
| 288 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 169 | * | 289 | * |
| 170 | * This hash chain list-traversal primitive allows for the looped code to | 290 | * This hash chain list-traversal primitive allows for the looped code to |
| 171 | * remove the loop cursor from the list. | 291 | * remove the loop cursor from the list. |
| 172 | */ | 292 | */ |
| 173 | #define rht_for_each_entry_safe(pos, n, head, ht, member) \ | 293 | #define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \ |
| 174 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 294 | for (pos = rht_dereference_bucket((tbl)->buckets[hash], tbl, hash), \ |
| 175 | typeof(*(pos)), member), \ | 295 | next = !rht_is_a_nulls(pos) ? \ |
| 176 | n = rht_next_entry_safe(pos, ht, member); \ | 296 | rht_dereference_bucket(pos->next, tbl, hash) : NULL; \ |
| 177 | pos; \ | 297 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
| 178 | pos = n, \ | 298 | pos = next, \ |
| 179 | n = rht_next_entry_safe(pos, ht, member)) | 299 | next = !rht_is_a_nulls(pos) ? \ |
| 300 | rht_dereference_bucket(pos->next, tbl, hash) : NULL) | ||
| 301 | |||
| 302 | /** | ||
| 303 | * rht_for_each_rcu_continue - continue iterating over rcu hash chain | ||
| 304 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 305 | * @head: the previous &struct rhash_head to continue from | ||
| 306 | * @tbl: the &struct bucket_table | ||
| 307 | * @hash: the hash value / bucket index | ||
| 308 | * | ||
| 309 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 310 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
| 311 | * traversal is guarded by rcu_read_lock(). | ||
| 312 | */ | ||
| 313 | #define rht_for_each_rcu_continue(pos, head, tbl, hash) \ | ||
| 314 | for (({barrier(); }), \ | ||
| 315 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ | ||
| 316 | !rht_is_a_nulls(pos); \ | ||
| 317 | pos = rcu_dereference_raw(pos->next)) | ||
| 180 | 318 | ||
| 181 | /** | 319 | /** |
| 182 | * rht_for_each_rcu - iterate over rcu hash chain | 320 | * rht_for_each_rcu - iterate over rcu hash chain |
| 183 | * @pos: &struct rhash_head to use as a loop cursor. | 321 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 184 | * @head: head of the hash chain (struct rhash_head *) | 322 | * @tbl: the &struct bucket_table |
| 185 | * @ht: pointer to your struct rhashtable | 323 | * @hash: the hash value / bucket index |
| 324 | * | ||
| 325 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 326 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
| 327 | * traversal is guarded by rcu_read_lock(). | ||
| 328 | */ | ||
| 329 | #define rht_for_each_rcu(pos, tbl, hash) \ | ||
| 330 | rht_for_each_rcu_continue(pos, (tbl)->buckets[hash], tbl, hash) | ||
| 331 | |||
| 332 | /** | ||
| 333 | * rht_for_each_entry_rcu_continue - continue iterating over rcu hash chain | ||
| 334 | * @tpos: the type * to use as a loop cursor. | ||
| 335 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 336 | * @head: the previous &struct rhash_head to continue from | ||
| 337 | * @tbl: the &struct bucket_table | ||
| 338 | * @hash: the hash value / bucket index | ||
| 339 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 186 | * | 340 | * |
| 187 | * This hash chain list-traversal primitive may safely run concurrently with | 341 | * This hash chain list-traversal primitive may safely run concurrently with |
| 188 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 342 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
| 189 | * traversal is guarded by rcu_read_lock(). | 343 | * traversal is guarded by rcu_read_lock(). |
| 190 | */ | 344 | */ |
| 191 | #define rht_for_each_rcu(pos, head, ht) \ | 345 | #define rht_for_each_entry_rcu_continue(tpos, pos, head, tbl, hash, member) \ |
| 192 | for (pos = rht_dereference_rcu(head, ht); \ | 346 | for (({barrier(); }), \ |
| 193 | pos; \ | 347 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ |
| 194 | pos = rht_dereference_rcu((pos)->next, ht)) | 348 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
| 349 | pos = rht_dereference_bucket_rcu(pos->next, tbl, hash)) | ||
| 195 | 350 | ||
| 196 | /** | 351 | /** |
| 197 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type | 352 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type |
| 198 | * @pos: type * to use as a loop cursor. | 353 | * @tpos: the type * to use as a loop cursor. |
| 199 | * @head: head of the hash chain (struct rhash_head *) | 354 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 200 | * @member: name of the rhash_head within the hashable struct. | 355 | * @tbl: the &struct bucket_table |
| 356 | * @hash: the hash value / bucket index | ||
| 357 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 201 | * | 358 | * |
| 202 | * This hash chain list-traversal primitive may safely run concurrently with | 359 | * This hash chain list-traversal primitive may safely run concurrently with |
| 203 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 360 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
| 204 | * traversal is guarded by rcu_read_lock(). | 361 | * traversal is guarded by rcu_read_lock(). |
| 205 | */ | 362 | */ |
| 206 | #define rht_for_each_entry_rcu(pos, head, member) \ | 363 | #define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \ |
| 207 | for (pos = rht_entry_safe(rcu_dereference_raw(head), \ | 364 | rht_for_each_entry_rcu_continue(tpos, pos, (tbl)->buckets[hash],\ |
| 208 | typeof(*(pos)), member); \ | 365 | tbl, hash, member) |
| 209 | pos; \ | ||
| 210 | pos = rht_entry_safe(rcu_dereference_raw((pos)->member.next), \ | ||
| 211 | typeof(*(pos)), member)) | ||
| 212 | 366 | ||
| 213 | #endif /* _LINUX_RHASHTABLE_H */ | 367 | #endif /* _LINUX_RHASHTABLE_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 85ab7d72b54c..1bb36edb66b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -626,8 +626,11 @@ struct sk_buff { | |||
| 626 | __u32 hash; | 626 | __u32 hash; |
| 627 | __be16 vlan_proto; | 627 | __be16 vlan_proto; |
| 628 | __u16 vlan_tci; | 628 | __u16 vlan_tci; |
| 629 | #ifdef CONFIG_NET_RX_BUSY_POLL | 629 | #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) |
| 630 | unsigned int napi_id; | 630 | union { |
| 631 | unsigned int napi_id; | ||
| 632 | unsigned int sender_cpu; | ||
| 633 | }; | ||
| 631 | #endif | 634 | #endif |
| 632 | #ifdef CONFIG_NETWORK_SECMARK | 635 | #ifdef CONFIG_NETWORK_SECMARK |
| 633 | __u32 secmark; | 636 | __u32 secmark; |
| @@ -2484,19 +2487,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) | |||
| 2484 | } | 2487 | } |
| 2485 | 2488 | ||
| 2486 | static inline int skb_add_data(struct sk_buff *skb, | 2489 | static inline int skb_add_data(struct sk_buff *skb, |
| 2487 | char __user *from, int copy) | 2490 | struct iov_iter *from, int copy) |
| 2488 | { | 2491 | { |
| 2489 | const int off = skb->len; | 2492 | const int off = skb->len; |
| 2490 | 2493 | ||
| 2491 | if (skb->ip_summed == CHECKSUM_NONE) { | 2494 | if (skb->ip_summed == CHECKSUM_NONE) { |
| 2492 | int err = 0; | 2495 | __wsum csum = 0; |
| 2493 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), | 2496 | if (csum_and_copy_from_iter(skb_put(skb, copy), copy, |
| 2494 | copy, 0, &err); | 2497 | &csum, from) == copy) { |
| 2495 | if (!err) { | ||
| 2496 | skb->csum = csum_block_add(skb->csum, csum, off); | 2498 | skb->csum = csum_block_add(skb->csum, csum, off); |
| 2497 | return 0; | 2499 | return 0; |
| 2498 | } | 2500 | } |
| 2499 | } else if (!copy_from_user(skb_put(skb, copy), from, copy)) | 2501 | } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy) |
| 2500 | return 0; | 2502 | return 0; |
| 2501 | 2503 | ||
| 2502 | __skb_trim(skb, off); | 2504 | __skb_trim(skb, off); |
| @@ -2693,8 +2695,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | |||
| 2693 | 2695 | ||
| 2694 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) | 2696 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) |
| 2695 | { | 2697 | { |
| 2696 | /* XXX: stripping const */ | 2698 | return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; |
| 2697 | return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len); | ||
| 2698 | } | 2699 | } |
| 2699 | 2700 | ||
| 2700 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) | 2701 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) |
| @@ -3071,7 +3072,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | |||
| 3071 | 3072 | ||
| 3072 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | 3073 | #define skb_checksum_validate_zero_check(skb, proto, check, \ |
| 3073 | compute_pseudo) \ | 3074 | compute_pseudo) \ |
| 3074 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | 3075 | __skb_checksum_validate(skb, proto, true, true, check, compute_pseudo) |
| 3075 | 3076 | ||
| 3076 | #define skb_checksum_simple_validate(skb) \ | 3077 | #define skb_checksum_simple_validate(skb) \ |
| 3077 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | 3078 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) |
| @@ -3096,6 +3097,27 @@ do { \ | |||
| 3096 | compute_pseudo(skb, proto)); \ | 3097 | compute_pseudo(skb, proto)); \ |
| 3097 | } while (0) | 3098 | } while (0) |
| 3098 | 3099 | ||
| 3100 | /* Update skbuf and packet to reflect the remote checksum offload operation. | ||
| 3101 | * When called, ptr indicates the starting point for skb->csum when | ||
| 3102 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete | ||
| 3103 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. | ||
| 3104 | */ | ||
| 3105 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, | ||
| 3106 | int start, int offset) | ||
| 3107 | { | ||
| 3108 | __wsum delta; | ||
| 3109 | |||
| 3110 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { | ||
| 3111 | __skb_checksum_complete(skb); | ||
| 3112 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); | ||
| 3113 | } | ||
| 3114 | |||
| 3115 | delta = remcsum_adjust(ptr, skb->csum, start, offset); | ||
| 3116 | |||
| 3117 | /* Adjust skb->csum since we changed the packet */ | ||
| 3118 | skb->csum = csum_add(skb->csum, delta); | ||
| 3119 | } | ||
| 3120 | |||
| 3099 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 3121 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 3100 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 3122 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
| 3101 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 3123 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6e49a14365dc..5c19cba34dce 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -318,13 +318,6 @@ struct ucred { | |||
| 318 | /* IPX options */ | 318 | /* IPX options */ |
| 319 | #define IPX_TYPE 1 | 319 | #define IPX_TYPE 1 |
| 320 | 320 | ||
| 321 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | ||
| 322 | struct iovec *iov, | ||
| 323 | int offset, | ||
| 324 | unsigned int len, __wsum *csump); | ||
| 325 | extern unsigned long iov_pages(const struct iovec *iov, int offset, | ||
| 326 | unsigned long nr_segs); | ||
| 327 | |||
| 328 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); | 321 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); |
| 329 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 322 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
| 330 | 323 | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 262ba4ef9a8e..3e18379dfa6f 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -190,6 +190,8 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
| 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 191 | # define raw_spin_lock_nested(lock, subclass) \ | 191 | # define raw_spin_lock_nested(lock, subclass) \ |
| 192 | _raw_spin_lock_nested(lock, subclass) | 192 | _raw_spin_lock_nested(lock, subclass) |
| 193 | # define raw_spin_lock_bh_nested(lock, subclass) \ | ||
| 194 | _raw_spin_lock_bh_nested(lock, subclass) | ||
| 193 | 195 | ||
| 194 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ | 196 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ |
| 195 | do { \ | 197 | do { \ |
| @@ -205,6 +207,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
| 205 | # define raw_spin_lock_nested(lock, subclass) \ | 207 | # define raw_spin_lock_nested(lock, subclass) \ |
| 206 | _raw_spin_lock(((void)(subclass), (lock))) | 208 | _raw_spin_lock(((void)(subclass), (lock))) |
| 207 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) | 209 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) |
| 210 | # define raw_spin_lock_bh_nested(lock, subclass) _raw_spin_lock_bh(lock) | ||
| 208 | #endif | 211 | #endif |
| 209 | 212 | ||
| 210 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 213 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
| @@ -324,6 +327,11 @@ do { \ | |||
| 324 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ | 327 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ |
| 325 | } while (0) | 328 | } while (0) |
| 326 | 329 | ||
| 330 | #define spin_lock_bh_nested(lock, subclass) \ | ||
| 331 | do { \ | ||
| 332 | raw_spin_lock_bh_nested(spinlock_check(lock), subclass);\ | ||
| 333 | } while (0) | ||
| 334 | |||
| 327 | #define spin_lock_nest_lock(lock, nest_lock) \ | 335 | #define spin_lock_nest_lock(lock, nest_lock) \ |
| 328 | do { \ | 336 | do { \ |
| 329 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ | 337 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 42dfab89e740..5344268e6e62 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr); | |||
| 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); |
| 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) | 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) |
| 24 | __acquires(lock); | 24 | __acquires(lock); |
| 25 | void __lockfunc _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass) | ||
| 26 | __acquires(lock); | ||
| 25 | void __lockfunc | 27 | void __lockfunc |
| 26 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) | 28 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) |
| 27 | __acquires(lock); | 29 | __acquires(lock); |
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index d0d188861ad6..d3afef9d8dbe 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | #define _raw_spin_lock(lock) __LOCK(lock) | 58 | #define _raw_spin_lock(lock) __LOCK(lock) |
| 59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) | 59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) |
| 60 | #define _raw_spin_lock_bh_nested(lock, subclass) __LOCK(lock) | ||
| 60 | #define _raw_read_lock(lock) __LOCK(lock) | 61 | #define _raw_read_lock(lock) __LOCK(lock) |
| 61 | #define _raw_write_lock(lock) __LOCK(lock) | 62 | #define _raw_write_lock(lock) __LOCK(lock) |
| 62 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) | 63 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index f7b9100686c3..c0f707ac192b 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -173,6 +173,7 @@ | |||
| 173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) | 173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) |
| 174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) | 174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) |
| 175 | #define SSB_SPROMSIZE_WORDS_R10 230 | 175 | #define SSB_SPROMSIZE_WORDS_R10 230 |
| 176 | #define SSB_SPROMSIZE_WORDS_R11 234 | ||
| 176 | #define SSB_SPROM_BASE1 0x1000 | 177 | #define SSB_SPROM_BASE1 0x1000 |
| 177 | #define SSB_SPROM_BASE31 0x0800 | 178 | #define SSB_SPROM_BASE31 0x0800 |
| 178 | #define SSB_SPROM_REVISION 0x007E | 179 | #define SSB_SPROM_REVISION 0x007E |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 67309ece0772..1a7adb411647 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -115,6 +115,7 @@ struct tcp_request_sock { | |||
| 115 | u32 rcv_isn; | 115 | u32 rcv_isn; |
| 116 | u32 snt_isn; | 116 | u32 snt_isn; |
| 117 | u32 snt_synack; /* synack sent time */ | 117 | u32 snt_synack; /* synack sent time */ |
| 118 | u32 last_oow_ack_time; /* last SYNACK */ | ||
| 118 | u32 rcv_nxt; /* the ack # by SYNACK. For | 119 | u32 rcv_nxt; /* the ack # by SYNACK. For |
| 119 | * FastOpen it's the seq# | 120 | * FastOpen it's the seq# |
| 120 | * after data-in-SYN. | 121 | * after data-in-SYN. |
| @@ -152,6 +153,7 @@ struct tcp_sock { | |||
| 152 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ | 153 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ |
| 153 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 154 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
| 154 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 155 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
| 156 | u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */ | ||
| 155 | 157 | ||
| 156 | u32 tsoffset; /* timestamp offset */ | 158 | u32 tsoffset; /* timestamp offset */ |
| 157 | 159 | ||
| @@ -340,6 +342,10 @@ struct tcp_timewait_sock { | |||
| 340 | u32 tw_rcv_wnd; | 342 | u32 tw_rcv_wnd; |
| 341 | u32 tw_ts_offset; | 343 | u32 tw_ts_offset; |
| 342 | u32 tw_ts_recent; | 344 | u32 tw_ts_recent; |
| 345 | |||
| 346 | /* The time we sent the last out-of-window ACK: */ | ||
| 347 | u32 tw_last_oow_ack_time; | ||
| 348 | |||
| 343 | long tw_ts_recent_stamp; | 349 | long tw_ts_recent_stamp; |
| 344 | #ifdef CONFIG_TCP_MD5SIG | 350 | #ifdef CONFIG_TCP_MD5SIG |
| 345 | struct tcp_md5sig_key *tw_md5_key; | 351 | struct tcp_md5sig_key *tw_md5_key; |
diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h new file mode 100644 index 000000000000..4382035a75bb --- /dev/null +++ b/include/linux/timecounter.h | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/timecounter.h | ||
| 3 | * | ||
| 4 | * based on code that migrated away from | ||
| 5 | * linux/include/linux/clocksource.h | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | */ | ||
| 17 | #ifndef _LINUX_TIMECOUNTER_H | ||
| 18 | #define _LINUX_TIMECOUNTER_H | ||
| 19 | |||
| 20 | #include <linux/types.h> | ||
| 21 | |||
| 22 | /* simplify initialization of mask field */ | ||
| 23 | #define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct cyclecounter - hardware abstraction for a free running counter | ||
| 27 | * Provides completely state-free accessors to the underlying hardware. | ||
| 28 | * Depending on which hardware it reads, the cycle counter may wrap | ||
| 29 | * around quickly. Locking rules (if necessary) have to be defined | ||
| 30 | * by the implementor and user of specific instances of this API. | ||
| 31 | * | ||
| 32 | * @read: returns the current cycle value | ||
| 33 | * @mask: bitmask for two's complement | ||
| 34 | * subtraction of non 64 bit counters, | ||
| 35 | * see CYCLECOUNTER_MASK() helper macro | ||
| 36 | * @mult: cycle to nanosecond multiplier | ||
| 37 | * @shift: cycle to nanosecond divisor (power of two) | ||
| 38 | */ | ||
| 39 | struct cyclecounter { | ||
| 40 | cycle_t (*read)(const struct cyclecounter *cc); | ||
| 41 | cycle_t mask; | ||
| 42 | u32 mult; | ||
| 43 | u32 shift; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
| 48 | * Contains the state needed by timecounter_read() to detect | ||
| 49 | * cycle counter wrap around. Initialize with | ||
| 50 | * timecounter_init(). Also used to convert cycle counts into the | ||
| 51 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
| 52 | * of this code are responsible for initializing the underlying | ||
| 53 | * cycle counter hardware, locking issues and reading the time | ||
| 54 | * more often than the cycle counter wraps around. The nanosecond | ||
| 55 | * counter will only wrap around after ~585 years. | ||
| 56 | * | ||
| 57 | * @cc: the cycle counter used by this instance | ||
| 58 | * @cycle_last: most recent cycle counter value seen by | ||
| 59 | * timecounter_read() | ||
| 60 | * @nsec: continuously increasing count | ||
| 61 | * @mask: bit mask for maintaining the 'frac' field | ||
| 62 | * @frac: accumulated fractional nanoseconds | ||
| 63 | */ | ||
| 64 | struct timecounter { | ||
| 65 | const struct cyclecounter *cc; | ||
| 66 | cycle_t cycle_last; | ||
| 67 | u64 nsec; | ||
| 68 | u64 mask; | ||
| 69 | u64 frac; | ||
| 70 | }; | ||
| 71 | |||
| 72 | /** | ||
| 73 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
| 74 | * @cc: Pointer to cycle counter. | ||
| 75 | * @cycles: Cycles | ||
| 76 | * @mask: bit mask for maintaining the 'frac' field | ||
| 77 | * @frac: pointer to storage for the fractional nanoseconds. | ||
| 78 | */ | ||
| 79 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
| 80 | cycle_t cycles, u64 mask, u64 *frac) | ||
| 81 | { | ||
| 82 | u64 ns = (u64) cycles; | ||
| 83 | |||
| 84 | ns = (ns * cc->mult) + *frac; | ||
| 85 | *frac = ns & mask; | ||
| 86 | return ns >> cc->shift; | ||
| 87 | } | ||
| 88 | |||
| 89 | /** | ||
| 90 | * timecounter_adjtime - Shifts the time of the clock. | ||
| 91 | * @delta: Desired change in nanoseconds. | ||
| 92 | */ | ||
| 93 | static inline void timecounter_adjtime(struct timecounter *tc, s64 delta) | ||
| 94 | { | ||
| 95 | tc->nsec += delta; | ||
| 96 | } | ||
| 97 | |||
| 98 | /** | ||
| 99 | * timecounter_init - initialize a time counter | ||
| 100 | * @tc: Pointer to time counter which is to be initialized/reset | ||
| 101 | * @cc: A cycle counter, ready to be used. | ||
| 102 | * @start_tstamp: Arbitrary initial time stamp. | ||
| 103 | * | ||
| 104 | * After this call the current cycle register (roughly) corresponds to | ||
| 105 | * the initial time stamp. Every call to timecounter_read() increments | ||
| 106 | * the time stamp counter by the number of elapsed nanoseconds. | ||
| 107 | */ | ||
| 108 | extern void timecounter_init(struct timecounter *tc, | ||
| 109 | const struct cyclecounter *cc, | ||
| 110 | u64 start_tstamp); | ||
| 111 | |||
| 112 | /** | ||
| 113 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
| 114 | * plus the initial time stamp | ||
| 115 | * @tc: Pointer to time counter. | ||
| 116 | * | ||
| 117 | * In other words, keeps track of time since the same epoch as | ||
| 118 | * the function which generated the initial time stamp. | ||
| 119 | */ | ||
| 120 | extern u64 timecounter_read(struct timecounter *tc); | ||
| 121 | |||
| 122 | /** | ||
| 123 | * timecounter_cyc2time - convert a cycle counter to same | ||
| 124 | * time base as values returned by | ||
| 125 | * timecounter_read() | ||
| 126 | * @tc: Pointer to time counter. | ||
| 127 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
| 128 | * | ||
| 129 | * Cycle counts that are converted correctly as long as they | ||
| 130 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
| 131 | * with "max cycle count" == cs->mask+1. | ||
| 132 | * | ||
| 133 | * This allows conversion of cycle counter values which were generated | ||
| 134 | * in the past. | ||
| 135 | */ | ||
| 136 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
| 137 | cycle_t cycle_tstamp); | ||
| 138 | |||
| 139 | #endif | ||
diff --git a/include/linux/types.h b/include/linux/types.h index a0bb7048687f..62323825cff9 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -213,5 +213,8 @@ struct callback_head { | |||
| 213 | }; | 213 | }; |
| 214 | #define rcu_head callback_head | 214 | #define rcu_head callback_head |
| 215 | 215 | ||
| 216 | /* clocksource cycle base type */ | ||
| 217 | typedef u64 cycle_t; | ||
| 218 | |||
| 216 | #endif /* __ASSEMBLY__ */ | 219 | #endif /* __ASSEMBLY__ */ |
| 217 | #endif /* _LINUX_TYPES_H */ | 220 | #endif /* _LINUX_TYPES_H */ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index ee3277593222..247cfdcc4b08 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
| @@ -49,11 +49,7 @@ struct udp_sock { | |||
| 49 | unsigned int corkflag; /* Cork is required */ | 49 | unsigned int corkflag; /* Cork is required */ |
| 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ | 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ |
| 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ | 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ |
| 52 | no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */ | 52 | no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */ |
| 53 | convert_csum:1;/* On receive, convert checksum | ||
| 54 | * unnecessary to checksum complete | ||
| 55 | * if possible. | ||
| 56 | */ | ||
| 57 | /* | 53 | /* |
| 58 | * Following member retains the information to create a UDP header | 54 | * Following member retains the information to create a UDP header |
| 59 | * when the socket is uncorked. | 55 | * when the socket is uncorked. |
| @@ -102,16 +98,6 @@ static inline bool udp_get_no_check6_rx(struct sock *sk) | |||
| 102 | return udp_sk(sk)->no_check6_rx; | 98 | return udp_sk(sk)->no_check6_rx; |
| 103 | } | 99 | } |
| 104 | 100 | ||
| 105 | static inline void udp_set_convert_csum(struct sock *sk, bool val) | ||
| 106 | { | ||
| 107 | udp_sk(sk)->convert_csum = val; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline bool udp_get_convert_csum(struct sock *sk) | ||
| 111 | { | ||
| 112 | return udp_sk(sk)->convert_csum; | ||
| 113 | } | ||
| 114 | |||
| 115 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | 101 | #define udp_portaddr_for_each_entry(__sk, node, list) \ |
| 116 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | 102 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) |
| 117 | 103 | ||
diff --git a/include/linux/uio.h b/include/linux/uio.h index 1c5e453f7ea9..3e0cb4ea3905 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -135,10 +135,4 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) | |||
| 135 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 135 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
| 136 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 136 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
| 137 | 137 | ||
| 138 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | ||
| 139 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | ||
| 140 | int offset, int len); | ||
| 141 | int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | ||
| 142 | int offset, int len); | ||
| 143 | |||
| 144 | #endif | 138 | #endif |
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h index 5691f752ce8f..63df3a2a8ce5 100644 --- a/include/linux/vmw_vmci_api.h +++ b/include/linux/vmw_vmci_api.h | |||
| @@ -74,7 +74,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair, | |||
| 74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, | 74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, |
| 75 | int mode); | 75 | int mode); |
| 76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, | 76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, |
| 77 | void *iov, size_t iov_size, int mode); | 77 | struct msghdr *msg, size_t iov_size, int mode); |
| 78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | 78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, |
| 79 | struct msghdr *msg, size_t iov_size, int mode); | 79 | struct msghdr *msg, size_t iov_size, int mode); |
| 80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, | 80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, |
