All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
@ 2013-07-31  8:39 ` Patrick Ziegler
  2013-07-31 14:38   ` Hauke Mehrtens
  2013-07-31  8:39 ` [RFC v2 2/8] backports: add eth_prepare_mac_addr_change() and eth_commit_mac_addr_change() Patrick Ziegler
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/compat/compat-2.6.25.c | 2 ++
 backport/compat/compat-2.6.28.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/backport/compat/compat-2.6.25.c b/backport/compat/compat-2.6.25.c
index b3597ea..37407a4 100644
--- a/backport/compat/compat-2.6.25.c
+++ b/backport/compat/compat-2.6.25.c
@@ -210,6 +210,7 @@ EXPORT_SYMBOL_GPL(sg_alloc_table);
  * to it. We implement a sloppy work around for backporting
  * this.
  */
+#ifdef CONFIG_PCI
 int pci_enable_device_mem(struct pci_dev *dev)
 {
 	int bars = pci_select_bars(dev, IORESOURCE_MEM);
@@ -217,6 +218,7 @@ int pci_enable_device_mem(struct pci_dev *dev)
 	return pci_enable_device_bars(dev, bars);
 }
 EXPORT_SYMBOL_GPL(pci_enable_device_mem);
+#endif
 
 /**
  * The following things are out of ./lib/vsprintf.c
diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c
index e47626b..9c21de8 100644
--- a/backport/compat/compat-2.6.28.c
+++ b/backport/compat/compat-2.6.28.c
@@ -238,6 +238,7 @@ EXPORT_SYMBOL_GPL(usb_anchor_empty);
 #endif /* CONFIG_USB */
 #endif
 
+#ifdef CONFIG_PCI
 void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
 {
 	/*
@@ -251,6 +252,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
 				     pci_resource_len(pdev, bar));
 }
 EXPORT_SYMBOL_GPL(pci_ioremap_bar);
+#endif
 
 static unsigned long round_jiffies_common(unsigned long j, int cpu,
 		bool force_up)
@@ -455,6 +457,7 @@ EXPORT_SYMBOL_GPL(n_tty_ioctl_helper);
  * generating PME# from both D3_hot and D3_cold, and the platform is unable to
  * enable wake-up power for it.
  */
+#ifdef CONFIG_PCI
 int pci_wake_from_d3(struct pci_dev *dev, bool enable)
 {
 	return pci_pme_capable(dev, PCI_D3cold) ?
@@ -462,4 +465,5 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable)
 			pci_enable_wake(dev, PCI_D3hot, enable);
 }
 EXPORT_SYMBOL_GPL(pci_wake_from_d3);
+#endif
 
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 2/8] backports: add eth_prepare_mac_addr_change() and eth_commit_mac_addr_change()
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
  2013-07-31  8:39 ` [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support Patrick Ziegler
@ 2013-07-31  8:39 ` Patrick Ziegler
  2013-07-31  8:39 ` [RFC v2 3/8] backports: define PM_EVENT_AUTO Patrick Ziegler
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

These functions are required by qmi_wwan device driver.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/etherdevice.h |  7 ++++++
 backport/backport-include/linux/if.h          |  4 ++++
 backport/compat/compat-3.9.c                  | 33 +++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 5c82fc4..b6617f0 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -114,6 +114,13 @@ static inline int is_unicast_ether_addr(const u8 *addr)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+#define eth_prepare_mac_addr_change LINUX_BACKPORT(eth_prepare_mac_addr_change)
+extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
+#define eth_commit_mac_addr_change LINUX_BACKPORT(eth_commit_mac_addr_change)
+extern void eth_commit_mac_addr_change(struct net_device *dev, void *p);
+#endif /* < 3.9 */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
 #define eth_mac_addr LINUX_BACKPORT(eth_mac_addr)
 extern int eth_mac_addr(struct net_device *dev, void *p);
diff --git a/backport/backport-include/linux/if.h b/backport/backport-include/linux/if.h
index 7926082..8f85b83 100644
--- a/backport/backport-include/linux/if.h
+++ b/backport/backport-include/linux/if.h
@@ -29,4 +29,8 @@
 #define IFF_TX_SKB_SHARING	0x10000
 #endif
 
+#ifndef IFF_LIVE_ADDR_CHANGE
+#define IFF_LIVE_ADDR_CHANGE 0x100000
+#endif
+
 #endif	/* _BACKPORT_LINUX_IF_H */
diff --git a/backport/compat/compat-3.9.c b/backport/compat/compat-3.9.c
index 03f3af8..1ce2dad 100644
--- a/backport/compat/compat-3.9.c
+++ b/backport/compat/compat-3.9.c
@@ -12,6 +12,9 @@
 #include <linux/scatterlist.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <linux/netdevice.h>
+#include <linux/if.h>
+#include <linux/if_ether.h>
 
 #ifdef __sg_page_iter_next
 
@@ -64,4 +67,34 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
 }
 EXPORT_SYMBOL_GPL(devm_ioremap_resource);
 
