Commit 4c1f0e3a authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()

Refactor wilc_wlan_handle_rxq() to fix line over 80 character issue
found by checkpatch.pl script. Added a new function to split
'wilc_wlan_handle_rxq' function code.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e03aec25
......@@ -773,33 +773,17 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
return ret;
}
static void wilc_wlan_handle_rxq(struct wilc *wilc)
static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size)
{
int offset = 0, size;
u8 *buffer;
struct rxq_entry_t *rqe;
wilc->rxq_exit = 0;
do {
if (wilc->quit) {
complete(&wilc->cfg_event);
break;
}
rqe = wilc_wlan_rxq_remove(wilc);
if (!rqe)
break;
buffer = rqe->buffer;
size = rqe->buffer_size;
offset = 0;
do {
int offset = 0;
u32 header;
u32 pkt_len, pkt_offset, tp_len;
int is_cfg_packet;
u8 *buff_ptr;
memcpy(&header, &buffer[offset], 4);
do {
buff_ptr = buffer + offset;
memcpy(&header, buff_ptr, 4);
header = cpu_to_le32(header);
is_cfg_packet = (header >> 31) & 0x1;
......@@ -814,28 +798,33 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
pkt_offset &= ~(IS_MANAGMEMENT |
IS_MANAGMEMENT_CALLBACK |
IS_MGMT_STATUS_SUCCES);
wilc_wfi_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
buff_ptr += HOST_HDR_OFFSET;
wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len);
} else {
if (!is_cfg_packet) {
if (pkt_len > 0) {
wilc_frmw_to_linux(wilc,
&buffer[offset],
wilc_frmw_to_linux(wilc, buff_ptr,
pkt_len,
pkt_offset);
}
} else {
struct wilc_cfg_rsp rsp;
wilc_wlan_cfg_indicate_rx(wilc, &buffer[pkt_offset + offset], pkt_len, &rsp);
buff_ptr += pkt_offset;
wilc_wlan_cfg_indicate_rx(wilc, buff_ptr,
pkt_len,
&rsp);
if (rsp.type == WILC_CFG_RSP) {
if (wilc->cfg_seq_no == rsp.seq_no)
complete(&wilc->cfg_event);
} else if (rsp.type == WILC_CFG_RSP_STATUS) {
wilc_mac_indicate(wilc, WILC_MAC_INDICATE_STATUS);
wilc_mac_indicate(wilc,
WILC_MAC_INDICATE_STATUS);
} else if (rsp.type == WILC_CFG_RSP_SCAN) {
wilc_mac_indicate(wilc, WILC_MAC_INDICATE_SCAN);
wilc_mac_indicate(wilc,
WILC_MAC_INDICATE_SCAN);
}
}
}
......@@ -843,6 +832,29 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
if (offset >= size)
break;
} while (1);
}
static void wilc_wlan_handle_rxq(struct wilc *wilc)
{
int size;
u8 *buffer;
struct rxq_entry_t *rqe;
wilc->rxq_exit = 0;
do {
if (wilc->quit) {
complete(&wilc->cfg_event);
break;
}
rqe = wilc_wlan_rxq_remove(wilc);
if (!rqe)
break;
buffer = rqe->buffer;
size = rqe->buffer_size;
wilc_wlan_handle_rx_buff(wilc, buffer, size);
kfree(rqe);
} while (1);
......
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