Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread Michael Schmitz
Hi Finn,

On Wed, Apr 18, 2018 at 1:23 PM, Finn Thain  wrote:
> On Wed, 18 Apr 2018, Michael Schmitz wrote:
>
>> I think this is a false positive - we're encouraged to provide the
>> full parameter list for functions, so the sreuct sk_buff* can't be
>> avoided.
>>
>
> I don't think it's a false positive. I think ax88796.h would need to
> #include .
>
> You may be able to get away with a forward declaration, as in,
> struct skbuff;
> but I'm not sure about that. I would have to build mach-anubis.c to check.

I've added a forward declaration for now - worked for struct
net_device as well (would have been missing from the mach-anubis.c
build as well because of the missing netdevice header).

> But why do you need to pass an skbuff pointer here? xs100_block_input()
> only accesses skb->data.

I'm forced to use the same interface as ax_block_input()
(xs100_block_input is a plug-in replacement for that). But both could
be changed. Let's leave that for later please.

> BTW, this patch has an unrelated whitespace change.

Fixed, thanks.

Cheers,

  Michael

>
> --
>
>> Cheers,
>>
>>   Michael
>>
>>
>> On Wed, Apr 18, 2018 at 6:46 AM, kbuild test robot  wrote:
>> > Hi Michael,
>> >
>> > I love your patch! Perhaps something to improve:
>> >
>> > [auto build test WARNING on v4.16]
>> > [cannot apply to net-next/master net/master v4.17-rc1 next-20180417]
>> > [if your patch is applied to the wrong git tree, please drop us a note to 
>> > help improve the system]
>> >
>> > url:
>> > https://github.com/0day-ci/linux/commits/Michael-Schmitz/New-network-driver-for-Amiga-X-Surf-100-m68k/20180417-141150
>> > config: arm-samsung (attached as .config)
>> > compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
>> > reproduce:
>> > wget 
>> > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
>> > -O ~/bin/make.cross
>> > chmod +x ~/bin/make.cross
>> > # save the attached .config to linux build tree
>> > make.cross ARCH=arm
>> >
>> > All warnings (new ones prefixed by >>):
>> >
>> >In file included from arch/arm/mach-s3c24xx/mach-anubis.c:42:0:
>> >>> include/net/ax88796.h:35:11: warning: 'struct sk_buff' declared inside 
>> >>> parameter list will not be visible outside of this definition or 
>> >>> declaration
>> >struct sk_buff *skb, int ring_offset);
>> >   ^~~
>> >
>> > vim +35 include/net/ax88796.h
>> >
>> > 20
>> > 21  struct ax_plat_data {
>> > 22  unsigned int flags;
>> > 23  unsigned charwordlength;/* 1 or 2 */
>> > 24  unsigned chardcr_val;   /* default value for DCR */
>> > 25  unsigned charrcr_val;   /* default value for RCR */
>> > 26  unsigned chargpoc_val;  /* default value for GPOC 
>> > */
>> > 27  u32 *reg_offsets;   /* register offsets */
>> > 28  u8  *mac_addr;  /* MAC addr (only used when
>> > 29 AXFLG_MAC_FROMPLATFORM 
>> > is used */
>> > 30
>> > 31  /* uses default ax88796 buffer if set to NULL */
>> > 32  void (*block_output)(struct net_device *dev, int count,
>> > 33  const unsigned char *buf, int star_page);
>> > 34  void (*block_input)(struct net_device *dev, int count,
>> >   > 35  struct sk_buff *skb, int ring_offset);
>> > 36  };
>> > 37
>> >
>> > ---
>> > 0-DAY kernel test infrastructureOpen Source Technology 
>> > Center
>> > https://lists.01.org/pipermail/kbuild-all   Intel 
>> > Corporation
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread Michael Schmitz
Hi Andrew,

ax88796 includes it via linux/netdevice.h. mac-anubis.c doesn't.

Michael Karcher's patches have added forward derclarations for struct
netdevice and struct platform_data already - I'll add struct sk_buff
as suggested by Finn.

Cheers,

  Michael


On Wed, Apr 18, 2018 at 1:19 PM, Andrew Lunn  wrote:
> On Wed, Apr 18, 2018 at 12:53:21PM +1200, Michael Schmitz wrote:
>> I think this is a false positive - we're encouraged to provide the
>> full parameter list for functions, so the sreuct sk_buff* can't be
>> avoided.
>
> Hi Michael
>
> How is  being included?
>
> You probably want to build using the .config file and see.
>
> Andrew


Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread Finn Thain
On Wed, 18 Apr 2018, Michael Schmitz wrote:

