Skip to contentSkip to conversation

staging: wilc1000: wilc_wlan.c: remove unused pointer variables

PATCH New Glen Lee 1 participant 24 messages Nov 6, 2015 Staging

lore
Share & tools
lore

Glen Lee

author
#0 lore raw

PATCH 50/73 staging: wilc1000: wilc_wlan.c: remove unused pointer variables

From: Leo Kim <[email protected]>

This patch removes unused two pointer variable.
- Free_head
- Alloc_head
It's pointer variables unused inside code.

---
 drivers/staging/wilc1000/wilc_wlan.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +0 -3
index 09029b6..7e7e77f 100644
@@ -208,9 +208,6 @@ struct pending_acks_info {
 	struct txq_entry_t  *txqe;
 };
 
-struct ack_session_info *Free_head;
-struct ack_session_info *Alloc_head;
-
 #define NOT_TCP_ACK			(-1)
 
 #define MAX_TCP_SESSION		25
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 51/73 staging: wilc1000: fixes alignment should match open parenthesis

From: Leo Kim <[email protected]>

This patch fixes the checks reported by checkpatch.pl for alignment should match open parenthesis.

---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index 7e7e77f..68158c9 100644
@@ -244,7 +244,7 @@ static inline int update_tcp_session(u32 index, u32 ack)
 }
 
 static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
-				       struct txq_entry_t *txqe)
+				      struct txq_entry_t *txqe)
 {
 	total_acks++;
 	if (pending_acks < MAX_PENDING_ACKS) {
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 52/73 staging: wilc1000: rename tcp_PendingAck_index of struct txq_entry_t

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames tcp_PendingAck_index of struct txq_entry_t to index to avoid CamelCase naming convention.

---
 drivers/staging/wilc1000/wilc_wlan.c | 12 ++++++------
 drivers/staging/wilc1000/wilc_wlan.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +6 -6
index 68158c9..679ae7e 100644
@@ -251,7 +251,7 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
 		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;
+		txqe->index = pending_base + pending_acks;
 		pending_acks++;
 	}
 	return 0;
@@ -422,7 +422,7 @@ static int wilc_wlan_txq_add_cfg_pkt(u8 *buffer, u32 buffer_size)
 	tqe->tx_complete_func = NULL;
 	tqe->priv = NULL;
 #ifdef TCP_ACK_FILTER
-	tqe->tcp_PendingAck_index = NOT_TCP_ACK;
+	tqe->index = NOT_TCP_ACK;
 #endif
 	PRINT_D(TX_DBG, "Adding the config packet at the Queue tail\n");
 
@@ -452,7 +452,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;
+	tqe->index = NOT_TCP_ACK;
 	if (is_tcp_ack_filter_enabled())
 		tcp_process(dev, tqe);
 #endif
@@ -479,7 +479,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
 	tqe->tx_complete_func = func;
 	tqe->priv = priv;
 #ifdef TCP_ACK_FILTER
-	tqe->tcp_PendingAck_index = NOT_TCP_ACK;
+	tqe->index = NOT_TCP_ACK;
 #endif
 	PRINT_D(TX_DBG, "Adding Network packet at the Queue tail\n");
 	wilc_wlan_txq_add_to_tail(dev, tqe);
@@ -911,8 +911,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if (tqe->tx_complete_func)
 					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;
+				if (tqe->index != NOT_TCP_ACK)
+					pending_acks_info[tqe->index].txqe = NULL;
 				#endif
 				kfree(tqe);
 			} else {
drivers/staging/wilc1000/wilc_wlan.h +1 -1
index 55e4f19..ff852b4 100644
@@ -231,7 +231,7 @@ struct txq_entry_t {
 	struct txq_entry_t *next;
 	struct txq_entry_t *prev;
 	int type;
-	int tcp_PendingAck_index;
+	int index;
 	u8 *buffer;
 	int buffer_size;
 	void *priv;
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 53/73 staging: wilc1000: fixes space prohibited between function name and open parenthesis

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch fixes the warning reported by checkpatch.pl for space prohibited between function name and open parenthesis '('

---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index 679ae7e..ba50605 100644
@@ -1678,7 +1678,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 		goto _fail_;
 	}
 
-#if defined (MEMORY_STATIC)
+#if defined(MEMORY_STATIC)
 	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);
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 54/73 staging: wilc1000: fixes possible unnecessary 'out of memory' message

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch fixes the warning reported by checkpatch.pl for possible unnecessary 'out of memory' message

---
 drivers/staging/wilc1000/wilc_wlan.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +0 -1
index ba50605..70d794b 100644
@@ -1111,7 +1111,6 @@ static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status)
 #else
 		buffer = kmalloc(size, GFP_KERNEL);
 		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_;
 		}
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH 55/73 staging: wilc1000: remove warnings line over 80 characters

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch removes the warnings reported by checkpatch.pl for line over 80 characters.

---
 drivers/staging/wilc1000/wilc_wlan.c | 50 ++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 16 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +34 -16
index 70d794b..ffe7baa 100644
@@ -361,7 +361,8 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 				dropped_acks++;
 				tqe->status = 1;
 				if (tqe->tx_complete_func)
-					tqe->tx_complete_func(tqe->priv, tqe->status);
+					tqe->tx_complete_func(tqe->priv,
+							      tqe->status);
 				kfree(tqe);
 				dropped++;
 			}
@@ -747,7 +748,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 				PRINT_D(TX_DBG, "VMM Size AFTER alignment = %d\n", vmm_sz);
 				vmm_table[i] = vmm_sz / 4;
-				PRINT_D(TX_DBG, "VMMTable entry size = %d\n", vmm_table[i]);
+				PRINT_D(TX_DBG, "VMMTable entry size = %d\n",
+					vmm_table[i]);
 
 				if (tqe->type == WILC_CFG_PKT) {
 					vmm_table[i] |= BIT(10);
@@ -883,7 +885,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 #endif
 				vmm_sz = (vmm_table[i] & 0x3ff);
 				vmm_sz *= 4;
-				header = (tqe->type << 31) | (tqe->buffer_size << 15) | vmm_sz;
+				header = (tqe->type << 31) |
+					 (tqe->buffer_size << 15) |
+					 vmm_sz;
 				if (tqe->type == WILC_MGMT_PKT)
 					header |= BIT(30);
 				else
@@ -904,12 +908,14 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 					buffer_offset = HOST_HDR_OFFSET;
 				}
 
-				memcpy(&txb[offset + buffer_offset], tqe->buffer, tqe->buffer_size);
+				memcpy(&txb[offset + buffer_offset],
+				       tqe->buffer, tqe->buffer_size);
 				offset += vmm_sz;
 				i++;
 				tqe->status = 1;
 				if (tqe->tx_complete_func)
-					tqe->tx_complete_func(tqe->priv, tqe->status);
+					tqe->tx_complete_func(tqe->priv,
+							      tqe->status);
 				#ifdef TCP_ACK_FILTER
 				if (tqe->index != NOT_TCP_ACK)
 					pending_acks_info[tqe->index].txqe = NULL;
@@ -970,7 +976,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 		}
 		buffer = rqe->buffer;
 		size = rqe->buffer_size;
-		PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n", size, buffer);
+		PRINT_D(RX_DBG, "rxQ entery Size = %d - Address = %p\n",
+			size, buffer);
 		offset = 0;
 
 		do {
@@ -983,7 +990,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 #ifdef BIG_ENDIAN
 			header = BYTE_SWAP(header);
 #endif
-			PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n", header, offset);
+			PRINT_D(RX_DBG, "Header = %04x - Offset = %d\n",
+				header, offset);
 
 			is_cfg_packet = (header >> 31) & 0x1;
 			pkt_offset = (header >> 22) & 0x1ff;
@@ -1000,7 +1008,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 			#define IS_MGMT_STATUS_SUCCES			0x040
 
 			if (pkt_offset & IS_MANAGMEMENT) {
-				pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES);
+				pkt_offset &= ~(IS_MANAGMEMENT |
+						IS_MANAGMEMENT_CALLBACK |
+						IS_MGMT_STATUS_SUCCES);
 
 				WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
 			} else {
@@ -1356,22 +1366,26 @@ int wilc_wlan_stop(void)
 			release_bus(RELEASE_ALLOW_SLEEP);
 			return ret;
 		}
-		PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n", reg, timeout);
+		PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n",
+			reg, timeout);
 
 		if ((reg & BIT(10))) {
-			PRINT_D(GENERIC_DBG, "Bit 10 not reset : Retry %d\n", timeout);
+			PRINT_D(GENERIC_DBG, "Bit 10 not reset : Retry %d\n",
+				timeout);
 			reg &= ~BIT(10);
 			ret = p->hif_func.hif_write_reg(WILC_GLB_RESET_0, reg);
 			timeout--;
 		} else {
-			PRINT_D(GENERIC_DBG, "Bit 10 reset after : Retry %d\n", timeout);
+			PRINT_D(GENERIC_DBG, "Bit 10 reset after : Retry %d\n",
+				timeout);
 			ret = p->hif_func.hif_read_reg(WILC_GLB_RESET_0, &reg);
 			if (!ret) {
 				PRINT_ER("Error while reading reg\n");
 				release_bus(RELEASE_ALLOW_SLEEP);
 				return ret;
 			}
-			PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n", reg, timeout);
+			PRINT_D(GENERIC_DBG, "Read RESET Reg %x : Retry%d\n",
+				reg, timeout);
 			break;
 		}
 