+/**
+ * eth_prepare_mac_addr_change - prepare for mac change
+ * @dev: network device
+ * @p: socket address
+ */
+int eth_prepare_mac_addr_change(struct net_device *dev, void *p)
+{
+	struct sockaddr *addr = p;
+
+	if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
+		return -EBUSY;
+	if (!is_valid_ether_addr(addr->sa_data))
+		return -EADDRNOTAVAIL;
+	return 0;
+}
+EXPORT_SYMBOL(eth_prepare_mac_addr_change);
+
+/**
+ * eth_commit_mac_addr_change - commit mac change
+ * @dev: network device
+ * @p: socket address
+ */
+void eth_commit_mac_addr_change(struct net_device *dev, void *p)
+{
+	struct sockaddr *addr = p;
+
+	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+}
+EXPORT_SYMBOL(eth_commit_mac_addr_change);
+
 #endif /* __sg_page_iter_next */
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 3/8] backports: define PM_EVENT_AUTO
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
  2013-07-31  8:39 ` [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support Patrick Ziegler
  2013-07-31  8:39 ` [RFC v2 2/8] backports: add eth_prepare_mac_addr_change() and eth_commit_mac_addr_change() Patrick Ziegler
@ 2013-07-31  8:39 ` Patrick Ziegler
  2013-07-31  8:39 ` [RFC v2 4/8] backports: add usb_translate_errors() Patrick Ziegler
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

This macro is missing for < 2.6.25

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/pm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/linux/pm.h b/backport/backport-include/linux/pm.h
index 70f3a21..d217c81 100644
--- a/backport/backport-include/linux/pm.h
+++ b/backport/backport-include/linux/pm.h
@@ -2,6 +2,10 @@
 #define __BACKPORT_PM_H
 #include_next <linux/pm.h>
 
+#ifndef PM_EVENT_AUTO
+#define PM_EVENT_AUTO		0x0400
+#endif
+
 #ifndef PM_EVENT_SLEEP
 #define PM_EVENT_SLEEP  (PM_EVENT_SUSPEND)
 #endif
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 4/8] backports: add usb_translate_errors()
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
                   ` (2 preceding siblings ...)
  2013-07-31  8:39 ` [RFC v2 3/8] backports: define PM_EVENT_AUTO Patrick Ziegler
@ 2013-07-31  8:39 ` Patrick Ziegler
  2013-07-31  8:39 ` [RFC v2 5/8] backports: add usb_endpoint_maxp() Patrick Ziegler
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

This inline function is missing for version < 2.6.39 but required by em28xx
and cdc-wdm device driver.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/usb.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 368da6c..49a5762 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -145,4 +145,21 @@ extern void usb_unpoison_urb(struct urb *urb);
 extern int usb_anchor_empty(struct usb_anchor *anchor);
 #endif /* 2.6.23-2.6.27 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
+#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
+static inline int usb_translate_errors(int error_code)
+{
+	switch (error_code) {
+	case 0:
+	case -ENOMEM:
+	case -ENODEV:
+	case -EOPNOTSUPP:
+		return error_code;
+	default:
+		return -EIO;
+	}
+}
+#endif /* CONFIG_USB */
+#endif /* < 2.6.39 */
+
 #endif /* __BACKPORT_USB_H */
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 5/8] backports: add usb_endpoint_maxp()
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
                   ` (3 preceding siblings ...)
  2013-07-31  8:39 ` [RFC v2 4/8] backports: add usb_translate_errors() Patrick Ziegler
