}
if (ielen) {
- buf = rtw_zmalloc(ielen);
+ buf = kzalloc(ielen, GFP_KERNEL);
if (buf == NULL) {
ret = -ENOMEM;
goto exit;
phead = get_list_head(queue);
pmlmepriv->pscanned = phead->next;
- while (1) {
- if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true)
- break;
-
+ while (phead != pmlmepriv->pscanned) {
pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
pmlmepriv->pscanned = pmlmepriv->pscanned->next;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist))
- break;
-
+ while (phead != plist) {
if ((stop - ev) < SCAN_ITEM_SIZE) {
ret = -E2BIG;
break;
phead = get_list_head(queue);
pmlmepriv->pscanned = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == true) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_warning_,
- ("rtw_wx_set_essid: scan_q is empty, set ssid to check if scanning again!\n"));
-
- break;
- }
-
+ while (phead != pmlmepriv->pscanned) {
pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
pmlmepriv->pscanned = pmlmepriv->pscanned->next;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (hwaddr_aton_i(data, bssid)) {
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 2011/05/18 */
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 20121226 */
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
-
+ while (phead != plist) {
pnetwork = container_of(plist, struct wlan_network, list);
/* Commented by Albert 2011/05/18 */
phead = get_list_head(queue);
plist = phead->next;
- while (1) {
- if (rtw_end_of_queue_search(phead, plist) == true)
- break;
+ while (phead != plist) {
if (uintPeerChannel != 0)
break;
phead = &(pstapriv->sta_hash[i]);
plist = phead->next;
- while ((rtw_end_of_queue_search(phead, plist)) == false) {
+ while (phead != plist) {
psta = container_of(plist, struct sta_info, hash_list);
plist = plist->next;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS;
- ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
+ ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (ph2c == NULL) {
res = _FAIL;
goto exit;
}
- psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
+ psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_KERNEL);
if (psetstakey_para == NULL) {
kfree(ph2c);
res = _FAIL;
DBG_88E("%s\n", __func__);
- pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
+ pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd == NULL) {
res = _FAIL;
goto exit;
}
- psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
+ psetkeyparm = kzalloc(sizeof(struct setkey_parm), GFP_KERNEL);
if (psetkeyparm == NULL) {
kfree(pcmd);
res = _FAIL;
pcmd->rsp = NULL;
pcmd->rspsz = 0;
- _rtw_init_listhead(&pcmd->list);
+ INIT_LIST_HEAD(&pcmd->list);
res = rtw_enqueue_cmd(pcmdpriv, pcmd);
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (psta) {
spin_lock_bh(&pstapriv->asoc_list_lock);
- if (!rtw_is_list_empty(&psta->asoc_list)) {
+ if (!list_empty(&psta->asoc_list)) {
rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
pEfuseHal = &haldata->EfuseHal;
err = 0;
- data = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
+ data = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
if (data == NULL) {
err = -ENOMEM;
goto exit;
}
- rawdata = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
+ rawdata = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
if (rawdata == NULL) {
err = -ENOMEM;
goto exit;
haldata = GET_HAL_DATA(padapter);
pEfuseHal = &haldata->EfuseHal;
err = 0;
- setdata = _rtw_zmalloc(1024);
+ setdata = kzalloc(1024, GFP_KERNEL);
if (setdata == NULL) {
err = -ENOMEM;
goto exit;
struct iw_request_info *info,
struct iw_point *wrqu, char *extra)
{
- u32 rate = MPT_RATE_1M;
+ unsigned long rate = MPT_RATE_1M;
char *input = kmalloc(wrqu->length, GFP_KERNEL);
struct adapter *padapter = rtw_netdev_priv(dev);
+ int status;
if (!input)
return -ENOMEM;
kfree(input);
return -EFAULT;
}
- rate = rtw_atoi(input);
- sprintf(extra, "Set data rate to %d", rate);
+
+ status = kstrtoul(input, 0, &rate);
+ if (status)
+ return status;
+
+ sprintf(extra, "Set data rate to %lu", rate);
kfree(input);
if (rate <= 0x7f)
rate = wifirate2_ratetbl_inx((u8)rate);
struct iw_point *wrqu, char *extra)
{
struct adapter *padapter = rtw_netdev_priv(dev);
- char *input = kmalloc(wrqu->length, GFP_KERNEL);
- u32 channel = 1;
+ char *input = kmalloc(wrqu->length, GFP_KERNEL);
+ unsigned long channel = 1;
+ int status;
if (!input)
return -ENOMEM;
kfree(input);
return -EFAULT;
}
- channel = rtw_atoi(input);
- sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel, channel);
+
+ status = kstrtoul(input, 0, &channel);
+ if (status)
+ return status;
+
+ sprintf(extra, "Change channel %d to channel %lu", padapter->mppriv.channel, channel);
padapter->mppriv.channel = channel;
Hal_SetChannel(padapter);
DBG_88E("+%s\n", __func__);
len = wrqu->data.length;
- pbuf = (u8 *)rtw_zmalloc(len);
+ pbuf = kzalloc(len, GFP_KERNEL);
if (pbuf == NULL) {
DBG_88E("%s: no memory!\n", __func__);
return -ENOMEM;
memcpy(&wdata, wrq_data, sizeof(wdata));
input_len = wdata.data.length;
- input = rtw_zmalloc(input_len);
+ input = kzalloc(input_len, GFP_KERNEL);
if (NULL == input)
return -ENOMEM;
if (copy_from_user(input, wdata.data.pointer, input_len)) {
k = j;
}
- buffer = rtw_zmalloc(4096);
+ buffer = kzalloc(4096, GFP_KERNEL);
if (NULL == buffer) {
err = -ENOMEM;
goto exit;
else
n = wdata.data.length;
- output = rtw_zmalloc(4096);
+ output = kzalloc(4096, GFP_KERNEL);
if (NULL == output) {
err = -ENOMEM;
goto exit;