[PATCH][uhttpd] fix compiler uninitialized variable

2021-09-27 Thread Thomas Huehn
In file included from ubus.c:20:
ubus.c: In function 'uh_ubus_list_cb':
libubox/blobmsg.h:256:9: error: 'o' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
  256 | blob_nest_end(buf, cookie);
  | ^~
ubus.c:591:19: note: 'o' was declared here
  591 | void *t, *o;
  |   ^
cc1: all warnings being treated as errors

Signed-off-by: Thomas Huehn 
Acked-by: Alexander Couzens 
---
 ubus.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ubus.c b/ubus.c
index 619135c..99cc400 100644
--- a/ubus.c
+++ b/ubus.c
@@ -588,7 +588,7 @@ static void uh_ubus_list_cb(struct ubus_context *ctx, 
struct ubus_object_data *o
struct blob_attr *sig, *attr;
struct list_data *data = priv;
int rem, rem2;
-   void *t, *o;
+   void *t, *o=NULL;
 
if (!data->verbose) {
blobmsg_add_string(data->buf, NULL, obj->path);
@@ -598,8 +598,12 @@ static void uh_ubus_list_cb(struct ubus_context *ctx, 
struct ubus_object_data *o
if (!obj->signature)
return;
 
-   if (data->add_object)
+   if (data->add_object) {
o = blobmsg_open_table(data->buf, obj->path);
+   if (!o)
+   return;
+   }
+
blob_for_each_attr(sig, obj->signature, rem) {
t = blobmsg_open_table(data->buf, blobmsg_name(sig));
rem2 = blobmsg_data_len(sig);
@@ -630,6 +634,7 @@ static void uh_ubus_list_cb(struct ubus_context *ctx, 
struct ubus_object_data *o
}
blobmsg_close_table(data->buf, t);
}
+
if (data->add_object)
blobmsg_close_table(data->buf, o);
 }
-- 
2.33.0


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


[OpenWrt-Devel] [PATCH v4] [kernel] upstream fix: mount overlayfs r/o if workdir cannot be created

2015-05-29 Thread Thomas Huehn
This is the case e.g. if JFFS2 partition is full.

see: https://www.mail-archive.com/linux-unionfs@vger.kernel.org/msg00246.html
(a small error in a logmessage was changed and reported upstream)

runtime tested on ar71xx with kernel 3.18.11 and r45772
this paritially fixes #19564

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
---
 ...-overlayfs-fallback-to-readonly-when-full.patch | 73 ++
 1 file changed, 73 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/912-overlayfs-fallback-to-readonly-when-full.patch

diff --git 
a/target/linux/generic/patches-3.18/912-overlayfs-fallback-to-readonly-when-full.patch
 
b/target/linux/generic/patches-3.18/912-overlayfs-fallback-to-readonly-when-full.patch
new file mode 100644
index 000..9e5fad4
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/912-overlayfs-fallback-to-readonly-when-full.patch
@@ -0,0 +1,73 @@
+Index: linux-3.18.14/fs/overlayfs/copy_up.c
+===
+--- linux-3.18.14.orig/fs/overlayfs/copy_up.c  2015-05-20 17:04:50.0 
+0200
 linux-3.18.14/fs/overlayfs/copy_up.c   2015-05-29 13:58:51.281147554 
+0200
+@@ -300,6 +300,9 @@
+   struct cred *override_cred;
+   char *link = NULL;
+ 
++  if (WARN_ON(!workdir))
++  return -EROFS;
++
+   ovl_path_upper(parent, parentpath);
+   upperdir = parentpath.dentry;
+ 
+Index: linux-3.18.14/fs/overlayfs/dir.c
+===
+--- linux-3.18.14.orig/fs/overlayfs/dir.c  2015-05-20 17:04:50.0 
+0200
 linux-3.18.14/fs/overlayfs/dir.c   2015-05-29 14:00:55.727646504 +0200
+@@ -222,6 +222,9 @@
+   struct kstat stat;
+   int err;
+ 
++  if (WARN_ON(!workdir))
++  return ERR_PTR(-EROFS);
++
+   err = ovl_lock_rename_workdir(workdir, upperdir);
+   if (err)
+   goto out;
+@@ -322,6 +325,9 @@
+   struct dentry *newdentry;
+   int err;
+ 
++  if (WARN_ON(!workdir))
++  return -EROFS;
++
+   err = ovl_lock_rename_workdir(workdir, upperdir);
+   if (err)
+   goto out;
+@@ -506,6 +512,9 @@
+   struct dentry *opaquedir = NULL;
+   int err;
+ 
++  if (WARN_ON(!workdir))
++  return -EROFS;
++
+   if (is_dir) {
+   opaquedir = ovl_check_empty_and_clear(dentry);
+   err = PTR_ERR(opaquedir);
+Index: linux-3.18.14/fs/overlayfs/super.c
+===
+--- linux-3.18.14.orig/fs/overlayfs/super.c2015-05-20 17:04:50.0 
+0200
 linux-3.18.14/fs/overlayfs/super.c 2015-05-29 14:05:45.901472157 +0200
+@@ -740,9 +740,17 @@
+   ufs-workdir = ovl_workdir_create(ufs-upper_mnt, workpath.dentry);
+   err = PTR_ERR(ufs-workdir);
+   if (IS_ERR(ufs-workdir)) {
+-  pr_err(overlayfs: failed to create directory %s/%s\n,
+- ufs-config.workdir, OVL_WORKDIR_NAME);
+-  goto out_put_lower_mnt;
++  if (err == -ENOSPC || err == -EROFS) {
++  pr_warning(overlayfs: failed to create work directory
++  (%s), mounting read-only\n,
++ err == ENOSPC ? ENOSPC : EROFS);
++  sb-s_flags |= MS_RDONLY;
++  ufs-workdir = NULL;
++  } else {
++  pr_err(overlayfs: failed to create directory %s/%s\n,
++  ufs-config.workdir, OVL_WORKDIR_NAME);
++  goto out_put_lower_mnt;
++  }
+   }
+ 
+   /*
-- 
2.4.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v1] gianfar: Fix reported number of sent bytes to BQL

2014-02-22 Thread Thomas Huehn
This is a backported patch for the gianfar ethernet driver
used in TPLink 4900 v1. It is supposed to fix the error which
show up in dmesg with:
NETDEV WATCHDOG: eth0 (fsl-gianfar): transmit queue xy timed out
Full upstream patch is at: http://patchwork.ozlabs.org/patch/271242

-v1: fix patch style

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 ...nfar_reported_number_of_sent_bytes_to_BQL.patch |   77 
 1 file changed, 77 insertions(+)
 create mode 100644 
target/linux/mpc85xx/patches-3.10/220-fix_gianfar_reported_number_of_sent_bytes_to_BQL.patch

diff --git 
a/target/linux/mpc85xx/patches-3.10/220-fix_gianfar_reported_number_of_sent_bytes_to_BQL.patch
 
b/target/linux/mpc85xx/patches-3.10/220-fix_gianfar_reported_number_of_sent_bytes_to_BQL.patch
new file mode 100644
index 000..d0380ff
--- /dev/null
+++ 
b/target/linux/mpc85xx/patches-3.10/220-fix_gianfar_reported_number_of_sent_bytes_to_BQL.patch
@@ -0,0 +1,77 @@
+--- a/drivers/net/ethernet/freescale/gianfar.c
 b/drivers/net/ethernet/freescale/gianfar.c
+@@ -2064,7 +2064,7 @@ static int gfar_start_xmit(struct sk_buf
+   int i, rq = 0, do_tstamp = 0;
+   u32 bufaddr;
+   unsigned long flags;
+-  unsigned int nr_frags, nr_txbds, length, fcb_length = GMAC_FCB_LEN;
++  unsigned int nr_frags, nr_txbds, bytes_sent, fcb_length = GMAC_FCB_LEN;
+ 
+   /* TOE=1 frames larger than 2500 bytes may see excess delays
+* before start of transmission.
+@@ -2130,7 +2130,10 @@ static int gfar_start_xmit(struct sk_buf
+   }
+ 
+   /* Update transmit stats */
+-  tx_queue-stats.tx_bytes += skb-len;
++  bytes_sent = skb-len;
++  tx_queue-stats.tx_bytes += bytes_sent;
++  /* keep Tx bytes on wire for BQL accounting */
++  GFAR_CB(skb)-bytes_sent = bytes_sent;
+   tx_queue-stats.tx_packets++;
+ 
+   txbdp = txbdp_start = tx_queue-cur_tx;
+@@ -2150,12 +2153,13 @@ static int gfar_start_xmit(struct sk_buf
+   } else {
+   /* Place the fragment addresses and lengths into the TxBDs */
+   for (i = 0; i  nr_frags; i++) {
++  unsigned int frag_len;
+   /* Point at the next BD, wrapping as needed */
+   txbdp = next_txbd(txbdp, base, tx_queue-tx_ring_size);
+ 
+-  length = skb_shinfo(skb)-frags[i].size;
++  frag_len = skb_shinfo(skb)-frags[i].size;
+ 
+-  lstatus = txbdp-lstatus | length |
++  lstatus = txbdp-lstatus | frag_len |
+ BD_LFLAG(TXBD_READY);
+ 
+   /* Handle the last BD specially */
+@@ -2165,7 +2169,7 @@ static int gfar_start_xmit(struct sk_buf
+   bufaddr = skb_frag_dma_map(priv-dev,
+  skb_shinfo(skb)-frags[i],
+  0,
+- length,
++ frag_len,
+  DMA_TO_DEVICE);
+ 
+   /* set the TxBD length and buffer pointer */
+@@ -2231,7 +2235,7 @@ static int gfar_start_xmit(struct sk_buf
+   lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb);
+   }
+ 
+-  netdev_tx_sent_queue(txq, skb-len);
++  netdev_tx_sent_queue(txq, bytes_sent);
+ 
+   /* We can work in parallel with gfar_clean_tx_ring(), except
+* when modifying num_txbdfree. Note that we didn't grab the lock
+@@ -2551,7 +2555,7 @@ static void gfar_clean_tx_ring(struct gf
+   bdp = next_txbd(bdp, base, tx_ring_size);
+   }
+ 
+-  bytes_sent += skb-len;
++  bytes_sent += GFAR_CB(skb)-bytes_sent;
+ 
+   dev_kfree_skb_any(skb);
+ 
+--- a/drivers/net/ethernet/freescale/gianfar.h
 b/drivers/net/ethernet/freescale/gianfar.h
+@@ -571,7 +571,7 @@ struct rxfcb {
+ };
+ 
+ struct gianfar_skb_cb {
+-  int alignamount;
++  unsigned int bytes_sent; /* bytes-on-wire (i.e. no FCB) */
+ };
+ 
+ #define GFAR_CB(skb) ((struct gianfar_skb_cb *)((skb)-cb))
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] tcpdump: new upstream release 4.5.1 libpcap 1.5.3

2014-02-04 Thread Thomas Huehn
Pull openwrt packages tcpdump and libpcap to the latest upstream versions.
Especially MCS rate information printed by tcpdump is fixed by this.

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 package/libs/libpcap/Makefile  |4 +-
 .../libpcap/patches/100-debian_shared_lib.patch|   44 +--
 .../patches/102-makefile_disable_manpages.patch|   77 +++--
 .../patches/103-makefile_flex_workaround.patch |   10 +-
 .../libpcap/patches/201-space_optimization.patch   |   26 +-
 .../libs/libpcap/patches/202-protocol_api.patch|   80 ++---
 .../patches/203-undef_iw_mode_monitor.patch|8 +-
 package/network/utils/tcpdump/Makefile |6 +-
 .../tcpdump/patches/001-remove_pcap_debug.patch|8 +-
 .../patches/002-remove_static_libpcap_check.patch  |   44 ++-
 .../utils/tcpdump/patches/004-fix_3g_iface.patch   |   22 +-
 .../utils/tcpdump/patches/100-tcpdump_mini.patch   |  325 +---
 12 files changed, 389 insertions(+), 265 deletions(-)

diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index 24b07c9..347b180 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpcap
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.5.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
-PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e
+PKG_MD5SUM:=7e7321fb3aff2f2bb05c8229f3795d4a
 
 PKG_MAINTAINER:=Felix Fietkau n...@openwrt.org
 
diff --git a/package/libs/libpcap/patches/100-debian_shared_lib.patch 
b/package/libs/libpcap/patches/100-debian_shared_lib.patch
index 30cb10a..3785180 100644
--- a/package/libs/libpcap/patches/100-debian_shared_lib.patch
+++ b/package/libs/libpcap/patches/100-debian_shared_lib.patch
@@ -1,8 +1,10 @@
 Debian-specific modifications to the upstream Makefile.in to
 build a shared library.
 
 a/Makefile.in
-+++ b/Makefile.in
+Index: libpcap-1.5.3/Makefile.in
+===
+--- libpcap-1.5.3.orig/Makefile.in 2013-12-03 16:11:53.0 +0100
 libpcap-1.5.3/Makefile.in  2014-02-04 13:03:56.880939714 +0100
 @@ -40,6 +40,14 @@
  srcdir = @srcdir@
  VPATH = @srcdir@
@@ -18,7 +20,7 @@ build a shared library.
  #
  # You shouldn't need to edit anything below.
  #
-@@ -60,7 +68,8 @@
+@@ -63,7 +71,8 @@
  PROG=libpcap
  
  # Standard CFLAGS
@@ -28,7 +30,7 @@ build a shared library.
  
  INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -80,7 +89,11 @@
+@@ -83,7 +92,11 @@
  # problem if you don't own the file but can write to the directory.
  .c.o:
@rm -f $@
@@ -39,9 +41,9 @@ build a shared library.
 +  @rm -f $@
 +  $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c
  
- PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@
+ PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@ @DBUS_SRC@
  FSRC =  fad-@V_FINDALLDEVS@.c
-@@ -96,6 +109,7 @@
+@@ -99,6 +112,7 @@
  # We would like to say OBJ = $(SRC:.c=.o) but Ultrix's make cannot
  # hack the extra indirection
  OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) 
$(LIBOBJS)
@@ -49,7 +51,7 @@ build a shared library.
  PUBHDR = \
pcap.h \
pcap-bpf.h \
-@@ -148,7 +162,7 @@
+@@ -153,7 +167,7 @@
  
  CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
$(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
@@ -58,7 +60,7 @@ build a shared library.
  
  MAN1 = pcap-config.1
  
-@@ -352,7 +366,7 @@
+@@ -363,7 +377,7 @@
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
$(RANLIB) $@
  
@@ -67,7 +69,7 @@ build a shared library.
  
  libpcap.so: $(OBJ)
@rm -f $@
-@@ -430,6 +444,13 @@
+@@ -441,6 +455,13 @@
  #
  libpcap.none:
  
@@ -81,7 +83,7 @@ build a shared library.
  scanner.c: $(srcdir)/scanner.l
@rm -f $@
$(srcdir)/runlex.sh $(LEX) -o$@ $
-@@ -437,6 +458,9 @@
+@@ -448,6 +469,9 @@
  scanner.o: scanner.c tokdefs.h
$(CC) $(FULL_CFLAGS) -c scanner.c
  
@@ -91,7 +93,7 @@ build a shared library.
  pcap.o: version.h
  
  tokdefs.h: grammar.c
-@@ -450,9 +474,16 @@
+@@ -461,9 +485,16 @@
@rm -f $@
$(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c
  
@@ -108,7 +110,7 @@ build a shared library.
  snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
  
-@@ -490,6 +521,9 @@
+@@ -501,6 +532,9 @@
  bpf_filter.o: bpf_filter.c
$(CC) $(FULL_CFLAGS) -c bpf_filter.c
  
@@ -118,7 +120,7 @@ build a shared library.
  #
  # Generate the pcap-config script.
  #
-@@ -607,11 +641,9 @@
+@@ -618,11 +652,9 @@
  install-shared-so: libpcap.so
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
@@ -133,9 +135,11 @@ build a shared library.
  install-shared-dylib: libpcap.dylib

[OpenWrt-Devel] [PATCH v2 1/2] libpcap: update to current upstream version 1.5.3

2014-02-04 Thread Thomas Huehn
-size_of(old libpcap-1.3.0) = 85228 Byte
-size_of(new libpcap-1.5.3) = 88587 Byte
= ~3.3 KByte increase
---
 package/libs/libpcap/Makefile  |4 +-
 .../libpcap/patches/100-debian_shared_lib.patch|   30 -
 .../patches/102-makefile_disable_manpages.patch|   71 ++--
 .../patches/103-makefile_flex_workaround.patch |4 +-
 .../libpcap/patches/201-space_optimization.patch   |8 +--
 .../libs/libpcap/patches/202-protocol_api.patch|   58 
 .../patches/203-undef_iw_mode_monitor.patch|2 +-
 7 files changed, 87 insertions(+), 90 deletions(-)

diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index 24b07c9..347b180 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpcap
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.5.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
-PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e
+PKG_MD5SUM:=7e7321fb3aff2f2bb05c8229f3795d4a
 
 PKG_MAINTAINER:=Felix Fietkau n...@openwrt.org
 
diff --git a/package/libs/libpcap/patches/100-debian_shared_lib.patch 
b/package/libs/libpcap/patches/100-debian_shared_lib.patch
index 30cb10a..b294e51 100644
--- a/package/libs/libpcap/patches/100-debian_shared_lib.patch
+++ b/package/libs/libpcap/patches/100-debian_shared_lib.patch
@@ -3,7 +3,7 @@ build a shared library.
 
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -40,6 +40,14 @@
+@@ -40,6 +40,14 @@ mandir = @mandir@
  srcdir = @srcdir@
  VPATH = @srcdir@
  
@@ -18,7 +18,7 @@ build a shared library.
  #
  # You shouldn't need to edit anything below.
  #
-@@ -60,7 +68,8 @@
+@@ -63,7 +71,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
  PROG=libpcap
  
  # Standard CFLAGS
@@ -28,7 +28,7 @@ build a shared library.
  
  INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -80,7 +89,11 @@
+@@ -83,7 +92,11 @@ YACC = @V_YACC@
  # problem if you don't own the file but can write to the directory.
  .c.o:
@rm -f $@
@@ -39,9 +39,9 @@ build a shared library.
 +  @rm -f $@
 +  $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c
  
- PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@
+ PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@ @DBUS_SRC@
  FSRC =  fad-@V_FINDALLDEVS@.c
-@@ -96,6 +109,7 @@
+@@ -99,6 +112,7 @@ SRC =   $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
  # We would like to say OBJ = $(SRC:.c=.o) but Ultrix's make cannot
  # hack the extra indirection
  OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) 
$(LIBOBJS)
@@ -49,7 +49,7 @@ build a shared library.
  PUBHDR = \
pcap.h \
pcap-bpf.h \
-@@ -148,7 +162,7 @@
+@@ -153,7 +167,7 @@ TAGFILES = \
  
  CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
$(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
@@ -58,7 +58,7 @@ build a shared library.
  
  MAN1 = pcap-config.1
  
-@@ -352,7 +366,7 @@
+@@ -363,7 +377,7 @@ libpcap.a: $(OBJ)
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
$(RANLIB) $@
  
@@ -67,7 +67,7 @@ build a shared library.
  
  libpcap.so: $(OBJ)
@rm -f $@
-@@ -430,6 +444,13 @@
+@@ -441,6 +455,13 @@ libpcap.shareda: $(OBJ)
  #
  libpcap.none:
  
@@ -81,7 +81,7 @@ build a shared library.
  scanner.c: $(srcdir)/scanner.l
@rm -f $@
$(srcdir)/runlex.sh $(LEX) -o$@ $
-@@ -437,6 +458,9 @@
+@@ -448,6 +469,9 @@ scanner.c: $(srcdir)/scanner.l
  scanner.o: scanner.c tokdefs.h
$(CC) $(FULL_CFLAGS) -c scanner.c
  
@@ -91,7 +91,7 @@ build a shared library.
  pcap.o: version.h
  
  tokdefs.h: grammar.c
-@@ -450,9 +474,16 @@
+@@ -461,9 +485,16 @@ grammar.o: grammar.c
@rm -f $@
$(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c
  
@@ -108,7 +108,7 @@ build a shared library.
  snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
  
-@@ -490,6 +521,9 @@
+@@ -501,6 +532,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
  bpf_filter.o: bpf_filter.c
$(CC) $(FULL_CFLAGS) -c bpf_filter.c
  
@@ -118,7 +118,7 @@ build a shared library.
  #
  # Generate the pcap-config script.
  #
-@@ -607,11 +641,9 @@
+@@ -618,11 +652,9 @@ install-shared: install-shared-$(DYEXT)
  install-shared-so: libpcap.so
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
@@ -135,7 +135,7 @@ build a shared library.
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 --- a/aclocal.m4
 +++ b/aclocal.m4
-@@ -262,7 +262,7 @@
+@@ -440,7 +440,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
esac
;;
esac
@@ -144,7 +144,7 @@ build a shared library.
V_SONAME_OPT=-Wl,-soname,
V_RPATH_OPT=-Wl,-rpath,
;;

[OpenWrt-Devel] [PATCH v2 2/2] tcpdump: update to current upstream version 4.5.1

2014-02-04 Thread Thomas Huehn
-size_of(old tcpdump-mini 4.2.1) = 145245 Byte
-size_of(new tcpdump-mini 4.5.1) = 149416 Byte
= ~4.2 KByte increase

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 package/network/utils/tcpdump/Makefile |6 +-
 .../tcpdump/patches/001-remove_pcap_debug.patch|2 +-
 .../patches/002-remove_static_libpcap_check.patch  |   38 ++--
 .../utils/tcpdump/patches/004-fix_3g_iface.patch   |   14 +-
 .../utils/tcpdump/patches/100-tcpdump_mini.patch   |  205 ++--
 5 files changed, 166 insertions(+), 99 deletions(-)

diff --git a/package/network/utils/tcpdump/Makefile 
b/package/network/utils/tcpdump/Makefile
index b32d25f..b221e2d 100644
--- a/package/network/utils/tcpdump/Makefile
+++ b/package/network/utils/tcpdump/Makefile
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpdump
-PKG_VERSION:=4.2.1
-PKG_RELEASE:=3
+PKG_VERSION:=4.5.1
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
http://ftp.gwdg.de/pub/misc/tcpdump/ \
http://www.at.tcpdump.org/ \
http://www.br.tcpdump.org/
-PKG_MD5SUM:=c202878c6db054767b52651041b9e60e
+PKG_MD5SUM:=973a2513d0076e34aa9da7e15ed98e1b
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
diff --git a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch 
b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
index 14d1b84..d2c724d 100644
--- a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
+++ b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
@@ -1,6 +1,6 @@
 --- a/tcpdump.c
 +++ b/tcpdump.c
-@@ -982,20 +982,6 @@ main(int argc, char **argv)
+@@ -1095,20 +1095,6 @@ main(int argc, char **argv)
error(invalid data link type %s, 
gndo-ndo_dltname);
break;
  
diff --git 
a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch 
b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
index 8ab54aa..c8bdf14 100644
--- 
a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
+++ 
b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
@@ -1,11 +1,11 @@
 --- a/configure
 +++ b/configure
-@@ -7130,28 +7130,6 @@ echo ${ECHO_T}Using $pfopen 6; }
+@@ -5813,28 +5813,6 @@ $as_echo Using $pfopen 6; }
LIBS=$LIBS $pfopen
fi
  fi
--{ echo $as_me:$LINENO: checking for local pcap library 5
--echo $ECHO_N checking for local pcap library... $ECHO_C 6; }
+-{ $as_echo $as_me:${as_lineno-$LINENO}: checking for local pcap library 
5
+-$as_echo_n checking for local pcap library...  6; }
 -libpcap=FAIL
 -lastdir=FAIL
 -places=`ls $srcdir/.. | sed -e 's,/$,,' -e s,^,$srcdir/../, | \
@@ -23,23 +23,21 @@
 -  fi
 -done
 -if test $libpcap = FAIL ; then
--  { echo $as_me:$LINENO: result: not found 5
--echo ${ECHO_T}not found 6; }
+-  { $as_echo $as_me:${as_lineno-$LINENO}: result: not found 5
+-$as_echo not found 6; }
 -
#
# Look for pcap-config.
#
-@@ -7335,45 +7313,6 @@ if test $ac_cv_lib_pcap_main = yes; then
+@@ -5989,41 +5967,6 @@ if test x$ac_cv_lib_pcap_main = xyes;
libpcap=-lpcap
  fi
  
 -  if test $libpcap = FAIL ; then
--  { { echo $as_me:$LINENO: error: see the INSTALL doc for 
more info 5
--echo $as_me: error: see the INSTALL doc for more info 2;}
--   { (exit 1); exit 1; }; }
+-  as_fn_error $? see the INSTALL doc for more info 
$LINENO 5
 -  fi
--  



{ echo $as_me:$LINENO: checking for extraneous pcap header directories 5
--echo $ECHO_N checking for extraneous pcap header directories... $ECHO_C 
6; }
+-  



{ $as_echo $as_me:${as_lineno-$LINENO}: checking for extraneous pcap header 
directories 5
+-$as_echo_n checking for extraneous pcap header directories...  6; }
 -  if test \( ! -r /usr/local/include/pcap.h \) -a \
 -  \( ! -r /usr/include/pcap.h \); then
 -  if test -r /usr/local/include/pcap/pcap.h; then
@@ -49,12 +47,12 @@
 -  fi
 -  fi
 -  if test -z $d

[OpenWrt-Devel] [PATCH v3 1/2] libpcap: update to current upstream version 1.5.3

2014-02-04 Thread Thomas Huehn
-size_of(old libpcap-1.3.0) = 85228 Byte
-size_of(new libpcap-1.5.3) = 88587 Byte
= ~3.3 KByte increase
---
 package/libs/libpcap/Makefile  |4 +-
 .../libpcap/patches/100-debian_shared_lib.patch|   30 -
 .../patches/102-makefile_disable_manpages.patch|   71 ++--
 .../patches/103-makefile_flex_workaround.patch |4 +-
 .../libpcap/patches/201-space_optimization.patch   |8 +--
 .../libs/libpcap/patches/202-protocol_api.patch|   58 
 .../patches/203-undef_iw_mode_monitor.patch|2 +-
 7 files changed, 87 insertions(+), 90 deletions(-)

diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index 24b07c9..347b180 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpcap
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.5.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
-PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e
+PKG_MD5SUM:=7e7321fb3aff2f2bb05c8229f3795d4a
 
 PKG_MAINTAINER:=Felix Fietkau n...@openwrt.org
 
diff --git a/package/libs/libpcap/patches/100-debian_shared_lib.patch 
b/package/libs/libpcap/patches/100-debian_shared_lib.patch
index 30cb10a..b294e51 100644
--- a/package/libs/libpcap/patches/100-debian_shared_lib.patch
+++ b/package/libs/libpcap/patches/100-debian_shared_lib.patch
@@ -3,7 +3,7 @@ build a shared library.
 
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -40,6 +40,14 @@
+@@ -40,6 +40,14 @@ mandir = @mandir@
  srcdir = @srcdir@
  VPATH = @srcdir@
  
@@ -18,7 +18,7 @@ build a shared library.
  #
  # You shouldn't need to edit anything below.
  #
-@@ -60,7 +68,8 @@
+@@ -63,7 +71,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
  PROG=libpcap
  
  # Standard CFLAGS
@@ -28,7 +28,7 @@ build a shared library.
  
  INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -80,7 +89,11 @@
+@@ -83,7 +92,11 @@ YACC = @V_YACC@
  # problem if you don't own the file but can write to the directory.
  .c.o:
@rm -f $@
@@ -39,9 +39,9 @@ build a shared library.
 +  @rm -f $@
 +  $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c
  
- PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@
+ PSRC =pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@ @DBUS_SRC@
  FSRC =  fad-@V_FINDALLDEVS@.c
-@@ -96,6 +109,7 @@
+@@ -99,6 +112,7 @@ SRC =   $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
  # We would like to say OBJ = $(SRC:.c=.o) but Ultrix's make cannot
  # hack the extra indirection
  OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) 
$(LIBOBJS)
@@ -49,7 +49,7 @@ build a shared library.
  PUBHDR = \
pcap.h \
pcap-bpf.h \
-@@ -148,7 +162,7 @@
+@@ -153,7 +167,7 @@ TAGFILES = \
  
  CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
$(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
@@ -58,7 +58,7 @@ build a shared library.
  
  MAN1 = pcap-config.1
  
-@@ -352,7 +366,7 @@
+@@ -363,7 +377,7 @@ libpcap.a: $(OBJ)
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
$(RANLIB) $@
  
@@ -67,7 +67,7 @@ build a shared library.
  
  libpcap.so: $(OBJ)
@rm -f $@
-@@ -430,6 +444,13 @@
+@@ -441,6 +455,13 @@ libpcap.shareda: $(OBJ)
  #
  libpcap.none:
  
@@ -81,7 +81,7 @@ build a shared library.
  scanner.c: $(srcdir)/scanner.l
@rm -f $@
$(srcdir)/runlex.sh $(LEX) -o$@ $
-@@ -437,6 +458,9 @@
+@@ -448,6 +469,9 @@ scanner.c: $(srcdir)/scanner.l
  scanner.o: scanner.c tokdefs.h
$(CC) $(FULL_CFLAGS) -c scanner.c
  
@@ -91,7 +91,7 @@ build a shared library.
  pcap.o: version.h
  
  tokdefs.h: grammar.c
-@@ -450,9 +474,16 @@
+@@ -461,9 +485,16 @@ grammar.o: grammar.c
@rm -f $@
$(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c
  
@@ -108,7 +108,7 @@ build a shared library.
  snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
  
-@@ -490,6 +521,9 @@
+@@ -501,6 +532,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
  bpf_filter.o: bpf_filter.c
$(CC) $(FULL_CFLAGS) -c bpf_filter.c
  
@@ -118,7 +118,7 @@ build a shared library.
  #
  # Generate the pcap-config script.
  #
-@@ -607,11 +641,9 @@
+@@ -618,11 +652,9 @@ install-shared: install-shared-$(DYEXT)
  install-shared-so: libpcap.so
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
@@ -135,7 +135,7 @@ build a shared library.
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 --- a/aclocal.m4
 +++ b/aclocal.m4
-@@ -262,7 +262,7 @@
+@@ -440,7 +440,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
esac
;;
esac
@@ -144,7 +144,7 @@ build a shared library.
V_SONAME_OPT=-Wl,-soname,
V_RPATH_OPT=-Wl,-rpath,
;;

[OpenWrt-Devel] [PATCH v3 2/2] tcpdump: update to current upstream version 4.5.1

2014-02-04 Thread Thomas Huehn
-size_of(old tcpdump-mini 4.2.1) = 145245 Byte
-size_of(new tcpdump-mini 4.5.1) = 149416 Byte
= ~4.2 KByte increase

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 package/network/utils/tcpdump/Makefile |6 +-
 .../tcpdump/patches/001-remove_pcap_debug.patch|2 +-
 .../patches/002-remove_static_libpcap_check.patch  |   38 ++--
 .../utils/tcpdump/patches/004-fix_3g_iface.patch   |   28 ---
 .../utils/tcpdump/patches/100-tcpdump_mini.patch   |  205 ++--
 5 files changed, 164 insertions(+), 115 deletions(-)
 delete mode 100644 package/network/utils/tcpdump/patches/004-fix_3g_iface.patch

diff --git a/package/network/utils/tcpdump/Makefile 
b/package/network/utils/tcpdump/Makefile
index b32d25f..b221e2d 100644
--- a/package/network/utils/tcpdump/Makefile
+++ b/package/network/utils/tcpdump/Makefile
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpdump
-PKG_VERSION:=4.2.1
-PKG_RELEASE:=3
+PKG_VERSION:=4.5.1
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
http://ftp.gwdg.de/pub/misc/tcpdump/ \
http://www.at.tcpdump.org/ \
http://www.br.tcpdump.org/
-PKG_MD5SUM:=c202878c6db054767b52651041b9e60e
+PKG_MD5SUM:=973a2513d0076e34aa9da7e15ed98e1b
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
diff --git a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch 
b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
index 14d1b84..d2c724d 100644
--- a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
+++ b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch
@@ -1,6 +1,6 @@
 --- a/tcpdump.c
 +++ b/tcpdump.c
-@@ -982,20 +982,6 @@ main(int argc, char **argv)
+@@ -1095,20 +1095,6 @@ main(int argc, char **argv)
error(invalid data link type %s, 
gndo-ndo_dltname);
break;
  
diff --git 
a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch 
b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
index 8ab54aa..c8bdf14 100644
--- 
a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
+++ 
b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch
@@ -1,11 +1,11 @@
 --- a/configure
 +++ b/configure
-@@ -7130,28 +7130,6 @@ echo ${ECHO_T}Using $pfopen 6; }
+@@ -5813,28 +5813,6 @@ $as_echo Using $pfopen 6; }
LIBS=$LIBS $pfopen
fi
  fi
--{ echo $as_me:$LINENO: checking for local pcap library 5
--echo $ECHO_N checking for local pcap library... $ECHO_C 6; }
+-{ $as_echo $as_me:${as_lineno-$LINENO}: checking for local pcap library 
5
+-$as_echo_n checking for local pcap library...  6; }
 -libpcap=FAIL
 -lastdir=FAIL
 -places=`ls $srcdir/.. | sed -e 's,/$,,' -e s,^,$srcdir/../, | \
@@ -23,23 +23,21 @@
 -  fi
 -done
 -if test $libpcap = FAIL ; then
--  { echo $as_me:$LINENO: result: not found 5
--echo ${ECHO_T}not found 6; }
+-  { $as_echo $as_me:${as_lineno-$LINENO}: result: not found 5
+-$as_echo not found 6; }
 -
#
# Look for pcap-config.
#
-@@ -7335,45 +7313,6 @@ if test $ac_cv_lib_pcap_main = yes; then
+@@ -5989,41 +5967,6 @@ if test x$ac_cv_lib_pcap_main = xyes;
libpcap=-lpcap
  fi
  
 -  if test $libpcap = FAIL ; then
--  { { echo $as_me:$LINENO: error: see the INSTALL doc for 
more info 5
--echo $as_me: error: see the INSTALL doc for more info 2;}
--   { (exit 1); exit 1; }; }
+-  as_fn_error $? see the INSTALL doc for more info 
$LINENO 5
 -  fi
--  



{ echo $as_me:$LINENO: checking for extraneous pcap header directories 5
--echo $ECHO_N checking for extraneous pcap header directories... $ECHO_C 
6; }
+-  



{ $as_echo $as_me:${as_lineno-$LINENO}: checking for extraneous pcap header 
directories 5
+-$as_echo_n checking for extraneous pcap header directories...  6; }
 -  if test \( ! -r /usr/local/include/pcap.h \) -a \
 -  \( ! -r /usr/include/pcap.h \); then
 -  if test -r /usr/local/include/pcap/pcap.h; then
@@ -49,12 +47,12

[OpenWrt-Devel] [PATCH] netifd: fix mac80211.sh to respect setting of mcast_rate

2014-01-10 Thread Thomas Huehn
This patch fixes a bug in /lib/netifd/wireless/mac80211.sh, where
the UCI setting of wireless multicast traffic (in uci: mcast_rate)
is not respected within netifd. Especially in Freifunk mesh networks
the olsr routing as effected by this, as only the lowest mcast_rate
was used, even when uci ncast_rate was set to something else.
In function mac80211_setup_adhoc() the value of mcast_rate is missing
in json_get_vars.

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 .../mac80211/files/lib/netifd/wireless/mac80211.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh 
b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 12c256e..1896fe0 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -241,7 +241,7 @@ mac80211_setup_supplicant() {
 }
 
 mac80211_setup_adhoc() {
-   json_get_vars bssid ssid basic_rate key
+   json_get_vars bssid ssid basic_rate key mcast_rate
 
keyspec=
[ $auth_type == wep ]  {
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] gianfar: Fix NAPI poll mechanism in GIANFAR ethernet driver

2013-10-31 Thread Thomas Huehn
This patch fixes the NAPI poll mechanism in the GIANFAR ethernet driver, which
was not properly working since Linus Kernel Version 3,8.
Therefore the workaround patch to downgrade the GIANFAR ethernet driver to
Kernelversion v3.8 is obsoete.
This patch was extensivly testes with different network loads and types of
traffic. There is quite a substantial user base that reports proper Ethernet
function with TPlink-4900. This patch is based on the fixes from GINAFAR
maintainer Claudiu Manoli.

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 .../patches-3.10/900-fix_gianfar_napi_poll.patch   |  111 
 1 file changed, 111 insertions(+)
 create mode 100644 
target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch

diff --git a/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch 
b/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch
new file mode 100644
index 000..cf570c9
--- /dev/null
+++ b/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch
@@ -0,0 +1,111 @@
+Index: linux-3.10.15/drivers/net/ethernet/freescale/gianfar.c
+===
+--- linux-3.10.15.orig/drivers/net/ethernet/freescale/gianfar.c
2013-10-05 16:13:21.0 +0200
 linux-3.10.15/drivers/net/ethernet/freescale/gianfar.c 2013-10-16 
13:44:36.469810517 +0200
+@@ -2835,7 +2835,7 @@
+   struct gfar_priv_rx_q *rx_queue = NULL;
+   int work_done = 0, work_done_per_q = 0;
+   int i, budget_per_q = 0;
+-  int has_tx_work;
++  int has_tx_work = 0;
+   unsigned long rstat_rxf;
+   int num_act_queues;
+ 
+@@ -2850,62 +2850,48 @@
+   if (num_act_queues)
+   budget_per_q = budget/num_act_queues;
+ 
+-  while (1) {
+-  has_tx_work = 0;
+-  for_each_set_bit(i, gfargrp-tx_bit_map, priv-num_tx_queues) {
+-  tx_queue = priv-tx_queue[i];
+-  /* run Tx cleanup to completion */
+-  if (tx_queue-tx_skbuff[tx_queue-skb_dirtytx]) {
+-  gfar_clean_tx_ring(tx_queue);
+-  has_tx_work = 1;
+-  }
+-  }
+-
+-  for_each_set_bit(i, gfargrp-rx_bit_map, priv-num_rx_queues) {
+-  /* skip queue if not active */
+-  if (!(rstat_rxf  (RSTAT_CLEAR_RXF0  i)))
+-  continue;
+-
+-  rx_queue = priv-rx_queue[i];
+-  work_done_per_q =
+-  gfar_clean_rx_ring(rx_queue, budget_per_q);
+-  work_done += work_done_per_q;
+-
+-  /* finished processing this queue */
+-  if (work_done_per_q  budget_per_q) {
+-  /* clear active queue hw indication */
+-  gfar_write(regs-rstat,
+- RSTAT_CLEAR_RXF0  i);
+-  rstat_rxf = ~(RSTAT_CLEAR_RXF0  i);
+-  num_act_queues--;
+-
+-  if (!num_act_queues)
+-  break;
+-  /* recompute budget per Rx queue */
+-  budget_per_q =
+-  (budget - work_done) / num_act_queues;
+-  }
++  for_each_set_bit(i, gfargrp-tx_bit_map, priv-num_tx_queues) {
++  tx_queue = priv-tx_queue[i];
++  /* run Tx cleanup to completion */
++  if (tx_queue-tx_skbuff[tx_queue-skb_dirtytx]) {
++  gfar_clean_tx_ring(tx_queue);
++  has_tx_work = 1;
+   }
++  }
+ 
+-  if (work_done = budget)
+-  break;
++  for_each_set_bit(i, gfargrp-rx_bit_map, priv-num_rx_queues) {
++  /* skip queue if not active */
++  if (!(rstat_rxf  (RSTAT_CLEAR_RXF0  i)))
++  continue;
++
++  rx_queue = priv-rx_queue[i];
++  work_done_per_q = gfar_clean_rx_ring(rx_queue, budget_per_q);
++  work_done += work_done_per_q;
++
++  /* finished processing this queue */
++  if (work_done_per_q  budget_per_q) {
++  /* clear active queue hw indication */
++  gfar_write(regs-rstat, RSTAT_CLEAR_RXF0  i);
++  num_act_queues--;
+ 
+-  if (!num_act_queues  !has_tx_work) {
++  if (!num_act_queues)
++  break;
++  }
++  }
+ 
+-  napi_complete(napi);
++  if (!num_act_queues  !has_tx_work) {
++  napi_complete(napi);
+ 
+-  /* Clear the halt bit in RSTAT */
+-  gfar_write(regs-rstat, gfargrp-rstat

[OpenWrt-Devel] [PATCH] mac80211: fix mac adress and channel assignment to be type specific

2012-08-21 Thread Thomas Huehn
The mac80211.sh script does not properly differentiate between certain
interface types and the way they get a MAC adress and a channel
assigned. This patch adds correct handling of monitor, ad-hoc and
combinations of it to avoid error messages.

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 package/mac80211/files/lib/wifi/mac80211.sh | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index 6dfe2a2..e7bf67d 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -329,6 +329,7 @@ enable_mac80211() {
export channel fixed
# convert channel to frequency
local freq=$(get_freq $phy ${fixed:+$channel})
+   local interface_type=monitor_only
 
wifi_fixup_hwmode $device g
for vif in $vifs; do
@@ -345,16 +346,19 @@ enable_mac80211() {
case $mode in
adhoc)
iw phy $phy interface add $ifname type adhoc
+   interface_type=mixed
;;
ap)
# Hostapd will handle recreating the interface 
and
# it's accompanying monitor
apidx=$(($apidx + 1))
[ $apidx -gt 1 ] || iw phy $phy interface 
add $ifname type managed
+   interface_type=mixed
;;
mesh)
config_get mesh_id $vif mesh_id
iw phy $phy interface add $ifname type mp 
mesh_id $mesh_id
+   interface_type=mixed
;;
monitor)
iw phy $phy interface add $ifname type 
monitor
@@ -367,6 +371,7 @@ enable_mac80211() {
config_get_bool powersave $vif powersave 0
[ $powersave -gt 0 ]  powersave=on || 
powersave=off
iw $ifname set power_save $powersave
+   interface_type=mixed
;;
esac
 
@@ -379,7 +384,7 @@ enable_mac80211() {
vif_mac=$(mac80211_generate_mac $macidx $macaddr)
macidx=$(($macidx + 1))
}
-   [ $mode = ap ] || ifconfig $ifname hw ether $vif_mac
+   [ ! $mode = ap -a $interface_type = mixed ]  ifconfig 
$ifname hw ether $vif_mac
config_set $vif macaddr $vif_mac
 
# !! ap !!
@@ -390,7 +395,7 @@ enable_mac80211() {
#
# ALL station functionality will be passed to wpa_supplicant
#
-   if [ ! $mode = ap ]; then
+   if [ ! $mode = ap -a ! $interface_type = monitor_only 
-a ! $mode = adhoc ]; then
# We attempt to set the channel for all interfaces, 
although
# mac80211 may not support it or the driver might not 
yet
# for ap mode this is handled by hostapd
-- 
1.7.11.1

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


[OpenWrt-Devel] [PATCH v2] mac80211: fix mac adress and channel assignment to be type specific

2012-08-21 Thread Thomas Huehn
The mac80211.sh script does not properly differentiate between certain
interface types and the way they get a MAC adress and a channel
assigned. This patch adds correct handling of monitor, ad-hoc and
combinations of it to avoid error messages.

Signed-off-by: Thomas Huehn tho...@net.t-labs.tu-berlin.de
---
 package/mac80211/files/lib/wifi/mac80211.sh | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index 6dfe2a2..df84472 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -329,6 +329,7 @@ enable_mac80211() {
export channel fixed
# convert channel to frequency
local freq=$(get_freq $phy ${fixed:+$channel})
+   local interface_type=monitor_only
 
wifi_fixup_hwmode $device g
for vif in $vifs; do
@@ -345,16 +346,19 @@ enable_mac80211() {
case $mode in
adhoc)
iw phy $phy interface add $ifname type adhoc
+   interface_type=mixed
;;
ap)
# Hostapd will handle recreating the interface 
and
# it's accompanying monitor
apidx=$(($apidx + 1))
[ $apidx -gt 1 ] || iw phy $phy interface 
add $ifname type managed
+   interface_type=mixed
;;
mesh)
config_get mesh_id $vif mesh_id
iw phy $phy interface add $ifname type mp 
mesh_id $mesh_id
+   interface_type=mixed
;;
monitor)
iw phy $phy interface add $ifname type 
monitor
@@ -367,6 +371,7 @@ enable_mac80211() {
config_get_bool powersave $vif powersave 0
[ $powersave -gt 0 ]  powersave=on || 
powersave=off
iw $ifname set power_save $powersave
+   interface_type=mixed
;;
esac
 
@@ -379,7 +384,10 @@ enable_mac80211() {
vif_mac=$(mac80211_generate_mac $macidx $macaddr)
macidx=$(($macidx + 1))
}
-   [ $mode = ap ] || ifconfig $ifname hw ether $vif_mac
+   if [ ! $mode = ap -a ! $mode = monitor ] ||
+  [ $mode = monitor -a $interface_type = monitor_only 
]; then
+   ifconfig $ifname hw ether $vif_mac
+   fi
config_set $vif macaddr $vif_mac
 
# !! ap !!
@@ -390,7 +398,8 @@ enable_mac80211() {
#
# ALL station functionality will be passed to wpa_supplicant
#
-   if [ ! $mode = ap ]; then
+   if [ ! $mode = ap -a ! $mode = adhoc -a ! $mode = 
monitor ] ||
+  [ $mode = monitor -a $interface_type = monitor_only 
]; then
# We attempt to set the channel for all interfaces, 
although
# mac80211 may not support it or the driver might not 
yet
# for ap mode this is handled by hostapd
-- 
1.7.11.1

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