Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3591733d authored by Mike McCormack's avatar Mike McCormack Committed by Larry Finger
Browse files

rtl8192e: Remove WIRELESS_EXT macro checks



Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
parent 5ad60c97
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -3564,12 +3564,7 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
	dev->hard_start_xmit = rtllib_xmit;
#endif

#if WIRELESS_EXT >= 12
#if WIRELESS_EXT < 17
        dev->get_wireless_stats = r8192_get_wireless_stats;
#endif
        dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
#endif
	dev->ethtool_ops = &rtl819x_ethtool_ops;

	dev->type = ARPHRD_ETHER;
@@ -3817,8 +3812,6 @@ static int __init rtl8192_pci_module_init(void)
#endif
	printk(KERN_INFO "\nLinux kernel driver for RTL8192E WLAN cards\n");
	printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan Driver\n");
	RT_TRACE(COMP_INIT, "Initializing module");
	RT_TRACE(COMP_INIT, "Wireless extensions version %d", WIRELESS_EXT);

	error = rtl_create_debugfs_root();
	if (error) {
+5 −16
Original line number Diff line number Diff line
@@ -480,10 +480,8 @@ static int rtl8192_wx_get_range(struct net_device *dev,
	}
	range->num_frequency = val;
	range->num_channels = val;
#if WIRELESS_EXT > 17
	range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2|
			  IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP;
#endif
	range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE;

        /* Event capability (kernel + driver) */
@@ -521,7 +519,6 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
	if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true)
		return -EAGAIN;

#if WIRELESS_EXT > 17
	if (wrqu->data.flags & IW_SCAN_THIS_ESSID)
	{
		struct iw_scan_req* req = (struct iw_scan_req*)b;
@@ -531,7 +528,6 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
			memcpy(ieee->current_network.ssid, req->essid, req->essid_len);
		}
	}
#endif

	down(&priv->wx_sem);

@@ -1018,8 +1014,6 @@ static int r8192_wx_set_sens(struct net_device *dev,
	return err;
}

#if (WIRELESS_EXT >= 18)

static int r8192_wx_set_enc_ext(struct net_device *dev,
                                        struct iw_request_info *info,
                                        union iwreq_data *wrqu, char *extra)
@@ -1176,7 +1170,6 @@ static int r8192_wx_set_mlme(struct net_device *dev,
	up(&priv->wx_sem);
	return ret;
}
#endif

static int r8192_wx_set_gen_ie(struct net_device *dev,
                                        struct iw_request_info *info,
@@ -1303,13 +1296,11 @@ static iw_handler r8192_wx_handlers[] =
        IW_IOCTL(SIOCGIWENCODE) = r8192_wx_get_enc,
        IW_IOCTL(SIOCSIWPOWER) = r8192_wx_set_power,
        IW_IOCTL(SIOCGIWPOWER) = r8192_wx_get_power,
#if (WIRELESS_EXT >= 18)
	IW_IOCTL(SIOCSIWGENIE) = r8192_wx_set_gen_ie,
	IW_IOCTL(SIOCGIWGENIE) = r8192_wx_get_gen_ie,
	IW_IOCTL(SIOCSIWMLME) = r8192_wx_set_mlme,
	IW_IOCTL(SIOCSIWAUTH) = r8192_wx_set_auth,
	IW_IOCTL(SIOCSIWENCODEEXT) = r8192_wx_set_enc_ext,
#endif
};

