* better
[mascara-docs.git] / i386 / linux-2.3.21 / drivers / ap1000 / mac.h
blob85f02b4a3cd9a19382df8c88a4f4b427d414b68e
1 /*
2 * Copyright 1996 The Australian National University.
3 * Copyright 1996 Fujitsu Laboratories Limited
4 *
5 * This software may be distributed under the terms of the Gnu
6 * Public License version 2 or later
7 */
8 /*
9 * Definitions of MAC state structures etc.
12 struct mac_info {
13 TimerTwosComplement tmax;
14 TimerTwosComplement tvx;
15 TimerTwosComplement treq;
16 ShortAddressType s_address;
17 LongAddressType l_address;
18 ShortAddressType s_group_adrs;
19 LongAddressType l_group_adrs;
20 int rcv_own_frames;
21 int only_good_frames;
25 struct mac_buf {
26 struct mac_buf *next;
27 int ack;
28 int length;
29 void *ptr;
30 int wraplen;
31 void *wrapptr;
32 int fr_start;
33 int fr_end;
36 int mac_xmit_space(void);
37 void mac_xmit_alloc(struct mac_buf *, int);
38 void mac_queue_frame(struct mac_buf *);
39 int mac_recv_frame(struct mac_buf *);
40 void mac_discard_frame(struct mac_buf *);
41 int mac_init(struct mac_info *mip);
42 int mac_inited(struct mac_info *mip);
43 void mac_reset(LoopbackType loopback);
44 void mac_claim(void);
45 void mac_sleep(void);
46 void mac_poll(void);
47 void mac_disable(void);
48 void mac_make_spframes(void);
49 int mac_xalloc(int nwords);
50 int mac_xmit_dma(struct sk_buff *skb);
51 void mac_dma_complete(void);
52 void mac_process(void);
53 int mac_queue_append(struct sk_buff *skb);
55 struct dma_chan {
56 int cmd; /* cmd << 16 + size */
57 int st; /* status << 16 + current size */
58 int hskip; /* hskip << 16 + hcnt */
59 int vskip; /* vskip << 16 + vcnt */
60 unsigned char *maddr; /* memory address */
61 unsigned char *cmaddr; /* current memory address */
62 int ccount; /* h_count << 16 + v_count */
63 int *tblp; /* table pointer */
64 int *ctblp; /* current table pointer */
65 unsigned char *hdptr; /* header pointer */
68 #define ROUND4(x) (((x) + 3) & -4)
69 #define ROUND8(x) (((x) + 7) & -8)
70 #define ROUND16(x) (((x) + 15) & -16)
71 #define ROUNDLINE(x) ROUND16(x)
73 #define NWORDS(x) (((x) + 3) >> 2)
74 #define NLINES(x) (((x) + 15) >> 4)
77 * Queue element used to queue transmit requests on the FDDI.
79 struct mac_queue {
80 volatile struct mac_queue *next;
81 struct sk_buff *skb;