diff options
author | Dan Williams <dcbw@redhat.com> | 2007-08-02 11:40:45 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:48 -0400 |
commit | 8c5127657549d055ac9d709cdea73902a6ef392c (patch) | |
tree | 33e72a0b55165d51652a002ab6929857f0e2facc /drivers/net/wireless/libertas/cmdresp.c | |
parent | e52414728b930f0adcbc38c6498dd03b3568fe99 (diff) |
[PATCH] libertas: simplify and clean up data rate handling
Remove unused/duplicated fields and consolidate static data rate arrays,
for example the libertas_supported_rates[] and datarates[] arrays in
the bss_descriptor structure, and the libertas_supported_rates field
in the wlan_adapter structure.
Introduce libertas_fw_index_to_data_rate and libertas_data_rate_to_fw_index
functions and use them everywhere firmware requires a rate index rather
than a rate array.
The firmware requires the 4 basic rates to have the MSB set, but most
other stuff doesn't, like WEXT and mesh ioctls. Therefore, only set the MSB
on basic rates when pushing rate arrays to firmware instead of doing a ton
of (rate & 0x7f) everywhere.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index d90279269e7b..577c434089b0 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -430,21 +430,18 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, | |||
430 | { | 430 | { |
431 | struct cmd_ds_802_11_data_rate *pdatarate = &resp->params.drate; | 431 | struct cmd_ds_802_11_data_rate *pdatarate = &resp->params.drate; |
432 | wlan_adapter *adapter = priv->adapter; | 432 | wlan_adapter *adapter = priv->adapter; |
433 | u8 dot11datarate; | ||
434 | 433 | ||
435 | lbs_deb_enter(LBS_DEB_CMD); | 434 | lbs_deb_enter(LBS_DEB_CMD); |
436 | 435 | ||
437 | lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", | 436 | lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", (u8 *) pdatarate, |
438 | (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); | 437 | sizeof(struct cmd_ds_802_11_data_rate)); |
439 | 438 | ||
440 | dot11datarate = pdatarate->datarate[0]; | 439 | /* FIXME: get actual rates FW can do if this command actually returns |
441 | if (pdatarate->action == cpu_to_le16(CMD_ACT_GET_TX_RATE)) { | 440 | * all data rates supported. |
442 | memcpy(adapter->libertas_supported_rates, pdatarate->datarate, | 441 | */ |
443 | sizeof(adapter->libertas_supported_rates)); | 442 | adapter->cur_rate = libertas_fw_index_to_data_rate(pdatarate->rates[0]); |
444 | } | ||
445 | adapter->datarate = libertas_index_to_data_rate(dot11datarate); | ||
446 | 443 | ||
447 | lbs_deb_enter(LBS_DEB_CMD); | 444 | lbs_deb_leave(LBS_DEB_CMD); |
448 | return 0; | 445 | return 0; |
449 | } | 446 | } |
450 | 447 | ||