@ 2013-07-31  8:39 ` Patrick Ziegler
  2013-07-31  8:40 ` [RFC v2 6/8] backports: include headers directly if math64 header is missing Patrick Ziegler
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

This function is missing for kernel version < 3.2 but required by uvc_video
and cdc-wdm device drivers.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/usb/ch9.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 backport/backport-include/linux/usb/ch9.h

diff --git a/backport/backport-include/linux/usb/ch9.h b/backport/backport-include/linux/usb/ch9.h
new file mode 100644
index 0000000..252a6f1
--- /dev/null
+++ b/backport/backport-include/linux/usb/ch9.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT__LINUX_USB_CH9_H
+#define __BACKPORT__LINUX_USB_CH9_H
+
+#include_next <linux/usb/ch9.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+#include <linux/types.h>    /* __u8 etc */
+#include <asm/byteorder.h>  /* le16_to_cpu */
+
+/**
+ * usb_endpoint_maxp - get endpoint's max packet size
+ * @epd: endpoint to be checked
+ *
+ * Returns @epd's max packet
+ */
+static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
+{
+	return __le16_to_cpu(epd->wMaxPacketSize);
+}
+#endif /* < 3.2 */
+
+#endif /* __BACKPORT__LINUX_USB_CH9_H */
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 6/8] backports: include headers directly if math64 header is missing
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
                   ` (4 preceding siblings ...)
  2013-07-31  8:39 ` [RFC v2 5/8] backports: add usb_endpoint_maxp() Patrick Ziegler
@ 2013-07-31  8:40 ` Patrick Ziegler
  2013-07-31  8:40 ` [RFC v2 7/8] backports: define phys_addr_t for ARM on kernel version < 2.6.25 Patrick Ziegler
  2013-07-31  8:40 ` [RFC v2 8/8] backports: add wwan device drivers Patrick Ziegler
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:40 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

If math64 header is not available, include div64.h directly. It is required for
do_div() that is used inside the backport version of math64.h.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/math64.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backport/backport-include/linux/math64.h b/backport/backport-include/linux/math64.h
index 7f3a81b..775c2d3 100644
--- a/backport/backport-include/linux/math64.h
+++ b/backport/backport-include/linux/math64.h
@@ -5,6 +5,9 @@
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25))
 #include_next <linux/math64.h>
+#else
+#include <linux/types.h>
+#include <asm/div64.h>
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 7/8] backports: define phys_addr_t for ARM on kernel version < 2.6.25
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
                   ` (5 preceding siblings ...)
  2013-07-31  8:40 ` [RFC v2 6/8] backports: include headers directly if math64 header is missing Patrick Ziegler
@ 2013-07-31  8:40 ` Patrick Ziegler
  2013-07-31  8:40 ` [RFC v2 8/8] backports: add wwan device drivers Patrick Ziegler
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:40 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

phys_addr_t is not defined on ARM systems if kernel version < 2.6.25.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/backport-include/linux/types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backport/backport-include/linux/types.h b/backport/backport-include/linux/types.h
index 504a615..0aadc80 100644
--- a/backport/backport-include/linux/types.h
+++ b/backport/backport-include/linux/types.h
@@ -4,7 +4,7 @@
 #include <linux/version.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
-#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
+#if defined(CONFIG_X86) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
 
 #if defined(CONFIG_64BIT) || defined(CONFIG_X86_PAE) || defined(CONFIG_PHYS_64BIT)
 typedef u64 phys_addr_t;
@@ -12,7 +12,7 @@ typedef u64 phys_addr_t;
 typedef u32 phys_addr_t;
 #endif
 
-#endif /* x86 */
+#endif /* x86 || ARM */
 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) /* < 2.6.25 */
 
 #if defined(CONFIG_X86) || defined(CONFIG_X86_64) || defined(CONFIG_PPC)
-- 
1.8.1.2



-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC v2 8/8] backports: add wwan device drivers
       [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
                   ` (6 preceding siblings ...)
  2013-07-31  8:40 ` [RFC v2 7/8] backports: define phys_addr_t for ARM on kernel version < 2.6.25 Patrick Ziegler
@ 2013-07-31  8:40 ` Patrick Ziegler
  7 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-07-31  8:40 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

