diff options
author | Justin Patrin <papercrane@gmail.com> | 2005-10-07 16:59:31 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-10-07 16:59:31 +0000 |
commit | ec4471204f98aea123a32d1b1c7f01c68f47bb90 (patch) | |
tree | 59155b22df25616f7cac592aa5878ea2727e1ac7 /packages/zd1211/zd1211-20050822/iwconfig-rate.patch | |
parent | a05f01de2c518771dceb6ab93f2a7c487d25c63a (diff) | |
parent | fa12b55de5065e65b088529c06888c6b725f265a (diff) |
merge of 417b6b1ab4151082a038c4eb1bc88276a46675b0
and d158643df91483ff93864d58c92e889b0050dea6
Diffstat (limited to 'packages/zd1211/zd1211-20050822/iwconfig-rate.patch')
-rw-r--r-- | packages/zd1211/zd1211-20050822/iwconfig-rate.patch | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/packages/zd1211/zd1211-20050822/iwconfig-rate.patch b/packages/zd1211/zd1211-20050822/iwconfig-rate.patch new file mode 100644 index 0000000000..c1cb634b1a --- /dev/null +++ b/packages/zd1211/zd1211-20050822/iwconfig-rate.patch @@ -0,0 +1,126 @@ +--- zd1211/src/zd1205.c 7 Jun 2005 21:45:21 -0000 1.17 ++++ zd1211/src/zd1205.c 24 Aug 2005 11:39:29 -0000 +@@ -3599,9 +3599,59 @@ + + } + ++static const unsigned long zd1205_rates[] = { ++ /* RATE_1M, 0 */ ++ 1000000, ++ /* RATE_2M, 1 */ ++ 2000000, ++ /* RATE_5M, 2 */ ++ 5500000, ++ /* RATE_11M, 3 */ ++ 11000000, ++ /* RATE_6M, 4 */ ++ 600000, ++ /* RATE_9M, 5 */ ++ 9000000, ++ /* RATE_12M, 6 */ ++ 12000000, ++ /* RATE_18M, 7 */ ++ 18000000, ++ /* RATE_24M, 8 */ ++ 24000000, ++ /* RATE_36M, 9 */ ++ 36000000, ++ /* RATE_48M, 10 */ ++ 48000000, ++ /* RATE_54M, 11 */ ++ 54000000, ++}; ++ ++#define ZD1205_NRATES ((sizeof(zd1205_rates))/(sizeof(unsigned long))) ++ + static int zd1205_ioctl_setrate(struct net_device *dev, struct iw_param *frq) + { +- return 0; ++ struct zd1205_private *macp = dev->priv; ++ U8 rate; ++ if(frq->value < 0) { ++ /* Auto */ ++ macp->bFixedRate = 0; ++ macp->AdapterMaxRate = RATE_54M; ++ return 0; ++ } ++ for(rate = 0; rate < ZD1205_NRATES; rate++) ++ if(zd1205_rates[rate] == frq->value) { ++ zd1205_lock(macp); ++ macp->bFixedRate = frq->fixed; ++ if(frq->fixed) ++ macp->cardSetting.FixedRate = rate; ++ else { ++ macp->AdapterMaxRate = rate; ++ macp->cardSetting.TxRate = rate; ++ } ++ zd1205_unlock(macp); ++ return 0; ++ } ++ return -EINVAL; + } + + static int zd1205_ioctl_getrate(struct net_device *dev, struct iw_param *frq) +@@ -3612,60 +3662,9 @@ + frq->disabled = 0; + frq->value = 0; + +- switch(macp->cardSetting.CurrTxRate) +- { +- case RATE_1M: +- frq->value = 1000000; +- break; +- +- case RATE_2M: +- frq->value = 2000000; +- break; +- +- case RATE_5M: +- frq->value = 5500000; +- break; +- +- case RATE_11M: +- frq->value = 11000000; +- break; +- +- case RATE_6M: +- frq->value = 600000; +- break; +- +- case RATE_9M: +- frq->value = 9000000; +- break; +- +- case RATE_12M: +- frq->value = 12000000; +- break; +- +- case RATE_18M: +- frq->value = 18000000; +- break; +- +- case RATE_24M: +- frq->value = 24000000; +- break; +- +- case RATE_36M: +- frq->value = 36000000; +- break; +- +- case RATE_48M: +- frq->value = 48000000; +- break; +- +- case RATE_54M: +- frq->value = 54000000; +- break; +- +- default: ++ if(macp->cardSetting.CurrTxRate > ZD1205_NRATES) + return -EINVAL; +- } +- ++ frq->value = zd1205_rates[macp->cardSetting.CurrTxRate]; + return 0; + } + |