@@ -1492,7 +1506,8 @@ int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size,
 	p->cfg_frame_offset = offset;
 
 	if (commit) {
-		PRINT_D(TX_DBG, "[WILC]PACKET Commit with sequence number %d\n", p->cfg_seq_no);
+		PRINT_D(TX_DBG, "[WILC]PACKET Commit with sequence number %d\n",
+			p->cfg_seq_no);
 		PRINT_D(RX_DBG, "Processing cfg_set()\n");
 		p->cfg_frame_in_use = 1;
 
@@ -1641,21 +1656,24 @@ 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));
-	memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func, sizeof(wilc_wlan_io_func_t));
+	memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func,
+	       sizeof(wilc_wlan_io_func_t));
 
 	if ((inp->io_func.io_type & 0x1) == HIF_SDIO) {
 		if (!hif_sdio.hif_init(inp, wilc_debug)) {
 			ret = -5;
 			goto _fail_;
 		}
-		memcpy((void *)&g_wlan.hif_func, &hif_sdio, sizeof(wilc_hif_func_t));
+		memcpy((void *)&g_wlan.hif_func, &hif_sdio,
+		       sizeof(wilc_hif_func_t));
 	} else {
 		if ((inp->io_func.io_type & 0x1) == HIF_SPI) {
 			if (!hif_spi.hif_init(inp, wilc_debug)) {
 				ret = -5;
 				goto _fail_;
 			}
-			memcpy((void *)&g_wlan.hif_func, &hif_spi, sizeof(wilc_hif_func_t));
+			memcpy((void *)&g_wlan.hif_func, &hif_spi,
+			       sizeof(wilc_hif_func_t));
 		} else {
 			ret = -5;
 			goto _fail_;
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH 56/73 staging: wilc1000: replace numeric type to kernel error type

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch replaces numeric type to generic type by kernel style.
-5 -> -EIO
-105 -> -ENOBUFS

---
 drivers/staging/wilc1000/wilc_wlan.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +12 -12
index ffe7baa..283c506 100644
@@ -1194,7 +1194,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
 
 	dma_buffer = kmalloc(blksz, GFP_KERNEL);
 	if (!dma_buffer) {
-		ret = -5;
+		ret = -EIO;
 		PRINT_ER("Can't allocate buffer for firmware download IO error\n ");
 		goto _fail_1;
 	}
@@ -1229,7 +1229,7 @@ int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size)
 		release_bus(RELEASE_ONLY);
 
 		if (!ret) {
-			ret = -5;
+			ret = -EIO;
 			PRINT_ER("Can't download firmware IO error\n ");
 			goto _fail_;
 		}
@@ -1263,7 +1263,7 @@ int wilc_wlan_start(void)
 	if (!ret) {
 		wilc_debug(N_ERR, "[wilc start]: fail write reg vmm_core_cfg...\n");
 		release_bus(RELEASE_ONLY);
-		ret = -5;
+		ret = -EIO;
 		return ret;
 	}
 	reg = 0;
@@ -1298,7 +1298,7 @@ int wilc_wlan_start(void)
 	if (!ret) {
 		wilc_debug(N_ERR, "[wilc start]: fail write WILC_GP_REG_1 ...\n");
 		release_bus(RELEASE_ONLY);
-		ret = -5;
+		ret = -EIO;
 		return ret;
 	}
 
@@ -1308,7 +1308,7 @@ int wilc_wlan_start(void)
 	if (!ret) {
 		wilc_debug(N_ERR, "[wilc start]: fail read reg 0x1000 ...\n");
 		release_bus(RELEASE_ONLY);
-		ret = -5;
+		ret = -EIO;
 		return ret;
 	}
 
@@ -1661,7 +1661,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 
 	if ((inp->io_func.io_type & 0x1) == HIF_SDIO) {
 		if (!hif_sdio.hif_init(inp, wilc_debug)) {
-			ret = -5;
+			ret = -EIO;
 			goto _fail_;
 		}
 		memcpy((void *)&g_wlan.hif_func, &hif_sdio,
@@ -1669,19 +1669,19 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 	} else {
 		if ((inp->io_func.io_type & 0x1) == HIF_SPI) {
 			if (!hif_spi.hif_init(inp, wilc_debug)) {
-				ret = -5;
+				ret = -EIO;
 				goto _fail_;
 			}
 			memcpy((void *)&g_wlan.hif_func, &hif_spi,
 			       sizeof(wilc_hif_func_t));
 		} else {
-			ret = -5;
+			ret = -EIO;
 			goto _fail_;
 		}
 	}
 
 	if (!wilc_wlan_cfg_init(wilc_debug)) {
-		ret = -105;
+		ret = -ENOBUFS;
 		goto _fail_;
 	}
 
@@ -1690,7 +1690,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 	PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
 
 	if (!g_wlan.tx_buffer) {
-		ret = -105;
+		ret = -ENOBUFS;
 		PRINT_ER("Can't allocate Tx Buffer");
 		goto _fail_;
 	}
@@ -1700,14 +1700,14 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 		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) {
-		ret = -105;
+		ret = -ENOBUFS;
 		PRINT_ER("Can't allocate Rx Buffer");
 		goto _fail_;
 	}
 #endif
 
 	if (!init_chip(dev)) {
-		ret = -5;
+		ret = -EIO;
 		goto _fail_;
 	}
 #ifdef	TCP_ACK_FILTER
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH 57/73 staging: wilc1000: wilc_wlan.h: alignment defines

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch fixes alignment of defines.

---
 drivers/staging/wilc1000/wilc_wlan.h | 292 ++++++++++++++++++-----------------
 1 file changed, 148 insertions(+), 144 deletions(-)
drivers/staging/wilc1000/wilc_wlan.h +148 -144
index ff852b4..ba70630 100644
@@ -3,7 +3,7 @@
 
 
 
-#define ISWILC1000(id)   (((id & 0xfffff000) == 0x100000) ? 1 : 0)
+#define ISWILC1000(id)			((id & 0xfffff000) == 0x100000 ? 1 : 0)
 
 
 /********************************************
@@ -11,27 +11,30 @@
  *      Mac eth header length
  *
  ********************************************/
-#define DRIVER_HANDLER_SIZE 4
-#define MAX_MAC_HDR_LEN         26 /* QOS_MAC_HDR_LEN */
-#define SUB_MSDU_HEADER_LENGTH  14
-#define SNAP_HDR_LEN            8
-#define ETHERNET_HDR_LEN          14
-#define WORD_ALIGNMENT_PAD        0
-
-#define ETH_ETHERNET_HDR_OFFSET   (MAX_MAC_HDR_LEN + SUB_MSDU_HEADER_LENGTH + \
-				   SNAP_HDR_LEN - ETHERNET_HDR_LEN + WORD_ALIGNMENT_PAD)
-
-#define HOST_HDR_OFFSET		4
-#define ETHERNET_HDR_LEN          14
-#define IP_HDR_LEN                20
-#define IP_HDR_OFFSET             ETHERNET_HDR_LEN
-#define UDP_HDR_OFFSET            (IP_HDR_LEN + IP_HDR_OFFSET)
-#define UDP_HDR_LEN               8
-#define UDP_DATA_OFFSET           (UDP_HDR_OFFSET + UDP_HDR_LEN)
-#define ETH_CONFIG_PKT_HDR_LEN    UDP_DATA_OFFSET
-
-#define ETH_CONFIG_PKT_HDR_OFFSET (ETH_ETHERNET_HDR_OFFSET + \
-				   ETH_CONFIG_PKT_HDR_LEN)
+#define DRIVER_HANDLER_SIZE		4
+#define MAX_MAC_HDR_LEN			26 /* QOS_MAC_HDR_LEN */
+#define SUB_MSDU_HEADER_LENGTH		14
+#define SNAP_HDR_LEN			8
+#define ETHERNET_HDR_LEN		14
+#define WORD_ALIGNMENT_PAD		0
+
+#define ETH_ETHERNET_HDR_OFFSET		(MAX_MAC_HDR_LEN + \
+					 SUB_MSDU_HEADER_LENGTH + \
+					 SNAP_HDR_LEN - \
+					 ETHERNET_HDR_LEN + \
+					 WORD_ALIGNMENT_PAD)
+
+#define HOST_HDR_OFFSET			4
+#define ETHERNET_HDR_LEN		14
+#define IP_HDR_LEN			20
+#define IP_HDR_OFFSET			ETHERNET_HDR_LEN
+#define UDP_HDR_OFFSET			(IP_HDR_LEN + IP_HDR_OFFSET)
+#define UDP_HDR_LEN			8
+#define UDP_DATA_OFFSET			(UDP_HDR_OFFSET + UDP_HDR_LEN)
+#define ETH_CONFIG_PKT_HDR_LEN		UDP_DATA_OFFSET
+
+#define ETH_CONFIG_PKT_HDR_OFFSET	(ETH_ETHERNET_HDR_OFFSET + \
+					 ETH_CONFIG_PKT_HDR_LEN)
 
 /********************************************
  *
@@ -39,91 +42,92 @@
  *
  ********************************************/
 
-#define BYTE_SWAP(val) ((((val) & 0x000000FF) << 24) + \
-			(((val) & 0x0000FF00) << 8)  + \
-			(((val) & 0x00FF0000) >> 8)   +	\
-			(((val) & 0xFF000000) >> 24))
+#define BYTE_SWAP(val)			(((val & 0x000000FF) << 24) + \
+					 ((val & 0x0000FF00) << 8) + \
+					 ((val & 0x00FF0000) >> 8) + \
+					 ((val & 0xFF000000) >> 24))
 
 /********************************************
  *
  *      Register Defines
  *
  ********************************************/
