Old/Libmac: madwifi-0.9.2-libmac.diff

File madwifi-0.9.2-libmac.diff, 25.1 KB (added by kishore, 18 years ago)
  • ath/if_ath.c

    diff -Naurp madwifi-0.9.2/ath/if_ath.c madwifi-0.9.2-libmac/ath/if_ath.c
    old new  
    9191#include "ath_tx99.h"
    9292#endif
    9393
     94#include <net80211/libmac.h>
     95
    9496/* unaligned little endian access */
    9597#define LE_READ_2(p)                            \
    9698    ((u_int16_t)                            \
    ath_attach(u_int16_t devid, struct net_d  
    902904                dev->name, error);
    903905    }
    904906
     907#ifdef CONFIG_MADWIFI_LIBMAC /* Should this go here of before ieee80211_create_vap() ? */
     908    ic->mac_append_in_mode = APPEND_OFF;
     909    ic->mac_append_out_mode = APPEND_OFF;
     910    ic->mac_supported_params[0] = mac_rssi;
     911    ic->mac_supported_params_flags[0] = WLGETONLY;
     912    /* we should eventually print supported params list .. */
     913    printk("%s: libmac-%s supported\n", dev->name, LIBMAC_VERSION);
     914#endif
     915
    905916    return 0;
    906917bad3:
    907918    ieee80211_ifdetach(ic);
    ath_rxbuf_init(struct ath_softc *sc, str  
    51025113    struct sk_buff *skb;
    51035114    struct ath_desc *ds;
    51045115
     5116    #ifdef CONFIG_MADWIFI_LIBMAC
     5117    struct ieee80211com *ic = &sc->sc_ic;
     5118    int tail_need = 0;
     5119    #endif
     5120   
    51055121    skb = bf->bf_skb;
    51065122    if (skb == NULL) {
    51075123        if (sc->sc_nmonvaps > 0) {
    ath_rxbuf_init(struct ath_softc *sc, str  
    51335149            if (off != 0)
    51345150                skb_reserve(skb, sc->sc_cachelsz - off);
    51355151        } else {
     5152#ifdef CONFIG_MADWIFI_LIBMAC
     5153            /* Make sure this has not been done before. */
     5154            if (ic->mac_rxbufsize_flag) {
     5155                if ( (ic->mac_append_in_mode==APPEND_ON) )
     5156                    /* For each parameter, space needed is 3 bytes. In addition,
     5157                     * 1 byte is needed for the no_of_params indicator and 2 bytes
     5158                     * more are needed for the length. Total number of bytes appended
     5159                     * is 1 (for no. of params) + 3 (1(for key) + 2(for value)) * num_params +
     5160                     * 2 (for length field).
     5161                     * */
     5162                    tail_need = (3 * (ic->mac_in_params.len)) + 1 + 2;
     5163                /* For each parameter, space needed is 2 bytes
     5164                 * for the length.
     5165                 */
     5166                else if ( (ic->mac_append_in_mode==APPEND_OFF) )
     5167                    tail_need = 2;
     5168                sc->sc_rxbufsize += tail_need;
     5169                ic->mac_rxbufsize_flag = 1;
     5170            }
     5171#endif /* CONFIG_MADWIFI_LIBMAC */
     5172
    51365173            /*
    51375174             * Cache-line-align.  This is important (for the
    51385175             * 5210 at least) as not doing so causes bogus data
    rx_accept:  
    55835620                keyix = ni->ni_ucastkey.wk_keyix;
    55845621                if (keyix != IEEE80211_KEYIX_NONE &&
    55855622                    sc->sc_keyixmap[keyix] == NULL)
    5586                     sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni);
     5623                  sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni);
    55875624                ieee80211_free_node(ni);
    55885625            } else
    55895626                type = ieee80211_input_all(ic, skb,
    ath_ioctl(struct net_device *dev, struct  
    89989035{
    89999036    struct ath_softc *sc = dev->priv;
    90009037    struct ieee80211com *ic = &sc->sc_ic;
    9001     int error;
     9038    int error = 0;
    90029039
    90039040    ATH_LOCK(sc);
    90049041    switch (cmd) {
  • madwifi-0.9.

    diff -Naurp madwifi-0.9.2/Makefile madwifi-0.9.2-libmac/Makefile
    old new include $(obj)/Makefile.inc  
    5050
    5151DIRS_MODULES = $(ATH) $(ATH_RATE) $(WLAN)
    5252
    53 obj-y := ath/ $(ATH_RATE)/ net80211/
     53obj-y := ath/ $(ATH_RATE)/ net80211/ 
    5454
    55 all: modules tools
     55#all: modules tools
     56all: modules
    5657
    5758modules: configcheck svnversion.h
    5859ifdef LINUX24
    svnversion.h:  
    8081tools:
    8182    $(MAKE) -C $(TOOLS) all || exit 1
    8283
    83 install: install-modules install-tools
    84 
     84#install: install-modules install-tools
     85install: install-modules
    8586install-modules:
    8687    @# check if there are modules left from an old installation
    8788    @# might cause make to abort the build
  • net80211/ieee80211_input.c

    diff -Naurp madwifi-0.9.2/net80211/ieee80211_input.c madwifi-0.9.2-libmac/net80211/ieee80211_input.c
    old new  
    5757
    5858#include <net80211/ieee80211_var.h>
    5959
     60/* Begin WINLAB */
     61#include <net80211/libmac.h>
     62/* End WINLAB */
     63
    6064#ifdef IEEE80211_DEBUG
    6165/*
    6266 * Decide if a received management frame should be
    ieee80211_deliver_data(struct ieee80211_  
    10921096    struct net_device *dev = vap->iv_dev;
    10931097    struct ether_header *eh = (struct ether_header *) skb->data;
    10941098
     1099    /* Begin WINLAB */
     1100#ifdef CONFIG_MADWIFI_LIBMAC
     1101    struct ieee80211com *ic = vap->iv_ic;
     1102    u8  *mac_skb_rx_8;      // 8-bit pointer to append values to end of packet
     1103        u32 *mac_skb_rx_32;     // 32-bit pointer to append values to end of packet
     1104        u8  *mac_skb_num_params;// 8-bit pointer to append number of parameters to end of packet
     1105        u16 *mac_skb_len_16;    // 16-bit pointer to append length of data to end of packet
     1106        int mac_i;              // counter
     1107        u_int16_t payload_len;
     1108#endif
     1109    /* End WINLAB */
     1110   
    10951111#ifdef ATH_SUPERG_XR
    10961112    /*
    10971113     * if it is a XR vap, send the data to associated normal net
    ieee80211_deliver_data(struct ieee80211_  
    11521168        if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) {
    11531169            /* attach vlan tag */
    11541170            vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan);
    1155         } else
    1156             netif_rx(skb);
     1171        } else {
     1172          /* Begin WINLAB */
     1173#ifdef CONFIG_MADWIFI_LIBMAC
     1174          payload_len = skb->len;
     1175          if (ic->mac_append_in_mode==APPEND_ON)
     1176            {
     1177                printk("APPEND_ON detected, number params:\t%d\n", ic->mac_in_params.len);
     1178              // First create space at the end of the buffer for number of params
     1179              mac_skb_num_params = (u8*)skb_put(skb, 1);
     1180              // Next fill in the number of parameters being appended
     1181              mac_skb_num_params[0] = ic->mac_in_params.len;
     1182
     1183              for(mac_i=0;mac_i<ic->mac_in_params.len; mac_i++)
     1184            {
     1185              switch(ic->mac_in_params.key_array[mac_i])
     1186                {
     1187                case mac_rssi :
     1188                  mac_skb_rx_8 = (u8*)skb_put(skb,1);
     1189                  mac_skb_rx_32 = (u32*)skb_put(skb, 4);
     1190                  mac_skb_rx_8[0] = ic->mac_in_params.key_array[mac_i];
     1191                  //mac_skb_rx_32[0] = ni->ni_rssi;
     1192                  /* XXX: check to see differing values between
     1193                   * ni->ni_rssi and what ieee80211_getrssi(ic) gets */
     1194                  mac_skb_rx_32[0] = ieee80211_getrssi(ic);
     1195                  printk("RSSI reported:\t%d\n", mac_skb_rx_32[0]);
     1196                  break;
     1197                default:
     1198                  printk("Unsupported param:\t%d\n", ic->mac_in_params.key_array[mac_i]);
     1199                  break;
     1200                }
     1201            }
     1202            }
     1203         
     1204          /* Do not append length to frame type 0x0900. */
     1205          if (eh->ether_type != __constant_htons(0x0900))
     1206            {
     1207              // Create space at the end of the packet for length of data
     1208              mac_skb_len_16 = (u16*)skb_put(skb,2);
     1209              mac_skb_len_16[0] = payload_len;
     1210            }
     1211#endif
     1212          /* End WINLAB */
     1213         
     1214          netif_rx(skb);
     1215        }
    11571216        dev->last_rx = jiffies;
    11581217    }
    11591218}
  • net80211/ieee80211_ioctl.h

    diff -Naurp madwifi-0.9.2/net80211/ieee80211_ioctl.h madwifi-0.9.2-libmac/net80211/ieee80211_ioctl.h
    old new  
    4141#include <net80211/ieee80211.h>
    4242#include <net80211/ieee80211_crypto.h>
    4343
     44/* Begin WINLAB */
     45#include <net80211/libmac.h>
     46/* End Winlab */
     47
    4448/*
    4549 * Per/node (station) statistics available when operating as an AP.
    4650 */
    enum {  
    532536    IEEE80211_WMMPARAMS_TXOPLIMIT   = 4,
    533537    IEEE80211_WMMPARAMS_ACM     = 5,
    534538    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 */
    535551};
    536552enum {
    537553    IEEE80211_PARAM_TURBO       = 1,    /* turbo mode */
  • net80211/ieee80211_var.h

    diff -Naurp madwifi-0.9.2/net80211/ieee80211_var.h madwifi-0.9.2-libmac/net80211/ieee80211_var.h
    old new  
    5252#include <net80211/ieee80211_power.h>
    5353#include <net80211/ieee80211_proto.h>
    5454#include <net80211/ieee80211_scan.h>
     55/* Begin WINLAB */
     56#include <net80211/libmac.h>
     57/* End WINLAB */
    5558
    5659#define IEEE80211_TXPOWER_MAX   100 /* .5 dBm units */
    5760#define IEEE80211_TXPOWER_MIN   0   /* kill radio */
    struct ieee80211com {  
    209212    u_int8_t ic_chanchange_tbtt;
    210213    u_int8_t ic_chanchange_chan;
    211214
     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
    212227    /* virtual ap create/delete */
    213228    struct ieee80211vap *(*ic_vap_create)(struct ieee80211com *,
    214229        const char *, int, int, int, struct net_device *);
  • net80211/ieee80211_wireless.c

    diff -Naurp madwifi-0.9.2/net80211/ieee80211_wireless.c madwifi-0.9.2-libmac/net80211/ieee80211_wireless.c
    old new  
    6161#include <net80211/ieee80211_var.h>
    6262#include <net80211/ieee80211_linux.h>
    6363
     64/* Begin WINLAB */
     65#include <net80211/libmac.h>
     66#include <ath/if_athvar.h> /* for struct ath_softc */
     67/* End WINLAB */
     68
    6469#define IS_UP(_dev) \
    6570    (((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
    6671#define IS_UP_AUTO(_vap) \
    ieee80211_ioctl_setwmmparams(struct net_  
    32963301    int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
    32973302    int bss = param[2];
    32983303    struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme;
     3304#ifdef CONFIG_MADWIFI_LIBMAC
     3305    struct ath_softc *sc = dev->priv;
     3306    struct ieee80211com *ic = vap->iv_ic;
     3307    int *compat = (int *) w;
     3308    struct iw_point *iwp = (struct iw_point *) w;
     3309    struct mac_params_list *p_in = (struct mac_params_list *) iwp->pointer;
     3310    struct mac_params_list *p = (struct mac_params_list *) extra;
     3311    //struct iw_param *iwparam = (struct iw_param *) extra;
     3312    union iwreq_data *wrqu = (union iwreq_data *) w;
     3313
     3314    /* Note: iwp->length is 0 when iwpriv is used */
     3315
     3316    /* If we have a Libmac sub-ioctl */
     3317    if((iwp->length == sizeof(struct mac_params_list)) &&
     3318            (p_in->si_num >= LIBMAC_INAPP) && (p_in->si_num <= LIBMAC_NOISE)) {
     3319        /* Libmac note: we only allow libmac sub-ioclts if magic flag was set to LIBMAC_MAGIC_FLAG */
     3320        if (p_in->si_flag != LIBMAC_MAGIC_FLAG) {
     3321            printk("%s: special get sub-ioctl (%d) for libmac called without magic flag (%d), do "
     3322                "not call directly using iwpriv or if you are unsure how to use this\n",
     3323                    dev->name, p_in->si_num, p_in->si_flag);
     3324            return -EINVAL;
     3325        }
     3326        switch (p_in->si_num) {
     3327            /* ioctl to turn on the append mode on all incoming packets */
     3328            case LIBMAC_INAPP:
     3329                memcpy(ic->mac_in_params.key_array, p->key_array, p->len);
     3330                memcpy(ic->mac_in_params.flags, p->flags, p->len);
     3331                ic->mac_in_params.len = p->len;
     3332                ic->mac_append_in_mode = APPEND_ON;
     3333                /* update ath_soft sc->sc_rxbufsize over here....other
     3334                 * one only takes care of HW reset */
     3335                sc->sc_rxbufsize += (3 * (ic->mac_in_params.len)) + 1 + 2;
     3336                break;
     3337            /* Turn append off for both incomming and outgoing packets */
     3338            case LIBMAC_ALLAPPOFF:
     3339                ic->mac_append_in_mode = APPEND_OFF;
     3340                ic->mac_append_out_mode = APPEND_OFF;
     3341                break;
     3342#if 0
     3343            case LIBMAC_TXRATE:
     3344                if (ath_ioctl_siwrate(dev, (struct iw_request_info *)NULL, iwparam, (char *)NULL ))
     3345                    printk("%s: libmac - Could not set txrate\n", dev->name);
     3346                break;
     3347            case LIBMAC_TXPOWER:
     3348                if (ath_ioctl_siwtxpow(dev,(struct iw_request_info *)NULL, iwparam, (char *)NULL))
     3349                    printk("%s: libmac - Could not set txpower\n");
     3350                break;
     3351#endif
     3352            /* ioctl to turn on the append mode on all outgoing packets */
     3353            case LIBMAC_OUTAPP: /* Not supported yet */
     3354            case LIBMAC_PARAMS:
     3355            case LIBMAC_RSSI:
     3356            case LIBMAC_NOISE:
     3357            default:
     3358                printk("%s: Libmac set sub-ioctl (%d) detected but not supported\n", dev->name, p_in->si_num);
     3359                return -EFAULT;
     3360        }
     3361        return 0;
     3362    }
    32993363
    3300     switch (param[0]) {
     3364    printk("Sorry, but set WMM private (%X) ioctls are not supported\n", compat[0]);
     3365    return 0;
     3366
     3367    /* To support Libmac through sub-iotls we needed to bastardize this handler,
     3368     * here is some backward compatiblity work */
     3369
     3370    /* Note: sizeof(extra) == 4 */
     3371
     3372    param[0] = compat[0];
     3373    param[1] = compat[1];
     3374    param[2] = compat[2];
     3375
     3376    wrqu->data.length = 525;
     3377
     3378    printk("%s: Libmac Compatibility at work - (param[0]: %d) (param[1]: %d) "
     3379            "(param[2]: %d) (data.length: %d)\n",
     3380            dev->name, param[0], param[1], param[2], wrqu->data.length);
     3381
     3382    ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
     3383    bss = param[2];
     3384
     3385#endif /* CONFIG_MADWIFI_LIBMAC */
     3386    switch (param[0]) {
    33013387        case IEEE80211_WMMPARAMS_CWMIN:
    33023388        if (param[3] < 0 || param[3] > 15)
    33033389            return -EINVAL;
    ieee80211_ioctl_setwmmparams(struct net_  
    33753461    return 0;
    33763462}
    33773463
     3464
    33783465static int
    33793466ieee80211_ioctl_getwmmparams(struct net_device *dev,
    33803467    struct iw_request_info *info, void *w, char *extra)
    33813468{
    33823469    struct ieee80211vap *vap = dev->priv;
    33833470    int *param = (int *) extra;
    3384     int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
     3471    int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE; 
    33853472    struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme;
    33863473    struct chanAccParams *chanParams = (param[2] == 0) ?
    33873474        &(wme->wme_chanParams) : &(wme->wme_bssChanParams);
     3475#ifdef CONFIG_MADWIFI_LIBMAC
     3476    struct ieee80211com *ic = vap->iv_ic;
     3477    int *compat = (int *) w;
     3478    struct iw_point *iwp = (struct iw_point *) w;
     3479    struct mac_params_list *p_in = (struct mac_params_list *) iwp->pointer;
     3480    struct mac_params_list *p = (struct mac_params_list *) extra;
     3481    struct iw_param *iwparam = (struct iw_param *) extra;
     3482    union iwreq_data *wrqu = (union iwreq_data *) w;
     3483
     3484    /* Note: iwp->length is 0 when iwpriv is used */
     3485
     3486    /* If we have a Libmac sub-ioctl */
     3487    if((iwp->length == sizeof(struct mac_params_list)) &&
     3488            (p_in->si_num >= LIBMAC_INAPP) && (p_in->si_num <= LIBMAC_NOISE)) {
     3489        /* Libmac note: we only allow libmac sub-ioclts if magic flag was set to LIBMAC_MAGIC_FLAG */
     3490        if (p_in->si_flag != LIBMAC_MAGIC_FLAG) {
     3491            printk("%s: special get sub-ioctl (%d) for libmac called without magic flag (%d), "
     3492                "do not call directly using iwpriv or if you are unsure how to use this\n",
     3493                    dev->name, p_in->si_num, p_in->si_flag);
     3494            return -EINVAL;
     3495        }
     3496        switch (p_in->si_num) {
     3497            /* Retrieves all supported Libmac MAC parameters */
     3498            case LIBMAC_PARAMS:
     3499                //memset(p, 0, sizeof(struct mac_params_list));
     3500                p->len = sizeof(ic->mac_supported_params);
     3501                memcpy(p->key_array, ic->mac_supported_params,
     3502                        sizeof(ic->mac_supported_params));
     3503                memcpy(p->flags, ic->mac_supported_params_flags,
     3504                        sizeof(ic->mac_supported_params_flags));
     3505                break;
     3506            case LIBMAC_RSSI:
     3507                /* XXX: Missing setting of length of sent data to user, required? */
     3508                iwparam->value = ieee80211_getrssi(ic);
     3509                printk("%s: RSSI returned is %d\n", dev->name, iwparam->value);
     3510                iwparam->fixed = 0; /* This has no meaning in this context */
     3511                iwparam->disabled = 0; /* This has no meaning in this context */
     3512                iwparam->flags = 0; /* This is not used currently */
     3513                break;
     3514            case LIBMAC_NOISE:
     3515                /* 161 (-95dB hard coded) */
     3516                iwparam->value = 161;
     3517                iwparam->fixed = 0;
     3518                iwparam->disabled = 0;
     3519                iwparam->flags = 0;
     3520                break;
     3521#if 0
     3522            case LIBMAC_TXRATE:
     3523                if (ath_ioctl_giwrate(dev, (struct iw_request_info *)NULL, iwparam, (char *)NULL ))
     3524                    printk("%s: libmac - Could not retrieve txrate\n", dev->name)
     3525                break;
     3526            case LIBMAC_TXPOWER:
     3527                if (ath_ioctl_giwtxpow(dev,(struct iw_request_info *)NULL, iwparam, (char *)NULL))
     3528                    printk("%s: libmac - Could not retrive txpower\n", dev->name);
     3529                break;
     3530#endif
     3531            case LIBMAC_INAPP:
     3532            case LIBMAC_OUTAPP:
     3533            case LIBMAC_ALLAPPOFF:
     3534            default:
     3535                printk("%s: Libmac get sub-ioctl (%d) detected but not supported\n", dev->name, p_in->si_num);
     3536                break;
     3537        }
     3538        return 0;
     3539    }
     3540
     3541    printk("Sorry, but get WMM private (%X) ioctls are not supported\n", compat[0]);
     3542    return 0;
     3543
     3544    /* To support Libmac through sub-iotls we needed to bastardize this handler,
     3545     * here is some backward compatiblity work */
     3546
     3547    /* Note: sizeof(extra) == 4 */
     3548
     3549    param[0] = compat[0];
     3550    param[1] = compat[1];
     3551    param[2] = compat[2];
     3552
     3553    wrqu->data.length = 525;
     3554
     3555    printk("%s: Libmac Compatibility at work - (param[0]: %d) (param[1]: %d) (param[2]: %d) (data.length: %d)\n",
     3556            dev->name, param[0], param[1], param[2], wrqu->data.length);
     3557
     3558    ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
     3559    chanParams = (param[2] == 0) ? &(wme->wme_chanParams) : &(wme->wme_bssChanParams);
     3560
     3561    /* Note: we are failing for iwpriv with BAD ADDRESS because wireless core tries this:
     3562     *
     3563     * err = copy_to_user(iwr->u.data.pointer, extra,
     3564     *  extra_size);
     3565     *
     3566     * At the end if (!ret && IW_IS_GET(cmd)) { }
     3567     *
     3568     * The buffer it allocates from iwpriv is buffer[4096] so its not the size,
     3569     * as seen bellow eve if we try to copy 1 byte it doesn't work. The data which we
     3570     * are trying to copy IS USERSPACE -- this has been verified with access_ok(), see bellow.
     3571     */
     3572
     3573    /* From iwpriv:
     3574     *
     3575     * iwpriv will not print data unless a value >= 0 is detected from ioctl. As mentioned above
     3576     * we are going to get -EFAULT returnd (bad address) as the core cannot copy_to_user even 1 byte
     3577     *
     3578     *   if(ioctl(skfd, priv[k].cmd, &wrq) < 0)
     3579     *       {
     3580     *      fprintf(stderr, "Interface doesn't accept private ioctl...\n");
     3581     *      fprintf(stderr, "%s (%X): %s\n", cmdname, priv[k].cmd, strerror(errno));
     3582     *      return(-1);
     3583     *  }
     3584     *
     3585     */
     3586
     3587#endif /* CONFIG_MADWIFI_LIBMAC */
    33883588
    33893589    switch (param[0]) {
    33903590        case IEEE80211_WMMPARAMS_CWMIN:
    33913591        param[0] = chanParams->cap_wmeParams[ac].wmep_logcwmin;
     3592        param[0] = 123;
    33923593        break;
    33933594        case IEEE80211_WMMPARAMS_CWMAX:
    33943595        param[0] = chanParams->cap_wmeParams[ac].wmep_logcwmax;
    ieee80211_ioctl_getwmmparams(struct net_  
    34083609    default:
    34093610        break;
    34103611    }
     3612   
    34113613    return 0;
    34123614}
    34133615
    ieee80211_ioctl_siwencodeext(struct net_  
    45074709#define IW_PRIV_TYPE_CHANINFO \
    45084710    IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_chaninfo)
    45094711
     4712#ifdef CONFIG_MADWIFI_LIBMAC
     4713#define IW_PRIV_TYPE_LIBMAC_PARAMS\
     4714    IW_PRIV_TYPE_BYTE | sizeof(struct mac_params_list)
     4715#endif /* CONFIG_MADWIFI_LIBMAC */
     4716
     4717#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 }
     4718#define WMM_SET_SIOCTL(ioctl, name) { ioctl, IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, 0, name }
     4719#define WMM_GSET_SIOCTL(ioctl, name) WWM_GET_SIOCTL(ioctl, "g_"name), WMM_SET_SIOCTL(ioctl, "s_"name)
     4720 
    45104721static const struct iw_priv_args ieee80211_priv_args[] = {
    45114722    /* NB: setoptie & getoptie are !IW_PRIV_SIZE_FIXED */
    45124723    { IEEE80211_IOCTL_SETOPTIE,
    static const struct iw_priv_args ieee802  
    45404751    { IEEE80211_IOCTL_GETMODE,
    45414752      0, IW_PRIV_TYPE_CHAR | 6, "get_mode" },
    45424753#if WIRELESS_EXT >= 12   
    4543     { IEEE80211_IOCTL_SETWMMPARAMS,
    4544       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 4, 0,"setwmmparams" },
    4545     { IEEE80211_IOCTL_GETWMMPARAMS,
    4546       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
    4547       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "getwmmparams" },
    4548     /*
    4549      * These depends on sub-ioctl support which added in version 12.
    4550      */
    4551     { IEEE80211_IOCTL_SETWMMPARAMS,
    4552       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"" },
    4553     { IEEE80211_IOCTL_GETWMMPARAMS,
    4554       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4555       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "" },
    45564754    /* sub-ioctl handlers */
    4557     { IEEE80211_WMMPARAMS_CWMIN,
    4558       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"cwmin" },
    4559     { IEEE80211_WMMPARAMS_CWMIN,
    4560       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4561       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_cwmin" },
    4562     { IEEE80211_WMMPARAMS_CWMAX,
    4563       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"cwmax" },
    4564     { IEEE80211_WMMPARAMS_CWMAX,
    4565       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4566       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_cwmax" },
    4567     { IEEE80211_WMMPARAMS_AIFS,
    4568       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"aifs" },
    4569     { IEEE80211_WMMPARAMS_AIFS,
    4570       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4571       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_aifs" },
    4572     { IEEE80211_WMMPARAMS_TXOPLIMIT,
    4573       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"txoplimit" },
    4574     { IEEE80211_WMMPARAMS_TXOPLIMIT,
    4575       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4576       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_txoplimit" },
    4577     { IEEE80211_WMMPARAMS_ACM,
    4578       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"acm" },
    4579     { IEEE80211_WMMPARAMS_ACM,
    4580       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
    4581       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_acm" },
    4582     { IEEE80211_WMMPARAMS_NOACKPOLICY,
    4583       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0,"noackpolicy" },
    4584     { IEEE80211_WMMPARAMS_NOACKPOLICY,
    4585       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,   
    4586       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,   "get_noackpolicy" },
     4755    WMM_SET_SIOCTL(IEEE80211_IOCTL_SETWMMPARAMS,    ""),
     4756    WWM_GET_SIOCTL(IEEE80211_IOCTL_GETWMMPARAMS,    ""),
     4757    /* sub-ioctl definitions */
     4758    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_CWMIN,  "cwmin"),
     4759    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_CWMAX,  "cwmax"),
     4760    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_AIFS,   "aifs"),
     4761    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_TXOPLIMIT,  "txoplimit"),
     4762    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_ACM,    "acm"),
     4763    WMM_GSET_SIOCTL(IEEE80211_WMMPARAMS_NOACKPOLICY,"noackpolicy"),
     4764#ifdef CONFIG_MADWIFI_LIBMAC
     4765    WMM_GSET_SIOCTL(LIBMAC_PARAMS,          "lbparams"),
     4766#endif /* CONFIG_MADWIFI_LIBMAC */
     4767    /* raw access to sub-ioctl hanlders */
     4768    {IEEE80211_IOCTL_SETWMMPARAMS, IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, 0, "setwmmparams"},
     4769    {IEEE80211_IOCTL_GETWMMPARAMS, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
     4770        IW_PRIV_TYPE_LIBMAC_PARAMS | IW_PRIV_SIZE_FIXED, "getwmmparams"},
    45874771   
    4588     { IEEE80211_IOCTL_SETPARAM,
    4589       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam" },
    45904772    /*
    45914773     * These depends on sub-ioctl support which added in version 12.
    45924774     */
     4775    { IEEE80211_IOCTL_SETPARAM,
     4776      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam" },
    45934777    { IEEE80211_IOCTL_GETPARAM,
    45944778      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
    45954779      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "getparam" },
    static const struct iw_priv_args ieee802  
    45994783      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "" },
    46004784    { IEEE80211_IOCTL_GETPARAM,
    46014785      0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "" },
    4602 
     4786   
    46034787    /* sub-ioctl definitions */
    46044788    { IEEE80211_PARAM_AUTHMODE,
    46054789      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "authmode" },
    static const struct iw_priv_args ieee802  
    46114795      0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_protmode" },
    46124796    { IEEE80211_PARAM_MCASTCIPHER,
    46134797      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastcipher" },
    4614     { IEEE80211_PARAM_MCASTCIPHER,
    4615       0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_mcastcipher" },
     4798       { IEEE80211_PARAM_MCASTCIPHER,
     4799     0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_mcastcipher" },
    46164800    { IEEE80211_PARAM_MCASTKEYLEN,
    46174801      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "mcastkeylen" },
    46184802    { IEEE80211_PARAM_MCASTKEYLEN,
    static const iw_handler ieee80211_handle  
    49035087    (iw_handler) ieee80211_ioctl_giwencodeext,  /* SIOCGIWENCODEEXT */
    49045088#endif /* WIRELESS_EXT >= 18 */
    49055089};
     5090
    49065091static const iw_handler ieee80211_priv_handlers[] = {
    49075092    (iw_handler) ieee80211_ioctl_setparam,      /* SIOCIWFIRSTPRIV+0 */
    49085093    (iw_handler) ieee80211_ioctl_getparam,      /* SIOCIWFIRSTPRIV+1 */
    ieee80211_ioctl(struct net_device *dev,  
    49615146{
    49625147    struct ieee80211vap *vap = dev->priv;
    49635148    u_int unit;
    4964 
     5149   
    49655150    switch (cmd) {
    49665151    case SIOCG80211STATS:
    49675152        return copy_to_user(ifr->ifr_data, &vap->iv_stats,
  • net80211/libmac.h

    diff -Naurp madwifi-0.9.2/net80211/libmac.h madwifi-0.9.2-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 */
     18typedef 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
     28typedef 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 */