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
|
7635 | 7635 | sc->sc_rc->ops->findrate(sc, an, shortPreamble, skb->len, |
7636 | 7636 | &rix, &try0, &txrate); |
7637 | 7637 | |
| 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 | |
7638 | 7644 | /* Ratecontrol sometimes returns invalid rate index */ |
7639 | 7645 | if (rix != 0xff) |
7640 | 7646 | an->an_prevdatarix = rix; |
diff -Naurp madwifi-3366.orig/net80211/ieee80211.c madwifi-3366/net80211/ieee80211.c
old
|
new
|
ieee80211_vap_setup(struct ieee80211com
|
451 | 451 | #endif |
452 | 452 | |
453 | 453 | 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 | |
454 | 457 | switch (opmode) { |
455 | 458 | case IEEE80211_M_STA: |
456 | 459 | /* WDS/Repeater */ |
457 | 460 | if (flags & IEEE80211_NO_STABEACONS) |
458 | 461 | vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS; |
| 462 | vap->iv_caps |= IEEE80211_C_SWRETRY; |
459 | 463 | break; |
460 | 464 | case IEEE80211_M_IBSS: |
461 | | vap->iv_caps |= IEEE80211_C_IBSS; |
| 465 | vap->iv_caps |= IEEE80211_C_IBSS | IEEE80211_C_SWRETRY; |
462 | 466 | vap->iv_ath_cap &= ~IEEE80211_ATHC_XR; |
463 | 467 | break; |
464 | 468 | case IEEE80211_M_AHDEMO: |
diff -Naurp madwifi-3366.orig/net80211/ieee80211_wireless.c madwifi-3366/net80211/ieee80211_wireless.c
old
|
new
|
ieee80211_ioctl_giwpower(struct net_devi
|
1299 | 1299 | return 0; |
1300 | 1300 | } |
1301 | 1301 | |
| 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 | |
1302 | 1315 | static int |
1303 | 1316 | ieee80211_ioctl_siwretry(struct net_device *dev, struct iw_request_info *info, |
1304 | 1317 | struct iw_param *rrq, char *extra) |
… |
… |
ieee80211_ioctl_siwretry(struct net_devi
|
1311 | 1324 | vap->iv_flags &= ~IEEE80211_F_SWRETRY; |
1312 | 1325 | goto done; |
1313 | 1326 | } |
| 1327 | /* Already disabled in iv_flags, nothing to do */ |
1314 | 1328 | return 0; |
1315 | 1329 | } |
1316 | 1330 | |
1317 | 1331 | if ((vap->iv_caps & IEEE80211_C_SWRETRY) == 0) |
1318 | 1332 | return -EOPNOTSUPP; |
| 1333 | if (rrq->value < 0) |
| 1334 | return -EINVAL; |
1319 | 1335 | if (rrq->flags == IW_RETRY_LIMIT) { |
1320 | 1336 | 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 | } |
1324 | 1345 | vap->iv_flags |= IEEE80211_F_SWRETRY; |
1325 | 1346 | } else { |
1326 | 1347 | vap->iv_flags &= ~IEEE80211_F_SWRETRY; |
1327 | 1348 | } |
1328 | | return 0; |
1329 | 1349 | } |
| 1350 | if (rrq->flags & IW_RETRY_LIFETIME) |
| 1351 | vap->iv_txlifetime = 0; |
1330 | 1352 | done: |
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; |
1332 | 1354 | } |
1333 | 1355 | |
1334 | 1356 | static int |