-#define WILC_PERIPH_REG_BASE 0x1000
-#define WILC_CHANGING_VIR_IF                     (0x108c)
-#define WILC_CHIPID	(WILC_PERIPH_REG_BASE)
-#define WILC_GLB_RESET_0 (WILC_PERIPH_REG_BASE + 0x400)
-#define WILC_PIN_MUX_0 (WILC_PERIPH_REG_BASE + 0x408)
-#define WILC_HOST_TX_CTRL (WILC_PERIPH_REG_BASE + 0x6c)
-#define WILC_HOST_RX_CTRL_0 (WILC_PERIPH_REG_BASE + 0x70)
-#define WILC_HOST_RX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x74)
-#define WILC_HOST_VMM_CTL	(WILC_PERIPH_REG_BASE + 0x78)
-#define WILC_HOST_RX_CTRL	(WILC_PERIPH_REG_BASE + 0x80)
-#define WILC_HOST_RX_EXTRA_SIZE	(WILC_PERIPH_REG_BASE + 0x84)
-#define WILC_HOST_TX_CTRL_1	(WILC_PERIPH_REG_BASE + 0x88)
-#define WILC_MISC	(WILC_PERIPH_REG_BASE + 0x428)
-#define WILC_INTR_REG_BASE (WILC_PERIPH_REG_BASE + 0xa00)
-#define WILC_INTR_ENABLE (WILC_INTR_REG_BASE)
-#define WILC_INTR2_ENABLE (WILC_INTR_REG_BASE + 4)
-
-#define WILC_INTR_POLARITY (WILC_INTR_REG_BASE + 0x10)
-#define WILC_INTR_TYPE (WILC_INTR_REG_BASE + 0x20)
-#define WILC_INTR_CLEAR (WILC_INTR_REG_BASE + 0x30)
-#define WILC_INTR_STATUS (WILC_INTR_REG_BASE + 0x40)
-
-#define WILC_VMM_TBL_SIZE 64
-#define WILC_VMM_TX_TBL_BASE (0x150400)
-#define WILC_VMM_RX_TBL_BASE (0x150500)
-
-#define WILC_VMM_BASE 0x150000
-#define WILC_VMM_CORE_CTL (WILC_VMM_BASE)
-#define WILC_VMM_TBL_CTL (WILC_VMM_BASE + 0x4)
-#define WILC_VMM_TBL_ENTRY (WILC_VMM_BASE + 0x8)
-#define WILC_VMM_TBL0_SIZE (WILC_VMM_BASE + 0xc)
-#define WILC_VMM_TO_HOST_SIZE (WILC_VMM_BASE + 0x10)
-#define WILC_VMM_CORE_CFG (WILC_VMM_BASE + 0x14)
-#define WILC_VMM_TBL_ACTIVE (WILC_VMM_BASE + 040)
-#define WILC_VMM_TBL_STATUS (WILC_VMM_BASE + 0x44)
-
-#define WILC_SPI_REG_BASE 0xe800
-#define WILC_SPI_CTL (WILC_SPI_REG_BASE)
-#define WILC_SPI_MASTER_DMA_ADDR (WILC_SPI_REG_BASE + 0x4)
-#define WILC_SPI_MASTER_DMA_COUNT (WILC_SPI_REG_BASE + 0x8)
-#define WILC_SPI_SLAVE_DMA_ADDR (WILC_SPI_REG_BASE + 0xc)
-#define WILC_SPI_SLAVE_DMA_COUNT (WILC_SPI_REG_BASE + 0x10)
-#define WILC_SPI_TX_MODE (WILC_SPI_REG_BASE + 0x20)
-#define WILC_SPI_PROTOCOL_CONFIG (WILC_SPI_REG_BASE + 0x24)
-#define WILC_SPI_INTR_CTL (WILC_SPI_REG_BASE + 0x2c)
-
-#define WILC_SPI_PROTOCOL_OFFSET (WILC_SPI_PROTOCOL_CONFIG - WILC_SPI_REG_BASE)
-
-#define WILC_AHB_DATA_MEM_BASE 0x30000
-#define WILC_AHB_SHARE_MEM_BASE 0xd0000
-
-#define WILC_VMM_TBL_RX_SHADOW_BASE WILC_AHB_SHARE_MEM_BASE
-#define WILC_VMM_TBL_RX_SHADOW_SIZE (256)
-
-#define WILC_GP_REG_0   0x149c
-#define WILC_GP_REG_1   0x14a0
-
-#define rHAVE_SDIO_IRQ_GPIO_BIT      (0)
-#define rHAVE_USE_PMU_BIT            (1)
-#define rHAVE_SLEEP_CLK_SRC_RTC_BIT  (2)
-#define rHAVE_SLEEP_CLK_SRC_XO_BIT   (3)
-#define rHAVE_EXT_PA_INV_TX_RX_BIT   (4)
-#define rHAVE_LEGACY_RF_SETTINGS_BIT (5)
-#define rHAVE_XTAL_24_BIT            (6)
-#define rHAVE_DISABLE_WILC_UART_BIT   (7)
-
-
-#define WILC_HAVE_SDIO_IRQ_GPIO       (1 << rHAVE_SDIO_IRQ_GPIO_BIT)
-#define WILC_HAVE_USE_PMU             (1 << rHAVE_USE_PMU_BIT)
-#define WILC_HAVE_SLEEP_CLK_SRC_RTC   (1 << rHAVE_SLEEP_CLK_SRC_RTC_BIT)
-#define WILC_HAVE_SLEEP_CLK_SRC_XO    (1 << rHAVE_SLEEP_CLK_SRC_XO_BIT)
-#define WILC_HAVE_EXT_PA_INV_TX_RX    (1 << rHAVE_EXT_PA_INV_TX_RX_BIT)
-#define WILC_HAVE_LEGACY_RF_SETTINGS  (1 << rHAVE_LEGACY_RF_SETTINGS_BIT)
-#define WILC_HAVE_XTAL_24             (1 << rHAVE_XTAL_24_BIT)
-#define WILC_HAVE_DISABLE_WILC_UART    (1 << rHAVE_DISABLE_WILC_UART_BIT)
+#define WILC_PERIPH_REG_BASE		0x1000
+#define WILC_CHANGING_VIR_IF		0x108c
+#define WILC_CHIPID			WILC_PERIPH_REG_BASE
+#define WILC_GLB_RESET_0		(WILC_PERIPH_REG_BASE + 0x400)
+#define WILC_PIN_MUX_0			(WILC_PERIPH_REG_BASE + 0x408)
+#define WILC_HOST_TX_CTRL		(WILC_PERIPH_REG_BASE + 0x6c)
+#define WILC_HOST_RX_CTRL_0		(WILC_PERIPH_REG_BASE + 0x70)
+#define WILC_HOST_RX_CTRL_1		(WILC_PERIPH_REG_BASE + 0x74)
+#define WILC_HOST_VMM_CTL		(WILC_PERIPH_REG_BASE + 0x78)
+#define WILC_HOST_RX_CTRL		(WILC_PERIPH_REG_BASE + 0x80)
+#define WILC_HOST_RX_EXTRA_SIZE		(WILC_PERIPH_REG_BASE + 0x84)
+#define WILC_HOST_TX_CTRL_1		(WILC_PERIPH_REG_BASE + 0x88)
+#define WILC_MISC			(WILC_PERIPH_REG_BASE + 0x428)
+#define WILC_INTR_REG_BASE		(WILC_PERIPH_REG_BASE + 0xa00)
+#define WILC_INTR_ENABLE		WILC_INTR_REG_BASE
+#define WILC_INTR2_ENABLE		(WILC_INTR_REG_BASE + 4)
+
+#define WILC_INTR_POLARITY		(WILC_INTR_REG_BASE + 0x10)
+#define WILC_INTR_TYPE			(WILC_INTR_REG_BASE + 0x20)
+#define WILC_INTR_CLEAR			(WILC_INTR_REG_BASE + 0x30)
+#define WILC_INTR_STATUS		(WILC_INTR_REG_BASE + 0x40)
+
+#define WILC_VMM_TBL_SIZE		64
+#define WILC_VMM_TX_TBL_BASE		0x150400
+#define WILC_VMM_RX_TBL_BASE		0x150500
+
+#define WILC_VMM_BASE			0x150000
+#define WILC_VMM_CORE_CTL		WILC_VMM_BASE
+#define WILC_VMM_TBL_CTL		(WILC_VMM_BASE + 0x4)
+#define WILC_VMM_TBL_ENTRY		(WILC_VMM_BASE + 0x8)
+#define WILC_VMM_TBL0_SIZE		(WILC_VMM_BASE + 0xc)
+#define WILC_VMM_TO_HOST_SIZE		(WILC_VMM_BASE + 0x10)
+#define WILC_VMM_CORE_CFG		(WILC_VMM_BASE + 0x14)
+#define WILC_VMM_TBL_ACTIVE		(WILC_VMM_BASE + 040)
+#define WILC_VMM_TBL_STATUS		(WILC_VMM_BASE + 0x44)
+
+#define WILC_SPI_REG_BASE		0xe800
+#define WILC_SPI_CTL			WILC_SPI_REG_BASE
+#define WILC_SPI_MASTER_DMA_ADDR	(WILC_SPI_REG_BASE + 0x4)
+#define WILC_SPI_MASTER_DMA_COUNT	(WILC_SPI_REG_BASE + 0x8)
+#define WILC_SPI_SLAVE_DMA_ADDR		(WILC_SPI_REG_BASE + 0xc)
+#define WILC_SPI_SLAVE_DMA_COUNT	(WILC_SPI_REG_BASE + 0x10)
+#define WILC_SPI_TX_MODE		(WILC_SPI_REG_BASE + 0x20)
+#define WILC_SPI_PROTOCOL_CONFIG	(WILC_SPI_REG_BASE + 0x24)
+#define WILC_SPI_INTR_CTL		(WILC_SPI_REG_BASE + 0x2c)
+
+#define WILC_SPI_PROTOCOL_OFFSET	(WILC_SPI_PROTOCOL_CONFIG - \
+					 WILC_SPI_REG_BASE)
+
+#define WILC_AHB_DATA_MEM_BASE		0x30000
+#define WILC_AHB_SHARE_MEM_BASE		0xd0000
+
+#define WILC_VMM_TBL_RX_SHADOW_BASE	WILC_AHB_SHARE_MEM_BASE
+#define WILC_VMM_TBL_RX_SHADOW_SIZE	256
+
+#define WILC_GP_REG_0			0x149c
+#define WILC_GP_REG_1			0x14a0
+
+#define rHAVE_SDIO_IRQ_GPIO_BIT		0
+#define rHAVE_USE_PMU_BIT		1
+#define rHAVE_SLEEP_CLK_SRC_RTC_BIT	2
+#define rHAVE_SLEEP_CLK_SRC_XO_BIT	3
+#define rHAVE_EXT_PA_INV_TX_RX_BIT	4
+#define rHAVE_LEGACY_RF_SETTINGS_BIT	5
+#define rHAVE_XTAL_24_BIT		6
+#define rHAVE_DISABLE_WILC_UART_BIT	7
+
+
+#define WILC_HAVE_SDIO_IRQ_GPIO		(1 << rHAVE_SDIO_IRQ_GPIO_BIT)
+#define WILC_HAVE_USE_PMU		(1 << rHAVE_USE_PMU_BIT)
+#define WILC_HAVE_SLEEP_CLK_SRC_RTC	(1 << rHAVE_SLEEP_CLK_SRC_RTC_BIT)
+#define WILC_HAVE_SLEEP_CLK_SRC_XO	(1 << rHAVE_SLEEP_CLK_SRC_XO_BIT)
+#define WILC_HAVE_EXT_PA_INV_TX_RX	(1 << rHAVE_EXT_PA_INV_TX_RX_BIT)
+#define WILC_HAVE_LEGACY_RF_SETTINGS	(1 << rHAVE_LEGACY_RF_SETTINGS_BIT)
+#define WILC_HAVE_XTAL_24		(1 << rHAVE_XTAL_24_BIT)
+#define WILC_HAVE_DISABLE_WILC_UART	(1 << rHAVE_DISABLE_WILC_UART_BIT)
 
 
 /********************************************
@@ -131,25 +135,25 @@
  *      Wlan Defines
  *
  ********************************************/
