Skip to content

Commit

Permalink
rtl8192du: Fix build when CONFIG_92D_AP_MODE is not defined
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  • Loading branch information
lwfinger committed Jul 21, 2014
1 parent 2c499cd commit 2efdd7f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions core/rtw_ioctl_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct rtw_adapter *padapter,
/* change to other mode from Ndis802_11APMode */
cur_network->join_res = -1;

#ifdef CONFIG_NATIVEAP_MLME
#ifdef CONFIG_92D_AP_MODE
stop_ap_mode(padapter);
#endif
}
Expand Down Expand Up @@ -407,7 +407,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct rtw_adapter *padapter,
break;
case NDIS802_11APMODE:
set_fwstate(pmlmepriv, WIFI_AP_STATE);
#ifdef CONFIG_NATIVEAP_MLME
#ifdef CONFIG_92D_AP_MODE
start_ap_mode(padapter);
#endif
break;
Expand Down
3 changes: 2 additions & 1 deletion core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,12 +1782,13 @@ void rtw_stadel_event_callback(struct rtw_adapter *adapter, u8 *pbuf)
struct sta_priv *pstapriv = &adapter->stapriv;
struct wlan_network *tgt_network = &(pmlmepriv->cur_network);

#ifdef CONFIG_92D_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
rtw_cfg80211_indicate_sta_disassoc(adapter, pstadel->macaddr,
*(u16 *)pstadel->rsvd);
return;
}

#endif
mlmeext_sta_del_event_callback(adapter);

spin_lock_bh(&pmlmepriv->lock);
Expand Down
14 changes: 6 additions & 8 deletions core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,9 +2484,7 @@ void issue_beacon(struct rtw_adapter *adapt)
unsigned short *fctrl;
unsigned int rate_len;
struct xmit_priv *pxmitpriv = &(adapt->xmitpriv);
#if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
struct mlme_priv *pmlmepriv = &(adapt->mlmepriv);
#endif /* if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */
struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
Expand All @@ -2497,9 +2495,7 @@ void issue_beacon(struct rtw_adapter *adapt)
DBG_8192D("%s, alloc mgnt frame fail\n", __func__);
return;
}
#if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
spin_lock_bh(&pmlmepriv->bcn_update_lock);
#endif /* if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */

/* update attribute */
pattrib = &pmgntframe->attrib;
Expand Down Expand Up @@ -2639,11 +2635,9 @@ void issue_beacon(struct rtw_adapter *adapt)

_issue_bcn:

#if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
pmlmepriv->update_bcn = false;

spin_unlock_bh(&pmlmepriv->bcn_update_lock);
#endif /* if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */

if ((pattrib->pktlen + TXDESC_SIZE) > 512) {
DBG_8192D("beacon frame too large\n");
Expand All @@ -2652,8 +2646,6 @@ void issue_beacon(struct rtw_adapter *adapt)

pattrib->last_txcmdsz = pattrib->pktlen;

/* DBG_8192D("issue bcn_sz=%d\n", pattrib->last_txcmdsz); */

dump_mgntframe(adapt, pmgntframe);
}

Expand Down Expand Up @@ -7120,13 +7112,17 @@ void change_band_update_ie(struct rtw_adapter *adapt,
network_type = WIRELESS_11A;
total_rate_len = IEEE80211_NUM_OFDM_RATESLEN;
DBG_8192D("%s(): change to 5G Band\n", __func__);
#ifdef CONFIG_92D_AP_MODE
rtw_remove_bcn_ie(adapt, pnetwork, _ERPINFO_IE_);
#endif
} else {
network_type = WIRELESS_11BG;
total_rate_len =
IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN;
DBG_8192D("%s(): change to 2.4G Band\n", __func__);
#ifdef CONFIG_92D_AP_MODE
rtw_add_bcn_ie(adapt, pnetwork, _ERPINFO_IE_, &erpinfo, 1);
#endif
}

rtw_set_supported_rate(pnetwork->SupportedRates, network_type);
Expand All @@ -7143,6 +7139,7 @@ void change_band_update_ie(struct rtw_adapter *adapt,
remainder_rate_len = 0;
}

#ifdef CONFIG_92D_AP_MODE
rtw_add_bcn_ie(adapt, pnetwork, _SUPPORTEDRATES_IE_,
pnetwork->SupportedRates, rate_len);

