Re: [PATCH stable] libertas: Extend CMD_MESH_CONFIG to get and set persistent mesh default params.
On Thu, 2008-05-15 at 11:01 -0700, Brian Cavagnolo wrote: This patch is based on a patch from Shailendra Govardhan. It introduces several new iwprivs: {get,set}_bootflag {get,set}_boottime {get,set}_def_chan {get,set}_def_protid {get,set}_def_metid {get,set}_def_meshcap {get,set}_def_meshid. These commands are only supported on Marvell hardware that implements persistent defaults, such as the OLPC Active Antenna. Accordingly, this patch may not be suitable for upstream merging. See http://dev.laptop.org/ticket/6823 for minimal testing results and known issues. See http://www.laptop.org/teamwiki/index.php/Tech:Wireless#Firmware_image_which_stores_the_mesh_parameters_in_flash for iwpriv documentation. Signed-off-by: Brian Cavagnolo [EMAIL PROTECTED] --- Hm. I was intending to veto the addition of any more private ioctls to the olpc tree, because they all need fixing to use cfg80211 or something else upstream, and we only make pain for ourselves by adding to the divergence -- adding new APIs to userspace when we _know_ are going to have to change them is just silly. But this is the _one_ thing which might actually be OK to do with a private ioctl, since it's very hardware-specific. Unlike like all the mesh-mangling stuff where we really ought to be compatible with o11s. So maybe, just maybe, we _can_ do this with iwpriv and push that upstream. If you want to revamp the patch to apply to the upstream kernel and see what people think of it, go ahead. -- dwmw2 ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [PATCH stable] libertas: Extend CMD_MESH_CONFIG to get and set persistent mesh default params.
On Fri, 2008-05-16 at 15:09 +0100, David Woodhouse wrote: On Thu, 2008-05-15 at 11:01 -0700, Brian Cavagnolo wrote: This patch is based on a patch from Shailendra Govardhan. It introduces several new iwprivs: {get,set}_bootflag {get,set}_boottime {get,set}_def_chan {get,set}_def_protid {get,set}_def_metid {get,set}_def_meshcap {get,set}_def_meshid. These commands are only supported on Marvell hardware that implements persistent defaults, such as the OLPC Active Antenna. Accordingly, this patch may not be suitable for upstream merging. But this is the _one_ thing which might actually be OK to do with a private ioctl, since it's very hardware-specific. Unlike like all the mesh-mangling stuff where we really ought to be compatible with o11s. So maybe, just maybe, we _can_ do this with iwpriv and push that upstream. Maybe we do, after all, need an iwpriv equivalent in cfg80211/nl80211 so that we can kill wext at some point. Or maybe this should be in sysfs or so? johannes signature.asc Description: This is a digitally signed message part ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [PATCH stable] libertas: Extend CMD_MESH_CONFIG to get and set persistent mesh default params.
On Fri, May 16, 2008 at 4:50 PM, Johannes Berg [EMAIL PROTECTED] wrote: On Fri, 2008-05-16 at 15:09 +0100, David Woodhouse wrote: On Thu, 2008-05-15 at 11:01 -0700, Brian Cavagnolo wrote: This patch is based on a patch from Shailendra Govardhan. It introduces several new iwprivs: {get,set}_bootflag {get,set}_boottime {get,set}_def_chan {get,set}_def_protid {get,set}_def_metid {get,set}_def_meshcap {get,set}_def_meshid. These commands are only supported on Marvell hardware that implements persistent defaults, such as the OLPC Active Antenna. Accordingly, this patch may not be suitable for upstream merging. But this is the _one_ thing which might actually be OK to do with a private ioctl, since it's very hardware-specific. Unlike like all the mesh-mangling stuff where we really ought to be compatible with o11s. So maybe, just maybe, we _can_ do this with iwpriv and push that upstream. Maybe we do, after all, need an iwpriv equivalent in cfg80211/nl80211 so that we can kill wext at some point. Or maybe this should be in sysfs or so? johannes Or maybe in configfs? That's a better place for configuration options. (BTW rt2x00 uses debugfs as an iwpriv replacement, so that's another possibility.) -- Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [PATCH stable] libertas: Extend CMD_MESH_CONFIG to get and set persistent mesh default params.
On Fri, 2008-05-16 at 17:51 +0200, Stefanik Gábor wrote: On Fri, May 16, 2008 at 4:50 PM, Johannes Berg [EMAIL PROTECTED] wrote: On Fri, 2008-05-16 at 15:09 +0100, David Woodhouse wrote: On Thu, 2008-05-15 at 11:01 -0700, Brian Cavagnolo wrote: This patch is based on a patch from Shailendra Govardhan. It introduces several new iwprivs: {get,set}_bootflag {get,set}_boottime {get,set}_def_chan {get,set}_def_protid {get,set}_def_metid {get,set}_def_meshcap {get,set}_def_meshid. These commands are only supported on Marvell hardware that implements persistent defaults, such as the OLPC Active Antenna. Accordingly, this patch may not be suitable for upstream merging. But this is the _one_ thing which might actually be OK to do with a private ioctl, since it's very hardware-specific. Unlike like all the mesh-mangling stuff where we really ought to be compatible with o11s. So maybe, just maybe, we _can_ do this with iwpriv and push that upstream. Maybe we do, after all, need an iwpriv equivalent in cfg80211/nl80211 so that we can kill wext at some point. Or maybe this should be in sysfs or so? johannes Or maybe in configfs? That's a better place for configuration options. (BTW rt2x00 uses debugfs as an iwpriv replacement, so that's another possibility.) I keep proposing debugfs too, but in some cases the commands aren't just for poking around with stuff. configfs is probably a better answer to tweakables that aren't just ricer-geekporn. Dan ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
[PATCH stable] libertas: Extend CMD_MESH_CONFIG to get and set persistent mesh default params.
This patch is based on a patch from Shailendra Govardhan. It introduces several new iwprivs: {get,set}_bootflag {get,set}_boottime {get,set}_def_chan {get,set}_def_protid {get,set}_def_metid {get,set}_def_meshcap {get,set}_def_meshid. These commands are only supported on Marvell hardware that implements persistent defaults, such as the OLPC Active Antenna. Accordingly, this patch may not be suitable for upstream merging. See http://dev.laptop.org/ticket/6823 for minimal testing results and known issues. See http://www.laptop.org/teamwiki/index.php/Tech:Wireless#Firmware_image_which_stores_the_mesh_parameters_in_flash for iwpriv documentation. Signed-off-by: Brian Cavagnolo [EMAIL PROTECTED] --- drivers/net/wireless/libertas/assoc.c |5 +- drivers/net/wireless/libertas/cmd.c | 69 +-- drivers/net/wireless/libertas/cmd.h |2 + drivers/net/wireless/libertas/defs.h | 10 ++ drivers/net/wireless/libertas/host.h | 17 +++ drivers/net/wireless/libertas/ioctl.c | 221 + drivers/net/wireless/libertas/ioctl.h | 14 ++ drivers/net/wireless/libertas/main.c | 13 ++- drivers/net/wireless/libertas/types.h | 31 + drivers/net/wireless/libertas/wext.c | 28 - 10 files changed, 389 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index e742550..45e1f20 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -210,7 +210,7 @@ static int assoc_helper_channel(struct lbs_private *priv, /* Change mesh channel first; 21.p21 firmware won't let you change channel otherwise (even though it'll return an error to this */ - lbs_mesh_config(priv, 0, assoc_req-channel); + lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_STOP, assoc_req-channel); } lbs_deb_assoc(ASSOC: channel: %d - %d\n, @@ -249,7 +249,8 @@ static int assoc_helper_channel(struct lbs_private *priv, restore_mesh: if (priv-mesh_dev) - lbs_mesh_config(priv, 1, priv-curbssparams.channel); + lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, + priv-curbssparams.channel); done: lbs_deb_leave_args(LBS_DEB_ASSOC, ret %d, ret); diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 0ae9851..c980816 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c @@ -4,6 +4,7 @@ */ #include net/iw_handler.h +#include net/ieee80211.h #include host.h #include hostcmd.h #include decl.h @@ -1114,24 +1115,68 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, } EXPORT_SYMBOL_GPL(lbs_mesh_access); -int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan) +int lbs_mesh_config_send(struct lbs_private *priv, struct cmd_ds_mesh_config *cmd, + u16 action, u16 type) +{ + int ret; + + lbs_deb_enter(LBS_DEB_CMD); + + cmd-hdr.command = cpu_to_le16(CMD_MESH_CONFIG); + cmd-hdr.size = cpu_to_le16(sizeof(struct cmd_ds_mesh_config)); + cmd-hdr.result = 0; + + cmd-type = cpu_to_le16(type); + cmd-action = cpu_to_le16(action); + + ret = lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd); + + lbs_deb_leave(LBS_DEB_CMD); + return ret; +} + +/* This function is the CMD_MESH_CONFIG legacy function. It only handles the + * START and STOP actions. The extended actions supported by CMD_MESH_CONFIG + * are all handled by preparing a struct cmd_ds_mesh_config and passing it to + * lbs_mesh_config_send. + */ +int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan) { struct cmd_ds_mesh_config cmd; + struct mrvl_meshie *ie; memset(cmd, 0, sizeof(cmd)); - cmd.action = cpu_to_le16(enable); cmd.channel = cpu_to_le16(chan); - cmd.type = cpu_to_le16(priv-mesh_tlv); - cmd.hdr.size = cpu_to_le16(sizeof(cmd)); - - if (enable) { - cmd.length = cpu_to_le16(priv-mesh_ssid_len); - memcpy(cmd.data, priv-mesh_ssid, priv-mesh_ssid_len); + ie = (struct mrvl_meshie *)cmd.data; + + switch(action) { + case CMD_ACT_MESH_CONFIG_START: + ie-hdr.id = MFIE_TYPE_GENERIC; + ie-val.oui[0] = 0x00; + ie-val.oui[1] = 0x50; + ie-val.oui[2] = 0x43; + ie-val.type = MARVELL_MESH_IE_TYPE; + ie-val.subtype = MARVELL_MESH_IE_SUBTYPE; + ie-val.version = MARVELL_MESH_IE_VERSION; + ie-val.active_protocol_id = MARVELL_MESH_PROTO_ID_HWMP; + ie-val.active_metric_id = MARVELL_MESH_METRIC_ID; + ie-val.mesh_capability = MARVELL_MESH_CAPABILITY; + ie-val.mesh_id_len = priv-mesh_ssid_len; +