1 /**********************************************************************
2 * iph5526.c: Structures for the Interphase 5526 PCI Fibre Channel
4 * Copyright (C) 1999 Vineet M Abraham <vmabraham@hotmail.com>
5 **********************************************************************/
12 u_short payload_length
;
14 u_short est_image_pair
;
21 u_int flags_and_byte_offset
;
23 u_short no_of_recvd_frames
;
24 u_short no_of_expected_frames
;
30 u_short buffer_offset
;
35 u_short max_frame_len
;
37 u_int total_seq_length
;
44 u_short header_length
;
61 u_short lcr_and_time_stamp
;
64 u_int type_and_f_cntl
;
75 u_short service_options
;
76 u_short initiator_ctl
;
77 u_short recipient_ctl
;
78 u_short recv_data_field_size
;
79 u_short concurrent_sequences
;
80 u_short n_port_end_to_end_credit
;
81 u_short open_seq_per_exchange
;
100 u_int node_name_high
;
130 u_int reg_function
; /* in the last byte */
139 u_short cmnd_resp_code
;
140 u_short max_res_size
;
144 u_char vendor_unique
;
150 u_char bit_map
[32]; /* 32 byte bit map */
155 u_short fc_ph_version
;
156 u_short buff_to_buff_credit
;
157 u_short common_features
;
158 u_short recv_data_field_size
;
159 u_short n_port_total_conc_seq
;
160 u_short rel_off_by_info_cat
;
162 u_int n_port_name_high
;
163 u_int n_port_name_low
;
164 u_int node_name_high
;
166 CLASS_OF_SERVICE c_of_s
[3];
168 u_int vendor_version_level
[4];
173 u_int port_type
; /* in the first byte */
182 /* (i)chip Registers */
184 u_int ptr_ichip_hw_control_reg
;
185 u_int ptr_ichip_hw_status_reg
;
186 u_int ptr_ichip_hw_addr_mask_reg
;
189 struct iph5526_novram
{
190 u_int ptr_novram_hw_control_reg
;
191 u_int ptr_novram_hw_status_reg
;
192 u_short data
[IPH5526_NOVRAM_SIZE
];
195 /* Tachyon Registers */
196 struct tachyon_regs
{
197 u_int ptr_ocq_base_reg
;
198 u_int ptr_ocq_len_reg
;
199 u_int ptr_ocq_prod_indx_reg
;
200 u_int ptr_ocq_cons_indx_reg
;
202 u_int ptr_imq_base_reg
;
203 u_int ptr_imq_len_reg
;
204 u_int ptr_imq_cons_indx_reg
;
205 u_int ptr_imq_prod_indx_reg
;
207 u_int ptr_mfsbq_base_reg
;
208 u_int ptr_mfsbq_len_reg
;
209 u_int ptr_mfsbq_prod_reg
;
210 u_int ptr_mfsbq_cons_reg
;
211 u_int ptr_mfsbuff_len_reg
;
213 u_int ptr_sfsbq_base_reg
;
214 u_int ptr_sfsbq_len_reg
;
215 u_int ptr_sfsbq_prod_reg
;
216 u_int ptr_sfsbq_cons_reg
;
217 u_int ptr_sfsbuff_len_reg
;
219 u_int ptr_sest_base_reg
;
220 u_int ptr_sest_len_reg
;
221 u_int ptr_scsibuff_len_reg
;
223 u_int ptr_tach_config_reg
;
224 u_int ptr_tach_control_reg
;
225 u_int ptr_tach_status_reg
;
226 u_int ptr_tach_flush_oxid_reg
;
228 u_int ptr_fm_config_reg
;
229 u_int ptr_fm_control_reg
;
230 u_int ptr_fm_status_reg
;
231 u_int ptr_fm_tov_reg
;
232 u_int ptr_fm_wwn_hi_reg
;
233 u_int ptr_fm_wwn_low_reg
;
234 u_int ptr_fm_rx_al_pa_reg
;
240 u_short ox_id
; /* OX_ID used for IP and ELS frames */
241 u_short scsi_oxid
; /* OX_ID for SEST entry */
244 u_int my_ddaa
; /* my domain and area in a fabric */
245 volatile u_char loop_up
;
246 volatile u_char ptp_up
; /* we have a point-to-point link */
247 volatile u_char link_up
;
248 volatile u_char n_port_try
;
249 volatile u_char nport_timer_set
;
250 volatile u_char lport_timer_set
;
251 /* Hmmm... We don't want to Initialize while closing */
253 u_int my_node_name_high
;
254 u_int my_node_name_low
;
255 u_int my_port_name_high
;
256 u_int my_port_name_low
;
257 u_char fabric_present
;
258 u_char explore_fabric
;
261 u_int
*els_buffer
[MAX_PENDING_FRAMES
]; /* temp space for ELS frames */
262 char *arp_buffer
; /* temp space for ARP frames */
263 u_int mfs_buffer_count
; /* keep track of MFS buffers used*/
264 u_char scsi_registered
;
265 /* variables for port discovery */
266 volatile u_char port_discovery
;
267 volatile u_char perform_adisc
;
268 u_short alpa_list_index
;
269 u_short type_of_frame
; /* Could be IP/SCSI Read/SCSI Write*/
270 u_char no_of_targets
; /* used to assign target_ids */
271 u_long sem
; /* to synchronize between IP and SCSI */
275 TACHYON_HEADER tach_header
;
282 INB_SEST_ENTRY inb_sest_entry
;
283 OUTB_SEST_ENTRY outb_sest_entry
;
291 struct queue_variables
{
292 /* Indices maintained in host memory.
294 u_int
*host_ocq_cons_indx
, *host_hpcq_cons_indx
, *host_imq_prod_indx
;
295 u_int
*ptr_host_ocq_cons_indx
, *ptr_host_hpcq_cons_indx
, *ptr_host_imq_prod_indx
;
297 /* Variables for Outbound Command Queue (OCQ).
300 u_int ocq_len
, ocq_end
;
302 u_int
*ptr_odb
[OCQ_LENGTH
];
304 /* Variables for Inbound Message Queue (IMQ).
307 u_int imq_len
, imq_end
;
310 u_int
*ptr_imqe
[IMQ_LENGTH
];
312 u_int
*ptr_mfsbq_base
;
313 u_int mfsbq_len
, mfsbq_end
;
314 u_int mfsbq_prod_indx
;
315 u_int mfsbq_cons_indx
;
316 u_int mfsbuff_len
, mfsbuff_end
;
318 u_int
*ptr_sfsbq_base
;
319 u_int sfsbq_len
, sfsbq_end
;
320 u_int sfsbq_prod_indx
;
321 u_int sfsbq_cons_indx
;
322 u_int sfsbuff_len
, sfsbuff_end
;
323 u_int
*ptr_sfs_buffers
[SFSBQ_LENGTH
* NO_OF_ENTRIES
];
325 /* Tables for SCSI Transactions */
326 u_int
*ptr_sest_base
;
327 u_int
*ptr_sest
[SEST_LENGTH
];
328 u_char free_scsi_oxid
[SEST_LENGTH
];
330 u_int
*ptr_sdb_slot
[NO_OF_SDB_ENTRIES
];
331 u_char sdb_slot_status
[NO_OF_SDB_ENTRIES
];
333 u_int
*ptr_fcp_cmnd_base
;
334 u_int
*ptr_fcp_cmnd
[NO_OF_FCP_CMNDS
];
337 /* Table for data to be transmitted.
340 u_int
*ptr_edb
[EDB_LEN
];
341 u_int edb_buffer_indx
;
342 volatile u_char free_edb_list
[EDB_LEN
];
344 /* Table of Tachyon Headers.
346 u_int
*ptr_tachyon_header
[NO_OF_TACH_HEADERS
];
347 u_int
*ptr_tachyon_header_base
;
348 u_int tachyon_header_indx
;
351 /* Used to match incoming ACCs to ELS requests sent out */
352 struct ox_id_els_map
{
355 struct ox_id_els_map
*next
;
359 /* Carries info about individual nodes... stores the info got at login
360 * time. Also maintains mapping between MAC->FC addresses
362 struct fc_node_info
{
363 /* Itz the WWN (8 bytes), the last 6 bytes is the MAC address */
364 u_char hw_addr
[PORT_NAME_LEN
];
365 u_char node_name
[NODE_NAME_LEN
];
366 u_int d_id
; /*real FC address, 3 bytes */
368 /* login = 1 if login attempted
369 * login = 2 if login completed
372 u_char scsi
; /* = 1 if device is a SCSI Target */
374 CLASS_OF_SERVICE c_of_s
[3];
375 struct fc_node_info
*next
;
382 struct net_device_stats fc_stats
;
383 struct fc_node_info
*node_info_list
;
385 struct ox_id_els_map
*ox_id_list
;
386 struct i_chip_regs i_r
;
387 struct tachyon_regs t_r
;
388 struct queue_variables q
;
390 struct iph5526_novram n_r
;
392 struct timer_list nport_timer
;
393 struct timer_list lport_timer
;
394 struct timer_list explore_timer
;
395 struct timer_list display_cache_timer
;
396 struct net_device
*dev
;
397 struct Scsi_Host
*host
;
401 struct iph5526_hostdata
{
404 Scsi_Cmnd
*cmnd_handler
[SEST_LENGTH
];
405 u_int tag_ages
[MAX_SCSI_TARGETS
];
408 /* List of valid AL_PAs */
409 u_char alpa_list
[127] = {
410 0x00, 0x01, 0x02, 0x04, 0x08, 0x0F, 0x10, 0x17,
411 0x18, 0x1B, 0x1D, 0x1E, 0x1F, 0x23, 0x25, 0x26,
412 0x27, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x31,
413 0x32, 0x33, 0x34, 0x35, 0x36, 0x39, 0x3A, 0x3C,
414 0x43, 0x45, 0x46, 0x47, 0x49, 0x4A, 0x4B, 0x4C,
415 0x4D, 0x4E, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
416 0x59, 0x5A, 0x5C, 0x63, 0x65, 0x66, 0x67, 0x69,
417 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x71, 0x72, 0x73,
418 0x74, 0x75, 0x76, 0x79, 0x7A, 0x7C, 0x80, 0x81,
419 0x82, 0x84, 0x88, 0x8F, 0x90, 0x97, 0x98, 0x9B,
420 0x9D, 0x9E, 0x9F, 0xA3, 0xA5, 0xA6, 0xA7, 0xA9,
421 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xB1, 0xB2, 0xB3,
422 0xB4, 0xB5, 0xB6, 0xB9, 0xBA, 0xBC, 0xC3, 0xC5,
423 0xC6, 0xC7, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE,
424 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD9, 0xDA,
425 0xDC, 0xE0, 0xE1, 0xE2, 0xE4, 0xE8, 0xEF
428 #endif /* _TACH_STRUCT_H */