2021-04-11 21:08:56

by Fabio M. De Francesco

[permalink] [raw]
Subject: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

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

Signed-off-by: Fabio M. De Francesco <[email protected]>
---
drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
1 file changed, 40 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 4cece40a92f6..d5a54c2d3086 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -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()
*
--
2.31.1


2021-04-12 10:15:54

by Fabio M. De Francesco

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

On Monday, April 12, 2021 11:42:51 AM CEST Greg KH wrote:
> On Sun, Apr 11, 2021 at 08:48:13PM +0200, Fabio M. De Francesco wrote:
> > Remove cmpk_handle_query_config_rx() because it just initializes a
> > local
> > variable and then returns "void".
> >
> > Signed-off-by: Fabio M. De Francesco <[email protected]>
> > ---
> >
> > drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
> > 1 file changed, 40 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
> > 4cece40a92f6..d5a54c2d3086 100644
> > --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > @@ -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()
> > *
>
> 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
>
> thanks,
>
> greg k-h




2021-04-12 10:24:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

On Mon, Apr 12, 2021 at 12:12:34PM +0200, Fabio M. De Francesco wrote:
> On Monday, April 12, 2021 11:42:51 AM CEST Greg KH wrote:
> > On Sun, Apr 11, 2021 at 08:48:13PM +0200, Fabio M. De Francesco wrote:
> > > Remove cmpk_handle_query_config_rx() because it just initializes a
> > > local
> > > variable and then returns "void".
> > >
> > > Signed-off-by: Fabio M. De Francesco <[email protected]>
> > > ---
> > >
> > > drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
> > > 1 file changed, 40 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
> > > 4cece40a92f6..d5a54c2d3086 100644
> > > --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > @@ -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()
> > > *
> >
> > 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?

The function is used elsewhere in this file :(

2021-04-12 23:14:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

On Sun, Apr 11, 2021 at 08:48:13PM +0200, Fabio M. De Francesco wrote:
> Remove cmpk_handle_query_config_rx() because it just initializes a local
> variable and then returns "void".
>
> Signed-off-by: Fabio M. De Francesco <[email protected]>
> ---
> drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40 ------------------------
> 1 file changed, 40 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> index 4cece40a92f6..d5a54c2d3086 100644
> --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> @@ -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()
> *
> --
> 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

2021-04-12 23:51:19

by Fabio M. De Francesco

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

On Monday, April 12, 2021 12:22:03 PM CEST Greg KH wrote:
> On Mon, Apr 12, 2021 at 12:12:34PM +0200, Fabio M. De Francesco wrote:
> > On Monday, April 12, 2021 11:42:51 AM CEST Greg KH wrote:
> > > On Sun, Apr 11, 2021 at 08:48:13PM +0200, Fabio M. De Francesco
wrote:
> > > > Remove cmpk_handle_query_config_rx() because it just initializes a
> > > > local
> > > > variable and then returns "void".
> > > >
> > > > Signed-off-by: Fabio M. De Francesco <[email protected]>
> > > > ---
> > > >
> > > > drivers/staging/rtl8192u/r819xU_cmdpkt.c | 40
> > > > ------------------------
> > > > 1 file changed, 40 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > > b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index
> > > > 4cece40a92f6..d5a54c2d3086 100644
> > > > --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > > +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> > > > @@ -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()
> > > > *
> > >
> > > 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?
>
> 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



2021-04-19 22:16:07

by kernel test robot

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove function

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
Reported-by: kernel test robot <[email protected]>

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]


Attachments:
(No filename) (7.09 kB)
.config.gz (63.53 kB)
Download all attachments