Changeset 1527
- Timestamp:
- 04/24/06 13:49:36 (3 years ago)
- Files:
-
- trunk/net80211/ieee80211_proto.c (modified) (1 diff)
- trunk/net80211/ieee80211_wireless.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/net80211/ieee80211_proto.c
r1520 r1527 958 958 /* 959 959 * Try to be intelligent about clocking the state 960 * machine. 961 * If forcescan is set, caller wants us to re-scan 962 * to find an appropriate ap. 963 * If we are in run state, we drop back down to 964 * associate to reapply any new state and/or parameters. 965 * If we are in some other state, then we are going 966 * to be able to automatically apply those parameters 967 * real soon now, so we don't muck with the state 968 * machine. 960 * machine. If we're currently in RUN state then 961 * we should be able to apply any new state/parameters 962 * simply by re-associating. Otherwise we need to 963 * re-scan to select an appropriate ap. 969 964 */ 970 if ( forcescan)965 if (vap->iv_state != IEEE80211_S_RUN || forcescan) 971 966 ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); 972 else if (vap->iv_state == IEEE80211_S_RUN)967 else 973 968 ieee80211_new_state(vap, IEEE80211_S_ASSOC, 1); 974 969 } else { trunk/net80211/ieee80211_wireless.c
r1526 r1527 3797 3797 3798 3798 3799 /* 3800 * The exact meaning of the IW_AUTH_ALG_* values is a little unclear. 3801 * For example, wpa_supplicant uses IW_AUTH_ALG_OPEN_SYSTEM for WPA-PSK 3802 * APs, unless you happen to set the auth_alg=SHARED option in your config 3803 * file in which case it uses IW_AUTH_ALG_SHARED_KEY. Fortunately, 3804 * neither makes a any difference to madwifi, so for now we ignore it. 3805 */ 3799 3806 static int 3800 3807 siwauth_80211_auth_alg(struct net_device *dev, 3801 3808 struct iw_request_info *info, struct iw_param *erq, char *buf) 3802 3809 { 3803 #define VALID_ALGS_MASK (IW_AUTH_ALG_OPEN_SYSTEM|IW_AUTH_ALG_SHARED_KEY|IW_AUTH_ALG_LEAP) 3804 int mode = erq->value; 3805 int args[2]; 3806 3807 args[0] = IEEE80211_PARAM_AUTHMODE; 3808 3809 if (mode & ~VALID_ALGS_MASK) { 3810 return -EINVAL; 3811 } 3812 if (mode & IW_AUTH_ALG_LEAP) { 3813 args[1] = IEEE80211_AUTH_8021X; 3814 } else if ((mode & IW_AUTH_ALG_SHARED_KEY) && 3815 (mode & IW_AUTH_ALG_OPEN_SYSTEM)) { 3816 args[1] = IEEE80211_AUTH_AUTO; 3817 } else if (mode & IW_AUTH_ALG_SHARED_KEY) { 3818 args[1] = IEEE80211_AUTH_SHARED; 3819 } else { 3820 args[1] = IEEE80211_AUTH_OPEN; 3821 } 3822 return ieee80211_ioctl_setparam(dev, NULL, NULL, (char*)args); 3823 #undef VALID_ALGS_MASK 3810 return -EOPNOTSUPP; 3824 3811 } 3825 3812 … … 4067 4054 struct iw_request_info *info, struct iw_param *erq, char *buf) 4068 4055 { 4069 int arg; 4070 int rc; 4071 4072 arg = IEEE80211_PARAM_AUTHMODE; 4073 rc = ieee80211_ioctl_getparam(dev, NULL, NULL, (char*)&arg); 4074 if (rc) 4075 return rc; 4076 4077 switch(arg) { 4078 case IEEE80211_AUTH_NONE: 4079 case IEEE80211_AUTH_OPEN: 4080 erq->value = IW_AUTH_ALG_OPEN_SYSTEM; 4081 break; 4082 case IEEE80211_AUTH_SHARED: 4083 erq->value = IW_AUTH_ALG_SHARED_KEY; 4084 break; 4085 case IEEE80211_AUTH_8021X: 4086 erq->value = IW_AUTH_ALG_LEAP; 4087 break; 4088 case IEEE80211_AUTH_WPA: 4089 erq->value = IW_AUTH_ALG_LEAP|IW_AUTH_ALG_SHARED_KEY; 4090 break; 4091 case IEEE80211_AUTH_AUTO: 4092 default: 4093 erq->value = IW_AUTH_ALG_SHARED_KEY|IW_AUTH_ALG_OPEN_SYSTEM|IW_AUTH_ALG_LEAP; 4094 break; 4095 } 4096 return 0; 4056 return -EOPNOTSUPP; 4097 4057 } 4098 4058
