diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-06-12 14:25:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-12 14:25:04 -0400 |
commit | 0440507bbc44149e63bbfb9df730ba3820371904 (patch) | |
tree | 7275e41aa1aa7e4d19d0503f1c15f07991c1a120 /drivers/net/wireless/libertas | |
parent | 8d242488ce4627dd7e6333caab56df11ea25e239 (diff) | |
parent | 7f0d9f430dc99303558adc30a75eef10c43f7bec (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/mesh.c | 7 |
3 files changed, 31 insertions, 16 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 2fa879b015b6..f4a203049fb4 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -435,24 +435,40 @@ static int lbs_add_wpa_tlv(u8 *tlv, const u8 *ie, u8 ie_len) | |||
435 | * Set Channel | 435 | * Set Channel |
436 | */ | 436 | */ |
437 | 437 | ||
438 | static int lbs_cfg_set_channel(struct wiphy *wiphy, | 438 | static int lbs_cfg_set_monitor_channel(struct wiphy *wiphy, |
439 | struct net_device *netdev, | 439 | struct ieee80211_channel *channel, |
440 | struct ieee80211_channel *channel, | 440 | enum nl80211_channel_type channel_type) |
441 | enum nl80211_channel_type channel_type) | ||
442 | { | 441 | { |
443 | struct lbs_private *priv = wiphy_priv(wiphy); | 442 | struct lbs_private *priv = wiphy_priv(wiphy); |
444 | int ret = -ENOTSUPP; | 443 | int ret = -ENOTSUPP; |
445 | 444 | ||
446 | lbs_deb_enter_args(LBS_DEB_CFG80211, "iface %s freq %d, type %d", | 445 | lbs_deb_enter_args(LBS_DEB_CFG80211, "freq %d, type %d", |
447 | netdev_name(netdev), channel->center_freq, channel_type); | 446 | channel->center_freq, channel_type); |
448 | 447 | ||
449 | if (channel_type != NL80211_CHAN_NO_HT) | 448 | if (channel_type != NL80211_CHAN_NO_HT) |
450 | goto out; | 449 | goto out; |
451 | 450 | ||
452 | if (netdev == priv->mesh_dev) | 451 | ret = lbs_set_channel(priv, channel->hw_value); |
453 | ret = lbs_mesh_set_channel(priv, channel->hw_value); | 452 | |
454 | else | 453 | out: |
455 | ret = lbs_set_channel(priv, channel->hw_value); | 454 | lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); |
455 | return ret; | ||
456 | } | ||
457 | |||
458 | static int lbs_cfg_set_mesh_channel(struct wiphy *wiphy, | ||
459 | struct net_device *netdev, | ||
460 | struct ieee80211_channel *channel) | ||
461 | { | ||
462 | struct lbs_private *priv = wiphy_priv(wiphy); | ||
463 | int ret = -ENOTSUPP; | ||
464 | |||
465 | lbs_deb_enter_args(LBS_DEB_CFG80211, "iface %s freq %d", | ||
466 | netdev_name(netdev), channel->center_freq); | ||
467 | |||
468 | if (netdev != priv->mesh_dev) | ||
469 | goto out; | ||
470 | |||
471 | ret = lbs_mesh_set_channel(priv, channel->hw_value); | ||
456 | 472 | ||
457 | out: | 473 | out: |
458 | lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); | 474 | lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); |
@@ -2029,7 +2045,8 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | |||
2029 | */ | 2045 | */ |
2030 | 2046 | ||
2031 | static struct cfg80211_ops lbs_cfg80211_ops = { | 2047 | static struct cfg80211_ops lbs_cfg80211_ops = { |
2032 | .set_channel = lbs_cfg_set_channel, | 2048 | .set_monitor_channel = lbs_cfg_set_monitor_channel, |
2049 | .libertas_set_mesh_channel = lbs_cfg_set_mesh_channel, | ||
2033 | .scan = lbs_cfg_scan, | 2050 | .scan = lbs_cfg_scan, |
2034 | .connect = lbs_cfg_connect, | 2051 | .connect = lbs_cfg_connect, |
2035 | .disconnect = lbs_cfg_disconnect, | 2052 | .disconnect = lbs_cfg_disconnect, |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 672005430aca..60996ce89f77 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -58,6 +58,7 @@ struct lbs_private { | |||
58 | uint16_t mesh_tlv; | 58 | uint16_t mesh_tlv; |
59 | u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; | 59 | u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; |
60 | u8 mesh_ssid_len; | 60 | u8 mesh_ssid_len; |
61 | u8 mesh_channel; | ||
61 | #endif | 62 | #endif |
62 | 63 | ||
63 | /* Debugfs */ | 64 | /* Debugfs */ |
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c index e87c031b298f..97807751ebcf 100644 --- a/drivers/net/wireless/libertas/mesh.c +++ b/drivers/net/wireless/libertas/mesh.c | |||
@@ -131,16 +131,13 @@ static int lbs_mesh_config(struct lbs_private *priv, uint16_t action, | |||
131 | 131 | ||
132 | int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel) | 132 | int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel) |
133 | { | 133 | { |
134 | priv->mesh_channel = channel; | ||
134 | return lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, channel); | 135 | return lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, channel); |
135 | } | 136 | } |
136 | 137 | ||
137 | static uint16_t lbs_mesh_get_channel(struct lbs_private *priv) | 138 | static uint16_t lbs_mesh_get_channel(struct lbs_private *priv) |
138 | { | 139 | { |
139 | struct wireless_dev *mesh_wdev = priv->mesh_dev->ieee80211_ptr; | 140 | return priv->mesh_channel ?: 1; |
140 | if (mesh_wdev->channel) | ||
141 | return mesh_wdev->channel->hw_value; | ||
142 | else | ||
143 | return 1; | ||
144 | } | 141 | } |
145 | 142 | ||
146 | /*************************************************************************** | 143 | /*************************************************************************** |