X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Fieee80211%2Fsoftmac%2Fieee80211softmac_module.c;h=c308756c2f9dae7edb6f65d90e98dfbe41fded7a;hb=8903bab009d3e9b34050042f8c0faf741eb027be;hp=4f8c3ef7081950b6e20157245b100dfca7f64065;hpb=d9bc125caf592b7d081021f32ce5b717efdf70c8;p=linux-2.6-omap-h63xx.git diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c index 4f8c3ef7081..c308756c2f9 100644 --- a/net/ieee80211/softmac/ieee80211softmac_module.c +++ b/net/ieee80211/softmac/ieee80211softmac_module.c @@ -33,7 +33,10 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) struct ieee80211softmac_device *softmac; struct net_device *dev; - dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv); + dev = alloc_ieee80211(sizeof(*softmac) + sizeof_priv); + if (!dev) + return NULL; + softmac = ieee80211_priv(dev); softmac->dev = dev; softmac->ieee = netdev_priv(dev); @@ -265,17 +268,10 @@ void ieee80211softmac_init_bss(struct ieee80211softmac_device *mac) /* Change the default txrate to the highest possible value. * The txrate machine will lower it, if it is too high. */ - /* FIXME: We don't correctly handle backing down to lower - rates, so 801.11g devices start off at 11M for now. People - can manually change it if they really need to, but 11M is - more reliable. Note similar logic in - ieee80211softmac_wx_set_rate() */ - if (ieee->modulation & IEEE80211_CCK_MODULATION) { + if (ieee->modulation & IEEE80211_OFDM_MODULATION) + txrates->user_rate = IEEE80211_OFDM_RATE_24MB; + else txrates->user_rate = IEEE80211_CCK_RATE_11MB; - } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { - txrates->user_rate = IEEE80211_OFDM_RATE_54MB; - } else - assert(0); txrates->default_rate = IEEE80211_CCK_RATE_1MB; change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;