Documentation/cImages/baseline-8.3.ndz: patch-02-retry-fix.diff

File patch-02-retry-fix.diff, 4.1 KB (added by mcgrof, 16 years ago)

retry fix

  • ath/if_ath.c

    Retry fix
    
    This enables modifying retry limits on madwifi via Wext. While the
    implementation on the ioctl adds support (ieee80211_wireless.c) for
    short retry, long retry and even retry lifetime the HAL only allows us
    currently to modify one simple retry limit.
    
    Signed-Off by: Luis Rodriguez <mcgrof@winlab.rutgers.edu>
    
    diff -Naurp madwifi-3366.orig/ath/if_ath.c madwifi-3366/ath/if_ath.c
    old new ath_tx_start(struct net_device *dev, str  
    76357635            sc->sc_rc->ops->findrate(sc, an, shortPreamble, skb->len,
    76367636                &rix, &try0, &txrate);
    76377637
     7638            /* Note: HAL does not support distinguishing between short
     7639            * and long retry. These both are set via try0 here then.
     7640            * In the openhal we'll fix this ;) */
     7641            if (vap->iv_flags & IEEE80211_F_SWRETRY && vap->iv_txmax != try0)
     7642                try0 = vap->iv_txmax;
     7643
    76387644            /* Ratecontrol sometimes returns invalid rate index */
    76397645            if (rix != 0xff)
    76407646                an->an_prevdatarix = rix;
  • net80211/ieee80211.c

    diff -Naurp madwifi-3366.orig/net80211/ieee80211.c madwifi-3366/net80211/ieee80211.c
    old new ieee80211_vap_setup(struct ieee80211com  
    451451#endif
    452452
    453453    vap->iv_caps = ic->ic_caps &~ IEEE80211_C_OPMODE;
     454    /* Means its unset yet via WE SIOCSIWRETRY ioctl */
     455    vap->iv_flags &= ~IEEE80211_F_SWRETRY;
     456
    454457    switch (opmode) {
    455458    case IEEE80211_M_STA:
    456459        /* WDS/Repeater */
    457460        if (flags & IEEE80211_NO_STABEACONS)
    458461            vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS;
     462        vap->iv_caps |= IEEE80211_C_SWRETRY;
    459463        break;
    460464    case IEEE80211_M_IBSS:
    461         vap->iv_caps |= IEEE80211_C_IBSS;
     465        vap->iv_caps |= IEEE80211_C_IBSS | IEEE80211_C_SWRETRY;
    462466        vap->iv_ath_cap &= ~IEEE80211_ATHC_XR;
    463467        break;
    464468    case IEEE80211_M_AHDEMO:
  • net80211/ieee80211_wireless.c

    diff -Naurp madwifi-3366.orig/net80211/ieee80211_wireless.c madwifi-3366/net80211/ieee80211_wireless.c
    old new ieee80211_ioctl_giwpower(struct net_devi  
    12991299    return 0;
    13001300}
    13011301
     1302/* WE-21 added support for IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
     1303 * Note: IW_RETRY_SHORT/IW_RETRY_LONG was just a userspace improvement so
     1304 * we can just add the defines required for its support here and a user
     1305 * with an older kernel but new WE will still be able to benefit from this */
     1306#if WIRELESS_EXT < 21
     1307/* Retry limits and lifetime flags available */
     1308#ifndef IW_RETRY_LIFETIME /* Can't pinpoint when this guy was introduced */
     1309#define IW_RETRY_LIFETIME       0x2000  /* Maximum duration of retries in us */
     1310#endif /* IW_RETRY_LIFETIME */
     1311#define IW_RETRY_SHORT          0x0010  /* Value is for short packets  */
     1312#define IW_RETRY_LONG           0x0020  /* Value is for long packets */
     1313#endif /* WIRELESS_EXT < 21 */
     1314
    13021315static int
    13031316ieee80211_ioctl_siwretry(struct net_device *dev, struct iw_request_info *info,
    13041317    struct iw_param *rrq, char *extra)
    ieee80211_ioctl_siwretry(struct net_devi  
    13111324            vap->iv_flags &= ~IEEE80211_F_SWRETRY;
    13121325            goto done;
    13131326        }
     1327        /* Already disabled in iv_flags, nothing to do */
    13141328        return 0;
    13151329    }
    13161330
    13171331    if ((vap->iv_caps & IEEE80211_C_SWRETRY) == 0)
    13181332        return -EOPNOTSUPP;
     1333    if (rrq->value < 0)
     1334        return -EINVAL;
    13191335    if (rrq->flags == IW_RETRY_LIMIT) {
    13201336        if (rrq->value >= 0) {
    1321             vap->iv_txmin = rrq->value;
    1322             vap->iv_txmax = rrq->value; /* XXX */
    1323             vap->iv_txlifetime = 0;     /* XXX */
     1337            if (rrq->flags & IW_RETRY_SHORT)
     1338                vap->iv_txmin = rrq->value;
     1339            else if (rrq->flags & IW_RETRY_LONG)
     1340                vap->iv_txmax = rrq->value;
     1341            else {
     1342                vap->iv_txmin = rrq->value;
     1343                vap->iv_txmax = rrq->value;
     1344            }
    13241345            vap->iv_flags |= IEEE80211_F_SWRETRY;
    13251346        } else {
    13261347            vap->iv_flags &= ~IEEE80211_F_SWRETRY;
    13271348        }
    1328         return 0;
    13291349    }
     1350    if (rrq->flags & IW_RETRY_LIFETIME)
     1351        vap->iv_txlifetime = 0;
    13301352done:
    1331     return IS_UP(vap->iv_dev) ? ic->ic_reset(vap->iv_dev) : 0;
     1353    return IS_UP(ic->ic_dev) ? ic->ic_reset(ic->ic_dev) : 0;
    13321354}
    13331355
    13341356static int