1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef _LINUX_NICSTAR_H_
16#define _LINUX_NICSTAR_H_
17
18
19
20
21#include <linux/types.h>
22#include <linux/pci.h>
23#include <linux/uio.h>
24#include <linux/skbuff.h>
25#include <linux/atmdev.h>
26#include <linux/atm_nicstar.h>
27
28
29
30
31#define NS_MAX_CARDS 4
32
33
34
35#undef RCQ_SUPPORT
36
37#define NS_TST_NUM_ENTRIES 2340
38#define NS_TST_RESERVED 340
39
40#define NS_SMBUFSIZE 48
41#define NS_LGBUFSIZE 16384
42#define NS_RSQSIZE 8192
43#define NS_VPIBITS 2
44
45#define NS_MAX_RCTSIZE 4096
46
47
48
49
50
51
52
53
54
55
56
57#define NUM_SB 32
58#define NUM_LB 24
59#define NUM_HB 8
60#define NUM_IOVB 48
61
62
63#define MIN_SB 8
64#define MIN_LB 8
65#define MIN_HB 6
66#define MIN_IOVB 8
67
68
69#define MAX_SB 64
70#define MAX_LB 48
71#define MAX_HB 10
72#define MAX_IOVB 80
73
74
75#define TOP_SB 256
76#define TOP_LB 128
77#define TOP_HB 64
78#define TOP_IOVB 256
79
80
81#define MAX_TBD_PER_VC 1
82#define MAX_TBD_PER_SCQ 10
83
84#undef ENABLE_TSQFIE
85
86#define SCQFULL_TIMEOUT (5 * HZ)
87
88#define NS_POLL_PERIOD (HZ)
89
90#define PCR_TOLERANCE (1.0001)
91
92
93
94
95
96#define NICSTAR_EPROM_MAC_ADDR_OFFSET 0x6C
97#define NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT 0xF6
98
99
100
101
102#define NS_IOREMAP_SIZE 4096
103
104
105
106
107
108
109#define BUF_SM 0x00000000
110#define BUF_LG 0x00000001
111#define BUF_NONE 0xffffffff
112
113#define NS_HBUFSIZE 65568
114#define NS_MAX_IOVECS (2 + (65568 - NS_SMBUFSIZE) / \
115 (NS_LGBUFSIZE - (NS_LGBUFSIZE % 48)))
116#define NS_IOVBUFSIZE (NS_MAX_IOVECS * (sizeof(struct iovec)))
117
118#define NS_SMBUFSIZE_USABLE (NS_SMBUFSIZE - NS_SMBUFSIZE % 48)
119#define NS_LGBUFSIZE_USABLE (NS_LGBUFSIZE - NS_LGBUFSIZE % 48)
120
121#define NS_AAL0_HEADER (ATM_AAL0_SDU - ATM_CELL_PAYLOAD)
122
123#define NS_SMSKBSIZE (NS_SMBUFSIZE + NS_AAL0_HEADER)
124#define NS_LGSKBSIZE (NS_SMBUFSIZE + NS_LGBUFSIZE)
125
126
127
128
129
130
131
132
133
134
135
136typedef struct ns_rsqe
137{
138 u32 word_1;
139 u32 buffer_handle;
140 u32 final_aal5_crc32;
141 u32 word_4;
142} ns_rsqe;
143
144#define ns_rsqe_vpi(ns_rsqep) \
145 ((le32_to_cpu((ns_rsqep)->word_1) & 0x00FF0000) >> 16)
146#define ns_rsqe_vci(ns_rsqep) \
147 (le32_to_cpu((ns_rsqep)->word_1) & 0x0000FFFF)
148
149#define NS_RSQE_VALID 0x80000000
150#define NS_RSQE_NZGFC 0x00004000
151#define NS_RSQE_EOPDU 0x00002000
152#define NS_RSQE_BUFSIZE 0x00001000
153#define NS_RSQE_CONGESTION 0x00000800
154#define NS_RSQE_CLP 0x00000400
155#define NS_RSQE_CRCERR 0x00000200
156
157#define NS_RSQE_BUFSIZE_SM 0x00000000
158#define NS_RSQE_BUFSIZE_LG 0x00001000
159
160#define ns_rsqe_valid(ns_rsqep) \
161 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_VALID)
162#define ns_rsqe_nzgfc(ns_rsqep) \
163 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_NZGFC)
164#define ns_rsqe_eopdu(ns_rsqep) \
165 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_EOPDU)
166#define ns_rsqe_bufsize(ns_rsqep) \
167 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_BUFSIZE)
168#define ns_rsqe_congestion(ns_rsqep) \
169 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_CONGESTION)
170#define ns_rsqe_clp(ns_rsqep) \
171 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_CLP)
172#define ns_rsqe_crcerr(ns_rsqep) \
173 (le32_to_cpu((ns_rsqep)->word_4) & NS_RSQE_CRCERR)
174
175#define ns_rsqe_cellcount(ns_rsqep) \
176 (le32_to_cpu((ns_rsqep)->word_4) & 0x000001FF)
177#define ns_rsqe_init(ns_rsqep) \
178 ((ns_rsqep)->word_4 = cpu_to_le32(0x00000000))
179
180#define NS_RSQ_NUM_ENTRIES (NS_RSQSIZE / 16)
181#define NS_RSQ_ALIGNMENT NS_RSQSIZE
182
183
184
185
186
187
188
189
190typedef struct cell_payload
191{
192 u32 word[12];
193} cell_payload;
194
195typedef struct ns_rcqe
196{
197 u32 word_1;
198 u32 word_2;
199 u32 word_3;
200 u32 word_4;
201 cell_payload payload;
202} ns_rcqe;
203
204#define NS_RCQE_SIZE 64
205
206#define ns_rcqe_islast(ns_rcqep) \
207 (le32_to_cpu((ns_rcqep)->word_2) != 0x00000000)
208#define ns_rcqe_cellheader(ns_rcqep) \
209 (le32_to_cpu((ns_rcqep)->word_1))
210#define ns_rcqe_nextbufhandle(ns_rcqep) \
211 (le32_to_cpu((ns_rcqep)->word_2))
212
213
214
215
216
217
218
219
220typedef struct ns_scqe
221{
222 u32 word_1;
223 u32 word_2;
224 u32 word_3;
225 u32 word_4;
226} ns_scqe;
227
228
229
230
231#define NS_SCQE_TYPE_TBD 0x00000000
232#define NS_SCQE_TYPE_TSR 0x80000000
233
234
235#define NS_TBD_EOPDU 0x40000000
236#define NS_TBD_AAL0 0x00000000
237#define NS_TBD_AAL34 0x04000000
238#define NS_TBD_AAL5 0x08000000
239
240#define NS_TBD_VPI_MASK 0x0FF00000
241#define NS_TBD_VCI_MASK 0x000FFFF0
242#define NS_TBD_VC_MASK (NS_TBD_VPI_MASK | NS_TBD_VCI_MASK)
243
244#define NS_TBD_VPI_SHIFT 20
245#define NS_TBD_VCI_SHIFT 4
246
247#define ns_tbd_mkword_1(flags, m, n, buflen) \
248 (cpu_to_le32((flags) | (m) << 23 | (n) << 16 | (buflen)))
249#define ns_tbd_mkword_1_novbr(flags, buflen) \
250 (cpu_to_le32((flags) | (buflen) | 0x00810000))
251#define ns_tbd_mkword_3(control, pdulen) \
252 (cpu_to_le32((control) << 16 | (pdulen)))
253#define ns_tbd_mkword_4(gfc, vpi, vci, pt, clp) \
254 (cpu_to_le32((gfc) << 28 | (vpi) << 20 | (vci) << 4 | (pt) << 1 | (clp)))
255
256
257#define NS_TSR_INTENABLE 0x20000000
258
259#define NS_TSR_SCDISVBR 0xFFFF
260
261#define ns_tsr_mkword_1(flags) \
262 (cpu_to_le32(NS_SCQE_TYPE_TSR | (flags)))
263#define ns_tsr_mkword_2(scdi, scqi) \
264 (cpu_to_le32((scdi) << 16 | 0x00008000 | (scqi)))
265
266#define ns_scqe_is_tsr(ns_scqep) \
267 (le32_to_cpu((ns_scqep)->word_1) & NS_SCQE_TYPE_TSR)
268
269#define VBR_SCQ_NUM_ENTRIES 512
270#define VBR_SCQSIZE 8192
271#define CBR_SCQ_NUM_ENTRIES 64
272#define CBR_SCQSIZE 1024
273
274#define NS_SCQE_SIZE 16
275
276
277
278
279
280
281
282
283typedef struct ns_tsi
284{
285 u32 word_1;
286 u32 word_2;
287} ns_tsi;
288
289
290
291
292
293#define NS_TSI_EMPTY 0x80000000
294#define NS_TSI_TIMESTAMP_MASK 0x00FFFFFF
295
296#define ns_tsi_isempty(ns_tsip) \
297 (le32_to_cpu((ns_tsip)->word_2) & NS_TSI_EMPTY)
298#define ns_tsi_gettimestamp(ns_tsip) \
299 (le32_to_cpu((ns_tsip)->word_2) & NS_TSI_TIMESTAMP_MASK)
300
301#define ns_tsi_init(ns_tsip) \
302 ((ns_tsip)->word_2 = cpu_to_le32(NS_TSI_EMPTY))
303
304
305#define NS_TSQSIZE 8192
306#define NS_TSQ_NUM_ENTRIES 1024
307#define NS_TSQ_ALIGNMENT 8192
308
309
310#define NS_TSI_SCDISVBR NS_TSR_SCDISVBR
311
312#define ns_tsi_tmrof(ns_tsip) \
313 (le32_to_cpu((ns_tsip)->word_1) == 0x00000000)
314#define ns_tsi_getscdindex(ns_tsip) \
315 ((le32_to_cpu((ns_tsip)->word_1) & 0xFFFF0000) >> 16)
316#define ns_tsi_getscqpos(ns_tsip) \
317 (le32_to_cpu((ns_tsip)->word_1) & 0x00007FFF)
318
319
320
321
322
323
324
325
326
327
328
329
330typedef struct ns_rcte
331{
332 u32 word_1;
333 u32 buffer_handle;
334 u32 dma_address;
335 u32 aal5_crc32;
336} ns_rcte;
337
338#define NS_RCTE_BSFB 0x00200000
339#define NS_RCTE_NZGFC 0x00100000
340#define NS_RCTE_CONNECTOPEN 0x00080000
341#define NS_RCTE_AALMASK 0x00070000
342#define NS_RCTE_AAL0 0x00000000
343#define NS_RCTE_AAL34 0x00010000
344#define NS_RCTE_AAL5 0x00020000
345#define NS_RCTE_RCQ 0x00030000
346#define NS_RCTE_RAWCELLINTEN 0x00008000
347#define NS_RCTE_RXCONSTCELLADDR 0x00004000
348#define NS_RCTE_BUFFVALID 0x00002000
349#define NS_RCTE_FBDSIZE 0x00001000
350#define NS_RCTE_EFCI 0x00000800
351#define NS_RCTE_CLP 0x00000400
352#define NS_RCTE_CRCERROR 0x00000200
353#define NS_RCTE_CELLCOUNT_MASK 0x000001FF
354
355#define NS_RCTE_FBDSIZE_SM 0x00000000
356#define NS_RCTE_FBDSIZE_LG 0x00001000
357
358#define NS_RCT_ENTRY_SIZE 4
359
360
361
362
363
364
365
366
367
368
369
370typedef struct ns_fbd
371{
372 u32 buffer_handle;
373 u32 dma_address;
374} ns_fbd;
375
376
377
378
379
380
381
382
383
384typedef u32 ns_tste;
385
386#define NS_TST_OPCODE_MASK 0x60000000
387
388#define NS_TST_OPCODE_NULL 0x00000000
389#define NS_TST_OPCODE_FIXED 0x20000000
390#define NS_TST_OPCODE_VARIABLE 0x40000000
391#define NS_TST_OPCODE_END 0x60000000
392
393#define ns_tste_make(opcode, sramad) (opcode | sramad)
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410typedef struct ns_scd
411{
412 u32 word_1;
413 u32 word_2;
414 u32 partial_aal5_crc;
415 u32 reserved;
416 ns_scqe cache_a;
417 ns_scqe cache_b;
418} ns_scd;
419
420#define NS_SCD_BASE_MASK_VAR 0xFFFFE000
421#define NS_SCD_BASE_MASK_FIX 0xFFFFFC00
422#define NS_SCD_TAIL_MASK_VAR 0x00001FF0
423#define NS_SCD_TAIL_MASK_FIX 0x000003F0
424#define NS_SCD_HEAD_MASK_VAR 0x00001FF0
425#define NS_SCD_HEAD_MASK_FIX 0x000003F0
426#define NS_SCD_XMITFOREVER 0x02000000
427
428
429
430
431
432
433
434
435
436
437#define NS_RCT 0x00000
438#define NS_RCT_32_END 0x03FFF
439#define NS_RCT_128_END 0x0FFFF
440#define NS_UNUSED_32 0x04000
441#define NS_UNUSED_128 0x10000
442#define NS_UNUSED_END 0x1BFFF
443#define NS_TST_FRSCD 0x1C000
444#define NS_TST_FRSCD_END 0x1E7DB
445#define NS_VRSCD2 0x1E7DC
446#define NS_VRSCD2_END 0x1E7E7
447#define NS_VRSCD1 0x1E7E8
448#define NS_VRSCD1_END 0x1E7F3
449#define NS_VRSCD0 0x1E7F4
450#define NS_VRSCD0_END 0x1E7FF
451#define NS_RXFIFO 0x1E800
452#define NS_RXFIFO_END 0x1F7FF
453#define NS_SMFBQ 0x1F800
454#define NS_SMFBQ_END 0x1FBFF
455#define NS_LGFBQ 0x1FC00
456#define NS_LGFBQ_END 0x1FFFF
457
458
459
460
461
462
463
464
465enum ns_regs
466{
467 DR0 = 0x00,
468 DR1 = 0x04,
469 DR2 = 0x08,
470 DR3 = 0x0C,
471 CMD = 0x10,
472 CFG = 0x14,
473 STAT = 0x18,
474 RSQB = 0x1C,
475 RSQT = 0x20,
476 RSQH = 0x24,
477 CDC = 0x28,
478 VPEC = 0x2C,
479 ICC = 0x30,
480 RAWCT = 0x34,
481 TMR = 0x38,
482 TSTB = 0x3C,
483 TSQB = 0x40,
484 TSQT = 0x44,
485 TSQH = 0x48,
486 GP = 0x4C,
487 VPM = 0x50
488};
489
490
491
492
493
494
495
496#define NS_CMD_NO_OPERATION 0x00000000
497
498
499#define NS_CMD_OPENCLOSE_CONNECTION 0x20000000
500
501
502#define NS_CMD_WRITE_SRAM 0x40000000
503
504
505#define NS_CMD_READ_SRAM 0x50000000
506
507
508#define NS_CMD_WRITE_FREEBUFQ 0x60000000
509
510
511#define NS_CMD_READ_UTILITY 0x80000000
512
513
514#define NS_CMD_WRITE_UTILITY 0x90000000
515
516
517#define NS_CMD_OPEN_CONNECTION (NS_CMD_OPENCLOSE_CONNECTION | 0x00080000)
518#define NS_CMD_CLOSE_CONNECTION NS_CMD_OPENCLOSE_CONNECTION
519
520
521
522
523#define NS_CFG_SWRST 0x80000000
524#define NS_CFG_RXPATH 0x20000000
525#define NS_CFG_SMBUFSIZE_MASK 0x18000000
526#define NS_CFG_LGBUFSIZE_MASK 0x06000000
527#define NS_CFG_EFBIE 0x01000000
528
529#define NS_CFG_RSQSIZE_MASK 0x00C00000
530#define NS_CFG_ICACCEPT 0x00200000
531#define NS_CFG_IGNOREGFC 0x00100000
532#define NS_CFG_VPIBITS_MASK 0x000C0000
533#define NS_CFG_RCTSIZE_MASK 0x00030000
534#define NS_CFG_VCERRACCEPT 0x00008000
535#define NS_CFG_RXINT_MASK 0x00007000
536
537#define NS_CFG_RAWIE 0x00000800
538#define NS_CFG_RSQAFIE 0x00000400
539
540#define NS_CFG_RXRM 0x00000200
541#define NS_CFG_TMRROIE 0x00000080
542
543#define NS_CFG_TXEN 0x00000020
544#define NS_CFG_TXIE 0x00000010
545
546#define NS_CFG_TXURIE 0x00000008
547
548#define NS_CFG_UMODE 0x00000004
549#define NS_CFG_TSQFIE 0x00000002
550
551#define NS_CFG_PHYIE 0x00000001
552
553#define NS_CFG_SMBUFSIZE_48 0x00000000
554#define NS_CFG_SMBUFSIZE_96 0x08000000
555#define NS_CFG_SMBUFSIZE_240 0x10000000
556#define NS_CFG_SMBUFSIZE_2048 0x18000000
557
558#define NS_CFG_LGBUFSIZE_2048 0x00000000
559#define NS_CFG_LGBUFSIZE_4096 0x02000000
560#define NS_CFG_LGBUFSIZE_8192 0x04000000
561#define NS_CFG_LGBUFSIZE_16384 0x06000000
562
563#define NS_CFG_RSQSIZE_2048 0x00000000
564#define NS_CFG_RSQSIZE_4096 0x00400000
565#define NS_CFG_RSQSIZE_8192 0x00800000
566
567#define NS_CFG_VPIBITS_0 0x00000000
568#define NS_CFG_VPIBITS_1 0x00040000
569#define NS_CFG_VPIBITS_2 0x00080000
570#define NS_CFG_VPIBITS_8 0x000C0000
571
572#define NS_CFG_RCTSIZE_4096_ENTRIES 0x00000000
573#define NS_CFG_RCTSIZE_8192_ENTRIES 0x00010000
574#define NS_CFG_RCTSIZE_16384_ENTRIES 0x00020000
575
576#define NS_CFG_RXINT_NOINT 0x00000000
577#define NS_CFG_RXINT_NODELAY 0x00001000
578#define NS_CFG_RXINT_314US 0x00002000
579#define NS_CFG_RXINT_624US 0x00003000
580#define NS_CFG_RXINT_899US 0x00004000
581
582
583
584
585#define NS_STAT_SFBQC_MASK 0xFF000000
586#define NS_STAT_LFBQC_MASK 0x00FF0000
587#define NS_STAT_TSIF 0x00008000
588#define NS_STAT_TXICP 0x00004000
589#define NS_STAT_TSQF 0x00001000
590#define NS_STAT_TMROF 0x00000800
591#define NS_STAT_PHYI 0x00000400
592#define NS_STAT_CMDBZ 0x00000200
593#define NS_STAT_SFBQF 0x00000100
594#define NS_STAT_LFBQF 0x00000080
595#define NS_STAT_RSQF 0x00000040
596#define NS_STAT_EOPDU 0x00000020
597#define NS_STAT_RAWCF 0x00000010
598#define NS_STAT_SFBQE 0x00000008
599#define NS_STAT_LFBQE 0x00000004
600#define NS_STAT_RSQAF 0x00000002
601
602#define ns_stat_sfbqc_get(stat) (((stat) & NS_STAT_SFBQC_MASK) >> 23)
603#define ns_stat_lfbqc_get(stat) (((stat) & NS_STAT_LFBQC_MASK) >> 15)
604
605
606
607
608
609
610#define NS_TST0 NS_TST_FRSCD
611#define NS_TST1 (NS_TST_FRSCD + NS_TST_NUM_ENTRIES + 1)
612
613#define NS_FRSCD (NS_TST1 + NS_TST_NUM_ENTRIES + 1)
614#define NS_FRSCD_SIZE 12
615#define NS_FRSCD_NUM ((NS_TST_FRSCD_END + 1 - NS_FRSCD) / NS_FRSCD_SIZE)
616
617#if (NS_SMBUFSIZE == 48)
618#define NS_CFG_SMBUFSIZE NS_CFG_SMBUFSIZE_48
619#elif (NS_SMBUFSIZE == 96)
620#define NS_CFG_SMBUFSIZE NS_CFG_SMBUFSIZE_96
621#elif (NS_SMBUFSIZE == 240)
622#define NS_CFG_SMBUFSIZE NS_CFG_SMBUFSIZE_240
623#elif (NS_SMBUFSIZE == 2048)
624#define NS_CFG_SMBUFSIZE NS_CFG_SMBUFSIZE_2048
625#else
626#error NS_SMBUFSIZE is incorrect in nicstar.h
627#endif
628
629#if (NS_LGBUFSIZE == 2048)
630#define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_2048
631#elif (NS_LGBUFSIZE == 4096)
632#define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_4096
633#elif (NS_LGBUFSIZE == 8192)
634#define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_8192
635#elif (NS_LGBUFSIZE == 16384)
636#define NS_CFG_LGBUFSIZE NS_CFG_LGBUFSIZE_16384
637#else
638#error NS_LGBUFSIZE is incorrect in nicstar.h
639#endif
640
641#if (NS_RSQSIZE == 2048)
642#define NS_CFG_RSQSIZE NS_CFG_RSQSIZE_2048
643#elif (NS_RSQSIZE == 4096)
644#define NS_CFG_RSQSIZE NS_CFG_RSQSIZE_4096
645#elif (NS_RSQSIZE == 8192)
646#define NS_CFG_RSQSIZE NS_CFG_RSQSIZE_8192
647#else
648#error NS_RSQSIZE is incorrect in nicstar.h
649#endif
650
651#if (NS_VPIBITS == 0)
652#define NS_CFG_VPIBITS NS_CFG_VPIBITS_0
653#elif (NS_VPIBITS == 1)
654#define NS_CFG_VPIBITS NS_CFG_VPIBITS_1
655#elif (NS_VPIBITS == 2)
656#define NS_CFG_VPIBITS NS_CFG_VPIBITS_2
657#elif (NS_VPIBITS == 8)
658#define NS_CFG_VPIBITS NS_CFG_VPIBITS_8
659#else
660#error NS_VPIBITS is incorrect in nicstar.h
661#endif
662
663#ifdef RCQ_SUPPORT
664#define NS_CFG_RAWIE_OPT NS_CFG_RAWIE
665#else
666#define NS_CFG_RAWIE_OPT 0x00000000
667#endif
668
669#ifdef ENABLE_TSQFIE
670#define NS_CFG_TSQFIE_OPT NS_CFG_TSQFIE
671#else
672#define NS_CFG_TSQFIE_OPT 0x00000000
673#endif
674
675
676
677
678#ifndef PCI_VENDOR_ID_IDT
679#define PCI_VENDOR_ID_IDT 0x111D
680#endif
681
682#ifndef PCI_DEVICE_ID_IDT_IDT77201
683#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
684#endif
685
686
687
688
689
690
691struct ns_skb_cb {
692 u32 buf_type;
693};
694
695#define NS_SKB_CB(skb) ((struct ns_skb_cb *)((skb)->cb))
696
697typedef struct tsq_info
698{
699 void *org;
700 ns_tsi *base;
701 ns_tsi *next;
702 ns_tsi *last;
703} tsq_info;
704
705
706typedef struct scq_info
707{
708 void *org;
709 ns_scqe *base;
710 ns_scqe *last;
711 ns_scqe *next;
712 volatile ns_scqe *tail;
713 unsigned num_entries;
714 struct sk_buff **skb;
715
716 u32 scd;
717
718 int tbd_count;
719 wait_queue_head_t scqfull_waitq;
720 volatile char full;
721 spinlock_t lock;
722} scq_info;
723
724
725
726typedef struct rsq_info
727{
728 void *org;
729 ns_rsqe *base;
730 ns_rsqe *next;
731 ns_rsqe *last;
732} rsq_info;
733
734
735typedef struct skb_pool
736{
737 volatile int count;
738 struct sk_buff_head queue;
739} skb_pool;
740
741
742
743
744
745
746typedef struct vc_map
747{
748 volatile unsigned int tx:1;
749 volatile unsigned int rx:1;
750 struct atm_vcc *tx_vcc, *rx_vcc;
751 struct sk_buff *rx_iov;
752 scq_info *scq;
753 u32 cbr_scd;
754
755 int tbd_count;
756} vc_map;
757
758
759struct ns_skb_data
760{
761 struct atm_vcc *vcc;
762 int iovcnt;
763};
764
765#define NS_SKB(skb) (((struct ns_skb_data *) (skb)->cb))
766
767
768typedef struct ns_dev
769{
770 int index;
771 int sram_size;
772 void __iomem *membase;
773 unsigned long max_pcr;
774 int rct_size;
775 int vpibits;
776 int vcibits;
777 struct pci_dev *pcidev;
778 struct atm_dev *atmdev;
779 tsq_info tsq;
780 rsq_info rsq;
781 scq_info *scq0, *scq1, *scq2;
782 skb_pool sbpool;
783 skb_pool lbpool;
784 skb_pool hbpool;
785 skb_pool iovpool;
786 volatile int efbie;
787 volatile u32 tst_addr;
788 volatile int tst_free_entries;
789 vc_map vcmap[NS_MAX_RCTSIZE];
790 vc_map *tste2vc[NS_TST_NUM_ENTRIES];
791 vc_map *scd2vc[NS_FRSCD_NUM];
792 buf_nr sbnr;
793 buf_nr lbnr;
794 buf_nr hbnr;
795 buf_nr iovnr;
796 int sbfqc;
797 int lbfqc;
798 u32 sm_handle;
799 u32 sm_addr;
800 u32 lg_handle;
801 u32 lg_addr;
802 struct sk_buff *rcbuf;
803 u32 rawch;
804 unsigned intcnt;
805 spinlock_t int_lock;
806 spinlock_t res_lock;
807} ns_dev;
808
809
810
811
812
813
814
815
816
817
818
819
820#endif
821