与wifi相关的源代码位于/arch/arm/mach_msm/ 、/driver/net/wireless/ 又因为通过SDIO来启动,所以还有代码在/driver/mmc/ 中。
相关的文件必然经过编译的。
在board_msm_7227a.c中
/* Ensure ar6000pm device is registered before MMC/SDC */
msm7x27a_init_ar6000pm();
/* init buffer for atheros wlan while system up */
msm7x27a_init_ath_buf();
static int __init msm7x27a_init_ar6000pm(void)
{
return platform_device_register(&msm_wlan_ar6000_pm_device);
}
static struct platform_device msm_wlan_ar6000_pm_device = {
.name = "wlan_ar6000_pm_dev",
.id = -1,
};
/* allocate atheros scatter buffer while system up */
#define AR6K_SCATTER_REQS 4
#define AR6K_SCATTER_SIZE (18*1024)
static char *ath_scatter_buf[AR6K_SCATTER_REQS];
static int __init msm7x27a_init_ath_buf(void)
{
int i = 0;
pr_err("%s: Enter. \n", __func__);
for (i = 0; i < AR6K_SCATTER_REQS; i ++)
{
ath_scatter_buf[i] = kmalloc(AR6K_SCATTER_SIZE, GFP_KERNEL);
if (ath_scatter_buf[i] == NULL)
{
pr_err("%s: No buffer. \n", __func__);
return -ENOMEM;
}
}
return 0;
}
/* ath_scatter_buf_get: called by ar6005 driver, for get pointer of memory allocated while system up. */
char *ath_scatter_buf_get(int size, int index)
{
if (size > AR6K_SCATTER_SIZE)
{
pr_err("%s: scatter request size=%d, larger than AR6K_SCATTER_SIZE=%d \n", __func__, size, AR6K_SCATTER_SIZE);
return NULL;
}
if (index >= AR6K_SCATTER_REQS)
{
pr_err("%s: scatter request index=%d, larger than AR6K_SCATTER_REQS=%d \n", __func__, index, AR6K_SCATTER_REQS);
return NULL;
}
if (ath_scatter_buf[index] == NULL)
{
pr_err("%s: ath_scatter_buf[index] == NULL, Error Error!. \n", __func__);
return NULL;
}
pr_err("%s: scatter request index=%d, buff addr=0x%p. \n", __func__, index, ath_scatter_buf[index]);
return ath_scatter_buf[index];
}
EXPORT_SYMBOL(ath_scatter_buf_get);
这几段代码删了。
发现之前不断死机重启的毛病没有了!!!! 有时间看看是什么情况···· 现在一切为了wifi~~~~