/*
@@ -1502,8 +1493,6 @@ struct iw_handler_def r8192_wx_handlers_def={
	.private = r8192_private_handler,
	.num_private = sizeof(r8192_private_handler) / sizeof(iw_handler),
	.num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args),
#if WIRELESS_EXT >= 17
	.get_wireless_stats = r8192_get_wireless_stats,
#endif
	.private_args = (struct iw_priv_args *)r8192_private_args,
};
+0 −24
Original line number Diff line number Diff line
@@ -586,7 +586,6 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv)
}


#if WIRELESS_EXT >= 18
static void rtllib_michael_mic_failure(struct net_device *dev,
				       struct rtllib_hdr_4addr *hdr,
				       int keyidx)
@@ -607,29 +606,6 @@ static void rtllib_michael_mic_failure(struct net_device *dev,
	wrqu.data.length = sizeof(ev);
	wireless_send_event(dev, IWEVMICHAELMICFAILURE, &wrqu, (char *) &ev);
}
#elif WIRELESS_EXT >= 15
static void rtllib_michael_mic_failure(struct net_device *dev,
				       struct rtllib_hdr_4addr *hdr,
				       int keyidx)
{
	union iwreq_data wrqu;
	char buf[128];

	/* TODO: needed parameters: count, keyid, key type, TSC */
	sprintf(buf, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr="
		MAC_FMT ")", keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni",
		MAC_ARG(hdr->addr2));
	memset(&wrqu, 0, sizeof(wrqu));
	wrqu.data.length = strlen(buf);
	wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
}
#else /* WIRELESS_EXT >= 15 */
static inline void rtllib_michael_mic_failure(struct net_device *dev,
					      struct rtllib_hdr_4addr *hdr,
					      int keyidx)
{
}
#endif /* WIRELESS_EXT >= 15 */

static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx,
				     int hdr_len, void *priv, struct rtllib_device* ieee)
+1 −2
Original line number Diff line number Diff line
@@ -1818,11 +1818,10 @@ int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb,
		hdrlen += 4;
	}

#if WIRELESS_EXT > 15
	rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
	ieee->stats.rx_packets++;
	ieee->stats.rx_bytes += skb->len;
#endif

	return 1;
}

+1 −34
Original line number Diff line number Diff line
@@ -195,36 +195,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
	iwe.u.data.length = p - custom;
	if (iwe.u.data.length)
		start = iwe_stream_add_point_rsl(info, start, stop, &iwe, custom);
#if (WIRELESS_EXT < 18)
	if (ieee->wpa_enabled && network->wpa_ie_len){
		char buf[MAX_WPA_IE_LEN * 2 + 30];
		u8 *p = buf;
		p += sprintf(p, "wpa_ie=");
		for (i = 0; i < network->wpa_ie_len; i++) {
			p += sprintf(p, "%02x", network->wpa_ie[i]);
		}

		memset(&iwe, 0, sizeof(iwe));
		iwe.cmd = IWEVCUSTOM;
		iwe.u.data.length = strlen(buf);
		start = iwe_stream_add_point_rsl(info, start, stop, &iwe, buf);
        }

	if (ieee->wpa_enabled && network->rsn_ie_len){
		char buf[MAX_WPA_IE_LEN * 2 + 30];

		u8 *p = buf;
		p += sprintf(p, "rsn_ie=");
		for (i = 0; i < network->rsn_ie_len; i++) {
			p += sprintf(p, "%02x", network->rsn_ie[i]);
		}

		memset(&iwe, 0, sizeof(iwe));
		iwe.cmd = IWEVCUSTOM;
		iwe.u.data.length = strlen(buf);
		start = iwe_stream_add_point_rsl(info, start, stop, &iwe, buf);
        }
#else
	memset(&iwe, 0, sizeof(iwe));
	if (network->wpa_ie_len)
	{
@@ -255,7 +226,6 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
		iwe.u.data.length = network->wzc_ie_len;
		start = iwe_stream_add_point_rsl(info, start, stop, &iwe, buf);
        }
#endif
#endif

	/* Add EXTRA: Age to display seconds since last beacon/probe response
@@ -531,7 +501,7 @@ int rtllib_wx_get_encode(struct rtllib_device *ieee,

	return 0;
}
#if (WIRELESS_EXT >= 18)

int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
                               struct iw_request_info *info,
                               union iwreq_data *wrqu, char *extra)
@@ -850,11 +820,9 @@ int rtllib_wx_set_auth(struct rtllib_device *ieee,
	}
	return 0;
}
#endif

int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
{
#if (WIRELESS_EXT >= 18 )
	u8 *buf;
	u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};

@@ -896,6 +864,5 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
		ieee->wpa_ie = NULL;
		ieee->wpa_ie_len = 0;
	}
#endif
	return 0;
}