> I think this is a false positive - we're encouraged to provide the
> full parameter list for functions, so the sreuct sk_buff* can't be
> avoided.
> 

I don't think it's a false positive. I think ax88796.h would need to 
#include .

You may be able to get away with a forward declaration, as in,
struct skbuff;
but I'm not sure about that. I would have to build mach-anubis.c to check.

But why do you need to pass an skbuff pointer here? xs100_block_input() 
only accesses skb->data.

BTW, this patch has an unrelated whitespace change.

-- 

> Cheers,
> 
>   Michael
> 
> 
> On Wed, Apr 18, 2018 at 6:46 AM, kbuild test robot  wrote:
> > Hi Michael,
> >
> > I love your patch! Perhaps something to improve:
> >
> > [auto build test WARNING on v4.16]
> > [cannot apply to net-next/master net/master v4.17-rc1 next-20180417]
> > [if your patch is applied to the wrong git tree, please drop us a note to 
> > help improve the system]
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Michael-Schmitz/New-network-driver-for-Amiga-X-Surf-100-m68k/20180417-141150
> > config: arm-samsung (attached as .config)
> > compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
> > reproduce:
> > wget 
> > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> > ~/bin/make.cross
> > chmod +x ~/bin/make.cross
> > # save the attached .config to linux build tree
> > make.cross ARCH=arm
> >
> > All warnings (new ones prefixed by >>):
> >
> >In file included from arch/arm/mach-s3c24xx/mach-anubis.c:42:0:
> >>> include/net/ax88796.h:35:11: warning: 'struct sk_buff' declared inside 
> >>> parameter list will not be visible outside of this definition or 
> >>> declaration
> >struct sk_buff *skb, int ring_offset);
> >   ^~~
> >
> > vim +35 include/net/ax88796.h
> >
> > 20
> > 21  struct ax_plat_data {
> > 22  unsigned int flags;
> > 23  unsigned charwordlength;/* 1 or 2 */
> > 24  unsigned chardcr_val;   /* default value for DCR */
> > 25  unsigned charrcr_val;   /* default value for RCR */
> > 26  unsigned chargpoc_val;  /* default value for GPOC */
> > 27  u32 *reg_offsets;   /* register offsets */
> > 28  u8  *mac_addr;  /* MAC addr (only used when
> > 29 AXFLG_MAC_FROMPLATFORM 
> > is used */
> > 30
> > 31  /* uses default ax88796 buffer if set to NULL */
> > 32  void (*block_output)(struct net_device *dev, int count,
> > 33  const unsigned char *buf, int star_page);
> > 34  void (*block_input)(struct net_device *dev, int count,
> >   > 35  struct sk_buff *skb, int ring_offset);
> > 36  };
> > 37
> >
> > ---
> > 0-DAY kernel test infrastructureOpen Source Technology 
> > Center
> > https://lists.01.org/pipermail/kbuild-all   Intel 
> > Corporation
> --
> To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread Andrew Lunn
On Wed, Apr 18, 2018 at 12:53:21PM +1200, Michael Schmitz wrote:
> I think this is a false positive - we're encouraged to provide the
> full parameter list for functions, so the sreuct sk_buff* can't be
> avoided.

Hi Michael

How is  being included?

You probably want to build using the .config file and see.

Andrew


Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread Michael Schmitz
I think this is a false positive - we're encouraged to provide the
full parameter list for functions, so the sreuct sk_buff* can't be
avoided.

Cheers,

  Michael


