Commit f0d5a975 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: refactor ks7010_sme_enqueue_events function

Event to send to init the card are always the same so change
code to be more readable putting them into an array and
enqueuing also using a for loop.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2059ebe9
...@@ -806,24 +806,19 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) ...@@ -806,24 +806,19 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
static void ks7010_sme_enqueue_events(struct ks_wlan_private *priv) static void ks7010_sme_enqueue_events(struct ks_wlan_private *priv)
{ {
hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM); static const u16 init_events[] = {
SME_GET_EEPROM_CKSUM, SME_STOP_REQUEST,
/* load initial wireless parameter */ SME_RTS_THRESHOLD_REQUEST, SME_FRAGMENTATION_THRESHOLD_REQUEST,
hostif_sme_enqueue(priv, SME_STOP_REQUEST); SME_WEP_INDEX_REQUEST, SME_WEP_KEY1_REQUEST,
SME_WEP_KEY2_REQUEST, SME_WEP_KEY3_REQUEST,
hostif_sme_enqueue(priv, SME_RTS_THRESHOLD_REQUEST); SME_WEP_KEY4_REQUEST, SME_WEP_FLAG_REQUEST,
hostif_sme_enqueue(priv, SME_FRAGMENTATION_THRESHOLD_REQUEST); SME_RSN_ENABLED_REQUEST, SME_MODE_SET_REQUEST,
SME_START_REQUEST
hostif_sme_enqueue(priv, SME_WEP_INDEX_REQUEST); };
hostif_sme_enqueue(priv, SME_WEP_KEY1_REQUEST); int ev;
hostif_sme_enqueue(priv, SME_WEP_KEY2_REQUEST);
hostif_sme_enqueue(priv, SME_WEP_KEY3_REQUEST); for (ev = 0; ev < ARRAY_SIZE(init_events); ev++)
hostif_sme_enqueue(priv, SME_WEP_KEY4_REQUEST); hostif_sme_enqueue(priv, init_events[ev]);
hostif_sme_enqueue(priv, SME_WEP_FLAG_REQUEST);
hostif_sme_enqueue(priv, SME_RSN_ENABLED_REQUEST);
hostif_sme_enqueue(priv, SME_MODE_SET_REQUEST);
hostif_sme_enqueue(priv, SME_START_REQUEST);
} }
static void ks7010_card_init(struct ks_wlan_private *priv) static void ks7010_card_init(struct ks_wlan_private *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment