-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathqla2xip.h
80 lines (66 loc) · 2.8 KB
/
qla2xip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* QLogic QLogic ISP2x00 IP network driver
* Copyright (c) 2003-2005 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/****************************************************************************
Please see revision.notes for revision history.
*****************************************************************************/
#if !defined(_QLA2XIP_H_)
#define _QLA2XIP_H_
#define WWN_SIZE 8
#define MAX_ADAPTER_COUNT 8 /* Maximum adapters supported */
#define MAX_MTU_SIZE 65280 /* Maximum MTU size */
#define MIN_MTU_SIZE 100 /* Minimum MTU size */
#define DEFAULT_MTU_SIZE 4096 /* Default MTU size */
#define DEFAULT_BUFFER_SIZE (DEFAULT_MTU_SIZE + sizeof(PACKET_HEADER))
#define DEFAULT_RECEIVE_BUFFERS 32 /* Default number of receive buffers */
#define RECEIVE_BUFFERS_LOW_MARK 16 /* Receive buffers low water mark */
#define RECEIVE_BUFFERS_ADD_MARK 10 /* Receive buffers add mark */
#define DEFAULT_HEADER_SPLIT 0 /* Default header split size (== 0) */
#define LSD(x) ((uint32_t)((uint64_t)(x)))
#define MSD(x) ((uint32_t)((((uint64_t)(x)) >> 16) >> 16))
/*
* Struct private for the QLogic IP adapter
*/
struct qla2xip_private {
/* Net device members */
struct net_device *next;
spinlock_t lock;
struct net_device_stats stats; /* Device statistics */
struct net_device *dev; /* Parent NET device */
uint32_t mtu; /* Maximum transfer unit */
uint16_t header_size; /* Split header size */
/* Send control block queue */
struct send_cb *send_q[MAX_SEND_PACKETS + 1];
uint16_t send_q_in; /* free in-pointer */
uint16_t send_q_out; /* free out-pointer */
/* Send control block array */
struct send_cb send_buffers[MAX_SEND_PACKETS];
struct packet_header *scb_header;
dma_addr_t scb_header_dma;
/* Inquiry data from SCSI driver */
unsigned long options; /* QLA2X00 supported options */
void *ha; /* Driver ha pointer */
uint16_t link_speed; /* Link speed */
uint8_t port_name[WWN_SIZE]; /* Adapter port name */
struct pci_dev *pdev; /* PCI device information */
/* Pointers to SCSI-backdoor callbacks */
int (*ip_enable_routine) (void *, struct bd_enable *);
int (*ip_disable_routine) (void *);
int (*ip_add_buffers_routine) (void *, uint16_t, int);
int (*ip_send_packet_routine) (void *, struct send_cb *);
int (*ip_tx_timeout_routine) (void *);
/* RISC receive queue */
uint16_t receive_q_size; /* size */
struct risc_rec_entry *receive_q; /* pointer */
struct risc_rec_entry *receive_q_in; /* in-pointer */
struct risc_rec_entry *receive_q_end; /* end-pointer */
uint16_t receive_q_cnt; /* current buffer count */
uint16_t receive_q_add_cnt; /* buffers to be added */
struct buffer_cb receive_buffers[MAX_RECEIVE_BUFFERS];
uint16_t max_receive_buffers; /* maximum # receive buffers */
uint32_t receive_buff_data_size; /* data size */
};
#endif