-#define WILC_CFG_PKT	1
-#define WILC_NET_PKT 0
-#define WILC_MGMT_PKT 2
+#define WILC_CFG_PKT		1
+#define WILC_NET_PKT		0
+#define WILC_MGMT_PKT		2
 
-#define WILC_CFG_SET 1
-#define WILC_CFG_QUERY 0
+#define WILC_CFG_SET		1
+#define WILC_CFG_QUERY		0
 
-#define WILC_CFG_RSP	1
-#define WILC_CFG_RSP_STATUS 2
-#define WILC_CFG_RSP_SCAN 3
+#define WILC_CFG_RSP		1
+#define WILC_CFG_RSP_STATUS	2
+#define WILC_CFG_RSP_SCAN	3
 
 #ifdef WILC_SDIO
-#define WILC_PLL_TO	4
+#define WILC_PLL_TO		4
 #else
-#define WILC_PLL_TO	2
+#define WILC_PLL_TO		2
 #endif
 
 
-#define ABORT_INT   BIT(31)
+#define ABORT_INT		BIT(31)
 
 /*******************************************/
 /*        E0 and later Interrupt flags.    */
@@ -165,15 +169,15 @@
 /* 20: INT4 flag                           */
 /* 21: INT5 flag                           */
 /*******************************************/
-#define                 IRG_FLAGS_OFFSET 16
-#define IRQ_DMA_WD_CNT_MASK ((1ul << IRG_FLAGS_OFFSET) - 1)
-#define INT_0           (1 << (IRG_FLAGS_OFFSET))
-#define INT_1           (1 << (IRG_FLAGS_OFFSET + 1))
-#define INT_2           (1 << (IRG_FLAGS_OFFSET + 2))
-#define INT_3           (1 << (IRG_FLAGS_OFFSET + 3))
-#define INT_4           (1 << (IRG_FLAGS_OFFSET + 4))
-#define INT_5           (1 << (IRG_FLAGS_OFFSET + 5))
-#define MAX_NUM_INT     (6)
+#define IRG_FLAGS_OFFSET	16
+#define IRQ_DMA_WD_CNT_MASK	((1ul << IRG_FLAGS_OFFSET) - 1)
+#define INT_0			(1 << IRG_FLAGS_OFFSET)
+#define INT_1			(1 << (IRG_FLAGS_OFFSET + 1))
+#define INT_2			(1 << (IRG_FLAGS_OFFSET + 2))
+#define INT_3			(1 << (IRG_FLAGS_OFFSET + 3))
+#define INT_4			(1 << (IRG_FLAGS_OFFSET + 4))
+#define INT_5			(1 << (IRG_FLAGS_OFFSET + 5))
+#define MAX_NUM_INT		6
 
 /*******************************************/
 /*        E0 and later Interrupt flags.    */
@@ -188,28 +192,28 @@
 /* 7: Select VMM table 2                   */
 /* 8: Enable VMM                           */
 /*******************************************/
-#define CLR_INT0             BIT(0)
-#define CLR_INT1             BIT(1)
-#define CLR_INT2             BIT(2)
-#define CLR_INT3             BIT(3)
-#define CLR_INT4             BIT(4)
-#define CLR_INT5             BIT(5)
-#define SEL_VMM_TBL0         BIT(6)
-#define SEL_VMM_TBL1         BIT(7)
-#define EN_VMM               BIT(8)
-
-#define DATA_INT_EXT	INT_0
-#define PLL_INT_EXT         INT_1
-#define SLEEP_INT_EXT	INT_2
-#define ALL_INT_EXT     (DATA_INT_EXT | PLL_INT_EXT | SLEEP_INT_EXT)
-#define NUM_INT_EXT     (3)
-
-#define DATA_INT_CLR	CLR_INT0
-#define PLL_INT_CLR         CLR_INT1
-#define SLEEP_INT_CLR	CLR_INT2
-
-#define ENABLE_RX_VMM   (SEL_VMM_TBL1 | EN_VMM)
-#define ENABLE_TX_VMM   (SEL_VMM_TBL0 | EN_VMM)
+#define CLR_INT0		BIT(0)
+#define CLR_INT1		BIT(1)
+#define CLR_INT2		BIT(2)
+#define CLR_INT3		BIT(3)
+#define CLR_INT4		BIT(4)
+#define CLR_INT5		BIT(5)
+#define SEL_VMM_TBL0		BIT(6)
+#define SEL_VMM_TBL1		BIT(7)
+#define EN_VMM			BIT(8)
+
+#define DATA_INT_EXT		INT_0
+#define PLL_INT_EXT		INT_1
+#define SLEEP_INT_EXT		INT_2
+#define ALL_INT_EXT		(DATA_INT_EXT | PLL_INT_EXT | SLEEP_INT_EXT)
+#define NUM_INT_EXT		3
+
+#define DATA_INT_CLR		CLR_INT0
+#define PLL_INT_CLR		CLR_INT1
+#define SLEEP_INT_CLR		CLR_INT2
+
+#define ENABLE_RX_VMM		(SEL_VMM_TBL1 | EN_VMM)
+#define ENABLE_TX_VMM		(SEL_VMM_TBL0 | EN_VMM)
 
 
 /*time for expiring the semaphores of cfg packets*/
