RE: [PATCH net-next 4/4] r8152: support firmware files

2014-08-24 Thread Hayes Wang
Francois Romieu [mailto:rom...@fr.zoreil.com] [...] > > +static void rtl_request_firmware(struct r8152 *tp) > > +{ > > + char *fw_name = NULL; > > + > > + if (tp->rtl_fw.fw) > > + goto out_request; > > + > > + switch (tp->version) { > > + case RTL_VER_01: > > + fw_name

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-24 Thread Francois Romieu
Hayes Wang : > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index 937d132..63542cc 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c [...] > +static void rtl_request_firmware(struct r8152 *tp) > +{ > + char *fw_name = NULL; > + > + if

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-24 Thread Francois Romieu
Hayes Wang hayesw...@realtek.com : diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 937d132..63542cc 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c [...] +static void rtl_request_firmware(struct r8152 *tp) +{ + char *fw_name = NULL; + + if

RE: [PATCH net-next 4/4] r8152: support firmware files

2014-08-24 Thread Hayes Wang
Francois Romieu [mailto:rom...@fr.zoreil.com] [...] +static void rtl_request_firmware(struct r8152 *tp) +{ + char *fw_name = NULL; + + if (tp-rtl_fw.fw) + goto out_request; + + switch (tp-version) { + case RTL_VER_01: + fw_name =

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Daniele Forsi
2014-08-20 14:35 GMT+02:00 Hayes Wang: > Is this necessary? Besides the check of the "start", > there are checks of the "size" and rtl_fw_data_ok(). > I think they cover the situations which you indicate. it's not necessary and it's better checked later as you did! -- Daniele Forsi -- To

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Daniele Forsi
2014-08-20 10:58 GMT+02:00 Hayes Wang: > The firmware file is composed of the fw header and the commands. Each > command has the following type. > > cmd(2 bytes) + length(2 bytes) + data(variable bytes) > +static bool rtl_fw_format_ok(struct rtl_fw *rtl_fw) > + start =

RE: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Hayes Wang
Daniele Forsi [mailto:dfo...@gmail.com] > Sent: Wednesday, August 20, 2014 8:01 PM > To: Hayes Wang > Cc: net...@vger.kernel.org; nic_swsd; > linux-kernel@vger.kernel.org; USB list > Subject: Re: [PATCH net-next 4/4] r8152: support firmware files [...] > > + start =

[PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Hayes Wang
The firmware file is composed of the fw header and the commands. Each command has the following type. cmd(2 bytes) + length(2 bytes) + data(variable bytes) Before applying the firmware, the driver would check the fw header and each command. Signed-off-by: Hayes Wang ---

[PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Hayes Wang
The firmware file is composed of the fw header and the commands. Each command has the following type. cmd(2 bytes) + length(2 bytes) + data(variable bytes) Before applying the firmware, the driver would check the fw header and each command. Signed-off-by: Hayes Wang

RE: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Hayes Wang
Daniele Forsi [mailto:dfo...@gmail.com] Sent: Wednesday, August 20, 2014 8:01 PM To: Hayes Wang Cc: net...@vger.kernel.org; nic_swsd; linux-kernel@vger.kernel.org; USB list Subject: Re: [PATCH net-next 4/4] r8152: support firmware files [...] + start = le32_to_cpu(fw_header

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Daniele Forsi
2014-08-20 10:58 GMT+02:00 Hayes Wang: The firmware file is composed of the fw header and the commands. Each command has the following type. cmd(2 bytes) + length(2 bytes) + data(variable bytes) +static bool rtl_fw_format_ok(struct rtl_fw *rtl_fw) + start =

Re: [PATCH net-next 4/4] r8152: support firmware files

2014-08-20 Thread Daniele Forsi
2014-08-20 14:35 GMT+02:00 Hayes Wang: Is this necessary? Besides the check of the start, there are checks of the size and rtl_fw_data_ok(). I think they cover the situations which you indicate. it's not necessary and it's better checked later as you did! -- Daniele Forsi -- To unsubscribe