Add cdc_mbim, cdc_ncm, sierra_net, qmi_wwan device drivers.

Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
 backport/Kconfig                                           |  2 ++
 backport/Makefile.kernel                                   |  3 +++
 copy-list                                                  | 14 ++++++++++++++
 .../network/0001-netdev_ops/qmi_wwan.patch                 | 11 +++++++++++
 .../network/0001-netdev_ops/sierra_net.patch               | 11 +++++++++++
 .../62-usb_driver_lpm/drivers_net_usb_cdc_mbim.patch       | 12 ++++++++++++
 .../62-usb_driver_lpm/drivers_net_usb_cdc_ncm.patch        | 12 ++++++++++++
 .../62-usb_driver_lpm/drivers_net_usb_qmi_wwan.patch       | 12 ++++++++++++
 .../62-usb_driver_lpm/drivers_net_usb_sierra_net.patch     | 12 ++++++++++++
 .../62-usb_driver_lpm/drivers_usb_class_cdc-wdm.patch      | 12 ++++++++++++
 10 files changed, 101 insertions(+)
 create mode 100644 patches/collateral-evolutions/network/0001-netdev_ops/qmi_wwan.patch
 create mode 100644 patches/collateral-evolutions/network/0001-netdev_ops/sierra_net.patch
 create mode 100644 patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_mbim.patch
 create mode 100644 patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_ncm.patch
 create mode 100644 patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_qmi_wwan.patch
 create mode 100644 patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_sierra_net.patch
 create mode 100644 patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_usb_class_cdc-wdm.patch

diff --git a/backport/Kconfig b/backport/Kconfig
index 845b233..64a5f8b 100644
--- a/backport/Kconfig
+++ b/backport/Kconfig
@@ -48,3 +48,5 @@ source drivers/platform/x86/Kconfig
 source net/ieee802154/Kconfig
 source net/mac802154/Kconfig
 source drivers/net/ieee802154/Kconfig
+
+source drivers/usb/class/Kconfig
diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index ac29dea..ca75ce1 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -40,3 +40,6 @@ obj-$(CPTCFG_INTEL_IPS) += drivers/platform/x86/
 obj-$(CPTCFG_IEEE802154) += net/ieee802154/
 obj-$(CPTCFG_MAC802154) += net/mac802154/
 obj-$(CPTCFG_IEEE802154) += drivers/net/ieee802154/
+
+obj-$(CPTCFG_USB_WDM) += drivers/usb/class/
+obj-$(CPTCFG_USB_USBNET) += drivers/net/usb/
diff --git a/copy-list b/copy-list
index aaf5ae9..7da4bb7 100644
--- a/copy-list
+++ b/copy-list
@@ -100,6 +100,20 @@ drivers/net/ethernet/broadcom/Makefile
 drivers/net/ethernet/broadcom/b44.c
 drivers/net/ethernet/broadcom/b44.h
 
+# wwan drivers
+include/uapi/linux/usb/cdc.h
+include/uapi/linux/usb/cdc-wdm.h
+include/linux/usb/cdc_ncm.h
+include/linux/usb/cdc-wdm.h
+
+drivers/usb/class/Makefile
+drivers/usb/class/Kconfig
+drivers/usb/class/cdc-wdm.c
+drivers/net/usb/cdc_mbim.c
+drivers/net/usb/cdc_ncm.c
+drivers/net/usb/sierra_net.c
+drivers/net/usb/qmi_wwan.c
+
 # DRM
 include/drm/
 include/uapi/drm/
