{
int res = _SUCCESS;
- pcmdpriv->cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
- GFP_KERNEL);
-
- if (pcmdpriv->cmd_allocated_buf == NULL) {
- res = _FAIL;
- goto exit;
- }
-
- pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ -
- ((unsigned long)(pcmdpriv->cmd_allocated_buf) &
- (CMDBUFF_ALIGN_SZ - 1));
-
pcmdpriv->rsp_allocated_buf = kzalloc(MAX_RSPSZ + 4, GFP_KERNEL);
if (!pcmdpriv->rsp_allocated_buf) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_,
("rtw_free_cmd_priv23a\n"));
- if (pcmdpriv) {
- kfree(pcmdpriv->cmd_allocated_buf);
+ if (pcmdpriv)
kfree(pcmdpriv->rsp_allocated_buf);
- }
}
static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
void (*pcmd_callback)(struct rtw_adapter *dev, struct cmd_obj *pcmd);
struct cmd_priv *pcmdpriv;
struct cmd_obj *pcmd = container_of(work, struct cmd_obj, work);
- u8 *pcmdbuf;
pcmdpriv = &pcmd->padapter->cmdpriv;
- pcmdbuf = pcmdpriv->cmd_buf;
if (rtw_cmd_filter(pcmdpriv, pcmd) == _FAIL) {
pcmd->res = H2C_DROPPED;
pcmd->cmdsz = ALIGN(pcmd->cmdsz, 4);
- memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
-
if (pcmd->cmdcode < (sizeof(wlancmds)/sizeof(struct cmd_hdl))) {
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
if (cmd_hdl)
- pcmd->res = cmd_hdl(pcmd->padapter, pcmdbuf);
+ pcmd->res = cmd_hdl(pcmd->padapter, pcmd->parmbuf);
else
pcmd->res = H2C_DROPPED;
} else