diff options
author | David S. Miller <davem@davemloft.net> | 2010-06-17 17:19:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-17 17:19:06 -0400 |
commit | bb9c03d8a6893517737b16fdbeb54be3c73b3023 (patch) | |
tree | 35fa0d1defaaf94641963a49126d7bb475ffa4c6 /net/mac80211/cfg.c | |
parent | 4de57826810fd2cfeb2ab5c7d003ff9116b8f7ee (diff) | |
parent | abf52f86aa0a49a7377350cafa8f218c4cd227e7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 1f76d048388b..ed8c9f5be94f 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1446,7 +1446,6 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
1446 | { | 1446 | { |
1447 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1447 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1448 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 1448 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
1449 | struct ieee80211_conf *conf = &local->hw.conf; | ||
1450 | 1449 | ||
1451 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 1450 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
1452 | return -EOPNOTSUPP; | 1451 | return -EOPNOTSUPP; |
@@ -1455,11 +1454,11 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
1455 | return -EOPNOTSUPP; | 1454 | return -EOPNOTSUPP; |
1456 | 1455 | ||
1457 | if (enabled == sdata->u.mgd.powersave && | 1456 | if (enabled == sdata->u.mgd.powersave && |
1458 | timeout == conf->dynamic_ps_forced_timeout) | 1457 | timeout == local->dynamic_ps_forced_timeout) |
1459 | return 0; | 1458 | return 0; |
1460 | 1459 | ||
1461 | sdata->u.mgd.powersave = enabled; | 1460 | sdata->u.mgd.powersave = enabled; |
1462 | conf->dynamic_ps_forced_timeout = timeout; | 1461 | local->dynamic_ps_forced_timeout = timeout; |
1463 | 1462 | ||
1464 | /* no change, but if automatic follow powersave */ | 1463 | /* no change, but if automatic follow powersave */ |
1465 | mutex_lock(&sdata->u.mgd.mtx); | 1464 | mutex_lock(&sdata->u.mgd.mtx); |
@@ -1555,9 +1554,55 @@ static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev, | |||
1555 | bool channel_type_valid, | 1554 | bool channel_type_valid, |
1556 | const u8 *buf, size_t len, u64 *cookie) | 1555 | const u8 *buf, size_t len, u64 *cookie) |
1557 | { | 1556 | { |
1558 | return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan, | 1557 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1559 | channel_type, channel_type_valid, | 1558 | struct ieee80211_local *local = sdata->local; |
1560 | buf, len, cookie); | 1559 | struct sk_buff *skb; |
1560 | struct sta_info *sta; | ||
1561 | const struct ieee80211_mgmt *mgmt = (void *)buf; | ||
1562 | u32 flags = IEEE80211_TX_INTFL_NL80211_FRAME_TX | | ||
1563 | IEEE80211_TX_CTL_REQ_TX_STATUS; | ||
1564 | |||
1565 | /* Check that we are on the requested channel for transmission */ | ||
1566 | if (chan != local->tmp_channel && | ||
1567 | chan != local->oper_channel) | ||
1568 | return -EBUSY; | ||
1569 | if (channel_type_valid && | ||
1570 | (channel_type != local->tmp_channel_type && | ||
1571 | channel_type != local->_oper_channel_type)) | ||
1572 | return -EBUSY; | ||
1573 | |||
1574 | switch (sdata->vif.type) { | ||
1575 | case NL80211_IFTYPE_ADHOC: | ||
1576 | if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) | ||
1577 | break; | ||
1578 | rcu_read_lock(); | ||
1579 | sta = sta_info_get(sdata, mgmt->da); | ||
1580 | rcu_read_unlock(); | ||
1581 | if (!sta) | ||
1582 | return -ENOLINK; | ||
1583 | break; | ||
1584 | case NL80211_IFTYPE_STATION: | ||
1585 | if (!(sdata->u.mgd.flags & IEEE80211_STA_MFP_ENABLED)) | ||
1586 | flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | ||
1587 | break; | ||
1588 | default: | ||
1589 | return -EOPNOTSUPP; | ||
1590 | } | ||
1591 | |||
1592 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + len); | ||
1593 | if (!skb) | ||
1594 | return -ENOMEM; | ||
1595 | skb_reserve(skb, local->hw.extra_tx_headroom); | ||
1596 | |||
1597 | memcpy(skb_put(skb, len), buf, len); | ||
1598 | |||
1599 | IEEE80211_SKB_CB(skb)->flags = flags; | ||
1600 | |||
1601 | skb->dev = sdata->dev; | ||
1602 | ieee80211_tx_skb(sdata, skb); | ||
1603 | |||
1604 | *cookie = (unsigned long) skb; | ||
1605 | return 0; | ||
1561 | } | 1606 | } |
1562 | 1607 | ||
1563 | struct cfg80211_ops mac80211_config_ops = { | 1608 | struct cfg80211_ops mac80211_config_ops = { |