Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arm/mach-msm/smd_tty.c b/arch/arm/mach-msm/smd_tty.c
- index 1d1802a..de7bb8b 100644
- --- a/arch/arm/mach-msm/smd_tty.c
- +++ b/arch/arm/mach-msm/smd_tty.c
- @@ -20,6 +20,7 @@
- #include <linux/device.h>
- #include <linux/wait.h>
- #include <linux/wakelock.h>
- +#include <linux/delay.h>
- #include <linux/tty.h>
- #include <linux/tty_driver.h>
- @@ -27,6 +28,7 @@
- #include <mach/msm_smd.h>
- #include <mach/amss_para.h>
- +#include "board-htcleo.h"
- #define MAX_SMD_TTYS 32
- @@ -197,8 +199,11 @@ static int smd_tty_write(struct tty_struct *tty,
- const unsigned char *buf, int len)
- {
- struct smd_tty_info *info = tty->driver_data;
- - int avail;
- - int ret;
- + int avail, ret, runfix=0;
- + static int init=0;
- + const unsigned char* firstcall="AT@BRIC=0\r";
- + const unsigned char* secondcall="AT+COPS=2\r";
- + unsigned int call_len;
- /* if we're writing to a packet channel we will
- ** never be able to write more data than there
- @@ -207,10 +212,32 @@ static int smd_tty_write(struct tty_struct *tty,
- #ifndef CONFIG_MACH_HTCLEO
- mutex_lock(&smd_tty_lock);
- #endif
- + if(len>7 && !init && htcleo_is_nand_boot()) {
- + if(strncmp(buf, "AT+CFUN", 7)==0) {
- + pr_info("SMD AT FIX!\n");
- + call_len = strlen(firstcall);
- + avail = smd_write_avail(info->ch);
- + if (call_len > avail)
- + call_len = avail;
- + ret = smd_write(info->ch, firstcall, call_len);
- + init=1;
- + runfix=1;
- + msleep(100);
- + }
- + }
- avail = smd_write_avail(info->ch);
- if (len > avail)
- len = avail;
- ret = smd_write(info->ch, buf, len);
- + if(runfix) {
- + msleep(100);
- + pr_info("SMD AT FIX2!\n");
- + call_len = strlen(secondcall);
- + avail = smd_write_avail(info->ch);
- + if (call_len > avail)
- + call_len = avail;
- + ret = smd_write(info->ch, secondcall, call_len);
- + }
- #ifndef CONFIG_MACH_HTCLEO
- mutex_unlock(&smd_tty_lock);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement