diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2019-11-05 09:51:36 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-05 18:08:53 +0100 |
commit | 156aafd2bec0b707dc50cffb846e43cbc8258e80 (patch) | |
tree | 9594f49e3cac71eb741f2094dcb7ed335efd7242 /drivers/staging/wilc1000 | |
parent | 027caaab0de784c57535d794459cf34cf6f12592 (diff) |
staging: wilc1000: use defines for msg types received from firmware
Added defines for different types of messages received from firmware.
Removed the unnecessary comments because after the addition of macros
the message types are self-explanatory.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-7-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/wlan_cfg.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/staging/wilc1000/wlan_cfg.c b/drivers/staging/wilc1000/wlan_cfg.c index c5b1678c7b5e..6f6b286788d1 100644 --- a/drivers/staging/wilc1000/wlan_cfg.c +++ b/drivers/staging/wilc1000/wlan_cfg.c @@ -44,6 +44,11 @@ static const struct wilc_cfg_str g_cfg_str[] = { {WID_NIL, NULL} }; +#define WILC_RESP_MSG_TYPE_CONFIG_REPLY 'R' +#define WILC_RESP_MSG_TYPE_STATUS_INFO 'I' +#define WILC_RESP_MSG_TYPE_NETWORK_INFO 'N' +#define WILC_RESP_MSG_TYPE_SCAN_COMPLETE 'S' + /******************************************** * * Configuration Functions @@ -360,21 +365,14 @@ void wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, size -= 4; rsp->type = 0; - /* - * The valid types of response messages are - * 'R' (Response), - * 'I' (Information), and - * 'N' (Network Information) - */ - switch (msg_type) { - case 'R': + case WILC_RESP_MSG_TYPE_CONFIG_REPLY: wilc_wlan_parse_response_frame(wilc, frame, size); rsp->type = WILC_CFG_RSP; rsp->seq_no = msg_id; break; - case 'I': + case WILC_RESP_MSG_TYPE_STATUS_INFO: wilc_wlan_parse_info_frame(wilc, frame); rsp->type = WILC_CFG_RSP_STATUS; rsp->seq_no = msg_id; @@ -382,11 +380,11 @@ void wilc_wlan_cfg_indicate_rx(struct wilc *wilc, u8 *frame, int size, wilc_gnrl_async_info_received(wilc, frame - 4, size + 4); break; - case 'N': + case WILC_RESP_MSG_TYPE_NETWORK_INFO: wilc_network_info_received(wilc, frame - 4, size + 4); break; - case 'S': + case WILC_RESP_MSG_TYPE_SCAN_COMPLETE: wilc_scan_complete_received(wilc, frame - 4, size + 4); break; |