Skip to contentSkip to conversation

staging: rtl8192u: Remove function

PATCH In review Fabio M. De Francesco 3 participants 6 messages Apr 11, 2021 – Apr 19, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192u: Remove function

Remove cmpk_handle_query_config_rx() because it just initializes a local variable and then returns "void".

---
 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
 1 file changed, 40 deletions(-)
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -40
index 4cece40a92f6..d5a54c2d3086 100644
@@ -249,46 +249,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
 	DMESG("<---- cmpk_handle_interrupt_status()\n");
 }
 
-/*-----------------------------------------------------------------------------
- * Function:    cmpk_handle_query_config_rx()
- *
- * Overview:    The function is responsible for extract the message from
- *		firmware. It will contain dedicated info in
- *		ws-06-0063-rtl8190-command-packet-specification. Please
- *		refer to chapter "Beacon State Element".
- *
- * Input:       u8    *pmsg	-	Message Pointer of the command packet.
- *
- * Output:      NONE
- *
- * Return:      NONE
- *
- * Revised History:
- *  When		Who	Remark
- *  05/12/2008		amy	Create Version 0 porting from windows code.
- *
- *---------------------------------------------------------------------------
- */
-static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg)
-{
-	struct cmpk_query_cfg	rx_query_cfg;
-
-	/* 1. Extract TX feedback info from RFD to temp structure buffer. */
-	/* 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
-	 * endian type before copy the message copy.
-	 */
-	rx_query_cfg.cfg_action		= (pmsg[4] & 0x80) >> 7;
-	rx_query_cfg.cfg_type		= (pmsg[4] & 0x60) >> 5;
-	rx_query_cfg.cfg_size		= (pmsg[4] & 0x18) >> 3;
-	rx_query_cfg.cfg_page		= (pmsg[6] & 0x0F) >> 0;
-	rx_query_cfg.cfg_offset		= pmsg[7];
-	rx_query_cfg.value		= (pmsg[8]  << 24) | (pmsg[9]  << 16) |
-					  (pmsg[10] <<  8) | (pmsg[11] <<  0);
-	rx_query_cfg.mask		= (pmsg[12] << 24) | (pmsg[13] << 16) |
-					  (pmsg[14] <<  8) | (pmsg[15] <<  0);
-}
-
 /*-----------------------------------------------------------------------------
  * Function:	cmpk_count_tx_status()
  *
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 63 lines · Fabio M. De Francesco

Remove cmpk_handle_query_config_rx() because it just initializes a local variable and then returns "void".

---
 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
 1 file changed, 40 deletions(-)
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -40
index 4cece40a92f6..d5a54c2d3086 100644
@@ -249,46 +249,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
 	DMESG("<---- cmpk_handle_interrupt_status()\n");
 }
 
-/*-----------------------------------------------------------------------------
- * Function:    cmpk_handle_query_config_rx()
- *
- * Overview:    The function is responsible for extract the message from
- *		firmware. It will contain dedicated info in
- *		ws-06-0063-rtl8190-command-packet-specification. Please
- *		refer to chapter "Beacon State Element".
- *
- * Input:       u8    *pmsg	-	Message Pointer of the command packet.
- *
- * Output:      NONE
- *
- * Return:      NONE
- *
- * Revised History:
- *  When		Who	Remark
- *  05/12/2008		amy	Create Version 0 porting from windows code.
- *
- *---------------------------------------------------------------------------
- */
-static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg)
-{
-	struct cmpk_query_cfg	rx_query_cfg;
-
-	/* 1. Extract TX feedback info from RFD to temp structure buffer. */
-	/* 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
-	 * endian type before copy the message copy.
-	 */
-	rx_query_cfg.cfg_action		= (pmsg[4] & 0x80) >> 7;
-	rx_query_cfg.cfg_type		= (pmsg[4] & 0x60) >> 5;
-	rx_query_cfg.cfg_size		= (pmsg[4] & 0x18) >> 3;
-	rx_query_cfg.cfg_page		= (pmsg[6] & 0x0F) >> 0;
-	rx_query_cfg.cfg_offset		= pmsg[7];
-	rx_query_cfg.value		= (pmsg[8]  << 24) | (pmsg[9]  << 16) |
-					  (pmsg[10] <<  8) | (pmsg[11] <<  0);
-	rx_query_cfg.mask		= (pmsg[12] << 24) | (pmsg[13] << 16) |
-					  (pmsg[14] <<  8) | (pmsg[15] <<  0);
-}
-
 /*-----------------------------------------------------------------------------
  * Function:	cmpk_count_tx_status()
  *
Signature · 1 line
2.31.1

Always test-build your patches as they can not break the build. You obviously did not do that here, why not?

thanks,

greg k-h

#2 lore raw
Quoted 20 lines · CEST Greg KH
Quoted 19 lines · Fabio M. De Francesco

Remove cmpk_handle_query_config_rx() because it just initializes a local
variable and then returns "void".

---

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
 1 file changed, 40 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
4cece40a92f6..d5a54c2d3086 100644

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -0
@@ -249,46 +249,6 @@ static void cmpk_handle_interrupt_status(struct

net_device *dev, u8 *pmsg)>
DMESG("<---- cmpk_handle_interrupt_status()\n");

Quoted 8 lines
Quoted 8 lines

}

-/*--------------------------------------------------------------------
--------- - * Function: cmpk_handle_query_config_rx()
- *
- * Overview: The function is responsible for extract the message
from - * firmware. It will contain dedicated info in
- * ws-06-0063-rtl8190-command-packet-specification.

Please

Quoted 3 lines
Quoted 3 lines

- * refer to chapter "Beacon State Element".
- *
- * Input: u8 *pmsg - Message Pointer of the

command packet.

Quoted 8 lines
Quoted 8 lines

- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * When Who Remark
- * 05/12/2008 amy Create Version 0 porting from

windows code.

Quoted 9 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 9 lines

- *
-
*---------------------------------------------------------------------
------ - */
-static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg) -{

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -3
-	struct cmpk_query_cfg	rx_query_cfg;
-
-	/* 1. Extract TX feedback info from RFD to temp structure 

buffer. */

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	/* It seems that FW use big endian(MIPS) and DRV use little 

endian in

Quoted 10 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 10 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	 * windows OS. So we have to read the content byte by byte or

transfer

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -8
-	 * endian type before copy the message copy.
-	 */
-	rx_query_cfg.cfg_action		= (pmsg[4] & 0x80) >> 7;
-	rx_query_cfg.cfg_type		= (pmsg[4] & 0x60) >> 5;
-	rx_query_cfg.cfg_size		= (pmsg[4] & 0x18) >> 3;
-	rx_query_cfg.cfg_page		= (pmsg[6] & 0x0F) >> 0;
-	rx_query_cfg.cfg_offset		= pmsg[7];
-	rx_query_cfg.value		= (pmsg[8]  << 24) | 

(pmsg[9] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[10] <<  8) 

| (pmsg[11] << 0);

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	rx_query_cfg.mask		= (pmsg[12] << 24) | 

(pmsg[13] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[14] <<  8) 

| (pmsg[15] << 0);

Quoted 11 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) · line 254

