bfa_fcs_auth.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  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
  11. *
  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.
  16. */
  17. #ifndef __BFA_FCS_AUTH_H__
  18. #define __BFA_FCS_AUTH_H__
  19. struct bfa_fcs_s;
  20. #include <defs/bfa_defs_status.h>
  21. #include <defs/bfa_defs_auth.h>
  22. #include <defs/bfa_defs_vf.h>
  23. #include <cs/bfa_q.h>
  24. #include <cs/bfa_sm.h>
  25. #include <defs/bfa_defs_pport.h>
  26. #include <fcs/bfa_fcs_lport.h>
  27. #include <protocol/fc_sp.h>
  28. struct bfa_fcs_fabric_s;
  29. struct bfa_fcs_auth_s {
  30. bfa_sm_t sm; /* state machine */
  31. bfa_boolean_t policy; /* authentication enabled/disabled */
  32. enum bfa_auth_status status; /* authentication status */
  33. enum auth_rjt_codes rjt_code; /* auth reject status */
  34. enum auth_rjt_code_exps rjt_code_exp; /* auth reject reason */
  35. enum bfa_auth_algo algo; /* Authentication algorithm */
  36. struct bfa_auth_stats_s stats; /* Statistics */
  37. enum auth_dh_gid group; /* DH(diffie-hellman) Group */
  38. enum bfa_auth_secretsource source; /* Secret source */
  39. char secret[BFA_AUTH_SECRET_STRING_LEN];
  40. /* secret string */
  41. u8 secret_len;
  42. /* secret string length */
  43. u8 nretries;
  44. /* number of retries */
  45. struct bfa_fcs_fabric_s *fabric;/* pointer to fabric */
  46. u8 sentcode; /* pointer to response data */
  47. u8 *response; /* pointer to response data */
  48. struct bfa_timer_s delay_timer; /* delay timer */
  49. struct bfa_fcxp_s *fcxp; /* pointer to fcxp */
  50. struct bfa_fcxp_wqe_s fcxp_wqe;
  51. };
  52. /**
  53. * bfa fcs authentication public functions
  54. */
  55. bfa_status_t bfa_fcs_auth_get_attr(struct bfa_fcs_s *port,
  56. struct bfa_auth_attr_s *attr);
  57. bfa_status_t bfa_fcs_auth_set_policy(struct bfa_fcs_s *port,
  58. bfa_boolean_t policy);
  59. enum bfa_auth_status bfa_fcs_auth_get_status(struct bfa_fcs_s *port);
  60. bfa_status_t bfa_fcs_auth_set_algo(struct bfa_fcs_s *port,
  61. enum bfa_auth_algo algo);
  62. bfa_status_t bfa_fcs_auth_get_stats(struct bfa_fcs_s *port,
  63. struct bfa_auth_stats_s *stats);
  64. bfa_status_t bfa_fcs_auth_set_dh_group(struct bfa_fcs_s *port, int group);
  65. bfa_status_t bfa_fcs_auth_set_secretstring(struct bfa_fcs_s *port,
  66. char *secret);
  67. bfa_status_t bfa_fcs_auth_set_secretstring_encrypt(struct bfa_fcs_s *port,
  68. u32 secret[], u32 len);
  69. bfa_status_t bfa_fcs_auth_set_secretsource(struct bfa_fcs_s *port,
  70. enum bfa_auth_secretsource src);
  71. bfa_status_t bfa_fcs_auth_reset_stats(struct bfa_fcs_s *port);
  72. bfa_status_t bfa_fcs_auth_reinit(struct bfa_fcs_s *port);
  73. #endif /* __BFA_FCS_AUTH_H__ */