diff options
Diffstat (limited to 'drivers/staging/rtl8188eu/os_dep')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 58 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 4 |
3 files changed, 31 insertions, 33 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index d5968ef9f43d..2e83d24fcb09 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -120,7 +120,7 @@ static char *translate_scan(struct adapter *padapter, start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.ssid.ssid); /* parsing HT_CAP_IE */ - p = rtw_get_ie(&pnetwork->network.ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.ie_length-12); + p = rtw_get_ie(&pnetwork->network.ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.ie_length - 12); if (p && ht_ielen > 0) { struct ieee80211_ht_cap *pht_capie; @@ -129,7 +129,7 @@ static char *translate_scan(struct adapter *padapter, pht_capie = (struct ieee80211_ht_cap *)(p + 2); memcpy(&mcs_rate, pht_capie->mcs.rx_mask, 2); bw_40MHz = !!(le16_to_cpu(pht_capie->cap_info) & - IEEE80211_HT_CAP_SUP_WIDTH); + IEEE80211_HT_CAP_SUP_WIDTH_20_40); short_GI = !!(le16_to_cpu(pht_capie->cap_info) & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)); @@ -195,7 +195,7 @@ static char *translate_scan(struct adapter *padapter, p = custom; p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), " Rates (Mb/s): "); while (pnetwork->network.SupportedRates[i] != 0) { - rate = pnetwork->network.SupportedRates[i]&0x7F; + rate = pnetwork->network.SupportedRates[i] & 0x7F; if (rate > max_rate) max_rate = rate; p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), @@ -204,14 +204,14 @@ static char *translate_scan(struct adapter *padapter, } if (ht_cap) { - if (mcs_rate&0x8000)/* MCS15 */ + if (mcs_rate & 0x8000)/* MCS15 */ max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130); - else if (mcs_rate&0x0080)/* MCS7 */ + else if (mcs_rate & 0x0080)/* MCS7 */ ; else/* default MCS7 */ max_rate = (bw_40MHz) ? ((short_GI) ? 150 : 135) : ((short_GI) ? 72 : 65); - max_rate = max_rate*2;/* Mbps/2; */ + max_rate *= 2; /* Mbps/2; */ } iwe.cmd = SIOCGIWRATE; @@ -284,7 +284,7 @@ static char *translate_scan(struct adapter *padapter, iwe.u.data.length = (u16)wps_ielen; start = iwe_stream_add_point(info, start, stop, &iwe, wpsie_ptr); } - cnt += ie_ptr[cnt+1]+2; /* goto next */ + cnt += ie_ptr[cnt + 1] + 2; /* goto next */ } } @@ -512,7 +512,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie DBG_88E("\n wpa_ie(length:%d):\n", ielen); for (i = 0; i < ielen; i += 8) - DBG_88E("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", buf[i], buf[i+1], buf[i+2], buf[i+3], buf[i+4], buf[i+5], buf[i+6], buf[i+7]); + DBG_88E("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", buf[i], buf[i + 1], buf[i + 2], buf[i + 3], buf[i + 4], buf[i + 5], buf[i + 6], buf[i + 7]); } if (ielen < RSN_HEADER_LEN) { @@ -586,7 +586,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie while (cnt < ielen) { eid = buf[cnt]; - if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt+2], wps_oui, 4))) { + if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt + 2], wps_oui, 4))) { DBG_88E("SET WPS_IE\n"); padapter->securitypriv.wps_ie_len = min(buf[cnt + 1] + 2, MAX_WPA_IE_LEN << 2); @@ -594,10 +594,10 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); - cnt += buf[cnt+1]+2; + cnt += buf[cnt + 1] + 2; break; } - cnt += buf[cnt+1]+2; /* goto next */ + cnt += buf[cnt + 1] + 2; /* goto next */ } } } @@ -628,7 +628,7 @@ static int rtw_wx_get_name(struct net_device *dev, if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) { /* parsing HT_CAP_IE */ - p = rtw_get_ie(&pcur_bss->ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->ie_length-12); + p = rtw_get_ie(&pcur_bss->ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->ie_length - 12); if (p && ht_ielen > 0) ht_cap = true; @@ -782,7 +782,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, DBG_88E("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n"); memcpy(psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid, IW_PMKID_LEN); psecuritypriv->PMKIDList[j].bUsed = true; - psecuritypriv->PMKIDIndex = j+1; + psecuritypriv->PMKIDIndex = j + 1; blInserted = true; break; } @@ -811,7 +811,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, psecuritypriv->PMKIDList[j].bUsed = false; break; } - } + } } else if (pPMK->cmd == IW_PMKSA_FLUSH) { DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n"); memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE); @@ -1093,7 +1093,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, goto exit; } - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) { + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING)) { indicate_wx_scan_complete_event(padapter); goto exit; } @@ -1102,7 +1102,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, /* the pmlmepriv->scan_interval is always equal to 3. */ /* So, the wpa_supplicant won't find out the WPS SoftAP. */ - memset(ssid, 0, sizeof(struct ndis_802_11_ssid)*RTW_SSID_SCAN_AMOUNT); + memset(ssid, 0, sizeof(struct ndis_802_11_ssid) * RTW_SSID_SCAN_AMOUNT); if (wrqu->data.length == sizeof(struct iw_scan_req)) { struct iw_scan_req *req = (struct iw_scan_req *)extra; @@ -1128,7 +1128,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, if (wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE && !memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE)) { int len = wrqu->data.length - WEXT_CSCAN_HEADER_SIZE; - char *pos = extra+WEXT_CSCAN_HEADER_SIZE; + char *pos = extra + WEXT_CSCAN_HEADER_SIZE; char section; char sec_len; int ssid_index = 0; @@ -1239,7 +1239,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, spin_unlock_bh(&pmlmepriv->scanned_queue.lock); - wrqu->data.length = ev-extra; + wrqu->data.length = ev - extra; wrqu->data.flags = 0; exit: @@ -1395,7 +1395,7 @@ static int rtw_wx_set_rate(struct net_device *dev, ratevalue = 11; goto set_rate; } - target_rate = target_rate/100000; + target_rate /= 100000; switch (target_rate) { case 10: @@ -1890,7 +1890,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, (pext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)) param->u.crypt.set_tx = 0; - param->u.crypt.idx = (pencoding->flags&0x00FF) - 1; + param->u.crypt.idx = (pencoding->flags & 0x00FF) - 1; if (pext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) memcpy(param->u.crypt.seq, pext->rx_seq, 8); @@ -1935,7 +1935,7 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) switch (name) { case IEEE_PARAM_WPA_ENABLED: padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; /* 802.1x */ - switch ((value)&0xff) { + switch (value & 0xff) { case 1: /* WPA */ padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */ padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; @@ -2407,7 +2407,7 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0)) pstapriv->max_num_sta = NUM_STA; - if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS)/* 12 = param header, 2:no packed */ + if (rtw_check_beacon_data(padapter, pbuf, len - 12 - 2) == _SUCCESS) /* 12 = param header, 2:no packed */ ret = 0; else ret = -EINVAL; @@ -2436,7 +2436,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr)); - if (!check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE))) + if (!check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE))) return -EINVAL; if (is_broadcast_ether_addr(param->sta_addr)) @@ -2451,7 +2451,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); /* check wmm cap. */ - if (WLAN_STA_WME&flags) + if (WLAN_STA_WME & flags) psta->qos_option = 1; else psta->qos_option = 0; @@ -2460,7 +2460,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta->qos_option = 0; /* chec 802.11n ht cap. */ - if (WLAN_STA_HT&flags) { + if (WLAN_STA_HT & flags) { psta->htpriv.ht_option = true; psta->qos_option = 1; memcpy(&psta->htpriv.ht_cap, ¶m->u.add_sta.ht_cap, @@ -2620,7 +2620,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ + ie_len = len - 12 - 2; /* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_beacon_ie); pmlmepriv->wps_beacon_ie = NULL; @@ -2654,7 +2654,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ + ie_len = len - 12 - 2; /* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_probe_resp_ie); pmlmepriv->wps_probe_resp_ie = NULL; @@ -2683,7 +2683,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ + ie_len = len - 12 - 2; /* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_assoc_resp_ie); pmlmepriv->wps_assoc_resp_ie = NULL; @@ -3014,7 +3014,7 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ret = rtw_hostapd_ioctl(dev, &wrq->u.data); break; #endif /* CONFIG_88EU_AP_MODE */ - case (SIOCDEVPRIVATE+1): + case (SIOCDEVPRIVATE + 1): ret = rtw_android_priv_cmd(dev, rq, cmd); break; default: diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c index 3cd6da1f843d..a80c7f3b86d1 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -400,7 +400,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) case -ENODEV: case -ESHUTDOWN: adapt->bSurpriseRemoved = true; - /* fall through */ + fallthrough; case -ENOENT: adapt->bDriverStopped = true; RT_TRACE(_module_hci_ops_os_c_, _drv_err_, diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index 017e1d628461..a73313cf6a75 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -14,8 +14,7 @@ #include <xmit_osdep.h> #include <osdep_intf.h> -int rtw_os_xmit_resource_alloc(struct adapter *padapter, - struct xmit_buf *pxmitbuf, u32 alloc_sz) +int rtw_os_xmit_resource_alloc(struct xmit_buf *pxmitbuf, u32 alloc_sz) { int i; @@ -24,7 +23,6 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, return _FAIL; pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ); - pxmitbuf->dma_transfer_addr = 0; for (i = 0; i < 8; i++) { pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); |