Quoted 7 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -2
-}
-
 
 /*--------------------------------------------------------------------
 --------->  
  * Function:	cmpk_count_tx_status()
  *

Always test-build your patches as they can not break the build. You obviously did not do that here, why not?

I can't see that where the build of rtl8192u is broken. The following lines are from the compilation log:

git/kernels/staging> make -j8 drivers/staging/rtl8192u/
[...]
CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o [...]
LD [M] drivers/staging/rtl8192u/r8192u_usb.o

No errors are reported.

What am I missing?

Thanks,

Fabio

Quoted 4 lines

thanks,

greg k-h

maintainer
#3 lore raw
Quoted 93 lines · Fabio M. De Francesco
Quoted 20 lines · CEST Greg KH
Quoted 19 lines · Fabio M. De Francesco

Remove cmpk_handle_query_config_rx() because it just initializes a local
variable and then returns "void".

---

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
 1 file changed, 40 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
4cece40a92f6..d5a54c2d3086 100644

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -0
@@ -249,46 +249,6 @@ static void cmpk_handle_interrupt_status(struct

net_device *dev, u8 *pmsg)>
DMESG("<---- cmpk_handle_interrupt_status()\n");

Quoted 8 lines
Quoted 8 lines

}

-/*--------------------------------------------------------------------
--------- - * Function: cmpk_handle_query_config_rx()
- *
- * Overview: The function is responsible for extract the message
from - * firmware. It will contain dedicated info in
- * ws-06-0063-rtl8190-command-packet-specification.

Please

Quoted 3 lines
Quoted 3 lines

- * refer to chapter "Beacon State Element".
- *
- * Input: u8 *pmsg - Message Pointer of the

command packet.

Quoted 8 lines
Quoted 8 lines

- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * When Who Remark
- * 05/12/2008 amy Create Version 0 porting from

windows code.

Quoted 9 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 9 lines

- *
-
*---------------------------------------------------------------------
------ - */
-static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg) -{

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -3
-	struct cmpk_query_cfg	rx_query_cfg;
-
-	/* 1. Extract TX feedback info from RFD to temp structure 

buffer. */

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	/* It seems that FW use big endian(MIPS) and DRV use little 

endian in

Quoted 10 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 10 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	 * windows OS. So we have to read the content byte by byte or

transfer

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -8
-	 * endian type before copy the message copy.
-	 */
-	rx_query_cfg.cfg_action		= (pmsg[4] & 0x80) >> 7;
-	rx_query_cfg.cfg_type		= (pmsg[4] & 0x60) >> 5;
-	rx_query_cfg.cfg_size		= (pmsg[4] & 0x18) >> 3;
-	rx_query_cfg.cfg_page		= (pmsg[6] & 0x0F) >> 0;
-	rx_query_cfg.cfg_offset		= pmsg[7];
-	rx_query_cfg.value		= (pmsg[8]  << 24) | 

(pmsg[9] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[10] <<  8) 

| (pmsg[11] << 0);

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	rx_query_cfg.mask		= (pmsg[12] << 24) | 

(pmsg[13] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[14] <<  8) 

| (pmsg[15] << 0);

Quoted 11 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) · line 254

Quoted 7 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -2
-}
-
 
 /*--------------------------------------------------------------------
 --------->  
  * Function:	cmpk_count_tx_status()
  *

Always test-build your patches as they can not break the build. You obviously did not do that here, why not?

I can't see that where the build of rtl8192u is broken. The following lines are from the compilation log:

git/kernels/staging> make -j8 drivers/staging/rtl8192u/
[...]
CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o [...]
LD [M] drivers/staging/rtl8192u/r8192u_usb.o

Quoted 3 lines

No errors are reported.

What am I missing?

The function is used elsewhere in this file :(

#4 lore raw
Quoted 3 lines · CEST Greg KH
Quoted 2 lines · Fabio M. De Francesco
Quoted 1 line · CEST Greg KH

On Sun, Apr 11, 2021 at 08:48:13PM +0200, Fabio M. De Francesco

Quoted 24 lines · wrote:
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

Remove cmpk_handle_query_config_rx() because it just initializes a local
variable and then returns "void".

---

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40
 ------------------------
 1 file changed, 40 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
4cece40a92f6..d5a54c2d3086 100644

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -0
@@ -249,46 +249,6 @@ static void

cmpk_handle_interrupt_status(struct
net_device *dev, u8 *pmsg)>

DMESG("<---- cmpk_handle_interrupt_status()\n");

}

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

-/*----------------------------------------------------------------
----
--------- - * Function: cmpk_handle_query_config_rx()
- *
- * Overview: The function is responsible for extract the
message
from - * firmware. It will contain dedicated

info in

Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line

- * ws-06-0063-rtl8190-command-packet-specification.

Please

Quoted 3 lines
Quoted 3 lines

- * refer to chapter "Beacon State Element".
- *
- * Input: u8 *pmsg - Message Pointer of the

command packet.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * When Who Remark
- * 05/12/2008 amy Create Version 0 porting

from

Quoted 69 lines
Quoted 69 lines

windows code.

Quoted 10 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 10 lines

- *
-
*------------------------------------------------------------------
---
------ - */
-static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg) -{

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -3
-	struct cmpk_query_cfg	rx_query_cfg;
-
-	/* 1. Extract TX feedback info from RFD to temp structure

buffer. */

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	/* It seems that FW use big endian(MIPS) and DRV use little

endian in

Quoted 10 lines

drivers/staging/rtl8192u/r819xU_cmdpkt.c static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)

Quoted 10 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	 * windows OS. So we have to read the content byte by byte or

transfer

drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -8
-	 * endian type before copy the message copy.
-	 */
-	rx_query_cfg.cfg_action		= (pmsg[4] & 0x80) >> 7;
-	rx_query_cfg.cfg_type		= (pmsg[4] & 0x60) >> 5;
-	rx_query_cfg.cfg_size		= (pmsg[4] & 0x18) >> 3;
-	rx_query_cfg.cfg_page		= (pmsg[6] & 0x0F) >> 0;
-	rx_query_cfg.cfg_offset		= pmsg[7];
-	rx_query_cfg.value		= (pmsg[8]  << 24) |

(pmsg[9] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[10] <<  8)
| 
| (pmsg[11] <<  0);
| 
Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-	rx_query_cfg.mask		= (pmsg[12] << 24) |

(pmsg[13] << 16) |

Quoted 1 line

drivers/staging/rtl8192u/r819xU_cmdpkt.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -1
-					  (pmsg[14] <<  8)
| 
| (pmsg[15] <<  0);
| 
Quoted 7 lines
Quoted 7 lines
drivers/staging/rtl8192u/r819xU_cmdpkt.c +0 -2
-}
-
 
 /*----------------------------------------------------------------
 ----
 --------->
Quoted 5 lines
Quoted 2 lines

* Function: cmpk_count_tx_status()
*

Always test-build your patches as they can not break the build. You obviously did not do that here, why not?

I can't see that where the build of rtl8192u is broken. The following lines are from the compilation log:

git/kernels/staging> make -j8 drivers/staging/rtl8192u/

[...]
CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o
CC [M] drivers/staging/rtl8192u/r819xU_cmdpkt.o
[...]
LD [M] drivers/staging/rtl8192u/r8192u_usb.o

Quoted 6 lines
Quoted 3 lines

No errors are reported.

What am I missing?

The function is used elsewhere in this file :(

You're right, it is used in a "switch" statement later in the file. Now I've also understood why it built with no errors:
it built because, notwithstanding that modification, for some reason I have still the original version of the file.
I don't know why, maybe I've made some stupid error with Git...

Thanks,

Fabio

#5 lore raw
In reply to Fabio M. De Francesco
Thank you for the patch! Yet something to improve:

Hi "Fabio,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Fabio-M-De-Francesco/staging-rtl8192u-Remove-function/20210412-024938
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 1b9e18de8d43bf798622cc365f99b41f180b446f
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/499674dec8e01774889806d098bf9a12731930ee
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Fabio-M-De-Francesco/staging-rtl8192u-Remove-function/20210412-024938
        git checkout 499674dec8e01774889806d098bf9a12731930ee
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

drivers/staging/rtl8192u/r819xU_cmdpkt.c: In function 'cmpk_message_handle_rx':

>> drivers/staging/rtl8192u/r819xU_cmdpkt.c:477:4: error: implicit declaration of function 'cmpk_handle_query_config_rx' [-Werror=implicit-function-declaration]
     477 |    cmpk_handle_query_config_rx(dev, pcmd_buff);
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/cmpk_handle_query_config_rx +477 drivers/staging/rtl8192u/r819xU_cmdpkt.c

8fc8598e61f6f3 Jerry Chuang      2009-11-03  409  
8fc8598e61f6f3 Jerry Chuang      2009-11-03  410  /*-----------------------------------------------------------------------------
8fc8598e61f6f3 Jerry Chuang      2009-11-03  411   * Function:    cmpk_message_handle_rx()
8fc8598e61f6f3 Jerry Chuang      2009-11-03  412   *
8fc8598e61f6f3 Jerry Chuang      2009-11-03  413   * Overview:    In the function, we will capture different RX command packet
8fc8598e61f6f3 Jerry Chuang      2009-11-03  414   *		info. Every RX command packet element has different message
8fc8598e61f6f3 Jerry Chuang      2009-11-03  415   *		length and meaning in content. We only support three type of RX
8fc8598e61f6f3 Jerry Chuang      2009-11-03  416   *		command packet now. Please refer to document
8fc8598e61f6f3 Jerry Chuang      2009-11-03  417   *		ws-06-0063-rtl8190-command-packet-specification.
8fc8598e61f6f3 Jerry Chuang      2009-11-03  418   *
8fc8598e61f6f3 Jerry Chuang      2009-11-03  419   * Input:       NONE
8fc8598e61f6f3 Jerry Chuang      2009-11-03  420   *
8fc8598e61f6f3 Jerry Chuang      2009-11-03  421   * Output:      NONE
8fc8598e61f6f3 Jerry Chuang      2009-11-03  422   *
8fc8598e61f6f3 Jerry Chuang      2009-11-03  423   * Return:      NONE
8fc8598e61f6f3 Jerry Chuang      2009-11-03  424   *
8fc8598e61f6f3 Jerry Chuang      2009-11-03  425   * Revised History:
8fc8598e61f6f3 Jerry Chuang      2009-11-03  426   *  When		Who	Remark
8fc8598e61f6f3 Jerry Chuang      2009-11-03  427   *  05/06/2008		amy	Create Version 0 porting from windows code.
8fc8598e61f6f3 Jerry Chuang      2009-11-03  428   *
70cd55d6755ee8 Derek Robson      2017-02-16  429   *---------------------------------------------------------------------------
70cd55d6755ee8 Derek Robson      2017-02-16  430   */
a115ee4175c3eb Teodora Baluta    2013-10-16  431  u32 cmpk_message_handle_rx(struct net_device *dev,
8fc8598e61f6f3 Jerry Chuang      2009-11-03  432  			   struct ieee80211_rx_stats *pstats)
8fc8598e61f6f3 Jerry Chuang      2009-11-03  433  {
8fc8598e61f6f3 Jerry Chuang      2009-11-03  434  	int			total_length;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  435  	u8			cmd_length, exe_cnt = 0;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  436  	u8			element_id;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  437  	u8			*pcmd_buff;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  438  
dc109dc597d7f4 simran singhal    2017-03-04  439  	/* 0. Check inpt arguments. It is a command queue message or
70cd55d6755ee8 Derek Robson      2017-02-16  440  	 * pointer is null.
70cd55d6755ee8 Derek Robson      2017-02-16  441  	 */
d6628e8cbe2047 Michael Straube   2020-09-19  442  	if (!pstats)
8fc8598e61f6f3 Jerry Chuang      2009-11-03  443  		return 0;	/* This is not a command packet. */
8fc8598e61f6f3 Jerry Chuang      2009-11-03  444  
8fc8598e61f6f3 Jerry Chuang      2009-11-03  445  	/* 1. Read received command packet message length from RFD. */
8fc8598e61f6f3 Jerry Chuang      2009-11-03  446  	total_length = pstats->Length;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  447  
8fc8598e61f6f3 Jerry Chuang      2009-11-03  448  	/* 2. Read virtual address from RFD. */
8fc8598e61f6f3 Jerry Chuang      2009-11-03  449  	pcmd_buff = pstats->virtual_address;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  450  
589b3d06fd1597 Justin P. Mattock 2012-04-30  451  	/* 3. Read command packet element id and length. */
8fc8598e61f6f3 Jerry Chuang      2009-11-03  452  	element_id = pcmd_buff[0];
8fc8598e61f6f3 Jerry Chuang      2009-11-03  453  
589b3d06fd1597 Justin P. Mattock 2012-04-30  454  	/* 4. Check every received command packet content according to different
70cd55d6755ee8 Derek Robson      2017-02-16  455  	 *    element type. Because FW may aggregate RX command packet to
70cd55d6755ee8 Derek Robson      2017-02-16  456  	 *    minimize transmit time between DRV and FW.
70cd55d6755ee8 Derek Robson      2017-02-16  457  	 */
6df9f669de3da5 Xenia Ragiadakou  2013-06-26  458  	/* Add a counter to prevent the lock in the loop from being held too
70cd55d6755ee8 Derek Robson      2017-02-16  459  	 * long
70cd55d6755ee8 Derek Robson      2017-02-16  460  	 */
05cdf47ac3374f Xenia Ragiadakou  2013-06-26  461  	while (total_length > 0 && exe_cnt++ < 100) {
6df9f669de3da5 Xenia Ragiadakou  2013-06-26  462  		/* We support aggregation of different cmd in the same packet */
8fc8598e61f6f3 Jerry Chuang      2009-11-03  463  		element_id = pcmd_buff[0];
8fc8598e61f6f3 Jerry Chuang      2009-11-03  464  
05cdf47ac3374f Xenia Ragiadakou  2013-06-26  465  		switch (element_id) {
8fc8598e61f6f3 Jerry Chuang      2009-11-03  466  		case RX_TX_FEEDBACK:
8fc8598e61f6f3 Jerry Chuang      2009-11-03  467  			cmpk_handle_tx_feedback(dev, pcmd_buff);
8fc8598e61f6f3 Jerry Chuang      2009-11-03  468  			cmd_length = CMPK_RX_TX_FB_SIZE;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  469  			break;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  470  
8fc8598e61f6f3 Jerry Chuang      2009-11-03  471  		case RX_INTERRUPT_STATUS:
8fc8598e61f6f3 Jerry Chuang      2009-11-03  472  			cmpk_handle_interrupt_status(dev, pcmd_buff);
17a16b769466e2 John Whitmore     2018-07-29  473  			cmd_length = sizeof(struct cmd_pkt_interrupt_status);
8fc8598e61f6f3 Jerry Chuang      2009-11-03  474  			break;
8fc8598e61f6f3 Jerry Chuang      2009-11-03  475  
8fc8598e61f6f3 Jerry Chuang      2009-11-03  476  		case BOTH_QUERY_CONFIG:

8fc8598e61f6f3 Jerry Chuang 2009-11-03 @477 cmpk_handle_query_config_rx(dev, pcmd_buff);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]