ispvar.h (288712) | ispvar.h (288714) |
---|---|
1/* $FreeBSD: stable/10/sys/dev/isp/ispvar.h 288712 2015-10-05 08:29:31Z mav $ */ | 1/* $FreeBSD: stable/10/sys/dev/isp/ispvar.h 288714 2015-10-05 08:31:48Z mav $ */ |
2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 361 unchanged lines hidden (view full) --- 371 * departed). Then we're done and can resume normal operations. 372 * 373 * Negative invariants that we try and test for are: 374 * 375 * + There can never be two non-NIL entries with the same { Port, Node } WWN 376 * duples. 377 * 378 * + There can never be two non-NIL entries with the same handle. | 2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 361 unchanged lines hidden (view full) --- 371 * departed). Then we're done and can resume normal operations. 372 * 373 * Negative invariants that we try and test for are: 374 * 375 * + There can never be two non-NIL entries with the same { Port, Node } WWN 376 * duples. 377 * 378 * + There can never be two non-NIL entries with the same handle. |
379 * 380 * + There can never be two non-NIL entries which have the same dev_map_idx 381 * value. | |
382 */ 383typedef struct { 384 /* 385 * This is the handle that the firmware needs in order for us to 386 * send commands to the device. For pre-24XX cards, this would be 387 * the 'loopid'. 388 */ 389 uint16_t handle; 390 391 /* | 379 */ 380typedef struct { 381 /* 382 * This is the handle that the firmware needs in order for us to 383 * send commands to the device. For pre-24XX cards, this would be 384 * the 'loopid'. 385 */ 386 uint16_t handle; 387 388 /* |
392 * The dev_map_idx, if nonzero, is the system virtual target ID (+1) 393 * | |
394 * A device is 'autologin' if the firmware automatically logs into 395 * it (re-logins as needed). Basically, local private loop devices. 396 * 397 * PRLI word 3 parameters contains role as well as other things. 398 * 399 * The state is the current state of this entry. 400 * | 389 * A device is 'autologin' if the firmware automatically logs into 390 * it (re-logins as needed). Basically, local private loop devices. 391 * 392 * PRLI word 3 parameters contains role as well as other things. 393 * 394 * The state is the current state of this entry. 395 * |
396 * The is_target is the current state of target on this port. 397 * 398 * The is_initiator is the current state of initiator on this port. 399 * |
|
401 * Portid is obvious, as are node && port WWNs. The new_role and 402 * new_portid is for when we are pending a change. | 400 * Portid is obvious, as are node && port WWNs. The new_role and 401 * new_portid is for when we are pending a change. |
403 * 404 * The 'target_mode' tag means that this entry arrived via a 405 * target mode command and is immune from normal flushing rules. 406 * You should also never see anything with an initiator role 407 * with this set. | |
408 */ 409 uint16_t prli_word3; /* PRLI parameters */ 410 uint16_t new_prli_word3; /* Incoming new PRLI parameters */ | 402 */ 403 uint16_t prli_word3; /* PRLI parameters */ 404 uint16_t new_prli_word3; /* Incoming new PRLI parameters */ |
411 uint16_t dev_map_idx : 12, | 405 uint16_t : 12, |
412 autologin : 1, /* F/W does PLOGI/PLOGO */ 413 state : 3; | 406 autologin : 1, /* F/W does PLOGI/PLOGO */ 407 state : 3; |
414 uint32_t : 7, 415 target_mode : 1, | 408 uint32_t : 6, 409 is_target : 1, 410 is_initiator : 1, |
416 portid : 24; 417 uint32_t | 411 portid : 24; 412 uint32_t |
418 : 5, 419 reported_gone : 1, 420 announced : 1, 421 dirty : 1, /* commands have been run */ | 413 : 8, |
422 new_portid : 24; 423 uint64_t node_wwn; 424 uint64_t port_wwn; 425 uint32_t gone_timer; 426} fcportdb_t; 427 428#define FC_PORTDB_STATE_NIL 0 429#define FC_PORTDB_STATE_PROBATIONAL 1 430#define FC_PORTDB_STATE_DEAD 2 431#define FC_PORTDB_STATE_CHANGED 3 432#define FC_PORTDB_STATE_NEW 4 433#define FC_PORTDB_STATE_PENDING_VALID 5 434#define FC_PORTDB_STATE_ZOMBIE 6 435#define FC_PORTDB_STATE_VALID 7 436 | 414 new_portid : 24; 415 uint64_t node_wwn; 416 uint64_t port_wwn; 417 uint32_t gone_timer; 418} fcportdb_t; 419 420#define FC_PORTDB_STATE_NIL 0 421#define FC_PORTDB_STATE_PROBATIONAL 1 422#define FC_PORTDB_STATE_DEAD 2 423#define FC_PORTDB_STATE_CHANGED 3 424#define FC_PORTDB_STATE_NEW 4 425#define FC_PORTDB_STATE_PENDING_VALID 5 426#define FC_PORTDB_STATE_ZOMBIE 6 427#define FC_PORTDB_STATE_VALID 7 428 |
429#define FC_PORTDB_TGT(isp, bus, pdb) (int)(lp - FCPARAM(isp, bus)->portdb) 430 |
|
437/* 438 * FC card specific information 439 * 440 * This structure is replicated across multiple channels for multi-id 441 * capapble chipsets, with some entities different on a per-channel basis. 442 */ 443 444typedef struct { --- 35 unchanged lines hidden (view full) --- 480 uint64_t isp_wwnn_nvram; 481 uint64_t isp_wwpn_nvram; 482 483 /* 484 * Our Port Data Base 485 */ 486 fcportdb_t portdb[MAX_FC_TARG]; 487 | 431/* 432 * FC card specific information 433 * 434 * This structure is replicated across multiple channels for multi-id 435 * capapble chipsets, with some entities different on a per-channel basis. 436 */ 437 438typedef struct { --- 35 unchanged lines hidden (view full) --- 474 uint64_t isp_wwnn_nvram; 475 uint64_t isp_wwpn_nvram; 476 477 /* 478 * Our Port Data Base 479 */ 480 fcportdb_t portdb[MAX_FC_TARG]; 481 |
488#ifdef ISP_TARGET_MODE | |
489 /* | 482 /* |
490 * This maps N-Port Handle to portdb entry so we 491 * don't have to search for every incoming command. 492 * 493 * The mapping function is to take any non-zero entry and 494 * subtract one to get the portdb index. This means that 495 * entries which are zero are unmapped (i.e., don't exist). 496 */ 497 uint16_t isp_tgt_map[MAX_NPORT_HANDLE]; 498#endif 499 500 /* | |
501 * Scratch DMA mapped in area to fetch Port Database stuff, etc. 502 */ 503 void * isp_scratch; 504 XS_DMA_ADDR_T isp_scdma; 505} fcparam; 506 507#define FW_CONFIG_WAIT 0 508#define FW_WAIT_AL_PA 1 --- 326 unchanged lines hidden (view full) --- 835/* 836 * Initialize Hardware to known state 837 */ 838void isp_init(ispsoftc_t *); 839 840/* 841 * Reset the ISP and call completion for any orphaned commands. 842 */ | 483 * Scratch DMA mapped in area to fetch Port Database stuff, etc. 484 */ 485 void * isp_scratch; 486 XS_DMA_ADDR_T isp_scdma; 487} fcparam; 488 489#define FW_CONFIG_WAIT 0 490#define FW_WAIT_AL_PA 1 --- 326 unchanged lines hidden (view full) --- 817/* 818 * Initialize Hardware to known state 819 */ 820void isp_init(ispsoftc_t *); 821 822/* 823 * Reset the ISP and call completion for any orphaned commands. 824 */ |
843void isp_reinit(ispsoftc_t *, int); | 825int isp_reinit(ispsoftc_t *, int); |
844 845/* 846 * Internal Interrupt Service Routine 847 * 848 * The outer layers do the spade work to get the appropriate status register, 849 * semaphore register and first mailbox register (if appropriate). This also 850 * means that most spurious/bogus interrupts not for us can be filtered first. 851 */ --- 338 unchanged lines hidden --- | 826 827/* 828 * Internal Interrupt Service Routine 829 * 830 * The outer layers do the spade work to get the appropriate status register, 831 * semaphore register and first mailbox register (if appropriate). This also 832 * means that most spurious/bogus interrupts not for us can be filtered first. 833 */ --- 338 unchanged lines hidden --- |