2008-05-14 14:30:49

by Holger Schurig

[permalink] [raw]
Subject: [PATCH] libertas: remove lbs_get_data_rate()

lbs_get_data_rate() get's called, but no-one uses it's result.

Signed-off-by: Holger Schurig <[email protected]>

Index: wireless-testing/drivers/net/wireless/libertas/cmd.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/libertas/cmd.c 2008-05-14 14:58:06.000000000 +0200
+++ wireless-testing/drivers/net/wireless/libertas/cmd.c 2008-05-14 14:58:15.000000000 +0200
@@ -697,38 +697,6 @@ static int lbs_cmd_802_11_rate_adapt_rat
}

/**
- * @brief Get the current data rate
- *
- * @param priv A pointer to struct lbs_private structure
- *
- * @return The data rate on success, error on failure
- */
-int lbs_get_data_rate(struct lbs_private *priv)
-{
- struct cmd_ds_802_11_data_rate cmd;
- int ret = -1;
-
- lbs_deb_enter(LBS_DEB_CMD);
-
- memset(&cmd, 0, sizeof(cmd));
- cmd.hdr.size = cpu_to_le16(sizeof(cmd));
- cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE);
-
- ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
- if (ret)
- goto out;
-
- lbs_deb_hex(LBS_DEB_CMD, "DATA_RATE_RESP", (u8 *) &cmd, sizeof (cmd));
-
- ret = (int) lbs_fw_index_to_data_rate(cmd.rates[0]);
- lbs_deb_cmd("DATA_RATE: current rate 0x%02x\n", ret);
-
-out:
- lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
- return ret;
-}
-
-/**
* @brief Set the data rate
*
* @param priv A pointer to struct lbs_private structure
Index: wireless-testing/drivers/net/wireless/libertas/cmd.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/libertas/cmd.h 2008-05-14 14:59:07.000000000 +0200
+++ wireless-testing/drivers/net/wireless/libertas/cmd.h 2008-05-14 14:59:11.000000000 +0200
@@ -34,7 +34,6 @@ int lbs_update_hw_spec(struct lbs_privat
int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
struct cmd_ds_mesh_access *cmd);

-int lbs_get_data_rate(struct lbs_private *priv);
int lbs_set_data_rate(struct lbs_private *priv, u8 rate);

int lbs_get_channel(struct lbs_private *priv);
Index: wireless-testing/drivers/net/wireless/libertas/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/libertas/main.c 2008-05-14 14:58:28.000000000 +0200
+++ wireless-testing/drivers/net/wireless/libertas/main.c 2008-05-14 15:04:14.000000000 +0200
@@ -928,20 +928,10 @@ static int lbs_setup_firmware(struct lbs
*/
memset(priv->current_addr, 0xff, ETH_ALEN);
ret = lbs_update_hw_spec(priv);
- if (ret) {
- ret = -1;
+ if (ret)
goto done;
- }

lbs_set_mac_control(priv);
-
- ret = lbs_get_data_rate(priv);
- if (ret < 0) {
- ret = -1;
- goto done;
- }
-
- ret = 0;
done:
lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
return ret;


2008-05-14 16:57:24

by Pavel Roskin

[permalink] [raw]
Subject: Re: [PATCH] libertas: remove lbs_get_data_rate()

On Wed, 2008-05-14 at 16:27 +0200, Holger Schurig wrote:
> lbs_get_data_rate() get's called, but no-one uses it's result.

s/'//g

Apostrophe overload :-)

--
Regards,
Pavel Roskin

2008-05-14 14:46:59

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] libertas: remove lbs_get_data_rate()

On Wed, 2008-05-14 at 16:27 +0200, Holger Schurig wrote:
> lbs_get_data_rate() get's called, but no-one uses it's result.
>
> Signed-off-by: Holger Schurig <[email protected]>

Acked-by: Dan Williams <[email protected]>

We currently get the iwconfig current rate from the last received packet
when the rate is 'auto'; I guess if we care about the TX data rate at
some future time we can use a combination of DATA_RATE (< 5.1 firmware)
and TX_RATEQUERY (>= 5.1 firmware) to get it.

