Skip to content

Commit 27cced2

Browse files
Michael Karcherdavem330
authored andcommitted
net-next: ax88796: Add block_input/output hooks to ax_plat_data
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 <kernel@mkarcher.dialup.fu-berlin.de> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9144c37 commit 27cced2

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

drivers/net/ethernet/8390/ax88796.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,14 @@ static int ax_init_dev(struct net_device *dev)
758758
#endif
759759

760760
ei_local->reset_8390 = &ax_reset_8390;
761-
ei_local->block_input = &ax_block_input;
762-
ei_local->block_output = &ax_block_output;
761+
if (ax->plat->block_input)
762+
ei_local->block_input = ax->plat->block_input;
763+
else
764+
ei_local->block_input = &ax_block_input;
765+
if (ax->plat->block_output)
766+
ei_local->block_output = ax->plat->block_output;
767+
else
768+
ei_local->block_output = &ax_block_output;
763769
ei_local->get_8390_hdr = &ax_get_8390_hdr;
764770
ei_local->priv = 0;
765771

include/net/ax88796.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __NET_AX88796_PLAT_H
1313
#define __NET_AX88796_PLAT_H
1414

15+
struct sk_buff;
16+
struct net_device;
17+
1518
#define AXFLG_HAS_EEPROM (1<<0)
1619
#define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */
1720
#define AXFLG_HAS_93CX6 (1<<2) /* use eeprom_93cx6 driver */
@@ -26,6 +29,12 @@ struct ax_plat_data {
2629
u32 *reg_offsets; /* register offsets */
2730
u8 *mac_addr; /* MAC addr (only used when
2831
AXFLG_MAC_FROMPLATFORM is used */
32+
33+
/* uses default ax88796 buffer if set to NULL */
34+
void (*block_output)(struct net_device *dev, int count,
35+
const unsigned char *buf, int star_page);
36+
void (*block_input)(struct net_device *dev, int count,
37+
struct sk_buff *skb, int ring_offset);
2938
};
3039

3140
#endif /* __NET_AX88796_PLAT_H */

0 commit comments

Comments
 (0)