diff --git a/patches/collateral-evolutions/network/0001-netdev_ops/qmi_wwan.patch b/patches/collateral-evolutions/network/0001-netdev_ops/qmi_wwan.patch
new file mode 100644
index 0000000..6281c8d
--- /dev/null
+++ b/patches/collateral-evolutions/network/0001-netdev_ops/qmi_wwan.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -331,7 +331,7 @@
+ 		dev->net->dev_addr[0] |= 0x02;	/* set local assignment bit */
+ 		dev->net->dev_addr[0] &= 0xbf;	/* clear "IP" bit */
+ 	}
+-	dev->net->netdev_ops = &qmi_wwan_netdev_ops;
++	netdev_attach_ops(dev->net, &qmi_wwan_netdev_ops);
+ err:
+ 	return status;
+ }
diff --git a/patches/collateral-evolutions/network/0001-netdev_ops/sierra_net.patch b/patches/collateral-evolutions/network/0001-netdev_ops/sierra_net.patch
new file mode 100644
index 0000000..e7ff14b
--- /dev/null
+++ b/patches/collateral-evolutions/network/0001-netdev_ops/sierra_net.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -695,7 +695,7 @@
+ 
+ 	priv->usbnet = dev;
+ 	priv->ifnum = ifacenum;
+-	dev->net->netdev_ops = &sierra_net_device_ops;
++	netdev_attach_ops(dev->net, &sierra_net_device_ops);
+ 
+ 	/* change MAC addr to include, ifacenum, and to be unique */
+ 	dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_mbim.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_mbim.patch
new file mode 100644
index 0000000..0feffc8
--- /dev/null
+++ b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_mbim.patch
@@ -0,0 +1,12 @@
+--- a/drivers/net/usb/cdc_mbim.c
++++ b/drivers/net/usb/cdc_mbim.c
+@@ -417,7 +417,9 @@
+ 	.resume = cdc_mbim_resume,
+ 	.reset_resume =	cdc_mbim_resume,
+ 	.supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ 	.disable_hub_initiated_lpm = 1,
++#endif
+ };
+ module_usb_driver(cdc_mbim_driver);
+ 
diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_ncm.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_ncm.patch
new file mode 100644
index 0000000..c6419fe
--- /dev/null
+++ b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_cdc_ncm.patch
@@ -0,0 +1,12 @@
+--- a/drivers/net/usb/cdc_ncm.c
++++ b/drivers/net/usb/cdc_ncm.c
+@@ -1271,7 +1271,9 @@
+ 	.resume = usbnet_resume,
+ 	.reset_resume =	usbnet_resume,
+ 	.supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ 	.disable_hub_initiated_lpm = 1,
++#endif
+ };
+ 
+ module_usb_driver(cdc_ncm_driver);
diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_qmi_wwan.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_qmi_wwan.patch
new file mode 100644
index 0000000..8f3355d
--- /dev/null
+++ b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_qmi_wwan.patch
@@ -0,0 +1,12 @@
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -672,7 +672,9 @@
+ 	.resume		      =	qmi_wwan_resume,
+ 	.reset_resume         = qmi_wwan_resume,
+ 	.supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ 	.disable_hub_initiated_lpm = 1,
++#endif
+ };
+ 
+ module_usb_driver(qmi_wwan_driver);
diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_sierra_net.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_sierra_net.patch
new file mode 100644
index 0000000..553f2ca
--- /dev/null
+++ b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_net_usb_sierra_net.patch
@@ -0,0 +1,12 @@
+--- a/drivers/net/usb/sierra_net.c
++++ b/drivers/net/usb/sierra_net.c
+@@ -959,7 +959,9 @@
+ 	.suspend = usbnet_suspend,
+ 	.resume = usbnet_resume,
+ 	.no_dynamic_id = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ 	.disable_hub_initiated_lpm = 1,
++#endif
+ };
+ 
+ module_usb_driver(sierra_net_driver);
diff --git a/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_usb_class_cdc-wdm.patch b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_usb_class_cdc-wdm.patch
new file mode 100644
index 0000000..c3af4a1
--- /dev/null
+++ b/patches/collateral-evolutions/network/62-usb_driver_lpm/drivers_usb_class_cdc-wdm.patch
@@ -0,0 +1,12 @@
+--- a/drivers/usb/class/cdc-wdm.c
++++ b/drivers/usb/class/cdc-wdm.c
+@@ -1060,7 +1060,9 @@
+ 	.post_reset =	wdm_post_reset,
+ 	.id_table =	wdm_ids,
+ 	.supports_autosuspend = 1,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+ 	.disable_hub_initiated_lpm = 1,
++#endif
+ };
+ 
+ module_usb_driver(wdm_driver);
-- 
1.8.1.2


