diff options
author | Dan Williams <dcbw@redhat.com> | 2008-07-29 13:50:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-01 15:31:34 -0400 |
commit | 3b72b01d3ab623c296df49f2d71d40a38bcfb4b3 (patch) | |
tree | dc81c662fa88169c67ad5abdc55eaa696aa6c8b8 | |
parent | d4764b29b6e0f1608e397930677928e5a3f62bba (diff) |
libertas: only enable rtap with mesh firmware
Since only mesh-enabled firmware has the CMD_802_11_MONITOR_MODE on
which the rtap functionality depends, only expose the rtap functionality
when mesh is also available.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 14d5d61cec4c..bd32ac0b4e07 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -297,9 +297,7 @@ static ssize_t lbs_rtap_set(struct device *dev, | |||
297 | lbs_add_rtap(priv); | 297 | lbs_add_rtap(priv); |
298 | } | 298 | } |
299 | priv->monitormode = monitor_mode; | 299 | priv->monitormode = monitor_mode; |
300 | } | 300 | } else { |
301 | |||
302 | else { | ||
303 | if (!priv->monitormode) | 301 | if (!priv->monitormode) |
304 | return strlen(buf); | 302 | return strlen(buf); |
305 | priv->monitormode = 0; | 303 | priv->monitormode = 0; |
@@ -1242,8 +1240,6 @@ int lbs_start_card(struct lbs_private *priv) | |||
1242 | lbs_pr_err("cannot register ethX device\n"); | 1240 | lbs_pr_err("cannot register ethX device\n"); |
1243 | goto done; | 1241 | goto done; |
1244 | } | 1242 | } |
1245 | if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) | ||
1246 | lbs_pr_err("cannot register lbs_rtap attribute\n"); | ||
1247 | 1243 | ||
1248 | lbs_update_channel(priv); | 1244 | lbs_update_channel(priv); |
1249 | 1245 | ||
@@ -1275,6 +1271,13 @@ int lbs_start_card(struct lbs_private *priv) | |||
1275 | 1271 | ||
1276 | if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) | 1272 | if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) |
1277 | lbs_pr_err("cannot register lbs_mesh attribute\n"); | 1273 | lbs_pr_err("cannot register lbs_mesh attribute\n"); |
1274 | |||
1275 | /* While rtap isn't related to mesh, only mesh-enabled | ||
1276 | * firmware implements the rtap functionality via | ||
1277 | * CMD_802_11_MONITOR_MODE. | ||
1278 | */ | ||
1279 | if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) | ||
1280 | lbs_pr_err("cannot register lbs_rtap attribute\n"); | ||
1278 | } | 1281 | } |
1279 | } | 1282 | } |
1280 | 1283 | ||
@@ -1306,9 +1309,9 @@ void lbs_stop_card(struct lbs_private *priv) | |||
1306 | netif_carrier_off(priv->dev); | 1309 | netif_carrier_off(priv->dev); |
1307 | 1310 | ||
1308 | lbs_debugfs_remove_one(priv); | 1311 | lbs_debugfs_remove_one(priv); |
1309 | device_remove_file(&dev->dev, &dev_attr_lbs_rtap); | ||
1310 | if (priv->mesh_tlv) { | 1312 | if (priv->mesh_tlv) { |
1311 | device_remove_file(&dev->dev, &dev_attr_lbs_mesh); | 1313 | device_remove_file(&dev->dev, &dev_attr_lbs_mesh); |
1314 | device_remove_file(&dev->dev, &dev_attr_lbs_rtap); | ||
1312 | } | 1315 | } |
1313 | 1316 | ||
1314 | /* Flush pending command nodes */ | 1317 | /* Flush pending command nodes */ |