diff options
author | Dan Williams <dcbw@redhat.com> | 2007-12-10 15:24:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:37 -0500 |
commit | 852e1f2a2627274102a3c2dc70a6547aeab99cb6 (patch) | |
tree | 6701d518c17e15b488bfe4b977d385b290d0a2d6 /drivers/net/wireless/libertas/cmd.c | |
parent | b31d8b90dcc6fbe39147863d13b93a8d49d2b341 (diff) |
libertas: clean up is_command_allowed_in_ps()
Total overkill to have an array when there's only one command in it.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index c7c226c09502..2efba5708041 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -19,26 +19,20 @@ void lbs_set_cmd_ctrl_node(struct lbs_private *priv, | |||
19 | u16 wait_option, void *pdata_buf); | 19 | u16 wait_option, void *pdata_buf); |
20 | 20 | ||
21 | 21 | ||
22 | static u16 commands_allowed_in_ps[] = { | ||
23 | CMD_802_11_RSSI, | ||
24 | }; | ||
25 | |||
26 | /** | 22 | /** |
27 | * @brief This function checks if the commans is allowed | 23 | * @brief Checks whether a command is allowed in Power Save mode |
28 | * in PS mode not. | ||
29 | * | 24 | * |
30 | * @param command the command ID | 25 | * @param command the command ID |
31 | * @return TRUE or FALSE | 26 | * @return 1 if allowed, 0 if not allowed |
32 | */ | 27 | */ |
33 | static u8 is_command_allowed_in_ps(__le16 command) | 28 | static u8 is_command_allowed_in_ps(u16 cmd) |
34 | { | 29 | { |
35 | int i; | 30 | switch (cmd) { |
36 | 31 | case CMD_802_11_RSSI: | |
37 | for (i = 0; i < ARRAY_SIZE(commands_allowed_in_ps); i++) { | 32 | return 1; |
38 | if (command == cpu_to_le16(commands_allowed_in_ps[i])) | 33 | default: |
39 | return 1; | 34 | break; |
40 | } | 35 | } |
41 | |||
42 | return 0; | 36 | return 0; |
43 | } | 37 | } |
44 | 38 | ||
@@ -1715,7 +1709,7 @@ int lbs_execute_next_command(struct lbs_private *priv) | |||
1715 | if (cmdnode) { | 1709 | if (cmdnode) { |
1716 | cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; | 1710 | cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; |
1717 | 1711 | ||
1718 | if (is_command_allowed_in_ps(cmdptr->command)) { | 1712 | if (is_command_allowed_in_ps(le16_to_cpu(cmdptr->command))) { |
1719 | if ((priv->psstate == PS_STATE_SLEEP) || | 1713 | if ((priv->psstate == PS_STATE_SLEEP) || |
1720 | (priv->psstate == PS_STATE_PRE_SLEEP)) { | 1714 | (priv->psstate == PS_STATE_PRE_SLEEP)) { |
1721 | lbs_deb_host( | 1715 | lbs_deb_host( |