From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for alignment should match open parenthesis
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index f82ecb9..976964d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -264,9 +264,11 @@ static int init_irq(struct net_device *dev)
PRINT_ER("could not obtain gpio for WILC_INTR\n");
}
- if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, isr_uh_routine, isr_bh_routine,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- "WILC_IRQ", dev)) < 0) {
+ if (ret != -1 && request_threaded_irq(wl->dev_irq_num,
+ isr_uh_routine,
+ isr_bh_routine,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ "WILC_IRQ", dev) < 0) {
PRINT_ER("Failed to request IRQ for GPIO: %d\n", GPIO_NUM);
ret = -1;
} else {
@@ -1472,8 +1474,7 @@ void wl_wlan_cleanup(struct wilc *wilc)
int i = 0;
perInterface_wlan_t *nic[NUM_CONCURRENT_IFC];
- if (wilc &&
- (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
+ if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
unregister_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Ack_no variable to ack_no
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 6d72e09..52351c6 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -306,22 +306,25 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
(u32)ip_hdr_ptr[3];
data_offset = ((u32)tcp_hdr_ptr[12] & 0xf0) >> 2;
if (total_length == (IHL + data_offset)) {
- u32 seq_no, Ack_no;
+ u32 seq_no, ack_no;
seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]);
- Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]);
+ ack_no = ((u32)tcp_hdr_ptr[8] << 24) +
+ ((u32)tcp_hdr_ptr[9] << 16) +
+ ((u32)tcp_hdr_ptr[10] << 8) +
+ (u32)tcp_hdr_ptr[11];
for (i = 0; i < tcp_session; i++) {
if (ack_session_info[i].seq_num == seq_no) {
- update_tcp_session(i, Ack_no);
+ update_tcp_session(i, ack_no);
break;
}
}
if (i == tcp_session)
add_tcp_session(0, 0, seq_no);
- add_tcp_pending_ack(Ack_no, i, tqe);
+ add_tcp_pending_ack(ack_no, i, tqe);
}
} else {
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the warnings reported by checkpatch.pl
for Missing a blank line after declarations.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index d3117f9..7ebfcaf 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -81,6 +81,7 @@ static inline void release_bus(BUS_RELEASE_T release)
static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
{
wilc_wlan_dev_t *p = &g_wlan;
+
if (tqe == p->txq_head) {
p->txq_head = tqe->next;
if (p->txq_head)
@@ -500,6 +501,7 @@ static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc,
struct txq_entry_t *tqe)
{
unsigned long flags;
+
spin_lock_irqsave(&wilc->txq_spinlock, flags);
tqe = tqe->next;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename drvHandler to drv_handler that is third argument of
wilc_wlan_cfg_commit function to avoid camelcase.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index d7834c5..2e1d9b8 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1449,13 +1449,13 @@ void wilc_wlan_cleanup(struct net_device *dev)
p->hif_func.hif_deinit(NULL);
}
-static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
+static int wilc_wlan_cfg_commit(int type, u32 drv_handler)
{
wilc_wlan_dev_t *p = &g_wlan;
wilc_cfg_frame_t *cfg = &p->cfg_frame;
int total_len = p->cfg_frame_offset + 4 + DRIVER_HANDLER_SIZE;
int seq_no = p->cfg_seq_no % 256;
- int driver_handler = (u32)drvHandler;
+ int driver_handler = (u32)drv_handler;
if (type == WILC_CFG_SET)
cfg->wid_header[0] = 'W';
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Init_TCP_tracking function to init_tcp_tracking
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index df20d4d..df0f5ce 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -222,7 +222,7 @@ u32 pending_base;
u32 tcp_session;
u32 pending_acks;
-static inline int Init_TCP_tracking(void)
+static inline int init_tcp_tracking(void)
{
return 0;
}
@@ -1697,7 +1697,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
goto _fail_;
}
#ifdef TCP_ACK_FILTER
- Init_TCP_tracking();
+ init_tcp_tracking();
#endif
return 1;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Opened_TCP_session variable to tcp_session
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index a1b6067..34e1097 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -219,7 +219,7 @@ struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS];
u32 pending_base;
-u32 Opened_TCP_session;
+u32 tcp_session;
u32 Pending_Acks;
static inline int Init_TCP_tracking(void)
@@ -229,13 +229,13 @@ static inline int Init_TCP_tracking(void)
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
- ack_session_info[Opened_TCP_session].seq_num = seq;
- ack_session_info[Opened_TCP_session].bigger_ack_num = 0;
- ack_session_info[Opened_TCP_session].src_port = src_prt;
- ack_session_info[Opened_TCP_session].dst_port = dst_prt;
- Opened_TCP_session++;
+ ack_session_info[tcp_session].seq_num = seq;
+ ack_session_info[tcp_session].bigger_ack_num = 0;
+ ack_session_info[tcp_session].src_port = src_prt;
+ ack_session_info[tcp_session].dst_port = dst_prt;
+ tcp_session++;
- PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", Opened_TCP_session, seq);
+ PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", tcp_session, seq);
return 0;
}
@@ -312,13 +312,13 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]);
- for (i = 0; i < Opened_TCP_session; i++) {
+ for (i = 0; i < tcp_session; i++) {
if (ack_session_info[i].seq_num == seq_no) {
Update_TCP_track_session(i, Ack_no);
break;
}
}
- if (i == Opened_TCP_session)
+ if (i == tcp_session)
add_TCP_track_session(0, 0, seq_no);
add_TCP_Pending_Ack(Ack_no, i, tqe);
@@ -365,7 +365,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
}
}
Pending_Acks = 0;
- Opened_TCP_session = 0;
+ tcp_session = 0;
if (pending_base == 0)
pending_base = MAX_TCP_SESSION;
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes u32SleepTime that is second argument of
chip_sleep_manually function because it is not used in this function.
Remove argument in the function call also.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 3 +--
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan.h | 1 +
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 84a2479..7014915 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -271,7 +271,6 @@ static struct host_if_drv *join_req_drv;
static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo);
-extern void chip_sleep_manually(u32 u32SleepTime);
extern int linux_wlan_get_num_conn_ifcs(void);
static int add_handler_in_list(struct host_if_drv *handler)
@@ -2906,7 +2905,7 @@ static int hostIFthread(void *pvArg)
PRINT_D(HOSTINF_DBG, "scan completed successfully\n");
if (!linux_wlan_get_num_conn_ifcs())
- chip_sleep_manually(INFINITE_SLEEP_TIME);
+ chip_sleep_manually();
Handle_ScanDone(msg.drv, SCAN_EVENT_DONE);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 0c08a9a..66d5d42 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -680,7 +680,7 @@ static inline void chip_wakeup(void)
chip_ps_state = CHIP_WAKEDUP;
}
#endif
-void chip_sleep_manually(u32 u32SleepTime)
+void chip_sleep_manually(void)
{
if (chip_ps_state != CHIP_WAKEDUP)
return;
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 2eb7e20..de2fb7c 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -309,4 +309,5 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler);
int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func);
+void chip_sleep_manually(void);
#endif
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes the warnings reported by checkpatch.pl
for line over 80 characters.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 52351c6..66d7f1e 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -308,7 +308,10 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
if (total_length == (IHL + data_offset)) {
u32 seq_no, ack_no;
- seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]);
+ seq_no = ((u32)tcp_hdr_ptr[4] << 24) +
+ ((u32)tcp_hdr_ptr[5] << 16) +
+ ((u32)tcp_hdr_ptr[6] << 8) +
+ (u32)tcp_hdr_ptr[7];
ack_no = ((u32)tcp_hdr_ptr[8] << 24) +
((u32)tcp_hdr_ptr[9] << 16) +
--
1.9.1
From: Leo Kim <[email protected]>
There are over-commenting in the wilc_wlan.c file and most of them
are not helpful to explain what the code does and generate 80 ending
line over warnings. So, all of comments are removed in this patch and the
comments will later be added if necessary with the preferred Linux style.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 330 +++--------------------------------
1 file changed, 27 insertions(+), 303 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 0e5535e..7aaad0f 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1,21 +1,7 @@
-/* ////////////////////////////////////////////////////////////////////////// */
-/* */
-/* Copyright (c) Atmel Corporation. All rights reserved. */
-/* */
-/* Module Name: wilc_wlan.c */
-/* */
-/* */
-/* //////////////////////////////////////////////////////////////////////////// */
-
#include "wilc_wlan_if.h"
#include "wilc_wfi_netdevice.h"
#include "wilc_wlan_cfg.h"
-/********************************************
- *
- * Global
- *
- ********************************************/
extern wilc_hif_func_t hif_sdio;
extern wilc_hif_func_t hif_spi;
u32 wilc_get_chipid(u8 update);
@@ -24,42 +10,20 @@ u32 wilc_get_chipid(u8 update);
typedef struct {
int quit;
-
- /**
- * input interface functions
- **/
wilc_wlan_io_func_t io_func;
-
- /**
- * host interface functions
- **/
wilc_hif_func_t hif_func;
-
- /**
- * configuration interface functions
- **/
int cfg_frame_in_use;
wilc_cfg_frame_t cfg_frame;
u32 cfg_frame_offset;
int cfg_seq_no;
- /**
- * RX buffer
- **/
#ifdef MEMORY_STATIC
u8 *rx_buffer;
u32 rx_buffer_offset;
#endif
- /**
- * TX buffer
- **/
u8 *tx_buffer;
u32 tx_buffer_offset;
- /**
- * TX queue
- **/
-
unsigned long txq_spinlock_flags;
struct txq_entry_t *txq_head;
@@ -67,9 +31,6 @@ typedef struct {
int txq_entries;
int txq_exit;
- /**
- * RX queue
- **/
struct rxq_entry_t *rxq_head;
struct rxq_entry_t *rxq_tail;
int rxq_entries;
@@ -82,12 +43,6 @@ static wilc_wlan_dev_t g_wlan;
static inline void chip_allow_sleep(void);
static inline void chip_wakeup(void);
-/********************************************
- *
- * Debug
- *
- ********************************************/
-
static u32 dbgflag = N_INIT | N_ERR | N_INTR | N_TXQ | N_RXQ;
static void wilc_debug(u32 flag, char *fmt, ...)
@@ -106,9 +61,6 @@ static void wilc_debug(u32 flag, char *fmt, ...)
static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
-/*acquire_bus() and release_bus() are made static inline functions*/
-/*as a temporary workaround to fix a problem of receiving*/
-/*unknown interrupt from FW*/
static inline void acquire_bus(BUS_ACQUIRE_T acquire)
{
@@ -130,11 +82,6 @@ static inline void release_bus(BUS_RELEASE_T release)
#endif
mutex_unlock(&g_linux_wlan->hif_cs);
}
-/********************************************
- *
- * Queue
- *
- ********************************************/
static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
{
@@ -219,9 +166,6 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev,
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
- /**
- * wake up TX queue
- **/
PRINT_D(TX_DBG, "Wake the txq_handling\n");
up(&wilc->txq_event);
@@ -253,11 +197,6 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
up(&g_linux_wlan->txq_add_to_head_cs);
-
-
- /**
- * wake up TX queue
- **/
up(&g_linux_wlan->txq_event);
PRINT_D(TX_DBG, "Wake up the txq_handler\n");
@@ -281,7 +220,7 @@ typedef struct {
u32 ack_num;
u32 Session_index;
struct txq_entry_t *txqe;
-} Pending_Acks_info_t /*Ack_info_t*/;
+} Pending_Acks_info_t;
@@ -373,7 +312,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
eth_hdr_ptr = &buffer[0];
h_proto = ntohs(*((unsigned short *)ð_hdr_ptr[12]));
- if (h_proto == 0x0800) { /* IP */
+ if (h_proto == 0x0800) {
u8 *ip_hdr_ptr;
u8 protocol;
@@ -389,7 +328,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
IHL = (ip_hdr_ptr[0] & 0xf) << 2;
Total_Length = (((u32)ip_hdr_ptr[2]) << 8) + ((u32)ip_hdr_ptr[3]);
Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2);
- if (Total_Length == (IHL + Data_offset)) { /*we want to recognize the clear Acks(packet only carry Ack infos not with data) so data size must be equal zero*/
+ if (Total_Length == (IHL + Data_offset)) {
u32 seq_no, Ack_no;
seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]);
@@ -443,7 +382,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
if (tqe) {
wilc_wlan_txq_remove(tqe);
Statisitcs_DroppedAcks++;
- tqe->status = 1; /* mark the packet send */
+ tqe->status = 1;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
kfree(tqe);
@@ -463,7 +402,6 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags);
while (Dropped > 0) {
- /*consume the semaphore count of the removed packet*/
linux_wlan_lock_timeout(&wilc->txq_event, 1);
Dropped--;
}
@@ -510,9 +448,6 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
#ifdef TCP_ACK_FILTER
tqe->tcp_PendingAck_index = NOT_TCP_ACK;
#endif
- /**
- * Configuration packet always at the front
- **/
PRINT_D(TX_DBG, "Adding the config packet at the Queue tail\n");
if (wilc_wlan_txq_add_to_head(tqe))
@@ -546,7 +481,6 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
tcp_process(dev, tqe);
#endif
wilc_wlan_txq_add_to_tail(dev, tqe);
- /*return number of itemes in the queue*/
return p->txq_entries;
}
@@ -651,22 +585,12 @@ static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc)
return NULL;
}
-
-/********************************************
- *
- * Power Save handle functions
- *
- ********************************************/
-
-
-
#ifdef WILC_OPTIMIZE_SLEEP_INT
static inline void chip_allow_sleep(void)
{
u32 reg = 0;
- /* Clear bit 1 */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
@@ -680,17 +604,11 @@ static inline void chip_wakeup(void)
if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
do {
g_wlan.hif_func.hif_read_reg(1, ®);
- /* Set bit 1 */
g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
-
- /* Clear bit 1*/
g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
do {
- /* Wait for the chip to stabilize*/
usleep_range(2 * 1000, 2 * 1000);
- /* Make sure chip is awake. This is an extra step that can be removed */
- /* later to avoid the bus access overhead */
if ((wilc_get_chipid(true) == 0))
wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
@@ -700,30 +618,19 @@ static inline void chip_wakeup(void)
} else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO) {
g_wlan.hif_func.hif_read_reg(0xf0, ®);
do {
- /* Set bit 1 */
g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
-
- /* Check the clock status */
g_wlan.hif_func.hif_read_reg(0xf1, &clk_status_reg);
- /* in case of clocks off, wait 2ms, and check it again. */
- /* if still off, wait for another 2ms, for a total wait of 6ms. */
- /* If still off, redo the wake up sequence */
while (((clk_status_reg & 0x1) == 0) && (((++trials) % 3) == 0)) {
- /* Wait for the chip to stabilize*/
usleep_range(2 * 1000, 2 * 1000);
- /* Make sure chip is awake. This is an extra step that can be removed */
- /* later to avoid the bus access overhead */
g_wlan.hif_func.hif_read_reg(0xf1, &clk_status_reg);
if ((clk_status_reg & 0x1) == 0)
wilc_debug(N_ERR, "clocks still OFF. Wake up failed\n");
}
- /* in case of failure, Reset the wakeup bit to introduce a new edge on the next loop */
if ((clk_status_reg & 0x1) == 0) {
- /* Reset bit 0 */
g_wlan.hif_func.hif_write_reg(0xf0, reg &
(~BIT(0)));
}
@@ -737,7 +644,6 @@ static inline void chip_wakeup(void)
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
if (wilc_get_chipid(false) >= 0x1002b0) {
- /* Enable PALDO back right after wakeup */
u32 val32;
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
@@ -759,28 +665,19 @@ static inline void chip_wakeup(void)
do {
if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
g_wlan.hif_func.hif_read_reg(1, ®);
- /* Make sure bit 1 is 0 before we start. */
g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
- /* Set bit 1 */
g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
- /* Clear bit 1*/
g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
} else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO) {
- /* Make sure bit 0 is 0 before we start. */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
- /* Set bit 1 */
g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
- /* Clear bit 1 */
g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
}
do {
- /* Wait for the chip to stabilize*/
mdelay(3);
- /* Make sure chip is awake. This is an extra step that can be removed */
- /* later to avoid the bus access overhead */
if ((wilc_get_chipid(true) == 0))
wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
@@ -794,7 +691,6 @@ static inline void chip_wakeup(void)
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
if (wilc_get_chipid(false) >= 0x1002b0) {
- /* Enable PALDO back right after wakeup */
u32 val32;
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
@@ -811,17 +707,13 @@ static inline void chip_wakeup(void)
#endif
void chip_sleep_manually(u32 u32SleepTime)
{
- if (genuChipPSstate != CHIP_WAKEDUP) {
- /* chip is already sleeping. Do nothing */
+ if (genuChipPSstate != CHIP_WAKEDUP)
return;
- }
acquire_bus(ACQUIRE_ONLY);
#ifdef WILC_OPTIMIZE_SLEEP_INT
chip_allow_sleep();
#endif
-
- /* Trigger the manual sleep interrupt */
g_wlan.hif_func.hif_write_reg(0x10a8, 1);
genuChipPSstate = CHIP_SLEEPING_MANUAL;
@@ -829,12 +721,6 @@ void chip_sleep_manually(u32 u32SleepTime)
}
-
-/********************************************
- *
- * Tx, Rx queue handle functions
- *
- ********************************************/
int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
@@ -865,15 +751,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
#ifdef TCP_ACK_FILTER
wilc_wlan_txq_filter_dup_tcp_ack(dev);
#endif
- /**
- * build the vmm list
- **/
PRINT_D(TX_DBG, "Getting the head of the TxQ\n");
tqe = wilc_wlan_txq_get_first(wilc);
i = 0;
sum = 0;
do {
- if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1)) /* reserve last entry to 0 */) {
+ if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) {
if (tqe->type == WILC_CFG_PKT)
vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET;
@@ -886,14 +769,14 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
vmm_sz += tqe->buffer_size;
PRINT_D(TX_DBG, "VMM Size before alignment = %d\n", vmm_sz);
- if (vmm_sz & 0x3) { /* has to be word aligned */
+ if (vmm_sz & 0x3)
vmm_sz = (vmm_sz + 4) & ~0x3;
- }
+
if ((sum + vmm_sz) > LINUX_TX_SIZE)
break;
PRINT_D(TX_DBG, "VMM Size AFTER alignment = %d\n", vmm_sz);
- vmm_table[i] = vmm_sz / 4; /* table take the word size */
+ vmm_table[i] = vmm_sz / 4;
PRINT_D(TX_DBG, "VMMTable entry size = %d\n", vmm_table[i]);
if (tqe->type == WILC_CFG_PKT) {
@@ -913,12 +796,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
}
} while (1);
- if (i == 0) { /* nothing in the queue */
+ if (i == 0) {
PRINT_D(TX_DBG, "Nothing in TX-Q\n");
break;
} else {
PRINT_D(TX_DBG, "Mark the last entry in VMM table - number of previous entries = %d\n", i);
- vmm_table[i] = 0x0; /* mark the last element to 0 */
+ vmm_table[i] = 0x0;
}
acquire_bus(ACQUIRE_AND_WAKEUP);
counter = 0;
@@ -931,9 +814,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
}
if ((reg & 0x1) == 0) {
- /**
- * write to vmm table
- **/
PRINT_D(TX_DBG, "Writing VMM table ... with Size = %d\n", ((i + 1) * 4));
break;
} else {
@@ -944,9 +824,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
ret = p->hif_func.hif_write_reg(WILC_HOST_TX_CTRL, 0);
break;
}
- /**
- * wait for vmm table is ready
- **/
PRINT_WRN(GENERIC_DBG, "[wilc txq]: warn, vmm table not clear yet, wait...\n");
release_bus(RELEASE_ALLOW_SLEEP);
usleep_range(3000, 3000);
@@ -959,30 +836,18 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
timeout = 200;
do {
-
- /**
- * write to vmm table
- **/
ret = p->hif_func.hif_block_tx(WILC_VMM_TBL_RX_SHADOW_BASE, (u8 *)vmm_table, ((i + 1) * 4));
if (!ret) {
wilc_debug(N_ERR, "ERR block TX of VMM table.\n");
break;
}
-
- /**
- * interrupt firmware
- **/
ret = p->hif_func.hif_write_reg(WILC_HOST_VMM_CTL, 0x2);
if (!ret) {
wilc_debug(N_ERR, "[wilc txq]: fail can't write reg host_vmm_ctl..\n");
break;
}
- /**
- * wait for confirm...
- **/
-
do {
ret = p->hif_func.hif_read_reg(WILC_HOST_VMM_CTL, ®);
if (!ret) {
@@ -990,9 +855,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
break;
}
if ((reg >> 2) & 0x1) {
- /**
- * Get the entries
- **/
entries = ((reg >> 3) & 0x3f);
break;
} else {
@@ -1013,7 +875,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
if (entries == 0) {
PRINT_WRN(GENERIC_DBG, "[wilc txq]: no more buffer in the chip (reg: %08x), retry later [[ %d, %x ]]\n", reg, i, vmm_table[i - 1]);
- /* undo the transaction. */
ret = p->hif_func.hif_read_reg(WILC_HOST_TX_CTRL, ®);
if (!ret) {
wilc_debug(N_ERR, "[wilc txq]: fail can't read reg WILC_HOST_TX_CTRL..\n");
@@ -1039,13 +900,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
goto _end_;
}
- /* since copying data into txb takes some time, then
- * allow the bus lock to be released let the RX task go. */
release_bus(RELEASE_ALLOW_SLEEP);
- /**
- * Copy data to the TX buffer
- **/
offset = 0;
i = 0;
do {
@@ -1056,7 +912,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
#ifdef BIG_ENDIAN
vmm_table[i] = BYTE_SWAP(vmm_table[i]);
#endif
- vmm_sz = (vmm_table[i] & 0x3ff); /* in word unit */
+ vmm_sz = (vmm_table[i] & 0x3ff);
vmm_sz *= 4;
header = (tqe->type << 31) | (tqe->buffer_size << 15) | vmm_sz;
if (tqe->type == WILC_MGMT_PKT)
@@ -1075,7 +931,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid;
buffer_offset = ETH_ETHERNET_HDR_OFFSET;
- /* copy the bssid at the sart of the buffer */
memcpy(&txb[offset + 4], pBSSID, 6);
}
else {
@@ -1085,7 +940,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
memcpy(&txb[offset + buffer_offset], tqe->buffer, tqe->buffer_size);
offset += vmm_sz;
i++;
- tqe->status = 1; /* mark the packet send */
+ tqe->status = 1;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
#ifdef TCP_ACK_FILTER
@@ -1098,9 +953,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
}
} while (--entries);
- /**
- * lock the bus
- **/
acquire_bus(ACQUIRE_AND_WAKEUP);
ret = p->hif_func.hif_clear_int_ext(ENABLE_TX_VMM);
@@ -1109,9 +961,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
goto _end_;
}
- /**
- * transfer
- **/
ret = p->hif_func.hif_block_tx_ext(0, txb, offset);
if (!ret) {
wilc_debug(N_ERR, "[wilc txq]: fail can't block tx ext...\n");
@@ -1128,7 +977,6 @@ _end_:
p->txq_exit = 1;
PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
- /* return tx[]q count */
*pu32TxqCount = p->txq_entries;
return ret;
}
@@ -1193,7 +1041,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
if (pkt_offset & IS_MANAGMEMENT) {
- /* reset mgmt indicator bit, to use pkt_offeset in furthur calculations */
pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES);
WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
@@ -1216,16 +1063,10 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
wilc_wlan_cfg_indicate_rx(&buffer[pkt_offset + offset], pkt_len, &rsp);
if (rsp.type == WILC_CFG_RSP) {
- /**
- * wake up the waiting task...
- **/
PRINT_D(RX_DBG, "p->cfg_seq_no = %d - rsp.seq_no = %d\n", p->cfg_seq_no, rsp.seq_no);
if (p->cfg_seq_no == rsp.seq_no)
up(&wilc->cfg_event);
} else if (rsp.type == WILC_CFG_RSP_STATUS) {
- /**
- * Call back to indicate status...
- **/
linux_wlan_mac_indicate(wilc, WILC_MAC_INDICATE_STATUS);
} else if (rsp.type == WILC_CFG_RSP_SCAN) {
@@ -1253,11 +1094,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
PRINT_D(RX_DBG, "THREAD: Exiting RX thread\n");
}
-/********************************************
- *
- * Fast DMA Isr
- *
- ********************************************/
static void wilc_unknown_isr_ext(void)
{
g_wlan.hif_func.hif_clear_int_ext(0);
@@ -1269,10 +1105,8 @@ static void wilc_pllupdate_isr_ext(u32 int_stats)
g_wlan.hif_func.hif_clear_int_ext(PLL_INT_CLR);
- /* Waiting for PLL */
mdelay(WILC_PLL_TO);
- /* poll till read a valid data */
while (!(ISWILC1000(wilc_get_chipid(true)) && --trials)) {
PRINT_D(TX_DBG, "PLL update retrying\n");
mdelay(1);
@@ -1299,17 +1133,11 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
int ret = 0;
struct rxq_entry_t *rqe;
-
- /**
- * Get the rx size
- **/
-
size = ((int_status & 0x7fff) << 2);
while (!size && retries < 10) {
u32 time = 0;
- /*looping more secure*/
- /*zero size make a crashe because the dma will not happen and that will block the firmware*/
+
wilc_debug(N_ERR, "RX Size equal zero ... Trying to read it again for %d time\n", time++);
p->hif_func.hif_read_size(&size);
size = ((size & 0x7fff) << 2);
@@ -1337,16 +1165,7 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
goto _end_;
}
#endif
-
- /**
- * clear the chip's interrupt after getting size some register getting corrupted after clear the interrupt
- **/
p->hif_func.hif_clear_int_ext(DATA_INT_CLR | ENABLE_RX_VMM);
-
-
- /**
- * start transfer
- **/
ret = p->hif_func.hif_block_rx_ext(0, buffer, size);
if (!ret) {
@@ -1361,9 +1180,6 @@ _end_:
offset += size;
p->rx_buffer_offset = offset;
#endif
- /**
- * add to rx queue
- **/
rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL);
if (rqe != NULL) {
rqe->buffer = buffer;
@@ -1393,7 +1209,6 @@ void wilc_handle_isr(void *wilc)
if (int_status & DATA_INT_EXT) {
wilc_wlan_handle_isr_ext(wilc, int_status);
#ifndef WILC_OPTIMIZE_SLEEP_INT
- /* Chip is up and talking*/
genuChipPSstate = CHIP_WAKEDUP;
#endif
}
@@ -1409,11 +1224,6 @@ void wilc_handle_isr(void *wilc)
release_bus(RELEASE_ALLOW_SLEEP);
}
-/********************************************
- *
- * Firmware download
- *
- ********************************************/
int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
{
wilc_wlan_dev_t *p = &g_wlan;
@@ -1423,20 +1233,16 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
int ret = 0;
blksz = BIT(12);
- /* Allocate a DMA coherent buffer. */
dma_buffer = kmalloc(blksz, GFP_KERNEL);
if (dma_buffer == NULL) {
- /*EIO 5*/
ret = -5;
PRINT_ER("Can't allocate buffer for firmware download IO error\n ");
goto _fail_1;
}
PRINT_D(INIT_DBG, "Downloading firmware size = %d ...\n", buffer_size);
- /**
- * load the firmware
- **/
+
offset = 0;
do {
memcpy(&addr, &buffer[offset], 4);
@@ -1452,7 +1258,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
size2 = size;
else
size2 = blksz;
- /* Copy firmware into a DMA coherent buffer */
+
memcpy(dma_buffer, &buffer[offset], size2);
ret = p->hif_func.hif_block_tx(addr, dma_buffer, size2);
if (!ret)
@@ -1465,7 +1271,6 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
release_bus(RELEASE_ONLY);
if (!ret) {
- /*EIO 5*/
ret = -5;
PRINT_ER("Can't download firmware IO error\n ");
goto _fail_;
@@ -1482,11 +1287,6 @@ _fail_1:
return (ret < 0) ? ret : 0;
}
-/********************************************
- *
- * Common
- *
- ********************************************/
int wilc_wlan_start(void)
{
wilc_wlan_dev_t *p = &g_wlan;
@@ -1494,12 +1294,9 @@ int wilc_wlan_start(void)
int ret;
u32 chipid;
- /**
- * Set the host interface
- **/
if (p->io_func.io_type == HIF_SDIO) {
reg = 0;
- reg |= BIT(3); /* bug 4456 and 4557 */
+ reg |= BIT(3);
} else if (p->io_func.io_type == HIF_SPI) {
reg = 1;
}
@@ -1508,7 +1305,6 @@ int wilc_wlan_start(void)
if (!ret) {
wilc_debug(N_ERR, "[wilc start]: fail write reg vmm_core_cfg...\n");
release_bus(RELEASE_ONLY);
- /* EIO 5*/
ret = -5;
return ret;
}
@@ -1533,14 +1329,9 @@ int wilc_wlan_start(void)
#endif
reg |= WILC_HAVE_LEGACY_RF_SETTINGS;
-
-
-/*Set oscillator frequency*/
#ifdef XTAL_24
reg |= WILC_HAVE_XTAL_24;
#endif
-
-/*Enable/Disable GPIO configuration for FW logs*/
#ifdef DISABLE_WILC_UART
reg |= WILC_HAVE_DISABLE_WILC_UART;
#endif
@@ -1549,30 +1340,20 @@ int wilc_wlan_start(void)
if (!ret) {
wilc_debug(N_ERR, "[wilc start]: fail write WILC_GP_REG_1 ...\n");
release_bus(RELEASE_ONLY);
- /* EIO 5*/
ret = -5;
return ret;
}
- /**
- * Bus related
- **/
p->hif_func.hif_sync_ext(NUM_INT_EXT);
ret = p->hif_func.hif_read_reg(0x1000, &chipid);
if (!ret) {
wilc_debug(N_ERR, "[wilc start]: fail read reg 0x1000 ...\n");
release_bus(RELEASE_ONLY);
- /* EIO 5*/
ret = -5;
return ret;
}
- /**
- * Go...
- **/
-
-
p->hif_func.hif_read_reg(WILC_GLB_RESET_0, ®);
if ((reg & BIT(10)) == BIT(10)) {
reg &= ~BIT(10);
@@ -1603,9 +1384,6 @@ int wilc_wlan_stop(void)
u32 reg = 0;
int ret;
u8 timeout = 10;
- /**
- * TODO: stop the firmware, need a re-download
- **/
acquire_bus(ACQUIRE_AND_WAKEUP);
ret = p->hif_func.hif_read_reg(WILC_GLB_RESET_0, ®);
@@ -1635,7 +1413,7 @@ int wilc_wlan_stop(void)
return ret;
}
PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n", reg, timeout);
- /*Workaround to ensure that the chip is actually reset*/
+
if ((reg & BIT(10))) {
PRINT_D(GENERIC_DBG, "Bit 10 not reset : Retry %d\n", timeout);
reg &= ~BIT(10);
@@ -1700,10 +1478,6 @@ void wilc_wlan_cleanup(struct net_device *dev)
kfree(rqe);
} while (1);
- /**
- * clean up buffer
- **/
-
#ifdef MEMORY_STATIC
kfree(p->rx_buffer);
p->rx_buffer = NULL;
@@ -1725,9 +1499,6 @@ void wilc_wlan_cleanup(struct net_device *dev)
release_bus(RELEASE_ALLOW_SLEEP);
}
release_bus(RELEASE_ALLOW_SLEEP);
- /**
- * io clean up
- **/
p->hif_func.hif_deinit(NULL);
}
@@ -1740,16 +1511,12 @@ static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
int seq_no = p->cfg_seq_no % 256;
int driver_handler = (u32)drvHandler;
-
- /**
- * Set up header
- **/
- if (type == WILC_CFG_SET) { /* Set */
+ if (type == WILC_CFG_SET) {
cfg->wid_header[0] = 'W';
- } else { /* Query */
+ } else {
cfg->wid_header[0] = 'Q';
}
- cfg->wid_header[1] = seq_no; /* sequence number */
+ cfg->wid_header[1] = seq_no;
cfg->wid_header[2] = (u8)total_len;
cfg->wid_header[3] = (u8)(total_len >> 8);
cfg->wid_header[4] = (u8)driver_handler;
@@ -1758,10 +1525,6 @@ static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
cfg->wid_header[7] = (u8)(driver_handler >> 24);
p->cfg_seq_no = seq_no;
- /**
- * Add to TX queue
- **/
-
if (!wilc_wlan_txq_add_cfg_pkt(&cfg->wid_header[0], total_len))
return -1;
@@ -1859,15 +1622,11 @@ int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size)
void wilc_bus_set_max_speed(void)
{
-
- /* Increase bus speed to max possible. */
g_wlan.hif_func.hif_set_max_bus_speed();
}
void wilc_bus_set_default_speed(void)
{
-
- /* Restore bus speed to default. */
g_wlan.hif_func.hif_set_default_bus_speed();
}
u32 init_chip(struct net_device *dev)
@@ -1882,11 +1641,6 @@ u32 init_chip(struct net_device *dev)
if ((chipid & 0xfff) != 0xa0) {
- /**
- * Avoid booting from boot ROM. Make sure that Drive IRQN [SDIO platform]
- * or SD_DAT3 [SPI platform] to ?1?
- **/
- /* Set cortus reset register to register control. */
ret = g_wlan.hif_func.hif_read_reg(0x1118, ®);
if (!ret) {
wilc_debug(N_ERR, "[wilc start]: fail read reg 0x1118 ...\n");
@@ -1898,10 +1652,6 @@ u32 init_chip(struct net_device *dev)
wilc_debug(N_ERR, "[wilc start]: fail write reg 0x1118 ...\n");
return ret;
}
- /**
- * Write branch intruction to IRAM (0x71 trap) at location 0xFFFF0000
- * (Cortus map) or C0000 (AHB map).
- **/
ret = g_wlan.hif_func.hif_write_reg(0xc0000, 0x71);
if (!ret) {
wilc_debug(N_ERR, "[wilc start]: fail write reg 0xc0000 ...\n");
@@ -1918,8 +1668,6 @@ u32 init_chip(struct net_device *dev)
u32 wilc_get_chipid(u8 update)
{
static u32 chipid;
- /* SDIO can't read into global variables */
- /* Use this variable as a temp, then copy to the global */
u32 tempchipid = 0;
u32 rfrevid;
@@ -1931,15 +1679,15 @@ u32 wilc_get_chipid(u8 update)
goto _fail_;
}
if (tempchipid == 0x1002a0) {
- if (rfrevid == 0x1) { /* 1002A0 */
- } else { /* if (rfrevid == 0x2) */ /* 1002A1 */
+ if (rfrevid == 0x1) {
+ } else {
tempchipid = 0x1002a1;
}
} else if (tempchipid == 0x1002b0) {
- if (rfrevid == 3) { /* 1002B0 */
- } else if (rfrevid == 4) { /* 1002B1 */
+ if (rfrevid == 3) {
+ } else if (rfrevid == 4) {
tempchipid = 0x1002b1;
- } else { /* if(rfrevid == 5) */ /* 1002B2 */
+ } else {
tempchipid = 0x1002b2;
}
} else {
@@ -1959,69 +1707,47 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
memset((void *)&g_wlan, 0, sizeof(wilc_wlan_dev_t));
-
- /**
- * store the input
- **/
memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func, sizeof(wilc_wlan_io_func_t));
- /***
- * host interface init
- **/
+
if ((inp->io_func.io_type & 0x1) == HIF_SDIO) {
if (!hif_sdio.hif_init(inp, wilc_debug)) {
- /* EIO 5 */
ret = -5;
goto _fail_;
}
memcpy((void *)&g_wlan.hif_func, &hif_sdio, sizeof(wilc_hif_func_t));
} else {
if ((inp->io_func.io_type & 0x1) == HIF_SPI) {
- /**
- * TODO:
- **/
if (!hif_spi.hif_init(inp, wilc_debug)) {
- /* EIO 5 */
ret = -5;
goto _fail_;
}
memcpy((void *)&g_wlan.hif_func, &hif_spi, sizeof(wilc_hif_func_t));
} else {
- /* EIO 5 */
ret = -5;
goto _fail_;
}
}
- /***
- * mac interface init
- **/
if (!wilc_wlan_cfg_init(wilc_debug)) {
- /* ENOBUFS 105 */
ret = -105;
goto _fail_;
}
- /**
- * alloc tx, rx buffer
- **/
if (g_wlan.tx_buffer == NULL)
g_wlan.tx_buffer = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
if (g_wlan.tx_buffer == NULL) {
- /* ENOBUFS 105 */
ret = -105;
PRINT_ER("Can't allocate Tx Buffer");
goto _fail_;
}
-/* rx_buffer is not used unless we activate USE_MEM STATIC which is not applicable, allocating such memory is useless*/
#if defined (MEMORY_STATIC)
if (g_wlan.rx_buffer == NULL)
g_wlan.rx_buffer = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
if (g_wlan.rx_buffer == NULL) {
- /* ENOBUFS 105 */
ret = -105;
PRINT_ER("Can't allocate Rx Buffer");
goto _fail_;
@@ -2029,7 +1755,6 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
#endif
if (!init_chip(dev)) {
- /* EIO 5 */
ret = -5;
goto _fail_;
}
@@ -2062,7 +1787,6 @@ u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
nic = netdev_priv(dev);
wilc = nic->wilc;
- /*Reset WILC_CHANGING_VIR_IF register to allow adding futrue keys to CE H/W*/
mutex_lock(&wilc->hif_cs);
ret = (&g_wlan)->hif_func.hif_read_reg(WILC_CHANGING_VIR_IF, ®);
if (!ret)
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for Blank lines aren't necessary after an open brace '{' and
Blank lines aren't necessary before a close brace '}'.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 5db87c0..603541c 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -59,7 +59,6 @@ static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
static inline void acquire_bus(BUS_ACQUIRE_T acquire)
{
-
mutex_lock(&g_linux_wlan->hif_cs);
#ifndef WILC_OPTIMIZE_SLEEP_INT
if (genuChipPSstate != CHIP_WAKEDUP)
@@ -68,7 +67,6 @@ static inline void acquire_bus(BUS_ACQUIRE_T acquire)
if (acquire == ACQUIRE_AND_WAKEUP)
chip_wakeup();
}
-
}
static inline void release_bus(BUS_RELEASE_T release)
{
@@ -81,10 +79,8 @@ static inline void release_bus(BUS_RELEASE_T release)
static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
{
-
wilc_wlan_dev_t *p = &g_wlan;
if (tqe == p->txq_head) {
-
p->txq_head = tqe->next;
if (p->txq_head)
p->txq_head->prev = NULL;
@@ -97,7 +93,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
tqe->next->prev = tqe->prev;
}
p->txq_entries -= 1;
-
}
static struct txq_entry_t *
@@ -191,7 +186,6 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
PRINT_D(TX_DBG, "Wake up the txq_handler\n");
return 0;
-
}
u32 Statisitcs_totalAcks = 0, Statisitcs_DroppedAcks = 0;
@@ -228,9 +222,7 @@ u32 Pending_Acks;
static inline int Init_TCP_tracking(void)
{
-
return 0;
-
}
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
@@ -246,11 +238,9 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
static inline int Update_TCP_track_session(u32 index, u32 Ack)
{
-
if (Ack > Acks_keep_track_info[index].Bigger_Ack_num)
Acks_keep_track_info[index].Bigger_Ack_num = Ack;
return 0;
-
}
static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe)
{
@@ -261,7 +251,6 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent
Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].Session_index = Session_index;
txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks;
Pending_Acks++;
-
} else {
}
@@ -466,7 +455,6 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func)
{
-
wilc_wlan_dev_t *p = &g_wlan;
struct txq_entry_t *tqe;
@@ -605,7 +593,6 @@ static inline void chip_wakeup(void)
if ((clk_status_reg & 0x1) == 0)
wilc_debug(N_ERR, "clocks still OFF. Wake up failed\n");
-
}
if ((clk_status_reg & 0x1) == 0) {
g_wlan.hif_func.hif_write_reg(0xf0, reg &
@@ -694,7 +681,6 @@ void chip_sleep_manually(u32 u32SleepTime)
genuChipPSstate = CHIP_SLEEPING_MANUAL;
release_bus(RELEASE_ONLY);
-
}
int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
@@ -733,7 +719,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
sum = 0;
do {
if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) {
-
if (tqe->type == WILC_CFG_PKT)
vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET;
@@ -782,7 +767,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
acquire_bus(ACQUIRE_AND_WAKEUP);
counter = 0;
do {
-
ret = p->hif_func.hif_read_reg(WILC_HOST_TX_CTRL, ®);
if (!ret) {
wilc_debug(N_ERR, "[wilc txq]: fail can't read reg vmm_tbl_entry..\n");
@@ -1015,7 +999,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
}
else
{
-
if (!is_cfg_packet) {
if (pkt_len > 0) {
frmw_to_linux(wilc,
@@ -1064,7 +1047,6 @@ static void wilc_unknown_isr_ext(void)
}
static void wilc_pllupdate_isr_ext(u32 int_stats)
{
-
int trials = 10;
g_wlan.hif_func.hif_clear_int_ext(PLL_INT_CLR);
@@ -1106,7 +1088,6 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
p->hif_func.hif_read_size(&size);
size = ((size & 0x7fff) << 2);
retries++;
-
}
if (size > 0) {
@@ -1457,7 +1438,6 @@ void wilc_wlan_cleanup(struct net_device *dev)
}
release_bus(RELEASE_ALLOW_SLEEP);
p->hif_func.hif_deinit(NULL);
-
}
static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
@@ -1523,7 +1503,6 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
p->cfg_frame_in_use = 0;
p->cfg_frame_offset = 0;
p->cfg_seq_no += 1;
-
}
return ret_size;
@@ -1614,7 +1593,6 @@ u32 init_chip(struct net_device *dev)
release_bus(RELEASE_ONLY);
return ret;
-
}
u32 wilc_get_chipid(u8 update)
@@ -1653,7 +1631,6 @@ _fail_:
int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
{
-
int ret = 0;
PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
@@ -1726,7 +1703,6 @@ _fail_:
g_wlan.tx_buffer = NULL;
return ret;
-
}
u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Ack Session_index variable to session_index
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 58043dc..ce9f45c 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -246,14 +246,14 @@ static inline int update_tcp_session(u32 index, u32 ack)
return 0;
}
-static inline int add_tcp_pending_ack(u32 ack, u32 Session_index,
+static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
struct txq_entry_t *txqe)
{
total_acks++;
if (pending_acks < MAX_PENDING_ACKS) {
pending_acks_info[pending_base + pending_acks].ack_num = ack;
pending_acks_info[pending_base + pending_acks].txqe = txqe;
- pending_acks_info[pending_base + pending_acks].session_index = Session_index;
+ pending_acks_info[pending_base + pending_acks].session_index = session_index;
txqe->tcp_PendingAck_index = pending_base + pending_acks;
pending_acks++;
} else {
--
1.9.1
From: Leo Kim <[email protected]>
This patch remove typedef of struct Pending_Acks_info_t.
And, rename the Pending_Acks_info_t to pending_acks_info.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4aec892..fb0e635 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -202,11 +202,11 @@ struct ack_session_info {
u16 status;
};
-typedef struct {
+struct pending_acks_info {
u32 ack_num;
u32 Session_index;
struct txq_entry_t *txqe;
-} Pending_Acks_info_t;
+};
struct ack_session_info *Free_head;
struct ack_session_info *Alloc_head;
@@ -216,7 +216,7 @@ struct ack_session_info *Alloc_head;
#define MAX_TCP_SESSION 25
#define MAX_PENDING_ACKS 256
struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION];
-Pending_Acks_info_t Pending_Acks_info[MAX_PENDING_ACKS];
+struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS];
u32 PendingAcks_arrBase;
u32 Opened_TCP_session;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Dropped variable to dropped
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 66d7f1e..283ab52 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -345,7 +345,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
perInterface_wlan_t *nic;
struct wilc *wilc;
u32 i = 0;
- u32 Dropped = 0;
+ u32 dropped = 0;
wilc_wlan_dev_t *p = &g_wlan;
nic = netdev_priv(dev);
@@ -366,7 +366,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
kfree(tqe);
- Dropped++;
+ dropped++;
}
}
}
@@ -380,9 +380,9 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags);
- while (Dropped > 0) {
+ while (dropped > 0) {
linux_wlan_lock_timeout(&wilc->txq_event, 1);
- Dropped--;
+ dropped--;
}
return 1;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Ack_session_info struct variable to ack_session_info
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 9b1ca17..f3968fd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -193,8 +193,8 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
u32 total_acks = 0, dropped_acks = 0;
#ifdef TCP_ACK_FILTER
-struct Ack_session_info;
-struct Ack_session_info {
+struct ack_session_info;
+struct ack_session_info {
u32 Ack_seq_num;
u32 Bigger_Ack_num;
u16 src_port;
@@ -208,14 +208,14 @@ typedef struct {
struct txq_entry_t *txqe;
} Pending_Acks_info_t;
-struct Ack_session_info *Free_head;
-struct Ack_session_info *Alloc_head;
+struct ack_session_info *Free_head;
+struct ack_session_info *Alloc_head;
#define NOT_TCP_ACK (-1)
#define MAX_TCP_SESSION 25
#define MAX_PENDING_ACKS 256
-struct Ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION];
+struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION];
Pending_Acks_info_t Pending_Acks_info[MAX_PENDING_ACKS];
u32 PendingAcks_arrBase;
--
1.9.1
From: Leo Kim <[email protected]>
This patch replace explicit NULL comparison with ! operator to simplify code.
Reported by checkpatch.pl for Comparison to NULL could be written "!XXX" or "XXX".
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index c393e52..8ac0b1e 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -137,7 +137,7 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev,
spin_lock_irqsave(&wilc->txq_spinlock, flags);
- if (p->txq_head == NULL) {
+ if (!p->txq_head) {
tqe->next = NULL;
tqe->prev = NULL;
p->txq_head = tqe;
@@ -168,7 +168,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
- if (p->txq_head == NULL) {
+ if (!p->txq_head) {
tqe->next = NULL;
tqe->prev = NULL;
p->txq_head = tqe;
@@ -407,7 +407,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
}
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
- if (tqe == NULL) {
+ if (!tqe) {
PRINT_ER("Failed to allocate memory\n");
return 0;
}
@@ -438,7 +438,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
- if (tqe == NULL)
+ if (!tqe)
return 0;
tqe->type = WILC_NET_PKT;
tqe->buffer = buffer;
@@ -467,7 +467,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL);
- if (tqe == NULL)
+ if (!tqe)
return 0;
tqe->type = WILC_MGMT_PKT;
tqe->buffer = buffer;
@@ -518,7 +518,7 @@ static int wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe)
return 0;
mutex_lock(&wilc->rxq_cs);
- if (p->rxq_head == NULL) {
+ if (!p->rxq_head) {
PRINT_D(RX_DBG, "Add to Queue head\n");
rqe->next = NULL;
p->rxq_head = rqe;
@@ -723,7 +723,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
i = 0;
sum = 0;
do {
- if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) {
+ if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) {
if (tqe->type == WILC_CFG_PKT)
vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET;
@@ -871,7 +871,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
i = 0;
do {
tqe = wilc_wlan_txq_remove_from_head(dev);
- if (tqe != NULL && (vmm_table[i] != 0)) {
+ if (tqe && (vmm_table[i] != 0)) {
u32 header, buffer_offset;
#ifdef BIG_ENDIAN
@@ -962,7 +962,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
break;
}
rqe = wilc_wlan_rxq_remove(wilc);
- if (rqe == NULL) {
+ if (!rqe) {
PRINT_D(RX_DBG, "nothing in the queue - exit 1st do-while\n");
break;
}
@@ -1110,7 +1110,7 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
#else
buffer = kmalloc(size, GFP_KERNEL);
- if (buffer == NULL) {
+ if (!buffer) {
wilc_debug(N_ERR, "[wilc isr]: fail alloc host memory...drop the packets (%d)\n", size);
usleep_range(100 * 1000, 100 * 1000);
goto _end_;
@@ -1130,7 +1130,7 @@ _end_:
p->rx_buffer_offset = offset;
#endif
rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL);
- if (rqe != NULL) {
+ if (rqe) {
rqe->buffer = buffer;
rqe->buffer_size = size;
PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer);
@@ -1184,7 +1184,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
blksz = BIT(12);
dma_buffer = kmalloc(blksz, GFP_KERNEL);
- if (dma_buffer == NULL) {
+ if (!dma_buffer) {
ret = -5;
PRINT_ER("Can't allocate buffer for firmware download IO error\n ");
goto _fail_1;
@@ -1406,7 +1406,7 @@ void wilc_wlan_cleanup(struct net_device *dev)
p->quit = 1;
do {
tqe = wilc_wlan_txq_remove_from_head(dev);
- if (tqe == NULL)
+ if (!tqe)
break;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, 0);
@@ -1415,7 +1415,7 @@ void wilc_wlan_cleanup(struct net_device *dev)
do {
rqe = wilc_wlan_rxq_remove(wilc);
- if (rqe == NULL)
+ if (!rqe)
break;
#ifndef MEMORY_STATIC
kfree(rqe->buffer);
@@ -1670,21 +1670,21 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
goto _fail_;
}
- if (g_wlan.tx_buffer == NULL)
+ if (!g_wlan.tx_buffer)
g_wlan.tx_buffer = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
- if (g_wlan.tx_buffer == NULL) {
+ if (!g_wlan.tx_buffer) {
ret = -105;
PRINT_ER("Can't allocate Tx Buffer");
goto _fail_;
}
#if defined (MEMORY_STATIC)
- if (g_wlan.rx_buffer == NULL)
+ if (!g_wlan.rx_buffer)
g_wlan.rx_buffer = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
- if (g_wlan.rx_buffer == NULL) {
+ if (!g_wlan.rx_buffer) {
ret = -105;
PRINT_ER("Can't allocate Rx Buffer");
goto _fail_;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Ack_seq_num of struct ack_session_info to seq_num
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index f3968fd..7162473 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -195,7 +195,7 @@ u32 total_acks = 0, dropped_acks = 0;
#ifdef TCP_ACK_FILTER
struct ack_session_info;
struct ack_session_info {
- u32 Ack_seq_num;
+ u32 seq_num;
u32 Bigger_Ack_num;
u16 src_port;
u16 dst_port;
@@ -229,7 +229,7 @@ static inline int Init_TCP_tracking(void)
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
- Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq;
+ Acks_keep_track_info[Opened_TCP_session].seq_num = seq;
Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0;
Acks_keep_track_info[Opened_TCP_session].src_port = src_prt;
Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt;
@@ -313,7 +313,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]);
for (i = 0; i < Opened_TCP_session; i++) {
- if (Acks_keep_track_info[i].Ack_seq_num == seq_no) {
+ if (Acks_keep_track_info[i].seq_num == seq_no) {
Update_TCP_track_session(i, Ack_no);
break;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Statisitcs_DroppedAcks variable to dropped_acks
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 8d6215b..9b1ca17 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -190,7 +190,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
return 0;
}
-u32 total_acks = 0, Statisitcs_DroppedAcks = 0;
+u32 total_acks = 0, dropped_acks = 0;
#ifdef TCP_ACK_FILTER
struct Ack_session_info;
@@ -354,7 +354,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
tqe = Pending_Acks_info[i].txqe;
if (tqe) {
wilc_wlan_txq_remove(tqe);
- Statisitcs_DroppedAcks++;
+ dropped_acks++;
tqe->status = 1;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the PendingAcks_arrBase variable to pending_base
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 7db42c0..a1b6067 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -218,7 +218,7 @@ struct ack_session_info *Alloc_head;
struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS];
-u32 PendingAcks_arrBase;
+u32 pending_base;
u32 Opened_TCP_session;
u32 Pending_Acks;
@@ -250,10 +250,10 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent
{
total_acks++;
if (Pending_Acks < MAX_PENDING_ACKS) {
- pending_acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack;
- pending_acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe;
- pending_acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index;
- txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks;
+ pending_acks_info[pending_base + Pending_Acks].ack_num = Ack;
+ pending_acks_info[pending_base + Pending_Acks].txqe = txqe;
+ pending_acks_info[pending_base + Pending_Acks].session_index = Session_index;
+ txqe->tcp_PendingAck_index = pending_base + Pending_Acks;
Pending_Acks++;
} else {
@@ -346,7 +346,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
wilc = nic->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
- for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
+ for (i = pending_base; i < (pending_base + Pending_Acks); i++) {
if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
@@ -367,10 +367,10 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
Pending_Acks = 0;
Opened_TCP_session = 0;
- if (PendingAcks_arrBase == 0)
- PendingAcks_arrBase = MAX_TCP_SESSION;
+ if (pending_base == 0)
+ pending_base = MAX_TCP_SESSION;
else
- PendingAcks_arrBase = 0;
+ pending_base = 0;
spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags);
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for prefer kmalloc(sizeof(*rqe)...) over kmalloc(sizeof(struct rxq_entry_t)...)
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index f1bb8af..c4118fe 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1132,7 +1132,7 @@ _end_:
offset += size;
p->rx_buffer_offset = offset;
#endif
- rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL);
+ rqe = kmalloc(sizeof(*rqe), GFP_KERNEL);
if (rqe) {
rqe->buffer = buffer;
rqe->buffer_size = size;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Pending_Acks variable to pending_acks
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 34e1097..df20d4d 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -220,7 +220,7 @@ struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS];
u32 pending_base;
u32 tcp_session;
-u32 Pending_Acks;
+u32 pending_acks;
static inline int Init_TCP_tracking(void)
{
@@ -249,12 +249,12 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack)
static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe)
{
total_acks++;
- if (Pending_Acks < MAX_PENDING_ACKS) {
- pending_acks_info[pending_base + Pending_Acks].ack_num = Ack;
- pending_acks_info[pending_base + Pending_Acks].txqe = txqe;
- pending_acks_info[pending_base + Pending_Acks].session_index = Session_index;
- txqe->tcp_PendingAck_index = pending_base + Pending_Acks;
- Pending_Acks++;
+ if (pending_acks < MAX_PENDING_ACKS) {
+ pending_acks_info[pending_base + pending_acks].ack_num = Ack;
+ pending_acks_info[pending_base + pending_acks].txqe = txqe;
+ pending_acks_info[pending_base + pending_acks].session_index = Session_index;
+ txqe->tcp_PendingAck_index = pending_base + pending_acks;
+ pending_acks++;
} else {
}
@@ -346,7 +346,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
wilc = nic->wilc;
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
- for (i = pending_base; i < (pending_base + Pending_Acks); i++) {
+ for (i = pending_base; i < (pending_base + pending_acks); i++) {
if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
@@ -364,7 +364,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
}
}
}
- Pending_Acks = 0;
+ pending_acks = 0;
tcp_session = 0;
if (pending_base == 0)
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Acks_keep_track_info variable to ack_session_info
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index af5a16e..359df26 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -215,7 +215,7 @@ struct ack_session_info *Alloc_head;
#define MAX_TCP_SESSION 25
#define MAX_PENDING_ACKS 256
-struct ack_session_info Acks_keep_track_info[2 * MAX_TCP_SESSION];
+struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS];
u32 PendingAcks_arrBase;
@@ -229,10 +229,10 @@ static inline int Init_TCP_tracking(void)
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
- Acks_keep_track_info[Opened_TCP_session].seq_num = seq;
- Acks_keep_track_info[Opened_TCP_session].bigger_ack_num = 0;
- Acks_keep_track_info[Opened_TCP_session].src_port = src_prt;
- Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt;
+ ack_session_info[Opened_TCP_session].seq_num = seq;
+ ack_session_info[Opened_TCP_session].bigger_ack_num = 0;
+ ack_session_info[Opened_TCP_session].src_port = src_prt;
+ ack_session_info[Opened_TCP_session].dst_port = dst_prt;
Opened_TCP_session++;
PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", Opened_TCP_session, seq);
@@ -241,8 +241,8 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
static inline int Update_TCP_track_session(u32 index, u32 Ack)
{
- if (Ack > Acks_keep_track_info[index].bigger_ack_num)
- Acks_keep_track_info[index].bigger_ack_num = Ack;
+ if (Ack > ack_session_info[index].bigger_ack_num)
+ ack_session_info[index].bigger_ack_num = Ack;
return 0;
}
@@ -313,7 +313,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]);
for (i = 0; i < Opened_TCP_session; i++) {
- if (Acks_keep_track_info[i].seq_num == seq_no) {
+ if (ack_session_info[i].seq_num == seq_no) {
Update_TCP_track_session(i, Ack_no);
break;
}
@@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
- if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].session_index].bigger_ack_num) {
+ if (Pending_Acks_info[i].ack_num < ack_session_info[Pending_Acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num);
--
1.9.1
From: Leo Kim <[email protected]>
This patch removes do-nothing else condition case.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index ce9f45c..b07d229 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -256,8 +256,6 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
pending_acks_info[pending_base + pending_acks].session_index = session_index;
txqe->tcp_PendingAck_index = pending_base + pending_acks;
pending_acks++;
- } else {
-
}
return 0;
}
@@ -1630,7 +1628,6 @@ u32 wilc_get_chipid(u8 update)
} else {
tempchipid = 0x1002b2;
}
- } else {
}
chipid = tempchipid;
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum declarations
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 603541c..d3117f9 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -68,6 +68,7 @@ static inline void acquire_bus(BUS_ACQUIRE_T acquire)
chip_wakeup();
}
}
+
static inline void release_bus(BUS_RELEASE_T release)
{
#ifdef WILC_OPTIMIZE_SLEEP_INT
@@ -224,6 +225,7 @@ static inline int Init_TCP_tracking(void)
{
return 0;
}
+
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq;
@@ -242,6 +244,7 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack)
Acks_keep_track_info[index].Bigger_Ack_num = Ack;
return 0;
}
+
static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe)
{
Statisitcs_totalAcks++;
@@ -1045,6 +1048,7 @@ static void wilc_unknown_isr_ext(void)
{
g_wlan.hif_func.hif_clear_int_ext(0);
}
+
static void wilc_pllupdate_isr_ext(u32 int_stats)
{
int trials = 10;
@@ -1507,6 +1511,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
return ret_size;
}
+
int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
{
wilc_wlan_dev_t *p = &g_wlan;
@@ -1562,6 +1567,7 @@ void wilc_bus_set_default_speed(void)
{
g_wlan.hif_func.hif_set_default_bus_speed();
}
+
u32 init_chip(struct net_device *dev)
{
u32 chipid;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Total_Length variable to total_length
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index b07d229..34a8b47 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -298,13 +298,14 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
if (protocol == 0x06) {
u8 *tcp_hdr_ptr;
- u32 IHL, Total_Length, Data_offset;
+ u32 IHL, total_length, Data_offset;
tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN];
IHL = (ip_hdr_ptr[0] & 0xf) << 2;
- Total_Length = (((u32)ip_hdr_ptr[2]) << 8) + ((u32)ip_hdr_ptr[3]);
+ total_length = ((u32)ip_hdr_ptr[2] << 8) +
+ (u32)ip_hdr_ptr[3];
Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2);
- if (Total_Length == (IHL + Data_offset)) {
+ if (total_length == (IHL + Data_offset)) {
u32 seq_no, Ack_no;
seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Enable_TCP_ACK_Filter function to enable_tcp_ack_filter
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++--
drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 5291868..6f40522 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1570,9 +1570,9 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
if ((strStatistics.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH) &&
(strStatistics.link_speed != DEFAULT_LINK_SPEED))
- Enable_TCP_ACK_Filter(true);
+ enable_tcp_ack_filter(true);
else if (strStatistics.link_speed != DEFAULT_LINK_SPEED)
- Enable_TCP_ACK_Filter(false);
+ enable_tcp_ack_filter(false);
PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
sinfo->tx_failed, sinfo->txrate.legacy);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 39cd8e1..d7bdca1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -104,6 +104,6 @@ void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
#define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
#define DEFAULT_LINK_SPEED 72
-void Enable_TCP_ACK_Filter(bool value);
+void enable_tcp_ack_filter(bool value);
#endif
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 0bfd1bd..53c5804 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -391,7 +391,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
bool enabled = false;
-void Enable_TCP_ACK_Filter(bool value)
+void enable_tcp_ack_filter(bool value)
{
enabled = value;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Data_offset variable to data_offset
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 34a8b47..6d72e09 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -298,14 +298,14 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
if (protocol == 0x06) {
u8 *tcp_hdr_ptr;
- u32 IHL, total_length, Data_offset;
+ u32 IHL, total_length, data_offset;
tcp_hdr_ptr = &ip_hdr_ptr[IP_HDR_LEN];
IHL = (ip_hdr_ptr[0] & 0xf) << 2;
total_length = ((u32)ip_hdr_ptr[2] << 8) +
(u32)ip_hdr_ptr[3];
- Data_offset = (((u32)tcp_hdr_ptr[12] & 0xf0) >> 2);
- if (total_length == (IHL + Data_offset)) {
+ data_offset = ((u32)tcp_hdr_ptr[12] & 0xf0) >> 2;
+ if (total_length == (IHL + data_offset)) {
u32 seq_no, Ack_no;
seq_no = (((u32)tcp_hdr_ptr[4]) << 24) + (((u32)tcp_hdr_ptr[5]) << 16) + (((u32)tcp_hdr_ptr[6]) << 8) + ((u32)tcp_hdr_ptr[7]);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Session_index of struct pending_acks_info to session_index
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index fb0e635..af5a16e 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -204,7 +204,7 @@ struct ack_session_info {
struct pending_acks_info {
u32 ack_num;
- u32 Session_index;
+ u32 session_index;
struct txq_entry_t *txqe;
};
@@ -252,7 +252,7 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent
if (Pending_Acks < MAX_PENDING_ACKS) {
Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack;
Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe;
- Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].Session_index = Session_index;
+ Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index;
txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks;
Pending_Acks++;
} else {
@@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
- if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].bigger_ack_num) {
+ if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the pBSSID variable to bssid
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index ec5fc1d..f1bb8af 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -899,10 +899,10 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
if (tqe->type == WILC_CFG_PKT) {
buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET;
} else if (tqe->type == WILC_NET_PKT) {
- char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid;
+ char *bssid = ((struct tx_complete_data *)(tqe->priv))->pBssid;
buffer_offset = ETH_ETHERNET_HDR_OFFSET;
- memcpy(&txb[offset + 4], pBSSID, 6);
+ memcpy(&txb[offset + 4], bssid, 6);
} else {
buffer_offset = HOST_HDR_OFFSET;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the error reported by checkpatch.pl
for else should follow close brace '}'
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index cffd720..ec5fc1d 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -898,14 +898,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
memcpy(&txb[offset], &header, 4);
if (tqe->type == WILC_CFG_PKT) {
buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET;
- }
- else if (tqe->type == WILC_NET_PKT) {
+ } else if (tqe->type == WILC_NET_PKT) {
char *pBSSID = ((struct tx_complete_data *)(tqe->priv))->pBssid;
buffer_offset = ETH_ETHERNET_HDR_OFFSET;
memcpy(&txb[offset + 4], pBSSID, 6);
- }
- else {
+ } else {
buffer_offset = HOST_HDR_OFFSET;
}
@@ -1008,9 +1006,7 @@ 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);
- }
- else
- {
+ } else {
if (!is_cfg_packet) {
if (pkt_len > 0) {
frmw_to_linux(wilc,
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename genuChipPSstate variable to chip_ps_state
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 7ebfcaf..c393e52 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -55,13 +55,13 @@ static void wilc_debug(u32 flag, char *fmt, ...)
}
}
-static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
+static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
static inline void acquire_bus(BUS_ACQUIRE_T acquire)
{
mutex_lock(&g_linux_wlan->hif_cs);
#ifndef WILC_OPTIMIZE_SLEEP_INT
- if (genuChipPSstate != CHIP_WAKEDUP)
+ if (chip_ps_state != CHIP_WAKEDUP)
#endif
{
if (acquire == ACQUIRE_AND_WAKEUP)
@@ -606,7 +606,7 @@ static inline void chip_wakeup(void)
} while ((clk_status_reg & 0x1) == 0);
}
- if (genuChipPSstate == CHIP_SLEEPING_MANUAL) {
+ if (chip_ps_state == CHIP_SLEEPING_MANUAL) {
g_wlan.hif_func.hif_read_reg(0x1C0C, ®);
reg &= ~BIT(0);
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
@@ -623,7 +623,7 @@ static inline void chip_wakeup(void)
g_wlan.hif_func.hif_write_reg(0x1e9c, val32);
}
}
- genuChipPSstate = CHIP_WAKEDUP;
+ chip_ps_state = CHIP_WAKEDUP;
}
#else
static inline void chip_wakeup(void)
@@ -653,7 +653,7 @@ static inline void chip_wakeup(void)
} while (wilc_get_chipid(true) == 0);
- if (genuChipPSstate == CHIP_SLEEPING_MANUAL) {
+ if (chip_ps_state == CHIP_SLEEPING_MANUAL) {
g_wlan.hif_func.hif_read_reg(0x1C0C, ®);
reg &= ~BIT(0);
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
@@ -670,12 +670,12 @@ static inline void chip_wakeup(void)
g_wlan.hif_func.hif_write_reg(0x1e9c, val32);
}
}
- genuChipPSstate = CHIP_WAKEDUP;
+ chip_ps_state = CHIP_WAKEDUP;
}
#endif
void chip_sleep_manually(u32 u32SleepTime)
{
- if (genuChipPSstate != CHIP_WAKEDUP)
+ if (chip_ps_state != CHIP_WAKEDUP)
return;
acquire_bus(ACQUIRE_ONLY);
@@ -684,7 +684,7 @@ void chip_sleep_manually(u32 u32SleepTime)
#endif
g_wlan.hif_func.hif_write_reg(0x10a8, 1);
- genuChipPSstate = CHIP_SLEEPING_MANUAL;
+ chip_ps_state = CHIP_SLEEPING_MANUAL;
release_bus(RELEASE_ONLY);
}
@@ -1069,7 +1069,7 @@ static void wilc_sleeptimer_isr_ext(u32 int_stats1)
{
g_wlan.hif_func.hif_clear_int_ext(SLEEP_INT_CLR);
#ifndef WILC_OPTIMIZE_SLEEP_INT
- genuChipPSstate = CHIP_SLEEPING_AUTO;
+ chip_ps_state = CHIP_SLEEPING_AUTO;
#endif
}
@@ -1158,7 +1158,7 @@ void wilc_handle_isr(void *wilc)
if (int_status & DATA_INT_EXT) {
wilc_wlan_handle_isr_ext(wilc, int_status);
#ifndef WILC_OPTIMIZE_SLEEP_INT
- genuChipPSstate = CHIP_WAKEDUP;
+ chip_ps_state = CHIP_WAKEDUP;
#endif
}
if (int_status & SLEEP_INT_EXT)
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Pending_Acks_info variable to pending_acks_info
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 359df26..7db42c0 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -216,7 +216,7 @@ struct ack_session_info *Alloc_head;
#define MAX_TCP_SESSION 25
#define MAX_PENDING_ACKS 256
struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
-struct pending_acks_info Pending_Acks_info[MAX_PENDING_ACKS];
+struct pending_acks_info pending_acks_info[MAX_PENDING_ACKS];
u32 PendingAcks_arrBase;
u32 Opened_TCP_session;
@@ -250,9 +250,9 @@ static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_ent
{
total_acks++;
if (Pending_Acks < MAX_PENDING_ACKS) {
- Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack;
- Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe;
- Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index;
+ pending_acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack;
+ pending_acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe;
+ pending_acks_info[PendingAcks_arrBase + Pending_Acks].session_index = Session_index;
txqe->tcp_PendingAck_index = PendingAcks_arrBase + Pending_Acks;
Pending_Acks++;
} else {
@@ -347,11 +347,12 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
- if (Pending_Acks_info[i].ack_num < ack_session_info[Pending_Acks_info[i].session_index].bigger_ack_num) {
+ if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
- PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num);
- tqe = Pending_Acks_info[i].txqe;
+ PRINT_D(TCP_ENH, "DROP ACK: %u\n",
+ pending_acks_info[i].ack_num);
+ tqe = pending_acks_info[i].txqe;
if (tqe) {
wilc_wlan_txq_remove(tqe);
dropped_acks++;
@@ -910,7 +911,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
tqe->tx_complete_func(tqe->priv, tqe->status);
#ifdef TCP_ACK_FILTER
if (tqe->tcp_PendingAck_index != NOT_TCP_ACK)
- Pending_Acks_info[tqe->tcp_PendingAck_index].txqe = NULL;
+ pending_acks_info[tqe->tcp_PendingAck_index].txqe = NULL;
#endif
kfree(tqe);
} else {
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the error reported by checkpatch.pl
for that open brace { should be on the previous line.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 947c9f9..c94cb13 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1186,8 +1186,7 @@ static void wilc_set_multicast_list(struct net_device *dev)
return;
}
- netdev_for_each_mc_addr(ha, dev)
- {
+ netdev_for_each_mc_addr(ha, dev) {
memcpy(multicast_mac_addr_list[i], ha->addr, ETH_ALEN);
PRINT_D(INIT_DBG, "Entry[%d]: %x:%x:%x:%x:%x:%x\n", i,
multicast_mac_addr_list[i][0],
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the error reported by checkpatch.pl
for braces {} should be used on all arms of this statement
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 458eef2b..3b097c1 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1104,9 +1104,9 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
if (LINUX_RX_SIZE - offset < size)
offset = 0;
- if (p->rx_buffer)
+ if (p->rx_buffer) {
buffer = &p->rx_buffer[offset];
- else {
+ } else {
wilc_debug(N_ERR, "[wilc isr]: fail Rx Buffer is NULL...drop the packets (%d)\n", size);
goto _end_;
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename pu32TxqCount to txq_count that is second argument of
wilc_wlan_handle_txq function to avoid camelcase.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
drivers/staging/wilc1000/wilc_wlan.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 66d5d42..cffd720 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -695,7 +695,7 @@ void chip_sleep_manually(void)
release_bus(RELEASE_ONLY);
}
-int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount)
+int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
{
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
int i, entries = 0;
@@ -949,7 +949,7 @@ _end_:
p->txq_exit = 1;
PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
- *pu32TxqCount = p->txq_entries;
+ *txq_count = p->txq_entries;
return ret;
}
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index de2fb7c..1eaac9a 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -300,7 +300,7 @@ int wilc_wlan_start(void);
int wilc_wlan_stop(void);
int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func);
-int wilc_wlan_handle_txq(struct net_device *dev, u32 *pu32TxqCount);
+int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count);
void wilc_handle_isr(void *wilc);
void wilc_wlan_cleanup(struct net_device *dev);
int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Update_TCP_track_session function to update_tcp_session
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 75b35b8..c4312bb 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -239,7 +239,7 @@ static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq)
return 0;
}
-static inline int Update_TCP_track_session(u32 index, u32 Ack)
+static inline int update_tcp_session(u32 index, u32 Ack)
{
if (Ack > ack_session_info[index].bigger_ack_num)
ack_session_info[index].bigger_ack_num = Ack;
@@ -314,7 +314,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
for (i = 0; i < tcp_session; i++) {
if (ack_session_info[i].seq_num == seq_no) {
- Update_TCP_track_session(i, Ack_no);
+ update_tcp_session(i, Ack_no);
break;
}
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the is_TCP_ACK_Filter_Enabled function to
is_tcp_ack_filter_enabled to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 53c5804..78a4359 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -396,7 +396,7 @@ void enable_tcp_ack_filter(bool value)
enabled = value;
}
-bool is_TCP_ACK_Filter_Enabled(void)
+bool is_tcp_ack_filter_enabled(void)
{
return enabled;
}
@@ -456,7 +456,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n");
#ifdef TCP_ACK_FILTER
tqe->tcp_PendingAck_index = NOT_TCP_ACK;
- if (is_TCP_ACK_Filter_Enabled())
+ if (is_tcp_ack_filter_enabled())
tcp_process(dev, tqe);
#endif
wilc_wlan_txq_add_to_tail(dev, tqe);
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for prefer kmalloc(sizeof(*tx_data)...) over kmalloc(sizeof(struct tx_complete_data)...)
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/linux_wlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 976964d..947c9f9 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1236,7 +1236,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
return 0;
}
- tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
+ tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
if (!tx_data) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename drvHandler to drv_handler that is fifth argument of
wilc_wlan_cfg_get function to avoid camelcase.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
drivers/staging/wilc1000/wilc_wlan.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index f0a8131..09029b6 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1516,7 +1516,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
return ret_size;
}
-int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
+int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler)
{
wilc_wlan_dev_t *p = &g_wlan;
u32 offset;
@@ -1536,7 +1536,7 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
if (commit) {
p->cfg_frame_in_use = 1;
- if (wilc_wlan_cfg_commit(WILC_CFG_QUERY, drvHandler))
+ if (wilc_wlan_cfg_commit(WILC_CFG_QUERY, drv_handler))
ret_size = 0;
if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 03af19b..55e4f19 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -305,7 +305,7 @@ void wilc_handle_isr(void *wilc);
void wilc_wlan_cleanup(struct net_device *dev);
int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
int commit, u32 drv_handler);
-int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler);
+int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler);
int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
u32 buffer_size, wilc_tx_complete_func_t func);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Statisitcs_totalAcks variable to total_acks
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 8ac0b1e..8d6215b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -190,7 +190,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
return 0;
}
-u32 Statisitcs_totalAcks = 0, Statisitcs_DroppedAcks = 0;
+u32 total_acks = 0, Statisitcs_DroppedAcks = 0;
#ifdef TCP_ACK_FILTER
struct Ack_session_info;
@@ -248,7 +248,7 @@ static inline int Update_TCP_track_session(u32 index, u32 Ack)
static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe)
{
- Statisitcs_totalAcks++;
+ total_acks++;
if (Pending_Acks < MAX_PENDING_ACKS) {
Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].ack_num = Ack;
Pending_Acks_info[PendingAcks_arrBase + Pending_Acks].txqe = txqe;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename bValue to value that is second argument of
set_machw_change_vir_if function to avoid camelcase.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 6f9da09..54ed723 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -217,7 +217,7 @@ void wl_wlan_cleanup(struct wilc *wilc);
int wilc_netdev_init(struct wilc **wilc);
void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
-u16 set_machw_change_vir_if(struct net_device *dev, bool bValue);
+u16 set_machw_change_vir_if(struct net_device *dev, bool value);
int linux_wlan_get_firmware(struct net_device *dev);
int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
#endif
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index c4118fe..458eef2b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1715,7 +1715,7 @@ _fail_:
return ret;
}
-u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
+u16 set_machw_change_vir_if(struct net_device *dev, bool value)
{
u16 ret;
u32 reg;
@@ -1730,7 +1730,7 @@ u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
if (!ret)
PRINT_ER("Error while Reading reg WILC_CHANGING_VIR_IF\n");
- if (bValue)
+ if (value)
reg |= BIT(31);
else
reg &= ~BIT(31);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename drvHandler to drv_handler that is seventh argument of
wilc_wlan_cfg_set function to avoid camelcase.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
drivers/staging/wilc1000/wilc_wlan.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 2e1d9b8..f0a8131 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1477,7 +1477,7 @@ static int wilc_wlan_cfg_commit(int type, u32 drv_handler)
}
int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
- int commit, u32 drvHandler)
+ int commit, u32 drv_handler)
{
wilc_wlan_dev_t *p = &g_wlan;
u32 offset;
@@ -1500,7 +1500,7 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
PRINT_D(RX_DBG, "Processing cfg_set()\n");
p->cfg_frame_in_use = 1;
- if (wilc_wlan_cfg_commit(WILC_CFG_SET, drvHandler))
+ if (wilc_wlan_cfg_commit(WILC_CFG_SET, drv_handler))
ret_size = 0;
if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 1eaac9a..03af19b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -304,7 +304,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count);
void wilc_handle_isr(void *wilc);
void wilc_wlan_cleanup(struct net_device *dev);
int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
- int commit, u32 drvHandler);
+ int commit, u32 drv_handler);
int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler);
int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size);
int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for Please don't use multiple blank lines.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 48 ------------------------------------
1 file changed, 48 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 7aaad0f..5db87c0 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -6,8 +6,6 @@ extern wilc_hif_func_t hif_sdio;
extern wilc_hif_func_t hif_spi;
u32 wilc_get_chipid(u8 update);
-
-
typedef struct {
int quit;
wilc_wlan_io_func_t io_func;
@@ -35,8 +33,6 @@ typedef struct {
struct rxq_entry_t *rxq_tail;
int rxq_entries;
int rxq_exit;
-
-
} wilc_wlan_dev_t;
static wilc_wlan_dev_t g_wlan;
@@ -92,8 +88,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
p->txq_head = tqe->next;
if (p->txq_head)
p->txq_head->prev = NULL;
-
-
} else if (tqe == p->txq_tail) {
p->txq_tail = (tqe->prev);
if (p->txq_tail)
@@ -126,10 +120,6 @@ wilc_wlan_txq_remove_from_head(struct net_device *dev)
p->txq_head->prev = NULL;
p->txq_entries -= 1;
-
-
-
-
} else {
tqe = NULL;
}
@@ -222,9 +212,6 @@ typedef struct {
struct txq_entry_t *txqe;
} Pending_Acks_info_t;
-
-
-
struct Ack_session_info *Free_head;
struct Ack_session_info *Alloc_head;
@@ -239,8 +226,6 @@ u32 PendingAcks_arrBase;
u32 Opened_TCP_session;
u32 Pending_Acks;
-
-
static inline int Init_TCP_tracking(void)
{
@@ -319,7 +304,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
ip_hdr_ptr = &buffer[ETHERNET_HDR_LEN];
protocol = ip_hdr_ptr[9];
-
if (protocol == 0x06) {
u8 *tcp_hdr_ptr;
u32 IHL, Total_Length, Data_offset;
@@ -335,7 +319,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
Ack_no = (((u32)tcp_hdr_ptr[8]) << 24) + (((u32)tcp_hdr_ptr[9]) << 16) + (((u32)tcp_hdr_ptr[10]) << 8) + ((u32)tcp_hdr_ptr[11]);
-
for (i = 0; i < Opened_TCP_session; i++) {
if (Acks_keep_track_info[i].Ack_seq_num == seq_no) {
Update_TCP_track_session(i, Ack_no);
@@ -346,8 +329,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
add_TCP_track_session(0, 0, seq_no);
add_TCP_Pending_Ack(Ack_no, i, tqe);
-
-
}
} else {
@@ -360,7 +341,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
return ret;
}
-
static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
{
perInterface_wlan_t *nic;
@@ -398,7 +378,6 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
else
PendingAcks_arrBase = 0;
-
spin_unlock_irqrestore(&wilc->txq_spinlock, p->txq_spinlock_flags);
while (Dropped > 0) {
@@ -523,7 +502,6 @@ static struct txq_entry_t *wilc_wlan_txq_get_first(struct wilc *wilc)
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
-
return tqe;
}
@@ -536,7 +514,6 @@ static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc,
tqe = tqe->next;
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
-
return tqe;
}
@@ -637,7 +614,6 @@ static inline void chip_wakeup(void)
} while ((clk_status_reg & 0x1) == 0);
}
-
if (genuChipPSstate == CHIP_SLEEPING_MANUAL) {
g_wlan.hif_func.hif_read_reg(0x1C0C, ®);
reg &= ~BIT(0);
@@ -990,9 +966,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
p->rxq_exit = 0;
-
-
-
do {
if (p->quit) {
PRINT_D(RX_DBG, "exit 1st do-while due to Clean_UP function\n");
@@ -1009,8 +982,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n", size, buffer);
offset = 0;
-
-
do {
u32 header;
u32 pkt_len, pkt_offset, tp_len;
@@ -1023,8 +994,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
#endif
PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n", header, offset);
-
-
is_cfg_packet = (header >> 31) & 0x1;
pkt_offset = (header >> 22) & 0x1ff;
tp_len = (header >> 11) & 0x7ff;
@@ -1039,7 +1008,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
#define IS_MANAGMEMENT_CALLBACK 0x080
#define IS_MGMT_STATUS_SUCCES 0x040
-
if (pkt_offset & IS_MANAGMEMENT) {
pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES);
@@ -1059,8 +1027,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
} else {
wilc_cfg_rsp_t rsp;
-
-
wilc_wlan_cfg_indicate_rx(&buffer[pkt_offset + offset], pkt_len, &rsp);
if (rsp.type == WILC_CFG_RSP) {
PRINT_D(RX_DBG, "p->cfg_seq_no = %d - rsp.seq_no = %d\n", p->cfg_seq_no, rsp.seq_no);
@@ -1078,8 +1044,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
if (offset >= size)
break;
} while (1);
-
-
#ifndef MEMORY_STATIC
kfree(buffer);
#endif
@@ -1173,8 +1137,6 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
goto _end_;
}
_end_:
-
-
if (ret) {
#ifdef MEMORY_STATIC
offset += size;
@@ -1394,8 +1356,6 @@ int wilc_wlan_stop(void)
}
reg &= ~BIT(10);
-
-
ret = p->hif_func.hif_write_reg(WILC_GLB_RESET_0, reg);
if (!ret) {
PRINT_ER("Error while writing reg\n");
@@ -1403,8 +1363,6 @@ int wilc_wlan_stop(void)
return ret;
}
-
-
do {
ret = p->hif_func.hif_read_reg(WILC_GLB_RESET_0, ®);
if (!ret) {
@@ -1486,7 +1444,6 @@ void wilc_wlan_cleanup(struct net_device *dev)
acquire_bus(ACQUIRE_AND_WAKEUP);
-
ret = p->hif_func.hif_read_reg(WILC_GP_REG_0, ®);
if (!ret) {
PRINT_ER("Error while reading reg\n");
@@ -1538,7 +1495,6 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
u32 offset;
int ret_size;
-
if (p->cfg_frame_in_use)
return 0;
@@ -1578,7 +1534,6 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
u32 offset;
int ret_size;
-
if (p->cfg_frame_in_use)
return 0;
@@ -1596,7 +1551,6 @@ int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler)
if (wilc_wlan_cfg_commit(WILC_CFG_QUERY, drvHandler))
ret_size = 0;
-
if (linux_wlan_lock_timeout(&g_linux_wlan->cfg_event,
CFG_PKTS_TIMEOUT)) {
PRINT_D(TX_DBG, "Get Timed Out\n");
@@ -1638,8 +1592,6 @@ u32 init_chip(struct net_device *dev)
chipid = wilc_get_chipid(true);
-
-
if ((chipid & 0xfff) != 0xa0) {
ret = g_wlan.hif_func.hif_read_reg(0x1118, ®);
if (!ret) {
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the warning reported by checkpatch.pl
for braces {} are not necessary for any arm of this statement
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 3b097c1..d7834c5 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1457,11 +1457,10 @@ static int wilc_wlan_cfg_commit(int type, u32 drvHandler)
int seq_no = p->cfg_seq_no % 256;
int driver_handler = (u32)drvHandler;
- if (type == WILC_CFG_SET) {
+ if (type == WILC_CFG_SET)
cfg->wid_header[0] = 'W';
- } else {
+ else
cfg->wid_header[0] = 'Q';
- }
cfg->wid_header[1] = seq_no;
cfg->wid_header[2] = (u8)total_len;
cfg->wid_header[3] = (u8)(total_len >> 8);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the add_TCP_track_session function to add_tcp_session
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index df0f5ce..75b35b8 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -227,7 +227,7 @@ static inline int init_tcp_tracking(void)
return 0;
}
-static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
+static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq)
{
ack_session_info[tcp_session].seq_num = seq;
ack_session_info[tcp_session].bigger_ack_num = 0;
@@ -319,7 +319,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
}
}
if (i == tcp_session)
- add_TCP_track_session(0, 0, seq_no);
+ add_tcp_session(0, 0, seq_no);
add_TCP_Pending_Ack(Ack_no, i, tqe);
}
--
1.9.1
From: Leo Kim <[email protected]>
This patch fixes the checks reported by checkpatch.pl
for prefer kmalloc(sizeof(*tqe)...) over kmalloc(sizeof(struct txq_entry_t)...)
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 78a4359..0c08a9a 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -413,7 +413,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
return 0;
}
- tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
+ tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
if (!tqe) {
PRINT_ER("Failed to allocate memory\n");
return 0;
@@ -443,7 +443,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
if (p->quit)
return 0;
- tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
+ tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
if (!tqe)
return 0;
@@ -472,7 +472,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
if (p->quit)
return 0;
- tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL);
+ tqe = kmalloc(sizeof(*tqe), GFP_KERNEL);
if (!tqe)
return 0;
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename Bigger_Ack_num of struct ack_session_info to bigger_ack_num
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 7162473..4aec892 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -196,7 +196,7 @@ u32 total_acks = 0, dropped_acks = 0;
struct ack_session_info;
struct ack_session_info {
u32 seq_num;
- u32 Bigger_Ack_num;
+ u32 bigger_ack_num;
u16 src_port;
u16 dst_port;
u16 status;
@@ -230,7 +230,7 @@ static inline int Init_TCP_tracking(void)
static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
{
Acks_keep_track_info[Opened_TCP_session].seq_num = seq;
- Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0;
+ Acks_keep_track_info[Opened_TCP_session].bigger_ack_num = 0;
Acks_keep_track_info[Opened_TCP_session].src_port = src_prt;
Acks_keep_track_info[Opened_TCP_session].dst_port = dst_prt;
Opened_TCP_session++;
@@ -241,8 +241,8 @@ static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
static inline int Update_TCP_track_session(u32 index, u32 Ack)
{
- if (Ack > Acks_keep_track_info[index].Bigger_Ack_num)
- Acks_keep_track_info[index].Bigger_Ack_num = Ack;
+ if (Ack > Acks_keep_track_info[index].bigger_ack_num)
+ Acks_keep_track_info[index].bigger_ack_num = Ack;
return 0;
}
@@ -347,7 +347,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
spin_lock_irqsave(&wilc->txq_spinlock, p->txq_spinlock_flags);
for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
- if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) {
+ if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].bigger_ack_num) {
struct txq_entry_t *tqe;
PRINT_D(TCP_ENH, "DROP ACK: %u\n", Pending_Acks_info[i].ack_num);
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the EnableTCPAckFilter variable to enabled
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 283ab52..0bfd1bd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -389,16 +389,16 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
}
#endif
-bool EnableTCPAckFilter = false;
+bool enabled = false;
void Enable_TCP_ACK_Filter(bool value)
{
- EnableTCPAckFilter = value;
+ enabled = value;
}
bool is_TCP_ACK_Filter_Enabled(void)
{
- return EnableTCPAckFilter;
+ return enabled;
}
static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the add_TCP_Pending_Ack function to add_tcp_pending_ack
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index c4312bb..3e62abd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -246,7 +246,8 @@ static inline int update_tcp_session(u32 index, u32 Ack)
return 0;
}
-static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct txq_entry_t *txqe)
+static inline int add_tcp_pending_ack(u32 Ack, u32 Session_index,
+ struct txq_entry_t *txqe)
{
total_acks++;
if (pending_acks < MAX_PENDING_ACKS) {
@@ -321,7 +322,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
if (i == tcp_session)
add_tcp_session(0, 0, seq_no);
- add_TCP_Pending_Ack(Ack_no, i, tqe);
+ add_tcp_pending_ack(Ack_no, i, tqe);
}
} else {
--
1.9.1
From: Leo Kim <[email protected]>
This patch rename the Ack member variable to ack
to avoid CamelCase naming convention.
Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Glen Lee <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 3e62abd..58043dc 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -239,19 +239,19 @@ static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq)
return 0;
}
-static inline int update_tcp_session(u32 index, u32 Ack)
+static inline int update_tcp_session(u32 index, u32 ack)
{
- if (Ack > ack_session_info[index].bigger_ack_num)
- ack_session_info[index].bigger_ack_num = Ack;
+ if (ack > ack_session_info[index].bigger_ack_num)
+ ack_session_info[index].bigger_ack_num = ack;
return 0;
}
-static inline int add_tcp_pending_ack(u32 Ack, u32 Session_index,
+static inline int add_tcp_pending_ack(u32 ack, u32 Session_index,
struct txq_entry_t *txqe)
{
total_acks++;
if (pending_acks < MAX_PENDING_ACKS) {
- pending_acks_info[pending_base + pending_acks].ack_num = Ack;
+ pending_acks_info[pending_base + pending_acks].ack_num = ack;
pending_acks_info[pending_base + pending_acks].txqe = txqe;
pending_acks_info[pending_base + pending_acks].session_index = Session_index;
txqe->tcp_PendingAck_index = pending_base + pending_acks;
--
1.9.1