Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79195
b: refs/heads/master
c: 020f3d0
h: refs/heads/master
i:
  79193: ffaf092
  79191: f9f243d
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 875a3b0 commit 51802d2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f4625776f96e26b15d98615337ea5916648b1e8
refs/heads/master: 020f3d0001cb249ceae623c1a7ae0c196326ef3f
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,14 +1121,14 @@ int lbs_mesh_config(struct lbs_private *priv, int enable)
memset(&cmd, 0, sizeof(cmd));
cmd.action = cpu_to_le16(enable);
cmd.channel = cpu_to_le16(priv->curbssparams.channel);
cmd.type = cpu_to_le16(0x100 + 37);
cmd.type = cpu_to_le16(priv->mesh_tlv);

if (enable) {
cmd.length = cpu_to_le16(priv->mesh_ssid_len);
memcpy(cmd.data, priv->mesh_ssid, priv->mesh_ssid_len);
}
lbs_deb_cmd("mesh config channel %d SSID %s\n",
priv->curbssparams.channel,
lbs_deb_cmd("mesh config enable %d TLV %x channel %d SSID %s\n",
enable, priv->mesh_tlv, priv->curbssparams.channel,
escape_essid(priv->mesh_ssid, priv->mesh_ssid_len));
return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ struct lbs_private {

/** current ssid/bssid related parameters*/
struct current_bss_params curbssparams;

uint16_t mesh_tlv;
u8 mesh_ssid[IW_ESSID_MAX_SIZE + 1];
u8 mesh_ssid_len;

Expand Down
32 changes: 29 additions & 3 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,33 @@ int lbs_start_card(struct lbs_private *priv)
}
if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
lbs_pr_err("cannot register lbs_rtap attribute\n");
if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
lbs_pr_err("cannot register lbs_mesh attribute\n");

/* Enable mesh, if supported, and work out which TLV it uses.
0x100 + 291 is an unofficial value used in 5.110.20.pXX
0x100 + 37 is the official value used in 5.110.21.pXX
but we check them in that order because 20.pXX doesn't
give an error -- it just silently fails. */

/* 5.110.20.pXX firmware will fail the command if the channel
doesn't match the existing channel. But only if the TLV
is correct. If the channel is wrong, _BOTH_ versions will
give an error to 0x100+291, and allow 0x100+37 to succeed.
It's just that 5.110.20.pXX will not have done anything
useful */

lbs_update_channel(priv);
priv->mesh_tlv = 0x100 + 291;
if (lbs_mesh_config(priv, 1)) {
priv->mesh_tlv = 0x100 + 37;
if (lbs_mesh_config(priv, 1))
priv->mesh_tlv = 0;
}
if (priv->mesh_tlv) {
lbs_add_mesh(priv);

if (device_create_file(&dev->dev, &dev_attr_lbs_mesh))
lbs_pr_err("cannot register lbs_mesh attribute\n");
}

lbs_debugfs_init_one(priv, dev);

Expand Down Expand Up @@ -1201,7 +1226,8 @@ int lbs_stop_card(struct lbs_private *priv)

lbs_debugfs_remove_one(priv);
device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
if (priv->mesh_tlv)
device_remove_file(&dev->dev, &dev_attr_lbs_mesh);

/* Flush pending command nodes */
spin_lock_irqsave(&priv->driver_lock, flags);
Expand Down

0 comments on commit 51802d2

Please sign in to comment.