/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
pcmdpriv->cmd_seq = 1;
- pcmdpriv->cmd_allocated_buf = _malloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ);
+ pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
+ GFP_ATOMIC);
if (pcmdpriv->cmd_allocated_buf == NULL)
return _FAIL;
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ -
((addr_t)(pcmdpriv->cmd_allocated_buf) &
(CMDBUFF_ALIGN_SZ-1));
- pcmdpriv->rsp_allocated_buf = _malloc(MAX_RSPSZ + 4);
+ pcmdpriv->rsp_allocated_buf = kmalloc(MAX_RSPSZ + 4, GFP_ATOMIC);
if (pcmdpriv->rsp_allocated_buf == NULL)
return _FAIL;
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
{
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
pevtpriv->event_seq = 0;
- pevtpriv->evt_allocated_buf = _malloc(MAX_EVTSZ + 4);
+ pevtpriv->evt_allocated_buf = kmalloc(MAX_EVTSZ + 4, GFP_ATOMIC);
if (pevtpriv->evt_allocated_buf == NULL)
return _FAIL;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psurveyPara = (struct sitesurvey_parm *)_malloc(
- sizeof(struct sitesurvey_parm));
+ psurveyPara = kmalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC);
if (psurveyPara == NULL) {
kfree((unsigned char *) ph2c);
return _FAIL;
struct setdatarate_parm *pbsetdataratepara;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pbsetdataratepara = (struct setdatarate_parm *)_malloc(
- sizeof(struct setdatarate_parm));
+ pbsetdataratepara = kmalloc(sizeof(struct setdatarate_parm),
+ GFP_ATOMIC);
if (pbsetdataratepara == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct SetChannelPlan_param *psetchplanpara;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetchplanpara = (struct SetChannelPlan_param *)
- _malloc(sizeof(struct SetChannelPlan_param));
+ psetchplanpara = kmalloc(sizeof(struct SetChannelPlan_param),
+ GFP_ATOMIC);
if (psetchplanpara == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct setbasicrate_parm *pssetbasicratepara;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pssetbasicratepara = (struct setbasicrate_parm *)_malloc(
- sizeof(struct setbasicrate_parm));
+ pssetbasicratepara = kmalloc(sizeof(struct setbasicrate_parm),
+ GFP_ATOMIC);
if (pssetbasicratepara == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct writePTM_parm *pwriteptmparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pwriteptmparm = (struct writePTM_parm *)
- _malloc(sizeof(struct writePTM_parm));
+ pwriteptmparm = kmalloc(sizeof(struct writePTM_parm), GFP_ATOMIC);
if (pwriteptmparm == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct writePTM_parm *pwriteptmparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pwriteptmparm = (struct writePTM_parm *)
- _malloc(sizeof(struct setdig_parm));
+ pwriteptmparm = kmalloc(sizeof(struct setdig_parm), GFP_ATOMIC);
if (pwriteptmparm == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct writePTM_parm *pwriteptmparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pwriteptmparm = (struct writePTM_parm *)
- _malloc(sizeof(struct setra_parm));
+ pwriteptmparm = kmalloc(sizeof(struct setra_parm), GFP_ATOMIC);
if (pwriteptmparm == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct writeRF_parm *pwriterfparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pwriterfparm = (struct writeRF_parm *)_malloc(
- sizeof(struct writeRF_parm));
+ pwriterfparm = kmalloc(sizeof(struct writeRF_parm), GFP_ATOMIC);
if (pwriterfparm == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct readRF_parm *prdrfparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- prdrfparm = (struct readRF_parm *)_malloc(sizeof(struct readRF_parm));
+ prdrfparm = kmalloc(sizeof(struct readRF_parm), GFP_ATOMIC);
if (prdrfparm == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
&padapter->registrypriv.dev_network;
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
- pcmd = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ pcmd = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (pcmd == NULL)
return _FAIL;
_init_listhead(&pcmd->list);
network.InfrastructureMode;
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
- pcmd = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ pcmd = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (pcmd == NULL)
return _FAIL;
t_len = sizeof(u32) + 6 * sizeof(unsigned char) + 2 +
struct disconnect_parm *pdisconnect;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- pdisconnect_cmd = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ pdisconnect_cmd = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (pdisconnect_cmd == NULL)
return _FAIL;
- pdisconnect = (struct disconnect_parm *)_malloc(
- sizeof(struct disconnect_parm));
+ pdisconnect = kmalloc(sizeof(struct disconnect_parm), GFP_ATOMIC);
if (pdisconnect == NULL) {
kfree((u8 *)pdisconnect_cmd);
return _FAIL;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetop = (struct setopmode_parm *)_malloc(
- sizeof(struct setopmode_parm));
+ psetop = kmalloc(sizeof(struct setopmode_parm), GFP_ATOMIC);
if (psetop == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct sta_info *sta = (struct sta_info *)psta;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetstakey_para = (struct set_stakey_parm *)_malloc(
- sizeof(struct set_stakey_parm));
+ psetstakey_para = kmalloc(sizeof(struct set_stakey_parm), GFP_ATOMIC);
if (psetstakey_para == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
}
- psetstakey_rsp = (struct set_stakey_rsp *)_malloc(
- sizeof(struct set_stakey_rsp));
+ psetstakey_rsp = kmalloc(sizeof(struct set_stakey_rsp), GFP_ATOMIC);
if (psetstakey_rsp == NULL) {
kfree((u8 *) ph2c);
kfree((u8 *) psetstakey_para);
struct setrfintfs_parm *psetrfintfsparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetrfintfsparm = (struct setrfintfs_parm *)_malloc(
- sizeof(struct setrfintfs_parm));
+ psetrfintfsparm = kmalloc(sizeof(struct setrfintfs_parm), GFP_ATOMIC);
if (psetrfintfsparm == NULL) {
kfree((unsigned char *) ph2c);
return _FAIL;
struct setratable_parm *psetrttblparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetrttblparm = (struct setratable_parm *)_malloc(
- sizeof(struct setratable_parm));
+ psetrttblparm = kmalloc(sizeof(struct setratable_parm), GFP_ATOMIC);
if (psetrttblparm == NULL) {
kfree((unsigned char *)ph2c);
return _FAIL;
struct cmd_obj *ph2c;
struct readTSSI_parm *prdtssiparm;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- prdtssiparm = (struct readTSSI_parm *)
- _malloc(sizeof(struct readTSSI_parm));
+ prdtssiparm = kmalloc(sizeof(struct readTSSI_parm), GFP_ATOMIC);
if (prdtssiparm == NULL) {
kfree((unsigned char *) ph2c);
return _FAIL;
struct cmd_obj *ph2c;
struct SetMacAddr_param *psetMacAddr_para;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetMacAddr_para = (struct SetMacAddr_param *)_malloc(
- sizeof(struct SetMacAddr_param));
+ psetMacAddr_para = kmalloc(sizeof(struct SetMacAddr_param),
+ GFP_ATOMIC);
if (psetMacAddr_para == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
struct set_assocsta_parm *psetassocsta_para;
struct set_assocsta_rsp *psetassocsta_rsp = NULL;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- psetassocsta_para = (struct set_assocsta_parm *)
- _malloc(sizeof(struct set_assocsta_parm));
+ psetassocsta_para = kmalloc(sizeof(struct set_assocsta_parm),
+ GFP_ATOMIC);
if (psetassocsta_para == NULL) {
kfree((u8 *) ph2c);
return _FAIL;
}
- psetassocsta_rsp = (struct set_assocsta_rsp *)_malloc(
- sizeof(struct set_assocsta_rsp));
+ psetassocsta_rsp = kmalloc(sizeof(struct set_assocsta_rsp),
+ GFP_ATOMIC);
if (psetassocsta_rsp == NULL) {
kfree((u8 *)ph2c);
kfree((u8 *)psetassocsta_para);
struct cmd_obj *ph2c;
struct addBaReq_parm *paddbareq_parm;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- paddbareq_parm = (struct addBaReq_parm *)_malloc(
- sizeof(struct addBaReq_parm));
+ paddbareq_parm = kmalloc(sizeof(struct addBaReq_parm), GFP_ATOMIC);
if (paddbareq_parm == NULL) {
kfree((unsigned char *)ph2c);
return _FAIL;
struct drvint_cmd_parm *pdrvintcmd_param;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- pdrvintcmd_param = (struct drvint_cmd_parm *)_malloc(
- sizeof(struct drvint_cmd_parm));
+ pdrvintcmd_param = kmalloc(sizeof(struct drvint_cmd_parm), GFP_ATOMIC);
if (pdrvintcmd_param == NULL) {
kfree((unsigned char *)ph2c);
return _FAIL;
struct DisconnectCtrlEx_param *param;
struct cmd_priv *pcmdpriv = &adapter->cmdpriv;
- ph2c = (struct cmd_obj *)_malloc(sizeof(struct cmd_obj));
+ ph2c = kmalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (ph2c == NULL)
return _FAIL;
- param = (struct DisconnectCtrlEx_param *)
- _malloc(sizeof(struct DisconnectCtrlEx_param));
+ param = kzalloc(sizeof(struct DisconnectCtrlEx_param), GFP_ATOMIC);
if (param == NULL) {
kfree((unsigned char *) ph2c);
return _FAIL;
}
- memset(param, 0, sizeof(struct DisconnectCtrlEx_param));
param->EnableDrvCtrl = (unsigned char)enableDrvCtrl;
param->TryPktCnt = (unsigned char)tryPktCnt;