3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
9 #ifndef _ASM_IA64_SN_NIC_H
10 #define _ASM_IA64_SN_NIC_H
12 #include <asm/types.h>
13 #include <asm/sn/types.h>
14 #include <linux/devfs_fs_kernel.h>
16 #define MCR_DATA(x) ((int) ((x) & 1))
17 #define MCR_DONE(x) ((x) & 2)
18 #define MCR_PACK(pulse, sample) ((pulse) << 10 | (sample) << 2)
20 typedef __psunsigned_t nic_data_t;
23 nic_access_f(nic_data_t data,
24 int pulse, int sample, int delay);
26 typedef nic_access_f *nic_access_t;
28 typedef struct nic_vmce_s *nic_vmce_t;
29 typedef void nic_vmc_func(devfs_handle_t v);
32 * PRIVATE data for Dallas NIC
35 typedef struct nic_state_t {
46 * Public interface for Dallas NIC
51 * nic_setup requires an access routine that pulses the NIC line for a
52 * specified duration, samples the NIC line after a specified duration,
53 * then delays for a third specified duration (for precharge).
55 * This general scheme allows us to access NICs through any medium
56 * (e.g. hub regs, bridge regs, vector writes, system ctlr commands).
58 * The access routine should return the sample value 0 or 1, or if an
59 * error occurs, return a negative error code. Negative error codes from
60 * the access routine will abort the NIC operation and be propagated
61 * through out of the top-level NIC call.
68 #define NIC_NOT_PRESENT 4
69 #define NIC_REDIR_LOOP 5
73 uint64_t nic_get_phase_bits(void);
75 extern int nic_setup(nic_state_t *ns,
79 extern int nic_next(nic_state_t *ns,
84 extern int nic_read_one_page(nic_state_t *ns,
92 extern int nic_read_mfg(nic_state_t *ns,
99 extern int nic_info_get(nic_access_t access,
103 extern int nic_item_info_get(char *buf, char *item, char **item_info);
105 nic_access_f nic_access_mcr32;
107 extern char *nic_vertex_info_get(devfs_handle_t v);
109 extern char *nic_vertex_info_set(nic_access_t access,
113 extern int nic_vertex_info_match(devfs_handle_t vertex,
116 extern char *nic_bridge_vertex_info(devfs_handle_t vertex,
118 extern char *nic_hq4_vertex_info(devfs_handle_t vertex,
120 extern char *nic_ioc3_vertex_info(devfs_handle_t vertex,
124 extern char *nic_hub_vertex_info(devfs_handle_t vertex);
126 extern nic_vmce_t nic_vmc_add(char *, nic_vmc_func *);
127 extern void nic_vmc_del(nic_vmce_t);
129 #endif /* _ASM_IA64_SN_NIC_H */