1 /* sbni.h: definitions for a Granch SBNI12 driver, version 5.0.0
2 * Written 2001 Denis I.Timofeev (timofeev@granch.ru)
3 * This file is distributed under the GNU GPL
16 /* We don't have official vendor id yet... */
17 #define SBNI_PCI_VENDOR 0x55
18 #define SBNI_PCI_DEVICE 0x9f
23 #define SBNI_IO_EXTENT 4
47 #ifdef __LITTLE_ENDIAN_BITFIELD
58 /* fields in frame header */
59 #define FRAME_ACK_MASK (unsigned short)0x7000
60 #define FRAME_LEN_MASK (unsigned short)0x03FF
61 #define FRAME_FIRST (unsigned short)0x8000
62 #define FRAME_RETRY (unsigned short)0x0800
64 #define FRAME_SENT_BAD (unsigned short)0x4000
65 #define FRAME_SENT_OK (unsigned short)0x3000
71 FL_NEED_RESEND
= 0x02,
75 #ifdef CONFIG_SBNI_MULTILINE
83 DEFAULT_IOBASEADDR
= 0x210,
84 DEFAULT_INTERRUPTNUMBER
= 5,
86 DEFAULT_FRAME_LEN
= 1012
89 #define DEF_RXL_DELTA -1
94 #define SBNI_MIN_LEN 60 /* Shortest Ethernet frame without FCS */
95 #define SBNI_MAX_FRAME 1023
96 #define ETHER_MAX_LEN 1518
98 #define SBNI_TIMEOUT (HZ/10)
100 #define TR_ERROR_COUNT 32
101 #define CHANGE_LEVEL_START_TICKS 4
103 #define SBNI_MAX_NUM_CARDS 16
105 /* internal SBNI-specific statistics */
106 struct sbni_in_stats
{
111 u32 resend_tx_number
;
114 /* SBNI ioctl params */
115 #define SIOCDEVGETINSTATS SIOCDEVPRIVATE
116 #define SIOCDEVRESINSTATS SIOCDEVPRIVATE+1
117 #define SIOCDEVGHWSTATE SIOCDEVPRIVATE+2
118 #define SIOCDEVSHWSTATE SIOCDEVPRIVATE+3
119 #define SIOCDEVENSLAVE SIOCDEVPRIVATE+4
120 #define SIOCDEVEMANSIPATE SIOCDEVPRIVATE+5
123 /* data packet for SIOCDEVGHWSTATE/SIOCDEVSHWSTATE ioctl requests */
135 #define CRC32(c,crc) (crc32tab[((size_t)(crc) ^ (c)) & 0xff] ^ (((crc) >> 8) & 0x00FFFFFF))
136 /* CRC generator 0xEDB88320 */
137 /* CRC remainder 0x2144DF1C */
138 /* CRC initial value 0x00000000 */
139 #define CRC32_REMAINDER 0x2144DF1C
140 #define CRC32_INITIAL 0x00000000