mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 12:33:40 +00:00
rtl8188eu: Fix problem where device is not up on module load
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
bc8ca96401
commit
0b659bd591
3 changed files with 43 additions and 59 deletions
|
@ -3149,18 +3149,13 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||
|
||||
if (mac_id >= NUM_STA) /* CAM_SIZE */
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
psta = pmlmeinfo->FW_sta_info[mac_id].psta;
|
||||
if (psta == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mac_id)
|
||||
{
|
||||
switch (mac_id) {
|
||||
case 0:/* for infra mode */
|
||||
supportRateNum = rtw_get_rateset_len(cur_network->SupportedRates);
|
||||
networkType = judge_network_type(padapter, cur_network->SupportedRates, supportRateNum) & 0xf;
|
||||
|
@ -3170,14 +3165,9 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
mask = update_supported_rate(cur_network->SupportedRates, supportRateNum);
|
||||
mask |= (pmlmeinfo->HT_enable)? update_MSC_rate(&(pmlmeinfo->HT_caps)): 0;
|
||||
|
||||
|
||||
if (support_short_GI(padapter, &(pmlmeinfo->HT_caps)))
|
||||
{
|
||||
shortGIrate = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:/* for broadcast/multicast */
|
||||
supportRateNum = rtw_get_rateset_len(pmlmeinfo->FW_sta_info[mac_id].SupportedRates);
|
||||
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
|
||||
|
@ -3186,10 +3176,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
networkType = WIRELESS_11G;
|
||||
raid = networktype_to_raid(networkType);
|
||||
mask = update_basic_rate(cur_network->SupportedRates, supportRateNum);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
default: /* for each sta in IBSS */
|
||||
supportRateNum = rtw_get_rateset_len(pmlmeinfo->FW_sta_info[mac_id].SupportedRates);
|
||||
networkType = judge_network_type(padapter, pmlmeinfo->FW_sta_info[mac_id].SupportedRates, supportRateNum) & 0xf;
|
||||
|
@ -3203,15 +3190,11 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
}
|
||||
|
||||
rate_bitmap = ODM_Get_Rate_Bitmap(&pHalData->odmpriv,mac_id,mask,rssi_level);
|
||||
pr_info("%s => mac_id:%d, networkType:0x%02x, mask:0x%08x\n\t ==> rssi_level:%d, rate_bitmap:0x%08x\n",
|
||||
__FUNCTION__,mac_id,networkType,mask,rssi_level,rate_bitmap);
|
||||
|
||||
mask &= rate_bitmap;
|
||||
|
||||
init_rate = get_highest_rate_idx(mask)&0x3f;
|
||||
|
||||
if (pHalData->fw_ractrl == true)
|
||||
{
|
||||
if (pHalData->fw_ractrl == true) {
|
||||
u8 arg = 0;
|
||||
|
||||
arg = mac_id&0x1f;/* MACID */
|
||||
|
@ -3231,13 +3214,8 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
RateMask[4] = macId | (bShortGI?0x20:0x00) | 0x80;
|
||||
*/
|
||||
rtl8188e_set_raid_cmd(padapter, mask);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
#if (RATE_ADAPTIVE_SUPPORT == 1)
|
||||
|
||||
ODM_RA_UpdateRateInfo_8188E(
|
||||
&(pHalData->odmpriv),
|
||||
mac_id,
|
||||
|
@ -3249,7 +3227,6 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* set ra_id */
|
||||
psta->raid = raid;
|
||||
psta->init_rate = init_rate;
|
||||
|
|
|
@ -5059,7 +5059,7 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev)
|
|||
wdev->wiphy = wiphy;
|
||||
wdev->netdev = pnetdev;
|
||||
/* wdev->iftype = NL80211_IFTYPE_STATION; */
|
||||
wdev->iftype = NL80211_IFTYPE_MONITOR; /* for rtw_setopmode_cmd() in cfg80211_rtw_change_iface() */
|
||||
wdev->iftype = NL80211_IFTYPE_STATION; /* for rtw_setopmode_cmd() in cfg80211_rtw_change_iface() */
|
||||
padapter->rtw_wdev = wdev;
|
||||
pnetdev->ieee80211_ptr = wdev;
|
||||
|
||||
|
|
|
@ -603,24 +603,31 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
|
|||
{
|
||||
int i;
|
||||
struct adapter *padapter = NULL;
|
||||
|
||||
for (i=0;i<dvobj->iface_nums;i++)
|
||||
{
|
||||
struct net_device *pnetdev = NULL;
|
||||
|
||||
if (!dvobj || dvobj->iface_nums == 0)
|
||||
return;
|
||||
|
||||
for (i=0;i<dvobj->iface_nums;i++) {
|
||||
padapter = dvobj->padapters[i];
|
||||
|
||||
if (padapter == NULL)
|
||||
continue;
|
||||
|
||||
pnetdev = padapter->pnetdev;
|
||||
if (!pnetdev)
|
||||
continue;
|
||||
|
||||
if ((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev) {
|
||||
if (padapter->DriverState != DRIVER_DISAPPEAR) {
|
||||
struct wireless_dev *wdev = padapter->rtw_wdev;
|
||||
|
||||
wdev->current_bss = NULL;
|
||||
pnetdev->reg_state = NETREG_REGISTERED;
|
||||
unregister_netdev(pnetdev); /* will call netdev_close() */
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
|
||||
if (padapter->rtw_wdev)
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue