提交 fa6b108b 编写于 作者: X Xenia Ragiadakou 提交者: Greg Kroah-Hartman

staging: rtl8192u: fix whitespace in r819xU_cmdpkt.c

This patch fixes whitespaces in r819xU_cmdpkt.c to
follow the kernel coding style and to improve code
readability.

It fixes the spaces around <,=||&&();} and adds or
removes tabs to better align variables.
Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 05cdf47a
...@@ -33,17 +33,12 @@ ...@@ -33,17 +33,12 @@
u32 temp[10];\ u32 temp[10];\
\ \
memcpy(temp, Address, 40);\ memcpy(temp, Address, 40);\
for (i = 0; i <40; i+=4)\ for (i = 0; i < 40; i += 4)\
printk("\r\n %08x", temp[i]);\ printk("\r\n %08x", temp[i]);\
}\ }\
/*---------------------------Define functions---------------------------------*/ /*---------------------------Define functions---------------------------------*/
rt_status rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
SendTxCommandPacket(
struct net_device *dev,
void *pData,
u32 DataLen
)
{ {
rt_status rtStatus = RT_STATUS_SUCCESS; rt_status rtStatus = RT_STATUS_SUCCESS;
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
...@@ -53,23 +48,23 @@ SendTxCommandPacket( ...@@ -53,23 +48,23 @@ SendTxCommandPacket(
//Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ) //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4); skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE; tcb_desc->queue_index = TXCMD_QUEUE;
tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_NORMAL; tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_NORMAL;
tcb_desc->bLastIniPkt = 0; tcb_desc->bLastIniPkt = 0;
skb_reserve(skb, USB_HWDESC_HEADER_LEN); skb_reserve(skb, USB_HWDESC_HEADER_LEN);
ptr_buf = skb_put(skb, DataLen); ptr_buf = skb_put(skb, DataLen);
memcpy(ptr_buf,pData,DataLen); memcpy(ptr_buf, pData, DataLen);
tcb_desc->txbuf_size= (u16)DataLen; tcb_desc->txbuf_size = (u16)DataLen;
if (!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)|| if (!priv->ieee80211->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\ (!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index])) ||\
(priv->ieee80211->queue_stop) ) { (priv->ieee80211->queue_stop)) {
RT_TRACE(COMP_FIRMWARE,"===================NULL packet==================================> tx full!\n"); RT_TRACE(COMP_FIRMWARE, "===================NULL packet==================================> tx full!\n");
skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb); skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
} else { } else {
priv->ieee80211->softmac_hard_start_xmit(skb,dev); priv->ieee80211->softmac_hard_start_xmit(skb, dev);
} }
return rtStatus; return rtStatus;
...@@ -95,11 +90,9 @@ SendTxCommandPacket( ...@@ -95,11 +90,9 @@ SendTxCommandPacket(
* 05/06/2008 amy porting from windows code. * 05/06/2008 amy porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
extern rt_status cmpk_message_handle_tx( extern rt_status cmpk_message_handle_tx(struct net_device *dev,
struct net_device *dev,
u8 *codevirtualaddress, u8 *codevirtualaddress,
u32 packettype, u32 packettype, u32 buffer_len)
u32 buffer_len)
{ {
bool rt_status = true; bool rt_status = true;
...@@ -121,7 +114,7 @@ SendTxCommandPacket( ...@@ -121,7 +114,7 @@ SendTxCommandPacket(
frag_threshold = pfirmware->cmdpacket_frag_thresold; frag_threshold = pfirmware->cmdpacket_frag_thresold;
do { do {
if ((buffer_len - frag_offset) > frag_threshold) { if ((buffer_len - frag_offset) > frag_threshold) {
frag_length = frag_threshold ; frag_length = frag_threshold;
bLastIniPkt = 0; bLastIniPkt = 0;
} else { } else {
...@@ -138,7 +131,7 @@ SendTxCommandPacket( ...@@ -138,7 +131,7 @@ SendTxCommandPacket(
#else #else
skb = dev_alloc_skb(frag_length + 4); skb = dev_alloc_skb(frag_length + 4);
#endif #endif
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE; tcb_desc->queue_index = TXCMD_QUEUE;
tcb_desc->bCmdOrInit = packettype; tcb_desc->bCmdOrInit = packettype;
...@@ -153,23 +146,23 @@ SendTxCommandPacket( ...@@ -153,23 +146,23 @@ SendTxCommandPacket(
* Transform from little endian to big endian * Transform from little endian to big endian
* and pending zero * and pending zero
*/ */
memcpy(seg_ptr,codevirtualaddress,buffer_len); memcpy(seg_ptr, codevirtualaddress, buffer_len);
tcb_desc->txbuf_size= (u16)buffer_len; tcb_desc->txbuf_size = (u16)buffer_len;
if (!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)|| if (!priv->ieee80211->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\ (!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index])) ||\
(priv->ieee80211->queue_stop) ) { (priv->ieee80211->queue_stop)) {
RT_TRACE(COMP_FIRMWARE,"=====================================================> tx full!\n"); RT_TRACE(COMP_FIRMWARE, "=====================================================> tx full!\n");
skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb); skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
} else { } else {
priv->ieee80211->softmac_hard_start_xmit(skb,dev); priv->ieee80211->softmac_hard_start_xmit(skb, dev);
} }
codevirtualaddress += frag_length; codevirtualaddress += frag_length;
frag_offset += frag_length; frag_offset += frag_length;
}while(frag_offset < buffer_len); } while (frag_offset < buffer_len);
return rt_status; return rt_status;
...@@ -194,10 +187,7 @@ SendTxCommandPacket( ...@@ -194,10 +187,7 @@ SendTxCommandPacket(
* 05/12/2008 amy Create Version 0 porting from windows code. * 05/12/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_count_txstatistic(struct net_device *dev, cmpk_txfb_t *pstx_fb)
cmpk_count_txstatistic(
struct net_device *dev,
cmpk_txfb_t *pstx_fb)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
#ifdef ENABLE_PS #ifdef ENABLE_PS
...@@ -278,10 +268,7 @@ cmpk_count_txstatistic( ...@@ -278,10 +268,7 @@ cmpk_count_txstatistic(
* 05/08/2008 amy Create Version 0 porting from windows code. * 05/08/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_handle_tx_feedback(struct net_device *dev, u8 *pmsg)
cmpk_handle_tx_feedback(
struct net_device *dev,
u8 *pmsg)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
cmpk_txfb_t rx_tx_fb; /* */ cmpk_txfb_t rx_tx_fb; /* */
...@@ -303,10 +290,7 @@ cmpk_handle_tx_feedback( ...@@ -303,10 +290,7 @@ cmpk_handle_tx_feedback(
} /* cmpk_Handle_Tx_Feedback */ } /* cmpk_Handle_Tx_Feedback */
void void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
cmdpkt_beacontimerinterrupt_819xusb(
struct net_device *dev
)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
u16 tx_rate; u16 tx_rate;
...@@ -319,11 +303,11 @@ cmdpkt_beacontimerinterrupt_819xusb( ...@@ -319,11 +303,11 @@ cmdpkt_beacontimerinterrupt_819xusb(
tx_rate = 60; tx_rate = 60;
DMESG("send beacon frame tx rate is 6Mbpm\n"); DMESG("send beacon frame tx rate is 6Mbpm\n");
} else { } else {
tx_rate =10; tx_rate = 10;
DMESG("send beacon frame tx rate is 1Mbpm\n"); DMESG("send beacon frame tx rate is 1Mbpm\n");
} }
rtl819xusb_beacon_tx(dev,tx_rate); // HW Beacon rtl819xusb_beacon_tx(dev, tx_rate); // HW Beacon
} }
...@@ -351,10 +335,7 @@ cmdpkt_beacontimerinterrupt_819xusb( ...@@ -351,10 +335,7 @@ cmdpkt_beacontimerinterrupt_819xusb(
* 05/12/2008 amy Add this for rtl8192 porting from windows code. * 05/12/2008 amy Add this for rtl8192 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
cmpk_handle_interrupt_status(
struct net_device *dev,
u8 *pmsg)
{ {
cmpk_intr_sta_t rx_intr_status; /* */ cmpk_intr_sta_t rx_intr_status; /* */
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
...@@ -373,7 +354,7 @@ cmpk_handle_interrupt_status( ...@@ -373,7 +354,7 @@ cmpk_handle_interrupt_status(
// Statistics of beacon for ad-hoc mode. // Statistics of beacon for ad-hoc mode.
if ( priv->ieee80211->iw_mode == IW_MODE_ADHOC) { if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) {
//2 maybe need endian transform? //2 maybe need endian transform?
rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4)); rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4));
...@@ -419,10 +400,7 @@ cmpk_handle_interrupt_status( ...@@ -419,10 +400,7 @@ cmpk_handle_interrupt_status(
* 05/12/2008 amy Create Version 0 porting from windows code. * 05/12/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg)
cmpk_handle_query_config_rx(
struct net_device *dev,
u8 *pmsg)
{ {
cmpk_query_cfg_t rx_query_cfg; /* */ cmpk_query_cfg_t rx_query_cfg; /* */
...@@ -431,7 +409,7 @@ cmpk_handle_query_config_rx( ...@@ -431,7 +409,7 @@ cmpk_handle_query_config_rx(
/* It seems that FW use big endian(MIPS) and DRV use little endian in /* It seems that FW use big endian(MIPS) and DRV use little endian in
windows OS. So we have to read the content byte by byte or transfer windows OS. So we have to read the content byte by byte or transfer
endian type before copy the message copy. */ endian type before copy the message copy. */
rx_query_cfg.cfg_action = (pmsg[4] & 0x80000000)>>31; rx_query_cfg.cfg_action = (pmsg[4] & 0x80000000) >> 31;
rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5; rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5;
rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3; rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3;
rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0; rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0;
...@@ -461,7 +439,7 @@ cmpk_handle_query_config_rx( ...@@ -461,7 +439,7 @@ cmpk_handle_query_config_rx(
* 05/12/2008 amy Create Version 0 porting from windows code. * 05/12/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void cmpk_count_tx_status( struct net_device *dev, static void cmpk_count_tx_status(struct net_device *dev,
cmpk_tx_status_t *pstx_status) cmpk_tx_status_t *pstx_status)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
...@@ -523,10 +501,7 @@ static void cmpk_count_tx_status( struct net_device *dev, ...@@ -523,10 +501,7 @@ static void cmpk_count_tx_status( struct net_device *dev,
* 05/12/2008 amy Create Version 0 porting from windows code. * 05/12/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_handle_tx_status(struct net_device *dev, u8 *pmsg)
cmpk_handle_tx_status(
struct net_device *dev,
u8 *pmsg)
{ {
cmpk_tx_status_t rx_tx_sts; /* */ cmpk_tx_status_t rx_tx_sts; /* */
...@@ -553,10 +528,7 @@ cmpk_handle_tx_status( ...@@ -553,10 +528,7 @@ cmpk_handle_tx_status(
* 05/12/2008 amy Create Version 0 porting from windows code. * 05/12/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg)
cmpk_handle_tx_rate_history(
struct net_device *dev,
u8 *pmsg)
{ {
cmpk_tx_rahis_t *ptxrate; cmpk_tx_rahis_t *ptxrate;
u8 i, j; u8 i, j;
...@@ -584,14 +556,14 @@ cmpk_handle_tx_rate_history( ...@@ -584,14 +556,14 @@ cmpk_handle_tx_rate_history(
for (i = 0; i < (length/4); i++) { for (i = 0; i < (length/4); i++) {
u16 temp1, temp2; u16 temp1, temp2;
temp1 = ptemp[i]&0x0000FFFF; temp1 = ptemp[i] & 0x0000FFFF;
temp2 = ptemp[i]>>16; temp2 = ptemp[i] >> 16;
ptemp[i] = (temp1<<16)|temp2; ptemp[i] = (temp1 << 16) | temp2;
} }
ptxrate = (cmpk_tx_rahis_t *)pmsg; ptxrate = (cmpk_tx_rahis_t *)pmsg;
if (ptxrate == NULL ) if (ptxrate == NULL)
return; return;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
...@@ -600,7 +572,7 @@ cmpk_handle_tx_rate_history( ...@@ -600,7 +572,7 @@ cmpk_handle_tx_rate_history(
priv->stats.txrate.cck[i] += ptxrate->cck[i]; priv->stats.txrate.cck[i] += ptxrate->cck[i];
// Collect OFDM rate packet num // Collect OFDM rate packet num
if (i< 8) if (i < 8)
priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i]; priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i];
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
...@@ -630,9 +602,7 @@ cmpk_handle_tx_rate_history( ...@@ -630,9 +602,7 @@ cmpk_handle_tx_rate_history(
* 05/06/2008 amy Create Version 0 porting from windows code. * 05/06/2008 amy Create Version 0 porting from windows code.
* *
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
extern u32 extern u32 cmpk_message_handle_rx(struct net_device *dev,
cmpk_message_handle_rx(
struct net_device *dev,
struct ieee80211_rx_stats *pstats) struct ieee80211_rx_stats *pstats)
{ {
int total_length; int total_length;
...@@ -642,7 +612,7 @@ cmpk_message_handle_rx( ...@@ -642,7 +612,7 @@ cmpk_message_handle_rx(
/* 0. Check inpt arguments. If is is a command queue message or pointer is /* 0. Check inpt arguments. If is is a command queue message or pointer is
null. */ null. */
if (pstats== NULL) if (pstats == NULL)
return 0; /* This is not a command packet. */ return 0; /* This is not a command packet. */
/* 1. Read received command packet message length from RFD. */ /* 1. Read received command packet message length from RFD. */
...@@ -664,7 +634,7 @@ cmpk_message_handle_rx( ...@@ -664,7 +634,7 @@ cmpk_message_handle_rx(
switch (element_id) { switch (element_id) {
case RX_TX_FEEDBACK: case RX_TX_FEEDBACK:
cmpk_handle_tx_feedback (dev, pcmd_buff); cmpk_handle_tx_feedback(dev, pcmd_buff);
cmd_length = CMPK_RX_TX_FB_SIZE; cmd_length = CMPK_RX_TX_FB_SIZE;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册