On Wed, Apr 18, 2018 at 6:46 AM, kbuild test robot  wrote:
> Hi Michael,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on v4.16]
> [cannot apply to net-next/master net/master v4.17-rc1 next-20180417]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
>
> url:
> https://github.com/0day-ci/linux/commits/Michael-Schmitz/New-network-driver-for-Amiga-X-Surf-100-m68k/20180417-141150
> config: arm-samsung (attached as .config)
> compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=arm
>
> All warnings (new ones prefixed by >>):
>
>In file included from arch/arm/mach-s3c24xx/mach-anubis.c:42:0:
>>> include/net/ax88796.h:35:11: warning: 'struct sk_buff' declared inside 
>>> parameter list will not be visible outside of this definition or declaration
>struct sk_buff *skb, int ring_offset);
>   ^~~
>
> vim +35 include/net/ax88796.h
>
> 20
> 21  struct ax_plat_data {
> 22  unsigned int flags;
> 23  unsigned charwordlength;/* 1 or 2 */
> 24  unsigned chardcr_val;   /* default value for DCR */
> 25  unsigned charrcr_val;   /* default value for RCR */
> 26  unsigned chargpoc_val;  /* default value for GPOC */
> 27  u32 *reg_offsets;   /* register offsets */
> 28  u8  *mac_addr;  /* MAC addr (only used when
> 29 AXFLG_MAC_FROMPLATFORM is 
> used */
> 30
> 31  /* uses default ax88796 buffer if set to NULL */
> 32  void (*block_output)(struct net_device *dev, int count,
> 33  const unsigned char *buf, int star_page);
> 34  void (*block_input)(struct net_device *dev, int count,
>   > 35  struct sk_buff *skb, int ring_offset);
> 36  };
> 37
>
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-17 Thread kbuild test robot
Hi Michael,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v4.16]
[cannot apply to net-next/master net/master v4.17-rc1 next-20180417]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Michael-Schmitz/New-network-driver-for-Amiga-X-Surf-100-m68k/20180417-141150
config: arm-samsung (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   In file included from arch/arm/mach-s3c24xx/mach-anubis.c:42:0:
>> include/net/ax88796.h:35:11: warning: 'struct sk_buff' declared inside 
>> parameter list will not be visible outside of this definition or declaration
   struct sk_buff *skb, int ring_offset);
  ^~~

vim +35 include/net/ax88796.h

20  
21  struct ax_plat_data {
22  unsigned int flags;
23  unsigned charwordlength;/* 1 or 2 */
24  unsigned chardcr_val;   /* default value for DCR */
25  unsigned charrcr_val;   /* default value for RCR */
26  unsigned chargpoc_val;  /* default value for GPOC */
27  u32 *reg_offsets;   /* register offsets */
28  u8  *mac_addr;  /* MAC addr (only used when
29 AXFLG_MAC_FROMPLATFORM is 
used */
30  
31  /* uses default ax88796 buffer if set to NULL */
32  void (*block_output)(struct net_device *dev, int count,
33  const unsigned char *buf, int star_page);
34  void (*block_input)(struct net_device *dev, int count,
  > 35  struct sk_buff *skb, int ring_offset);
36  };
37  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH 04/10] net: ax88796: Add block_input/output hooks to ax_plat_data

2018-04-16 Thread Michael Schmitz
Add platform specific hooks for block transfer reads/writes of packet
buffer data, superseding the default provided ax_block_input/output.
Currently used for m68k Amiga XSurf100.

Signed-off-by: Michael Karcher 
Signed-off-by: Michael Schmitz 
---
 drivers/net/ethernet/8390/ax88796.c |   10 --
 include/net/ax88796.h   |9 -
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/8390/ax88796.c 
b/drivers/net/ethernet/8390/ax88796.c
index a4f23ba..9159235 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -758,8 +758,14 @@ static int ax_init_dev(struct net_device *dev)
 #endif
 
ei_local->reset_8390 = _reset_8390;
-   ei_local->block_input = _block_input;
-   ei_local->block_output = _block_output;
+   if (ax->plat->block_input)
+   ei_local->block_input = ax->plat->block_input;
+   else
+   ei_local->block_input = _block_input;
+   if (ax->plat->block_output)
+   ei_local->block_output = ax->plat->block_output;
+   else
+   ei_local->block_output = _block_output;
ei_local->get_8390_hdr = _get_8390_hdr;
ei_local->priv = 0;
ei_local->msg_enable = ax_msg_enable;
diff --git a/include/net/ax88796.h b/include/net/ax88796.h
index b9a3bec..26cc459 100644
--- a/include/net/ax88796.h
+++ b/include/net/ax88796.h
@@ -8,10 +8,11 @@
  * published by the Free Software Foundation.
  *
 */
-
 #ifndef __NET_AX88796_PLAT_H
 #define __NET_AX88796_PLAT_H
 
+struct net_device;
+
 #define AXFLG_HAS_EEPROM   (1<<0)
 #define AXFLG_MAC_FROMDEV  (1<<1)  /* device already has MAC */
 #define AXFLG_HAS_93CX6(1<<2)  /* use eeprom_93cx6 
driver */
@@ -26,6 +27,12 @@ struct ax_plat_data {
u32 *reg_offsets;   /* register offsets */
u8  *mac_addr;  /* MAC addr (only used when
   AXFLG_MAC_FROMPLATFORM is used */
+
+   /* uses default ax88796 buffer if set to NULL */
+   void (*block_output)(struct net_device *dev, int count,
+   const unsigned char *buf, int star_page);
+   void (*block_input)(struct net_device *dev, int count,
+   struct sk_buff *skb, int ring_offset);
 };
 
 #endif /* __NET_AX88796_PLAT_H */
-- 
1.7.0.4