Skip to content

Commit

Permalink
Merge with GPL 7266
Browse files Browse the repository at this point in the history
  • Loading branch information
RMerl committed Feb 20, 2017
1 parent 50ad9fc commit 1b567d7
Show file tree
Hide file tree
Showing 485 changed files with 32,663 additions and 40,918 deletions.
8 changes: 5 additions & 3 deletions release/src-rt-6.x.4708/et/sys/et_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ et_rxevent(osl_t *osh, et_info_t *et, struct chops *chops, void *ch, int quota)
bool skip_check = SKIP_TCP_CTRL_CHECK(et);
#endif /* USBAP */
#endif /* PKTC */
uint16 ether_type;
uint16 ether_type, vlan_type;

/* read the buffers first */
while ((p = (*chops->rx)(ch))) {
Expand Down Expand Up @@ -2313,8 +2313,10 @@ et_rxevent(osl_t *osh, et_info_t *et, struct chops *chops, void *ch, int quota)

evh = PKTDATA(et->osh, p) + dataoff;

ether_type = ((struct ether_header *) evh)->ether_type;
if (ether_type == HTON16(ETHER_TYPE_BRCM)) {
ether_type = ((struct ethervlan_header *) evh)->ether_type;
vlan_type = ((struct ethervlan_header *) evh)->vlan_type;
if (ether_type == HTON16(ETHER_TYPE_BRCM) ||
vlan_type == HTON16(ETHER_TYPE_BRCM)) {
PKTFREE(osh, p, FALSE);
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ ipt_do_table(struct sk_buff *skb,
ip = ip_hdr(skb);
if (verdict == IPT_CONTINUE)
e = ipt_next_entry(e);
else if (verdict == IPT_RETURN) { // added -- zzz
e = jumpstack[--*stackptr];
if (*stackptr <= origptr) {
e = get_entry(table_base,
private->underflow[hook]);
pr_debug("Underflow (this is normal) "
"to %p\n", e);
} else {
e = jumpstack[--*stackptr];
pr_debug("Pulled %p out from pos %u\n",
e, *stackptr);
e = ipt_next_entry(e);
}
continue;
}
else
/* Verdict */
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ connmark_tg(struct sk_buff *skb, const struct xt_action_param *par)
if (newmark != skb->mark) {
skb->mark = newmark;
}
//return XT_RETURN; // set return here will cause traffic blocked !?
break;
return XT_RETURN;
case XT_CONNMARK_SAVE:
newmark = (ct->mark & ~info->ctmask) ^
(skb->mark & info->nfmask);
Expand Down
Binary file modified release/src-rt-6.x/wl/exe/prebuilt/wl
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,160 @@ static struct resource norflash_region = {
static unsigned char flash_nvh[MAX_NVRAM_SPACE];
#ifdef CONFIG_MTD_NFLASH

#define NLS_XFR 1 /* added by Jiahao for WL500gP */
#ifdef NLS_XFR

#include <linux/nls.h>

static char *NLS_NVRAM_U2C="asusnlsu2c";
static char *NLS_NVRAM_C2U="asusnlsc2u";
__u16 unibuf[1024];
char codebuf[1024];
char tmpbuf[1024];

void
asusnls_u2c(char *name)
{
#ifdef CONFIG_NLS
char *codepage;
char *xfrstr;
struct nls_table *nls;
int ret, len;

strcpy(codebuf, name);
codepage=codebuf+strlen(NLS_NVRAM_U2C);
if((xfrstr=strchr(codepage, '_')))
{
*xfrstr=NULL;
xfrstr++;
nls=load_nls(codepage);
if(!nls)
{
printk("NLS table is null!!\n");
}
else {
len = 0;
if (ret=utf8s_to_utf16s(xfrstr, strlen(xfrstr), unibuf))
{
int i;
for (i = 0; (i < ret) && unibuf[i]; i++) {
int charlen;
charlen = nls->uni2char(unibuf[i], &name[len], NLS_MAX_CHARSET_SIZE);
if (charlen > 0) {
len += charlen;
}
else {
strcpy(name, "");
unload_nls(nls);
return;
}
}
name[len] = 0;
}
unload_nls(nls);
if(!len)
{
printk("can not xfr from utf8 to %s\n", codepage);
strcpy(name, "");
}
}
}
else
{
strcpy(name, "");
}
#endif
}

void
asusnls_c2u(char *name)
{
#ifdef CONFIG_NLS
char *codepage;
char *xfrstr;
struct nls_table *nls;
int ret;

strcpy(codebuf, name);
codepage=codebuf+strlen(NLS_NVRAM_C2U);
if((xfrstr=strchr(codepage, '_')))
{
*xfrstr=NULL;
xfrstr++;

strcpy(name, "");
nls=load_nls(codepage);
if(!nls)
{
printk("NLS table is null!!\n");
}
else
{
int charlen;
int i;
int len = strlen(xfrstr);
for (i = 0; len && *xfrstr; i++, xfrstr += charlen, len -= charlen) { /* string to unicode */
charlen = nls->char2uni(xfrstr, len, &unibuf[i]);
if (charlen < 1) {
strcpy(name ,"");
unload_nls(nls);
return;
}
}
unibuf[i] = 0;
ret=utf16s_to_utf8s(unibuf, i, UTF16_HOST_ENDIAN, name, 1024); /* unicode to utf-8, 1024 is size of array unibuf */
name[ret]=0;
unload_nls(nls);
if(!ret)
{
printk("can not xfr from %s to utf8\n", codepage);
strcpy(name, "");
}
}
}
else
{
strcpy(name, "");
}
#endif
}

char *
nvram_xfr(const char *buf)
{
char *name = tmpbuf;
ssize_t ret=0;

if (copy_from_user(name, buf, strlen(buf)+1)) {
ret = -EFAULT;
goto done;
}

if (strncmp(tmpbuf, NLS_NVRAM_U2C, strlen(NLS_NVRAM_U2C))==0)
{
asusnls_u2c(tmpbuf);
}
else if (strncmp(buf, NLS_NVRAM_C2U, strlen(NLS_NVRAM_C2U))==0)
{
asusnls_c2u(tmpbuf);
}
else
{
strcpy(tmpbuf, "");
}

if (copy_to_user(buf, tmpbuf, strlen(tmpbuf)+1))
{
ret = -EFAULT;
goto done;
}
done:
if(ret==0) return tmpbuf;
else return NULL;
}

#endif // NLS_XFR

static struct nvram_header *
BCMINITFN(nand_find_nvram)(hndnand_t *nfl, uint32 off)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ ipt_do_table(struct sk_buff *skb,
ip = ip_hdr(skb);
if (verdict == IPT_CONTINUE)
e = ipt_next_entry(e);
else if (verdict == IPT_RETURN) { // added -- zzz
e = jumpstack[--*stackptr];
if (*stackptr <= origptr) {
e = get_entry(table_base,
private->underflow[hook]);
pr_debug("Underflow (this is normal) "
"to %p\n", e);
} else {
e = jumpstack[--*stackptr];
pr_debug("Pulled %p out from pos %u\n",
e, *stackptr);
e = ipt_next_entry(e);
}
continue;
}
else
/* Verdict */
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ connmark_tg(struct sk_buff *skb, const struct xt_action_param *par)
if (newmark != skb->mark) {
skb->mark = newmark;
}
//return XT_RETURN; // set return here will cause traffic blocked !?
break;
return XT_RETURN;
case XT_CONNMARK_SAVE:
newmark = (ct->mark & ~info->ctmask) ^
(skb->mark & info->nfmask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ ipt_do_table(struct sk_buff *skb,
ip = ip_hdr(skb);
if (verdict == IPT_CONTINUE)
e = ipt_next_entry(e);
else if (verdict == IPT_RETURN) { // added -- zzz
e = jumpstack[--*stackptr];
if (*stackptr <= origptr) {
e = get_entry(table_base,
private->underflow[hook]);
pr_debug("Underflow (this is normal) "
"to %p\n", e);
} else {
e = jumpstack[--*stackptr];
pr_debug("Pulled %p out from pos %u\n",
e, *stackptr);
e = ipt_next_entry(e);
}
continue;
}
else
/* Verdict */
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ connmark_tg(struct sk_buff *skb, const struct xt_action_param *par)
if (newmark != skb->mark) {
skb->mark = newmark;
}
//return XT_RETURN; // set return here will cause traffic blocked !?
break;
return XT_RETURN;
case XT_CONNMARK_SAVE:
newmark = (ct->mark & ~info->ctmask) ^
(skb->mark & info->nfmask);
Expand Down
Binary file added release/src-rt-7.x.main/src/wl/prebuilt/et
Binary file not shown.
Binary file added release/src-rt-7.x.main/src/wl/prebuilt/wl
Binary file not shown.
Loading

0 comments on commit 1b567d7

Please sign in to comment.