Skip to content

Commit

Permalink
libertas: remove some references to IW_MODE_abc
Browse files Browse the repository at this point in the history
... in pursue to quaff the wide-spread references to WEXT constants.

When setting SNMP_MIB_OID_BSS_TYPE, wext.c can directly calculate the value
the firmware wants.

Reading of SNMP_MIB_OID_BSS_TYPE doesn't happen anywhere, so no need to
convert the firmware value into WEXT values anyway.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Holger Schurig authored and John W. Linville committed Oct 27, 2009
1 parent e93156e commit fef0640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion drivers/net/wireless/libertas/assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,8 @@ static int assoc_helper_mode(struct lbs_private *priv,
}

priv->mode = assoc_req->mode;
ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, assoc_req->mode);
ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE,
assoc_req->mode == IW_MODE_ADHOC ? 2 : 1);

done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
Expand Down
10 changes: 2 additions & 8 deletions drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val)
switch (oid) {
case SNMP_MIB_OID_BSS_TYPE:
cmd.bufsize = cpu_to_le16(sizeof(u8));
cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
cmd.value[0] = val;
break;
case SNMP_MIB_OID_11D_ENABLE:
case SNMP_MIB_OID_FRAG_THRESHOLD:
Expand Down Expand Up @@ -443,13 +443,7 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val)

switch (le16_to_cpu(cmd.bufsize)) {
case sizeof(u8):
if (oid == SNMP_MIB_OID_BSS_TYPE) {
if (cmd.value[0] == 2)
*out_val = IW_MODE_ADHOC;
else
*out_val = IW_MODE_INFRA;
} else
*out_val = cmd.value[0];
*out_val = cmd.value[0];
break;
case sizeof(u16):
*out_val = le16_to_cpu(*((__le16 *)(&cmd.value)));
Expand Down

0 comments on commit fef0640

Please sign in to comment.