> Index: wireless-testing/drivers/net/wireless/libertas/cmd.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/cmd.c 2008-05-14 14:58:06.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/libertas/cmd.c 2008-05-14 14:58:15.000000000 +0200
> @@ -697,38 +697,6 @@ static int lbs_cmd_802_11_rate_adapt_rat
> }
>
> /**
> - * @brief Get the current data rate
> - *
> - * @param priv A pointer to struct lbs_private structure
> - *
> - * @return The data rate on success, error on failure
> - */
> -int lbs_get_data_rate(struct lbs_private *priv)
> -{
> - struct cmd_ds_802_11_data_rate cmd;
> - int ret = -1;
> -
> - lbs_deb_enter(LBS_DEB_CMD);
> -
> - memset(&cmd, 0, sizeof(cmd));
> - cmd.hdr.size = cpu_to_le16(sizeof(cmd));
> - cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE);
> -
> - ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
> - if (ret)
> - goto out;
> -
> - lbs_deb_hex(LBS_DEB_CMD, "DATA_RATE_RESP", (u8 *) &cmd, sizeof (cmd));
> -
> - ret = (int) lbs_fw_index_to_data_rate(cmd.rates[0]);
> - lbs_deb_cmd("DATA_RATE: current rate 0x%02x\n", ret);
> -
> -out:
> - lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> * @brief Set the data rate
> *
> * @param priv A pointer to struct lbs_private structure
> Index: wireless-testing/drivers/net/wireless/libertas/cmd.h
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/cmd.h 2008-05-14 14:59:07.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/libertas/cmd.h 2008-05-14 14:59:11.000000000 +0200
> @@ -34,7 +34,6 @@ int lbs_update_hw_spec(struct lbs_privat
> int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
> struct cmd_ds_mesh_access *cmd);
>
> -int lbs_get_data_rate(struct lbs_private *priv);
> int lbs_set_data_rate(struct lbs_private *priv, u8 rate);
>
> int lbs_get_channel(struct lbs_private *priv);
> Index: wireless-testing/drivers/net/wireless/libertas/main.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/main.c 2008-05-14 14:58:28.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/libertas/main.c 2008-05-14 15:04:14.000000000 +0200
> @@ -928,20 +928,10 @@ static int lbs_setup_firmware(struct lbs
> */
> memset(priv->current_addr, 0xff, ETH_ALEN);
> ret = lbs_update_hw_spec(priv);
> - if (ret) {
> - ret = -1;
> + if (ret)
> goto done;
> - }
>
> lbs_set_mac_control(priv);
> -
> - ret = lbs_get_data_rate(priv);
> - if (ret < 0) {
> - ret = -1;
> - goto done;
> - }
> -
> - ret = 0;
> done:
> lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
> return ret;


2008-05-20 22:08:49

by David Woodhouse

[permalink] [raw]
Subject: Re: [PATCH] libertas: remove lbs_get_data_rate()

On Wed, 2008-05-14 at 12:57 -0400, Pavel Roskin wrote:
> On Wed, 2008-05-14 at 16:27 +0200, Holger Schurig wrote:
> > lbs_get_data_rate() get's called, but no-one uses it's result.
>
> s/'//g
>
> Apostrophe overload :-)

When this got committed the g on the above was ignored...

--
dwmw2


2008-05-14 14:57:27

by Holger Schurig

[permalink] [raw]
Subject: Re: [PATCH] libertas: remove lbs_get_data_rate()

Ha, I like Dan in Auto-Ack-Mode :-) Dan, don't forget to ACK
Masakazu Mokuno :-)

2008-05-21 00:58:41

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] libertas: remove lbs_get_data_rate()

On Tue, May 20, 2008 at 11:08:39PM +0100, David Woodhouse wrote:
> On Wed, 2008-05-14 at 12:57 -0400, Pavel Roskin wrote:
> > On Wed, 2008-05-14 at 16:27 +0200, Holger Schurig wrote:
> > > lbs_get_data_rate() get's called, but no-one uses it's result.
> >
> > s/'//g
> >
> > Apostrophe overload :-)
>
> When this got committed the g on the above was ignored...

True, sorry.

John
--
John W. Linville
[email protected]