reference :https://forum.openwrt.org/viewtopic.php?id=43237

reference :http://blog.chinaunix.net/uid-22547469-id-5048943.html

cp  httpd     cus531-16m/  -a

cp  net/httpd.c   cus531-16m/

cp  net/httpd.h   cus531-16m/

修改net.c

#ifdef CONFIG_STATUS_LED

#include <status_led.h>

#include <miiphy.h>

#endif

//add by panzidong

#include "httpd.h"

#include "../httpd/uipopt.h"

#include "../httpd/uip.h"

#include "../httpd/uip_arp.h"

#if (CONFIG_COMMANDS & CFG_CMD_SNTP)

#include "sntp.h"

#endif

#if (CONFIG_COMMANDS & CFG_CMD_NET)

#if 0

#define ET_DEBUG

#endif

// add by panzidong

unsigned char *webfailsafe_data_pointer = NULL;

int     webfailsafe_is_running = 0;

int     webfailsafe_ready_for_upgrade = 0;

int     webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE;

void NetReceiveHttpd(volatile uchar * inpkt, int len);

extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

void

NetReceive(volatile uchar * inpkt, int len)

{

// add by panzidong

if(webfailsafe_is_running){

NetReceiveHttpd(inpkt, len);

return;

}

NetRxPkt = inpkt;

NetRxPktLen = len;

et = (Ethernet_t *)inpkt;

从蓝本的net/net.c中将后面三个函数粘贴到此。以#define BUF ((struct uip_eth_hdr *)&uip_buf[0])开头的那段代码。

增加httpd命令:

./include/net.h

/* Initialize the network adapter */

extern int      NetLoop(proto_t);

//add by panzidong

extern int      NetLoopHttpd(void);

extern void     NetSendHttpd(void);

static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);

// add by panzidong

int do_httpd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){

return NetLoopHttpd();

}

U_BOOT_CMD(httpd, 1, 1, do_httpd, "start www server for firmware recovery\n", NULL);

顶层的Makefiel

board953x_config                :       unconfig

@ >include/config.h

@echo '#define CONFIG_ATHEROS           1'      >include/config.h

@echo '#define CONFIG_MACH_QCA953x      1'      >>include/config.h

@echo '#define CFG_INIT_STACK_IN_SRAM   1'      >>include/config.h

@echo '#define CONFIG_'`echo $(CFG_BOARD_TYPE) | tr [a-z] [A-Z] | sed s/-/_/g`' 1' >>include/config.h

@echo '#define __CONFIG_BOARD_NAME $(CFG_BOARD_TYPE)' >>include/config.h

@echo '#define CONFIG_BOARD_NAME "$(CFG_BOARD_TYPE)"' >>include/config.h

@echo "#define BUILD_VERSION "\"$(BUILDVERSION)\" >>include/config.h

##

## add by panzidong

##

@echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD        3" >> include/config.h

@echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE      5" >> include/config.h

@echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE   7" >> include/config.h

@echo "#define CONFIG_MAX_BUTTON_PRESSING          10" >> include/config.h

Common/main.c

#ifdef CONFIG_SILENT_CONSOLE

DECLARE_GLOBAL_DATA_PTR;

#endif

// add by panzidong

extern int reset_button_status(void);

extern void all_led_on(void);

extern void all_led_off(void);

extern int NetLoopHttpd(void);

extern void udelay(unsigned long usec);

#define milisecdelay(_x)                        udelay((_x) * 1000)

Board/Atheros/board953x.c

// add by panzidong

int reset_button_status(void){

return 0;

}

void all_led_on(void){

}

void all_led_off(void){

}

learning uboot support web http function in qca4531 cpu的更多相关文章

  1. learning uboot how to enable watchdog in qca4531 cpu

    find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...

  2. learning uboot distro design in am335x-evm board

    reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...

  3. Orthogonal Least Squares Learning Algorithm for Radial Basis Function Networks

    Orthogonal Least Squares Learning Algorithm for Radial Basis Function Networks S. Chen, C. F. N. Cow ...

  4. learning uboot auto switch to stanbdy system in qca4531 cpu

    design: when uboot load kerne failed,we can switch to stanbdy system; how to realize: when boot fail ...

  5. learning uboot how to set ddr parameter in qca4531 cpu

    DDR工作频率  在600MHZ. include/configs/board953x.h #define CFG_PLL_FREQ            CFG_PLL_650_600_200 #d ...

  6. learning uboot enable protect console

    reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...

  7. learning uboot test command

    uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...

  8. learning uboot switch to standby system using button

    pseudocode: If(reset_button was pressed ) { Change  uboot env bootslot^1 }

  9. learning uboot source command

    reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...

随机推荐

  1. fatal One or more refs for names blocks change upload

    前言 今天在提代码时,发现push不到gerrit仓库了,十分的奇怪,和同事沟通后发现,同事可以直接git push origin master而且也可以合并,都是没有问题的,但是就是在gerrit上 ...

  2. P4013 数字梯形问题 网络流二十四题

    P4013 数字梯形问题 题目描述 给定一个由 nn 行数字组成的数字梯形如下图所示. 梯形的第一行有 m 个数字.从梯形的顶部的 m 个数字开始,在每个数字处可以沿左下或右下方向移动,形成一条从梯形 ...

  3. POJ1128 Frame Stacking(拓扑排序+dfs)题解

    Description Consider the following 5 picture frames placed on an 9 x 8 array.  ........ ........ ... ...

  4. [IDEA插件] - 一个不错的插件

    今天看到微信平台一篇推送IDEA插件的文章继而下载了个插件看了下. 名字叫做codehelper.generator codehelper.generator http://plugins.jetbr ...

  5. The way to Go(6): Go程序的基本结构和要素

    Reference: Github: Go Github: The way to Go Go程序的基本结构和要素 helloworld.go: package main import "fm ...

  6. 【TCP/IP详解 卷一:协议】第二十四章 TCP的未来与性能

    来到了TCP的最后一个章节,未来与性能.在当时(1991年)的未来,如今已经部分变为现实,部分就只是历史中的实验. 主要内容: 路径MTU的发现与TCP的结合. 长肥管道 和 高速千兆比网络. 窗口扩 ...

  7. 【Coursera】Security Introduction -Eighth Week(1)

    Security Introduction People With Bad Intent 今天,Bob 向 Alice 发送了一条 "Hello,Allice!" 的信息,他们希望 ...

  8. 解决方案:c调用python,PyImport_Import或者PyImport_ImportModule总是返回为空

    下面c_python_utils.h是处理工具函数,test.cpp是测试程序,hello.py是python类 可是当我集成到项目中的时候,PyImport_Import总是返回为空,起初我以为是i ...

  9. 【咖啡の设备】便携式冰滴壶——Dripo 使用体验

    --------------------------------------------2016.12.22 更新------------------------------------------- ...

  10. hdu 5651 xiaoxin juju needs help 逆元 两种求解方式

    xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/ ...