blob: aa52b2e8ff7b24af42a336065b830d90d7bd1034 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Ben Dooks825a2ff2007-07-03 16:53:09 +01002/* include/net/ax88796.h
3 *
4 * Copyright 2005 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
Ben Dooks825a2ff2007-07-03 16:53:09 +01006*/
7
8#ifndef __NET_AX88796_PLAT_H
9#define __NET_AX88796_PLAT_H
10
Michael Karcher27cced22018-04-19 14:05:22 +120011struct sk_buff;
12struct net_device;
Michael Karchercec4c1c2018-04-19 14:05:23 +120013struct platform_device;
Michael Karcher27cced22018-04-19 14:05:22 +120014
Ben Dooks825a2ff2007-07-03 16:53:09 +010015#define AXFLG_HAS_EEPROM (1<<0)
16#define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */
Magnus Damm89e536a2007-09-28 22:42:16 -070017#define AXFLG_HAS_93CX6 (1<<2) /* use eeprom_93cx6 driver */
Daniel Mack67fca022009-03-24 23:32:03 -070018#define AXFLG_MAC_FROMPLATFORM (1<<3) /* MAC given by platform data */
Ben Dooks825a2ff2007-07-03 16:53:09 +010019
20struct ax_plat_data {
21 unsigned int flags;
Daniel Mack67fca022009-03-24 23:32:03 -070022 unsigned char wordlength; /* 1 or 2 */
23 unsigned char dcr_val; /* default value for DCR */
24 unsigned char rcr_val; /* default value for RCR */
25 unsigned char gpoc_val; /* default value for GPOC */
26 u32 *reg_offsets; /* register offsets */
27 u8 *mac_addr; /* MAC addr (only used when
28 AXFLG_MAC_FROMPLATFORM is used */
Michael Karcher27cced22018-04-19 14:05:22 +120029
30 /* uses default ax88796 buffer if set to NULL */
31 void (*block_output)(struct net_device *dev, int count,
32 const unsigned char *buf, int star_page);
33 void (*block_input)(struct net_device *dev, int count,
34 struct sk_buff *skb, int ring_offset);
Michael Karchercec4c1c2018-04-19 14:05:23 +120035 /* returns nonzero if a pending interrupt request might by caused by
36 * the ax88786. Handles all interrupts if set to NULL
37 */
38 int (*check_irq)(struct platform_device *pdev);
Ben Dooks825a2ff2007-07-03 16:53:09 +010039};
40
41#endif /* __NET_AX88796_PLAT_H */