From: Johnny Kim <johnny.kim@atmel.com>
To: Julian Calaby <julian.calaby@gmail.com>, Tony Cho <tony.cho@atmel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
Chris Park <chris.park@atmel.com>,
"Rachel Kim" <rachel.kim@atmel.com>, <austin.shin@atmel.com>,
<glen.lee@atmel.com>, <leo.kim@atmel.com>, <jude.lee@atmel.com>,
<robin.hwang@atmel.com>, <Nicolas.FERRE@atmel.com>
Subject: Re: [PATCH 5/5] staging: wilc1000: use id value as argument
Date: Mon, 10 Aug 2015 16:53:11 +0900 [thread overview]
Message-ID: <55C85867.90903@atmel.com> (raw)
In-Reply-To: <CAGRGNgWVUM-4tTTdAsVfrD75YzUx=RPgQUnNMYqvLxcV9rJwnQ@mail.gmail.com>
Hello Julian.
On 2015년 08월 10일 15:47, Julian Calaby wrote:
> Hi Tony and Johnny,
>
> On Mon, Aug 10, 2015 at 3:58 PM, Tony Cho <tony.cho@atmel.com> wrote:
>> From: Johnny Kim <johnny.kim@atmel.com>
>>
>> The driver communicates with the chipset via the address of handlers
>> to distinguish async data frame. The SendConfigPkt function gets the
>> pointer address indicating the handlers as the last argument, but this
>> requires redundant typecasting and does not support the 64 bit machine.
>>
>> This patch adds the function which assigns ID values instead of pointer
>> representing the driver handler to the address and then uses the ID
>> instead of pointer as the last argument of SendConfigPkt. The driver
>> also gets the handler's address from the ID in the data frame when it
>> receives them.
> Excellent work!
>
> A couple of minor questions:
>
>> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
>> index c4e27c7..5a0277f 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -616,7 +680,8 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetChan *pst
>>
>> PRINT_D(HOSTINF_DBG, "Setting channel\n");
>> /*Sending Cfg*/
>> - s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
>> + s32Error = (SET_CFG, &strWID, 1, true,
>> + get_id_from_handler(pstrWFIDrv));
> Would it make sense to call get_id_from_handler() inside
> SendConfigPkt() instead?
SendConfigPkt function can't be aware of tstrWILC_WFIDrv type
because SendConfigPkt is defined before tstrWILC_WFIDrv.
>> if (s32Error) {
>> PRINT_ER("Failed to set channel\n");
>> WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
>> @@ -653,7 +718,8 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand
>>
>> /*Sending Cfg*/
>>
>> - s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
>> + s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,host_int_set_wfi_drv_handler
>> + pstrHostIfSetDrvHandler->u32Address);
> Is this correct?
pstrHostIfSetDrvHandler->u32Address value which is input as argument
isn't pointer address but ID value.
The value was filled in host_int_set_wfi_drv_handler function.
>>
>> if ((pstrHostIfSetDrvHandler->u32Address) == (u32)NULL)
>> @@ -6772,11 +6888,11 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
>> {
>> s32 s32Error = WILC_SUCCESS;
>> tstrHostIFmsg strHostIFmsg;
>> - u32 drvHandler;
>> + u32 id;
>> tstrWILC_WFIDrv *pstrWFIDrv = NULL;
>>
>> - drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
>> - pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
>> + id = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
> Would be32_to_cpu() or something like that be able to help you do this?
Thank for your comment. I will fix it on another subject.
>> + pstrWFIDrv = get_handler_from_id(id);
>>
>>
>>
> Thanks,
>
next prev parent reply other threads:[~2015-08-10 7:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 5:58 [PATCH 0/5] 64 bit build patch Tony Cho
2015-08-10 5:58 ` [PATCH 1/5] staging: wilc1000: replace WILC_WFIDrvHandle by tstrWILC_WFIDrv Tony Cho
2015-08-10 5:58 ` [PATCH 2/5] staging: wilc1000: change void pointer type to real type Tony Cho
2015-08-10 5:58 ` [PATCH 3/5] staging: wilc1000: clarify the argument type Tony Cho
2015-08-10 5:58 ` [PATCH 4/5] staging: wilc1000: use the real data type Tony Cho
2015-08-10 5:58 ` [PATCH 5/5] staging: wilc1000: use id value as argument Tony Cho
2015-08-10 6:47 ` Julian Calaby
2015-08-10 7:53 ` Johnny Kim [this message]
2015-08-10 10:44 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2015-08-13 4:41 [PATCH 0/5] staging: wilc1000: 64bit build patch Tony Cho
2015-08-13 4:41 ` [PATCH 5/5] staging: wilc1000: use id value as argument Tony Cho
2015-08-13 14:49 ` Dan Carpenter
2015-08-18 3:10 ` Johnny Kim
2015-08-18 9:12 ` Dan Carpenter
2015-08-19 7:58 ` Johnny Kim
2015-08-19 10:05 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C85867.90903@atmel.com \
--to=johnny.kim@atmel.com \
--cc=Nicolas.FERRE@atmel.com \
--cc=austin.shin@atmel.com \
--cc=chris.park@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=glen.lee@atmel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jude.lee@atmel.com \
--cc=julian.calaby@gmail.com \
--cc=leo.kim@atmel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rachel.kim@atmel.com \
--cc=robin.hwang@atmel.com \
--cc=tony.cho@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).