@@ -276,7 +280,7 @@ typedef struct {
  *
  ********************************************/
 
-#define MAX_CFG_FRAME_SIZE 1468
+#define MAX_CFG_FRAME_SIZE	1468
 
 typedef struct {
 	u8 ether_header[14];
Signature · 1 line
1.9.1
author
#8 lore raw

PATCH 58/73 staging: wilc1000: fixes prefer using the BIT macro

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch fixes the warning reported by checkpatch.pl for prefer using the BIT macro.
And, removes unnecessary bit increase defines.

---
 drivers/staging/wilc1000/wilc_wlan.h | 39 +++++++++++++-----------------------
 1 file changed, 14 insertions(+), 25 deletions(-)
drivers/staging/wilc1000/wilc_wlan.h +14 -25
index ba70630..6ca2544 100644
@@ -110,25 +110,14 @@
 #define WILC_GP_REG_0			0x149c
 #define WILC_GP_REG_1			0x14a0
 
-#define rHAVE_SDIO_IRQ_GPIO_BIT		0
-#define rHAVE_USE_PMU_BIT		1
-#define rHAVE_SLEEP_CLK_SRC_RTC_BIT	2
-#define rHAVE_SLEEP_CLK_SRC_XO_BIT	3
-#define rHAVE_EXT_PA_INV_TX_RX_BIT	4
-#define rHAVE_LEGACY_RF_SETTINGS_BIT	5
-#define rHAVE_XTAL_24_BIT		6
-#define rHAVE_DISABLE_WILC_UART_BIT	7
-
-
-#define WILC_HAVE_SDIO_IRQ_GPIO		(1 << rHAVE_SDIO_IRQ_GPIO_BIT)
-#define WILC_HAVE_USE_PMU		(1 << rHAVE_USE_PMU_BIT)
-#define WILC_HAVE_SLEEP_CLK_SRC_RTC	(1 << rHAVE_SLEEP_CLK_SRC_RTC_BIT)
-#define WILC_HAVE_SLEEP_CLK_SRC_XO	(1 << rHAVE_SLEEP_CLK_SRC_XO_BIT)
-#define WILC_HAVE_EXT_PA_INV_TX_RX	(1 << rHAVE_EXT_PA_INV_TX_RX_BIT)
-#define WILC_HAVE_LEGACY_RF_SETTINGS	(1 << rHAVE_LEGACY_RF_SETTINGS_BIT)
-#define WILC_HAVE_XTAL_24		(1 << rHAVE_XTAL_24_BIT)
-#define WILC_HAVE_DISABLE_WILC_UART	(1 << rHAVE_DISABLE_WILC_UART_BIT)
-
+#define WILC_HAVE_SDIO_IRQ_GPIO		BIT(0)
+#define WILC_HAVE_USE_PMU		BIT(1)
+#define WILC_HAVE_SLEEP_CLK_SRC_RTC	BIT(2)
+#define WILC_HAVE_SLEEP_CLK_SRC_XO	BIT(3)
+#define WILC_HAVE_EXT_PA_INV_TX_RX	BIT(4)
+#define WILC_HAVE_LEGACY_RF_SETTINGS	BIT(5)
+#define WILC_HAVE_XTAL_24		BIT(6)
+#define WILC_HAVE_DISABLE_WILC_UART	BIT(7)
 
 /********************************************
  *
@@ -171,12 +160,12 @@
 /*******************************************/
 #define IRG_FLAGS_OFFSET	16
 #define IRQ_DMA_WD_CNT_MASK	((1ul << IRG_FLAGS_OFFSET) - 1)
-#define INT_0			(1 << IRG_FLAGS_OFFSET)
-#define INT_1			(1 << (IRG_FLAGS_OFFSET + 1))
-#define INT_2			(1 << (IRG_FLAGS_OFFSET + 2))
-#define INT_3			(1 << (IRG_FLAGS_OFFSET + 3))
-#define INT_4			(1 << (IRG_FLAGS_OFFSET + 4))
-#define INT_5			(1 << (IRG_FLAGS_OFFSET + 5))
+#define INT_0			BIT(IRG_FLAGS_OFFSET)
+#define INT_1			BIT(IRG_FLAGS_OFFSET + 1)
+#define INT_2			BIT(IRG_FLAGS_OFFSET + 2)
+#define INT_3			BIT(IRG_FLAGS_OFFSET + 3)
+#define INT_4			BIT(IRG_FLAGS_OFFSET + 4)
+#define INT_5			BIT(IRG_FLAGS_OFFSET + 5)
 #define MAX_NUM_INT		6
 
 /*******************************************/
Signature · 1 line
1.9.1
author
#9 lore raw

PATCH 59/73 staging: wilc1000: fixes please don't use multiple blank lines

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch fixes the checks reported by checkpatch.pl for Please don't use multiple blank lines.

---
 drivers/staging/wilc1000/wilc_wlan.h | 8 --------
 1 file changed, 8 deletions(-)
drivers/staging/wilc1000/wilc_wlan.h +0 -8
index 6ca2544..74f6210 100644
@@ -1,11 +1,7 @@
 #ifndef WILC_WLAN_H
 #define WILC_WLAN_H
 
-
-
 #define ISWILC1000(id)			((id & 0xfffff000) == 0x100000 ? 1 : 0)
-
-
 /********************************************
  *
  *      Mac eth header length
@@ -140,8 +136,6 @@
 #else
 #define WILC_PLL_TO		2
 #endif
-
-
 #define ABORT_INT		BIT(31)
 
 /*******************************************/
@@ -203,8 +197,6 @@
 
 #define ENABLE_RX_VMM		(SEL_VMM_TBL1 | EN_VMM)
 #define ENABLE_TX_VMM		(SEL_VMM_TBL0 | EN_VMM)
-
-
 /*time for expiring the semaphores of cfg packets*/
 #define CFG_PKTS_TIMEOUT	2000
 /********************************************
Signature · 1 line
1.9.1
author
#10 lore raw

PATCH 60/73 staging: wilc1000: remove typedef from wilc_cfg_frame_t

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch removes typedef from the struct wilc_cfg_frame_t and renames it to wilc_cfg_frame.

---
 drivers/staging/wilc1000/wilc_wlan.c | 4 ++--
 drivers/staging/wilc1000/wilc_wlan.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +2 -2
index 283c506..c61048b 100644
@@ -11,7 +11,7 @@ typedef struct {
 	wilc_wlan_io_func_t io_func;
 	wilc_hif_func_t hif_func;
 	int cfg_frame_in_use;
-	wilc_cfg_frame_t cfg_frame;
+	struct wilc_cfg_frame cfg_frame;
 	u32 cfg_frame_offset;
 	int cfg_seq_no;
 
@@ -1462,7 +1462,7 @@ void wilc_wlan_cleanup(struct net_device *dev)
 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;
+	struct wilc_cfg_frame *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)drv_handler;
drivers/staging/wilc1000/wilc_wlan.h +2 -2
index 74f6210..d15c848 100644
@@ -263,13 +263,13 @@ typedef struct {
 
 #define MAX_CFG_FRAME_SIZE	1468
 
-typedef struct {
+struct wilc_cfg_frame {
 	u8 ether_header[14];
 	u8 ip_header[20];
 	u8 udp_header[8];
 	u8 wid_header[8];
 	u8 frame[MAX_CFG_FRAME_SIZE];
-} wilc_cfg_frame_t;
+};
 
 typedef struct {
 	int (*wlan_tx)(u8 *, u32, wilc_tx_complete_func_t);
Signature · 1 line
1.9.1
author
#11 lore raw

PATCH 61/73 staging: wilc1000: remove unused typedef wilc_wlan_cfg_func_t

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch removes unused typedef wilc_wlan_cfg_func_t of wilc_wlan.h.

---
 drivers/staging/wilc1000/wilc_wlan.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/wilc1000/wilc_wlan.h +0 -4
index d15c848..6c784fd 100644
@@ -272,10 +272,6 @@ struct wilc_cfg_frame {
 };
 
 typedef struct {
-	int (*wlan_tx)(u8 *, u32, wilc_tx_complete_func_t);
-} wilc_wlan_cfg_func_t;
-
-typedef struct {
 	int type;
 	u32 seq_no;
 } wilc_cfg_rsp_t;
Signature · 1 line
1.9.1
author
#12 lore raw

PATCH 62/73 staging: wilc1000: remove typedef from wilc_cfg_rsp_t

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch removes typedef from the struct wilc_cfg_rsp_t and renames it to wilc_cfg_rsp.

---
 drivers/staging/wilc1000/wilc_wlan.c     | 2 +-
 drivers/staging/wilc1000/wilc_wlan.h     | 4 ++--
 drivers/staging/wilc1000/wilc_wlan_cfg.c | 2 +-
 drivers/staging/wilc1000/wilc_wlan_cfg.h | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index c61048b..7b8e70b 100644
@@ -1023,7 +1023,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 						has_packet = 1;
 					}
 				} else {
-					wilc_cfg_rsp_t rsp;
+					struct wilc_cfg_rsp rsp;
 
 					wilc_wlan_cfg_indicate_rx(&buffer[pkt_offset + offset], pkt_len, &rsp);
 					if (rsp.type == WILC_CFG_RSP) {
drivers/staging/wilc1000/wilc_wlan.h +2 -2
index 6c784fd..368b7ff 100644
@@ -271,10 +271,10 @@ struct wilc_cfg_frame {
 	u8 frame[MAX_CFG_FRAME_SIZE];
 };
 
-typedef struct {
+struct wilc_cfg_rsp {
 	int type;
 	u32 seq_no;
-} wilc_cfg_rsp_t;
+};
 
 int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size);
 int wilc_wlan_start(void);
drivers/staging/wilc1000/wilc_wlan_cfg.c +1 -1
index a34a81c..e237963 100644
@@ -505,7 +505,7 @@ int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size)
 	return ret;
 }
 
-int wilc_wlan_cfg_indicate_rx(u8 *frame, int size, wilc_cfg_rsp_t *rsp)
+int wilc_wlan_cfg_indicate_rx(u8 *frame, int size, struct wilc_cfg_rsp *rsp)
 {
 	int ret = 1;
 	u8 msg_type;
drivers/staging/wilc1000/wilc_wlan_cfg.h +1 -1
index 30e60ec..443b2d5 100644
@@ -33,7 +33,7 @@ typedef struct {
 int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, u8 *buf, int size);
 int wilc_wlan_cfg_get_wid(u8 *frame, u32 offset, u16 id);
 int wilc_wlan_cfg_get_wid_value(u16 wid, u8 *buffer, u32 buffer_size);
-int wilc_wlan_cfg_indicate_rx(u8 *frame, int size, wilc_cfg_rsp_t *rsp);
+int wilc_wlan_cfg_indicate_rx(u8 *frame, int size, struct wilc_cfg_rsp *rsp);
 int wilc_wlan_cfg_init(wilc_debug_func func);
 
 #endif
Signature · 1 line
1.9.1
author
#13 lore raw

PATCH 63/73 staging: wilc1000: remove typedef from wilc_hif_func_t

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch removes typedef from the struct wilc_hif_func_t and renames it to wilc_hif_func.

---
 drivers/staging/wilc1000/wilc_sdio.c |  2 +-
 drivers/staging/wilc1000/wilc_spi.c  |  2 +-
 drivers/staging/wilc1000/wilc_wlan.c | 10 +++++-----
 drivers/staging/wilc1000/wilc_wlan.h |  4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/wilc1000/wilc_sdio.c +1 -1
index 300c571..cfa76b2 100644
@@ -992,7 +992,7 @@ static int sdio_sync_ext(int nint /*  how mant interrupts to enable. */)
  *
  ********************************************/
 
-wilc_hif_func_t hif_sdio = {
+struct wilc_hif_func hif_sdio = {
 	sdio_init,
 	sdio_deinit,
 	sdio_read_reg,
drivers/staging/wilc1000/wilc_spi.c +1 -1
index 599508b..b09b3bd 100644
@@ -1256,7 +1256,7 @@ static int spi_sync_ext(int nint /*  how mant interrupts to enable. */)
  *      Global spi HIF function table
  *
  ********************************************/
-wilc_hif_func_t hif_spi = {
+struct wilc_hif_func hif_spi = {
 	spi_init,
 	spi_deinit,
 	spi_read_reg,
drivers/staging/wilc1000/wilc_wlan.c +5 -5
index 7b8e70b..b6d784b 100644
@@ -2,14 +2,14 @@
 #include "wilc_wfi_netdevice.h"
 #include "wilc_wlan_cfg.h"
 
-extern wilc_hif_func_t hif_sdio;
-extern wilc_hif_func_t hif_spi;
+extern struct wilc_hif_func hif_sdio;
+extern struct wilc_hif_func hif_spi;
 u32 wilc_get_chipid(u8 update);
 
 typedef struct {
 	int quit;
 	wilc_wlan_io_func_t io_func;
-	wilc_hif_func_t hif_func;
+	struct wilc_hif_func hif_func;
 	int cfg_frame_in_use;
 	struct wilc_cfg_frame cfg_frame;
 	u32 cfg_frame_offset;
@@ -1665,7 +1665,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 			goto _fail_;
 		}
 		memcpy((void *)&g_wlan.hif_func, &hif_sdio,
-		       sizeof(wilc_hif_func_t));
+		       sizeof(struct wilc_hif_func));
 	} else {
 		if ((inp->io_func.io_type & 0x1) == HIF_SPI) {
 			if (!hif_spi.hif_init(inp, wilc_debug)) {
@@ -1673,7 +1673,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
 				goto _fail_;
 			}
 			memcpy((void *)&g_wlan.hif_func, &hif_spi,
-			       sizeof(wilc_hif_func_t));
+			       sizeof(struct wilc_hif_func));
 		} else {
 			ret = -EIO;
 			goto _fail_;
drivers/staging/wilc1000/wilc_wlan.h +2 -2
index 368b7ff..ff4872f 100644
@@ -236,7 +236,7 @@ struct rxq_entry_t {
  *
  ********************************************/
 
-typedef struct {
+struct wilc_hif_func {
 	int (*hif_init)(wilc_wlan_inp_t *, wilc_debug_func);
 	int (*hif_deinit)(void *);
 	int (*hif_read_reg)(u32, u32 *);
@@ -253,7 +253,7 @@ typedef struct {
 	int (*hif_sync_ext)(int);
 	void (*hif_set_max_bus_speed)(void);
 	void (*hif_set_default_bus_speed)(void);
-} wilc_hif_func_t;
+};
 
 /********************************************
  *
Signature · 1 line
1.9.1
author
#14 lore raw

PATCH 64/73 staging: wilc1000: rename Handle_SetChannel function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_SetChannel function to handle_set_channel to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/host_interface.c +2 -2
index 7014915..16396e5 100644
@@ -323,7 +323,7 @@ static struct host_if_drv *get_handler_from_id(int id)
 	return wfidrv_list[id];
 }
 
-static s32 Handle_SetChannel(struct host_if_drv *hif_drv,
+static s32 handle_set_channel(struct host_if_drv *hif_drv,
 			      struct channel_attr *hif_set_ch)
 {
 	s32 result = 0;
@@ -2893,7 +2893,7 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_SET_CHANNEL:
-			Handle_SetChannel(msg.drv, &msg.body.channel_info);
+			handle_set_channel(msg.drv, &msg.body.channel_info);
 			break;
 
 		case HOST_IF_MSG_DISCONNECT:
Signature · 1 line
1.9.1
author
#15 lore raw

PATCH 65/73 staging: wilc1000: rename Handle_SetWfiDrvHandler function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_SetWfiDrvHandler function to handle_set_wfi_drv_handler to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -4
index 16396e5..dcaf0eb 100644
@@ -347,8 +347,8 @@ static s32 handle_set_channel(struct host_if_drv *hif_drv,
 	return result;
 }
 
-static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
-				    struct drv_handler *hif_drv_handler)
+static s32 handle_set_wfi_drv_handler(struct host_if_drv *hif_drv,
+				      struct drv_handler *hif_drv_handler)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2970,8 +2970,7 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_SET_WFIDRV_HANDLER:
-			Handle_SetWfiDrvHandler(msg.drv,
-						&msg.body.drv);
+			handle_set_wfi_drv_handler(msg.drv, &msg.body.drv);
 			break;
 
 		case HOST_IF_MSG_SET_OPERATION_MODE:
Signature · 1 line
1.9.1
author
#16 lore raw

PATCH 66/73 staging: wilc1000: rename Handle_SetOperationMode function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_SetOperationMode function to handle_set_operation_mode to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -3
index dcaf0eb..504763e 100644
@@ -371,8 +371,8 @@ static s32 handle_set_wfi_drv_handler(struct host_if_drv *hif_drv,
 	return result;
 }
 
-static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
-				    struct op_mode *hif_op_mode)
+static s32 handle_set_operation_mode(struct host_if_drv *hif_drv,
+				     struct op_mode *hif_op_mode)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2974,7 +2974,7 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_SET_OPERATION_MODE:
-			Handle_SetOperationMode(msg.drv, &msg.body.mode);
+			handle_set_operation_mode(msg.drv, &msg.body.mode);
 			break;
 
 		case HOST_IF_MSG_SET_IPADDRESS:
Signature · 1 line
1.9.1
author
#17 lore raw

PATCH 67/73 staging: wilc1000: rename Handle_set_IPAddress function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_set_IPAddress function to handle_set_ip_address to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/host_interface.c +4 -2
index 504763e..4612723 100644
@@ -396,7 +396,7 @@ static s32 handle_set_operation_mode(struct host_if_drv *hif_drv,
 	return result;
 }
 
-s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
+s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2979,7 +2979,9 @@ static int hostIFthread(void *pvArg)
 
 		case HOST_IF_MSG_SET_IPADDRESS:
 			PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
-			Handle_set_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx);
+			handle_set_ip_address(msg.drv,
+					      msg.body.ip_info.ip_addr,
+					      msg.body.ip_info.idx);
 			break;
 
 		case HOST_IF_MSG_GET_IPADDRESS:
Signature · 1 line
1.9.1
author
#18 lore raw

PATCH 68/73 staging: wilc1000: rename Handle_get_IPAddress function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_get_IPAddress function to handle_get_ip_address to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.c +2 -2
old mode 100644
new mode 100755
index 4612723..9c4c0b2
@@ -430,7 +430,7 @@ s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
 	return result;
 }
 
-s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 idx)
+s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2986,7 +2986,7 @@ static int hostIFthread(void *pvArg)
 
 		case HOST_IF_MSG_GET_IPADDRESS:
 			PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
-			Handle_get_IPAddress(msg.drv, msg.body.ip_info.idx);
+			handle_get_ip_address(msg.drv, msg.body.ip_info.idx);
 			break;
 
 		case HOST_IF_MSG_SET_MAC_ADDRESS:
Signature · 1 line
1.9.1
author
#19 lore raw

PATCH 69/73 staging: wilc1000: rename Handle_SetMacAddress function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_SetMacAddress function to handle_set_mac_address to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
 mode change 100755 => 100644 drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.c +4 -3
old mode 100755
new mode 100644
index 9c4c0b2..2388e2d
@@ -464,8 +464,8 @@ s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
 	return result;
 }
 
-static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
-				struct set_mac_addr *set_mac_addr)
+static s32 handle_set_mac_address(struct host_if_drv *hif_drv,
+				  struct set_mac_addr *set_mac_addr)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2990,7 +2990,8 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_SET_MAC_ADDRESS:
-			Handle_SetMacAddress(msg.drv, &msg.body.set_mac_info);
+			handle_set_mac_address(msg.drv,
+					       &msg.body.set_mac_info);
 			break;
 
 		case HOST_IF_MSG_GET_MAC_ADDRESS:
Signature · 1 line
1.9.1
author
#20 lore raw

PATCH 70/73 staging: wilc1000: rename Handle_GetMacAddress function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_GetMacAddress function to handle_get_mac_address to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.c +4 -3
old mode 100644
new mode 100755
index 2388e2d..cbc53bc
@@ -494,8 +494,8 @@ static s32 handle_set_mac_address(struct host_if_drv *hif_drv,
 	return result;
 }
 
-static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
-				struct get_mac_addr *get_mac_addr)
+static s32 handle_get_mac_address(struct host_if_drv *hif_drv,
+				  struct get_mac_addr *get_mac_addr)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -2995,7 +2995,8 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_GET_MAC_ADDRESS:
-			Handle_GetMacAddress(msg.drv, &msg.body.get_mac_info);
+			handle_get_mac_address(msg.drv,
+					       &msg.body.get_mac_info);
 			break;
 
 		case HOST_IF_MSG_REMAIN_ON_CHAN:
Signature · 1 line
1.9.1
author
#21 lore raw

PATCH 71/73 staging: wilc1000: rename Handle_CfgParam function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames Handle_CfgParam function to handle_cfg_param to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
 mode change 100755 => 100644 drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.c +3 -4
old mode 100755
new mode 100644
index cbc53bc..4c91ae2
@@ -517,8 +517,8 @@ static s32 handle_get_mac_address(struct host_if_drv *hif_drv,
 	return result;
 }
 
-static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
-			   struct cfg_param_attr *cfg_param_attr)
+static s32 handle_cfg_param(struct host_if_drv *hif_drv,
+			    struct cfg_param_attr *cfg_param_attr)
 {
 	s32 result = 0;
 	struct wid strWIDList[32];
@@ -2888,8 +2888,7 @@ static int hostIFthread(void *pvArg)
 			break;
 
 		case HOST_IF_MSG_CFG_PARAMS:
-
-			Handle_CfgParam(msg.drv, &msg.body.cfg_info);
+			handle_cfg_param(msg.drv, &msg.body.cfg_info);
 			break;
 
 		case HOST_IF_MSG_SET_CHANNEL:
Signature · 1 line
1.9.1
author
#22 lore raw

PATCH 72/73 staging: wilc1000: rename strWIDList of handle_cfg_param function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames strWIDList variable of handle_cfg_param function to wid_list to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 149 +++++++++++++++---------------
 1 file changed, 74 insertions(+), 75 deletions(-)
drivers/staging/wilc1000/host_interface.c +74 -75
index 4c91ae2..588a027 100644
@@ -521,7 +521,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 			    struct cfg_param_attr *cfg_param_attr)
 {
 	s32 result = 0;
-	struct wid strWIDList[32];
+	struct wid wid_list[32];
 	u8 u8WidCnt = 0;
 
 	down(&hif_drv->sem_cfg_values);
@@ -530,10 +530,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 
 	if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
 		if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
-			strWIDList[u8WidCnt].id = WID_BSS_TYPE;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_BSS_TYPE;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->cfg_attr_info.bss_type;
 		} else {
 			PRINT_ER("check value 6 over\n");
@@ -546,10 +546,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 		if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
 		    cfg_param_attr->cfg_attr_info.auth_type == 2 ||
 		    cfg_param_attr->cfg_attr_info.auth_type == 5) {
-			strWIDList[u8WidCnt].id = WID_AUTH_TYPE;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_AUTH_TYPE;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->cfg_attr_info.auth_type;
 		} else {
 			PRINT_ER("Impossible value \n");
@@ -561,10 +561,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
 		if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
 		    cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
-			strWIDList[u8WidCnt].id = WID_AUTH_TIMEOUT;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_AUTH_TIMEOUT;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.auth_timeout = cfg_param_attr->cfg_attr_info.auth_timeout;
 		} else {
 			PRINT_ER("Range(1 ~ 65535) over\n");
@@ -575,10 +575,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & POWER_MANAGEMENT) {
 		if (cfg_param_attr->cfg_attr_info.power_mgmt_mode < 5) {
-			strWIDList[u8WidCnt].id = WID_POWER_MANAGEMENT;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_POWER_MANAGEMENT;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode;
 		} else {
 			PRINT_ER("Invalide power mode\n");
@@ -590,10 +590,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & RETRY_SHORT) {
 		if (cfg_param_attr->cfg_attr_info.short_retry_limit > 0 &&
 		    cfg_param_attr->cfg_attr_info.short_retry_limit < 256) {
-			strWIDList[u8WidCnt].id = WID_SHORT_RETRY_LIMIT;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_SHORT_RETRY_LIMIT;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.short_retry_limit = cfg_param_attr->cfg_attr_info.short_retry_limit;
 		} else {
 			PRINT_ER("Range(1~256) over\n");
@@ -605,11 +605,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & RETRY_LONG) {
 		if (cfg_param_attr->cfg_attr_info.long_retry_limit > 0 &&
 		    cfg_param_attr->cfg_attr_info.long_retry_limit < 256) {
-			strWIDList[u8WidCnt].id = WID_LONG_RETRY_LIMIT;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;
-
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_LONG_RETRY_LIMIT;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.long_retry_limit = cfg_param_attr->cfg_attr_info.long_retry_limit;
 		} else {
 			PRINT_ER("Range(1~256) over\n");
@@ -621,10 +620,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & FRAG_THRESHOLD) {
 		if (cfg_param_attr->cfg_attr_info.frag_threshold > 255 &&
 		    cfg_param_attr->cfg_attr_info.frag_threshold < 7937) {
-			strWIDList[u8WidCnt].id = WID_FRAG_THRESHOLD;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_FRAG_THRESHOLD;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.frag_threshold = cfg_param_attr->cfg_attr_info.frag_threshold;
 		} else {
 			PRINT_ER("Threshold Range fail\n");
@@ -636,10 +635,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & RTS_THRESHOLD) {
 		if (cfg_param_attr->cfg_attr_info.rts_threshold > 255 &&
 		    cfg_param_attr->cfg_attr_info.rts_threshold < 65536) {
-			strWIDList[u8WidCnt].id = WID_RTS_THRESHOLD;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_RTS_THRESHOLD;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.rts_threshold = cfg_param_attr->cfg_attr_info.rts_threshold;
 		} else {
 			PRINT_ER("Threshold Range fail\n");
@@ -650,10 +649,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & PREAMBLE) {
 		if (cfg_param_attr->cfg_attr_info.preamble_type < 3) {
-			strWIDList[u8WidCnt].id = WID_PREAMBLE;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_PREAMBLE;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.preamble_type = cfg_param_attr->cfg_attr_info.preamble_type;
 		} else {
 			PRINT_ER("Preamle Range(0~2) over\n");
@@ -664,10 +663,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & SHORT_SLOT_ALLOWED) {
 		if (cfg_param_attr->cfg_attr_info.short_slot_allowed < 2) {
-			strWIDList[u8WidCnt].id = WID_SHORT_SLOT_ALLOWED;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_SHORT_SLOT_ALLOWED;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->cfg_attr_info.short_slot_allowed;
 		} else {
 			PRINT_ER("Short slot(2) over\n");
@@ -678,10 +677,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & TXOP_PROT_DISABLE) {
 		if (cfg_param_attr->cfg_attr_info.txop_prot_disabled < 2) {
-			strWIDList[u8WidCnt].id = WID_11N_TXOP_PROT_DISABLE;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_11N_TXOP_PROT_DISABLE;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->cfg_attr_info.txop_prot_disabled;
 		} else {
 			PRINT_ER("TXOP prot disable\n");
@@ -693,10 +692,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & BEACON_INTERVAL) {
 		if (cfg_param_attr->cfg_attr_info.beacon_interval > 0 &&
 		    cfg_param_attr->cfg_attr_info.beacon_interval < 65536) {
-			strWIDList[u8WidCnt].id = WID_BEACON_INTERVAL;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_BEACON_INTERVAL;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.beacon_interval = cfg_param_attr->cfg_attr_info.beacon_interval;
 		} else {
 			PRINT_ER("Beacon interval(1~65535) fail\n");
@@ -708,10 +707,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & DTIM_PERIOD) {
 		if (cfg_param_attr->cfg_attr_info.dtim_period > 0 &&
 		    cfg_param_attr->cfg_attr_info.dtim_period < 256) {
-			strWIDList[u8WidCnt].id = WID_DTIM_PERIOD;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_DTIM_PERIOD;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.dtim_period = cfg_param_attr->cfg_attr_info.dtim_period;
 		} else {
 			PRINT_ER("DTIM range(1~255) fail\n");
@@ -722,10 +721,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY) {
 		if (cfg_param_attr->cfg_attr_info.site_survey_enabled < 3) {
-			strWIDList[u8WidCnt].id = WID_SITE_SURVEY;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
-			strWIDList[u8WidCnt].type = WID_CHAR;
-			strWIDList[u8WidCnt].size = sizeof(char);
+			wid_list[u8WidCnt].id = WID_SITE_SURVEY;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
+			wid_list[u8WidCnt].type = WID_CHAR;
+			wid_list[u8WidCnt].size = sizeof(char);
 			hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->cfg_attr_info.site_survey_enabled;
 		} else {
 			PRINT_ER("Site survey disable\n");
@@ -737,10 +736,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY_SCAN_TIME) {
 		if (cfg_param_attr->cfg_attr_info.site_survey_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.site_survey_scan_time < 65536) {
-			strWIDList[u8WidCnt].id = WID_SITE_SURVEY_SCAN_TIME;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_SITE_SURVEY_SCAN_TIME;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->cfg_attr_info.site_survey_scan_time;
 		} else {
 			PRINT_ER("Site survey scan time(1~65535) over\n");
@@ -752,10 +751,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & ACTIVE_SCANTIME) {
 		if (cfg_param_attr->cfg_attr_info.active_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.active_scan_time < 65536) {
-			strWIDList[u8WidCnt].id = WID_ACTIVE_SCAN_TIME;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_ACTIVE_SCAN_TIME;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.active_scan_time = cfg_param_attr->cfg_attr_info.active_scan_time;
 		} else {
 			PRINT_ER("Active scan time(1~65535) over\n");
@@ -767,10 +766,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 	if (cfg_param_attr->cfg_attr_info.flag & PASSIVE_SCANTIME) {
 		if (cfg_param_attr->cfg_attr_info.passive_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.passive_scan_time < 65536) {
-			strWIDList[u8WidCnt].id = WID_PASSIVE_SCAN_TIME;
-			strWIDList[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_PASSIVE_SCAN_TIME;
+			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.passive_scan_time = cfg_param_attr->cfg_attr_info.passive_scan_time;
 		} else {
 			PRINT_ER("Passive scan time(1~65535) over\n");
@@ -788,10 +787,10 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 		    || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12
 		    || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24
 		    || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
-			strWIDList[u8WidCnt].id = WID_CURRENT_TX_RATE;
-			strWIDList[u8WidCnt].val = (s8 *)&curr_tx_rate;
-			strWIDList[u8WidCnt].type = WID_SHORT;
-			strWIDList[u8WidCnt].size = sizeof(u16);
+			wid_list[u8WidCnt].id = WID_CURRENT_TX_RATE;
+			wid_list[u8WidCnt].val = (s8 *)&curr_tx_rate;
+			wid_list[u8WidCnt].type = WID_SHORT;
+			wid_list[u8WidCnt].size = sizeof(u16);
 			hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate;
 		} else {
 			PRINT_ER("out of TX rate\n");
@@ -801,7 +800,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 		u8WidCnt++;
 	}
 
-	result = send_config_pkt(SET_CFG, strWIDList, u8WidCnt,
+	result = send_config_pkt(SET_CFG, wid_list, u8WidCnt,
 				 get_id_from_handler(hif_drv));
 
 	if (result)
Signature · 1 line
1.9.1
author
#23 lore raw

PATCH 73/73 staging: wilc1000: rename u8WidCnt of handle_cfg_param function

In reply to Glen Lee

From: Leo Kim <[email protected]>

This patch renames u8WidCnt variable of handle_cfg_param function to wid_cnt to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 184 +++++++++++++++---------------
 1 file changed, 92 insertions(+), 92 deletions(-)
drivers/staging/wilc1000/host_interface.c +92 -92
index 588a027..1a334ae 100644
@@ -522,7 +522,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 {
 	s32 result = 0;
 	struct wid wid_list[32];
-	u8 u8WidCnt = 0;
+	u8 wid_cnt = 0;
 
 	down(&hif_drv->sem_cfg_values);
 
@@ -530,253 +530,253 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 
 	if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
 		if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
-			wid_list[u8WidCnt].id = WID_BSS_TYPE;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_BSS_TYPE;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->cfg_attr_info.bss_type;
 		} else {
 			PRINT_ER("check value 6 over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & AUTH_TYPE) {
 		if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
 		    cfg_param_attr->cfg_attr_info.auth_type == 2 ||
 		    cfg_param_attr->cfg_attr_info.auth_type == 5) {
-			wid_list[u8WidCnt].id = WID_AUTH_TYPE;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_AUTH_TYPE;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->cfg_attr_info.auth_type;
 		} else {
 			PRINT_ER("Impossible value \n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
 		if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
 		    cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
-			wid_list[u8WidCnt].id = WID_AUTH_TIMEOUT;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_AUTH_TIMEOUT;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.auth_timeout = cfg_param_attr->cfg_attr_info.auth_timeout;
 		} else {
 			PRINT_ER("Range(1 ~ 65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & POWER_MANAGEMENT) {
 		if (cfg_param_attr->cfg_attr_info.power_mgmt_mode < 5) {
-			wid_list[u8WidCnt].id = WID_POWER_MANAGEMENT;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_POWER_MANAGEMENT;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode;
 		} else {
 			PRINT_ER("Invalide power mode\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & RETRY_SHORT) {
 		if (cfg_param_attr->cfg_attr_info.short_retry_limit > 0 &&
 		    cfg_param_attr->cfg_attr_info.short_retry_limit < 256) {
-			wid_list[u8WidCnt].id = WID_SHORT_RETRY_LIMIT;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_SHORT_RETRY_LIMIT;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.short_retry_limit = cfg_param_attr->cfg_attr_info.short_retry_limit;
 		} else {
 			PRINT_ER("Range(1~256) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & RETRY_LONG) {
 		if (cfg_param_attr->cfg_attr_info.long_retry_limit > 0 &&
 		    cfg_param_attr->cfg_attr_info.long_retry_limit < 256) {
-			wid_list[u8WidCnt].id = WID_LONG_RETRY_LIMIT;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_LONG_RETRY_LIMIT;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.long_retry_limit = cfg_param_attr->cfg_attr_info.long_retry_limit;
 		} else {
 			PRINT_ER("Range(1~256) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & FRAG_THRESHOLD) {
 		if (cfg_param_attr->cfg_attr_info.frag_threshold > 255 &&
 		    cfg_param_attr->cfg_attr_info.frag_threshold < 7937) {
-			wid_list[u8WidCnt].id = WID_FRAG_THRESHOLD;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_FRAG_THRESHOLD;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.frag_threshold = cfg_param_attr->cfg_attr_info.frag_threshold;
 		} else {
 			PRINT_ER("Threshold Range fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & RTS_THRESHOLD) {
 		if (cfg_param_attr->cfg_attr_info.rts_threshold > 255 &&
 		    cfg_param_attr->cfg_attr_info.rts_threshold < 65536) {
-			wid_list[u8WidCnt].id = WID_RTS_THRESHOLD;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_RTS_THRESHOLD;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.rts_threshold = cfg_param_attr->cfg_attr_info.rts_threshold;
 		} else {
 			PRINT_ER("Threshold Range fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & PREAMBLE) {
 		if (cfg_param_attr->cfg_attr_info.preamble_type < 3) {
-			wid_list[u8WidCnt].id = WID_PREAMBLE;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_PREAMBLE;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.preamble_type = cfg_param_attr->cfg_attr_info.preamble_type;
 		} else {
 			PRINT_ER("Preamle Range(0~2) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & SHORT_SLOT_ALLOWED) {
 		if (cfg_param_attr->cfg_attr_info.short_slot_allowed < 2) {
-			wid_list[u8WidCnt].id = WID_SHORT_SLOT_ALLOWED;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_SHORT_SLOT_ALLOWED;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->cfg_attr_info.short_slot_allowed;
 		} else {
 			PRINT_ER("Short slot(2) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & TXOP_PROT_DISABLE) {
 		if (cfg_param_attr->cfg_attr_info.txop_prot_disabled < 2) {
-			wid_list[u8WidCnt].id = WID_11N_TXOP_PROT_DISABLE;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_11N_TXOP_PROT_DISABLE;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->cfg_attr_info.txop_prot_disabled;
 		} else {
 			PRINT_ER("TXOP prot disable\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & BEACON_INTERVAL) {
 		if (cfg_param_attr->cfg_attr_info.beacon_interval > 0 &&
 		    cfg_param_attr->cfg_attr_info.beacon_interval < 65536) {
-			wid_list[u8WidCnt].id = WID_BEACON_INTERVAL;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_BEACON_INTERVAL;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.beacon_interval = cfg_param_attr->cfg_attr_info.beacon_interval;
 		} else {
 			PRINT_ER("Beacon interval(1~65535) fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & DTIM_PERIOD) {
 		if (cfg_param_attr->cfg_attr_info.dtim_period > 0 &&
 		    cfg_param_attr->cfg_attr_info.dtim_period < 256) {
-			wid_list[u8WidCnt].id = WID_DTIM_PERIOD;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_DTIM_PERIOD;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.dtim_period = cfg_param_attr->cfg_attr_info.dtim_period;
 		} else {
 			PRINT_ER("DTIM range(1~255) fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY) {
 		if (cfg_param_attr->cfg_attr_info.site_survey_enabled < 3) {
-			wid_list[u8WidCnt].id = WID_SITE_SURVEY;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
-			wid_list[u8WidCnt].type = WID_CHAR;
-			wid_list[u8WidCnt].size = sizeof(char);
+			wid_list[wid_cnt].id = WID_SITE_SURVEY;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
+			wid_list[wid_cnt].type = WID_CHAR;
+			wid_list[wid_cnt].size = sizeof(char);
 			hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->cfg_attr_info.site_survey_enabled;
 		} else {
 			PRINT_ER("Site survey disable\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY_SCAN_TIME) {
 		if (cfg_param_attr->cfg_attr_info.site_survey_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.site_survey_scan_time < 65536) {
-			wid_list[u8WidCnt].id = WID_SITE_SURVEY_SCAN_TIME;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_SITE_SURVEY_SCAN_TIME;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->cfg_attr_info.site_survey_scan_time;
 		} else {
 			PRINT_ER("Site survey scan time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & ACTIVE_SCANTIME) {
 		if (cfg_param_attr->cfg_attr_info.active_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.active_scan_time < 65536) {
-			wid_list[u8WidCnt].id = WID_ACTIVE_SCAN_TIME;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_ACTIVE_SCAN_TIME;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.active_scan_time = cfg_param_attr->cfg_attr_info.active_scan_time;
 		} else {
 			PRINT_ER("Active scan time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & PASSIVE_SCANTIME) {
 		if (cfg_param_attr->cfg_attr_info.passive_scan_time > 0 &&
 		    cfg_param_attr->cfg_attr_info.passive_scan_time < 65536) {
-			wid_list[u8WidCnt].id = WID_PASSIVE_SCAN_TIME;
-			wid_list[u8WidCnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_PASSIVE_SCAN_TIME;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.passive_scan_time = cfg_param_attr->cfg_attr_info.passive_scan_time;
 		} else {
 			PRINT_ER("Passive scan time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 	if (cfg_param_attr->cfg_attr_info.flag & CURRENT_TX_RATE) {
 		enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->cfg_attr_info.curr_tx_rate;
@@ -787,20 +787,20 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
 		    || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12
 		    || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24
 		    || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
-			wid_list[u8WidCnt].id = WID_CURRENT_TX_RATE;
-			wid_list[u8WidCnt].val = (s8 *)&curr_tx_rate;
-			wid_list[u8WidCnt].type = WID_SHORT;
-			wid_list[u8WidCnt].size = sizeof(u16);
+			wid_list[wid_cnt].id = WID_CURRENT_TX_RATE;
+			wid_list[wid_cnt].val = (s8 *)&curr_tx_rate;
+			wid_list[wid_cnt].type = WID_SHORT;
+			wid_list[wid_cnt].size = sizeof(u16);
 			hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate;
 		} else {
 			PRINT_ER("out of TX rate\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		u8WidCnt++;
+		wid_cnt++;
 	}
 
-	result = send_config_pkt(SET_CFG, wid_list, u8WidCnt,
+	result = send_config_pkt(SET_CFG, wid_list, wid_cnt,
 				 get_id_from_handler(hif_drv));
 
 	if (result)
Signature · 1 line
1.9.1