-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support
  2013-07-31  8:39 ` [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support Patrick Ziegler
@ 2013-07-31 14:38   ` Hauke Mehrtens
  2013-08-01 12:55     ` Patrick Ziegler
  0 siblings, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2013-07-31 14:38 UTC (permalink / raw)
  To: Patrick Ziegler; +Cc: Luis R. Rodriguez, backports

Nice work,

what kernel version(s) without PCI support have you tested this against?

There are also PCI(e) functions in backport/compat/compat-3.7.c and
backport/compat/compat-2.6.27.c

On 07/31/2013 10:39 AM, Patrick Ziegler wrote:
> Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
> ---
>  backport/compat/compat-2.6.25.c | 2 ++
>  backport/compat/compat-2.6.28.c | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/backport/compat/compat-2.6.25.c b/backport/compat/compat-2.6.25.c
> index b3597ea..37407a4 100644
> --- a/backport/compat/compat-2.6.25.c
> +++ b/backport/compat/compat-2.6.25.c
> @@ -210,6 +210,7 @@ EXPORT_SYMBOL_GPL(sg_alloc_table);
>   * to it. We implement a sloppy work around for backporting
>   * this.
>   */
> +#ifdef CONFIG_PCI
>  int pci_enable_device_mem(struct pci_dev *dev)
>  {
>  	int bars = pci_select_bars(dev, IORESOURCE_MEM);
> @@ -217,6 +218,7 @@ int pci_enable_device_mem(struct pci_dev *dev)
>  	return pci_enable_device_bars(dev, bars);
>  }
>  EXPORT_SYMBOL_GPL(pci_enable_device_mem);
> +#endif
>  
>  /**
>   * The following things are out of ./lib/vsprintf.c
> diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c
> index e47626b..9c21de8 100644
> --- a/backport/compat/compat-2.6.28.c
> +++ b/backport/compat/compat-2.6.28.c
> @@ -238,6 +238,7 @@ EXPORT_SYMBOL_GPL(usb_anchor_empty);
>  #endif /* CONFIG_USB */
>  #endif
>  
> +#ifdef CONFIG_PCI
>  void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
>  {
>  	/*
> @@ -251,6 +252,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
>  				     pci_resource_len(pdev, bar));
>  }
>  EXPORT_SYMBOL_GPL(pci_ioremap_bar);
> +#endif
>  
>  static unsigned long round_jiffies_common(unsigned long j, int cpu,
>  		bool force_up)
> @@ -455,6 +457,7 @@ EXPORT_SYMBOL_GPL(n_tty_ioctl_helper);
>   * generating PME# from both D3_hot and D3_cold, and the platform is unable to
>   * enable wake-up power for it.
>   */
> +#ifdef CONFIG_PCI
>  int pci_wake_from_d3(struct pci_dev *dev, bool enable)
>  {
>  	return pci_pme_capable(dev, PCI_D3cold) ?
> @@ -462,4 +465,5 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable)
>  			pci_enable_wake(dev, PCI_D3hot, enable);
>  }
>  EXPORT_SYMBOL_GPL(pci_wake_from_d3);
> +#endif

The mainline Linux kernel uses a empty pci_wake_from_d3() function if
CONFIG_PCI is not set in include/linux/pci.h

Hauke

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support
  2013-07-31 14:38   ` Hauke Mehrtens
