src_ssid = ndis_ssid.Ssid;
spin_lock_bh(&queue->lock);
- phead = get_list_head(queue);
- pmlmepriv->pscanned = phead->next;
+ phead = get_list_head(queue);
+ pmlmepriv->pscanned = phead->next;
while (phead != pmlmepriv->pscanned) {
pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
u32 target_rate = wrqu->bitrate.value;
u32 fixed = wrqu->bitrate.fixed;
u32 ratevalue = 0;
- u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
+ u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
if (target_rate == -1) {
ratevalue = 11;
struct iw_point *pdata = &wrqu->data;
u32 u32wps_start = 0;
+ if (!pdata)
+ return -EINVAL;
ret = copy_from_user((void *)&u32wps_start, pdata->pointer, 4);
if (ret) {
ret = -EINVAL;
goto exit;
}
- if (padapter->bDriverStopped || !pdata) {
+ if (padapter->bDriverStopped) {
ret = -EINVAL;
goto exit;
}
DBG_88E("[%s] In value = %s, len = %d\n", __func__, extra, wrqu->data.length - 1);
/* The upper application should pass the SSID to driver by using this rtw_p2p_profilefound function. */
- if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
- if (extra[0] == '0') {
+ if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
+ if (extra[0] == '0') {
/* Remove all the profile information of wifidirect_info structure. */
memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM);
pwdinfo->profileindex = 0;
if (strcmp(tmp[0], "status") == 0) {
sprintf(extra, "Load File efuse =%s, Load File MAC =%s", (pEEPROM->bloadfile_fail_flag ? "FAIL" : "OK"), (pEEPROM->bloadmac_fail_flag ? "FAIL" : "OK"));
- goto exit;
+ goto exit;
} else if (strcmp(tmp[0], "filemap") == 0) {
mapLen = EFUSE_MAP_SIZE;
case MP_START:
DBG_88E("set case mp_start\n");
rtw_mp_start(dev, info, wrqu, extra);
- break;
+ break;
case MP_STOP:
DBG_88E("set case mp_stop\n");
rtw_mp_stop(dev, info, wrqu, extra);
- break;
+ break;
case MP_BANDWIDTH:
DBG_88E("set case mp_bandwidth\n");
rtw_mp_bandwidth(dev, info, wrqu, extra);
case READ_REG:
DBG_88E("mp_get READ_REG\n");
rtw_mp_read_reg(dev, info, wrqu, extra);
- break;
+ break;
case READ_RF:
DBG_88E("mp_get READ_RF\n");
rtw_mp_read_rf(dev, info, wrqu, extra);
case EFUSE_GET:
DBG_88E("efuse get EFUSE_GET\n");
rtw_mp_efuse_get(dev, info, wdata, extra);
- break;
+ break;
case MP_DUMP:
DBG_88E("set case MP_DUMP\n");
rtw_mp_dump(dev, info, wrqu, extra);
- break;
+ break;
case MP_PSD:
DBG_88E("set case MP_PSD\n");
rtw_mp_psd(dev, info, wrqu, extra);
struct net_device *pnetdev = padapter->pnetdev;
+ if (!padapter)
+ goto error_exit;
if ((!padapter->bup) || (padapter->bDriverStopped) ||
(padapter->bSurpriseRemoved)) {
DBG_88E("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
goto error_exit;
}
- if (padapter) { /* system suspend */
- LeaveAllPowerSaveMode(padapter);
+ LeaveAllPowerSaveMode(padapter);
- DBG_88E("==> rtw_hw_suspend\n");
- _enter_pwrlock(&pwrpriv->lock);
- pwrpriv->bips_processing = true;
- /* s1. */
- if (pnetdev) {
- netif_carrier_off(pnetdev);
- rtw_netif_stop_queue(pnetdev);
- }
+ DBG_88E("==> rtw_hw_suspend\n");
+ _enter_pwrlock(&pwrpriv->lock);
+ pwrpriv->bips_processing = true;
+ /* s1. */
+ if (pnetdev) {
+ netif_carrier_off(pnetdev);
+ rtw_netif_stop_queue(pnetdev);
+ }
- /* s2. */
- rtw_disassoc_cmd(padapter, 500, false);
+ /* s2. */
+ rtw_disassoc_cmd(padapter, 500, false);
- /* s2-2. indicate disconnect to os */
- {
- struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+ /* s2-2. indicate disconnect to os */
+ {
+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- if (check_fwstate(pmlmepriv, _FW_LINKED)) {
- _clr_fwstate_(pmlmepriv, _FW_LINKED);
+ if (check_fwstate(pmlmepriv, _FW_LINKED)) {
+ _clr_fwstate_(pmlmepriv, _FW_LINKED);
- rtw_led_control(padapter, LED_CTL_NO_LINK);
+ rtw_led_control(padapter, LED_CTL_NO_LINK);
- rtw_os_indicate_disconnect(padapter);
+ rtw_os_indicate_disconnect(padapter);
- /* donnot enqueue cmd */
- rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
- }
+ /* donnot enqueue cmd */
+ rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
}
- /* s2-3. */
- rtw_free_assoc_resources(padapter, 1);
+ }
+ /* s2-3. */
+ rtw_free_assoc_resources(padapter, 1);
- /* s2-4. */
- rtw_free_network_queue(padapter, true);
- rtw_ips_dev_unload(padapter);
- pwrpriv->rf_pwrstate = rf_off;
- pwrpriv->bips_processing = false;
+ /* s2-4. */
+ rtw_free_network_queue(padapter, true);
+ rtw_ips_dev_unload(padapter);
+ pwrpriv->rf_pwrstate = rf_off;
+ pwrpriv->bips_processing = false;
- _exit_pwrlock(&pwrpriv->lock);
- } else {
- goto error_exit;
- }
- return 0;
+ _exit_pwrlock(&pwrpriv->lock);
+ return 0;
error_exit:
DBG_88E("%s, failed\n", __func__);
int rtw_hw_resume(struct adapter *padapter)
{
- struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
+ struct pwrctrl_priv *pwrpriv;
struct net_device *pnetdev = padapter->pnetdev;
+ if (!padapter)
+ goto error_exit;
+ pwrpriv = &padapter->pwrctrlpriv;
+ DBG_88E("==> rtw_hw_resume\n");
+ _enter_pwrlock(&pwrpriv->lock);
+ pwrpriv->bips_processing = true;
+ rtw_reset_drv_sw(padapter);
- if (padapter) { /* system resume */
- DBG_88E("==> rtw_hw_resume\n");
- _enter_pwrlock(&pwrpriv->lock);
- pwrpriv->bips_processing = true;
- rtw_reset_drv_sw(padapter);
-
- if (pm_netdev_open(pnetdev, false) != 0) {
- _exit_pwrlock(&pwrpriv->lock);
- goto error_exit;
- }
-
- netif_device_attach(pnetdev);
- netif_carrier_on(pnetdev);
+ if (pm_netdev_open(pnetdev, false) != 0) {
+ _exit_pwrlock(&pwrpriv->lock);
+ goto error_exit;
+ }
- if (!netif_queue_stopped(pnetdev))
- netif_start_queue(pnetdev);
- else
- netif_wake_queue(pnetdev);
+ netif_device_attach(pnetdev);
+ netif_carrier_on(pnetdev);
- pwrpriv->bkeepfwalive = false;
- pwrpriv->brfoffbyhw = false;
+ if (!netif_queue_stopped(pnetdev))
+ netif_start_queue(pnetdev);
+ else
+ netif_wake_queue(pnetdev);
- pwrpriv->rf_pwrstate = rf_on;
- pwrpriv->bips_processing = false;
+ pwrpriv->bkeepfwalive = false;
+ pwrpriv->brfoffbyhw = false;
- _exit_pwrlock(&pwrpriv->lock);
- } else {
- goto error_exit;
- }
+ pwrpriv->rf_pwrstate = rf_on;
+ pwrpriv->bips_processing = false;
+ _exit_pwrlock(&pwrpriv->lock);
return 0;
error_exit:
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
struct adapter *padapter = dvobj->if1;
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
- int ret = 0;
+ int ret = 0;
if (pwrpriv->bInternalAutoSuspend)
ret = rtw_resume_process(padapter);