return r;
}
- EXPORT_SYMBOL(__netdev_printk);
+ EXPORT_SYMBOL_GPL(__netdev_printk);
+
+int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ ASSERT_RTNL();
+
+ if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings)
+ return -EOPNOTSUPP;
+
+ memset(cmd, 0, sizeof(struct ethtool_cmd));
+ cmd->cmd = ETHTOOL_GSET;
+ return dev->ethtool_ops->get_settings(dev, cmd);
+}
+EXPORT_SYMBOL(__ethtool_get_settings);
+
+#ifndef CONFIG_COMPAT_SLES_11_2
+/**
+ * llist_add_batch - add several linked entries in batch
+ * @new_first: first entry in batch to be added
+ * @new_last: last entry in batch to be added
+ * @head: the head for your lock-less list
+ *
+ * Return whether list is empty before adding.
+ */
+bool llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
+ struct llist_head *head)
+{
+ struct llist_node *entry, *old_entry;
+
+ entry = head->first;
+ for (;;) {
+ old_entry = entry;
+ new_last->next = entry;
+ entry = cmpxchg(&head->first, old_entry, new_first);
+ if (entry == old_entry)
+ break;
+ }
+
+ return old_entry == NULL;
+}
+EXPORT_SYMBOL_GPL(llist_add_batch);
+
+/**
+ * llist_del_first - delete the first entry of lock-less list
+ * @head: the head for your lock-less list
+ *
+ * If list is empty, return NULL, otherwise, return the first entry
+ * deleted, this is the newest added one.
+ *
+ * Only one llist_del_first user can be used simultaneously with
+ * multiple llist_add users without lock. Because otherwise
+ * llist_del_first, llist_add, llist_add (or llist_del_all, llist_add,
+ * llist_add) sequence in another user may change @head->first->next,
+ * but keep @head->first. If multiple consumers are needed, please
+ * use llist_del_all or use lock between consumers.
+ */
+struct llist_node *llist_del_first(struct llist_head *head)
+{
+ struct llist_node *entry, *old_entry, *next;
+
+ entry = head->first;
+ for (;;) {
+ if (entry == NULL)
+ return NULL;
+ old_entry = entry;
+ next = entry->next;
+ entry = cmpxchg(&head->first, old_entry, next);
+ if (entry == old_entry)
+ break;
+ }
+
+ return entry;
+}
+EXPORT_SYMBOL_GPL(llist_del_first);
+
+#endif /* CONFIG_COMPAT_SLES_11_2 */
#endif
#include <linux/firmware.h>
#include <linux/input.h>
+#include <linux/sched.h>
- #if defined(CONFIG_COMPAT_FIRMWARE_CLASS)
+ #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
#define release_firmware compat_release_firmware
#define request_firmware compat_request_firmware
#define request_firmware_nowait compat_request_firmware_nowait
#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
-#define netdev_hw_addr dev_mc_list
-
+ /*
+ * We cannot backport this guy as the IRQ data structure
+ * was modified in the kernel itself to support this. We
+ * treat the system as uni-processor in this case.
+ */
+ static inline int irq_set_affinity_hint(unsigned int irq,
+ const struct cpumask *m)
+ {
+ return -EINVAL;
+ }
+
static inline wait_queue_head_t *sk_sleep(struct sock *sk)
{
return sk->sk_sleep;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
#include <linux/security.h>
+ #include <linux/skbuff.h>
+ #include <net/ip.h>
+ #include <linux/idr.h>
+#include <net/dst.h>
+
+static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
+{
+ return dst->neighbour;
+}
+
+static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
+{
+ dst->neighbour = neigh;
+}
+
+static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
+{
+ return rcu_dereference_raw(dst->neighbour);
+}
+ /* Backports 56f8a75c */
+ static inline bool ip_is_fragment(const struct iphdr *iph)
+ {
+ return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
+ }
+
+ static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
+ unsigned int length, gfp_t gfp)
+ {
+ struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
+
+ if (NET_IP_ALIGN && skb)
+ skb_reserve(skb, NET_IP_ALIGN);
+ return skb;
+ }
+
+#ifndef NEED_MIN_DUMP_ALLOC_ARG
+#include <linux/netlink.h>
+/* remove last arg */
+#define netlink_dump_start(a, b, c, d, e, f) netlink_dump_start(a, b, c, d, e)
+#endif
+
+ /*
+ * Getting something that works in C and CPP for an arg that may or may
+ * not be defined is tricky. Here, if we have "#define CONFIG_BOOGER 1"
+ * we match on the placeholder define, insert the "0," for arg1 and generate
+ * the triplet (0, 1, 0). Then the last step cherry picks the 2nd arg (a one).
+ * When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when
+ * the last step cherry picks the 2nd arg, we get a zero.
+ */
+ #define __ARG_PLACEHOLDER_1 0,
+ #define config_enabled(cfg) _config_enabled(cfg)
+ #define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value)
+ #define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
+ #define ___config_enabled(__ignored, val, ...) val
#define genl_dump_check_consistent(cb, user_hdr, family)
+ /*
+ * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
+ * 0 otherwise.
+ *
+ */
+ #define IS_ENABLED(option) \
+ (config_enabled(option) || config_enabled(option##_MODULE))
+
#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
* skbs on transmit */