[Feature][ZXW-76]merged P48U04 base code
Change-Id: Ia14632a24eb4e8ddf720d8f53f2fe3a1b52a0a8e
diff --git a/ap/app/Script/scripts/internet.sh b/ap/app/Script/scripts/internet.sh
index b9ff044..95a56b4 100755
--- a/ap/app/Script/scripts/internet.sh
+++ b/ap/app/Script/scripts/internet.sh
@@ -9,6 +9,13 @@
echo "Info: internet.sh start" > $test_log
echo "Info: `date +%m-%d %H:%M:%S`" >> $test_log
+#CONFIG_BRIDGE_IGMP_SNOOPING¿ª¹Ø
+br_multi_off=`nv get br_multi_off`
+echo "Info: set br_multi_off: $br_multi_off" >> $test_log
+if [ "-$br_multi_off" == "-1" ]; then
+ echo 1 > /proc/net/br_multi_off
+fi
+
genSysFiles()
{
login=`nv get Login`
@@ -88,17 +95,17 @@
#½«¿ìËÙת·¢¼¶±ð´«¸øÄÚºË
fastnat_level=`nv get fastnat_level`
-echo "Info: set fastnat_level£º$fastnat_level" >> $test_log
+echo "Info: set fastnat_level: $fastnat_level" >> $test_log
echo $fastnat_level > /proc/net/fastnat_level
#½«²»Ö§³Ö¿ìËÙת·¢µÄÐÒé¶Ë¿ÚºÅ´«¸øÄÚºË
nofast_port=`nv get nofast_port`
-echo "Info: set nofast_port£º$nofast_port" >> $test_log
+echo "Info: set nofast_port: $nofast_port" >> $test_log
echo $nofast_port > /proc/net/nofast_port
#SKB debug¿ª¹Ø
skb_debug=`nv get skb_debug`
-echo "Info: set skb_debug£º$skb_debug" >> $test_log
+echo "Info: set skb_debug: $skb_debug" >> $test_log
if [ "-$skb_debug" != "-1" ]; then
echo 0 > /proc/net/skb_debug_off
fi
diff --git a/ap/app/Script/scripts/psext_updown.sh b/ap/app/Script/scripts/psext_updown.sh
index 890a6f1..56f4103 100755
--- a/ap/app/Script/scripts/psext_updown.sh
+++ b/ap/app/Script/scripts/psext_updown.sh
@@ -277,7 +277,7 @@
get_netmask_btrunk $pdp_ip
fi
- ifconfig $ps_if $ps_ip up 2>>$test_log
+ ifconfig $ps_if $ps_ip netmask 255.255.255.0 up 2>>$test_log
if [ $? -ne 0 ];then
echo "Error: ifconfig $ps_if $ps_ip up failed." >> $test_log
fi
diff --git a/ap/app/Script/scripts/wan_ipv4.sh b/ap/app/Script/scripts/wan_ipv4.sh
index e5f7446..e4c5a40 100755
--- a/ap/app/Script/scripts/wan_ipv4.sh
+++ b/ap/app/Script/scripts/wan_ipv4.sh
@@ -113,7 +113,7 @@
if [ $? -ne 0 ];then
echo "Error: ifconfig $wan_if down failed." >> $test_log
fi
- ifconfig $wan_if $pswan_ip up 2>>$test_log
+ ifconfig $wan_if $pswan_ip netmask 255.255.255.0 up 2>>$test_log
if [ $? -ne 0 ];then
echo "Error: ifconfig $wan_if $pswan_ip up failed." >> $test_log
fi
diff --git a/ap/lib/libatext/ext_dev_func.c b/ap/lib/libatext/ext_dev_func.c
index 24cbc83..3b442e4 100755
--- a/ap/lib/libatext/ext_dev_func.c
+++ b/ap/lib/libatext/ext_dev_func.c
@@ -329,7 +329,6 @@
int ate_req_rcv_act(char *at_paras,int at_fd,struct at_context *context)
{
int32_t setResult = 0;
- char strAtReplyCmd[AT_CMD_MAX] = {0};
if(atoi(at_paras) == 0 || atoi(at_paras) == 1)
{
@@ -347,9 +346,8 @@
setResult = vFnPortEchoType(at_fd, OPENECHO);
if(setResult != 0)
- {
- sprintf(strAtReplyCmd,"\r\nERROR: %d\r\n", setResult);
- at_write(at_fd, strAtReplyCmd, strlen(strAtReplyCmd));
+ {
+ at_write(at_fd, "\r\nERROR\r\n", strlen("\r\nERROR\r\n"));
}
else
{
diff --git a/ap/lib/libatext/ext_locknet.c b/ap/lib/libatext/ext_locknet.c
index efe68a0..d4372b8 100755
--- a/ap/lib/libatext/ext_locknet.c
+++ b/ap/lib/libatext/ext_locknet.c
@@ -3,74 +3,122 @@
int ext_LocklistAuth_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKLISTAUTH_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
- return AT_CONTINUE;
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKLISTAUTH_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
+ return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetList_set_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetKey_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETKEY_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETKEY_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetAmtStatus_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAMTSTATUS_GET_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAMTSTATUS_GET_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetDigest_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETDIGEST_GET_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETDIGEST_GET_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetSign_set_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSIGN_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSIGN_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetLevel_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLEVEL_GET_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLEVEL_GET_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetList_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_GET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_GET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetAuth_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAUTH_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAUTH_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetUnlockTimes_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCKTIMES_GET_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCKTIMES_GET_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetStatus_get_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSTATUS_GET_REQ, 0, NULL,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSTATUS_GET_REQ, 0, NULL,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
int ext_LocknetUnlock_func(char *at_paras, void ** res_msg)
{
- ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCK_REQ,strlen(at_paras), (unsigned char *)at_paras,0);
+ if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCK_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
return AT_CONTINUE;
+ else{
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ return AT_END;
+ }
}
//ÊÕµ½zudryÖ÷¶¯Éϱ¨ÃüÁîºó£¬Ï·¢AT+ZSCHPLMN=1ʹmodemÔÊÐíËÑÍø(¸ÃÃüÁîÊÇÔÚËøÍø¹¦ÄÜÖÐʹÓÃ)
diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/Makefile b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/Makefile
old mode 100644
new mode 100755
index e9d2669..1d079c1
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/Makefile
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/Makefile
@@ -27,7 +27,7 @@
ifeq ($(USE_BTRUNK_SUPPORT),yes)
obj-y += hal_xp2xp.o
else
-ifeq ($(USE_VEHICLE_DC),yes)
+ifeq ($(USE_VEHICLE),yes)
obj-y += hal_xp2xp.o
endif
diff --git a/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-adc.c b/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-adc.c
old mode 100644
new mode 100755
index af82c3d..b15d08c
--- a/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-adc.c
+++ b/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-adc.c
@@ -354,10 +354,7 @@
int index=0;
int tmpValue=0,totalValue=0;
uint avgValue;
-#ifdef _USE_VEHICLE_DC
- printk("%s adc not support in ap\n",__func__);
- return 0;
-#endif
+
for(index = 0; index < counter; index++)
{
zx234290_adc_read(ADC_CHANNEL_VBAT_ADC, &tmpValue);
@@ -387,10 +384,7 @@
int index=0;
int tmpValue=0,totalValue=0;
uint avgValue;
-#ifdef _USE_VEHICLE_DC
- printk("%s adc not support in ap\n",__func__);
- return 0;
-#endif
+
for(index = 0; index < counter; index++)
{
zx234290_adc_read(ADC_CHANNEL_VADC1, &tmpValue);
@@ -421,10 +415,7 @@
int index=0;
int tmpValue=0,totalValue=0;
uint avgValue;
-#ifdef _USE_VEHICLE_DC
- printk("%s adc not support in ap\n",__func__);
- return 0;
-#endif
+
//wake_lock(&adc_wake_lock);
for(index = 0; index < counter; index++)
{
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
old mode 100644
new mode 100755
index b2ed27e..ff872df
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
@@ -38,9 +38,7 @@
struct adb_dev *g_adb_agent;
ssize_t adb_server_write2usb( const char *buf,size_t count);
extern void usb_rpmsg_notify_ap(usb_rpmsg_cmd *notify, int has_param);
-//xf.li@20230614 add for adb offline start
extern int usb_get_adb_agent(void);
-//xf.li@20230614 add for adb offline end
void adb_recv_from_ap(void *buf, unsigned int len)
{
@@ -184,10 +182,12 @@
if (!g_adb_agent)
return -1;
- T_ZDrvRpMsg_Msg *rpmsg = &g_adb_agent->rpmsg_tx;
-
- rpmsg->flag = 0;
- rpmsg->flag |= 1;
+ T_ZDrvRpMsg_Msg rpmsg = {0};
+
+ rpmsg.actorID = CAP_ID;
+ rpmsg.chID = ADB_RPMSG_CH;
+ rpmsg.flag = 0;
+ rpmsg.flag |= 1;
USBSTACK_DBG("adb_rpmsg_write2ap datalen:%d\n", len);
#if 0
if(len && len < 32){
@@ -201,8 +201,8 @@
}
#endif
if(len == 0){//just send notify
- rpmsg->len = len;
- ret = zDrvRpMsg_Write_Cap(&g_adb_agent->rpmsg_tx);
+ rpmsg.len = len;
+ ret = zDrvRpMsg_Write_Cap(&rpmsg);
if(ret < 0)
printk("adb_rpmsg_write2ap notify send fail, ret:%d\n", ret);
return ret;
@@ -211,11 +211,11 @@
while(total_cnt){
transfer_cnt = total_cnt > ADB_RPMSG_MAX_SIZE ? ADB_RPMSG_MAX_SIZE: total_cnt;
memcpy(g_adb_agent->rx2agt_buf, tmp, transfer_cnt);
- rpmsg->len = transfer_cnt;
- rpmsg->buf = g_adb_agent->rx2agt_buf;
+ rpmsg.len = transfer_cnt;
+ rpmsg.buf = g_adb_agent->rx2agt_buf;
atomic_set(&g_adb_agent->write_busy, 1);
- ret = zDrvRpMsg_Write_Cap(&g_adb_agent->rpmsg_tx);
- if(rpmsg->len != ret){
+ ret = zDrvRpMsg_Write_Cap(&rpmsg);
+ if(rpmsg.len != ret){
atomic_set(&g_adb_agent->write_busy, 0);
printk("[adb_rpmsg_write2ap] msg send error:(%d)", ret);
return ret;
@@ -422,7 +422,7 @@
ret = wait_event_interruptible(dev->agent_monitor_wq,
(atomic_read(&dev->agent_switch) ||kthread_should_stop()));
if (ret < 0) {
- printk("monitor_thread wait fail\n");
+ USBSTACK_DBG("monitor_thread wait fail\n");
//return ret;
continue;
}
@@ -443,11 +443,9 @@
//wakeup adb read and return
//dev->rx_done = 1;
//wake_up(&dev->read_wq);
- //xf.li@20230614 add for adb offline start
if (atomic_read(&dev->read_excl)){
adb_agent_dequeue_rx(dev);
}
- //xf.li@20230614 add for adb offline end
}else{
//dev->agent_start = 0;
//disable agent
@@ -486,19 +484,23 @@
return 0;
}
EXPORT_SYMBOL_GPL(adb_enable_rpmsg_agent);
-//xf.li@20230614 add for adb offline start
+
+
void adb_agent_switch_work(struct work_struct *work)
{
struct adb_dev *dev = container_of(work, struct adb_dev, agent_switch_work);
+
if(usb_get_adb_agent() == 1){
printk("agent_switch_work, switch to CAP\n");
adb_enable_rpmsg_agent(1);
return;
}
+
printk("agent_switch_work, switch to AP\n");
adb_enable_rpmsg_agent(0);
+
}
-//xf.li@20230614 add for adb offline end
+
void adb_rpmsg_recv_thread(void *ptr)
{
@@ -534,7 +536,7 @@
req->length = ADB_BULK_BUFFER_SIZE;
dev->rx_done = 0;
if(!dev->online){
- printk("rpmsg_recv dev is offline\n");
+ USBSTACK_DBG("rpmsg_recv dev is offline\n");
r = -EIO;
goto done;
}
@@ -568,21 +570,21 @@
dev->agt_error = 1;
r = ret;
usb_ep_dequeue(dev->ep_out, req);
- USBSTACK_DBG("rpmsg_recv stop ret: 0x%x", ret);
+ printk("rpmsg_recv stop ret: 0x%x", ret);
goto done;
}
if (!dev->agt_error) {
if(!dev->online){
- printk("rpmsg_recv dev is offline cannot requeue req\n");
+ USBSTACK_DBG("rpmsg_recv dev is offline cannot requeue req\n");
r = -EIO;
goto done;
}
/* If we got a 0-len packet, throw it back and try again. */
if (req->actual == 0){
- printk("rpmsg_recv actual is 0, requeue_req again\n");
+ USBSTACK_DBG("rpmsg_recv actual is 0, requeue_req again\n");
goto requeue_req;
}
- printk("rpmsg_recv rx %p actual:%d\n", req, req->actual);
+ //printk("rpmsg_recv rx %p actual:%d\n", req, req->actual);
xfer = req->actual;
r = adb_rpmsg_write2ap(req->buf, xfer);
@@ -593,11 +595,11 @@
goto requeue_req;
} else{
if(dev->agent_start){
- printk("rpmsg_recv fail ,len:%d, status:%d\n", req->actual, req->status);
+ USBSTACK_DBG("rpmsg_recv fail ,len:%d, status:%d\n", req->actual, req->status);
r = -EIO;
dev->rx_done = 0;
}else{
- printk("adb_rpmsg_write wake_up agt_read_wq, len:%d, status:%d\n", req->actual, req->status);
+ USBSTACK_DBG("adb_rpmsg_write wake_up agt_read_wq, len:%d, status:%d\n", req->actual, req->status);
wake_up(&dev->agt_read_wq);
}
@@ -629,9 +631,7 @@
init_waitqueue_head(&dev->agt_read_wq);
init_waitqueue_head(&dev->agt_write_wq);
INIT_WORK(&dev->agent_inform_work, adb_agent_inform_work);
-//xf.li@20230614 add for adb offline start
INIT_DELAYED_WORK(&dev->agent_switch_work, adb_agent_switch_work);
-//xf.li@20230614 add for adb offline end
atomic_set(&dev->agent_switch, 0);
atomic_set(&dev->write_busy, 0);
atomic_set(&dev->agt_read_flag, 0);
@@ -655,9 +655,6 @@
dev->agent_monitor_thread = kthread_run(adb_agent_monitor_thread, (unsigned long)dev+1, "adb_agent_monitor");
BUG_ON(IS_ERR(dev->agent_monitor_thread));
g_adb_agent = dev;
- g_adb_agent->rpmsg_tx.actorID = CAP_ID;
- g_adb_agent->rpmsg_tx.chID = ADB_RPMSG_CH;
- //g_adb_agent->rpmsg_tx.flag= 0x1;
//alloc 512
g_adb_agent->rx2agt_buf = kmalloc(ADB_BULK_BUFFER_SIZE, GFP_KERNEL);
if(!g_adb_agent->rx2agt_buf){
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
old mode 100644
new mode 100755
index 75825ef..9561ca8
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
@@ -38,9 +38,8 @@
extern int adb_rpmsg_write2ap(void *buf, unsigned int len);
extern int adb_agent_close(void);
extern void adb_server_plug_notify(e_usb_rpmsg_cmd_type plug_type);
-//xf.li@20230614 add for adb offline start
extern int usb_get_adb_agent(void);
-//xf.li@20230614 add for adb offline end
+
#endif
static const char adb_shortname[] = "android_adb";
@@ -73,7 +72,6 @@
atomic_t agt_read_flag;
atomic_t adb_read_flag;
int agt_error;
- T_ZDrvRpMsg_Msg rpmsg_tx;
char *rx2agt_buf;
struct task_struct *rpmsg_thread;
struct task_struct *agent_monitor_thread;
@@ -324,18 +322,20 @@
int ret;
USBSTACK_DBG("adb_read enter(%d)\n", count);
- if (!_adb_dev)
+ if (!_adb_dev){
+ USBSTACK_DBG("adb_read: _adb_dev is NULL\n");
return -ENODEV;
-
+ }
if (count > ADB_BULK_BUFFER_SIZE)
return -EINVAL;
- if (adb_lock(&dev->read_excl))
+ if (adb_lock(&dev->read_excl)){
+ USBSTACK_DBG("adb_read: read_excl lock fail, \n");
return -EBUSY;
-
+ }
/* we will block until we're online */
while (!(dev->online || dev->error)) {
- pr_debug("adb_read: waiting for online state\n");
+ USBSTACK_DBG("adb_read: waiting for online state\n");
ret = wait_event_interruptible(dev->read_wq,
(dev->online || dev->error));
if (ret < 0) {
@@ -554,7 +554,7 @@
printk("---adb_open, switch to cap\n");
schedule_delayed_work(&_adb_dev->agent_switch_work, 200);
}
-#endif
+#endif
USBSTACK_DBG("%s", __func__);
if (adb_lock(&_adb_dev->open_excl)){
printk("\n adb_open,open_excl:%d\n", atomic_read(&_adb_dev->open_excl));
@@ -570,16 +570,13 @@
if(atomic_read(&_adb_dev->enable_excl)){
_adb_dev->online = 1;
wake_up(&_adb_dev->read_wq);
-//xf.li@20230614 add for adb offline start
}else{
-
adb_unlock(&_adb_dev->open_excl);
return -ENODEV;
-//xf.li@20230614 add for adb offline end
}
usb_record_dbginfo(USB_DEV_OPEN, 0, 3);
- printk("\n adb_open--ok--exit\n");
+ printk("\n adb_open--ok--exit,online:%d\n", _adb_dev->online);
return 0;
}
@@ -747,6 +744,7 @@
return 0;
if(atomic_read(&dev->open_excl)==1){
+ printk("adb_function_set_alt, adb open, and set online \n");
dev->online = 1;
dev->error= 0;
/* readers may be blocked waiting for us to go online */
diff --git a/ap/os/linux/linux-3.4.x/net/bridge/br_forward.c b/ap/os/linux/linux-3.4.x/net/bridge/br_forward.c
old mode 100644
new mode 100755
index 36cde04..b3dc65f
--- a/ap/os/linux/linux-3.4.x/net/bridge/br_forward.c
+++ b/ap/os/linux/linux-3.4.x/net/bridge/br_forward.c
@@ -267,6 +267,8 @@
void br_multicast_deliver(struct net_bridge_mdb_entry *mdst,
struct sk_buff *skb)
{
+ if(br_multicast_off)
+ return;
br_multicast_flood(mdst, skb, NULL, __br_deliver);
}
@@ -274,6 +276,8 @@
void br_multicast_forward(struct net_bridge_mdb_entry *mdst,
struct sk_buff *skb, struct sk_buff *skb2)
{
+ if(br_multicast_off)
+ return;
br_multicast_flood(mdst, skb, skb2, __br_forward);
}
#endif
diff --git a/ap/os/linux/linux-3.4.x/net/bridge/br_multicast.c b/ap/os/linux/linux-3.4.x/net/bridge/br_multicast.c
old mode 100644
new mode 100755
index 87ae8c3..548920d
--- a/ap/os/linux/linux-3.4.x/net/bridge/br_multicast.c
+++ b/ap/os/linux/linux-3.4.x/net/bridge/br_multicast.c
@@ -38,7 +38,7 @@
static void br_multicast_add_router(struct net_bridge *br,
struct net_bridge_port *port);
-
+int br_multicast_off = 0;
#if IS_ENABLED(CONFIG_IPV6)
static inline int ipv6_is_transient_multicast(const struct in6_addr *addr)
{
@@ -140,6 +140,8 @@
struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
struct sk_buff *skb)
{
+ if(br_multicast_off)
+ return NULL;
struct net_bridge_mdb_htable *mdb = rcu_dereference(br->mdb);
struct br_ip ip;
@@ -226,6 +228,8 @@
static void br_multicast_group_expired(unsigned long data)
{
+ if(br_multicast_off)
+ return;
struct net_bridge_mdb_entry *mp = (void *)data;
struct net_bridge *br = mp->br;
struct net_bridge_mdb_htable *mdb;
@@ -287,6 +291,8 @@
static void br_multicast_port_group_expired(unsigned long data)
{
+ if(br_multicast_off)
+ return;
struct net_bridge_port_group *pg = (void *)data;
struct net_bridge *br = pg->port->br;
@@ -725,6 +731,8 @@
static void br_multicast_router_expired(unsigned long data)
{
+ if(br_multicast_off)
+ return;
struct net_bridge_port *port = (void *)data;
struct net_bridge *br = port->br;
@@ -793,6 +801,8 @@
static void br_multicast_port_query_expired(unsigned long data)
{
+ if(br_multicast_off)
+ return;
struct net_bridge_port *port = (void *)data;
struct net_bridge *br = port->br;
@@ -814,6 +824,8 @@
void br_multicast_add_port(struct net_bridge_port *port)
{
+ if(br_multicast_off)
+ return;
port->multicast_router = 1;
setup_timer(&port->multicast_router_timer, br_multicast_router_expired,
@@ -824,6 +836,8 @@
void br_multicast_del_port(struct net_bridge_port *port)
{
+ if(br_multicast_off)
+ return;
del_timer_sync(&port->multicast_router_timer);
}
@@ -839,7 +853,8 @@
void br_multicast_enable_port(struct net_bridge_port *port)
{
struct net_bridge *br = port->br;
-
+ if(br_multicast_off)
+ return;
spin_lock(&br->multicast_lock);
if (br->multicast_disabled || !netif_running(br->dev))
goto out;
@@ -857,7 +872,8 @@
struct net_bridge *br = port->br;
struct net_bridge_port_group *pg;
struct hlist_node *p, *n;
-
+ if(br_multicast_off)
+ return;
spin_lock(&br->multicast_lock);
hlist_for_each_entry_safe(pg, p, n, &port->mglist, mglist)
br_multicast_del_pg(br, pg);
@@ -1522,6 +1538,8 @@
int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port,
struct sk_buff *skb)
{
+ if(br_multicast_off)
+ return 0;
BR_INPUT_SKB_CB(skb)->igmp = 0;
BR_INPUT_SKB_CB(skb)->mrouters_only = 0;
@@ -1543,7 +1561,8 @@
static void br_multicast_query_expired(unsigned long data)
{
struct net_bridge *br = (void *)data;
-
+ if(br_multicast_off)
+ return;
spin_lock(&br->multicast_lock);
if (br->multicast_startup_queries_sent <
br->multicast_startup_query_count)
@@ -1556,6 +1575,8 @@
void br_multicast_init(struct net_bridge *br)
{
+ if(br_multicast_off)
+ return;
br->hash_elasticity = 4;
br->hash_max = 512;
@@ -1581,6 +1602,8 @@
void br_multicast_open(struct net_bridge *br)
{
+ if(br_multicast_off)
+ return;
br->multicast_startup_queries_sent = 0;
if (br->multicast_disabled)
@@ -1596,7 +1619,8 @@
struct hlist_node *p, *n;
u32 ver;
int i;
-
+ if(br_multicast_off)
+ return;
del_timer_sync(&br->multicast_router_timer);
del_timer_sync(&br->multicast_querier_timer);
del_timer_sync(&br->multicast_query_timer);
diff --git a/ap/os/linux/linux-3.4.x/net/bridge/br_private.h b/ap/os/linux/linux-3.4.x/net/bridge/br_private.h
old mode 100644
new mode 100755
index 6822ef1..bfb0f3d
--- a/ap/os/linux/linux-3.4.x/net/bridge/br_private.h
+++ b/ap/os/linux/linux-3.4.x/net/bridge/br_private.h
@@ -421,8 +421,11 @@
extern int br_multicast_toggle(struct net_bridge *br, unsigned long val);
extern int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val);
+extern int br_multicast_off;
static inline bool br_multicast_is_router(struct net_bridge *br)
{
+ if(br_multicast_off)
+ return 0;
return br->multicast_router == 2 ||
(br->multicast_router == 1 &&
timer_pending(&br->multicast_router_timer));
diff --git a/ap/os/linux/linux-3.4.x/net/core/fastproc/fast_track.c b/ap/os/linux/linux-3.4.x/net/core/fastproc/fast_track.c
index 1ae104b..c118526 100755
--- a/ap/os/linux/linux-3.4.x/net/core/fastproc/fast_track.c
+++ b/ap/os/linux/linux-3.4.x/net/core/fastproc/fast_track.c
@@ -1112,6 +1112,7 @@
const char __user *buffer, size_t count, loff_t *pos)
{
skb_debug_off();
+ printk("skb_debug_off\n");
return count;
}
@@ -1195,6 +1196,20 @@
.write = skb_debug_off_set,
};
+extern int br_multicast_off;
+static ssize_t br_multicast_off_set(struct file *file,
+ const char __user *buffer, size_t count, loff_t *pos)
+{
+ br_multicast_off = 1;
+ printk("br_multicast_off\n");
+ return count;
+}
+
+static const struct file_operations br_multicast_off_file_ops = {
+ .owner = THIS_MODULE,
+ .write = br_multicast_off_set,
+};
+
//¿ìËÙת·¢procÎļþµÄ³õʼ»¯
int fast_conntrack_init_proc(void)
{
@@ -1227,6 +1242,10 @@
//turn off skb debug
proc_create("skb_debug_off", 0440, init_net.proc_net, &skb_debug_off_file_ops);
+
+ //turn off br multicast
+ proc_create("br_multi_off", 0440, init_net.proc_net, &br_multicast_off_file_ops);
+
return 1;
}