Пример #1
0
int r8180_wx_set_key(struct net_device *dev, struct iw_request_info *info, 
		     union iwreq_data *wrqu, char *key)
{
	struct r8180_priv *priv = ieee80211_priv(dev);
	struct iw_point *erq = &(wrqu->encoding);	

	if (erq->flags & IW_ENCODE_DISABLED) {
	}
	
	
/*	i = erq->flags & IW_ENCODE_INDEX;
	if (i < 1 || i > 4)
*/	
	
	if (erq->length > 0) {

		//int len = erq->length <= 5 ? 5 : 13;
		
		u32* tkey= (u32*) key;
		priv->key0[0] = tkey[0];
		priv->key0[1] = tkey[1];
		priv->key0[2] = tkey[2];
		priv->key0[3] = tkey[3] &0xff;
		DMESG("Setting wep key to %x %x %x %x", 
		      tkey[0],tkey[1],tkey[2],tkey[3]);
		rtl8180_set_hw_wep(dev);
	}
	return 0;
}
int r8180_wx_set_key(struct net_device *dev, struct iw_request_info *info,
		     union iwreq_data *wrqu, char *key)
{
	struct r8180_priv *priv = ieee80211_priv(dev);
	struct iw_point *erq = &(wrqu->encoding);

	if (priv->ieee80211->bHwRadioOff)
		return 0;

	if (erq->length > 0) {
		u32* tkey = (u32*) key;
		priv->key0[0] = tkey[0];
		priv->key0[1] = tkey[1];
		priv->key0[2] = tkey[2];
		priv->key0[3] = tkey[3] & 0xff;
		DMESG("Setting wep key to %x %x %x %x",
		      tkey[0], tkey[1], tkey[2], tkey[3]);
		rtl8180_set_hw_wep(dev);
	}
	return 0;
}