From 285af1cf22b5bf4bc28fe212c2a31f14a5f35be2 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 10 Jul 2013 20:10:20 -0500 Subject: [PATCH] rtl8188eu: Remove dead code inside "ifdef PLATFORM_FREEBSD" sections Signed-off-by: Larry Finger --- core/rtw_mlme.c | 204 +--------------------------------- core/rtw_mlme_ext.c | 47 -------- core/rtw_mp.c | 15 --- core/rtw_pwrctrl.c | 2 +- core/rtw_recv.c | 78 +------------ core/rtw_security.c | 12 +- include/drv_types.h | 9 -- include/ieee80211.h | 13 +-- include/osdep_intf.h | 5 - include/rtw_led.h | 2 +- include/rtw_mlme.h | 2 +- include/rtw_recv.h | 15 +-- include/rtw_security.h | 3 - include/rtw_xmit.h | 15 +-- include/usb_ops.h | 7 -- include/wifi.h | 2 +- include/wlan_bssdef.h | 245 ----------------------------------------- 17 files changed, 18 insertions(+), 658 deletions(-) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 44e6620..6f6bc72 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -301,16 +301,6 @@ _func_enter_; #endif -#ifdef PLATFORM_FREEBSD - /* i think needs to check again */ - delta_time = (curr_time -pnetwork->last_scanned)/hz; - - if (delta_time < lifetime)/* unit:sec */ - { - goto exit; - } - -#endif } _enter_critical_bh(&free_queue->lock, &irqL); @@ -527,7 +517,6 @@ _func_exit_; } -#ifndef PLATFORM_FREEBSD /* Baron */ static struct wlan_network *rtw_dequeue_network(_queue *queue) { struct wlan_network *pnetwork; @@ -536,7 +525,6 @@ _func_enter_; _func_exit_; return pnetwork; } -#endif /* PLATFORM_FREEBSD */ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv ); struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue *free_queue) */ @@ -2206,24 +2194,6 @@ void _rtw_join_timeout_handler (_adapter *adapter) #endif /* CONFIG_LAYER2_ROAMING */ _func_enter_; -#ifdef PLATFORM_FREEBSD - rtw_mtx_lock(NULL); - if (callout_pending(&adapter->mlmepriv.assoc_timer.callout)) { - /* callout was reset */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - if (!callout_active(&adapter->mlmepriv.assoc_timer.callout)) { - /* callout was stopped */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - callout_deactivate(&adapter->mlmepriv.assoc_timer.callout); - - -#endif DBG_88E("%s, fw_state=%x\n", __func__, get_fwstate(pmlmepriv)); @@ -2264,9 +2234,6 @@ _func_enter_; #ifdef CONFIG_DRVEXT_MODULE_WSC drvext_assoc_fail_indicate(&adapter->drvextpriv); #endif -#ifdef PLATFORM_FREEBSD - rtw_mtx_unlock(NULL); -#endif _func_exit_; @@ -2411,10 +2378,11 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) if ( adapter->pnetdev->br_port + && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) ) #else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ if ( rcu_dereference(adapter->pnetdev->rx_handler_data) -#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) ) +#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ { /* expire NAT2.5 entry */ nat25_db_expire(adapter); @@ -2490,7 +2458,6 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms) #define RTW_SCAN_RESULT_EXPIRE 2000 #endif -#ifndef PLATFORM_FREEBSD /* * Select a new join candidate from the original @param candidate and @param competitor * @return true: candidate is updated @@ -2637,173 +2604,6 @@ _func_exit_; return ret; } -#else -int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv ) -{ - _irqL irqL; - _list *phead; -#ifdef CONFIG_ANTENNA_DIVERSITY - u8 CurrentAntenna; -#endif - unsigned char *dst_ssid, *src_ssid; - _adapter *adapter; - _queue *queue = &(pmlmepriv->scanned_queue); - struct wlan_network *pnetwork = NULL; - struct wlan_network *pnetwork_max_rssi = NULL; - #ifdef CONFIG_LAYER2_ROAMING - struct wlan_network * roaming_candidate=NULL; - u32 cur_time=rtw_get_current_time(); - #endif - -_func_enter_; - _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - phead = get_list_head(queue); - adapter = (_adapter *)pmlmepriv->nic_hdl; - - pmlmepriv->pscanned = get_next( phead ); - - while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) { - - pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); - if (pnetwork==NULL){ - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(2)rtw_select_and_join_from_scanned_queue return _FAIL:(pnetwork==NULL)\n")); - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - return _FAIL; - } - - dst_ssid = pnetwork->network.Ssid.Ssid; - src_ssid = pmlmepriv->assoc_ssid.Ssid; - - pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); - - if (pmlmepriv->assoc_by_bssid==true) - { - if (_rtw_memcmp(pnetwork->network.MacAddress, pmlmepriv->assoc_bssid, ETH_ALEN)==true) - { - /* remove the condition @ 20081125 */ - - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) - { - if (is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) - { - rtw_indicate_connect(adapter);/* rtw_indicate_connect again */ - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - return 2; - } - else - { - rtw_disassoc_cmd(adapter, 0, true); - rtw_indicate_disconnect(adapter); - rtw_free_assoc_resources(adapter, 0); - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - goto ask_for_joinbss; - - } - } - else - { - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - goto ask_for_joinbss; - } - - } - - } else if (pmlmepriv->assoc_ssid.SsidLength == 0) { - goto ask_for_joinbss;/* anyway, join first selected(dequeued) pnetwork if ssid_len=0 */ - - #ifdef CONFIG_LAYER2_ROAMING - } else if (pmlmepriv->to_roaming>0) { - - if ( (roaming_candidate == NULL ||roaming_candidate->network.Rssinetwork.Rssi ) - && is_same_ess(&pnetwork->network, &pmlmepriv->cur_network.network) - /* is_same_network(&pnetwork->network, &pmlmepriv->cur_network.network)) */ - && rtw_get_time_interval_ms((u32)pnetwork->last_scanned,cur_time) < 5000 - ) { - roaming_candidate = pnetwork; - /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_, */ - DBG_88E("roaming_candidate???: %s(%pM\n", - roaming_candidate->network.Ssid.Ssid, - roaming_candidate->network.MacAddress); - } - continue; - #endif - - } else if ( (pnetwork->network.Ssid.SsidLength==pmlmepriv->assoc_ssid.SsidLength) - &&((_rtw_memcmp(dst_ssid, src_ssid, pmlmepriv->assoc_ssid.SsidLength)) == true) - ) - { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("dst_ssid=%s, src_ssid=%s\n", dst_ssid, src_ssid)); -#ifdef CONFIG_ANTENNA_DIVERSITY - rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna)); - DBG_88E("#### dst_ssid=(%s) Opt_Ant_(%s) , cur_Ant(%s)\n", dst_ssid, - (2==pnetwork->network.PhyInfo.Optimum_antenna)?"A":"B", - (2==CurrentAntenna)?"A":"B"); -#endif - /* remove the condition @ 20081125 */ - /* if ((pmlmepriv->cur_network.network.InfrastructureMode==Ndis802_11AutoUnknown)|| */ - /* pmlmepriv->cur_network.network.InfrastructureMode == pnetwork->network.InfrastructureMode) */ - /* */ - /* _rtw_memcpy(pmlmepriv->assoc_bssid, pnetwork->network.MacAddress, ETH_ALEN); */ - /* goto ask_for_joinbss; */ - /* */ - - if (pmlmepriv->assoc_by_rssi==true)/* if the ssid is the same, select the bss which has the max rssi */ - { - if ( NULL==pnetwork_max_rssi|| pnetwork->network.Rssi > pnetwork_max_rssi->network.Rssi) - pnetwork_max_rssi = pnetwork; - } - else if (rtw_is_desired_network(adapter, pnetwork) == true) - { - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) - { - rtw_disassoc_cmd(adapter, 0, true); - rtw_free_assoc_resources(adapter, 0); - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - goto ask_for_joinbss; - } else { - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - goto ask_for_joinbss; - } - - } - - - } - - } - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - #ifdef CONFIG_LAYER2_ROAMING - if (pmlmepriv->to_roaming>0 && roaming_candidate ){ - pnetwork=roaming_candidate; - DBG_88E("select_and_join_from_scanned_queue: roaming_candidate: %s(%pM\n", - pnetwork->network.Ssid.Ssid, pnetwork->network.MacAddress); - goto ask_for_joinbss; - } - #endif - - if ((pmlmepriv->assoc_by_rssi==true) && (pnetwork_max_rssi!=NULL)) - { - pnetwork = pnetwork_max_rssi; - DBG_88E("select_and_join_from_scanned_queue: pnetwork_max_rssi: %s()))%pM\n", - pnetwork->network.Ssid.Ssid, pnetwork->network.MacAddress); - goto ask_for_joinbss; - } - - DBG_88E("(1)rtw_select_and_join_from_scanned_queue return _FAIL\n"); - -_func_exit_; - - return _FAIL; - -ask_for_joinbss: - -_func_exit_; - - return rtw_joinbss_cmd(adapter, pnetwork); - -} -#endif /* PLATFORM_FREEBSD */ - sint rtw_set_auth(_adapter * adapter,struct security_priv *psecuritypriv) { diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 45b3f5d..148d764 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -10130,26 +10130,6 @@ void survey_timer_hdl(_adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -#endif - - /* DBG_88E("marc: survey timer\n"); */ -#ifdef PLATFORM_FREEBSD - rtw_mtx_lock(NULL); - if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { - /* callout was reset */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { - /* callout was stopped */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); - - #endif /* issue rtw_sitesurvey_cmd */ @@ -10204,10 +10184,6 @@ void survey_timer_hdl(_adapter *padapter) exit_survey_timer_hdl: -#ifdef PLATFORM_FREEBSD - rtw_mtx_unlock(NULL); -#endif - return; } @@ -10220,25 +10196,6 @@ void link_timer_hdl(_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); /* struct sta_priv *pstapriv = &padapter->stapriv; */ -#ifdef PLATFORM_FREEBSD - rtw_mtx_lock(NULL); - if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { - /* callout was reset */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { - /* callout was stopped */ - /* mtx_unlock(&sc->sc_mtx); */ - rtw_mtx_unlock(NULL); - return; - } - callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); - - -#endif - if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { DBG_88E("link_timer_hdl:no beacon while connecting\n"); @@ -10282,10 +10239,6 @@ void link_timer_hdl(_adapter *padapter) issue_assocreq(padapter); set_link_timer(pmlmeext, REASSOC_TO); } -#ifdef PLATFORM_FREEBSD - rtw_mtx_unlock(NULL); -#endif - return; } diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 0bbbc53..9c25dce 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -21,10 +21,6 @@ #include -#ifdef PLATFORM_FREEBSD -#include /* for RFHIGHPID */ -#endif - #ifdef CONFIG_RTL8712 #include #endif @@ -1067,17 +1063,6 @@ void SetPacketTx(PADAPTER padapter) if (IS_ERR(pmp_priv->tx.PktTxThread)) DBG_88E("Create PktTx Thread Fail !!!!!\n"); #endif -#ifdef PLATFORM_FREEBSD -{ - struct proc *p; - struct thread *td; - pmp_priv->tx.PktTxThread = kproc_kthread_add(mp_xmit_packet_thread, pmp_priv, - &p, &td, RFHIGHPID, 0, "MPXmitThread", "MPXmitThread"); - - if (pmp_priv->tx.PktTxThread < 0) - DBG_88E("Create PktTx Thread Fail !!!!!\n"); -} -#endif } void SetPacketRx(PADAPTER pAdapter, u8 bStartRx) diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index dcb177f..90144ec 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -195,7 +195,7 @@ exit: return ret; } -#if defined (PLATFORM_LINUX)||defined (PLATFORM_FREEBSD) +#if defined (PLATFORM_LINUX) void rtw_ps_processor(_adapter*padapter) { #ifdef CONFIG_P2P diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 97628a3..27162fd 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -251,7 +251,7 @@ _func_enter_; rtw_os_read_port(padapter, precvframe->u.hdr.precvbuf); #endif -#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_LINUX) if (precvframe->u.hdr.pkt) { @@ -263,7 +263,7 @@ _func_enter_; precvframe->u.hdr.pkt = NULL; } -#endif /* defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) */ +#endif /* defined(PLATFORM_LINUX) */ _enter_critical_bh(&pfree_recv_queue->lock, &irqL); @@ -2619,23 +2619,17 @@ _func_exit_; static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) { -#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) /* for amsdu TP improvement,Creator: Thomas */ +#if defined (PLATFORM_LINUX) /* for amsdu TP improvement,Creator: Thomas */ int a_len, padding_len; u16 eth_type, nSubframe_Length; u8 nr_subframes, i; unsigned char *pdata; struct rx_pkt_attrib *pattrib; -#ifndef PLATFORM_FREEBSD unsigned char *data_ptr; _pkt *sub_skb,*subframes[MAX_SUBFRAME_COUNT]; -#endif /* PLATFORM_FREEBSD */ struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &(precvpriv->free_recv_queue); int ret = _SUCCESS; -#ifdef PLATFORM_FREEBSD - struct mbuf *sub_m=NULL, *subframes[MAX_SUBFRAME_COUNT]; - u8 *ptr,offset; -#endif /* PLATFORM_FREEBSD */ nr_subframes = 0; pattrib = &prframe->u.hdr.attrib; @@ -2661,7 +2655,6 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) goto exit; } -#ifndef PLATFORM_FREEBSD /* move the data point to data content */ pdata += ETH_HLEN; a_len -= ETH_HLEN; @@ -2692,24 +2685,9 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } } -#else /* PLATFORM_FREEBSD */ - /* PLATFORM_FREEBSD */ - /* Allocate a mbuff, */ - /* sub_m =m_devget(pdata, nSubframe_Length+12, 12, padapter->pifp,NULL); */ - sub_m =m_devget(pdata, nSubframe_Length+ETH_HLEN, ETHER_ALIGN, padapter->pifp,NULL); - - pdata += ETH_HLEN; - a_len -= ETH_HLEN; -#endif /* PLATFORM_FREEBSD */ - -#ifndef PLATFORM_FREEBSD /* sub_skb->dev = padapter->pnetdev; */ subframes[nr_subframes++] = sub_skb; -#else /* PLATFORM_FREEBSD */ - /* PLATFORM_FREEBSD */ - subframes[nr_subframes++] = sub_m; -#endif /* PLATFORM_FREEBSD */ if (nr_subframes >= MAX_SUBFRAME_COUNT) { DBG_88E("ParseSubframe(): Too many Subframes! Packets dropped!\n"); @@ -2733,7 +2711,6 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } for (i=0; idata[6]); @@ -2783,53 +2760,6 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) netif_rx(sub_skb); } -#else /* PLATFORM_FREEBSD */ - - /* PLATFORM_FREEBSD */ - sub_m = subframes[i]; - ptr=mtod(sub_m, u8 *); - offset=ETH_HLEN; - /* convert hdr + possible LLC headers into Ethernet header */ - eth_type = ntohs(*(u16*)&ptr[offset+6]); - if (sub_m->m_pkthdr.len >= ETH_HLEN+8 && - ((_rtw_memcmp(ptr+ETH_HLEN, rtw_rfc1042_header, SNAP_SIZE) && - eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || - _rtw_memcmp(ptr+ETH_HLEN, rtw_bridge_tunnel_header, SNAP_SIZE) )) { - /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ - offset+=SNAP_SIZE; - _rtw_memcpy(&ptr[offset-ETH_ALEN], pattrib->src, ETH_ALEN); - offset-=ETH_ALEN; - _rtw_memcpy(&ptr[offset-ETH_ALEN], pattrib->dst, ETH_ALEN); - offset-=ETH_ALEN; - } else { - u16 len; - /* Leave Ethernet header part of hdr and full payload */ - len = htons(sub_m->m_pkthdr.len-offset); - _rtw_memcpy(&ptr[offset- 2], &len, 2); - offset-=2; - _rtw_memcpy(&ptr[offset-ETH_ALEN], pattrib->src, ETH_ALEN); - offset-=ETH_ALEN; - _rtw_memcpy(&ptr[offset-ETH_ALEN], pattrib->dst, ETH_ALEN); - offset-=ETH_ALEN; - } - - m_adj(sub_m,offset); - - /* Indicat the packets to upper layer */ - if (sub_m) { - if ( ((u32)(mtod(sub_m, caddr_t) + 14) % 4) != 0) - printf("%s()-%d: mtod(sub_m) = %p\n", __func__, __LINE__, mtod(sub_m, caddr_t)); -#ifdef CONFIG_RX_INDICATE_QUEUE - IF_ENQUEUE(&precvpriv->rx_indicate_queue, sub_m); - if (_IF_QLEN(&precvpriv->rx_indicate_queue) <= 1) { - taskqueue_enqueue(taskqueue_thread, &precvpriv->rx_indicate_tasklet); - } -#else /* CONFIG_RX_INDICATE_QUEUE */ - (*padapter->pifp->if_input)(padapter->pifp, sub_m); -#endif /* CONFIG_RX_INDICATE_QUEUE */ - } - -#endif /* PLATFORM_FREEBSD */ } exit: @@ -2838,7 +2768,7 @@ exit: rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ return ret; -#else /* || defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) */ +#else /* || defined (PLATFORM_LINUX) */ #ifdef PLATFORM_WINDOWS _irqL irql; #endif /* PLATFORM_WINDOWS */ diff --git a/core/rtw_security.c b/core/rtw_security.c index 95bdeb6..74c25af 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -920,13 +920,11 @@ static void next_key(u8 *key, sint round); static void byte_sub(u8 *in, u8 *out); static void shift_row(u8 *in, u8 *out); static void mix_column(u8 *in, u8 *out); -#ifndef PLATFORM_FREEBSD static void add_round_key( u8 *shiftrow_in, u8 *mcol_in, u8 *block_in, sint round, u8 *out); -#endif /* PLATFORM_FREEBSD */ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); @@ -1933,7 +1931,6 @@ _func_exit_; exit: return res; } -#ifndef PLATFORM_FREEBSD /* compress 512-bits */ static int sha256_compress(struct sha256_state *md, unsigned char *buf) { @@ -2199,7 +2196,6 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, _len[1] = 32; sha256_vector(2, _addr, _len, mac); } -#endif /* PLATFORM_FREEBSD */ /** * sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2) * @key: Key for PRF @@ -2213,7 +2209,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, * This function is used to derive new, cryptographically separate keys from a * given key. */ -#ifndef PLATFORM_FREEBSD /* Baron */ + static void sha256_prf(u8 *key, size_t key_len, char *label, u8 *data, size_t data_len, u8 *buf, size_t buf_len) { @@ -2250,7 +2246,6 @@ static void sha256_prf(u8 *key, size_t key_len, char *label, counter++; } } -#endif /* PLATFORM_FREEBSD Baron */ /* AES tables*/ const u32 Te0[256] = { @@ -2429,7 +2424,6 @@ const u8 rcons[] = { * * @return the number of rounds for the given cipher key size. */ -#ifndef PLATFORM_FREEBSD /* Baron */ static void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[]) { int i; @@ -2645,7 +2639,6 @@ static int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac) { return omac1_aes_128_vector(key, 1, &data, &data_len, mac); } -#endif /* PLATFORM_FREEBSD Baron */ #ifdef CONFIG_TDLS void wpa_tdls_generate_tpk(_adapter *padapter, struct sta_info *psta) @@ -2828,9 +2821,6 @@ void rtw_use_tkipkey_handler ( #ifdef PLATFORM_LINUX void rtw_use_tkipkey_handler(void *FunctionContext) #endif -#ifdef PLATFORM_FREEBSD -void rtw_use_tkipkey_handler(void *FunctionContext) -#endif { _adapter *padapter = (_adapter *)FunctionContext; diff --git a/include/drv_types.h b/include/drv_types.h index b37d8ab..24d1499 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -318,10 +318,6 @@ struct dvobj_priv struct usb_device *pusbdev; #endif//PLATFORM_LINUX -#ifdef PLATFORM_FREEBSD - struct usb_interface *pusbintf; - struct usb_device *pusbdev; -#endif//PLATFORM_FREEBSD ATOMIC_T continual_urb_error; #endif//CONFIG_USB_HCI @@ -576,11 +572,6 @@ struct _ADAPTER{ #endif //end of PLATFORM_LINUX -#ifdef PLATFORM_FREEBSD - _nic_hdl pifp; - int bup; - _lock glock; -#endif //PLATFORM_FREEBSD int net_closed; u8 bFWReady; diff --git a/include/ieee80211.h b/include/ieee80211.h index cc7b893..d235845 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -315,7 +315,7 @@ struct ieee_ibss_seq { _list list; }; -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW)||defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) struct rtw_ieee80211_hdr { u16 frame_ctl; @@ -524,7 +524,7 @@ enum eap_type { #define P80211_OUI_LEN 3 -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) || defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8711FW) struct ieee80211_snap_hdr { @@ -757,7 +757,6 @@ struct ieee80211_frag_entry { u8 dst_addr[ETH_ALEN]; }; -#ifndef PLATFORM_FREEBSD //Baron BSD has already defined struct ieee80211_stats { uint tx_unicast_frames; uint tx_multicast_frames; @@ -781,7 +780,7 @@ struct ieee80211_stats { uint rx_message_in_msg_fragments; uint rx_message_in_bad_msg_fragments; }; -#endif //PLATFORM_FREEBSD + struct ieee80211_softmac_stats{ uint rx_ass_ok; uint rx_ass_err; @@ -1095,10 +1094,7 @@ join_res: > 0: TID */ -#ifndef PLATFORM_FREEBSD //Baron BSD has already defined - enum ieee80211_state { - /* the card is not linked at all */ IEEE80211_NOLINK = 0, @@ -1135,7 +1131,6 @@ enum ieee80211_state { IEEE80211_LINKED_SCANNING, }; -#endif //PLATFORM_FREEBSD #define DEFAULT_MAX_SCAN_AGE (15 * HZ) #define DEFAULT_FTS 2346 @@ -1268,9 +1263,7 @@ enum rtw_ieee80211_back_parties { #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs) * 00:50:F2 */ -#ifndef PLATFORM_FREEBSD //Baron BSD has defined #define WME_OUI_TYPE 2 -#endif //PLATFORM_FREEBSD #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0 #define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1 #define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2 diff --git a/include/osdep_intf.h b/include/osdep_intf.h index c588a9a..c52ba90 100644 --- a/include/osdep_intf.h +++ b/include/osdep_intf.h @@ -123,11 +123,6 @@ static void rtw_proc_remove_one(struct net_device *dev){} #endif //!CONFIG_PROC_DEBUG #endif //PLATFORM_LINUX - -#ifdef PLATFORM_FREEBSD -extern int rtw_ioctl(struct ifnet * ifp, u_long cmd, caddr_t data); -#endif - void rtw_ips_dev_unload(_adapter *padapter); #ifdef CONFIG_RF_GAIN_OFFSET diff --git a/include/rtw_led.h b/include/rtw_led.h index f7567b5..bf6ff6b 100644 --- a/include/rtw_led.h +++ b/include/rtw_led.h @@ -128,7 +128,7 @@ typedef struct _LED_871x{ u8 bLedStartToLinkBlinkInProgress; u8 bLedScanBlinkInProgress; - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)|| defined PLATFORM_FREEBSD + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) _workitem BlinkWorkItem; // Workitem used by BlinkTimer to manipulate H/W to blink LED. #endif #endif //defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index 8ae3631..e97f633 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -616,7 +616,7 @@ extern void _rtw_scan_timeout_handler ( #endif -#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD) +#if defined (PLATFORM_LINUX) extern int event_thread(void *context); extern void rtw_join_timeout_handler(void* FunctionContext); extern void _rtw_scan_timeout_handler(void* FunctionContext); diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 842b0bf..25e3a92 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -277,14 +277,9 @@ struct recv_priv #endif //CONFIG_USB_INTERRUPT_IN_PIPE #endif -#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) -#ifdef PLATFORM_FREEBSD - struct task irq_prepare_beacon_tasklet; - struct task recv_tasklet; -#else //PLATFORM_FREEBSD +#if defined(PLATFORM_LINUX) struct tasklet_struct irq_prepare_beacon_tasklet; struct tasklet_struct recv_tasklet; -#endif //PLATFORM_FREEBSD struct sk_buff_head free_recv_skb_queue; struct sk_buff_head rx_skb_queue; #ifdef CONFIG_RX_INDICATE_QUEUE @@ -295,7 +290,7 @@ struct recv_priv #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX _queue recv_buf_pending_queue; #endif // CONFIG_USE_USB_BUFFER_ALLOC_RX -#endif //defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) +#endif //defined(PLATFORM_LINUX) u8 *pallocated_recv_buf; u8 *precv_buf; // 4 alignment @@ -380,7 +375,7 @@ struct recv_buf #ifdef CONFIG_USB_HCI - #if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX)||defined(PLATFORM_FREEBSD) + #if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX) PURB purb; dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ u32 alloc_sz; @@ -403,10 +398,6 @@ struct recv_buf _pkt *pskb; u8 reuse; #endif -#ifdef PLATFORM_FREEBSD //skb solution - struct sk_buff *pskb; - u8 reuse; -#endif //PLATFORM_FREEBSD //skb solution }; diff --git a/include/rtw_security.h b/include/rtw_security.h index f4ca99b..c97d670 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -440,7 +440,4 @@ void rtw_use_tkipkey_handler ( void rtw_use_tkipkey_handler(void* FunctionContext); #endif -#ifdef PLATFORM_FREEBSD -void rtw_use_tkipkey_handler(void* FunctionContext); -#endif //PLATFORM_FREEBSD #endif //__RTL871X_SECURITY_H_ diff --git a/include/rtw_xmit.h b/include/rtw_xmit.h index 73a7cc5..936e8b1 100644 --- a/include/rtw_xmit.h +++ b/include/rtw_xmit.h @@ -23,9 +23,6 @@ #include #include #include -#ifdef PLATFORM_FREEBSD -#include -#endif //PLATFORM_FREEBSD #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) //#define MAX_XMITBUF_SZ (30720)// (2048) @@ -255,13 +252,6 @@ struct pkt_attrib #endif }; -#ifdef PLATFORM_FREEBSD -#define ETH_ALEN 6 /* Octets in one ethernet addr */ -#define ETH_HLEN 14 /* Total octets in header. */ -#define ETH_P_IP 0x0800 /* Internet Protocol packet */ - -#endif //PLATFORM_FREEBSD - #define WLANHDR_OFFSET 64 #define NULL_FRAMETAG (0x0) @@ -332,7 +322,7 @@ struct xmit_buf //u32 sz[8]; u32 ff_hwaddr; -#if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX) PURB pxmit_urb[8]; dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ #endif @@ -521,9 +511,6 @@ struct xmit_priv { #endif #ifdef PLATFORM_LINUX struct tasklet_struct xmit_tasklet; -#endif -#ifdef PLATFORM_FREEBSD - struct task xmit_tasklet; #endif //per AC pending irp int beq_cnt; diff --git a/include/usb_ops.h b/include/usb_ops.h index f46ae69..b833ad7 100644 --- a/include/usb_ops.h +++ b/include/usb_ops.h @@ -84,14 +84,7 @@ void rtl8192du_set_hw_type(_adapter *padapter); #define hal_set_hw_type rtl8192du_set_hw_type void rtl8192du_set_intf_ops(struct _io_ops *pops); #define usb_set_intf_ops rtl8192du_set_intf_ops -#ifndef PLATFORM_FREEBSD void rtl8192du_recv_tasklet(void *priv); -#else // PLATFORM_FREEBSD -void rtl8192du_recv_tasklet(void *priv, int npending); -#ifdef CONFIG_RX_INDICATE_QUEUE -void rtw_rx_indicate_tasklet(void *priv, int npending); -#endif // CONFIG_RX_INDICATE_QUEUE -#endif // PLATFORM_FREEBSD void rtl8192du_xmit_tasklet(void *priv); #endif diff --git a/include/wifi.h b/include/wifi.h index 24d134a..f26e22b 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -672,7 +672,7 @@ struct rtw_ieee80211_bar { #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 - #if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW) || defined(PLATFORM_FREEBSD) + #if defined(PLATFORM_LINUX) diff --git a/include/wlan_bssdef.h b/include/wlan_bssdef.h index c5fd1f5..2e89d70 100644 --- a/include/wlan_bssdef.h +++ b/include/wlan_bssdef.h @@ -270,251 +270,6 @@ typedef struct _NDIS_802_11_TEST #endif //end of #ifdef PLATFORM_LINUX -#ifdef PLATFORM_FREEBSD - -#define NDIS_802_11_LENGTH_SSID 32 -#define NDIS_802_11_LENGTH_RATES 8 -#define NDIS_802_11_LENGTH_RATES_EX 16 - -typedef unsigned char NDIS_802_11_MAC_ADDRESS[6]; -typedef long NDIS_802_11_RSSI; // in dBm -typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates -typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates - - -typedef ULONG NDIS_802_11_KEY_INDEX; -typedef unsigned long long NDIS_802_11_KEY_RSC; - - -typedef struct _NDIS_802_11_SSID -{ - ULONG SsidLength; - UCHAR Ssid[32]; -} NDIS_802_11_SSID, *PNDIS_802_11_SSID; - -typedef enum _NDIS_802_11_NETWORK_TYPE -{ - Ndis802_11FH, - Ndis802_11DS, - Ndis802_11OFDM5, - Ndis802_11OFDM24, - Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound -} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; - -typedef struct _NDIS_802_11_CONFIGURATION_FH -{ - ULONG Length; // Length of structure - ULONG HopPattern; // As defined by 802.11, MSB set - ULONG HopSet; // to one if non-802.11 - ULONG DwellTime; // units are Kusec -} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH; - - -/* - FW will only save the channel number in DSConfig. - ODI Handler will convert the channel number to freq. number. -*/ -typedef struct _NDIS_802_11_CONFIGURATION -{ - ULONG Length; // Length of structure - ULONG BeaconPeriod; // units are Kusec - ULONG ATIMWindow; // units are Kusec - ULONG DSConfig; // Frequency, units are kHz - NDIS_802_11_CONFIGURATION_FH FHConfig; -} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION; - - - -typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE -{ - Ndis802_11IBSS, - Ndis802_11Infrastructure, - Ndis802_11AutoUnknown, - Ndis802_11InfrastructureMax, // Not a real value, defined as upper bound - Ndis802_11APMode -} NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE; - - - - - -typedef struct _NDIS_802_11_FIXED_IEs -{ - UCHAR Timestamp[8]; - USHORT BeaconInterval; - USHORT Capabilities; -} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs; - - - -typedef struct _NDIS_802_11_VARIABLE_IEs -{ - UCHAR ElementID; - UCHAR Length; - UCHAR data[1]; -} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; - - - -/* - - - -Length is the 4 bytes multiples of the sume of - sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG) -+ sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION) -+ sizeof (NDIS_802_11_RATES_EX) + IELength - -Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the -partial sum. - -*/ - -typedef enum _NDIS_802_11_AUTHENTICATION_MODE -{ - Ndis802_11AuthModeOpen, - Ndis802_11AuthModeShared, - Ndis802_11AuthModeAutoSwitch, - Ndis802_11AuthModeWPA, - Ndis802_11AuthModeWPAPSK, - Ndis802_11AuthModeWPANone, - Ndis802_11AuthModeMax // Not a real mode, defined as upper bound -} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE; - -typedef enum _NDIS_802_11_WEP_STATUS -{ - Ndis802_11WEPEnabled, - Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, - Ndis802_11WEPDisabled, - Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, - Ndis802_11WEPKeyAbsent, - Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, - Ndis802_11WEPNotSupported, - Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, - Ndis802_11Encryption2Enabled, - Ndis802_11Encryption2KeyAbsent, - Ndis802_11Encryption3Enabled, - Ndis802_11Encryption3KeyAbsent -} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, - NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; - - -#define NDIS_802_11_AI_REQFI_CAPABILITIES 1 -#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2 -#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4 - -#define NDIS_802_11_AI_RESFI_CAPABILITIES 1 -#define NDIS_802_11_AI_RESFI_STATUSCODE 2 -#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4 - -typedef struct _NDIS_802_11_AI_REQFI -{ - USHORT Capabilities; - USHORT ListenInterval; - NDIS_802_11_MAC_ADDRESS CurrentAPAddress; -} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI; - -typedef struct _NDIS_802_11_AI_RESFI -{ - USHORT Capabilities; - USHORT StatusCode; - USHORT AssociationId; -} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI; - -typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION -{ - ULONG Length; - USHORT AvailableRequestFixedIEs; - NDIS_802_11_AI_REQFI RequestFixedIEs; - ULONG RequestIELength; - ULONG OffsetRequestIEs; - USHORT AvailableResponseFixedIEs; - NDIS_802_11_AI_RESFI ResponseFixedIEs; - ULONG ResponseIELength; - ULONG OffsetResponseIEs; -} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; - -typedef enum _NDIS_802_11_RELOAD_DEFAULTS -{ - Ndis802_11ReloadWEPKeys -} NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS; - - -// Key mapping keys require a BSSID -typedef struct _NDIS_802_11_KEY -{ - ULONG Length; // Length of this structure - ULONG KeyIndex; - ULONG KeyLength; // length of key in bytes - NDIS_802_11_MAC_ADDRESS BSSID; - NDIS_802_11_KEY_RSC KeyRSC; - UCHAR KeyMaterial[32]; // variable length depending on above field -} NDIS_802_11_KEY, *PNDIS_802_11_KEY; - -typedef struct _NDIS_802_11_REMOVE_KEY -{ - ULONG Length; // Length of this structure - ULONG KeyIndex; - NDIS_802_11_MAC_ADDRESS BSSID; -} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY; - -typedef struct _NDIS_802_11_WEP -{ - ULONG Length; // Length of this structure - ULONG KeyIndex; // 0 is the per-client key, 1-N are the global keys - ULONG KeyLength; // length of key in bytes - UCHAR KeyMaterial[16];// variable length depending on above field -} NDIS_802_11_WEP, *PNDIS_802_11_WEP; - -typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST -{ - ULONG Length; // Length of structure - NDIS_802_11_MAC_ADDRESS Bssid; - ULONG Flags; -} NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST; - -typedef enum _NDIS_802_11_STATUS_TYPE -{ - Ndis802_11StatusType_Authentication, - Ndis802_11StatusType_MediaStreamMode, - Ndis802_11StatusType_PMKID_CandidateList, - Ndis802_11StatusTypeMax // not a real type, defined as an upper bound -} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE; - -typedef struct _NDIS_802_11_STATUS_INDICATION -{ - NDIS_802_11_STATUS_TYPE StatusType; -} NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION; - -// mask for authentication/integrity fields -#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f -#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01 -#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02 -#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06 -#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E - -// MIC check time, 60 seconds. -#define MIC_CHECK_TIME 60000000 - -typedef struct _NDIS_802_11_AUTHENTICATION_EVENT -{ - NDIS_802_11_STATUS_INDICATION Status; - NDIS_802_11_AUTHENTICATION_REQUEST Request[1]; -} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT; - -typedef struct _NDIS_802_11_TEST -{ - ULONG Length; - ULONG Type; - union - { - NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent; - NDIS_802_11_RSSI RssiTrigger; - }tt; -} NDIS_802_11_TEST, *PNDIS_802_11_TEST; - - -#endif //PLATFORM_FREEBSD #ifndef Ndis802_11APMode #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) #endif