n_gsm.c: Enhancement of gsm_mux TX/RX buf allocate
authorxiaojin <jin.xiao@intel.com>
Thu, 19 Apr 2012 00:49:38 +0000 (08:49 +0800)
committerbuildbot <buildbot@intel.com>
Thu, 26 Apr 2012 13:07:51 +0000 (06:07 -0700)
commitd2d8d2f89672ec1a4bac47382e7da7185a530932
treeb22db0b896524230900efbba9bc2117c2fafd318
parentd923ab69f634fc7df9897f21a0dc566b9dc4fab4
n_gsm.c: Enhancement of gsm_mux TX/RX buf allocate

BZ: 28510

In LEX platform, we found huge kmalloc fail if repeated gsmld open and close
that trigged by stmd(userspace) or modem reset.

LEX memory size is 512M, only the half of Medfield.

Enhancement:
1. gsm_mux buf/txframe allocation moved to gsmld_config, according to mtu/mru of cfg
2. if encoding ==0, txframe allocate one mtu; otherwise allocate double mtu
3. if allocation size less than PAGE, use kmalloc; otherwise use vmalloc

This patch is part of the solution to TX/RX buffer allocate fail.
We also need to change mtu/mru in STMD, it should matched to N1 of AT+CMUX.
N1(Maximum Frame Size) of modem is 1509 now.

Signed-off-by: xiaojin <jin.xiao@intel.com>
Change-Id: I928f9943bce17c065e070750ccf6648d577b17ff
Reviewed-on: http://android.intel.com:8080/43942
Reviewed-by: Stoltz-douchet, OlivierX <olivierx.stoltz-douchet@intel.com>
Reviewed-by: Pillet, VincentX <vincentx.pillet@intel.com>
Reviewed-by: Xiao, Jin <jin.xiao@intel.com>
Reviewed-by: Roulliere, Pierre <pierre.roulliere@intel.com>
Reviewed-by: Liu, Chuansheng <chuansheng.liu@intel.com>
Reviewed-by: Predon, Frederic <frederic.predon@intel.com>
Reviewed-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: Lebsir, SamiX <samix.lebsir@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/n_gsm.c