[OpenWrt-Devel] [PATCH] ltq-adsl-mei: improve memory allocation

2014-02-08 Thread Matti Laakso
The ltq-adsl-mei driver allocates memory for the ADSL firmware in a
rather stupid way, leading to several 128k allocations, which fail when
many services are enabled. This patch tries to allocate 64 kiB chunks,
and only falls back to larger allocations if the returned pointers are
not correctly aligned. Fixes out-of-memory errors on Danube boards with
32 MiB RAM.

Signed-off-by: Matti Laakso 
---

Index: trunk/package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c
===
--- trunk/package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c   (revision 39457)
+++ trunk/package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c   (working copy)
@@ -1513,13 +1513,31 @@
 allocate_size = size;
 else
 allocate_size = SDRAM_SEGMENT_SIZE;
-   org_mem_ptr = kmalloc (allocate_size + 1024, GFP_KERNEL);
+
+   org_mem_ptr = kmalloc (allocate_size, GFP_KERNEL);
if (org_mem_ptr == NULL) {
 IFX_MEI_EMSG ("%d: kmalloc %d bytes memory fail!\n", 
idx, allocate_size);
err = -ENOMEM;
goto allocate_error;
}
-mem_ptr = (unsigned long) (org_mem_ptr + 1023) & ~(1024 -1);
+   
+   if (((unsigned long)org_mem_ptr) & (1023)) {
+   /* Pointer not 1k aligned, so free it and allocate a 
larger chunk
+* for further alignment.
+*/
+   kfree(org_mem_ptr);
+   org_mem_ptr = kmalloc (allocate_size + 1024, 
GFP_KERNEL);
+   if (org_mem_ptr == NULL) {
+   IFX_MEI_EMSG ("%d: kmalloc %d bytes memory 
fail!\n",
+ idx, allocate_size + 1024);
+   err = -ENOMEM;
+   goto allocate_error;
+   }
+   mem_ptr = (unsigned long) (org_mem_ptr + 1023) & ~(1024 
-1);
+   } else {
+   mem_ptr = (unsigned long) org_mem_ptr;
+   }
+
 adsl_mem_info[idx].address = (char *) mem_ptr;
 adsl_mem_info[idx].org_address = org_mem_ptr;
 adsl_mem_info[idx].size = allocate_size;
@@ -1591,6 +1609,7 @@
 
size_t nRead = 0, nCopy = 0;
char *mem_ptr;
+   char *org_mem_ptr = NULL;
ssize_t retval = -ENOMEM;
int idx = 0;
 
@@ -1634,17 +1653,33 @@
DSL_DEV_PRIVATE(pDev)->img_hdr =
(ARC_IMG_HDR *) adsl_mem_info[0].address;
 
-   adsl_mem_info[XDATA_REGISTER].org_address = kmalloc 
(SDRAM_SEGMENT_SIZE + 1024, GFP_KERNEL);
-   adsl_mem_info[XDATA_REGISTER].address =
-   (char *) ((unsigned long) 
(adsl_mem_info[XDATA_REGISTER].org_address + 1023) & 0xFC00);
-
-   adsl_mem_info[XDATA_REGISTER].size = SDRAM_SEGMENT_SIZE;
-
-   if (adsl_mem_info[XDATA_REGISTER].address == NULL) {
+   org_mem_ptr = kmalloc (SDRAM_SEGMENT_SIZE, GFP_KERNEL);
+   if (org_mem_ptr == NULL) {
IFX_MEI_EMSG ("kmalloc memory fail!\n");
retval = -ENOMEM;
goto error;
}
+   
+   if (((unsigned long)org_mem_ptr) & (1023)) {
+   /* Pointer not 1k aligned, so free it and allocate a 
larger chunk
+* for further alignment.
+*/
+   kfree(org_mem_ptr);
+   org_mem_ptr = kmalloc (SDRAM_SEGMENT_SIZE + 1024, 
GFP_KERNEL);
+   if (org_mem_ptr == NULL) {
+   IFX_MEI_EMSG ("kmalloc memory fail!\n");
+   retval = -ENOMEM;
+   goto error;
+   }
+   adsl_mem_info[XDATA_REGISTER].address =
+   (char *) ((unsigned long) (org_mem_ptr + 1023) 
& ~(1024 -1));
+   } else {
+   adsl_mem_info[XDATA_REGISTER].address = org_mem_ptr;
+   }
+   
+   adsl_mem_info[XDATA_REGISTER].org_address = org_mem_ptr;
+   adsl_mem_info[XDATA_REGISTER].size = SDRAM_SEGMENT_SIZE;
+
adsl_mem_info[XDATA_REGISTER].type = FREE_RELOAD;
IFX_MEI_DMSG("-> IFX_MEI_BarUpdate()\n");
IFX_MEI_BarUpdate (pDev, (DSL_DEV_PRIVATE(pDev)->nBar));
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] new kernel module: usb-net-kalmia

2014-02-08 Thread Matti Laakso
This patch adds a new kernel module for Samsung USB LTE modems.

Signed-off-by: Matti Laakso 
---