@ 2013-08-01 12:55     ` Patrick Ziegler
  0 siblings, 0 replies; 10+ messages in thread
From: Patrick Ziegler @ 2013-08-01 12:55 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: Luis R. Rodriguez, backports

On 31.07.2013 16:38, Hauke Mehrtens wrote:
> Nice work,
> 
> what kernel version(s) without PCI support have you tested this against?

I'm using this with kernel version 2.6.24.7

> 
> There are also PCI(e) functions in backport/compat/compat-3.7.c and
> backport/compat/compat-2.6.27.c

That's true but they do not break the build. The functions which are called
inside these PCI(e) functions have already empty stub functions if PCI
support is not enabled.

> 
> On 07/31/2013 10:39 AM, Patrick Ziegler wrote:
>> Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
>> ---
>>  backport/compat/compat-2.6.25.c | 2 ++
>>  backport/compat/compat-2.6.28.c | 4 ++++
>>  2 files changed, 6 insertions(+)
>>
>> diff --git a/backport/compat/compat-2.6.25.c b/backport/compat/compat-2.6.25.c
>> index b3597ea..37407a4 100644
>> --- a/backport/compat/compat-2.6.25.c
>> +++ b/backport/compat/compat-2.6.25.c
>> @@ -210,6 +210,7 @@ EXPORT_SYMBOL_GPL(sg_alloc_table);
>>   * to it. We implement a sloppy work around for backporting
>>   * this.
>>   */
>> +#ifdef CONFIG_PCI
>>  int pci_enable_device_mem(struct pci_dev *dev)
>>  {
>>  	int bars = pci_select_bars(dev, IORESOURCE_MEM);
>> @@ -217,6 +218,7 @@ int pci_enable_device_mem(struct pci_dev *dev)
>>  	return pci_enable_device_bars(dev, bars);
>>  }
>>  EXPORT_SYMBOL_GPL(pci_enable_device_mem);
>> +#endif
>>  
>>  /**
>>   * The following things are out of ./lib/vsprintf.c
>> diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c
>> index e47626b..9c21de8 100644
>> --- a/backport/compat/compat-2.6.28.c
>> +++ b/backport/compat/compat-2.6.28.c
>> @@ -238,6 +238,7 @@ EXPORT_SYMBOL_GPL(usb_anchor_empty);
>>  #endif /* CONFIG_USB */
>>  #endif
>>  
>> +#ifdef CONFIG_PCI
>>  void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
>>  {
>>  	/*
>> @@ -251,6 +252,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
>>  				     pci_resource_len(pdev, bar));
>>  }
>>  EXPORT_SYMBOL_GPL(pci_ioremap_bar);
>> +#endif
>>  
>>  static unsigned long round_jiffies_common(unsigned long j, int cpu,
>>  		bool force_up)
>> @@ -455,6 +457,7 @@ EXPORT_SYMBOL_GPL(n_tty_ioctl_helper);
>>   * generating PME# from both D3_hot and D3_cold, and the platform is unable to
>>   * enable wake-up power for it.
>>   */
>> +#ifdef CONFIG_PCI
>>  int pci_wake_from_d3(struct pci_dev *dev, bool enable)
>>  {
>>  	return pci_pme_capable(dev, PCI_D3cold) ?
>> @@ -462,4 +465,5 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable)
>>  			pci_enable_wake(dev, PCI_D3hot, enable);
>>  }
>>  EXPORT_SYMBOL_GPL(pci_wake_from_d3);
>> +#endif
> 
> The mainline Linux kernel uses a empty pci_wake_from_d3() function if
> CONFIG_PCI is not set in include/linux/pci.h
> 

Indeed, I've just realized that an include of pci.h in compat-2.6.28.c is 
enough to make it work with kernel version 2.6.24. I will resend the patch with this change.

Patrick

-- 
Dipl.-Inf. (FH) Patrick Ziegler

University Of Applied Sciences
Kaiserslautern

Amerikastrasse 1
D-66482 Zweibruecken
Germany

Phone:  +49 631 3724 5526
Mail:   patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C

http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-08-01 12:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1375259597.git.patrick.ziegler@fh-kl.de>
2013-07-31  8:39 ` [RFC v2 1/8] backports: disable PCI functions for kernels without PCI support Patrick Ziegler
2013-07-31 14:38   ` Hauke Mehrtens
2013-08-01 12:55     ` Patrick Ziegler
2013-07-31  8:39 ` [RFC v2 2/8] backports: add eth_prepare_mac_addr_change() and eth_commit_mac_addr_change() Patrick Ziegler
2013-07-31  8:39 ` [RFC v2 3/8] backports: define PM_EVENT_AUTO Patrick Ziegler
2013-07-31  8:39 ` [RFC v2 4/8] backports: add usb_translate_errors() Patrick Ziegler
2013-07-31  8:39 ` [RFC v2 5/8] backports: add usb_endpoint_maxp() Patrick Ziegler
2013-07-31  8:40 ` [RFC v2 6/8] backports: include headers directly if math64 header is missing Patrick Ziegler
2013-07-31  8:40 ` [RFC v2 7/8] backports: define phys_addr_t for ARM on kernel version < 2.6.25 Patrick Ziegler
2013-07-31  8:40 ` [RFC v2 8/8] backports: add wwan device drivers Patrick Ziegler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.