Skip to contentSkip to conversation

Staging: rtl8192u: Replace types

PATCH In review Ksenija Stanojevic 2 participants 2 messages Mar 12, 2015 – Mar 16, 2015 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 2/2 Staging: rtl8192u: Replace types

This patch replaces types made by typedefs in r8192U_cmdpkt.h by struct definitions. Also where ever struct was added line was aligned and doesn't exceed 80 character mark and unnecessary tabs were removed.

---
v2: change commit message.

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 35 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 17 deletions(-)
drivers/staging/rtl8192u/r819xU_cmdpkt.c +18 -17
index 545f49e..d75f671 100644
@@ -26,7 +26,7 @@
 #include "r8192U.h"
 #include "r819xU_cmdpkt.h"
 
-rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
+enum rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
 {
 	struct r8192_priv   *priv = ieee80211_priv(dev);
 	struct sk_buff	    *skb;
@@ -77,7 +77,8 @@ rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
  *  05/12/2008		amy	Create Version 0 porting from windows code.
  *
  *---------------------------------------------------------------------------*/
-static void cmpk_count_txstatistic(struct net_device *dev, cmpk_txfb_t *pstx_fb)
+static void cmpk_count_txstatistic(struct net_device *dev,
+				   struct cmpk_txfb *pstx_fb)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 #ifdef ENABLE_PS
@@ -162,7 +163,7 @@ static void cmpk_count_txstatistic(struct net_device *dev, cmpk_txfb_t *pstx_fb)
 static void cmpk_handle_tx_feedback(struct net_device *dev, u8 *pmsg)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
-	cmpk_txfb_t		rx_tx_fb;
+	struct cmpk_txfb rx_tx_fb;
 
 	priv->stats.txfeedback++;
 
@@ -171,7 +172,7 @@ static void cmpk_handle_tx_feedback(struct net_device *dev, u8 *pmsg)
 	   windows OS. So we have to read the content byte by byte or transfer
 	   endian type before copy the message copy. */
 	/* Use pointer to transfer structure memory. */
-	memcpy((u8 *)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t));
+	memcpy((u8 *)&rx_tx_fb, pmsg, sizeof(struct cmpk_txfb));
 	/* 2. Use tx feedback info to count TX statistics. */
 	cmpk_count_txstatistic(dev, &rx_tx_fb);
 	/* Comment previous method for TX statistic function. */
@@ -227,7 +228,7 @@ static void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
  *---------------------------------------------------------------------------*/
 static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
 {
-	cmpk_intr_sta_t		rx_intr_status;	/* */
+	struct cmpk_intr_sta rx_intr_status;	/* */
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
 	DMESG("---> cmpk_Handle_Interrupt_Status()\n");
@@ -237,7 +238,7 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
 	   windows OS. So we have to read the content byte by byte or transfer
 	   endian type before copy the message copy. */
 	rx_intr_status.length = pmsg[1];
-	if (rx_intr_status.length != (sizeof(cmpk_intr_sta_t) - 2)) {
+	if (rx_intr_status.length != (sizeof(struct cmpk_intr_sta) - 2)) {
 		DMESG("cmpk_Handle_Interrupt_Status: wrong length!\n");
 		return;
 	}
@@ -293,7 +294,7 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
  *---------------------------------------------------------------------------*/
 static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg)
 {
-	cmpk_query_cfg_t	rx_query_cfg;
+	struct cmpk_set_cfg rx_query_cfg;
 
 
 	/* 1. Extract TX feedback info from RFD to temp structure buffer. */
@@ -331,7 +332,7 @@ static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg)
  *
  *---------------------------------------------------------------------------*/
 static void cmpk_count_tx_status(struct net_device *dev,
-				 cmpk_tx_status_t *pstx_status)
+				 struct cmpk_tx_status *pstx_status)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
@@ -395,9 +396,9 @@ static void cmpk_count_tx_status(struct net_device *dev,
  *---------------------------------------------------------------------------*/
 static void cmpk_handle_tx_status(struct net_device *dev, u8 *pmsg)
 {
-	cmpk_tx_status_t	rx_tx_sts;
+	struct cmpk_tx_status rx_tx_sts;
 
-	memcpy((void *)&rx_tx_sts, (void *)pmsg, sizeof(cmpk_tx_status_t));
+	memcpy((void *)&rx_tx_sts, (void *)pmsg, sizeof(struct cmpk_tx_status));
 	/* 2. Use tx feedback info to count TX statistics. */
 	cmpk_count_tx_status(dev, &rx_tx_sts);
 
@@ -422,9 +423,9 @@ static void cmpk_handle_tx_status(struct net_device *dev, u8 *pmsg)
  *---------------------------------------------------------------------------*/
 static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg)
 {
-	cmpk_tx_rahis_t	*ptxrate;
+	struct cmpk_tx_rahis *ptxrate;
 	u8		i, j;
-	u16		length = sizeof(cmpk_tx_rahis_t);
+	u16		length = sizeof(struct cmpk_tx_rahis);
 	u32		*ptemp;
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
@@ -452,7 +453,7 @@ static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg)
 		ptemp[i] = (temp1 << 16) | temp2;
 	}
 
-	ptxrate = (cmpk_tx_rahis_t *)pmsg;
+	ptxrate = (struct cmpk_tx_rahis *)pmsg;
 
 	if (ptxrate == NULL)
 		return;
@@ -504,7 +505,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
 	/* 0. Check inpt arguments. If is is a command queue message or
 	   pointer is null. */
 	if (pstats == NULL)
-		return 0;	/* This is not a command packet. */
+		return U32_FALSE;	/* This is not a command packet. */
 
 	/* 1. Read received command packet message length from RFD. */
 	total_length = pstats->Length;
@@ -532,7 +533,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
 
 		case RX_INTERRUPT_STATUS:
 			cmpk_handle_interrupt_status(dev, pcmd_buff);
-			cmd_length = sizeof(cmpk_intr_sta_t);
+			cmd_length = sizeof(struct cmpk_intr_sta);
 			break;
 
 		case BOTH_QUERY_CONFIG:
@@ -560,12 +561,12 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
 
 			RT_TRACE(COMP_ERR, "---->%s():unknown CMD Element\n",
 				 __func__);
-			return 1;	/* This is a command packet. */
+			return U32_TRUE;	/* This is a command packet. */
 		}
 
 		total_length -= cmd_length;
 		pcmd_buff    += cmd_length;
 	}
-	return	1;	/* This is a command packet. */
+	return	U32_TRUE;	/* This is a command packet. */
 
 }
Signature · 1 line
1.9.1
maintainer
#2 lore raw
Quoted 10 lines · Ksenija Stanojevic

This patch replaces types made by typedefs in r8192U_cmdpkt.h by struct definitions. Also where ever struct was added line was aligned and doesn't exceed 80 character mark and unnecessary tabs were removed.

---
v2: change commit message.

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 35 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

This requires your previous patch, which would have broken the build, you can't do that either :(