Index: trunk/package/kernel/linux/modules/usb.mk
===
--- trunk/package/kernel/linux/modules/usb.mk   (revision 39530)
+++ trunk/package/kernel/linux/modules/usb.mk   (working copy)
@@ -969,6 +969,21 @@
 $(eval $(call KernelPackage,usb-net-ipheth))
 
 
+define KernelPackage/usb-net-kalmia
+  TITLE:=Samsung Kalmia based LTE USB modem
+  KCONFIG:=CONFIG_USB_NET_KALMIA
+  FILES:=$(LINUX_DIR)/drivers/net/usb/kalmia.ko
+  AUTOLOAD:=$(call AutoProbe,kalmia)
+  $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-kalmia/description
+ Kernel support for Samsung Kalmia based LTE USB modem
+endef
+
+$(eval $(call KernelPackage,usb-net-kalmia))
+
+
 define KernelPackage/usb-hid
   TITLE:=Support for USB Human Input Devices
   KCONFIG:=CONFIG_HID_SUPPORT=y CONFIG_USB_HID CONFIG_USB_HIDDEV=y
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] Enable kmod-hid-generic driver when selecting usb-hid

2014-02-08 Thread Álvaro Fernández Rojas
kmod-hid-generic needs to be selected when enabling usb-hid in order to get 
generic devices working.

This fixes keyboards support in linux 3.3+ kernels.
https://dev.openwrt.org/ticket/12631
https://dev.openwrt.org/ticket/12686

Signed-off-by: Álvaro Fernández Rojas 
---
v2: Fix recursive dependency by adding kmod-hid-generic only when usb-hid is 
selected.

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index 825b29e..98928e5 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -975,7 +975,7 @@ define KernelPackage/usb-hid
   FILES:=$(LINUX_DIR)/drivers/$(USBHID_DIR)/usbhid.ko
   AUTOLOAD:=$(call AutoProbe,usbhid)
   $(call AddDepends/usb)
-  $(call AddDepends/hid)
+  $(call AddDepends/hid,+kmod-hid-generic)
   $(call AddDepends/input,+kmod-input-evdev)
 endef
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-02-08 Thread Matti Laakso
> On Fri, Jan 24, 2014 at 9:57 AM, Matti Laakso  > wrote:
>
> >/ To get it to build just add a declaration to
> />/
> />/ trunk/package/kernel/linux/modules/usb.mk
> />/
> />/ like this:
> />/
> />/ define KernelPackage/usb-net-kalmia
> />/   TITLE:=Samsung Kalmia based LTE USB modem
> />/   KCONFIG:=CONFIG_USB_NET_KALMIA
> />/   FILES:=$(LINUX_DIR)/drivers/net/usb/kalmia.ko
> />/   AUTOLOAD:=$(call AutoProbe,kalmia)
> />/   $(call AddDepends/usb-net)
> />/ endef
> />/
> />/ define KernelPackage/usb-net-kalmia/description
> />/  Kernel support for Samsung Kalmia based LTE USB modem
> />/ endef
> />/
> />/ $(eval $(call KernelPackage,usb-net-kalmia))
> />/
> /
> I must say I'm impressed how easy that was!
>
> Can we please add this package to the code base? Can you do that or should
> I send in a patch for that?

I just sent one.

> Some questions about that:
> - Are you aware of other UMTS/LTE modems which use the WWAN subsystem and
> require a chat script for initialization as well?

Most LTE modems and many 3G modems use the WWAN subsystem, but instead
of AT-commands require the use of some binary protocol, e.g. qmi.
There's some work done regarding that, but it's unfinished:
http://nbd.name/gitweb.cgi?p=uqmi.git;a=summary

> This leads to several questions:
> - I'd like to distribute my built image with the "kalmia" kernel package
> and the replaced chat script. Are you fine with that? Is there anything I
> have to take care of?

Go ahead, people with that modem are certainly grateful!

> - What's the best way to add device-specific chat scripts and support them
> in the webinterface?
> An easy workaround would be to introduce new service types e.g., the user
> would have to specify a custom service type "samsung-gt-b3740". Then, the
> 3g.sh script could be modified to deal with this type and use the
> device-specific chat script. The best solution would be if the webinterface
> detects the modem type and automatically takes care of the necessary steps
> (install kalmia kernel module, set up both interfaces, use device-specific
> chat script). Otherwise, the user always depends on a tutorial.

I suppose the best way is to add a new protocol, something like "WWAN
with AT-commands" and integrate it to netifd, which would then handle
reading the configuration and sending the AT-commands without extra scripts.

Matti Laakso
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] kernel/generic-3.12: don't remove Intel-specific XHCI quirks

2014-02-08 Thread Hauke Mehrtens
On 02/07/2014 10:56 AM, Daniel wrote:
> The symbols are required to build the xhci-pci module.
> Probably this applies to kernel 3.13 as well, however, I only had the
> chance to test on 3.12.
> ---
>  .../generic/patches-3.12/811-pci_disable_usb_common_quirks.patch | 9 
> -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 

Thank you for the patch, a modified version was committed in r39534.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH V2] [packages] libqmi: update to 1.8.0

