From 1bef00a60f27593b18181e6af2630fb66ba54c18 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 10 Dec 2007 15:24:47 -0500 Subject: [PATCH] --- yaml --- r: 79155 b: refs/heads/master c: 852e1f2a2627274102a3c2dc70a6547aeab99cb6 h: refs/heads/master i: 79153: 8e7bde9115008be3d11d8af7b77eefd0b95b17fd 79151: e9cdea99c8dc193d8c897004c0a3213e8b2610e3 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/libertas/cmd.c | 24 +++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 584e5fcad3a8..448dc81836d4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b31d8b90dcc6fbe39147863d13b93a8d49d2b341 +refs/heads/master: 852e1f2a2627274102a3c2dc70a6547aeab99cb6 diff --git a/trunk/drivers/net/wireless/libertas/cmd.c b/trunk/drivers/net/wireless/libertas/cmd.c index c7c226c09502..2efba5708041 100644 --- a/trunk/drivers/net/wireless/libertas/cmd.c +++ b/trunk/drivers/net/wireless/libertas/cmd.c @@ -19,26 +19,20 @@ void lbs_set_cmd_ctrl_node(struct lbs_private *priv, u16 wait_option, void *pdata_buf); -static u16 commands_allowed_in_ps[] = { - CMD_802_11_RSSI, -}; - /** - * @brief This function checks if the commans is allowed - * in PS mode not. + * @brief Checks whether a command is allowed in Power Save mode * * @param command the command ID - * @return TRUE or FALSE + * @return 1 if allowed, 0 if not allowed */ -static u8 is_command_allowed_in_ps(__le16 command) +static u8 is_command_allowed_in_ps(u16 cmd) { - int i; - - for (i = 0; i < ARRAY_SIZE(commands_allowed_in_ps); i++) { - if (command == cpu_to_le16(commands_allowed_in_ps[i])) - return 1; + switch (cmd) { + case CMD_802_11_RSSI: + return 1; + default: + break; } - return 0; } @@ -1715,7 +1709,7 @@ int lbs_execute_next_command(struct lbs_private *priv) if (cmdnode) { cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr; - if (is_command_allowed_in_ps(cmdptr->command)) { + if (is_command_allowed_in_ps(le16_to_cpu(cmdptr->command))) { if ((priv->psstate == PS_STATE_SLEEP) || (priv->psstate == PS_STATE_PRE_SLEEP)) { lbs_deb_host(