diff options
author | Holger Schurig <holgerschurig@googlemail.com> | 2009-12-02 09:26:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:38:29 -0500 |
commit | 602114ae595af6c89eab149cf9f939e3f7ef4a34 (patch) | |
tree | 560c6d362b846131630861998915a7407aaf9343 /drivers | |
parent | e4da1a81a967c05dfde6f0498cff1f6fe6683f52 (diff) |
libertas: add access functions for mesh open/connect status
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/mesh.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/mesh.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 6 |
7 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index dd69191f24eb..4a198113f9be 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1304,7 +1304,7 @@ int lbs_execute_next_command(struct lbs_private *priv) | |||
1304 | if ((priv->psmode != LBS802_11POWERMODECAM) && | 1304 | if ((priv->psmode != LBS802_11POWERMODECAM) && |
1305 | (priv->psstate == PS_STATE_FULL_POWER) && | 1305 | (priv->psstate == PS_STATE_FULL_POWER) && |
1306 | ((priv->connect_status == LBS_CONNECTED) || | 1306 | ((priv->connect_status == LBS_CONNECTED) || |
1307 | (priv->mesh_connect_status == LBS_CONNECTED))) { | 1307 | lbs_mesh_connected(priv))) { |
1308 | if (priv->secinfo.WPAenabled || | 1308 | if (priv->secinfo.WPAenabled || |
1309 | priv->secinfo.WPA2enabled) { | 1309 | priv->secinfo.WPA2enabled) { |
1310 | /* check for valid WPA group keys */ | 1310 | /* check for valid WPA group keys */ |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 127b7f60c320..64b327d4548b 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -123,7 +123,7 @@ static ssize_t lbs_rtap_set(struct device *dev, | |||
123 | if (priv->monitormode == monitor_mode) | 123 | if (priv->monitormode == monitor_mode) |
124 | return strlen(buf); | 124 | return strlen(buf); |
125 | if (!priv->monitormode) { | 125 | if (!priv->monitormode) { |
126 | if (priv->infra_open || priv->mesh_open) | 126 | if (priv->infra_open || lbs_mesh_open(priv)) |
127 | return -EBUSY; | 127 | return -EBUSY; |
128 | if (priv->mode == IW_MODE_INFRA) | 128 | if (priv->mode == IW_MODE_INFRA) |
129 | lbs_cmd_80211_deauthenticate(priv, | 129 | lbs_cmd_80211_deauthenticate(priv, |
@@ -619,7 +619,7 @@ static int lbs_thread(void *data) | |||
619 | if (priv->connect_status == LBS_CONNECTED) | 619 | if (priv->connect_status == LBS_CONNECTED) |
620 | netif_wake_queue(priv->dev); | 620 | netif_wake_queue(priv->dev); |
621 | if (priv->mesh_dev && | 621 | if (priv->mesh_dev && |
622 | priv->mesh_connect_status == LBS_CONNECTED) | 622 | lbs_mesh_connected(priv)) |
623 | netif_wake_queue(priv->mesh_dev); | 623 | netif_wake_queue(priv->mesh_dev); |
624 | } | 624 | } |
625 | } | 625 | } |
@@ -833,7 +833,6 @@ static int lbs_init_adapter(struct lbs_private *priv) | |||
833 | memset(priv->current_addr, 0xff, ETH_ALEN); | 833 | memset(priv->current_addr, 0xff, ETH_ALEN); |
834 | 834 | ||
835 | priv->connect_status = LBS_DISCONNECTED; | 835 | priv->connect_status = LBS_DISCONNECTED; |
836 | priv->mesh_connect_status = LBS_DISCONNECTED; | ||
837 | priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; | 836 | priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; |
838 | priv->mode = IW_MODE_INFRA; | 837 | priv->mode = IW_MODE_INFRA; |
839 | priv->channel = DEFAULT_AD_HOC_CHANNEL; | 838 | priv->channel = DEFAULT_AD_HOC_CHANNEL; |
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c index 4f67c8b62edc..954cd00f7452 100644 --- a/drivers/net/wireless/libertas/mesh.c +++ b/drivers/net/wireless/libertas/mesh.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #include <linux/moduleparam.h> | ||
2 | #include <linux/delay.h> | 1 | #include <linux/delay.h> |
3 | #include <linux/etherdevice.h> | 2 | #include <linux/etherdevice.h> |
4 | #include <linux/netdevice.h> | 3 | #include <linux/netdevice.h> |
@@ -196,6 +195,8 @@ int lbs_init_mesh(struct lbs_private *priv) | |||
196 | 195 | ||
197 | lbs_deb_enter(LBS_DEB_MESH); | 196 | lbs_deb_enter(LBS_DEB_MESH); |
198 | 197 | ||
198 | priv->mesh_connect_status = LBS_DISCONNECTED; | ||
199 | |||
199 | /* Determine mesh_fw_ver from fwrelease and fwcapinfo */ | 200 | /* Determine mesh_fw_ver from fwrelease and fwcapinfo */ |
200 | /* 5.0.16p0 9.0.0.p0 is known to NOT support any mesh */ | 201 | /* 5.0.16p0 9.0.0.p0 is known to NOT support any mesh */ |
201 | /* 5.110.22 have mesh command with 0xa3 command id */ | 202 | /* 5.110.22 have mesh command with 0xa3 command id */ |
diff --git a/drivers/net/wireless/libertas/mesh.h b/drivers/net/wireless/libertas/mesh.h index b642d5d11699..388c39281b7d 100644 --- a/drivers/net/wireless/libertas/mesh.h +++ b/drivers/net/wireless/libertas/mesh.h | |||
@@ -84,4 +84,10 @@ void lbs_mesh_ethtool_get_strings(struct net_device *dev, | |||
84 | uint32_t stringset, uint8_t *s); | 84 | uint32_t stringset, uint8_t *s); |
85 | 85 | ||
86 | 86 | ||
87 | /* Accessors */ | ||
88 | |||
89 | #define lbs_mesh_open(priv) (priv->mesh_open) | ||
90 | #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED) | ||
91 | |||
92 | |||
87 | #endif | 93 | #endif |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index c6a6c042b82f..4a0c3e3cd3b1 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -640,7 +640,7 @@ out: | |||
640 | if (!priv->tx_pending_len) | 640 | if (!priv->tx_pending_len) |
641 | netif_wake_queue(priv->dev); | 641 | netif_wake_queue(priv->dev); |
642 | } | 642 | } |
643 | if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) { | 643 | if (priv->mesh_dev && lbs_mesh_connected(priv)) { |
644 | netif_carrier_on(priv->mesh_dev); | 644 | netif_carrier_on(priv->mesh_dev); |
645 | if (!priv->tx_pending_len) | 645 | if (!priv->tx_pending_len) |
646 | netif_wake_queue(priv->mesh_dev); | 646 | netif_wake_queue(priv->mesh_dev); |
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 315d1ce286ca..52d244ea3d97 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c | |||
@@ -198,7 +198,7 @@ void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count) | |||
198 | if (priv->connect_status == LBS_CONNECTED) | 198 | if (priv->connect_status == LBS_CONNECTED) |
199 | netif_wake_queue(priv->dev); | 199 | netif_wake_queue(priv->dev); |
200 | 200 | ||
201 | if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) | 201 | if (priv->mesh_dev && lbs_mesh_connected(priv)) |
202 | netif_wake_queue(priv->mesh_dev); | 202 | netif_wake_queue(priv->mesh_dev); |
203 | } | 203 | } |
204 | EXPORT_SYMBOL_GPL(lbs_send_tx_feedback); | 204 | EXPORT_SYMBOL_GPL(lbs_send_tx_feedback); |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index a8eb9e1fcf36..c0c7bc40b109 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -192,7 +192,7 @@ static void copy_active_data_rates(struct lbs_private *priv, u8 *rates) | |||
192 | lbs_deb_enter(LBS_DEB_WEXT); | 192 | lbs_deb_enter(LBS_DEB_WEXT); |
193 | 193 | ||
194 | if ((priv->connect_status != LBS_CONNECTED) && | 194 | if ((priv->connect_status != LBS_CONNECTED) && |
195 | (priv->mesh_connect_status != LBS_CONNECTED)) | 195 | !lbs_mesh_connected(priv)) |
196 | memcpy(rates, lbs_bg_rates, MAX_RATES); | 196 | memcpy(rates, lbs_bg_rates, MAX_RATES); |
197 | else | 197 | else |
198 | memcpy(rates, priv->curbssparams.rates, MAX_RATES); | 198 | memcpy(rates, priv->curbssparams.rates, MAX_RATES); |
@@ -307,7 +307,7 @@ static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, | |||
307 | 307 | ||
308 | /* Use nickname to indicate that mesh is on */ | 308 | /* Use nickname to indicate that mesh is on */ |
309 | 309 | ||
310 | if (priv->mesh_connect_status == LBS_CONNECTED) { | 310 | if (lbs_mesh_connected(priv)) { |
311 | strncpy(extra, "Mesh", 12); | 311 | strncpy(extra, "Mesh", 12); |
312 | extra[12] = '\0'; | 312 | extra[12] = '\0'; |
313 | dwrq->length = strlen(extra); | 313 | dwrq->length = strlen(extra); |
@@ -863,7 +863,7 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev) | |||
863 | 863 | ||
864 | /* If we're not associated, all quality values are meaningless */ | 864 | /* If we're not associated, all quality values are meaningless */ |
865 | if ((priv->connect_status != LBS_CONNECTED) && | 865 | if ((priv->connect_status != LBS_CONNECTED) && |
866 | (priv->mesh_connect_status != LBS_CONNECTED)) | 866 | !lbs_mesh_connected(priv)) |
867 | goto out; | 867 | goto out; |
868 | 868 | ||
869 | /* Quality by RSSI */ | 869 | /* Quality by RSSI */ |