2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
18 #ifndef __BFA_FCS_AUTH_H__
19 #define __BFA_FCS_AUTH_H__
23 #include <defs/bfa_defs_status.h>
24 #include <defs/bfa_defs_auth.h>
25 #include <defs/bfa_defs_vf.h>
27 #include <cs/bfa_sm.h>
28 #include <defs/bfa_defs_pport.h>
29 #include <fcs/bfa_fcs_lport.h>
30 #include <protocol/fc_sp.h>
32 struct bfa_fcs_fabric_s
;
36 struct bfa_fcs_auth_s
{
37 bfa_sm_t sm
; /* state machine */
38 bfa_boolean_t policy
; /* authentication enabled/disabled */
39 enum bfa_auth_status status
; /* authentication status */
40 enum auth_rjt_codes rjt_code
; /* auth reject status */
41 enum auth_rjt_code_exps rjt_code_exp
; /* auth reject reason */
42 enum bfa_auth_algo algo
; /* Authentication algorithm */
43 struct bfa_auth_stats_s stats
; /* Statistics */
44 enum auth_dh_gid group
; /* DH(diffie-hellman) Group */
45 enum bfa_auth_secretsource source
; /* Secret source */
46 char secret
[BFA_AUTH_SECRET_STRING_LEN
];
49 /* secret string length */
51 /* number of retries */
52 struct bfa_fcs_fabric_s
*fabric
;/* pointer to fabric */
53 u8 sentcode
; /* pointer to response data */
54 u8
*response
; /* pointer to response data */
55 struct bfa_timer_s delay_timer
; /* delay timer */
56 struct bfa_fcxp_s
*fcxp
; /* pointer to fcxp */
57 struct bfa_fcxp_wqe_s fcxp_wqe
;
61 * bfa fcs authentication public functions
63 bfa_status_t
bfa_fcs_auth_get_attr(struct bfa_fcs_s
*port
,
64 struct bfa_auth_attr_s
*attr
);
65 bfa_status_t
bfa_fcs_auth_set_policy(struct bfa_fcs_s
*port
,
66 bfa_boolean_t policy
);
67 enum bfa_auth_status
bfa_fcs_auth_get_status(struct bfa_fcs_s
*port
);
68 bfa_status_t
bfa_fcs_auth_set_algo(struct bfa_fcs_s
*port
,
69 enum bfa_auth_algo algo
);
70 bfa_status_t
bfa_fcs_auth_get_stats(struct bfa_fcs_s
*port
,
71 struct bfa_auth_stats_s
*stats
);
72 bfa_status_t
bfa_fcs_auth_set_dh_group(struct bfa_fcs_s
*port
, int group
);
73 bfa_status_t
bfa_fcs_auth_set_secretstring(struct bfa_fcs_s
*port
,
75 bfa_status_t
bfa_fcs_auth_set_secretstring_encrypt(struct bfa_fcs_s
*port
,
76 u32 secret
[], u32 len
);
77 bfa_status_t
bfa_fcs_auth_set_secretsource(struct bfa_fcs_s
*port
,
78 enum bfa_auth_secretsource src
);
79 bfa_status_t
bfa_fcs_auth_reset_stats(struct bfa_fcs_s
*port
);
80 bfa_status_t
bfa_fcs_auth_reinit(struct bfa_fcs_s
*port
);
82 #endif /* __BFA_FCS_AUTH_H__ */