From: Larry Finger Date: Thu, 14 Jul 2011 22:08:46 +0000 (-0500) Subject: staging: rtl8192e: Remove dead code associated with CONFIG_CFG_80211 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1bd7bcfc633eeb821b85a90067be2bea79510d39;p=linux-beck.git staging: rtl8192e: Remove dead code associated with CONFIG_CFG_80211 Signed-off-by: Larry Finger --- diff --git a/drivers/staging/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl_core.c index 7c89ed87f3bb..59bf9b15043d 100644 --- a/drivers/staging/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl_core.c @@ -1387,14 +1387,6 @@ short rtl8192_init(struct net_device *dev) priv->ops->init_adapter_variable(dev); rtl8192_get_channel_map(dev); -#ifdef CONFIG_CFG_80211 - /* channel map setting for the cfg80211 style */ - { - struct r8192_priv* priv = rtllib_priv(dev); - rtllib_set_geo(priv); - } -#endif - init_hal_dm(dev); init_timer(&priv->watch_dog_timer); @@ -3093,11 +3085,6 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev, goto fail1; } -#ifdef CONFIG_CFG_80211 - if (!rtl8192_register_wiphy_dev(dev)) - goto fail1; -#endif - netif_carrier_off(dev); netif_stop_queue(dev); diff --git a/drivers/staging/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl_core.h index 526a2599b192..ec977870f5d7 100644 --- a/drivers/staging/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl_core.h @@ -56,10 +56,6 @@ #include "r8190P_def.h" #include "r8192E_dev.h" -#ifdef CONFIG_CFG_80211 -#include "rtl_regd.h" -#endif - #ifdef CONFIG_RTL_RFKILL #include "rtl_rfkill.h" #endif @@ -660,11 +656,6 @@ typedef struct r8192_priv void (*rf_close)(struct net_device *dev); void (*rf_init)(struct net_device *dev); -#ifdef CONFIG_CFG_80211 - struct ieee80211_rate rates[IEEE80211_NUM_BANDS][RTL_RATE_MAX]; - struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; -#endif - rx_desc *rx_ring[MAX_RX_QUEUE]; struct sk_buff *rx_buf[MAX_RX_QUEUE][MAX_RX_COUNT]; dma_addr_t rx_ring_dma[MAX_RX_QUEUE]; @@ -1144,8 +1135,4 @@ ActUpdateChannelAccessSetting( PCHANNEL_ACCESS_SETTING ChnlAccessSetting ); -#ifdef CONFIG_CFG_80211 -struct net_device *wiphy_to_net_device(struct wiphy *wiphy); -#endif - #endif diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 1e99c7bcfac5..4ecfe5f0e083 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -35,10 +35,6 @@ #include #include -#ifdef CONFIG_CFG_80211 -#include -#endif - #include "rtl819x_HT.h" #include "rtl819x_BA.h" #include "rtl819x_TS.h" @@ -854,7 +850,6 @@ enum _REG_PREAMBLE_MODE{ #define WLAN_GET_SEQ_FRAG(seq) ((seq) & RTLLIB_SCTL_FRAG) #define WLAN_GET_SEQ_SEQ(seq) (((seq) & RTLLIB_SCTL_SEQ) >> 4) -#ifndef CONFIG_CFG_80211 /* Authentication algorithms */ #define WLAN_AUTH_OPEN 0 #define WLAN_AUTH_SHARED_KEY 1 @@ -942,7 +937,6 @@ enum rtllib_reasoncode { WLAN_REASON_IEEE8021X_FAILED = 23, WLAN_REASON_CIPHER_SUITE_REJECTED = 24, }; -#endif #define RTLLIB_STATMASK_SIGNAL (1<<0) #define RTLLIB_STATMASK_RSSI (1<<1) @@ -2106,145 +2100,6 @@ typedef struct _RT_PMKID_LIST u16 ssid_length; } RT_PMKID_LIST, *PRT_PMKID_LIST; -#ifdef CONFIG_CFG_80211 -enum { - LIBIPW_CH_PASSIVE_ONLY = (1 << 0), - LIBIPW_CH_80211H_RULES = (1 << 1), - LIBIPW_CH_B_ONLY = (1 << 2), - LIBIPW_CH_NO_IBSS = (1 << 3), - LIBIPW_CH_UNIFORM_SPREADING = (1 << 4), - LIBIPW_CH_RADAR_DETECT = (1 << 5), - LIBIPW_CH_INVALID = (1 << 6), -}; -struct rtllib_channel { - u32 freq; - u8 channel; - u8 flags; - u8 max_power; -}; - -#define RTLLIB_24GHZ_MIN_CHANNEL 1 -#define RTLLIB_24GHZ_MAX_CHANNEL 14 -#define RTLLIB_24GHZ_CHANNELS (RTLLIB_24GHZ_MAX_CHANNEL - \ - RTLLIB_24GHZ_MIN_CHANNEL + 1) - -struct reg_dmn_pair_mapping { - u16 regDmnEnum; - u16 reg_5ghz_ctl; - u16 reg_2ghz_ctl; -}; - -struct rtl_regulatory { - char alpha2[2]; - u16 country_code; - u16 max_power_level; - u32 tp_scale; - u16 current_rd; - u16 current_rd_ext; - int16_t power_limit; - struct reg_dmn_pair_mapping *regpair; -}; - -struct ieee80211_bss { - /* Yes, this is a hack */ - struct cfg80211_bss cbss; - - /* don't want to look up all the time */ - size_t ssid_len; - u8 ssid[IEEE80211_MAX_SSID_LEN]; - - u8 dtim_period; - - bool wmm_used; - - unsigned long last_probe_resp; - -#ifdef CONFIG_MAC80211_MESH - u8 *mesh_id; - size_t mesh_id_len; - u8 *mesh_cfg; -#endif - - #define IEEE80211_MAX_SUPP_RATES 32 - u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; - size_t supp_rates_len; - - /* - * During assocation, we save an ERP value from a probe response so - * that we can feed ERP info to the driver when handling the - * association completes. these fields probably won't be up-to-date - * otherwise, you probably don't want to use them. - */ - bool has_erp_value; - u8 erp_value; -}; - -/* Parsed Information Elements */ -struct ieee802_11_elems { - u8 *ie_start; - size_t total_len; - - /* pointers to IEs */ - u8 *ssid; - u8 *supp_rates; - u8 *fh_params; - u8 *ds_params; - u8 *cf_params; - struct ieee80211_tim_ie *tim; - u8 *ibss_params; - u8 *challenge; - u8 *wpa; - u8 *rsn; - u8 *erp_info; - u8 *ext_supp_rates; - u8 *wmm_info; - u8 *wmm_param; - struct ieee80211_ht_cap *ht_cap_elem; - struct ieee80211_ht_info *ht_info_elem; - u8 *mesh_config; - u8 *mesh_id; - u8 *peer_link; - u8 *preq; - u8 *prep; - u8 *perr; - u8 *ch_switch_elem; - u8 *country_elem; - u8 *pwr_constr_elem; - u8 *quiet_elem; /* first quite element */ - u8 *timeout_int; - - /* length of them, respectively */ - u8 ssid_len; - u8 supp_rates_len; - u8 fh_params_len; - u8 ds_params_len; - u8 cf_params_len; - u8 tim_len; - u8 ibss_params_len; - u8 challenge_len; - u8 wpa_len; - u8 rsn_len; - u8 erp_info_len; - u8 ext_supp_rates_len; - u8 wmm_info_len; - u8 wmm_param_len; - u8 mesh_config_len; - u8 mesh_id_len; - u8 peer_link_len; - u8 preq_len; - u8 prep_len; - u8 perr_len; - u8 ch_switch_elem_len; - u8 country_elem_len; - u8 pwr_constr_elem_len; - u8 quiet_elem_len; - u8 num_of_quiet_elem; /* can be more the one */ - u8 timeout_int_len; -}; - -#endif - - typedef struct _RT_INTEL_PROMISCUOUS_MODE_INFO { bool bPromiscuousOn; bool bFilterSourceStationFrame; @@ -2283,10 +2138,6 @@ struct rtllib_device { HT_EXTCHNL_OFFSET chan_offset_bk; HT_CHANNEL_WIDTH bandwidth_bk; u8 hwscan_sem_up; -#ifdef CONFIG_CFG_80211 - struct wireless_dev wdev; - struct rtl_regulatory regulatory; -#endif u8 CntAfterLink; RT_OP_MODE OpMode; diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index 2182e56f0d23..6a33bff11dc7 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -56,26 +56,6 @@ #define DRV_NAME "rtllib_92e" -#ifdef CONFIG_CFG_80211 -#ifdef CONFIG_RTL_RFKILL -static inline void rtllib_rfkill_poll(struct wiphy *wiphy) -{ - struct rtllib_device *rtllib = NULL; - - rtllib = (struct rtllib_device *)wiphy_priv(wiphy); - - rtllib = (struct rtllib_device *)netdev_priv_rsl(rtllib->dev); - - if (rtllib->rtllib_rfkill_poll) - rtllib->rtllib_rfkill_poll(rtllib->dev); -} -#else -static inline void rtllib_rfkill_poll(struct wiphy *wiphy) {} -#endif -struct cfg80211_ops rtllib_config_ops = {.rfkill_poll = rtllib_rfkill_poll }; -void *rtllib_wiphy_privid = &rtllib_wiphy_privid; -#endif - void _setup_timer( struct timer_list* ptimer, void* fun, unsigned long data ) { ptimer->function = fun; @@ -121,43 +101,6 @@ static inline void rtllib_networks_initialize(struct rtllib_device *ieee) list_add_tail(&ieee->networks[i].list, &ieee->network_free_list); } -#if defined CONFIG_CFG_80211 -static bool rtllib_wdev_alloc(struct rtllib_device *ieee, int sizeof_priv) -{ - int priv_size; - struct rtllib_device *rtllib = NULL; - - priv_size = ALIGN(sizeof(struct rtllib_device),NETDEV_ALIGN) + sizeof_priv; - - ieee->wdev.wiphy = wiphy_new(&rtllib_config_ops, priv_size); - if (!ieee->wdev.wiphy) { - RTLLIB_ERROR("Unable to allocate wiphy.\n"); - goto out_err_new; - } - - rtllib = (struct rtllib_device *)wiphy_priv(ieee->wdev.wiphy); - rtllib->dev = ieee->dev; - - ieee->dev->ieee80211_ptr = &ieee->wdev; - ieee->wdev.iftype = NL80211_IFTYPE_STATION; - - /* Fill-out wiphy structure bits we know... Not enough info - * here to call set_wiphy_dev or set MAC address or channel info - * -- have to do that in ->ndo_init... */ - ieee->wdev.wiphy->privid = rtllib_wiphy_privid; - - ieee->wdev.wiphy->max_scan_ssids = 1; - ieee->wdev.wiphy->max_scan_ie_len = 0; - ieee->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); - - return true; - -out_err_new: - wiphy_free(ieee->wdev.wiphy); - return false; -} -#endif - struct net_device *alloc_rtllib(int sizeof_priv) { struct rtllib_device *ieee = NULL; @@ -175,10 +118,6 @@ struct net_device *alloc_rtllib(int sizeof_priv) memset(ieee, 0, sizeof(struct rtllib_device)+sizeof_priv); ieee->dev = dev; -#ifdef CONFIG_CFG_80211 - if (!rtllib_wdev_alloc(ieee, sizeof_priv)) - goto failed; -#endif err = rtllib_networks_allocate(ieee); if (err) { RTLLIB_ERROR("Unable to allocate beacon storage: %d\n", @@ -277,10 +216,6 @@ void free_rtllib(struct net_device *dev) } rtllib_networks_free(ieee); -#ifdef CONFIG_CFG_80211 - wiphy_unregister(ieee->wdev.wiphy); - wiphy_free(ieee->wdev.wiphy); -#endif free_netdev(dev); } diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index f4f7ec509b3b..cef04e59515f 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -45,276 +45,6 @@ #include "rtllib.h" #include "dot11d.h" -#if defined CONFIG_CFG_80211 -#include - -struct ieee80211_channel *rtllib_get_channel(struct wiphy *wiphy, - int freq) -{ - enum ieee80211_band band; - struct ieee80211_supported_band *sband; - int i; - - for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - sband = wiphy->bands[band]; - - if (!sband) - continue; - - for (i = 0; i < sband->n_channels; i++) { - if (sband->channels[i].center_freq == freq) - return &sband->channels[i]; - } - } - - return NULL; -} - -int rtllib_channel_to_frequency(int chan) -{ - if (chan < 14) - return 2407 + chan * 5; - - if (chan == 14) - return 2484; - - /* FIXME: 802.11j 17.3.8.3.2 */ - return (chan + 1000) * 5; -} - -u32 rtllib_parse_elems_crc(u8 *start, size_t len, - struct ieee802_11_elems *elems, - u64 filter, u32 crc) -{ - size_t left = len; - u8 *pos = start; - bool calc_crc = filter != 0; - - memset(elems, 0, sizeof(*elems)); - elems->ie_start = start; - elems->total_len = len; - - while (left >= 2) { - u8 id, elen; - - id = *pos++; - elen = *pos++; - left -= 2; - - if (elen > left) - break; - - if (calc_crc && id < 64 && (filter & BIT(id))) - crc = crc32_be(crc, pos - 2, elen + 2); - - switch (id) { - case WLAN_EID_SSID: - elems->ssid = pos; - elems->ssid_len = elen; - break; - case WLAN_EID_SUPP_RATES: - elems->supp_rates = pos; - elems->supp_rates_len = elen; - break; - case WLAN_EID_FH_PARAMS: - elems->fh_params = pos; - elems->fh_params_len = elen; - break; - case WLAN_EID_DS_PARAMS: - elems->ds_params = pos; - elems->ds_params_len = elen; - break; - case WLAN_EID_CF_PARAMS: - elems->cf_params = pos; - elems->cf_params_len = elen; - break; - case WLAN_EID_TIM: - if (elen >= sizeof(struct ieee80211_tim_ie)) { - elems->tim = (void *)pos; - elems->tim_len = elen; - } - break; - case WLAN_EID_IBSS_PARAMS: - elems->ibss_params = pos; - elems->ibss_params_len = elen; - break; - case WLAN_EID_CHALLENGE: - elems->challenge = pos; - elems->challenge_len = elen; - break; - case WLAN_EID_VENDOR_SPECIFIC: - if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 && - pos[2] == 0xf2) { - /* Microsoft OUI (00:50:F2) */ - - if (calc_crc) - crc = crc32_be(crc, pos - 2, elen + 2); - - if (pos[3] == 1) { - /* OUI Type 1 - WPA IE */ - elems->wpa = pos; - elems->wpa_len = elen; - } else if (elen >= 5 && pos[3] == 2) { - /* OUI Type 2 - WMM IE */ - if (pos[4] == 0) { - elems->wmm_info = pos; - elems->wmm_info_len = elen; - } else if (pos[4] == 1) { - elems->wmm_param = pos; - elems->wmm_param_len = elen; - } - } - } - break; - case WLAN_EID_RSN: - elems->rsn = pos; - elems->rsn_len = elen; - break; - case WLAN_EID_ERP_INFO: - elems->erp_info = pos; - elems->erp_info_len = elen; - break; - case WLAN_EID_EXT_SUPP_RATES: - elems->ext_supp_rates = pos; - elems->ext_supp_rates_len = elen; - break; - case WLAN_EID_HT_CAPABILITY: - if (elen >= sizeof(struct ieee80211_ht_cap)) - elems->ht_cap_elem = (void *)pos; - break; - case WLAN_EID_HT_INFORMATION: - if (elen >= sizeof(struct ieee80211_ht_info)) - elems->ht_info_elem = (void *)pos; - break; - case WLAN_EID_MESH_ID: - elems->mesh_id = pos; - elems->mesh_id_len = elen; - break; - case WLAN_EID_MESH_CONFIG: - elems->mesh_config = pos; - elems->mesh_config_len = elen; - break; - case WLAN_EID_PEER_LINK: - elems->peer_link = pos; - elems->peer_link_len = elen; - break; - case WLAN_EID_PREQ: - elems->preq = pos; - elems->preq_len = elen; - break; - case WLAN_EID_PREP: - elems->prep = pos; - elems->prep_len = elen; - break; - case WLAN_EID_PERR: - elems->perr = pos; - elems->perr_len = elen; - break; - case WLAN_EID_CHANNEL_SWITCH: - elems->ch_switch_elem = pos; - elems->ch_switch_elem_len = elen; - break; - case WLAN_EID_QUIET: - if (!elems->quiet_elem) { - elems->quiet_elem = pos; - elems->quiet_elem_len = elen; - } - elems->num_of_quiet_elem++; - break; - case WLAN_EID_COUNTRY: - elems->country_elem = pos; - elems->country_elem_len = elen; - break; - case WLAN_EID_PWR_CONSTRAINT: - elems->pwr_constr_elem = pos; - elems->pwr_constr_elem_len = elen; - break; - case WLAN_EID_TIMEOUT_INTERVAL: - elems->timeout_int = pos; - elems->timeout_int_len = elen; - break; - default: - break; - } - - left -= elen; - pos += elen; - } - - return crc; -} - -void rtllib_parse_elems(u8 *start, size_t len, - struct ieee802_11_elems *elems) -{ - rtllib_parse_elems_crc(start, len, elems, 0, 0); -} - -void ieee80211_scan_rx(struct rtllib_device *ieee, struct sk_buff *skb, struct rtllib_rx_stats *rx_status) -{ - struct rtllib_hdr_4addr *header = (struct rtllib_hdr_4addr *)skb->data ; - struct ieee80211_mgmt *mgmt; - struct ieee80211_bss *bss; - u8 *elements; - struct ieee80211_channel *channel; - size_t baselen; - int freq; - __le16 fc; - bool presp, beacon = false; - struct ieee802_11_elems elems; - s32 signal = 0; - - if (skb->len < 2) - return; - - mgmt = (struct ieee80211_mgmt *) skb->data; - fc = mgmt->frame_control; - - if (skb->len < 24) - return; - - presp = (WLAN_FC_GET_STYPE(header->frame_ctl) == RTLLIB_STYPE_PROBE_RESP); - if (presp) { - /* ignore ProbeResp to foreign address */ - if (memcmp(mgmt->da, ieee->dev->dev_addr, ETH_ALEN)) - return ;; - - presp = true; - elements = mgmt->u.probe_resp.variable; - baselen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); - } else { - beacon = (WLAN_FC_GET_STYPE(header->frame_ctl) == RTLLIB_STYPE_BEACON); - baselen = offsetof(struct ieee80211_mgmt, u.beacon.variable); - elements = mgmt->u.beacon.variable; - } - - if (!presp && !beacon) - return; - - if (baselen > skb->len) - return; - - rtllib_parse_elems(elements, skb->len - baselen, &elems); - - if (elems.ds_params && elems.ds_params_len == 1) - freq = rtllib_channel_to_frequency(elems.ds_params[0]); - else - return; - - channel = rtllib_get_channel(ieee->wdev.wiphy, freq); - - if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) - return; - - signal = rx_status->signal * 100; - - bss = (void *)cfg80211_inform_bss_frame(ieee->wdev.wiphy, channel, - mgmt, skb->len, signal, GFP_ATOMIC); - - return; -} -#endif - static inline void rtllib_monitor_rx(struct rtllib_device *ieee, struct sk_buff *skb,struct rtllib_rx_stats *rx_status, size_t hdr_length) @@ -499,7 +229,6 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb, return 0; } -#ifndef CONFIG_CFG_80211 /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ static unsigned char rfc1042_header[] = @@ -508,7 +237,6 @@ static unsigned char rfc1042_header[] = static unsigned char bridge_tunnel_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; /* No encapsulation header if EtherType < 0x600 (=length) */ -#endif /* Called by rtllib_rx_frame_decrypt */ static int rtllib_is_eapol_frame(struct rtllib_device *ieee,