Expand All @@ -7153,6 +7150,7 @@ void change_band_update_ie(struct rtw_adapter *adapt,
} else {
rtw_remove_bcn_ie(adapt, pnetwork, _EXT_SUPPORTEDRATES_IE_);
}
#endif
}

#ifdef CONFIG_DUALMAC_CONCURRENT
Expand Down
2 changes: 1 addition & 1 deletion include/autoconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define CONFIG_IPS 1
//#define CONFIG_LPS 1

#define CONFIG_92D_AP_MODE 1
//#define CONFIG_92D_AP_MODE 1
#define CONFIG_NATIVEAP_MLME 1
#ifndef CONFIG_NATIVEAP_MLME
#define CONFIG_HOSTAPD_MLME 1
Expand Down
4 changes: 0 additions & 4 deletions include/rtw_mlme.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ struct mlme_priv {
u8 *wps_probe_req_ie;
u32 wps_probe_req_ie_len;

#if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
/* Number of associated Non-ERP stations (i.e., stations using 802.11b
* in 802.11g BSS) */
int num_sta_non_erp;
Expand Down Expand Up @@ -433,9 +432,6 @@ struct mlme_priv {
spinlock_t bcn_update_lock;
u8 update_bcn;


#endif /* if defined (CONFIG_92D_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */

#ifdef CONFIG_CONCURRENT_MODE
u8 scanning_via_buddy_intf;
#endif
Expand Down
4 changes: 0 additions & 4 deletions include/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ struct sta_info {
/* curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO */
/* sta_info: (AP & STA) CAP/INFO */

#ifdef CONFIG_92D_AP_MODE

struct list_head asoc_list;
struct list_head auth_list;

Expand Down Expand Up @@ -191,8 +189,6 @@ struct sta_info {

u8 keep_alive_trycnt;

#endif /* CONFIG_92D_AP_MODE */

u8 *passoc_req;
u32 assoc_req_len;

Expand Down
12 changes: 8 additions & 4 deletions os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3417,12 +3417,15 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf,

memcpy(pmlmepriv->wps_beacon_ie, wps_ie, wps_ielen);
pmlmepriv->wps_beacon_ie_len = wps_ielen;

#ifdef CONFIG_92D_AP_MODE
update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, true);
#endif

}

#ifdef CONFIG_92D_AP_MODE
pmlmeext->bstart_bss = true;
#endif
}

return ret;
Expand Down Expand Up @@ -3742,11 +3745,12 @@ static void rtw_cfg80211_preinit_wiphy(struct rtw_adapter *padapter, struct wiph
wiphy->max_remain_on_channel_duration = RTW_MAX_REMAIN_ON_CHANNEL_DURATION;
#endif

wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC)
wiphy->interface_modes = BIT(NL80211_IFTYPE_ADHOC) |
#ifdef CONFIG_92D_AP_MODE
| BIT(NL80211_IFTYPE_AP)
| BIT(NL80211_IFTYPE_MONITOR);
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MONITOR) |
#endif
BIT(NL80211_IFTYPE_STATION);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
#ifdef CONFIG_92D_AP_MODE
wiphy->mgmt_stypes = rtw_cfg80211_default_mgmt_stypes;
Expand Down
7 changes: 6 additions & 1 deletion os_dep/xmit_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ static int rtw_mlcst2unicst(struct rtw_adapter *padapter, struct sk_buff *skb)
struct sta_info *psta = NULL;
s32 res;

#ifdef CONFIG_92D_AP_MODE
spin_lock_bh(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list;
plist = phead->next;

#endif
/* free sta asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false)
{
Expand All @@ -250,12 +251,16 @@ static int rtw_mlcst2unicst(struct rtw_adapter *padapter, struct sk_buff *skb)
DBG_8192D("%s-%d: skb_copy() failed!\n", __func__, __LINE__);
pxmitpriv->tx_drop++;

#ifdef CONFIG_92D_AP_MODE
spin_unlock_bh(&pstapriv->asoc_list_lock);
#endif
return false; /* Caller shall tx this multicast frame via normal way. */
}
}

#ifdef CONFIG_92D_AP_MODE
spin_unlock_bh(&pstapriv->asoc_list_lock);
#endif
dev_kfree_skb_any(skb);
return true;
}
Expand Down

0 comments on commit 2efdd7f

Please sign in to comment.