Old/Libmac: madwifi-0.9.1-libmac.diff
File madwifi-0.9.1-libmac.diff, 24.4 KB (added by , 19 years ago) |
---|
-
ath/if_ath.c
diff -Naur madwifi-0.9.1/ath/if_ath.c madwifi-0.9.1-libmac/ath/if_ath.c
old new 91 91 #include "ath_tx99.h" 92 92 #endif 93 93 94 #include <net80211/libmac.h> 95 94 96 /* unaligned little endian access */ 95 97 #define LE_READ_2(p) \ 96 98 ((u_int16_t) \ … … 903 905 dev->name, error); 904 906 } 905 907 908 #ifdef CONFIG_MADWIFI_LIBMAC /* Should this go here of before ieee80211_create_vap() ? */ 909 ic->mac_append_in_mode = APPEND_OFF; 910 ic->mac_append_out_mode = APPEND_OFF; 911 ic->mac_supported_params[0] = mac_rssi; 912 ic->mac_supported_params_flags[0] = WLGETONLY; 913 /* we should eventually print supported params list .. */ 914 printk("%s: libmac-%s supported\n", dev->name, LIBMAC_VERSION); 915 #endif 916 906 917 return 0; 907 918 bad3: 908 919 ieee80211_ifdetach(ic); … … 5100 5111 struct sk_buff *skb; 5101 5112 struct ath_desc *ds; 5102 5113 5114 #ifdef CONFIG_MADWIFI_LIBMAC 5115 struct ieee80211com *ic = &sc->sc_ic; 5116 int tail_need = 0; 5117 #endif 5118 5103 5119 skb = bf->bf_skb; 5104 5120 if (skb == NULL) { 5105 5121 if (sc->sc_nmonvaps > 0) { … … 5131 5147 if (off != 0) 5132 5148 skb_reserve(skb, sc->sc_cachelsz - off); 5133 5149 } else { 5150 #ifdef CONFIG_MADWIFI_LIBMAC 5151 /* Make sure this has not been done before. */ 5152 if (ic->mac_rxbufsize_flag) { 5153 if ( (ic->mac_append_in_mode==APPEND_ON) ) 5154 /* For each parameter, space needed is 3 bytes. In addition, 5155 * 1 byte is needed for the no_of_params indicator and 2 bytes 5156 * more are needed for the length. Total number of bytes appended 5157 * is 1 (for no. of params) + 3 (1(for key) + 2(for value)) * num_params + 5158 * 2 (for length field). 5159 * */ 5160 tail_need = (3 * (ic->mac_in_params.len)) + 1 + 2; 5161 /* For each parameter, space needed is 2 bytes 5162 * for the length. 5163 */ 5164 else if ( (ic->mac_append_in_mode==APPEND_OFF) ) 5165 tail_need = 2; 5166 sc->sc_rxbufsize += tail_need; 5167 ic->mac_rxbufsize_flag = 1; 5168 } 5169 #endif /* CONFIG_MADWIFI_LIBMAC */ 5170 5134 5171 /* 5135 5172 * Cache-line-align. This is important (for the 5136 5173 * 5210 at least) as not doing so causes bogus data … … 5581 5618 keyix = ni->ni_ucastkey.wk_keyix; 5582 5619 if (keyix != IEEE80211_KEYIX_NONE && 5583 5620 sc->sc_keyixmap[keyix] == NULL) 5584 5621 sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni); 5585 5622 ieee80211_free_node(ni); 5586 5623 } else 5587 5624 type = ieee80211_input_all(ic, skb, … … 8996 9033 { 8997 9034 struct ath_softc *sc = dev->priv; 8998 9035 struct ieee80211com *ic = &sc->sc_ic; 8999 int error ;9036 int error = 0; 9000 9037 9001 9038 ATH_LOCK(sc); 9002 9039 switch (cmd) { -
madwifi-0.9.
diff -Naur madwifi-0.9.1/Makefile madwifi-0.9.1-libmac/Makefile
old new 51 51 # NB: the order is important here 52 52 DIRS_MODULES= ${WLAN} ${ATH_RATE} ${ATH} 53 53 54 obj-y := ath/ $(ATH_RATE)/ net80211/ 54 obj-y := ath/ $(ATH_RATE)/ net80211/ 55 55 56 all: modules tools 56 #all: modules tools 57 all: modules 57 58 58 59 modules: configcheck svnversion.h 59 60 ifdef LINUX24 … … 81 82 tools: 82 83 $(MAKE) -C ${TOOLS} all || exit 1 83 84 84 install: install-modules install-tools85 85 #install: install-modules install-tools 86 install: install-modules 86 87 install-modules: 87 88 @# check if there are modules left from an old installation 88 89 @# might cause make to abort the build -
net80211/ieee80211_input.c
diff -Naur madwifi-0.9.1/net80211/ieee80211_input.c madwifi-0.9.1-libmac/net80211/ieee80211_input.c
old new 54 54 55 55 #include <net80211/ieee80211_var.h> 56 56 57 /* Begin WINLAB */ 58 #include <net80211/libmac.h> 59 /* End WINLAB */ 60 57 61 #ifdef IEEE80211_DEBUG 58 62 /* 59 63 * Decide if a received management frame should be … … 968 972 struct net_device *dev = vap->iv_dev; 969 973 struct ether_header *eh = (struct ether_header *) skb->data; 970 974 975 /* Begin WINLAB */ 976 #ifdef CONFIG_MADWIFI_LIBMAC 977 struct ieee80211com *ic = vap->iv_ic; 978 u8 *mac_skb_rx_8; // 8-bit pointer to append values to end of packet 979 u32 *mac_skb_rx_32; // 32-bit pointer to append values to end of packet 980 u8 *mac_skb_num_params;// 8-bit pointer to append number of parameters to end of packet 981 u16 *mac_skb_len_16; // 16-bit pointer to append length of data to end of packet 982 int mac_i; // counter 983 u_int16_t payload_len; 984 #endif 985 /* End WINLAB */ 986 971 987 #ifdef ATH_SUPERG_XR 972 988 /* 973 989 * if it is a XR vap, send the data to associated normal net … … 1028 1044 if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) { 1029 1045 /* attach vlan tag */ 1030 1046 vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan); 1031 } else 1032 netif_rx(skb); 1047 } else { 1048 /* Begin WINLAB */ 1049 #ifdef CONFIG_MADWIFI_LIBMAC 1050 payload_len = skb->len; 1051 if (ic->mac_append_in_mode==APPEND_ON) 1052 { 1053 printk("APPEND_ON detected, number params:\t%d\n", ic->mac_in_params.len); 1054 // First create space at the end of the buffer for number of params 1055 mac_skb_num_params = (u8*)skb_put(skb, 1); 1056 // Next fill in the number of parameters being appended 1057 mac_skb_num_params[0] = ic->mac_in_params.len; 1058 1059 for(mac_i=0;mac_i<ic->mac_in_params.len; mac_i++) 1060 { 1061 switch(ic->mac_in_params.key_array[mac_i]) 1062 { 1063 case mac_rssi : 1064 mac_skb_rx_8 = (u8*)skb_put(skb,1); 1065 mac_skb_rx_32 = (u32*)skb_put(skb, 4); 1066 mac_skb_rx_8[0] = ic->mac_in_params.key_array[mac_i]; 1067 //mac_skb_rx_32[0] = ni->ni_rssi; 1068 /* XXX: check to see differing values between 1069 * ni->ni_rssi and what ieee80211_getrssi(ic) gets */ 1070 mac_skb_rx_32[0] = ieee80211_getrssi(ic); 1071 printk("RSSI reported:\t%d\n", mac_skb_rx_32[0]); 1072 break; 1073 default: 1074 printk("Unsupported param:\t%d\n", ic->mac_in_params.key_array[mac_i]); 1075 break; 1076 } 1077 } 1078 } 1079 1080 /* Do not append length to frame type 0x0900. */ 1081 if (eh->ether_type != __constant_htons(0x0900)) 1082 { 1083 // Create space at the end of the packet for length of data 1084 mac_skb_len_16 = (u16*)skb_put(skb,2); 1085 mac_skb_len_16[0] = payload_len; 1086 } 1087 #endif 1088 /* End WINLAB */ 1089 1090 netif_rx(skb); 1091 } 1033 1092 dev->last_rx = jiffies; 1034 1093 } 1035 1094 } -
net80211/ieee80211_ioctl.h
diff -Naur madwifi-0.9.1/net80211/ieee80211_ioctl.h madwifi-0.9.1-libmac/net80211/ieee80211_ioctl.h
old new 41 41 #include <net80211/ieee80211.h> 42 42 #include <net80211/ieee80211_crypto.h> 43 43 44 /* Begin WINLAB */ 45 #include <net80211/libmac.h> 46 /* End Winlab */ 47 44 48 /* 45 49 * Per/node (station) statistics available when operating as an AP. 46 50 */ … … 532 536 IEEE80211_WMMPARAMS_TXOPLIMIT = 4, 533 537 IEEE80211_WMMPARAMS_ACM = 5, 534 538 IEEE80211_WMMPARAMS_NOACKPOLICY = 6, 539 #ifdef CONFIG_MADWIFI_LIBMAC 540 /* We're out of ioctls, and private ioctls, lets abuse this 541 * for now. Later on we can use configfs */ 542 LIBMAC_INAPP = 7, /* */ 543 LIBMAC_OUTAPP = 8, /* */ 544 LIBMAC_ALLAPPOFF = 9, /* */ 545 LIBMAC_PARAMS = 10, /* Get supported params with flags / Set flags for supported params */ 546 LIBMAC_RSSI = 11, /* */ 547 LIBMAC_TXPOWER = 12, /* */ 548 LIBMAC_TXRATE = 13, /* */ 549 LIBMAC_NOISE = 14, /* */ 550 #endif /* CONFIG_MADWIFI_LIBMAC */ 535 551 }; 536 552 enum { 537 553 IEEE80211_PARAM_TURBO = 1, /* turbo mode */ -
net80211/ieee80211_var.h
diff -Naur madwifi-0.9.1/net80211/ieee80211_var.h madwifi-0.9.1-libmac/net80211/ieee80211_var.h
old new 52 52 #include <net80211/ieee80211_power.h> 53 53 #include <net80211/ieee80211_proto.h> 54 54 #include <net80211/ieee80211_scan.h> 55 /* Begin WINLAB */ 56 #include <net80211/libmac.h> 57 /* End WINLAB */ 55 58 56 59 #define IEEE80211_TXPOWER_MAX 100 /* .5 dBm units */ 57 60 #define IEEE80211_TXPOWER_MIN 0 /* kill radio */ … … 209 212 u_int8_t ic_chanchange_tbtt; 210 213 u_int8_t ic_chanchange_chan; 211 214 215 #ifdef CONFIG_MADWIFI_LIBMAC 216 mac_params_list mac_in_params; 217 mac_params_list mac_out_params; 218 u_int8_t mac_append_in_mode; 219 u_int8_t mac_append_out_mode; 220 u_int8_t mac_rxbufsize_flag; 221 /* list of suppported mac params */ 222 unsigned char mac_supported_params[1]; 223 /* parameter attributes */ 224 unsigned char mac_supported_params_flags[1]; 225 #endif /* CONFIG_MADWIFI_LIBMAC */ 226 212 227 /* virtual ap create/delete */ 213 228 struct ieee80211vap *(*ic_vap_create)(struct ieee80211com *, 214 229 const char *, int, int, int, struct net_device *); -
net80211/ieee80211_wireless.c
diff -Naur madwifi-0.9.1/net80211/ieee80211_wireless.c madwifi-0.9.1-libmac/net80211/ieee80211_wireless.c
old new 60 60 #include <net80211/ieee80211_var.h> 61 61 #include <net80211/ieee80211_linux.h> 62 62 63 /* Begin WINLAB */ 64 #include <net80211/libmac.h> 65 #include <ath/if_athvar.h> /* for struct ath_softc */ 66 /* End WINLAB */ 67 63 68 #define IS_UP(_dev) \ 64 69 (((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) 65 70 #define IS_UP_AUTO(_vap) \ … … 3161 3166 int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 3162 3167 int bss = param[2]; 3163 3168 struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; 3169 #ifdef CONFIG_MADWIFI_LIBMAC 3170 struct ath_softc *sc = dev->priv; 3171 struct ieee80211com *ic = vap->iv_ic; 3172 int *compat = (int *) w; 3173 struct iw_point *iwp = (struct iw_point *) w; 3174 struct mac_params_list *p_in = (struct mac_params_list *) iwp->pointer; 3175 struct mac_params_list *p = (struct mac_params_list *) extra; 3176 //struct iw_param *iwparam = (struct iw_param *) extra; 3177 union iwreq_data *wrqu = (union iwreq_data *) w; 3178 3179 /* Note: iwp->length is 0 when iwpriv is used */ 3180 3181 /* If we have a Libmac sub-ioctl */ 3182 if((iwp->length == sizeof(struct mac_params_list)) && 3183 (p_in->si_num >= LIBMAC_INAPP) && (p_in->si_num <= LIBMAC_NOISE)) { 3184 /* Libmac note: we only allow libmac sub-ioclts if magic flag was set to LIBMAC_MAGIC_FLAG */ 3185 if (p_in->si_flag != LIBMAC_MAGIC_FLAG) { 3186 printk("%s: special get sub-ioctl (%d) for libmac called without magic flag (%d), do " 3187 "not call directly using iwpriv or if you are unsure how to use this\n", 3188 dev->name, p_in->si_num, p_in->si_flag); 3189 return -EINVAL; 3190 } 3191 switch (p_in->si_num) { 3192 /* ioctl to turn on the append mode on all incoming packets */ 3193 case LIBMAC_INAPP: 3194 memcpy(ic->mac_in_params.key_array, p->key_array, p->len); 3195 memcpy(ic->mac_in_params.flags, p->flags, p->len); 3196 ic->mac_in_params.len = p->len; 3197 ic->mac_append_in_mode = APPEND_ON; 3198 /* update ath_soft sc->sc_rxbufsize over here....other 3199 * one only takes care of HW reset */ 3200 sc->sc_rxbufsize += (3 * (ic->mac_in_params.len)) + 1 + 2; 3201 break; 3202 /* Turn append off for both incomming and outgoing packets */ 3203 case LIBMAC_ALLAPPOFF: 3204 ic->mac_append_in_mode = APPEND_OFF; 3205 ic->mac_append_out_mode = APPEND_OFF; 3206 break; 3207 #if 0 3208 case LIBMAC_TXRATE: 3209 if (ath_ioctl_siwrate(dev, (struct iw_request_info *)NULL, iwparam, (char *)NULL )) 3210 printk("%s: libmac - Could not set txrate\n", dev->name); 3211 break; 3212 case LIBMAC_TXPOWER: 3213 if (ath_ioctl_siwtxpow(dev,(struct iw_request_info *)NULL, iwparam, (char *)NULL)) 3214 printk("%s: libmac - Could not set txpower\n"); 3215 break; 3216 #endif 3217 /* ioctl to turn on the append mode on all outgoing packets */ 3218 case LIBMAC_OUTAPP: /* Not supported yet */ 3219 case LIBMAC_PARAMS: 3220 case LIBMAC_RSSI: 3221 case LIBMAC_NOISE: 3222 default: 3223 printk("%s: Libmac set sub-ioctl (%d) detected but not supported\n", dev->name, p_in->si_num); 3224 return -EFAULT; 3225 } 3226 return 0; 3227 } 3164 3228 3165 switch (param[0]) { 3229 printk("Sorry, but set WMM private (%X) ioctls are not supported\n", compat[0]); 3230 return 0; 3231 3232 /* To support Libmac through sub-iotls we needed to bastardize this handler, 3233 * here is some backward compatiblity work */ 3234 3235 /* Note: sizeof(extra) == 4 */ 3236 3237 param[0] = compat[0]; 3238 param[1] = compat[1]; 3239 param[2] = compat[2]; 3240 3241 wrqu->data.length = 525; 3242 3243 printk("%s: Libmac Compatibility at work - (param[0]: %d) (param[1]: %d) " 3244 "(param[2]: %d) (data.length: %d)\n", 3245 dev->name, param[0], param[1], param[2], wrqu->data.length); 3246 3247 ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 3248 bss = param[2]; 3249 3250 #endif /* CONFIG_MADWIFI_LIBMAC */ 3251 switch (param[0]) { 3166 3252 case IEEE80211_WMMPARAMS_CWMIN: 3167 3253 if (param[3] < 0 || param[3] > 15) 3168 3254 return -EINVAL; … … 3240 3326 return 0; 3241 3327 } 3242 3328 3329 3243 3330 static int 3244 3331 ieee80211_ioctl_getwmmparams(struct net_device *dev, 3245 3332 struct iw_request_info *info, void *w, char *extra) 3246 3333 { 3247 3334 struct ieee80211vap *vap = dev->priv; 3248 3335 int *param = (int *) extra; 3249 int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 3336 int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 3250 3337 struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; 3251 3338 struct chanAccParams *chanParams = (param[2] == 0) ? 3252 3339 &(wme->wme_chanParams) : &(wme->wme_bssChanParams); 3340 #ifdef CONFIG_MADWIFI_LIBMAC 3341 struct ieee80211com *ic = vap->iv_ic; 3342 int *compat = (int *) w; 3343 struct iw_point *iwp = (struct iw_point *) w; 3344 struct mac_params_list *p_in = (struct mac_params_list *) iwp->pointer; 3345 struct mac_params_list *p = (struct mac_params_list *) extra; 3346 struct iw_param *iwparam = (struct iw_param *) extra; 3347 union iwreq_data *wrqu = (union iwreq_data *) w; 3348 3349 /* Note: iwp->length is 0 when iwpriv is used */ 3350 3351 /* If we have a Libmac sub-ioctl */ 3352 if((iwp->length == sizeof(struct mac_params_list)) && 3353 (p_in->si_num >= LIBMAC_INAPP) && (p_in->si_num <= LIBMAC_NOISE)) { 3354 /* Libmac note: we only allow libmac sub-ioclts if magic flag was set to LIBMAC_MAGIC_FLAG */ 3355 if (p_in->si_flag != LIBMAC_MAGIC_FLAG) { 3356 printk("%s: special get sub-ioctl (%d) for libmac called without magic flag (%d), " 3357 "do not call directly using iwpriv or if you are unsure how to use this\n", 3358 dev->name, p_in->si_num, p_in->si_flag); 3359 return -EINVAL; 3360 } 3361 switch (p_in->si_num) { 3362 /* Retrieves all supported Libmac MAC parameters */ 3363 case LIBMAC_PARAMS: 3364 //memset(p, 0, sizeof(struct mac_params_list)); 3365 p->len = sizeof(ic->mac_supported_params); 3366 memcpy(p->key_array, ic->mac_supported_params, 3367 sizeof(ic->mac_supported_params)); 3368 memcpy(p->flags, ic->mac_supported_params_flags, 3369 sizeof(ic->mac_supported_params_flags)); 3370 break; 3371 case LIBMAC_RSSI: 3372 /* XXX: Missing setting of length of sent data to user, required? */ 3373 iwparam->value = ieee80211_getrssi(ic); 3374 printk("%s: RSSI returned is %d\n", dev->name, iwparam->value); 3375 iwparam->fixed = 0; /* This has no meaning in this context */ 3376 iwparam->disabled = 0; /* This has no meaning in this context */ 3377 iwparam->flags = 0; /* This is not used currently */ 3378 break; 3379 case LIBMAC_NOISE: 3380 /* 161 (-95dB hard coded) */ 3381 iwparam->value = 161; 3382 iwparam->fixed = 0; 3383 iwparam->disabled = 0; 3384 iwparam->flags = 0; 3385 break; 3386 #if 0 3387 case LIBMAC_TXRATE: 3388 if (ath_ioctl_giwrate(dev, (struct iw_request_info *)NULL, iwparam, (char *)NULL )) 3389 printk("%s: libmac - Could not retrieve txrate\n", dev->name) 3390 break; 3391 case LIBMAC_TXPOWER: 3392 if (ath_ioctl_giwtxpow(dev,(struct iw_request_info *)NULL, iwparam, (char *)NULL)) 3393 printk("%s: libmac - Could not retrive txpower\n", dev->name); 3394 break; 3395 #endif 3396 case LIBMAC_INAPP: 3397 case LIBMAC_OUTAPP: 3398 case LIBMAC_ALLAPPOFF: 3399 default: 3400 printk("%s: Libmac get sub-ioctl (%d) detected but not supported\n", dev->name, p_in->si_num); 3401 break; 3402 } 3403 return 0; 3404 } 3405 3406 printk("Sorry, but get WMM private (%X) ioctls are not supported\n", compat[0]); 3407 return 0; 3408 3409 /* To support Libmac through sub-iotls we needed to bastardize this handler, 3410 * here is some backward compatiblity work */ 3411 3412 /* Note: sizeof(extra) == 4 */ 3413 3414 param[0] = compat[0]; 3415 param[1] = compat[1]; 3416 param[2] = compat[2]; 3417 3418 wrqu->data.length = 525; 3419 3420 printk("%s: Libmac Compatibility at work - (param[0]: %d) (param[1]: %d) (param[2]: %d) (data.length: %d)\n", 3421 dev->name, param[0], param[1], param[2], wrqu->data.length); 3422 3423 ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 3424 chanParams = (param[2] == 0) ? &(wme->wme_chanParams) : &(wme->wme_bssChanParams); 3425 3426 /* Note: we are failing for iwpriv with BAD ADDRESS because wireless core tries this: 3427 * 3428 * err = copy_to_user(iwr->u.data.pointer, extra, 3429 * extra_size); 3430 * 3431 * At the end if (!ret && IW_IS_GET(cmd)) { } 3432 * 3433 * The buffer it allocates from iwpriv is buffer[4096] so its not the size, 3434 * as seen bellow eve if we try to copy 1 byte it doesn't work. The data which we 3435 * are trying to copy IS USERSPACE -- this has been verified with access_ok(), see bellow. 3436 */ 3437 3438 /* From iwpriv: 3439 * 3440 * iwpriv will not print data unless a value >= 0 is detected from ioctl. As mentioned above 3441 * we are going to get -EFAULT returnd (bad address) as the core cannot copy_to_user even 1 byte 3442 * 3443 * if(ioctl(skfd, priv[k].cmd, &wrq) < 0) 3444 * { 3445 * fprintf(stderr, "Interface doesn't accept private ioctl...\n"); 3446 * fprintf(stderr, "%s (%X): %s\n", cmdname, priv[k].cmd, strerror(errno)); 3447 * return(-1); 3448 * } 3449 * 3450 */ 3451 3452 #endif /* CONFIG_MADWIFI_LIBMAC */ 3253 3453 3254 3454 switch (param[0]) { 3255 3455 case IEEE80211_WMMPARAMS_CWMIN: 3256 3456 param[0] = chanParams->cap_wmeParams[ac].wmep_logcwmin; 3457 param[0] = 123; 3257 3458 break; 3258 3459 case IEEE80211_WMMPARAMS_CWMAX: 3259 3460 param[0] = chanParams->cap_wmeParams[ac].wmep_logcwmax; … … 3273 3474 default: 3274 3475 break; 3275 3476 } 3477 3276 3478 return 0; 3277 3479 } 3278 3480 … … 4363 4565 #define IW_PRIV_TYPE_CHANINFO \ 4364 4566 IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_chaninfo) 4365 4567 4568 #ifdef CONFIG_MADWIFI_LIBMAC 4569 #define IW_PRIV_TYPE_LIBMAC_PARAMS\ 4570 IW_PRIV_TYPE_BYTE | sizeof(struct mac_params_list) 4571 #endif /* CONFIG_MADWIFI_LIBMAC */ 4572 4573 #define WWM_GET_SIOCTL(ioctl, name) { ioctl, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, name } 4574 #define WMM_SET_SIOCTL(ioctl, name) { ioctl, IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, 0, name } 4575 #define WMM_GSET_SIOCTL(ioctl, name) WWM_GET_SIOCTL(ioctl, "g_"name), WMM_SET_SIOCTL(ioctl, "s_"name) 4576 4366 4577 static const struct iw_priv_args ieee80211_priv_args[] = { 4367 4578 /* NB: setoptie & getoptie are !IW_PRIV_SIZE_FIXED */ 4368 4579 { IEEE80211_IOCTL_SETOPTIE, … … 4396 4607 { IEEE80211_IOCTL_GETMODE, 4397 4608 0, IW_PRIV_TYPE_CHAR | 6, "get_mode" }, 4398 4609 #if WIRELESS_EXT >= 12 4399 { IEEE80211_IOCTL_SETWMMPARAMS,4400 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 4, 0,"setwmmparams" },4401 { IEEE80211_IOCTL_GETWMMPARAMS,4402 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,4403 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams" },4404 /*4405 * These depends on sub-ioctl support which added in version 12.4406 */4407 { IEEE80211_IOCTL_SETWMMPARAMS,4408 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"" },4409 { IEEE80211_IOCTL_GETWMMPARAMS,4410 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,4411 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "" },4412 4610 /* sub-ioctl handlers */ 4413 { IEEE80211_WMMPARAMS_CWMIN, 4414 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"cwmin" }, 4415 { IEEE80211_WMMPARAMS_CWMIN, 4416 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4417 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_cwmin" }, 4418 { IEEE80211_WMMPARAMS_CWMAX, 4419 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"cwmax" }, 4420 { IEEE80211_WMMPARAMS_CWMAX, 4421 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4422 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_cwmax" }, 4423 { IEEE80211_WMMPARAMS_AIFS, 4424 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"aifs" }, 4425 { IEEE80211_WMMPARAMS_AIFS, 4426 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4427 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_aifs" }, 4428 { IEEE80211_WMMPARAMS_TXOPLIMIT, 4429 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"txoplimit" }, 4430 { IEEE80211_WMMPARAMS_TXOPLIMIT, 4431 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4432 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_txoplimit" }, 4433 { IEEE80211_WMMPARAMS_ACM, 4434 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"acm" }, 4435 { IEEE80211_WMMPARAMS_ACM, 4436 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4437 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_acm" }, 4438 { IEEE80211_WMMPARAMS_NOACKPOLICY, 4439 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"noackpolicy" }, 4440 { IEEE80211_WMMPARAMS_NOACKPOLICY, 4441 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 4442 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_noackpolicy" }, 4611 WMM_SET_SIOCTL(IEEE80211_IOCTL_SETWMMPARAMS, ""), 4612 WWM_GET_SIOCTL(IEEE80211_IOCTL_GETWMMPARAMS, ""), 4613 /* sub-ioctl definitions */ 4614 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_CWMIN, "cwmin"), 4615 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_CWMAX, "cwmax"), 4616 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_AIFS, "aifs"), 4617 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_TXOPLIMIT, "txoplimit"), 4618 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_ACM, "acm"), 4619 WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_NOACKPOLICY,"noackpolicy"), 4620 #ifdef CONFIG_MADWIFI_LIBMAC 4621 WMM_GSET_SIOCTL(LIBMAC_PARAMS, "lbparams"), 4622 #endif /* CONFIG_MADWIFI_LIBMAC */ 4623 /* raw access to sub-ioctl hanlders */ 4624 {IEEE80211_IOCTL_SETWMMPARAMS, IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, 0, "setwmmparams"}, 4625 {IEEE80211_IOCTL_GETWMMPARAMS, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 4626 IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, "getwmmparams"}, 4443 4627 4444 { IEEE80211_IOCTL_SETPARAM,4445 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam" },4446 4628 /* 4447 4629 * These depends on sub-ioctl support which added in version 12. 4448 4630 */ 4631 { IEEE80211_IOCTL_SETPARAM, 4632 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam" }, 4449 4633 { IEEE80211_IOCTL_GETPARAM, 4450 4634 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 4451 4635 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam" }, … … 4455 4639 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "" }, 4456 4640 { IEEE80211_IOCTL_GETPARAM, 4457 4641 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "" }, 4458 4642 4459 4643 /* sub-ioctl definitions */ 4460 4644 { IEEE80211_PARAM_AUTHMODE, 4461 4645 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "authmode" }, … … 4467 4651 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_protmode" }, 4468 4652 { IEEE80211_PARAM_MCASTCIPHER, 4469 4653 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastcipher" }, 4470 4471 4654 { IEEE80211_PARAM_MCASTCIPHER, 4655 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_mcastcipher" }, 4472 4656 { IEEE80211_PARAM_MCASTKEYLEN, 4473 4657 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastkeylen" }, 4474 4658 { IEEE80211_PARAM_MCASTKEYLEN, … … 4755 4939 (iw_handler) ieee80211_ioctl_giwencodeext, /* SIOCGIWENCODEEXT */ 4756 4940 #endif /* WIRELESS_EXT >= 18 */ 4757 4941 }; 4942 4758 4943 static const iw_handler ieee80211_priv_handlers[] = { 4759 4944 (iw_handler) ieee80211_ioctl_setparam, /* SIOCIWFIRSTPRIV+0 */ 4760 4945 (iw_handler) ieee80211_ioctl_getparam, /* SIOCIWFIRSTPRIV+1 */ … … 4813 4998 { 4814 4999 struct ieee80211vap *vap = dev->priv; 4815 5000 u_int unit; 4816 5001 4817 5002 switch (cmd) { 4818 5003 case SIOCG80211STATS: 4819 5004 return copy_to_user(ifr->ifr_data, &vap->iv_stats, -
net80211/libmac.h
diff -Naur madwifi-0.9.1/net80211/libmac.h madwifi-0.9.1-libmac/net80211/libmac.h
old new 1 /* WINLAB Libmac definitions and declarations. */ 2 #ifndef _MAC_MADWIFI_CMN_H 3 #define _MAC_MADWIFI_CMN_H 4 5 #define CONFIG_MADWIFI_LIBMAC 1 /* Enable/disable libmac on driver */ 6 #define LIBMAC_VERSION "1.2" 7 #define LIBMAC_MAGIC_FLAG 12 /* This should be higher than WME_NUM_AC */ 8 #define START_PARAMS_KEY 0 9 #define MAX_NO_PARAMS 256 10 11 #define APPEND_ON 1 /* Append mode on */ 12 #define APPEND_OFF 0 /* Append mode off */ 13 #define WLGETONLY 0 /* Get only for parameter flags */ 14 #define WLSETNGET 1 /* Both set and get for parameter flags */ 15 #define WLALLPACKETS 0 /* Append parameters on all packets - true if 1 and false if 0 */ 16 17 /* Sample key structure */ 18 typedef enum 19 { 20 mac_priority=START_PARAMS_KEY, 21 mac_txpower, 22 mac_rssi, 23 mac_noise, 24 mac_currentXmitRate, 25 mac_timestamp 26 } mac_parameter_keys; 27 28 typedef struct mac_params_list 29 { 30 u32 si_num; 31 u32 si_flag; 32 unsigned char len; 33 unsigned char key_array[MAX_NO_PARAMS]; 34 unsigned char flags[MAX_NO_PARAMS]; 35 } mac_params_list; 36 37 #endif /* _MAC_MADWIFI_CMN_H */