2014-02-08 Thread Hauke Mehrtens
On 02/07/2014 09:28 AM, Dirk Neukirchen wrote:
> On 06.02.2014 23:42, Hauke Mehrtens wrote:
>> On 12/12/2013 07:05 PM, Tim Harvey wrote:
>>> Signed-off-by: Tim Harvey 
>>> ---
> 
>> There is no libqmi-1.8.0.tar.xz on the gnome ftp server.
>>
>> This url returns 404:
>> http://ftp.gnome.org/pub/GNOME/sources/libqmi/1.8/libqmi-1.8.0.tar.xz
>>
>> Hauke
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
> 
> 
> v1: update to libqmi 1.8.0
> v2: fix packet source URL
> 
> libqmi is now hosted on Freedesktop
> 
> Signed-off-by: Tim Harvey 
> Signed-off-by: Dirk Neukirchen 
> ---
>  libs/libqmi/Makefile | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
Thank you for the patch, it was applied in r39536.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] new kernel module: usb-net-kalmia

2014-02-08 Thread Hauke Mehrtens
On 02/08/2014 02:16 PM, Matti Laakso wrote:
> This patch adds a new kernel module for Samsung USB LTE modems.
> 
> Signed-off-by: Matti Laakso 
> ---
> 
Thank you for the patch, it was applied in r39535.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] umurmur: version 0.2.13

2014-02-08 Thread Hauke Mehrtens
On 11/14/2013 06:22 AM, Daniel Golle wrote:
> ---
>  net/umurmur/Makefile   |   4 +-
>  net/umurmur/patches/100-polarssl_backport.patch|  74 ---
>  .../patches/110-reduced_polarssl_support.patch | 141 
> -
>  3 files changed, 2 insertions(+), 217 deletions(-)
>  delete mode 100644 net/umurmur/patches/100-polarssl_backport.patch
>  delete mode 100644 net/umurmur/patches/110-reduced_polarssl_support.patch
> 

Thank you for the patch, it was applied in r39537.

I changed the version to 0.2.14.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [packages] perl-www: Bump to 5.837

2014-02-08 Thread Hauke Mehrtens
On 11/23/2013 06:14 PM, Robert Högberg wrote:
> Package perl-www-mechanize requires perl-www version 5.829 or later to
> work, so bump perl-www to 5.837.
> 
> If another 12.09 release is coming I suggest merging this to AA also
> since perl-www-mechanize is broken there also.
> 
> Signed-off-by: Robert Högberg 
> ---
Thank you for the patch, it was applied in r39539.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [packages] sound/mpd: update to mpd 0.16.8

2014-02-08 Thread Hauke Mehrtens
On 11/07/2013 04:53 PM, Dirk Neukirchen wrote:
> updating to latest mpd requres more work on dependencies
> (libmms,libaudiofile,libstdcpp)
> 
> - mpd isn't hosted on sourceforge anymore
> 
> - fix: https://dev.openwrt.org/ticket/14422
> Issue 1: could not replicate
> Issue 2: update to last mpd 0.16 series fixes compile, 
> its linked to ffmpeg version
> 
> Signed-off-by: Dirk Neukirchen 
> ---
>  sound/mpd/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
Thank you for the patch, it was applied in r39540.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [packages] mosh

2014-02-08 Thread Hauke Mehrtens
On 11/03/2013 06:53 AM, Kyle Anderson wrote:
> This adds mosh-full, mosh-server, and mosh-client packages.
> 
> The Entware team has already done the hard work:
> http://code.google.com/p/wl500g-repo/source/browse/feeds/rtndev/mosh/Makefile?r=1220
> 
> All I added was a patch to disabled the check for UTF-8, which is not 
> available on our platform. (It works fine with the check disabled)
> https://github.com/keithw/mosh/issues/464
> 
> This was originally requested here:
> https://dev.openwrt.org/ticket/12509
> 
> This actually does work in conjunction with the openssh-client/server.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662939
> 
> Signed-off-by: Kyle Anderson 
> 

Thank you for the patch, it was applied in r39541.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [packages] mosh

2014-02-08 Thread Outback Dingo
On Sat, Feb 8, 2014 at 1:22 PM, Hauke Mehrtens  wrote:

> On 11/03/2013 06:53 AM, Kyle Anderson wrote:
> > This adds mosh-full, mosh-server, and mosh-client packages.
> >
> > The Entware team has already done the hard work:
> >
> http://code.google.com/p/wl500g-repo/source/browse/feeds/rtndev/mosh/Makefile?r=1220
> >
> > All I added was a patch to disabled the check for UTF-8, which is not
> > available on our platform. (It works fine with the check disabled)
> > https://github.com/keithw/mosh/issues/464
> >
> > This was originally requested here:
> > https://dev.openwrt.org/ticket/12509
> >
> > This actually does work in conjunction with the openssh-client/server.
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662939
> >
> > Signed-off-by: Kyle Anderson 
> >
>
> Thank you for the patch, it was applied in r39541.
>

However it is not showing up in make menuconfig, and a search displays no
results in menuconfig



>
> Hauke
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel